WO2020220746A1 - 一种基于区块链的结算方法、装置以及电子设备 - Google Patents

一种基于区块链的结算方法、装置以及电子设备 Download PDF

Info

Publication number
WO2020220746A1
WO2020220746A1 PCT/CN2020/070848 CN2020070848W WO2020220746A1 WO 2020220746 A1 WO2020220746 A1 WO 2020220746A1 CN 2020070848 W CN2020070848 W CN 2020070848W WO 2020220746 A1 WO2020220746 A1 WO 2020220746A1
Authority
WO
WIPO (PCT)
Prior art keywords
payment
transaction
write
blockchain
cumulative
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.)
Ceased
Application number
PCT/CN2020/070848
Other languages
English (en)
French (fr)
Inventor
王旭
冯照临
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to US16/803,720 priority Critical patent/US10991045B2/en
Publication of WO2020220746A1 publication Critical patent/WO2020220746A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION 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/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION 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/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a settlement method, device, and electronic device based on blockchain.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices participate in "bookkeeping" and jointly maintain a complete distributed database. Because the blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and the rapid data synchronization between computing devices, the blockchain technology has been widely used in many fields. To apply.
  • this specification provides a blockchain-based settlement method, device and electronic equipment.
  • a blockchain-based settlement method is provided, the method is applied to a payment system docked with the blockchain, and the method includes:
  • the target payment payment transaction In response to the monitored payment settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction of the deposit certificate on the blockchain according to the payment payment sequence; and, by The payment and write-off transaction of the deposit certificate on the blockchain constitutes the target payment and write-off transaction corresponding to the end node of the payment and write-off transaction chain list according to the payment and write-off sequence; wherein, the payment and payment transaction includes the payment and payment transaction The unsettled transactions in the linked list are accumulated to the corresponding cumulative value of the payment transaction; the payment and write-off transaction includes the cumulative value of the unsettled transactions in the linked list of the payment and write-off transactions accumulated to the payment transaction;
  • the fund settlement is performed based on the accumulated value in the target payment transaction or the target payment transaction.
  • the payment payment transaction in the payment payment transaction chain list is deposited in the following way:
  • the payment message carries payment information
  • the publishing of the payment transaction to the blockchain for deposit certification includes:
  • the payment transaction is posted to the blockchain for deposit.
  • the cumulative value of the payment transaction includes: a total cumulative payment amount and a total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the payment payment transaction further includes: a hash pointer that points to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payment system maintains the total cumulative payment amount and the total number of cumulative payments in the payment transaction corresponding to the end node of the linked list of the payment payment transaction chain;
  • the constructing a fee payment transaction based on the payment information includes:
  • the payment payment transaction is constructed.
  • the method further includes:
  • the total accumulated payment amount and the total number of accumulated payments recorded in the payment transaction are used, and the total accumulated payment amount and the total number of accumulated payments maintained by the payment system are updated respectively.
  • the method further includes:
  • the total accumulated payment amount and the total number of accumulated payments maintained by the payment system are cleared to zero.
  • the method further includes:
  • a blockchain-based settlement method is provided, the method is applied to a payee system docked with the blockchain, and the method includes:
  • a settlement request transaction is constructed based on the settlement request
  • the payment system monitors the payment settlement request transaction that the payee system deposits in the blockchain; respond to the monitored payment Settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction deposited on the blockchain according to the payment payment order; and, deposit the certificate on the blockchain
  • the target payment and write-off transaction corresponding to the end node of the linked list of payment and write-off transactions constituted by the payment and write-off sequence; determine whether the target payment transaction and the target payment and write-off transaction have the same cumulative value; If they are the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment write-off transaction;
  • the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list accumulated to the corresponding cumulative value of the payment payment transaction; the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list Accumulate to the accumulated value corresponding to the payment transaction.
  • the payment and write-off transaction are deposited in the following ways:
  • the payment and write-off transaction is constructed, and the payment and write-off transaction are published to the blockchain for deposit.
  • the cumulative value of the payment transaction includes: a total cumulative payment amount and a total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the payment payment transaction further includes: a hash pointer that points to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payee system maintains the cumulative total amount of write-offs and the total number of cumulative write-offs in the payment and write-off transactions corresponding to the tail node of the linked list of the payment and write-off transactions;
  • the construction of a payment and write-off transaction based on the result of payment and write-off includes:
  • the hash pointer of the payment and write-off transaction corresponding to the tail node of the linked list, the hash pointer of the payment and payment transaction, the total amount of the cumulative write-off in the payment and write-off transaction and the cumulative write-off The total number of transactions to construct payment and write-off transactions.
  • the posting of the payment and write-off transaction to the blockchain for deposit certification includes:
  • the method further includes:
  • the accumulated total written-off amount and the accumulated total number of written-offs maintained by the payee system are updated.
  • the method further includes:
  • the total accumulated amount of written-off accounts and the total number of accumulated written-offs maintained by the payee system are cleared to zero.
  • a blockchain-based settlement device is provided, the device is applied to a payment system docked with the blockchain, and the device includes:
  • the monitoring unit is used to monitor the settlement request transaction that the payee system deposits in the blockchain
  • the first acquiring unit is configured to, in response to the monitored payment settlement request transaction, acquire the target corresponding to the end node of the list of the payment transaction chain formed by the payment payment transaction deposited on the blockchain according to the payment order.
  • Payment transaction ; and, the target payment write-off transaction corresponding to the end node of the list of the payment write-off transaction chain formed by the payment and write-off transaction of the deposit certificate on the blockchain according to the payment and write-off sequence; wherein, the payment payment The transaction includes the accumulated value corresponding to the unsettled transaction in the linked list of payment and payment transactions accumulated to the payment transaction; the transaction of payment and write-off includes the accumulation of unsettled transactions in the linked list of payment and write-off transactions to the payment transaction The corresponding accumulated value at time;
  • a determining unit configured to determine whether the accumulated value of the target payment transaction and the target payment write-off transaction are the same
  • the settlement unit is configured to, if the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment transaction.
  • the device further includes:
  • the second acquiring unit is configured to acquire a payment message sent by the user terminal; the payment message carries payment information;
  • the first construction unit is configured to construct a fee payment transaction based on the payment information in response to the payment message;
  • the first publishing unit is used to publish the payment transaction to the blockchain for deposit, so that the payee system monitors the payment transaction deposited in the blockchain based on the payment transaction Perform payment and write-off of the payment information in the payment information, and publish the payment and write-off transaction constructed from the result of the payment and write-off to the blockchain for deposit.
  • the first publishing unit when publishing the payment payment transaction to the blockchain for deposit, is specifically used to detect that the payment payment transaction corresponding to the end node of the list of the current payment transaction chain is different from the current payment transaction. Whether the accumulated values in the payment and write-off transactions corresponding to the end nodes of the linked list of the payment and write-off chain are the same; if they are the same, the payment and payment transactions are published to the blockchain for deposit.
  • the cumulative value of the payment transaction includes: a total cumulative payment amount and a total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the payment payment transaction further includes: a hash pointer that points to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payment system maintains the total cumulative payment amount and the total number of cumulative payments in the payment transaction corresponding to the end node of the linked list of the payment payment transaction chain;
  • the first construction unit is specifically configured to obtain the payment transaction corresponding to the end node of the linked list of the current payment transaction link list, and generate a hash pointer of the payment payment transaction corresponding to the end node of the linked list; based on the maintenance of the payment system
  • the cumulative total payment amount and the payment amount carried in the payment message are used to determine the cumulative total payment amount in the payment transaction; based on the total number of cumulative payments maintained by the payment system, determine the cumulative payment in the payment transaction
  • the total number of payments; the payment transaction is constructed based on the payment information, the generated hash pointer, the cumulative total payment amount in the payment transaction and the total number of cumulative payments.
  • the device further includes:
  • the update unit is used to update the payment system maintenance by using the total cumulative payment amount and the total number of cumulative payments recorded in the payment transaction after publishing the payment transaction to the blockchain for deposit certificate The total amount of accumulated payments and the total number of accumulated payments.
  • the device further includes:
  • the reset unit is used to reset the total accumulated payment amount and the total number of accumulated payments maintained by the payment system after the completion of the fund settlement is determined.
  • the device further includes:
  • the second construction unit is used to construct a payment settlement voucher transaction based on the fund settlement result after it is determined that the fund settlement is completed;
  • the second issuing unit is used to publish the payment settlement voucher transaction to the blockchain for deposit.
  • a blockchain-based settlement device is provided, the device is applied to a payee system docked with the blockchain, and the device includes:
  • the first construction unit is used to respond to the payment settlement request initiated by the client and construct a settlement request transaction based on the settlement request;
  • the first issuing unit is configured to publish the payment settlement request transaction to the blockchain for deposit, so that the payment system monitors the payment settlement request transaction that the payee system deposits in the blockchain; Based on the monitored payment settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction deposited on the blockchain according to the payment payment sequence; and
  • the payment and write-off transaction of the deposit certificate on the blockchain constitutes the target payment and write-off transaction corresponding to the end node of the payment and write-off transaction chain list according to the payment and write-off sequence; determine the target payment and payment transaction and the target payment and write-off Whether the accumulated value of the transaction is the same; if they are the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment write-off transaction;
  • the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list accumulated to the corresponding cumulative value of the payment payment transaction; the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list Accumulate to the accumulated value corresponding to the payment transaction.
  • the device further includes:
  • the first monitoring unit is configured to monitor the payment payment transaction deposited by the payment system in the blockchain; wherein the payment payment transaction carries payment information;
  • the account write-off unit is configured to perform payment and account write-off based on the payment information in the fee payment transaction in response to the monitored fee payment transaction;
  • the second construction unit is used to construct a fee payment and account cancellation transaction based on the result of the fee payment and account cancellation;
  • the second publishing unit is used to publish the payment and write-off transaction to the blockchain for certification.
  • the cumulative value of the payment transaction includes: a total cumulative payment amount and a total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the payment payment transaction further includes: a hash pointer that points to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payee system maintains the cumulative total amount of write-offs and the total number of cumulative write-offs in the payment and write-off transactions corresponding to the tail node of the linked list of the payment and write-off transactions;
  • the second construction unit is specifically configured to obtain the payment and write-off transaction corresponding to the end node of the current payment and write-off linked list, and generate a hash pointer of the payment and write-off transaction corresponding to the end node of the linked list; and generate the monitored
  • the hash pointer of the fee payment transaction based on the cumulative total account write-off amount maintained by the payee system and the payment amount carried in the fee payment transaction, determine the cumulative total account write-off amount in the fee payment transaction ; Based on the total number of cumulative write-offs maintained by the payee system, determine the total number of cumulative write-offs in the payment write-off transaction; based on the payment write-off result, the payment write-off corresponding to the end node of the linked list
  • the hash pointer of the transaction, the hash pointer of the payment transaction, the total amount of accumulated write-offs in the transaction of payment write-off, and the total number of accumulated write-offs constitute a payment write-off transaction.
  • the second issuance unit is specifically configured to detect whether the sum of the cumulative total written-off amount maintained by the payee system and the payment amount is consistent with the total cumulative payment in the payment transaction, And detecting whether the value of the cumulative number of write-offs maintained by the payee system plus 1 is consistent with the total number of cumulative payments in the payment transaction; if they are consistent, the payment transaction is posted to the The blockchain is used for deposit.
  • the device further includes:
  • the updating unit is used to update the collection based on the total accumulated amount of written-off accounts and the total number of accumulated written-off transactions in the payment and write-off transactions after the payment and write-off transactions are published to the blockchain for certification
  • the device further includes:
  • the second monitoring unit is used to monitor the payment settlement voucher transaction issued by the payment system to the blockchain;
  • the reset unit is used to respond to the payment settlement voucher transaction, and clear the total accumulated amount of written-off accounts and the total number of accumulated written-offs maintained by the payee system to zero.
  • an electronic device including:
  • Memory for storing machine executable instructions
  • the target payment payment transaction In response to the monitored payment settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction of the deposit certificate on the blockchain according to the payment payment sequence; and, by The payment and write-off transaction of the deposit certificate on the blockchain constitutes the target payment and write-off transaction corresponding to the end node of the payment and write-off transaction chain list according to the payment and write-off sequence; wherein, the payment and payment transaction includes the payment and payment transaction The unsettled transactions in the linked list are accumulated to the corresponding cumulative value of the payment transaction; the payment and write-off transaction includes the cumulative value of the unsettled transactions in the linked list of the payment and write-off transactions accumulated to the payment transaction;
  • the fund settlement is performed based on the accumulated value in the target payment transaction or the target payment transaction.
  • an electronic device including:
  • Memory for storing machine executable instructions
  • a settlement request transaction is constructed based on the settlement request
  • the payment system monitors the payment settlement request transaction that the payee system deposits in the blockchain; respond to the monitored payment Settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction deposited on the blockchain according to the payment payment order; and, deposit the certificate on the blockchain
  • the target payment and write-off transaction corresponding to the end node of the linked list of payment and write-off transactions constituted by the payment and write-off sequence; determine whether the target payment transaction and the target payment and write-off transaction have the same cumulative value; If they are the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment write-off transaction;
  • the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list accumulated to the corresponding cumulative value of the payment payment transaction; the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list Accumulate to the accumulated value corresponding to the payment transaction.
  • the payment system Since the payment system can no longer complete the fund settlement by interacting with the payee system at the agreed settlement time, the payment system uses the area when it monitors the settlement request transaction that the payee has deposited on the blockchain.
  • the deposit certificate payment transaction and the payment write-off transaction on the blockchain are reconciled and the fund settlement is completed; since the reconciliation and fund settlement do not require the participation of the payee system, the fund settlement can be realized at any time, increasing The flexibility of fund settlement.
  • Fig. 1 is a schematic diagram of a network of a settlement method based on blockchain shown in an exemplary embodiment of this specification;
  • Fig. 2a is a flowchart of a method for depositing a fee payment transaction according to an exemplary embodiment of this specification
  • Fig. 2b is a schematic diagram of a payment transaction shown in an exemplary embodiment of this specification.
  • Fig. 3a is a flowchart of a method for depositing a certificate for a payment and write-off transaction shown in an exemplary embodiment of this specification;
  • Fig. 3b is a schematic diagram of a payment and write-off transaction shown in an exemplary embodiment of this specification
  • Figure 4 is a schematic diagram of a blockchain-based settlement method shown in an exemplary embodiment of this specification
  • Fig. 5 is a schematic diagram of another blockchain-based settlement method shown in an exemplary embodiment of this specification.
  • Fig. 6 is a hardware structure diagram of an electronic device shown in an exemplary embodiment of this specification.
  • Fig. 7 is a block diagram of a block chain-based settlement device shown in an exemplary embodiment of this specification.
  • Fig. 8 is a block diagram of another block chain-based settlement device shown in an exemplary embodiment of this specification.
  • first, second, third, etc. may be used in this specification to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.
  • the payee system After the user purchases some services or commodities, the payee system generates the user's bill. When users pay for these services or goods, they need to complete the payment through the payment system.
  • the payment system can deposit the funds into the intermediate account, and send a payment cancellation message to the payee system to cancel the bill generated for the user.
  • the payment system and the payee system will agree on a settlement time (such as early morning every day) for settlement.
  • the payment system can reconcile the accounts with the payee system in the early morning of each day. After the account reconciliation is completed, the payment system can transfer the accumulated payment funds between the last settlement time and the current settlement time to the payee system , Thereby completing the fund settlement.
  • the payment system and the payee system can only settle at the agreed settlement time, resulting in inflexible fund settlement.
  • this manual proposes a payment system based on a blockchain-based deposit certificate mechanism to settle funds at any time.
  • the payment system can publish the payment transaction for the payment message to the blockchain for deposit.
  • the payee system monitors the payment transaction, it can perform the payment and write-off, and construct the payment and write-off transaction based on the result of the payment and write-off, and publish the payment and write-off transaction to the blockchain for deposit certification.
  • a linked list of payment and write-off transactions is composed of transactions in the order of write-off.
  • the payment payment transaction includes: the unsettled transaction in the payment payment transaction chain list is accumulated to the corresponding cumulative value of the current payment transaction.
  • the payment and write-off transaction includes: the unsettled transactions in the chain of the payment and write-off transactions are accumulated to the corresponding cumulative value of the current payment and write-off transaction.
  • the payee system After the payee system monitors the payment settlement request initiated by the client, the payee system can construct a payment settlement request transaction based on the payment settlement request, and publish the payment settlement request transaction to the blockchain for deposit certification.
  • the payment system can obtain the payment payment transaction corresponding to the end node of the payment payment transaction chain list of the blockchain deposit certificate and the payment payment transaction corresponding to the end node of the payment payment transaction chain list, and It is detected whether the accumulated value of the acquired payment transaction and the payment transaction is the same. If they are the same, the fund settlement is performed based on the accumulated value in the acquired payment transaction or payment write-off transaction.
  • the interactive payment information or payment and cancellation results between the payment system and the beneficiary system are no longer transmitted in a point-to-point manner, but use the deposit certificate mechanism of the blockchain to transfer payment information or payment cancellation The result of the account; therefore, no interaction can reduce the interactive cost of the interactive payment information or the payment and write-off results, improve the interaction efficiency, and use the non-tamperable characteristics of the data deposited in the blockchain to improve the interactive payment information and the payment and write-off. Reliability of results.
  • the payment transaction issued by the payment system to the blockchain also carries a hash pointer to the last payment transaction, so that the payment transaction in the blockchain is linked to the The last payment payment transaction, thereby forming a payment payment transaction chain list composed of payment payment transactions in the order of payment on the blockchain, which allows users to trace each payment in the payment payment transaction chain list of the blockchain Payment transactions improve the traceability of payment transactions.
  • the payment and write-off transaction issued by the payee system to the blockchain also carries a hash pointer pointing to the last payment and write-off transaction, so that the payment and write-off transaction in the blockchain is linked to the hash pointer stored by itself
  • the last payment and write-off transaction so as to form a payment and write-off transaction chain list formed by each payment and write-off transaction on the blockchain in the order of write-off, which allows users to trace back in the blockchain’s payment and write-off transaction chain
  • Each transaction of payment and write-off has improved the traceability of payment and write-off transactions.
  • the payment and write-off transaction also includes a hash pointer pointing to the payment and payment transaction corresponding to the payment and write-off transaction, so that the payment and write-off transaction can be traced back to the payment and payment transaction corresponding to the payment and write-off transaction.
  • the payment transaction issued by the payment system to the blockchain also carries the cumulative value corresponding to the unsettled transaction in the payment payment transaction chain list accumulated to the current payment transaction, and the payment issued by the payee system to the blockchain
  • the write-off transaction also carries the unsettled transaction in the payment and write-off transaction chain list to the corresponding cumulative value of the current payment and write-off transaction, which allows the payment system to directly pay the end node of the payment transaction chain when reconciling the account.
  • the end node of the corresponding payment transaction and payment write-off transaction link list corresponds to the accumulated value in the payment write-off transaction, and there is no need to count the cumulative value of all payment transactions and all payment write-offs from the last settlement time to the current moment. The accumulated value of the transaction, thereby greatly reducing the workload of the payment system during fund settlement.
  • FIG. 1 is a schematic diagram of networking of a settlement method based on blockchain shown in an exemplary embodiment of this specification.
  • the network shown in Figure 1 includes: payment system, payee system and blockchain.
  • the aforementioned payment system may refer to an institution that provides payment services to users, and users can complete payment through the payment system.
  • payment systems may include: Alipay, WeChat Pay, JD Pay, and bank payment.
  • the payment system can be a software system mounted on a node device in the blockchain, or a software system mounted on a server that establishes a connection with the node device in the blockchain. This is not limited.
  • the above-mentioned payee system may be an institution that issues user consumption bills.
  • the payee system may be the payee of the water and electricity fees.
  • the payee system may be a banking institution.
  • the above-mentioned blockchains are generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain.
  • the most decentralized one is the public chain.
  • the public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks.
  • each participant ie, node
  • the private chain is the opposite.
  • the write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization.
  • the private chain can be a weakly centralized system with strict restrictions and few participating nodes. This type of blockchain is more suitable for internal use by specific institutions.
  • the alliance chain is a block chain between the public chain and the private chain, which can achieve "partial decentralization".
  • Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
  • the blockchain described in this specification can specifically include any type of blockchain network; in practical applications, any of a public chain, a private chain, or a consortium chain can be used.
  • Fig. 2a is a flowchart of a method for depositing a fee payment transaction according to an exemplary embodiment of the present specification. This method can be applied in a payment system and can include the following steps.
  • Step 202 The payment system obtains the payment message sent by the user terminal; the payment message carries payment information.
  • the user can make a payment on the user terminal.
  • the user terminal monitors that the user initiates a payment operation, it can send a payment message to the payment system.
  • the payment message carries payment information.
  • the payment information may include: payment amount.
  • the payment information may also include the payer (ie, the user ID), the payee ID, etc.
  • the payment information is only exemplified here, and is not specifically limited.
  • Step 204 In response to the payment message, the payment system constructs a payment payment transaction based on the payment information.
  • the payment transaction includes:
  • the payment system also maintains the total cumulative payment amount and the total number of cumulative payment transactions corresponding to the end node of the current payment payment chain.
  • the last node of the payment transaction chain list corresponding to the time when the payment settlement request transaction was monitored is the 10th node. Assuming that from the time when the payment settlement request transaction was monitored last time to the current moment, there are 5 more nodes joining the payment payment transaction chain list, then the payment payment corresponding to the 15th node of the payment payment transaction chain list
  • the total cumulative payment amount in the transaction is: the cumulative value of the payment amount in the payment transaction corresponding to the 11th node to the 15th node.
  • the total number of accumulated payments in the payment transaction corresponding to the 15th node is 5.
  • the end node of the current payment transaction chain list is the 15th node, and the payment system maintains the total accumulated payment amount and the total number of accumulated payments in the payment transaction corresponding to the 15th node.
  • the payment amount in the payment transaction corresponding to the 11th node to the 15th node is: 100 yuan, 200 yuan, 50 yuan, 50 yuan, 100 yuan, then the payment in the payment transaction corresponding to the 15th node
  • the total amount of accumulated payments is 500 yuan, and the total number of accumulated payments is 5.
  • the total accumulated payment amount maintained by the payment system is 500 yuan, and the total number of accumulated payments is 5.
  • the total accumulated payment amount and the total number of accumulated payments maintained by the payment system will be updated as the payment transaction is on the chain, and cleared as the fund settlement is completed.
  • the payment system responds to the payment message and constructs a payment transaction based on the payment information.
  • the payment system can obtain the payment transaction corresponding to the end node of the linked list in the current payment transaction chain list, and generate a hash pointer for the acquired payment transaction.
  • the payment system may determine the cumulative total payment amount in the fee payment transaction based on the cumulative total payment amount maintained by the payment system and the payment amount.
  • the payment system may calculate the sum of the cumulative total payment amount maintained by the payment system and the payment amount carried in the payment message as the cumulative total payment amount in the payment transaction.
  • the payment system may also add 1 to the total number of accumulated payments maintained by the payment system as the total number of accumulated payments in the payment transaction.
  • the payment system may construct the payment payment transaction based on the payment information, the generated hash pointer, the total cumulative payment amount and the total number of cumulative payments in the payment payment transaction.
  • the end node of the current payment transaction chain is the 15th node
  • the total payment amount of the payment transaction (referred to as the 15th payment transaction for short) corresponding to the 15 nodes is 500 yuan, and the total number of cumulative payments For 5 pens.
  • the payment system may generate a hash pointer for the 15th payment transaction.
  • the payment system can calculate the sum of the cumulative total payment amount (that is, 500 yuan) and the payment amount (that is, 50 yuan) carried in the payment message (that is, 550 yuan) as the total cumulative payment amount in the payment transaction (that is, 550 yuan).
  • the payment system may also add 1 to the total number of accumulated payments (ie, 5) as the total number of accumulated payments in the payment transaction (ie, 6).
  • the payment system can construct the payment transaction based on the hash pointer of the 15th payment payment transaction, the total cumulative payment amount in the payment transaction is 550 yuan, and the total number of cumulative payments in the payment transaction is 6.
  • the constructed payment payment transaction is the 16th payment transaction in the payment transaction chain list.
  • Step 206 The payment system publishes the payment transaction to the blockchain for certificate deposit, so that the payee system monitors the payment transaction of the certificate deposit in the blockchain based on the payment transaction in the payment transaction.
  • the payment information is used to perform payment and write-off, and the payment and write-off transaction constructed from the result of the payment and write-off is published to the blockchain for deposit.
  • the payment transaction issued by the payment system is consistent with the cumulative value of the payment transaction for the payment transaction issued by the payee system.
  • the business system publishes the payment transaction, it needs to verify the payment transaction corresponding to the end node of the current payment transaction chain and the payment transaction corresponding to the end node of the current payment transaction chain. Only after the verification is successful, Publish the constructed payment transaction to the blockchain for deposit certification.
  • the payment system can detect the payment transaction corresponding to the end node of the current payment transaction chain (here recorded as payment transaction 1) and the payment transaction corresponding to the end node of the current payment cancellation chain (This is recorded as payment and write-off transaction 1) whether the accumulated values are the same; if they are the same, the payment transaction is posted to the blockchain for deposit certification.
  • the payment system can detect whether the cumulative total payment amount of payment transaction 1 is consistent with the cumulative total written-off amount in payment write-off transaction 1, and the payment system can detect the total number of cumulative payments and payment cancellation of payment transaction 1. Whether the cumulative total number of write-offs in the account transaction is consistent.
  • the payment system publishes the payment transaction to the blockchain for certification.
  • the total cumulative payment amount of the payment transaction corresponding to the 15 nodes is 500 yuan, and the total number of cumulative payments is 5.
  • the cumulative total amount of payment and write-off transactions corresponding to the 15th node is 500 yuan, and the total number of cumulative write-offs is 5.
  • the payment system can detect the cumulative total payment amount corresponding to the 15th node of the payment transaction chain list (ie 500 yuan) and the cumulative amount corresponding to the payment transaction chain list Whether the total amount of write-offs (ie 500 yuan) is the same, and the total number of cumulative payments corresponding to the 15th node of the payment payment transaction chain list (ie 5) and the total number of cumulative write-offs corresponding to the payment transaction chain list (That is, 5 strokes) are consistent.
  • the two are the same, so the payment system can post the 16th payment transaction to the blockchain for deposit. After depositing the certificate, the payment transaction list on the blockchain forms the 16th node.
  • the payment system can use the cumulative total payment amount in the payment transaction to update the cumulative amount maintained by the payment system For the total payment amount, the total number of cumulative payments in the payment transaction is used to update the total number of cumulative payments maintained by the payment system.
  • the payment system can update the total cumulative payment amount maintained by the payment system from 500 yuan to 550 yuan , The total number of accumulated payments maintained by the payment system is updated from 5 to 6.
  • the payment information transmitted by the payment system to the payee system is no longer transmitted in a point-to-point manner, but uses the blockchain deposit certificate mechanism to transfer payment information to the payee system; therefore, Not only can the transmission cost of transmitting payment information be reduced, and the interaction efficiency can be improved, but also the non-tampering characteristics of the data stored in the blockchain can be used to improve the reliability of the transmission of interactive payment information.
  • the payment transaction issued by the payment system to the blockchain also carries a hash pointer pointing to the last payment transaction, so that the payment transaction in the blockchain is linked to the above through the hash pointer stored in it.
  • a payment payment transaction thereby forming a payment payment transaction chain list composed of payment payment transactions in the order of payment on the blockchain, which allows users to trace each payment payment in the payment payment transaction chain list of the blockchain Transaction, which improves the traceability of payment transactions.
  • Fig. 3a is a flowchart of a method for depositing a certificate for a payment and write-off transaction shown in an exemplary embodiment of this specification. This method can be applied to the payee system and can include the following steps.
  • Step 302 The payee system monitors the payment transaction that is deposited by the payment system in the blockchain; wherein the payment transaction carries payment information;
  • Step 304 In response to the monitored payment transaction, the payee system performs payment cancellation based on the payment information in the payment transaction;
  • Step 306 The payee system constructs a fee payment and write-off transaction based on the result of the write-off processing, and publishes the fee payment and write-off transaction to the blockchain for certification.
  • the payment and write-off transaction includes:
  • a hash pointer that points to the last transaction of payment and write-off of the blockchain deposit certificate.
  • the payee system maintains the cumulative total amount of written-off accounts and the total number of cumulative written-off transactions in the payment and write-off transactions corresponding to the end node of the linked list of the linked list of payment and write-off transactions.
  • the last node of the payment and write-off transaction chain list corresponding to the time when the settlement request was monitored last time is the 10th node.
  • the 15th node of the payment and write-off transaction chain corresponds to the payment cancellation
  • the cumulative total amount of write-offs in the account transaction is: the cumulative value of the payment amount in the payment write-off transaction corresponding to the 11th node to the 15th node.
  • the total number of accumulated write-offs in the payment and write-off transactions corresponding to the 15th node is 5.
  • the end node of the current payment and write-off transaction chain is the 15th node, and the payee system maintains the cumulative total amount and total number of cumulative write-offs in the payment and write-off transactions corresponding to the 15th node.
  • the corresponding payment and write-off transaction amounts are: 100 yuan, 200 yuan, 50 yuan, 50 yuan, 100 yuan, then the 15th node corresponds to the fee payment write-off transaction
  • the total amount of cumulative write-offs in the transaction is 500 yuan, and the total number of cumulative write-offs is 5.
  • the total accumulated written-off amount maintained by the payee's system is 500 yuan, and the total accumulated written-off amount is 5.
  • variable of the total amount of accumulated write-offs and the variable of the total number of accumulated write-offs will be updated as the payment and write-off transactions are on the chain, and will be cleared as the fund settlement is completed.
  • the payee system can construct a payment and write-off transaction based on the result of the payment and write-off.
  • the payee system can obtain the payment and write-off transaction corresponding to the end node of the current payment and write-off linked list, and generate a hash pointer of the payment and write-off transaction corresponding to the end node of the linked list.
  • the payee system may generate a hash pointer of the monitored fee payment transaction.
  • the payee system may determine the total accumulated account write-off amount in the fee payment transaction based on the accumulated total account write-off amount maintained by the payee system and the payment amount carried in the fee payment transaction.
  • the payee system may calculate the sum of the cumulative total written-off amount maintained by the payee system and the payment amount carried in the payment transaction as the total cumulative write-off amount in the payment transaction.
  • the payee system may determine the total number of cumulative write-offs in the transaction of payment and write-off based on the total number of cumulative write-offs maintained by the payee system
  • the payee system adds 1 to the value of the variable of the cumulative total number of write-offs as the target total number of cumulative write-offs.
  • the payee system can be based on the payment and write-off result, the hash pointer of the payment and write-off transaction corresponding to the end node of the linked list, the hash pointer of the payment and payment transaction, and the cumulative total of the write-off transaction in the payment and write-off transaction.
  • the amount and the total number of accumulated write-offs are used to construct a payment and write-off transaction.
  • the payment transaction monitored by the payee system is the 16th payment transaction in the above payment payment transaction chain list
  • the payment amount in the payment information carried by the 16th payment transaction is 50 yuan.
  • the cumulative total amount of the payment and write-off transaction (referred to as the 15th payment and write-off transaction) corresponding to the 15 nodes is 500 yuan, and the cumulative write-off is The total number of transactions is 5.
  • the payee system may generate the hash pointer of the 15th payment transaction and the hash pointer of the 16th payment transaction.
  • the payee's system can calculate the sum of the cumulative total amount of write-offs maintained by the payee system (ie 500 yuan) and the payment amount (ie 50 yuan) carried by the 16th payment transaction (ie 550 yuan) as the 16th The cumulative total amount of write-offs in a payment transaction.
  • the payee system may also add 1 to the cumulative total number of write-offs maintained by the payee system (ie 5) as the total cumulative number of write-offs in the 16th payment transaction (ie 6).
  • the payee system can be based on the hash pointer of the 15th payment and write-off transaction, the hash pointer of the 16th payment and payment transaction, the cumulative total amount of write-off in the 16th payment and write-off transaction, and the 16th payment.
  • the total number of cumulative write-offs in the write-off transaction is 6 to construct the 16th payment transaction.
  • the payee system can publish the payment and write-off transaction to the blockchain for certification.
  • the payee system publishes the constructed payment and write-off transaction, it also needs to verify the books of the payment system and the payee system. After passing, the constructed fee payment and write-off transaction will be published to the blockchain for certification.
  • the payee system can detect whether the sum of the accumulated total written-off amount maintained by the payee system and the payment amount carried in the monitored payment transaction is consistent with the total accumulated payment in the payment transaction, And detecting whether the value of the variable value of the cumulative total number of write-offs plus 1 is consistent with the total cumulative payment value in the payment transaction.
  • the payment and write-off transaction is published to the blockchain for deposit.
  • the total amount of accumulated write-offs maintained by the payee system is 500 yuan
  • the payment amount carried by the monitored payment payment transaction is 50 yuan
  • the total accumulated payment amount carried by the payment payment transaction is 550 yuan.
  • variable value of the total number of accumulated write-offs is 5, and the total number of accumulated payments carried by the payment transaction is 6.
  • the payee system can detect whether the sum of the total amount of accumulated write-offs maintained by the payee system (ie 500 yuan) and the payment amount (ie 50 yuan) carried by the monitored payment payment transaction (ie 550 yuan) is consistent with the stated
  • the total cumulative payment amount in the payment transaction that is, 550 yuan
  • it is detected whether the value of the cumulative total number of write-off variables that is, 5 transactions) plus 1 (that is, 6 transactions) is consistent with the payment payment payment
  • the total number of accumulated payments in the transaction (that is, 6) is the same.
  • the two are the same, so the payee system can publish the constructed payment and write-off transaction to the blockchain for certification.
  • the payment and write-off results transmitted by the payee system to the payment system are no longer transmitted in a point-to-point manner, but the blockchain deposit certificate mechanism is used to transmit the payment and write-off results to the payment system; Therefore, not only can the transmission cost of transferring the payment and account write-off results be reduced, and the interaction efficiency can be improved, but also the non-tamperable characteristics of the data stored in the blockchain can be used to improve the reliability of the interactive payment and account write-off results.
  • the payment and write-off transaction issued by the payee system to the blockchain also carries a hash pointer to the last payment and write-off transaction, so that the payment and write-off transaction in the blockchain can pass through its own stored Ha Hope that the pointer is linked to the last payment and write-off transaction, thereby forming a chain of payment and write-off transactions on the blockchain, which is composed of each payment and write-off transaction in the order of write-off, which allows users to pay and write off on the blockchain
  • Each transaction of payment and write-off is traced back in the transaction chain table, which improves the traceability of payment and write-off transactions.
  • the payment and write-off transaction also includes a hash pointer pointing to the payment and payment transaction corresponding to the payment and write-off transaction, so that the payment and write-off transaction can be traced back to the payment and payment transaction corresponding to the payment and write-off transaction.
  • Step 402 In response to the payment settlement request initiated by the client, a settlement request transaction is constructed based on the settlement request.
  • the payee system corresponds to a client, and the manager can initiate payment and settlement operations through the client.
  • the client terminal detects the payment settlement operation initiated by the manager, the client terminal may send a payment settlement request to the payee system, and the payee system may construct a payment settlement request transaction based on the payment settlement request.
  • Step 404 The payee system may post the payment settlement request transaction to the blockchain for deposit.
  • Step 502 The payment system monitors the settlement request transaction recorded by the payee system in the blockchain.
  • Step 504 In response to the monitoring of the payment settlement request transaction, the payment system obtains the target payment payment corresponding to the end node of the payment payment transaction chain formed by the payment payment transaction deposited on the blockchain according to the payment payment sequence. Transaction; and, the target payment and write-off transaction corresponding to the end node of the linked list of the payment and write-off transaction chain formed by the payment and write-off transaction of the deposit certificate on the blockchain according to the payment and write-off sequence.
  • the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list accumulated to the corresponding cumulative value of the payment payment transaction; the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list Accumulate to the accumulated value corresponding to the payment transaction;
  • Step 506 The payment system determines whether the accumulated value of the target payment transaction and the target payment transaction is the same.
  • Step 508 If the same, the payment system performs fund settlement based on the accumulated value in the target payment transaction or the target payment transaction.
  • the payment payment transaction is deposited by the method shown in Figure 2a, so that the payment payment transaction chain list is deposited on the blockchain.
  • the payment and write-off transactions are deposited in the manner shown in Figure 3a, so that the payment and write-off transaction chain list is deposited on the blockchain.
  • the payment payment transaction linked list is a linked list composed of payment payment transactions deposited on the blockchain in the order of transactions.
  • the payment payment transaction in the payment payment transaction chain table includes: the unsettled transaction in the payment payment transaction chain table is accumulated to the corresponding cumulative value of the current payment payment transaction.
  • the cumulative value may refer to the end node of the linked list corresponding to the time when the payment settlement request transaction was monitored last time in the payment payment transaction chain list, and the cumulative value accumulated to the current payment payment transaction.
  • the last node of the payment transaction chain list corresponding to the time when the payment settlement request transaction was monitored is the 10th node. Assume that from the time when the payment settlement request transaction was monitored last time to the current time, 5 more nodes have joined the payment payment transaction chain list. The nodes starting from the 11th node are all unsettled nodes.
  • the cumulative value of the payment transaction corresponding to the 15th node of the payment transaction chain list is: the cumulative value of the payment transaction corresponding to the 15th node from the payment transaction corresponding to the 11th node.
  • the cumulative value in the payment transaction includes: the total amount of cumulative payment, the total number of cumulative payments; this is only an exemplary description of the cumulative value in the payment transaction, and no specific limitation is made.
  • the linked list of payment and write-off transactions is a linked list composed of payment and write-off transactions deposited on the blockchain in the order of write-off.
  • the payment and write-off transaction in the payment and write-off transaction chain table includes: the unsettled transactions in the payment and write-off transaction chain are accumulated to the corresponding cumulative value of the current payment and write-off transaction.
  • the accumulated value may refer to the accumulated value of the end node of the linked list corresponding to the time when the settlement request was monitored last time in the linked list of payment and write-off transactions to the current accumulated value of the payment and write-off transactions.
  • the last node of the linked list of payment and write-off transactions is the eleventh node when the payment settlement request is monitored last time.
  • 6 more nodes have joined the linked list of payment and write-off transactions.
  • the nodes starting from the 11th node are all unsettled nodes.
  • the accumulated value of the payment and write-off transactions corresponding to the 17th node of the payment and write-off transaction chain list is: the cumulative value of the payment and write-off transactions corresponding to the 12th node to the first The accumulated value of payment and write-off transactions corresponding to 17 nodes.
  • the accumulated value in the payment and write-off transaction includes: the total amount of the cumulative write-off and the total number of cumulative write-offs; here, the cumulative value in the payment and write-off transaction is only exemplified, and no specific limitation is made.
  • the payment system may, in response to the monitored payment settlement request transaction, determine the target payment payment transaction corresponding to the end node of the chain list of the payment payment transaction list of the blockchain deposit certificate, and the Whether the accumulated value in the target payment and write-off transaction corresponding to the end node of the linked list of the payment and write-off transaction is the same.
  • the payment system can obtain the target payment payment transaction of the end node of the payment transaction chain list of the blockchain deposit certificate, and obtain the target corresponding to the end node of the chain end node of the payment transaction list of the blockchain deposit certificate Payment and write-off transactions.
  • the payment system can detect whether the total cumulative payment amount carried by the target payment payment transaction is the same as the cumulative total written-off amount carried by the target payment write-off transaction, and the payment system can detect the total cumulative payment number carried by the standard payment payment transaction and the target payment cancellation Whether the total number of accumulated cancellations carried by the account transaction is the same.
  • the payment system may perform fund settlement based on the cumulative total payment amount carried in the target payment payment transaction or the cumulative total written-off amount carried in the first target payment payment transaction.
  • the payment system can construct a payment settlement voucher transaction based on the fund settlement result, and publish the payment settlement voucher transaction to the blockchain for deposit.
  • the payment system can clear the total amount of accumulated payments maintained by the payment system, and clear the total number of accumulated payments maintained by the payment system.
  • the payee's system monitors the transaction of the payment settlement voucher, it can clear the total accumulated written-off amount maintained by the payee's system and the total number of accumulated payments maintained by the payee's system to zero.
  • the tail node in the payment transaction chain list is the 18th node, and the payment transaction corresponding to the 18 nodes is referred to as the 18th payment transaction for short.
  • the end node in the linked list of payment and write-off transactions is the 18th node, and the 18th node corresponds to the payment and write-off transaction for short as the 18th payment and write-off transaction.
  • the total cumulative payment amount of the 18th payment transaction is 800 yuan, and the total number of cumulative payments is 8.
  • the total cumulative write-off amount was 800 yuan, and the total number of cumulative write-offs was 8.
  • the value of the variable of the total amount of cumulative payments is 800 yuan, and the value of the variable of the total number of cumulative payments is 8 transactions.
  • the value of the variable of the total amount of cumulative write-offs is 800 yuan, and the value of the variable of the total number of cumulative write-offs is 8.
  • the payment system monitors the payment settlement request transaction, it can determine the total cumulative payment amount in the 18th payment payment transaction (ie 800 yuan) and the cumulative total write-off amount in the 18th payment payment transaction (ie 800 yuan) Whether they are consistent, and determine whether the total number of cumulative payments in the 18th payment transaction (ie 8) is consistent with the total number of cumulative write-offs in the 18th payment transaction (ie 8).
  • the payment system can make funds based on the cumulative total payment amount in the 18th payment transaction or the cumulative total write-off amount in the 18th payment transaction (ie 800 yuan) Settlement.
  • the payment system can clear the total accumulated payment amount maintained by the payment system to 0, and clear the value of the variable of the total number of accumulated payments to 0.
  • the payment system can construct a payment settlement voucher transaction, and publish the payment settlement voucher transaction to the blockchain for deposit.
  • the payee's system After the payee's system monitors the transaction of the payment settlement voucher, it can clear the total accumulated written-off amount maintained by the payee's system to 0, and clear the total number of accumulated payments maintained by the payee's system to 0.
  • the payment transaction and the payment write-off transaction of the blockchain deposit certificate carry the accumulated value, this allows the payment system to directly pass the payment payment transaction and the payment transaction corresponding to the end node of the payment transaction chain when reconciling the account.
  • the end node of the payment and write-off transaction link list corresponds to the cumulative value of the payment and write-off transaction, and there is no need to count the cumulative value of all payment transactions and the cumulative value of all payment and write-off transactions from the last settlement time to the current time. This greatly reduces the workload of the payment system when making fund settlement.
  • this specification also provides an embodiment of a blockchain-based settlement device.
  • the embodiments of the blockchain-based settlement device in this specification can be applied to electronic equipment.
  • the device embodiments can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the electronic device where it is located. From a hardware perspective, as shown in Figure 6, a hardware structure diagram of the electronic equipment where the business configuration device of the block of this specification is located, except for the processor, memory, network interface, and non-volatile memory shown in Figure 6. In addition to the sexual memory, the electronic device in which the device is located in the embodiment usually includes other hardware according to the actual function of the electronic device, which will not be repeated here.
  • the electronic device can be a payment system docked with the blockchain, or a payee system docked with the blockchain.
  • FIG. 7 is a block diagram of a block chain-based settlement device shown in an exemplary embodiment of this specification.
  • the device can be applied to a payment system docked with the block chain and may include the following units.
  • the monitoring unit 701 is configured to monitor the settlement request transaction that the payee system deposits in the blockchain
  • the first acquiring unit 702 is configured to, in response to the monitored payment settlement request transaction, acquire the payment payment transaction that is deposited on the blockchain in accordance with the payment order of the payment transaction linked list corresponding to the end node of the list Target payment transaction; and, the target payment write-off transaction corresponding to the end node of the list of the payment write-off transaction chain formed by the payment write-off transaction of the deposit certificate on the blockchain according to the payment write-off sequence; wherein, the payment The payment transaction includes the accumulated value corresponding to the unsettled transaction in the linked list of payment and payment transactions accumulated to the payment transaction; the transaction of payment and write-off includes the accumulation of unsettled transactions in the linked list of payment and write-off transactions to the payment and payment The accumulated value corresponding to the transaction;
  • the determining unit 703 is configured to determine whether the accumulated values of the target payment transaction and the target payment transaction are the same;
  • the settlement unit 704 is configured to, if the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment transaction.
  • the device further includes:
  • the second acquiring unit 705 is configured to acquire a payment message sent by the user terminal; the payment message carries payment information;
  • the first construction unit 706 is configured to construct a payment payment transaction based on the payment information in response to the payment message;
  • the first issuance unit 707 is configured to publish the payment transaction to the blockchain for deposit, so that the payee system monitors the payment transaction of the deposit in the blockchain, and then pays based on the payment
  • the payment information in the transaction performs payment and write-off, and the payment and write-off transaction constructed from the result of the payment and write-off is published to the blockchain for certification.
  • the first issuing unit 707 when publishing the payment transaction to the blockchain for deposit, is specifically used to detect that the payment transaction corresponding to the end node of the current payment transaction chain is different from the current payment transaction. Whether the accumulated values in the payment and write-off transactions corresponding to the end nodes of the linked list of the payment and write-off linked lists are the same; if they are the same, the payment and payment transactions are published to the blockchain for deposit certification.
  • the cumulative value of the payment transaction includes: a total cumulative payment amount and a total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the payment payment transaction further includes: a hash pointer that points to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payment system maintains the total cumulative payment amount and the total number of cumulative payments in the payment transaction corresponding to the end node of the linked list of the payment payment transaction chain;
  • the first construction unit 706 is specifically configured to obtain the payment payment transaction corresponding to the end node of the linked list of the current payment transaction linked list, and generate a hash pointer of the payment payment transaction corresponding to the end node of the linked list; maintenance based on the payment system The total cumulative payment amount and the payment amount carried in the payment message are used to determine the cumulative total payment amount in the payment transaction; based on the total cumulative payment number maintained by the payment system, determine the total payment in the payment transaction The total number of accumulated payments; the payment transaction is constructed based on the payment information, the generated hash pointer, the accumulated total payment amount in the payment transaction, and the total number of accumulated payments.
  • the device further includes:
  • the update unit 708 is configured to update the payment system maintenance by using the total cumulative payment amount and the total number of cumulative payments recorded in the payment transaction after the payment transaction is posted to the blockchain for deposit certification. The total cumulative payment amount and the total number of cumulative payments.
  • the device further includes:
  • the reset unit 709 is configured to reset the total accumulated payment amount and the total number of accumulated payments maintained by the payment system after the completion of the fund settlement is determined.
  • the device further includes:
  • the second construction unit 710 is configured to construct a payment settlement voucher transaction based on the fund settlement result after determining that the fund settlement is completed;
  • the second issuing unit 711 is configured to publish the payment settlement voucher transaction to the blockchain for deposit.
  • FIG. 8 is a block diagram of another block chain-based settlement device shown in an exemplary embodiment of this specification.
  • the device can be applied to a payee system connected to the block chain, and may include the following ⁇ unit.
  • the first construction unit 801 is configured to respond to a payment settlement request initiated by the client and construct a settlement request transaction based on the settlement request;
  • the first issuing unit 802 is configured to publish the payment settlement request transaction to the blockchain for deposit, so that the payment system monitors the payment settlement request transaction that the payee system deposits in the blockchain; In response to the monitored payment settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction of the deposit certificate on the blockchain according to the payment payment sequence; and, by The payment and write-off transaction of the deposit certificate on the blockchain is the target payment and write-off transaction corresponding to the end node of the chain of the payment and write-off transaction chain formed according to the payment and write-off sequence; determining the target payment and payment transaction and the target payment and write-off transaction Whether the accumulated value of the account transaction is the same; if they are the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment transaction;
  • the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list accumulated to the corresponding cumulative value of the payment payment transaction; the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list Accumulate to the accumulated value corresponding to the payment transaction.
  • the device further includes:
  • the first monitoring unit 803 is configured to monitor the payment payment transaction deposited by the payment system in the blockchain; wherein, the payment payment transaction carries payment information;
  • the account write-off unit 804 is configured to perform payment write-off based on the payment information in the fee payment transaction in response to the monitored fee payment transaction;
  • the second construction unit 805 is configured to construct a fee payment and write-off transaction based on the fee payment and write-off result
  • the second publishing unit 806 is configured to publish the payment and write-off transaction to the blockchain for certification.
  • the cumulative value of the payment transaction includes: a total cumulative payment amount and a total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the payment payment transaction further includes: a hash pointer that points to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payee system maintains the cumulative total amount of write-offs and the total number of cumulative write-offs in the payment and write-off transactions corresponding to the tail node of the linked list of the payment and write-off transactions;
  • the second construction unit 805 is specifically configured to obtain the payment and write-off transaction corresponding to the end node of the linked list of the current payment and write-off linked list, and generate a hash pointer of the payment and write-off transaction corresponding to the end node of the linked list;
  • the hash pointer of the payment transaction based on the cumulative total written-off amount maintained by the payee system and the payment amount carried in the payment transaction, determine the total cumulative write-off in the payment transaction Amount; based on the total number of cumulative write-offs maintained by the payee system, determine the total cumulative number of write-offs in the payment transaction; based on the payment write-off result, the payment cancel corresponding to the end node of the linked list
  • the hash pointer of the account transaction, the hash pointer of the payment transaction, the total amount of accumulated write-offs and the total number of accumulated write-offs in the transaction of payment and write-off constitute a transaction of payment and write-off.
  • the second issuing unit 806 is specifically configured to detect whether the sum of the cumulative total amount of written-off accounts maintained by the payee system and the payment amount is consistent with the cumulative total payment amount in the payment transaction , And detecting whether the value of the cumulative number of write-offs maintained by the payee system plus 1 is consistent with the total number of cumulative payments in the payment transaction; if they are consistent, the payment transaction is posted to The blockchain is used for deposit.
  • the device further includes:
  • the updating unit 807 is configured to update the receipt based on the total accumulated amount of written-off accounts and the total number of accumulated written-off transactions in the payment and write-off transactions after publishing the payment and write-off transactions to the blockchain for deposit.
  • the device further includes:
  • the second monitoring unit 808 is configured to monitor the payment settlement voucher transaction issued by the payment system to the blockchain;
  • the resetting unit 809 is configured to, in response to the payment settlement voucher transaction, clear the total accumulated amount of written-off accounts and the total number of accumulated written-offs maintained by the payee system to zero.
  • the electronic device includes a processor and a memory for storing machine executable instructions; wherein the processor and the memory are usually connected to each other through an internal bus.
  • the device may also include an external interface to be able to communicate with other devices or components.
  • the target payment payment transaction In response to the monitored payment settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction of the deposit certificate on the blockchain according to the payment payment sequence; and, by The payment and write-off transaction of the deposit certificate on the blockchain constitutes the target payment and write-off transaction corresponding to the end node of the payment and write-off transaction chain list according to the payment and write-off sequence; wherein, the payment and payment transaction includes the payment and payment transaction The unsettled transactions in the linked list are accumulated to the corresponding cumulative value of the payment transaction; the payment and write-off transaction includes the cumulative value of the unsettled transactions in the linked list of the payment and write-off transactions accumulated to the payment transaction;
  • the fund settlement is performed based on the accumulated value in the target payment transaction or the target payment transaction.
  • the processor is prompted to:
  • the payment message carries payment information
  • the processor is prompted to:
  • the payment transaction is posted to the blockchain for deposit.
  • the processor is prompted to:
  • the cumulative value of the payment transaction includes: the total cumulative payment amount and the total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the processor is prompted to:
  • the payment payment transaction further includes: a hash pointer pointing to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payment system maintains the total cumulative payment amount and the total number of cumulative payments in the payment transaction corresponding to the end node of the linked list of the payment payment transaction chain;
  • the processor By reading and executing the machine executable instructions corresponding to the control logic of blockchain-based settlement stored in the memory, the processor is prompted to:
  • the payment payment transaction is constructed.
  • the processor is prompted to:
  • the total cumulative payment amount and the total number of cumulative payments recorded in the payment payment transaction are used to update the total cumulative payment sum maintained by the payment system respectively.
  • the total number of cumulative payments are used to update the total cumulative payment sum maintained by the payment system respectively.
  • the processor is further prompted to:
  • the total accumulated payment amount and the total number of accumulated payments maintained by the payment system are cleared to zero.
  • the processor is further prompted to:
  • the electronic device includes a processor and a memory for storing machine executable instructions; wherein the processor and the memory are usually connected to each other through an internal bus.
  • the device may also include an external interface to be able to communicate with other devices or components.
  • a settlement request transaction is constructed based on the settlement request
  • the payment system monitors the payment settlement request transaction that the payee system deposits in the blockchain; respond to the monitored payment Settlement request transaction, obtain the target payment payment transaction corresponding to the end node of the payment payment transaction chain list formed by the payment payment transaction deposited on the blockchain according to the payment payment order; and, deposit the certificate on the blockchain
  • the target payment and write-off transaction corresponding to the end node of the linked list of payment and write-off transactions constituted by the payment and write-off sequence; determine whether the target payment transaction and the target payment and write-off transaction have the same cumulative value; If they are the same, perform fund settlement based on the accumulated value in the target payment transaction or the target payment write-off transaction;
  • the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list accumulated to the corresponding cumulative value of the payment payment transaction; the payment payment transaction includes the unsettled transaction in the payment payment transaction chain list Accumulate to the accumulated value corresponding to the payment transaction.
  • the processor is prompted to:
  • the payment and write-off transaction is constructed, and the payment and write-off transaction are published to the blockchain for deposit.
  • the processor is prompted to:
  • the cumulative value of the payment transaction includes: the total cumulative payment amount and the total number of cumulative payments;
  • the accumulated value of the payment and write-off transaction includes: the total amount of accumulated written-off and the total number of accumulated written-off transactions.
  • the processor is prompted to:
  • the payment payment transaction further includes: a hash pointer pointing to the last payment payment transaction of the blockchain deposit certificate;
  • the fee payment and account cancellation result transaction further includes: a hash pointer pointing to the last fee payment transaction of the blockchain deposit certificate, and a hash pointer pointing to the fee payment transaction corresponding to the fee payment transaction.
  • the payment information includes: payment amount;
  • the payee system maintains the cumulative total amount of write-offs and the total number of cumulative write-offs in the payment and write-off transactions corresponding to the tail node of the linked list of the payment and write-off transactions;
  • the processor By reading and executing the machine executable instructions corresponding to the control logic of blockchain-based settlement stored in the memory, the processor is prompted to:
  • the hash pointer of the payment and write-off transaction corresponding to the tail node of the linked list, the hash pointer of the payment and payment transaction, the total amount of the cumulative write-off in the payment and write-off transaction and the cumulative write-off The total number of transactions to construct payment and write-off transactions.
  • the processor is prompted to:
  • the processor is prompted to:
  • the accumulated total written-off amount and the accumulated total number of written-offs maintained by the payee system are updated.
  • the processor is prompted to:
  • the total accumulated amount of written-off accounts and the total number of accumulated written-offs maintained by the payee system are cleared to zero.
  • the relevant part can refer to the part of the description of the method embodiment.
  • the device embodiments described above are merely illustrative.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units.
  • Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement it without creative work.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种基于区块链的结算方法、装置以及电子设备,包括:支付系统监听收款方系统在所述区块链中存证的结算请求交易(502);支付系统响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易(504);支付系统确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同(506);如果相同,支付系统基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算(508)。

Description

一种基于区块链的结算方法、装置以及电子设备 技术领域
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种基于区块链的结算方法、装置以及电子设备。
背景技术
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用。
发明内容
有鉴于此,本说明书提供一种基于区块链的结算方法、装置以及电子设备。
具体地,本说明书是通过如下技术方案实现的:
根据本说明书的第一方面,提供一种基于区块链的结算方法,所述方法应用于与区块链对接的支付系统,所述方法包括:
监听收款方系统在所述区块链中存证的结算请求交易;
响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
可选的,所述缴费支付交易链表中的缴费支付交易通过如下方式存证:
获取用户终端发送的支付消息;所述支付消息中携带支付信息;
响应于所述支付消息,基于所述支付信息构造缴费支付交易;
将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
可选的,所述将所述缴费支付交易发布至区块链进行存证,包括:
检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易与当前所述缴费销账链表的链表尾节点对应的缴费销账交易中的累计值是否相同;
若相同,则将所述缴费支付交易发布至区块链进行存证。
可选的,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述支付系统维护了所述缴费支付交易链表的链表尾节点对应的缴费支付交易中的累计支付总金额和累计支付总笔数;
所述基于所述支付信息构造缴费支付交易,包括:
获取当前所述缴费交易链表的链表尾节点对应的缴费支付交易,并生成该链表尾节点对应的缴费支付交易的哈希指针;
基于所述支付系统维护的累计支付总金额和所述支付消息中携带的支付金额,确定所述缴费支付交易中的累计支付总金额;
基于所述支付系统维护的累计支付总笔数,确定所述缴费支付交易中的累计支付总笔数;
基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
可选的,在将所述缴费支付交易发布至区块链进行存证后,所述方法还包括:
采用所述缴费支付交易中记录的累计支付总金额和累计支付总笔数、分别更新所述支付系统维护的累计支付总金额和累计支付总笔数。
可选的,所述方法还包括:
在确定资金结算完成后,将所述支付系统维护的累计支付总金额和累计支付总笔数清零。
可选的,所述方法还包括:
在确定资金结算完成后,基于资金结算结果构造缴费结算凭证交易;
将所述缴费结算凭证交易发布至所述区块链进行存证。
根据本申请的第二方面,提供一种基于区块链的结算方法,所述方法应用于与区块链对接的收款方系统,所述方法包括:
响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
可选的,所述缴费销账交易通过如下方式存证:
监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行缴费销账;
基于缴费销账结果构造缴费销账交易,并将缴费销账交易发布至所述区块链进行存证。
可选的,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数;
所述基于缴费销账结果构造缴费销账交易,包括:
获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针;
生成监听到的所述缴费支付交易的哈希指针;
基于所述收款方系统维护的累计销账总金额和所述缴费支付交易中携带的支付金额,确定所述缴费销账交易中的累计销账总金额;
基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数;
基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数,构造缴费销账交易。
可选的,所述将缴费销账交易发布至所述区块链进行存证,包括:
检测所述收款方系统维护的累计销账总金额与所述支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述收款方系统维护的累计销账笔数加1后的值是否与所述缴费支付交易中的累计支付总笔数一致;
若均一致,则将缴费销账交易发布至所述区块链进行存证。
可选的,所述在将缴费销账交易发布至所述区块链进行存证之后,所述方法还包括:
基于所述缴费销账交易中的累计销账总金额和累计销账总笔数,更新所述收款方系统维护的累计销账总金额和累计销账总笔数。
可选的,所述方法还包括:
监听由所述支付系统发布至所述区块链的缴费结算凭证交易;
响应于所述缴费结算凭证交易,将所述收款方系统维护的累计销账总金额和累计销账总笔数清零。
根据本申请的第三方面,提供一种基于区块链的结算装置,所述装置应用于与区块链对接的支付系统,所述装置包括:
监听单元,用于监听收款方系统在所述区块链中存证的结算请求交易;
第一获取单元,用于响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
确定单元,用于确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
结算单元,用于如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
可选的,所述装置还包括:
第二获取单元,用于获取用户终端发送的支付消息;所述支付消息中携带支付信息;
第一构造单元,用于响应于所述支付消息,基于所述支付信息构造缴费支付交易;
第一发布单元,用于将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
可选的,所述第一发布单元,在将所述缴费支付交易发布至区块链进行存证时,具体用于检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易与当前所述缴费销账链表的链表尾节点对应的缴费销账交易中的累计值是否相同;若相同,则将所述缴费支付交易发布至区块链进行存证。
可选的,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述支付系统维护了所述缴费支付交易链表的链表尾节点对应的缴费支付交易中的累计支付总金额和累计支付总笔数;
所述第一构造单元,具体用于获取当前所述缴费交易链表的链表尾节点对应的缴费支付交易,并生成该链表尾节点对应的缴费支付交易的哈希指针;基于所述支付系统维护的累计支付总金额和所述支付消息中携带的支付金额,确定所述缴费支付交易中的累计支付总金额;基于所述支付系统维护的累计支付总笔数,确定所述缴费支付交易中的累计支付总笔数;基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
可选的,所述装置还包括:
更新单元,用于在将所述缴费支付交易发布至区块链进行存证后,采用所述缴费支付交易中记录的累计支付总金额和累计支付总笔数、分别更新所述支付系统维护的累计支付总金额和累计支付总笔数。
可选的,所述装置还包括:
复位单元,用于在确定资金结算完成后,将所述支付系统维护的累计支付总金额和累计支付总笔数清零。
可选的,所述装置还包括:
第二构造单元,用于在确定资金结算完成后,基于资金结算结果构造缴费结算凭证 交易;
第二发布单元,用于将所述缴费结算凭证交易发布至所述区块链进行存证。
根据本申请的第四方面,提供一种基于区块链的结算装置,所述装置应用于与区块链对接的收款方系统,所述装置包括:
第一构造单元,用于响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
第一发布单元,用于将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
可选的,所述装置还包括:
第一监听单元,用于监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
销账单元,用于响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行缴费销账;
第二构造单元,用于基于缴费销账结果构造缴费销账交易;
第二发布单元,用于将缴费销账交易发布至所述区块链进行存证。
可选的,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数;
所述第二构造单元,具体用于获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针;生成监听到的所述缴费支付交易的哈希指针;基于所述收款方系统维护的累计销账总金额和所述缴费支付交易中携带的支付金额,确定所述缴费销账交易中的累计销账总金额;基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数;基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数,构造缴费销账交易。
可选的,所述第二发布单元,具体用于检测所述收款方系统维护的累计销账总金额与所述支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述收款方系统维护的累计销账笔数加1后的值是否与所述缴费支付交易中的累计支付总笔数一致;若均一致,则将缴费销账交易发布至所述区块链进行存证。
可选的,所述装置还包括:
更新单元,用于在将缴费销账交易发布至所述区块链进行存证之后,基于所述缴费销账交易中的累计销账总金额和累计销账总笔数,更新所述收款方系统维护的累计销账总金额和累计销账总笔数。
可选的,所述装置还包括:
第二监听单元,用于监听由所述支付系统发布至所述区块链的缴费结算凭证交易;
复位单元,用于响应于所述缴费结算凭证交易,将所述收款方系统维护的累计销账总金额和累计销账总笔数清零。
根据本申请的第五方面,提供一种电子设备,包括:
处理器;
用于存储机器可执行指令的存储器;
其中,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
监听收款方系统在所述区块链中存证的结算请求交易;
响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
根据本申请的第六方面,提供一种电子设备,包括:
处理器;
用于存储机器可执行指令的存储器;
其中,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
由于支付系统可以不再按照约定的结算时刻通过与收款方系统进行交互完成资金结算,而是由支付系统在监听到在收款方存证在区块链上的结算请求交易时,利用区块链上存证的缴费支付交易和缴费销账交易进行对账并完成资金结算;由于在对账和资金结算时,不再需要收款方系统参与,因此,可以实现随时进行资金结算,增加资金结算的灵活性。
附图说明
图1是本说明书一示例性实施例示出的一种基于区块链的结算方法的组网示意图;
图2a是本说明书一示例性实施例示出的一种缴费支付交易存证方法的流程图;
图2b是本说明书一示例性实施例示出的一种缴费支付交易的示意图;
图3a是本说明书一示例性实施例示出的一种缴费销账交易存证方法的流程图;
图3b是本说明书一示例性实施例示出的一种缴费销账交易的示意图;
图4是本说明书一示例性实施例示出的一种基于区块链的结算方法的示意图;
图5是本说明书一示例性实施例示出的另一种基于区块链的结算方法的示意图;
图6是本说明书一示例性实施例示出的一种电子设备的硬件结构图;
图7是本说明书一示例性实施例示出的一种基于区块链的结算装置的框图;
图8是本说明书一示例性实施例示出的另一种基于区块链的结算装置的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书的一些方面相一致的装置和方法的例子。
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
在一些场景下,用户购买了一些服务或者商品等后,收款方系统会生成该用户的账单。而用户支付这些服务或商品时需要通过支付系统来完成支付。
具体地,支付系统在收到用户支付的资金后可将资金存入中间账户,并向收款方系统发送缴费销账消息,以销除为该用户生成的账单。支付系统和收款方系统会约定一个结算时刻(比如每日凌晨)进行结算。
比如,支付系统可在每日凌晨的与收款方系统进行对账,在对账完成后,支付系统可将上一个结算时刻与当前结算时刻之间的累计的支付资金转给收款方系统,从而完成资金结算。
然而,在这种场景下,支付系统和收款方系统只能按照约定的结算时刻进行结算,造成资金结算的不灵活。
有鉴于此,本说明书提出一种支付系统基于区块链的存证机制,随时进行资金结算的技术方案。
在实现时,支付系统在接收到用户发送的支付消息后,可将针对该支付消息的缴费支付交易发布至区块链进行存证。收款方系统在监听到该缴费支付交易后,可进行缴费销账,并基于缴费销账结果构造缴费销账交易,并将缴费销账交易发布至区块链进行存证。
基于此,区块链上存证了两条链表,一条是基于区块链上存证的缴费支付交易按照支付顺序构成的缴费支付交易链表,另一条是基于区块上存证的缴费销账交易按照销账顺序构成的缴费销账交易链表。
缴费支付交易包括:该缴费支付交易链表中未结算交易累积至当前缴费支付交易时对应的累计值。缴费销账交易包括:该缴费销账交易链表中的未结算交易累积至当前缴费销账交易时对应的累计值。
当收款方系统在监听到客户端发起的缴费结算请求后,收款方系统可基于该缴费结算请求构造缴费结算请求交易,并将该缴费结算请求交易发布至区块链进行存证。
当支付系统监听到该缴费结算请求交易时,支付系统可获取该区块链存证的缴费支付交易链表尾节点对应的缴费支付交易和缴费销账交易链表尾节点对应的缴费销账交易,并检测获取到的缴费支付交易和缴费销账交易的累计值是否相同。如果相同,则基于该获取到的缴费支付交易或缴费销账交易中的累计值进行资金结算。
由上述描述可以看出,一方面由于支付系统不再按照约定的结算时刻通过与收款方系统进行交互完成资金结算,而是支付系统在监听到由收款方系统在区块链上发布的缴费结算请求交易时,利用区块链上存证的缴费支付交易和缴费销账交易进行对账并完成资金结算;由于在对账和资金结算时,不再需要收款方系统参与,因此,可以实现随时进行资金结算,增加资金结算的灵活性。
另一方面,支付系统与收款方系统之间的交互的支付信息或者缴费销账结果不再以点对点的方式进行传递,而是利用区块链的存证机制来相互传递支付信息或者缴费销账结果;因此,不进行可以降低交互支付信息或者缴费销账结果的交互成本,提高交互效率,还可以利用区块链中存证的数据具有不可篡改的特性,提升交互支付信息和缴费销账结果的可靠性。
第三方面,支付系统向区块链发布的缴费支付交易中还携带有指向上一笔缴费支付交易的哈希指针,使得区块链中的缴费支付交易通过自身储存的哈希指针链接到与上一笔缴费支付交易,从而在区块链上形成由各缴费支付交易按照支付顺序构成的缴费支付交易链表,这就使得用户可以在区块链的缴费支付交易链表中追溯出每一笔缴费支付交易,提高了缴费支付交易的可追溯性。
收款方系统向区块链发布的缴费销账交易中还携带有指向上一笔缴费销账交易的哈希指针,使得区块链中的缴费销账交易通过自身储存的哈希指针链接到上一笔缴费销账交易,从而在区块链上形成各缴费销账交易按照销账顺序构成的缴费销账交易链表,这就使得用户可以在区块链的缴费销账交易链表中追溯出每一笔缴费销账交易,提高了缴费销账交易的可追溯性。
此外,缴费销账交易中还包括:指向与该缴费销账交易对应的缴费支付交易的哈希指针,使得通过该缴费销账交易可以追溯到该缴费销账交易对应的缴费支付交易。
第四方面,支付系统向区块链发布的缴费支付交易中还携带了缴费支付交易链表中未结算交易累积至当前缴费支付交易时对应的累计值,收款方系统向区块链发布的缴费销账交易中还携带了该缴费销账交易链表中的未结算交易累积至当前缴费销账交 易时对应的累计值,这使得支付系统在进行对账时,可以直接通过缴费支付交易链表尾节点对应的缴费支付交易和缴费销账交易链表尾节点对应缴费销账交易中的累计值进行对账,而不需要再统计上一次结算时刻至当前时刻所有缴费支付交易的累计值和所有缴费销账交易的累计值,从而大大降低了支付系统在进行资金结算时的工作负荷。
参见图1,图1是本说明书一示例性实施例示出的一种基于区块链的结算方法的组网示意图。
图1所示的组网中包括:支付系统、收款方系统和区块链。
上述支付系统,可以是指为用户提供支付服务的机构,用户可以通过支付系统完成支付。比如支付系统可包括:支付宝、微信支付、京东支付和银行支付等。
需要说明的是,支付系统可以是搭载在区块链中的节点设备上的软件系统,也可以是搭载在与区块链中的节点设备之间建立连接的服务器上的软件系统,本说明书对此不作限制。
上述收款方系统,可以是出具用户消费账单的机构。比如,用户缴纳水费、电费等费用时,该收款方系统可以是水电费收款方。再比如,用户进行信用卡还款时,该收款方系统可以是银行机构等。这里只是对收款方系统进行示例性地说明,不进行具体地限定。
上述区块链一般被划分为三种类型:公有链(Public Blockchain),私有链(Private Blockchain)和联盟链(Consortium Blockchain)。此外,还有多种类型的结合,比如私有链+联盟链、联盟链+公有链等不同组合形式。其中去中心化程度最高的是公有链。公有链以比特币、以太坊为代表,加入公有链的参与者可以读取链上的数据记录、参与交易以及竞争新区块的记账权等。
而且,各参与者(即节点)可自由加入以及退出网络,并进行相关操作。私有链则相反,该网络的写入权限由某个组织或者机构控制,数据读取权限受组织规定。简单来说,私有链可以为一个弱中心化系统,参与节点具有严格限制且少。这种类型的区块链更适合于特定机构内部使用。
联盟链则是介于公有链以及私有链之间的区块链,可实现“部分去中心化”。联盟链中各个节点通常有与之相对应的实体机构或者组织;参与者通过授权加入网络并组成利益相关联盟,共同维护区块链运行。
在本说明书描述的区块链,具体可以包括任意类型的区块链网络;在实际应用 中,可以采用共有链、私有链、或者联盟链中的任意一种。
在介绍本申请提供的结算方法之前,先介绍缴费支付交易和缴费销账交易的存证方式。
参见图2a,图2a是本说明书一示例性实施例示出的一种缴费支付交易存证方法的流程图。该方法可应用在支付系统中,可包括如下所示步骤。
步骤202:支付系统获取用户终端发送的支付消息;所述支付消息中携带支付信息。
用户可以在用户终端上进行支付,当用户终端监听到用户发起支付操作后,可向支付系统发送支付消息。该支付消息中携带有支付信息。
其中,该支付信息可包括:支付金额。当然,该支付信息还可包括付款方(即用户标识)、收款方标识等,这里只是对支付信息进行示例性地说明,不进行具体地限定。
步骤204:支付系统响应于所述支付消息,基于所述支付信息构造缴费支付交易。
如图2b所示,该缴费支付交易包括:
1)缴费支付交易链表中未结算交易累积至该缴费支付交易时对应的累计支付总金额。
2)缴费支付交易链表中未结算交易累积至该缴费支付交易时对应的累计支付总笔数;
3)指向所述区块链存证的上一笔缴费支付交易的哈希指针。
此外,支付系统还维护了当前缴费支付链表的链表尾节点对应的缴费支付交易的累计支付总金额和累计支付总笔数。
例如,假设上一次监听到缴费结算请求交易的时刻对应的缴费支付交易链表尾节点为第10个节点。假设,从上一次监听到缴费结算请求交易的时刻时起至当前时刻的时间段内,又有5个节点加入该缴费支付交易链表,则该缴费支付交易链表的第15个节点对应的缴费支付交易中的累计支付总金额为:从第11个节点至第15个节点对应的缴费支付交易中的支付金额的累计值。该第15个节点对应的缴费支付交易中的累计支付总笔数为5笔。
当前缴费支付交易链表的尾节点为第15个节点,则支付系统维护了第15个节 点对应的缴费支付交易中的累计支付总金额和累计支付总笔数。
比如,从第11个节点至第15个节点对应的缴费支付交易中的支付金额依次为:100元、200元、50元、50元、100元,则第15节点对应的缴费支付交易中的累计支付总金额为500元,累计支付总笔数为5笔。则此时,支付系统维护的累计支付总金额为500元,累计支付总笔数为5笔。
支付系统维护的累计支付总金额和累计支付总笔数会随着缴费支付交易上链发生更新,随着资金结算完成而清零。
在本申请说明书中,支付系统响应于所述支付消息,基于所述支付信息构造缴费支付交易。
在构造时,支付系统可获取当前该缴费支付交易链表中链表尾节点对应的缴费支付交易,并生成该获取到缴费支付交易的哈希指针。
支付系统可基于该支付系统维护的累计支付总金额和所述支付金额,确定该缴费支付交易中的累计支付总金额。
比如,支付系统可计算该支付系统维护的累计支付总金额和支付消息中携带的支付金额之和,作为该缴费支付交易中的累计支付总金额。
此外,支付系统还可将该支付系统维护的累计支付总笔数加1作为作为该缴费支付交易中的累计支付总笔数。
支付系统可基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
例如,假设当前缴费支付交易链表的尾节点为第15个节点,该15个节点对应的缴费支付交易(简称为第15个缴费支付交易)的累计支付总金额为500元,累计支付总笔数为5笔。
假设,支付系统维护的累计支付总金额为500元,累计支付总笔数为5笔。
假设支付请求中的支付消息所包括的支付金额为50元。
支付系统可生成该第15个缴费支付交易的哈希指针。
支付系统可计算累计支付总金额(即500元)和支付消息中携带的支付金额(即50元)之和(即550元),作为该支付交易中的累计支付总金额(即550元)。
支付系统还可将累计支付总笔数(即5笔)加1作为该支付交易中的累计支付总笔数(即6笔)。
支付系统可基于第15个缴费支付交易的哈希指针,支付交易中的累计支付总金额550元、支付交易中的累计支付总笔数6笔,构造该缴费支付交易。构造出的缴费支付交易为该缴费支付交易链表中的第16个缴费支付交易。
步骤206:支付系统将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
为了保证支付系统和收款方系统的账面一致,即支付系统发布的缴费支付交易,与收款方系统发布的针对该缴费支付交易的缴费销账交易的累计值一致。在业务系统在发布缴费支付交易时,需要对当前缴费支付交易链表尾节点对应的缴费支付交易以及当前缴费销账交易链表尾节点对应的缴费销账交易进行校验,在校验成功后,才将构建的缴费支付交易发布至区块链进行存证。
在实现时,支付系统可检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易(这里记为缴费支付交易1)与当前所述缴费销账链表的链表尾节点对应的缴费销账交易(这里记为缴费销账交易1)中的累计值是否相同;若相同,则将所述缴费支付交易发布至区块链进行存证。
具体地,支付系统可检测缴费支付交易1的累计支付总金额与缴费销账交易1中的累计销账总金额是否一致,以及支付系统可检测缴费支付交易1的累计支付总笔数与缴费销账交易中的累计销账总笔数是否一致。
如果所述缴费支付交易1的累计支付总金额与缴费销账交易1中的累计销账总金额一致,且缴费支付交易1的累计支付总笔数与缴费销账交易1中的累计销账总笔数一致,支付系统将该缴费支付交易发布至区块链进行存证。
例如,假设当前缴费支付交易链表的尾节点为第15个节点,该15个节点对应的缴费支付交易的累计支付总金额为500元,累计支付总笔数为5笔。
假设当前缴费销账交易链表的尾节点为第15个节点,该第15个节点对应的缴费销账交易的累计销账总金额为500元,累计销账总笔数为5笔。
支付系统在区块链上发布第16个缴费支付交易时,支付系统可检测缴费支付交易链表的第15个节点对应的累计支付总金额(即500元)与该缴费销账交易链表对应 的累计销账总金额(即500元)是否一致、以及检测缴费支付交易链表的第15个节点对应的累计支付总笔数(即5笔)与该缴费销账交易链表对应的累计销账总笔数(即5笔)是否一致。
在本例中,二者均一致,所以支付系统可将第16个缴费支付交易发布至区块链进行存证。在存证后,区块链上的缴费支付交易链表形成第16个节点。
此外,在本说明书提供的实施例中,在将该构造的缴费支付交易发布至区块链进行存证后,支付系统可采用该缴费支付交易中的累计支付总金额更新该支付系统维护的累计支付总金额,采用该缴费支付交易中的累计支付总笔数更新该支付系统维护的累计支付总笔数。
仍以步骤204中的例子为例,在将构造的第16个缴费支付交易发布至区块链进行存证后,支付系统可将该支付系统维护的累计支付总金额由500元更新为550元,将该支付系统维护的累计支付总笔数由5笔更新为6笔。
由上述描述可知,一方面,支付系统向收款方系统传递的支付信息不再以点对点的方式进行传递,而是利用区块链的存证机制来向收款方系统传递支付信息;因此,不仅可以降低传递支付信息的传输成本,提高交互效率,还可以利用区块链中存证的数据具有不可篡改的特性,提升交互支付信息传递的可靠性。
另一方面,支付系统向区块链发布的缴费支付交易中还携带有指向上一笔缴费支付交易的哈希指针,使得区块链中的缴费支付交易通过自身储存的哈希指针链接到上一笔缴费支付交易,从而在区块链上形成由各缴费支付交易按照支付顺序构成的缴费支付交易链表,这就使得用户可以在区块链的缴费支付交易链表中追溯出每一笔缴费支付交易,提高了缴费支付交易的可追溯性。
参见图3a,图3a是本说明书一示例性实施例示出的一种缴费销账交易存证方法的流程图。该方法可应用在收款方系统中,可包括如下所示步骤。
步骤302:收款方系统监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
步骤304:收款方系统响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行缴费销账;
步骤306:收款方系统基于销账处理结果构造缴费销账交易,并将缴费销账交易发布至所述区块链进行存证。
如图3b所示,该缴费销账交易包括:
1)缴费销账交易链表中未结算交易累积至该缴费支付交易时对应的累计销账总金额。
2)缴费销账交易链表中与未结算交易累积至该缴费支付交易时对应的累计销账总笔数。
3)指向所述区块链存证的上一笔缴费销账交易的哈希指针。
4)指向与监听到的所述缴费支付交易的哈希指针,即与该缴费销账交易对应的缴费支付交易的哈希指针。
此外,收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数。
例如,假设上一次监听到结算请求的时刻对应的缴费销账交易链表尾节点为第10个节点。假设,从上一次监听到结算请求的时刻时起至当前时刻的时间段内,又有5个节点加入该缴费销账交易链表,则该缴费销账交易链表的第15个节点对应的缴费销账交易中的累计销账总金额为:从第11个节点至第15个节点对应的缴费销账交易中的支付金额的累计值。该第15个节点对应的缴费销账交易中的累计销账总笔数为5笔。
当前缴费销账交易链表的尾节点为第15个节点,则收款方系统维护了第15个节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数。
比如,从第11个节点至第15个节点对应的缴费销账交易中的销账金额依次为:100元、200元、50元、50元、100元,则第15节点对应的缴费销账交易中的累计销账总金额为500元,累计销账总笔数为5笔。则此时,收款方系统维护的累计销账总金额为500元,累计销账总笔数为5笔。
该累计销账总金额变量和累计销账总笔数变量的取值会随着缴费销账交易上链发生更新,随着资金结算完成而清零。
在本申请说明书中,收款方系统可以基于缴费销账结果构造缴费销账交易。
在构造时,收款方系统可获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针。
收款方系统可生成监听到的所述缴费支付交易的哈希指针。
收款方系统可基于所述收款方系统维护的累计销账总金额和所述缴费支付交易 中携带的支付金额,确定所述缴费销账交易中的累计销账总金额。
比如,收款方系统可计算该收款方系统维护的累计销账总金额和该缴费支付交易中携带的支付金额之和,作为该缴费销账交易中的累计销账总金额。
收款方系统可基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数
比如,收款方系统将所述累计销账总笔数变量的取值加1作为目标累计销账总笔数。
收款方系统可基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数,构造缴费销账交易。
例如,假设收款方系统监听到的缴费支付交易为上述缴费支付交易链表中的第16个缴费支付交易,该第16个缴费支付交易携带的支付信息中的支付金额为50元。
假设当前缴费销账交易链表的尾节点为第15个节点,该15个节点对应的缴费销账交易(简称为第15个缴费销账交易)的累计销账总金额为500元,累计销账总笔数为5笔。
假设,收款方系统维护的累计销账总金额为500元,累计销账总笔数为5笔。
收款方系统可生成该第15个缴费销账交易的哈希指针、以及该第16个缴费支付交易的哈希指针。
收款方系统可计算该收款方系统维护的累计销账总金额(即500元)和第16个缴费支付交易携带的支付金额(即50元)之和(即550元),作为第16个缴费销账交易中的累计销账总金额。
收款方系统还可将该收款方系统维护的累计销账总笔数(即5笔)加1作为第16个缴费销账交易中的累计销账总笔数(即6笔)。
收款方系统可基于第15个缴费销账交易的哈希指针,第16个缴费支付交易的哈希指针、第16个缴费销账交易中的累计销账总金额550元、第16个缴费销账交易中的累计销账总笔数6笔,构造该第16个缴费销账交易。
在本说明书实施例中,在基于缴费销账结果构造缴费销账交易后,收款方系统可将缴费销账交易发布至区块链进行存证。
在发布时,为了保证支付系统和收款方系统的账面一致,收款方系统在发布构造出的缴费销账交易时,还需要对支付系统和收款方系统的账面进行校验,校验通过后,才将构造出的缴费销账交易发布至区块链进行存证。
在实现时,收款方系统可检测该收款方系统维护的累计销账总金额与监听到的缴费支付交易携带的支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述累计销账总笔数变量取值加1后的值是否与所述缴费支付交易中的累计支付总笔数值一致。
如果该收款方系统维护的累计销账总金额与所述支付金额之和与所述缴费支付交易中的累计支付总金额一致、且累计销账总笔数变量取值加1后的值与所述缴费支付交易中的累计支付总笔数值一致,则将缴费销账交易发布至该区块链进行存证。
例如,假设该收款方系统维护的累计销账总金额为500元,监听到的缴费支付交易携带的支付金额为50元,缴费支付交易携带的累计支付总金额为550元。
累计销账总笔数变量取值为5笔,缴费支付交易携带的累计支付总笔数为6笔。
收款方系统可检测该收款方系统维护的累计销账总金额(即500元)与监听到的缴费支付交易携带的支付金额(即50元)之和(即550元)是否与所述缴费支付交易中的累计支付总金额(即550元)一致、以及检测所述累计销账总笔数变量取值(即5笔)加1后的值(即6笔)是否与所述缴费支付交易中的累计支付总笔数(即6笔)一致。
在本例中,两者均一致,所以收款方系统可将构造出的缴费销账交易发布至区块链进行存证。
由上述描述可知,一方面,收款方系统向支付系统传递的缴费销账结果不再以点对点的方式进行传递,而是利用区块链的存证机制来向支付系统传递缴费销账结果;因此,不仅可以降低传递缴费销账结果的传输成本,提高交互效率,还可以利用区块链中存证的数据具有不可篡改的特性,提升交互缴费销账结果传递的可靠性。
另一方面,收款方系统向区块链发布的缴费销账交易中还携带有指向上一笔缴费销账交易的哈希指针,使得区块链中的缴费销账交易通过自身储存的哈希指针链接到上一笔缴费销账交易,从而在区块链上形成由各缴费销账交易按照销账顺序构成的缴费销账交易链表,这就使得用户可以在区块链的缴费销账交易链表中追溯出每一笔缴费销账交易,提高了缴费销账交易的可追溯性。
此外,缴费销账交易中还包括:指向与该缴费销账交易对应的缴费支付交易的哈希指针,使得通过该缴费销账交易可以追溯到该缴费销账交易对应的缴费支付交易。
在介绍完上述缴费支付交易和缴费销账交易的存证方法后,下面结合图4和图5,对本申请提供的基于区块链的结算方法进行详细地说明。该基于区块链的结算方法可通过如下方式实现。
步骤402:响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易。
收款方系统对应有客户端,管理人员可以通过客户端发起缴费结算操作。当客户端检测到管理人员发起的缴费结算操作时,客户端可向收款方系统发送缴费结算请求,收款方系统可基于该缴费结算请求构造缴费结算请求交易。
步骤404:收款方系统可将所述缴费结算请求交易发布至所述区块链进行存证。
步骤502:支付系统监听收款方系统在所述区块链中存证的结算请求交易。
步骤504:支付系统响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易。
其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
步骤506:支付系统确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同。
步骤508:如果相同,支付系统基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
通过图2a所示的方式对缴费支付交易进行存证,使得区块链上存证了缴费支付交易链表。
通过图3a所示的方式对缴费销账交易进行存证,使得区块链上存证了缴费销账交易链表。
1)缴费支付交易链表
缴费支付交易链表是由在所述区块链上存证的缴费支付交易按照交易顺序构成的链表。
缴费支付交易链表中的缴费支付交易包括:所述缴费支付交易链表中的未结算交易累积至当前缴费支付交易时对应的累计值。
具体地,该累计值可以是指所述缴费支付交易链表中与上一次监听到缴费结算请求交易的时刻对应的链表尾节点,累计至当前缴费支付交易的累计值。
例如,假设上一次监听到缴费结算请求交易的时刻对应的缴费支付交易链表尾节点为第10个节点。假设,从上一次监听到缴费结算请求交易的时刻时起至当前时刻的时间段内,又有5个节点加入该缴费支付交易链表。第11节点起的节点均为未结算节点。该缴费支付交易链表的第15个节点对应的缴费支付交易中的累计值为:从第11个节点对应的缴费支付交易累计至第15个节点对应的缴费支付交易的累计值。
其中,缴费支付交易中的累计值包括:累计支付总金额、累计支付总笔数;这只只是对缴费支付交易中的累计值进行示例性地说明,不进行具体地限定。
2)缴费销账交易链表
缴费销账交易链表是由在所述区块链上存证的缴费销账交易按照销账顺序构成的链表。
缴费销账交易链表中的缴费销账交易包括:所述缴费销账交易链表中未结算交易累积至当前缴费销账交易时对应的累计值。
具体地,该累计值可以是指所述缴费销账交易链表中与上一次监听到结算请求的时刻对应的链表尾节点,累计至当前缴费销账交易的累计值。
例如,假设上一次监听到缴费结算请求的时刻对应的缴费销账交易链表尾节点为第11个节点。假设,从上一次监听到结算请求的时刻时起至当前时刻的时间段内,又有6个节点加入该缴费销账交易链表。从第11节点起的节点均为未结算节点,该缴费销账交易链表的第17个节点对应的缴费销账交易中的累计值为:从第12个节点对应的缴费销账交易累计至第17个节点对应的缴费销账交易的累计值。
缴费销账交易中的累计值包括:累计销账总金额、累计销账总笔数;这里只是对缴费销账交易中的累计值进行示例性地说明,不进行具体地限定。
在本说明书提供的实施例中,支付系统可响应于监听到的该缴费结算请求交易, 确定所述区块链存证的缴费支付交易链表的链表尾节点对应的目标缴费支付交易、以及所述缴费销账交易链表的链表尾节点对应的目标缴费销账交易中的累计值是否相同。
在实现时,支付系统可获取该区块链存证的缴费支付交易链表的链表尾节点的目标缴费支付交易,以及获取该区块链存证的缴费销账交易链表的链表尾节点对应的目标缴费销账交易。
支付系统可检测目标缴费支付交易携带的累计支付总金额与目标缴费销账交易携带的累计销账总金额是否相同、以及支付系统可检测标缴费支付交易携带的累计支付总笔数与目标缴费销账交易携带的累计销账总笔数是否相同。
如果目标缴费支付交易携带的累计支付总金额与目标缴费销账交易携带的累计销账总金额相同、且目标缴费支付交易携带的累计支付总笔数与目标缴费销账交易携带的累计销账总笔数相同,支付系统可基于该目标缴费支付交易中携带的累计支付总金额、或者该第一目标缴费销账交易中携带的累计销账总金额来进行资金结算。
此外,在本说明书实施例中,当完成资金结算后,支付系统可基于资金结算结果构造缴费结算凭证交易,并将缴费结算凭证交易发布至区块链进行存证。
此外,在完成资金结算后,支付系统可将该支付系统维护的累计支付总金额清零,将该支付系统维护的累计支付总笔数清零。
收款方系统在监听到该缴费结算凭证交易后,可将收款方系统维护的累计销账总金额清零,将收款方系统维护的累计支付总笔数清零。
例如,假设支付系统在监听到缴费结算请求交易时,缴费支付交易链表中的尾节点为第18个节点,该18个节点对应的缴费支付交易简称为第18个缴费支付交易。缴费销账交易链表中的尾节点为第18个节点,该第18个节点对应缴费销账交易简称为第18个缴费销账交易。
假设,第18个缴费支付交易的累计支付总金额为800元,累计支付总笔数为8笔。第18个缴费销账交易的累计销账总金额为800元,累计销账总笔数为8笔。
假设,累计支付总金额变量的取值为800元,累计支付总笔数变量的取值为8笔。累计销账总金额变量的取值为800元,累计销账总笔数变量的取值为8笔。
当支付系统监听到缴费结算请求交易时,可确定第18个缴费支付交易中的累计支付总金额(即800元)与第18个缴费销账交易中的累计销账总金额(即800元)是 否一致,以及确定第18个缴费支付交易中的累计支付总笔数(即8笔)与第18个缴费销账交易中的累计销账总笔数(即8笔)是否一致。
在本例中,由于两者均一致,所以支付系统可以基于第18个缴费支付交易中的累计支付总金额或第18个缴费销账交易中的累计销账总金额(即800元)进行资金结算。
在结算完成后,支付系统可将该支付系统维护的累计支付总金额清0,将累计支付总笔数变量的取值清0。
此外,支付系统可构造缴费结算凭证交易,并将该缴费结算凭证交易发布至区块链进行存证。
收款方系统在监听到该缴费结算凭证交易后,可将收款方系统维护的累计销账总金额清0,将收款方系统维护的累计支付总笔数清0。
由上述描述可知,一方面由于支付系统不再按照约定的结算时刻通过与收款方系统进行交互完成资金结算,而是支付系统在监听到由收款方系统在区块链上发布的缴费结算请求交易时,利用区块链上存证的缴费支付交易和缴费销账交易进行对账并完成资金结算;由于在对账和资金结算时,不再需要收款方系统参与,因此,可以实现随时进行资金结算,增加资金结算的灵活性。
另一方面,由于区块链存证的缴费支付交易和缴费销账交易均携带了累计值,这使得支付系统在进行对账时,可以直接通过缴费支付交易链表尾节点对应的缴费支付交易和缴费销账交易链表尾节点对应缴费销账交易中的累计值进行对账,而不需要再统计上一次结算时刻至当前时刻所有缴费支付交易的累计值和所有缴费销账交易的累计值,从而大大降低了支付系统在进行资金结算时的工作负荷。
与上述方法实施例相对应,本说明书还提供了一种基于区块链的结算装置的实施例。本说明书基于区块链的结算装置的实施例可以应用在电子设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在电子设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图6所示,为本说明书的区块的业务配置装置所在电子设备的一种硬件结构图,除了图6所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的电子设备通常根据该电子设备的实际功能,还可以包括其他硬件,对此不再赘述。
该电子设备可以是与区块链对接的支付系统,也可以是与区块链对接的收款方系统。
参见图7,图7是本说明书一示例性实施例示出的一种基于区块链的结算装置的框图,该装置可应用在与区块链对接的支付系统上,可包括如下所示单元。
监听单元701,用于监听收款方系统在所述区块链中存证的结算请求交易;
第一获取单元702,用于响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
确定单元703,用于确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
结算单元704,用于如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
可选的,所述装置还包括:
第二获取单元705,用于获取用户终端发送的支付消息;所述支付消息中携带支付信息;
第一构造单元706,用于响应于所述支付消息,基于所述支付信息构造缴费支付交易;
第一发布单元707,用于将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
可选的,所述第一发布单元707,在将所述缴费支付交易发布至区块链进行存证时,具体用于检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易与当前所述缴费销账链表的链表尾节点对应的缴费销账交易中的累计值是否相同;若相同,则将所 述缴费支付交易发布至区块链进行存证。
可选的,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述支付系统维护了所述缴费支付交易链表的链表尾节点对应的缴费支付交易中的累计支付总金额和累计支付总笔数;
所述第一构造单元706,具体用于获取当前所述缴费交易链表的链表尾节点对应的缴费支付交易,并生成该链表尾节点对应的缴费支付交易的哈希指针;基于所述支付系统维护的累计支付总金额和所述支付消息中携带的支付金额,确定所述缴费支付交易中的累计支付总金额;基于所述支付系统维护的累计支付总笔数,确定所述缴费支付交易中的累计支付总笔数;基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
可选的,所述装置还包括:
更新单元708,用于在将所述缴费支付交易发布至区块链进行存证后,采用所述缴费支付交易中记录的累计支付总金额和累计支付总笔数、分别更新所述支付系统维护的累计支付总金额和累计支付总笔数。
可选的,所述装置还包括:
复位单元709,用于在确定资金结算完成后,将所述支付系统维护的累计支付总金额和累计支付总笔数清零。
可选的,所述装置还包括:
第二构造单元710,用于在确定资金结算完成后,基于资金结算结果构造缴费结算凭证交易;
第二发布单元711,用于将所述缴费结算凭证交易发布至所述区块链进行存证。
参见图8,图8是本说明书一示例性实施例示出的另一种基于区块链的结算装置的框图,该装置可应用在与区块链对接的收款方系统上,可包括如下所示单元。
第一构造单元801,用于响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
第一发布单元802,用于将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
可选的,所述装置还包括:
第一监听单元803,用于监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
销账单元804,用于响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行缴费销账;
第二构造单元805,用于基于缴费销账结果构造缴费销账交易;
第二发布单元806,用于将缴费销账交易发布至所述区块链进行存证。
可选的,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数;
所述第二构造单元805,具体用于获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针;生成监听到的所述缴费支付交易的哈希指针;基于所述收款方系统维护的累计销账总金额和所述缴费支付交易中携带的支付金额,确定所述缴费销账交易中的累计销账总金额;基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数;基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数,构造缴费销账交易。
可选的,所述第二发布单元806,具体用于检测所述收款方系统维护的累计销账总金额与所述支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述收款方系统维护的累计销账笔数加1后的值是否与所述缴费支付交易中的累计支付总笔数一致;若均一致,则将缴费销账交易发布至所述区块链进行存证。
可选的,所述装置还包括:
更新单元807,用于在将缴费销账交易发布至所述区块链进行存证之后,基于所述缴费销账交易中的累计销账总金额和累计销账总笔数,更新所述收款方系统维护的累计销账总金额和累计销账总笔数。
可选的,所述装置还包括:
第二监听单元808,用于监听由所述支付系统发布至所述区块链的缴费结算凭证交易;
复位单元809,用于响应于所述缴费结算凭证交易,将所述收款方系统维护的累计销账总金额和累计销账总笔数清零。
与上述方法实施例对应,本说明书还提供了一种电子设备的实施例。该电子设备包括:处理器以及用于存储机器可执行指令的存储器;其中,处理器和存储器通常通过内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
监听收款方系统在所述区块链中存证的结算请求交易;
响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
获取用户终端发送的支付消息;所述支付消息中携带支付信息;
响应于所述支付消息,基于所述支付信息构造缴费支付交易;
将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易与当前所述缴费销账链表的链表尾节点对应的缴费销账交易中的累计值是否相同;
若相同,则将所述缴费支付交易发布至区块链进行存证。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述支付系统维护了所述缴费支付交易链表的链表尾节点对应的缴费支付交易中的累计支付总金额和累计支付总笔数;
通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
获取当前所述缴费交易链表的链表尾节点对应的缴费支付交易,并生成该链表尾节点对应的缴费支付交易的哈希指针;
基于所述支付系统维护的累计支付总金额和所述支付消息中携带的支付金额,确定所述缴费支付交易中的累计支付总金额;
基于所述支付系统维护的累计支付总笔数,确定所述缴费支付交易中的累计支付总笔数;
基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
在将所述缴费支付交易发布至区块链进行存证后,采用所述缴费支付交易中记录的累计支付总金额和累计支付总笔数、分别更新所述支付系统维护的累计支付总金额和累计支付总笔数。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器还被促使:
在确定资金结算完成后,将所述支付系统维护的累计支付总金额和累计支付总笔数清零。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器还被促使:
在确定资金结算完成后,基于资金结算结果构造缴费结算凭证交易;
将所述缴费结算凭证交易发布至所述区块链进行存证。
与上述方法实施例对应,本说明书还提供了另一种电子设备的实施例。该电子设备包括:处理器以及用于存储机器可执行指令的存储器;其中,处理器和存储器通常通过内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行 缴费销账;
基于缴费销账结果构造缴费销账交易,并将缴费销账交易发布至所述区块链进行存证。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
可选的,所述支付信息包括:支付金额;
所述收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数;
通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针;
生成监听到的所述缴费支付交易的哈希指针;
基于所述收款方系统维护的累计销账总金额和所述缴费支付交易中携带的支付金额,确定所述缴费销账交易中的累计销账总金额;
基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数;
基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数, 构造缴费销账交易。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
检测所述收款方系统维护的累计销账总金额与所述支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述收款方系统维护的累计销账笔数加1后的值是否与所述缴费支付交易中的累计支付总笔数一致;
若均一致,则将缴费销账交易发布至所述区块链进行存证。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
基于所述缴费销账交易中的累计销账总金额和累计销账总笔数,更新所述收款方系统维护的累计销账总金额和累计销账总笔数。
可选的,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
监听由所述支付系统发布至所述区块链的缴费结算凭证交易;
响应于所述缴费结算凭证交易,将所述收款方系统维护的累计销账总金额和累计销账总笔数清零。
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。

Claims (36)

  1. 一种基于区块链的结算方法,所述方法应用于与区块链对接的支付系统,所述方法包括:
    监听收款方系统在所述区块链中存证的结算请求交易;
    响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
    确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
    如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
  2. 根据权利要求1所述的方法,所述缴费支付交易链表中的缴费支付交易通过如下方式存证:
    获取用户终端发送的支付消息;所述支付消息中携带支付信息;
    响应于所述支付消息,基于所述支付信息构造缴费支付交易;
    将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
  3. 根据权利要求2所述的方法,所述将所述缴费支付交易发布至区块链进行存证,包括:
    检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易与当前所述缴费销账链表的链表尾节点对应的缴费销账交易中的累计值是否相同;
    若相同,则将所述缴费支付交易发布至区块链进行存证。
  4. 根据权利要求1至3任一项所述的方法,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
    所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
  5. 根据权利要求4所述的方法,
    所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
    所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
  6. 根据权利要求5所述的方法,所述支付信息包括:支付金额;
    所述支付系统维护了所述缴费支付交易链表的链表尾节点对应的缴费支付交易中的累计支付总金额和累计支付总笔数;
    所述基于所述支付信息构造缴费支付交易,包括:
    获取当前所述缴费交易链表的链表尾节点对应的缴费支付交易,并生成该链表尾节点对应的缴费支付交易的哈希指针;
    基于所述支付系统维护的累计支付总金额和所述支付消息中携带的支付金额,确定所述缴费支付交易中的累计支付总金额;
    基于所述支付系统维护的累计支付总笔数,确定所述缴费支付交易中的累计支付总笔数;
    基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
  7. 根据权利要求6所述的方法,在将所述缴费支付交易发布至区块链进行存证后,所述方法还包括:
    采用所述缴费支付交易中记录的累计支付总金额和累计支付总笔数、分别更新所述支付系统维护的累计支付总金额和累计支付总笔数。
  8. 根据权利要求6所述的方法,所述方法还包括:
    在确定资金结算完成后,将所述支付系统维护的累计支付总金额和累计支付总笔数清零。
  9. 根据权利要求1所述的方法,所述方法还包括:
    在确定资金结算完成后,基于资金结算结果构造缴费结算凭证交易;
    将所述缴费结算凭证交易发布至所述区块链进行存证。
  10. 一种基于区块链的结算方法,所述方法应用于与区块链对接的收款方系统,所述方法包括:
    响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
    将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按 照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
    其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
  11. 根据权利要求10所述的方法,所述缴费销账交易通过如下方式存证:
    监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
    响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行缴费销账;
    基于缴费销账结果构造缴费销账交易,并将缴费销账交易发布至所述区块链进行存证。
  12. 根据权利要求10所述的方法,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
    所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
  13. 根据权利要求12所述的方法,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
    所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
  14. 根据权利要求13所述的方法,所述支付信息包括:支付金额;
    所述收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数;
    所述基于缴费销账结果构造缴费销账交易,包括:
    获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针;
    生成监听到的所述缴费支付交易的哈希指针;
    基于所述收款方系统维护的累计销账总金额和所述缴费支付交易中携带的支付金额,确定所述缴费销账交易中的累计销账总金额;
    基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数;
    基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数,构造缴费销账交易。
  15. 根据权利要求14所述的方法,所述将缴费销账交易发布至所述区块链进行存证,包括:
    检测所述收款方系统维护的累计销账总金额与所述支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述收款方系统维护的累计销账笔数加1后的值是否与所述缴费支付交易中的累计支付总笔数一致;
    若均一致,则将缴费销账交易发布至所述区块链进行存证。
  16. 根据权利要求14所述的方法,所述在将缴费销账交易发布至所述区块链进行存证之后,所述方法还包括:
    基于所述缴费销账交易中的累计销账总金额和累计销账总笔数,更新所述收款方系统维护的累计销账总金额和累计销账总笔数。
  17. 根据权利要求14所述的方法,所述方法还包括:
    监听由所述支付系统发布至所述区块链的缴费结算凭证交易;
    响应于所述缴费结算凭证交易,将所述收款方系统维护的累计销账总金额和累计销账总笔数清零。
  18. 一种基于区块链的结算装置,所述装置应用于与区块链对接的支付系统,所述装置包括:
    监听单元,用于监听收款方系统在所述区块链中存证的结算请求交易;
    第一获取单元,用于响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
    确定单元,用于确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
    结算单元,用于如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
  19. 根据权利要求18所述的装置,所述装置还包括:
    第二获取单元,用于获取用户终端发送的支付消息;所述支付消息中携带支付信息;
    第一构造单元,用于响应于所述支付消息,基于所述支付信息构造缴费支付交易;
    第一发布单元,用于将所述缴费支付交易发布至区块链进行存证,以使得收款方系统在监听到所述区块链中存证的缴费支付交易后,基于该缴费支付交易中的支付信息进行缴费销账,并将由缴费销账结果构造的缴费销账交易发布至所述区块链进行存证。
  20. 根据权利要求19所述的装置,所述第一发布单元,在将所述缴费支付交易发布至区块链进行存证时,具体用于检测当前所述缴费交易链表的链表尾节点对应的缴费支付交易与当前所述缴费销账链表的链表尾节点对应的缴费销账交易中的累计值是否相同;若相同,则将所述缴费支付交易发布至区块链进行存证。
  21. 根据权利要求18至20任一项所述的装置,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
    所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
  22. 根据权利要求21所述的装置,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
    所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
  23. 根据权利要求22所述的装置,所述支付信息包括:支付金额;
    所述支付系统维护了所述缴费支付交易链表的链表尾节点对应的缴费支付交易中的累计支付总金额和累计支付总笔数;
    所述第一构造单元,具体用于获取当前所述缴费交易链表的链表尾节点对应的缴费支付交易,并生成该链表尾节点对应的缴费支付交易的哈希指针;基于所述支付系统维护的累计支付总金额和所述支付消息中携带的支付金额,确定所述缴费支付交易中的累计支付总金额;基于所述支付系统维护的累计支付总笔数,确定所述缴费支付交易中的累计支付总笔数;基于所述支付信息、生成的哈希指针、所述缴费支付交易中的累计支付总金额和累计支付总笔数,构造所述缴费支付交易。
  24. 根据权利要求23所述的装置,所述装置还包括:
    更新单元,用于在将所述缴费支付交易发布至区块链进行存证后,采用所述缴费支付交易中记录的累计支付总金额和累计支付总笔数、分别更新所述支付系统维护的累计支付总金额和累计支付总笔数。
  25. 根据权利要求23所述的装置,所述装置还包括:
    复位单元,用于在确定资金结算完成后,将所述支付系统维护的累计支付总金额和累计支付总笔数清零。
  26. 根据权利要求18所述的装置,所述装置还包括:
    第二构造单元,用于在确定资金结算完成后,基于资金结算结果构造缴费结算凭证交易;
    第二发布单元,用于将所述缴费结算凭证交易发布至所述区块链进行存证。
  27. 一种基于区块链的结算装置,所述装置应用于与区块链对接的收款方系统,所述装置包括:
    第一构造单元,用于响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
    第一发布单元,用于将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
    其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
  28. 根据权利要求27所述的装置,所述装置还包括:
    第一监听单元,用于监听由支付系统在所述区块链中存证的缴费支付交易;其中,所述缴费支付交易中携带支付信息;
    销账单元,用于响应于监听到的所述缴费支付交易,基于所述缴费支付交易中的支付信息进行缴费销账;
    第二构造单元,用于基于缴费销账结果构造缴费销账交易;
    第二发布单元,用于将缴费销账交易发布至所述区块链进行存证。
  29. 根据权利要求27所述的装置,所述缴费支付交易的累计值包括:累计支付总金额和累计支付总笔数;
    所述缴费销账交易的累计值包括:累计销账总金额和累计销账总笔数。
  30. 根据权利要求29所述的装置,所述缴费支付交易中还包括:指向所述区块链存证的上一笔缴费支付交易的哈希指针;
    所述缴费销账结果交易还包括:指向所述区块链存证的上一笔缴费销账交易的哈希指针、指向与所述缴费销账交易对应的缴费支付交易的哈希指针。
  31. 根据权利要求30所述的装置,所述支付信息包括:支付金额;
    所述收款方系统维护了所述缴费销账交易链表的链表尾节点对应的缴费销账交易中的累计销账总金额和累计销账总笔数;
    所述第二构造单元,具体用于获取当前所述缴费销账链表的链表尾节点对应的缴费销账交易,并生成该链表尾节点对应的缴费销账交易的哈希指针;生成监听到的所述缴费支付交易的哈希指针;基于所述收款方系统维护的累计销账总金额和所述缴费支付交易中携带的支付金额,确定所述缴费销账交易中的累计销账总金额;基于所述收款方系统维护的累计销账总笔数,确定所述缴费销账交易中的累计销账总笔数;基于所述缴费销账结果、该链表尾节点对应的缴费销账交易的哈希指针、所述缴费支付交易的哈希指针、所述缴费销账交易中的累计销账总金额和累计销账总笔数,构造缴费销账交易。
  32. 根据权利要求31所述的装置,所述第二发布单元,具体用于检测所述收款方系统维护的累计销账总金额与所述支付金额之和是否与所述缴费支付交易中的累计支付总金额一致、以及检测所述收款方系统维护的累计销账笔数加1后的值是否与所述缴费支付交易中的累计支付总笔数一致;若均一致,则将缴费销账交易发布至所述区块链进行存证。
  33. 根据权利要求31所述的装置,所述装置还包括:
    更新单元,用于在将缴费销账交易发布至所述区块链进行存证之后,基于所述缴费销账交易中的累计销账总金额和累计销账总笔数,更新所述收款方系统维护的累计销账总金额和累计销账总笔数。
  34. 根据权利要求31所述的装置,所述装置还包括:
    第二监听单元,用于监听由所述支付系统发布至所述区块链的缴费结算凭证交易;
    复位单元,用于响应于所述缴费结算凭证交易,将所述收款方系统维护的累计销账总金额和累计销账总笔数清零。
  35. 一种电子设备,包括:
    处理器;
    用于存储机器可执行指令的存储器;
    其中,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机 器可执行指令,所述处理器被促使:
    监听收款方系统在所述区块链中存证的结算请求交易;
    响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;
    确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;
    如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算。
  36. 一种电子设备,包括:
    处理器;
    用于存储机器可执行指令的存储器;
    其中,通过读取并执行所述存储器存储的与基于区块链的结算的控制逻辑对应的机器可执行指令,所述处理器被促使:
    响应于客户端发起的缴费结算请求,基于该结算请求构造结算请求交易;
    将所述缴费结算请求交易发布至所述区块链进行存证,以使支付系统监听收款方系统在所述区块链中存证的缴费结算请求交易;响应于监听到的所述缴费结算请求交易,获取由所述区块链上存证的缴费支付交易按照缴费支付顺序构成的缴费支付交易链表的链表尾节点对应的目标缴费支付交易;以及,由所述区块链上存证的缴费销账交易按照缴费销账顺序构成的缴费销账交易链表的链表尾节点对应的目标缴费销账交易;确定所述目标缴费支付交易和所述目标缴费销账交易的累计值是否相同;如果相同,基于所述目标缴费支付交易中或所述目标缴费销账交易中的累计值进行资金结算;
    其中,所述缴费支付交易包括所述缴费支付交易链表中的未结算交易累积至该缴费支付交易时对应的累计值;所述缴费销账交易包括所述缴费销账交易链表中的未结算交易累积至该缴费支付交易时对应的累计值。
PCT/CN2020/070848 2019-04-29 2020-01-08 一种基于区块链的结算方法、装置以及电子设备 Ceased WO2020220746A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/803,720 US10991045B2 (en) 2019-04-29 2020-02-27 Blockchain-based settlement method, apparatus, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910356863.5A CN110163605B (zh) 2019-04-29 2019-04-29 一种基于区块链的结算方法、装置以及电子设备
CN201910356863.5 2019-04-29

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/803,720 Continuation US10991045B2 (en) 2019-04-29 2020-02-27 Blockchain-based settlement method, apparatus, and electronic device

Publications (1)

Publication Number Publication Date
WO2020220746A1 true WO2020220746A1 (zh) 2020-11-05

Family

ID=67633323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/070848 Ceased WO2020220746A1 (zh) 2019-04-29 2020-01-08 一种基于区块链的结算方法、装置以及电子设备

Country Status (2)

Country Link
CN (2) CN110163605B (zh)
WO (1) WO2020220746A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114387115A (zh) * 2021-12-14 2022-04-22 泰康保险集团股份有限公司 一种三支柱缴费的管理方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163605B (zh) * 2019-04-29 2020-09-11 阿里巴巴集团控股有限公司 一种基于区块链的结算方法、装置以及电子设备
US10991045B2 (en) 2019-04-29 2021-04-27 Advanced New Technologies Co., Ltd. Blockchain-based settlement method, apparatus, and electronic device
CN111275840B (zh) * 2020-02-19 2021-08-03 中国联合网络通信集团有限公司 一种车辆收费方法及装置
CN111415160B (zh) * 2020-04-27 2024-05-28 中国银行股份有限公司 基于区块链的销账业务处理方法、系统及各相关节点
CN112116440A (zh) * 2020-09-22 2020-12-22 筑权网(武汉)科技有限公司 缴费提醒方法、装置、设备及存储介质
CN112926980A (zh) * 2021-02-26 2021-06-08 贵州鑫众搏骏科技有限公司 一种基于区块链的支付数据交易方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170270527A1 (en) * 2016-03-17 2017-09-21 John Rampton Assessing trust to facilitate blockchain transactions
CN107918868A (zh) * 2016-10-07 2018-04-17 华讯资讯服务有限公司 结合区块链电子票券交易系统及其电子票券交易方法
CN108960826A (zh) * 2018-06-29 2018-12-07 杭州复杂美科技有限公司 一种交易组、交易组构造方法、存储介质、设备和系统
CN109003175A (zh) * 2018-07-06 2018-12-14 国网汇通金财(北京)信息科技有限公司 一种基于区块链的对账方法及系统
CN109102384A (zh) * 2018-07-27 2018-12-28 中国联合网络通信集团有限公司 缴费方法及网络系统
CN110163605A (zh) * 2019-04-29 2019-08-23 阿里巴巴集团控股有限公司 一种基于区块链的结算方法、装置以及电子设备

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150348017A1 (en) * 2014-06-03 2015-12-03 Jonathan Allmen Method for integrating cryptocurrency transfer on a social network interface
HK1249791A1 (zh) * 2015-03-31 2018-11-09 Nasdaq, Inc. 区块链交易记录的系统和方法
US10423993B2 (en) * 2015-12-28 2019-09-24 Raise Marketplace, Llc Authenticating an exchange item in an exchange item marketplace network
US11132704B2 (en) * 2017-07-06 2021-09-28 Mastercard International Incorporated Method and system for electronic vouchers via blockchain
CN108805564B (zh) * 2018-04-26 2020-10-20 布比(北京)网络技术有限公司 一种基于区块链进行支付结算的方法及系统
CN108764868B (zh) * 2018-05-25 2020-10-27 全链通有限公司 区块链节点代理对账方法和区块对账代理节点
CN109034797B (zh) * 2018-06-26 2021-09-17 东莞市大易产业链服务有限公司 一种基于区块链技术的票据凭证支付方法
CN109377216B (zh) * 2018-08-07 2021-03-23 创新先进技术有限公司 一种基于中心化结算与区块链存证的交易方法及系统
CN109472574A (zh) * 2018-09-19 2019-03-15 平安科技(深圳)有限公司 支付方法、装置、计算机设备及存储介质
CN109615363A (zh) * 2019-01-04 2019-04-12 深圳壹账通智能科技有限公司 聚合支付方法、装置、系统、计算机设备和存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170270527A1 (en) * 2016-03-17 2017-09-21 John Rampton Assessing trust to facilitate blockchain transactions
CN107918868A (zh) * 2016-10-07 2018-04-17 华讯资讯服务有限公司 结合区块链电子票券交易系统及其电子票券交易方法
CN108960826A (zh) * 2018-06-29 2018-12-07 杭州复杂美科技有限公司 一种交易组、交易组构造方法、存储介质、设备和系统
CN109003175A (zh) * 2018-07-06 2018-12-14 国网汇通金财(北京)信息科技有限公司 一种基于区块链的对账方法及系统
CN109102384A (zh) * 2018-07-27 2018-12-28 中国联合网络通信集团有限公司 缴费方法及网络系统
CN110163605A (zh) * 2019-04-29 2019-08-23 阿里巴巴集团控股有限公司 一种基于区块链的结算方法、装置以及电子设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114387115A (zh) * 2021-12-14 2022-04-22 泰康保险集团股份有限公司 一种三支柱缴费的管理方法及装置

Also Published As

Publication number Publication date
CN112488702B (zh) 2024-06-07
CN110163605A (zh) 2019-08-23
CN112488702A (zh) 2021-03-12
CN110163605B (zh) 2020-09-11

Similar Documents

Publication Publication Date Title
JP7139499B6 (ja) ブロックチェーン上のセキュアなピアツーピア通信の方法
WO2020220746A1 (zh) 一种基于区块链的结算方法、装置以及电子设备
US20200226677A1 (en) Syndicated loan distributed ledger pass-through processing
JP6813477B2 (ja) 信頼度が低い、または信頼度が皆無の当事者間での価値転送を円滑化する装置、システム、または方法
JP2023134665A (ja) ブロックチェーンが実現される方法及びシステム
JP2022547130A (ja) ブロックチェーンベースの記録プロセスを提供するシステムおよび方法
US9773237B2 (en) Synchronous split payment transaction management
US12112318B2 (en) Method and system for defining, creating, managing, and transacting multiple classes of digital objects
CN110706110A (zh) 基于换汇平台的数据处理方法、装置、设备及存储介质
JP2019523495A (ja) 分散トランザクションコンセンサスネットワークのデジタル財管理
CN109643415A (zh) 交易管理技术
CN110162527A (zh) 一种基于区块链的业务溯源方法、装置以及电子设备
US20210374843A1 (en) Debt Resource Management in a Distributed Ledger System
CN105474244A (zh) 支付联合服务
CN110930257A (zh) 一种数据处理方法、装置、设备及存储介质
CN110728523B (zh) 电子钱包的交易处理方法、装置、设备及存储介质
CN114298841A (zh) 基于区块链投融资撮合交易技术方案
CN109544343A (zh) 一种基于账单数据的双向交易清算方法和系统
JP4461618B2 (ja) 決済装置及び方法
CN111401873B (zh) 一种任务创建方法、装置、存储介质和电子设备
US10991045B2 (en) Blockchain-based settlement method, apparatus, and electronic device
JP2018124640A (ja) 貿易支援方法、仮想通貨管理方法、貿易支援システム、仮想通貨管理システム、貿易支援プログラム、および仮想通貨管理プログラム
HK40051179A (zh) 一种基於区块链的结算方法、装置以及电子设备
HK40013024B (zh) 一种基於区块链的结算方法、装置以及电子设备
HK40013024A (zh) 一种基於区块链的结算方法、装置以及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20799213

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20799213

Country of ref document: EP

Kind code of ref document: A1