WO2021239066A1 - Consortium blockchain network-based transaction execution method, and system - Google Patents

Consortium blockchain network-based transaction execution method, and system Download PDF

Info

Publication number
WO2021239066A1
WO2021239066A1 PCT/CN2021/096506 CN2021096506W WO2021239066A1 WO 2021239066 A1 WO2021239066 A1 WO 2021239066A1 CN 2021096506 W CN2021096506 W CN 2021096506W WO 2021239066 A1 WO2021239066 A1 WO 2021239066A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
execution
amount
node
fee
Prior art date
Application number
PCT/CN2021/096506
Other languages
French (fr)
Chinese (zh)
Inventor
林凯东
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021239066A1 publication Critical patent/WO2021239066A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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

Definitions

  • the embodiments of this specification relate to the field of information technology, and in particular to a transaction execution method and system based on a consortium chain network.
  • public chain networks such as Bitcoin and Ethereum
  • POW Proof-Of-Work
  • consortium chain network architecture has gradually become the mainstream of application.
  • the consortium chain network usually does not support the POW algorithm.
  • the nodes in the consortium chain network are usually based on the practical Byzantine Fault Tolerance (PBFT) to achieve consensus.
  • PBFT Byzantine Fault Tolerance
  • the embodiment of this specification provides a transaction execution method based on the alliance chain network, which is applied to each of the alliance chain networks.
  • the method includes: obtaining the transaction to be executed; determining the amount of execution fee corresponding to the transaction, and triggering the execution of the transaction; wherein, the amount of execution fee corresponding to the transaction is the same as the amount of execution fee consumed by the execution of the transaction.
  • the amount of computing resources is positively correlated, and is positively correlated with the amount of storage resources consumed by storing the transaction; after triggering the execution of the transaction, based on the amount of execution fees corresponding to the transaction, determine the amount to be paid by the user account that initiated the transaction.
  • the amount of execution fee, and the amount of execution fee to be allocated to each node based on the preset fee distribution rule and the amount of execution fee corresponding to the transaction; the amount of execution fee to be paid for the user account that initiated the transaction is compared with the amount of execution fee to be paid
  • the amount of execution fee allocated to each node is written into the blockchain.
  • a transaction execution method based on multiple alliance chain networks includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes, and the method includes: For each consortium chain network, each node in the consortium chain network executes: obtains the transaction to be executed; determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; wherein, the execution fee corresponding to the transaction The amount is positively correlated with the amount of computing resources consumed by the execution of the transaction, and is positively correlated with the amount of storage resources consumed by the storage of the transaction; after the execution of the transaction is triggered, it is determined based on the amount of the execution fee corresponding to the transaction The amount of execution fees to be paid by the user account that initiated the transaction, and the amount of execution fees to be allocated to each node based on the preset fee distribution rules and the amount of execution fees corresponding to the transaction; The amount of execution fees to be paid by the user account and the amount of execution fees to be
  • a transaction execution system including a consortium chain network; each node in the consortium chain network executes: obtains the transaction to be executed; determines the amount of execution fee corresponding to the transaction, And, trigger the execution of the transaction; wherein the execution fee amount corresponding to the transaction is positively correlated with the amount of computing resources consumed by executing the transaction, and is positively correlated with the amount of storage resources consumed by storing the transaction; After the transaction is executed, the amount of execution fee to be paid by the user account that initiated the transaction is determined based on the amount of execution fee corresponding to the transaction, and the amount of execution fee corresponding to the transaction is calculated based on the preset fee distribution rule
  • the amount of execution fees to be allocated to each node; the amount of execution fees to be paid for the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain.
  • a transaction execution system including a node network, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes; for each alliance chain network , Each node in the alliance chain network executes: obtains the transaction to be executed; determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is the same as the execution fee amount corresponding to the transaction.
  • the amount of computing resources consumed by the exchange is positively correlated with the amount of storage resources consumed by storing the exchange; after the execution of the transaction is triggered, the user who initiated the transaction is determined based on the amount of execution fees corresponding to the transaction.
  • the amount of execution fees to be paid by the account, and the amount of execution fees to be allocated to each node based on the preset fee distribution rules and the amount of execution fees corresponding to the transaction; the execution of the user account to be paid for initiating the transaction is calculated
  • the amount of cost and the amount of execution cost to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
  • each node in the alliance chain network determines the execution fee amount (or called Gas) corresponding to the transaction to be executed, and the execution fee amount is positively correlated with the amount of computing resources consumed to execute the transaction. And it is positively correlated with the amount of storage resources consumed by storage transactions.
  • the node triggers the execution transaction account, it will determine the amount of execution fees to be paid for the user account that initiates the transaction, as well as the amount of execution fees to be allocated to each node, and also write the above determination results into the blockchain.
  • a technical process for incentivizing nodes to execute transactions under the PBFT mechanism of the alliance chain network is provided.
  • each node participating in the execution of the transaction can obtain Gas;
  • second not only the amount of computing resources consumed by the execution of the transaction is considered to determine the amount of execution fees, but also the subsequent consumption of the storage transaction
  • Third, the amount of execution fees to be paid by the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain, so that the expenditure and income of the execution fees of each transaction can be trusted. Deposit evidence.
  • any one of the embodiments of the present specification does not need to achieve all the above-mentioned effects.
  • Figure 1 is a schematic flow diagram of a transaction execution method based on a consortium chain network
  • Figure 2 is a schematic structural diagram of a transaction execution system provided by an embodiment of this specification
  • FIG. 3 is a schematic structural diagram of another transaction execution system provided by an embodiment of this specification.
  • Figure 4 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification.
  • Figure 5 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification.
  • Fig. 6 is a schematic structural diagram of a device for configuring the method of the embodiment of this specification.
  • an organization can act as the initiator of the alliance chain network and initiate the alliance chain network.
  • Other organizations can act as participants in the alliance chain network and join the alliance chain network for a fee or for free.
  • the institution can provide Gas exchange service, which is used to characterize transaction execution fees in the alliance chain network. Gas has a certain exchange ratio with real-world legal currency, and the exchange ratio can be determined by the initiator.
  • the gas owned by the user is stored in the user account, and the gas owned by the node is stored in the node account.
  • the user account and the node account may be a centralized account registered on the server of the initiator, or a decentralized account registered in the alliance chain network.
  • the initiator can initiate a recharge transaction through the node account under its control.
  • the user account ID and the recharged Gas amount are specified in the recharge transaction.
  • After the recharge transaction is written into the blockchain of the alliance chain network, it is equivalent to adding these gases to the user's account.
  • users want to exchange the Gas in their decentralized account back to legal currency they can initiate a redemption transaction through their user account.
  • the redemption transaction specifies the user account ID and the amount of gas to be exchanged.
  • the redemption transaction is written into the alliance chain network. After the block chain, it is equivalent to reducing the gas in the user's account, and the initiator will also return the corresponding legal currency to the user accordingly.
  • the initiator can also initiate a node network, and other organizations can join the node network as a joining party.
  • the node network there may be multiple alliance chain networks, and different alliance chain networks may include the same node or different nodes.
  • Each consortium chain network maintains the corresponding blockchain. For example, for a certain node, it may belong to both alliance chain network A and alliance chain network B. Then, the node locally maintains both the blockchain of alliance chain network A and the blockchain of alliance chain network B. .
  • code logic needs to be deployed on the nodes to implement operations related to execution fees, such as determining the amount of execution fees and determining the execution fees to be paid by the user account that initiated the transaction The amount, calculation of the amount of execution fee to be allocated to each node, and operations such as writing the amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the blockchain.
  • the code logic can be written into the smart contract deployed on the node.
  • the node executes a transaction based on the smart contract, it will also perform operations related to execution fees based on the smart contract.
  • the logic code can also be written into the firmware of the node.
  • the node executes transactions based on smart contracts, and on the other hand, executes operations related to execution fees based on the local firmware.
  • Fig. 1 is a schematic flow chart of a transaction execution method based on a consortium chain network, which includes the following steps: S100: Obtain a transaction to be executed.
  • the main body of execution of the method shown in Figure 1 is each node in the consortium chain network.
  • a user initiates a transaction through his user account, and sends the transaction to a node of a certain institution that the user is connected to, and the node of the institution further broadcasts the transaction to the entire network of the alliance chain network.
  • the node of the institution After each node completes the consensus based on the PBFT algorithm, it will determine the consensus block, and then each node needs to execute each transaction in the block.
  • the transaction to be executed above can be any transaction in the block.
  • S102 Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction.
  • the amount of execution fees corresponding to the transaction needs to meet: positive correlation with the amount of computing resources consumed by the execution of the transaction, and/ Or, it is positively correlated with the amount of storage resources consumed by storing the transaction.
  • the user who initiates the transaction can specify the execution fee amount in the transaction, and the node can extract the execution fee amount from the transaction.
  • the amount of execution fee specified by the user in the transaction is usually not greater than his account balance.
  • the amount of execution fee specified by the user in the transaction is usually greater than the account balance, and the excess is regarded as a liability of the user's account.
  • the node can verify whether the extracted execution fee amount is sufficient. For example, the node can calculate the amount of execution fee based on the amount of computing resources consumed by executing the transaction and the amount of storage resources consumed by storing the transaction. If the amount of calculated execution fee is greater than the amount of extracted execution fee, it will refuse to trigger execution The transaction.
  • the execution fee amount corresponding to the transaction may also be positively correlated with the expected storage duration corresponding to the transaction. Since the longer the storage time of the node for the transaction, the higher the cost paid, therefore, this solution also considers the expected storage duration of the transaction as a factor that affects the amount of execution fee corresponding to the transaction.
  • S104 After triggering the execution of the transaction, determine the amount of the execution fee to be paid by the user account that initiated the transaction based on the amount of the execution fee corresponding to the transaction, and execute the corresponding execution of the transaction based on a preset fee distribution rule The amount of cost, calculate the amount of execution cost to be allocated to each node.
  • the user account initiates a transaction, and the transaction is executed by each node in the blockchain network. In essence, the user account pays a fee to each node to encourage each node to execute the transaction.
  • step S104 is not a step for executing transactions.
  • executing transactions according to the corresponding business requirements of the exchange is not the focus of this solution.
  • the focus of this program is how to obtain Gas while the node executes the transaction, and keep the record of obtaining Gas.
  • the preset cost distribution rules can be specified according to actual needs.
  • the allocation rules can be negotiated and determined by each node in the alliance chain network, or can be specified by the initiator node of the alliance chain network.
  • the distribution rule may be: the amount of execution fee corresponding to the transaction/the number of nodes executing the transaction*the node distribution coefficient, and the remaining amount of execution cost is allocated to the initiator node.
  • the execution fee amount corresponding to the transaction is 90
  • the number of nodes executing the transaction is 3
  • the distribution coefficient of node 1 is 50%
  • the distribution coefficient of node 2 is 60%
  • the distribution coefficient of node 3 is 100%.
  • the amount of execution cost allocated by node 1 is 15, the amount of execution cost allocated by node 2 is 18, and the amount of execution cost allocated by node 3 is 30.
  • S106 Write the amount of execution fees to be paid to the user account that initiated the transaction and the amount of execution fees to be allocated to each node into the blockchain.
  • the node may write the amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the transaction execution result of the transaction; wherein, the transaction corresponds to The transaction execution result is written into the blockchain. Since nodes usually execute transactions based on smart contracts, get the execution results, and write the transactions and execution results into the blockchain (generally speaking, the transaction is written into the transaction tree in the block, and the execution result is anchored to the block Receipt tree), therefore, it is equivalent to implementing step S106 in this way.
  • the node can also encapsulate the amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node into a deposit certificate transaction, put the deposit certificate transaction in the local cache, and wait for the next consensus Pack the deposit certificate transaction into a block, and then write it to the blockchain.
  • each node in the alliance chain network determines the execution fee amount (or called Gas) corresponding to the transaction to be executed, and the execution fee amount is positively correlated with the amount of computing resources consumed to execute the transaction. And it is positively correlated with the amount of storage resources consumed by storage transactions.
  • the node triggers the execution transaction account, it will determine the amount of execution fee to be paid for the user account that initiated the transaction, as well as the amount of execution fee to be allocated to each node, and will also write the above determination result into the blockchain.
  • a technical process for incentivizing nodes to execute transactions under the PBFT mechanism of the alliance chain network is provided.
  • each node participating in the execution of the transaction can obtain Gas;
  • second not only the amount of computing resources consumed by the execution of the transaction is considered to determine the amount of execution fees, but also the subsequent consumption of the storage transaction
  • Third, the amount of execution fees to be paid by the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain, so that the expenditure and income of the execution fees of each transaction can be trusted. Deposit evidence.
  • the embodiment of this specification also provides a transaction execution method based on multiple alliance chain networks
  • the node network includes multiple alliance chain networks
  • different alliance chain networks include the same node or different nodes
  • the method includes: A consortium chain network, where each node in the consortium chain network executes: obtains the transaction to be executed; determines the execution fee amount corresponding to the transaction, and triggers the execution of the transaction; wherein the execution fee amount corresponding to the transaction is equal to The amount of computing resources consumed by the execution of the transaction is positively correlated, and is positively related to the amount of storage resources consumed by the storage of the transaction; after the execution of the transaction is triggered, based on the amount of execution fees corresponding to the transaction, it is determined to initiate the The amount of execution fee to be paid by the user account of the transaction, and the amount of execution fee to be allocated to each node based on the preset fee distribution rule and the amount of execution fee corresponding to the transaction; The amount of execution fees paid and the amount of execution fees to be allocated to each node are written into the blockchain corresponding to
  • FIG. 2 is a schematic structural diagram of a transaction execution system provided by an embodiment of this specification, including a consortium chain network;
  • Each node in the alliance chain network executes: obtains the transaction to be executed; determines the execution fee amount corresponding to the transaction, and triggers the execution of the transaction; wherein, the execution fee amount corresponding to the transaction is the same as the execution fee amount
  • the amount of computing resources consumed by the exchange is positively correlated, and is positively related to the amount of storage resources consumed by storing the exchange; after triggering the execution of the transaction, based on the amount of execution fees corresponding to the transaction, determine the initiator of the transaction
  • the amount of execution cost and the amount of execution cost to be allocated to each node are written into the blockchain.
  • FIG 3 is a schematic structural diagram of another transaction execution system provided by an embodiment of the specification, including a node network, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes; for each alliance A chain network in which each node in the alliance chain network executes: obtains the transaction to be executed; determines the execution fee amount corresponding to the transaction, and triggers the execution of the transaction; wherein the execution fee amount corresponding to the transaction is the same as the execution fee amount
  • the amount of computing resources consumed by the exchange is positively correlated, and is positively correlated with the amount of storage resources consumed by storing the exchange; after the execution of the transaction is triggered, the transaction is determined to be initiated based on the amount of execution fees corresponding to the transaction
  • block chain 1 is the block chain corresponding to alliance chain network 1
  • block chain 2 is the block chain corresponding to alliance chain network 2.
  • a node in Figure 3 belongs to both the alliance chain network 1 and the alliance chain network 2, so the node maintains the blockchain 1 and the blockchain 2 locally.
  • FIG. 4 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification, which is applied to each node in the alliance chain network.
  • the device includes: an acquisition module 401 to acquire a transaction to be executed; and a first processing module 402, Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed in executing the transaction, and is related to storing the transaction The amount of storage resources consumed is positively correlated; the second processing module 403, after triggering the execution of the transaction, determines the amount of execution fee to be paid by the user account that initiated the transaction based on the amount of execution fee corresponding to the transaction, and based on the forecast Set the fee distribution rule and the amount of execution fee corresponding to the transaction, calculate the amount of execution fee to be allocated to each node; write module 404, and compare the amount of execution fee to be paid to the user account that initiated the transaction with the amount to be allocated to The amount of execution fee for each no
  • the writing module 504 After the transaction, determine the amount of execution fee to be paid by the user account that initiated the transaction based on the amount of execution fee corresponding to the transaction, and calculate the amount of execution fee to be allocated based on the preset fee allocation rule and the amount of execution fee corresponding to the transaction The amount of execution fee for each node; the writing module 504 writes the amount of execution fee to be paid for the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the blockchain corresponding to the alliance chain network .
  • the embodiments of this specification also provide a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method shown in FIG. 1 when the program is executed. .
  • the device may include a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050.
  • the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040 realize the communication connection between each other in the device through the bus 1050.
  • the processor 1010 may be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for execution related Program to realize the technical solutions provided in the embodiments of this specification.
  • a general CPU Central Processing Unit, central processing unit
  • a microprocessor an application specific integrated circuit (Application Specific Integrated Circuit, ASIC)
  • ASIC Application Specific Integrated Circuit
  • the memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, etc.
  • the memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, related program codes are stored in the memory 1020 and called and executed by the processor 1010.
  • the input/output interface 1030 is used to connect an input/output module to realize information input and output.
  • the input/output/module can be configured in the device as a component (not shown in the figure), or can be connected to the device to provide corresponding functions.
  • the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
  • the bus 1050 includes a path to transmit information between various components of the device (for example, the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040).
  • the above device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include the necessary equipment for normal operation. Other components.
  • the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of the present specification, and not necessarily include all the components shown in the figures.
  • the embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method shown in FIG. 1 is implemented.
  • Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments.
  • the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
  • the device embodiments described above are merely illustrative, and the modules described as separate components may or may not be physically separated.
  • the functions of the modules can be combined in the same way when implementing the solutions of the embodiments of this specification. Or multiple software and/or hardware implementations. It is also possible to select some or all of the modules according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.

Abstract

A consortium blockchain network-based transaction execution method, and a system. Each node in a consortium blockchain network determines an execution charge amount (or referred to as Gas) corresponding to a transaction to be executed, the execution charge amount being positively related to the amount of computing resources consumed for executing said transaction and being positively related to the amount of storage resources consumed for storing said transaction. When triggering execution of a transaction, the node determines, for a user account which initiates said transaction, an execution charge amount to be paid, determines an execution charge amount to be allocated to each node, and further writes determination results into a blockchain.

Description

一种基于联盟链网络的交易执行方法及系统A transaction execution method and system based on alliance chain network 技术领域Technical field
本说明书实施例涉及信息技术领域,尤其涉及一种基于联盟链网络的交易执行方法及系统。The embodiments of this specification relate to the field of information technology, and in particular to a transaction execution method and system based on a consortium chain network.
背景技术Background technique
在区块链技术领域,公有链网络(如比特币、以太坊)通常采用工作量证明(Proof-Of-Work,POW)这一共识算法来实现节点间共识。In the field of blockchain technology, public chain networks (such as Bitcoin and Ethereum) usually use the Proof-Of-Work (POW) consensus algorithm to achieve consensus among nodes.
以以太坊为例,网络中每次需要打包区块时,各节点基于POW算法争取本次打包区块的权利(也称为记账权),区块打包后,各节点会同步执行该区块中的交易。此外,交易中指定有交易的执行费用(或称为燃料Gas),争取到本次记账权的节点会获取到交易中指定的Gas,节点可以将拥有的Gas兑换成收益(如以太币)。Taking Ethereum as an example, every time a block needs to be packaged in the network, each node fights for the right to package the block (also known as the accounting right) based on the POW algorithm. After the block is packaged, each node will execute the block synchronously. Transactions in the block. In addition, the transaction execution fee (or gas gas) is specified in the transaction, and the node that obtains this accounting right will get the gas specified in the transaction, and the node can convert the gas it owns into revenue (such as ether) .
目前联盟链网络架构逐渐成为应用主流,联盟链网络通常并不支持POW算法,联盟链网络中各节点通常基于实用拜占庭容错算法(Practical Byzantine Fault Tolerance,PBFT)来实现共识。At present, the consortium chain network architecture has gradually become the mainstream of application. The consortium chain network usually does not support the POW algorithm. The nodes in the consortium chain network are usually based on the practical Byzantine Fault Tolerance (PBFT) to achieve consensus.
基于此,如何设计一种基于联盟链网络的交易执行技术流程,使得在PBFT机制下仍然可以利用Gas对节点执行交易进行激励,是丞待解决的技术问题。Based on this, how to design a transaction execution technical process based on the alliance chain network so that Gas can still be used to incentivize nodes to execute transactions under the PBFT mechanism is a technical problem to be solved.
发明内容Summary of the invention
为了解决现有的基于联盟链网络的交易执行流程无法利用Gas对节点执行交易进行激励的问题,本说明书实施例提供一种基于联盟链网络的交易执行方法,应用于联盟链网络中的每个节点,所述方法包括:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。In order to solve the problem that the existing transaction execution process based on the alliance chain network cannot use Gas to incentivize the execution of transactions by the node, the embodiment of this specification provides a transaction execution method based on the alliance chain network, which is applied to each of the alliance chain networks. Node, the method includes: obtaining the transaction to be executed; determining the amount of execution fee corresponding to the transaction, and triggering the execution of the transaction; wherein, the amount of execution fee corresponding to the transaction is the same as the amount of execution fee consumed by the execution of the transaction. The amount of computing resources is positively correlated, and is positively correlated with the amount of storage resources consumed by storing the transaction; after triggering the execution of the transaction, based on the amount of execution fees corresponding to the transaction, determine the amount to be paid by the user account that initiated the transaction The amount of execution fee, and the amount of execution fee to be allocated to each node based on the preset fee distribution rule and the amount of execution fee corresponding to the transaction; the amount of execution fee to be paid for the user account that initiated the transaction is compared with the amount of execution fee to be paid The amount of execution fee allocated to each node is written into the blockchain.
根据本说明书实施例的第2方面,提供一种基于多个联盟链网络的交易执行方法,节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点,所述方法包括:针对每个联盟链网络,该联盟链网络中每个节点执行:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。According to a second aspect of the embodiments of the present specification, a transaction execution method based on multiple alliance chain networks is provided, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes, and the method includes: For each consortium chain network, each node in the consortium chain network executes: obtains the transaction to be executed; determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; wherein, the execution fee corresponding to the transaction The amount is positively correlated with the amount of computing resources consumed by the execution of the transaction, and is positively correlated with the amount of storage resources consumed by the storage of the transaction; after the execution of the transaction is triggered, it is determined based on the amount of the execution fee corresponding to the transaction The amount of execution fees to be paid by the user account that initiated the transaction, and the amount of execution fees to be allocated to each node based on the preset fee distribution rules and the amount of execution fees corresponding to the transaction; The amount of execution fees to be paid by the user account and the amount of execution fees to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
根据本说明书实施例的第3方面,提供一种交易执行系统,包括联盟链网络;所述联盟链网络中的每个节点执行:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。According to the third aspect of the embodiments of this specification, a transaction execution system is provided, including a consortium chain network; each node in the consortium chain network executes: obtains the transaction to be executed; determines the amount of execution fee corresponding to the transaction, And, trigger the execution of the transaction; wherein the execution fee amount corresponding to the transaction is positively correlated with the amount of computing resources consumed by executing the transaction, and is positively correlated with the amount of storage resources consumed by storing the transaction; After the transaction is executed, the amount of execution fee to be paid by the user account that initiated the transaction is determined based on the amount of execution fee corresponding to the transaction, and the amount of execution fee corresponding to the transaction is calculated based on the preset fee distribution rule The amount of execution fees to be allocated to each node; the amount of execution fees to be paid for the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain.
根据本说明书实施例的第4方面,提供一种交易执行系统,包括节点网络,所述节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点;针对每个联盟链网络,该联盟链网络中每个节点执行:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。According to the fourth aspect of the embodiments of this specification, a transaction execution system is provided, including a node network, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes; for each alliance chain network , Each node in the alliance chain network executes: obtains the transaction to be executed; determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is the same as the execution fee amount corresponding to the transaction. The amount of computing resources consumed by the exchange is positively correlated with the amount of storage resources consumed by storing the exchange; after the execution of the transaction is triggered, the user who initiated the transaction is determined based on the amount of execution fees corresponding to the transaction The amount of execution fees to be paid by the account, and the amount of execution fees to be allocated to each node based on the preset fee distribution rules and the amount of execution fees corresponding to the transaction; the execution of the user account to be paid for initiating the transaction is calculated The amount of cost and the amount of execution cost to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
本说明书实施例所提供的技术方案,联盟链网络中每个节点确定待执行的交易对应的执行费用数额(或称为Gas),执行费用数额与执行交易所需消耗的计算资源量正相关,且与存储交易所消耗的存储资源量正相关。节点在触发执行交易账户,会为发起交 易的用户账户确定待支付的执行费用数额,以及确定待分配给每个节点的执行费用数额,并且,还会将上述确定结果写入区块链。In the technical solution provided by the embodiment of this specification, each node in the alliance chain network determines the execution fee amount (or called Gas) corresponding to the transaction to be executed, and the execution fee amount is positively correlated with the amount of computing resources consumed to execute the transaction. And it is positively correlated with the amount of storage resources consumed by storage transactions. When the node triggers the execution transaction account, it will determine the amount of execution fees to be paid for the user account that initiates the transaction, as well as the amount of execution fees to be allocated to each node, and also write the above determination results into the blockchain.
通过本说明书实施例,提供了一种在联盟链网络的PBFT机制下,激励节点执行交易的技术流程。在该技术流程中,其一,实现了参与执行交易的每个节点都可以获得Gas;其二,不但考虑执行交易所消耗的计算资源量来确定执行费用数额,还会考虑后续存储交易所消耗的存储资源量来确定执行费用数额(而公有链网络的POW机制下,由于只有争取到记账权的节点才会获得Gas,因此在确定Gas时通常不会考虑后续消耗的存储资源量);其三,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链,可以对每个交易的执行费用的支出与收入情况进行可信存证。Through the embodiments of this specification, a technical process for incentivizing nodes to execute transactions under the PBFT mechanism of the alliance chain network is provided. In this technical process, first, it is realized that each node participating in the execution of the transaction can obtain Gas; second, not only the amount of computing resources consumed by the execution of the transaction is considered to determine the amount of execution fees, but also the subsequent consumption of the storage transaction The amount of storage resources to determine the amount of execution costs (and under the POW mechanism of the public chain network, because only the nodes that have obtained the accounting right will get Gas, the subsequent consumption of storage resources is usually not considered when determining the Gas); Third, the amount of execution fees to be paid by the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain, so that the expenditure and income of the execution fees of each transaction can be trusted. Deposit evidence.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the embodiments of this specification.
此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。In addition, any one of the embodiments of the present specification does not need to achieve all the above-mentioned effects.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some of the embodiments described in the embodiments of this specification. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
图1是一种基于联盟链网络的交易执行方法的流程示意图;Figure 1 is a schematic flow diagram of a transaction execution method based on a consortium chain network;
图2是本说明书实施例提供的一种交易执行系统的结构示意图;Figure 2 is a schematic structural diagram of a transaction execution system provided by an embodiment of this specification;
图3是本说明书实施例提供的另一种交易执行系统的结构示意图;Figure 3 is a schematic structural diagram of another transaction execution system provided by an embodiment of this specification;
图4是本说明书实施例提供的一种交易执行装置的结构示意图;Figure 4 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification;
图5是本说明书实施例提供的一种交易执行装置的结构示意图;Figure 5 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification;
图6是用于配置本说明书实施例方法的一种设备的结构示意图。Fig. 6 is a schematic structural diagram of a device for configuring the method of the embodiment of this specification.
具体实施方式Detailed ways
此处对本方案的应用场景进行说明。The application scenarios of this solution are described here.
在本方案中,某个机构可以作为联盟链网络的发起方,发起联盟链网络。其他机构可以作为联盟链网络的加入方,以付费或者免费的方式加入联盟链网络。作为发起方的机构可以提供Gas兑换服务,用于在联盟链网络中表征交易执行费用。Gas与现实世界的法币具有一定的兑换比例,该兑换比例可以由发起方确定。In this solution, an organization can act as the initiator of the alliance chain network and initiate the alliance chain network. Other organizations can act as participants in the alliance chain network and join the alliance chain network for a fee or for free. As the initiator, the institution can provide Gas exchange service, which is used to characterize transaction execution fees in the alliance chain network. Gas has a certain exchange ratio with real-world legal currency, and the exchange ratio can be determined by the initiator.
用户可以向发起方购买Gas,从而可以在发起交易时,向联盟链网络中的节点支付Gas,作为交易执行费用。Users can purchase Gas from the initiator, so that when initiating a transaction, they can pay Gas to nodes in the alliance chain network as a transaction execution fee.
用户拥有的Gas存放在用户账户中,节点拥有的Gas存放在节点账户中。具体而言,用户账户与节点账户可以是在发起方的服务器上注册的中心化账户,也可以在联盟链网络中注册的去中心化账户。The gas owned by the user is stored in the user account, and the gas owned by the node is stored in the node account. Specifically, the user account and the node account may be a centralized account registered on the server of the initiator, or a decentralized account registered in the alliance chain network.
如果用户账户与节点账户是去中心化账户,那么,用户在向发起方购买Gas时,发起方可以通过其控制的节点账户发起充值交易,充值交易中指定用户账户标识与充值的Gas数额,该充值交易被写入联盟链网络的区块链中之后,相当于用户的账户中增加了这些Gas。用户如果想将自己的去中心化账户中的Gas兑换回法币,可以通过自己的用户账户发起兑现交易,兑现交易中指定用户账户标识与兑换的Gas数额,该兑现交易被写入联盟链网络的区块链中之后,相当于用户的账户中减少了这些Gas,发起方也会据此向用户退还相应的法币。If the user account and the node account are decentralized accounts, then when the user purchases Gas from the initiator, the initiator can initiate a recharge transaction through the node account under its control. The user account ID and the recharged Gas amount are specified in the recharge transaction. After the recharge transaction is written into the blockchain of the alliance chain network, it is equivalent to adding these gases to the user's account. If users want to exchange the Gas in their decentralized account back to legal currency, they can initiate a redemption transaction through their user account. The redemption transaction specifies the user account ID and the amount of gas to be exchanged. The redemption transaction is written into the alliance chain network. After the block chain, it is equivalent to reducing the gas in the user's account, and the initiator will also return the corresponding legal currency to the user accordingly.
此外,在实际应用中,发起方也可以发起一个节点网络,其他机构可以作为加入方加入节点网络。在节点网络中,可以存在多个联盟链网络,不同的联盟链网络可以包括相同节点,也可以包括不同节点。每个联盟链网络维护对应的区块链。例如,对于某个节点而言,其可能既属于联盟链网络A,又属于联盟链网络B,那么,该节点本地同时维护有联盟链网络A的区块链与联盟链网络B的区块链。In addition, in practical applications, the initiator can also initiate a node network, and other organizations can join the node network as a joining party. In the node network, there may be multiple alliance chain networks, and different alliance chain networks may include the same node or different nodes. Each consortium chain network maintains the corresponding blockchain. For example, for a certain node, it may belong to both alliance chain network A and alliance chain network B. Then, the node locally maintains both the blockchain of alliance chain network A and the blockchain of alliance chain network B. .
在本方案中,对于加入联盟链网络的节点,需要在节点上部署代码逻辑,用于实现与执行费用有关的操作,如确定执行费用数额、确定发起所述交易的用户账户待支付的执行费用数额、计算待分配给每个节点的执行费用数额、将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链等操作。In this solution, for nodes joining the alliance chain network, code logic needs to be deployed on the nodes to implement operations related to execution fees, such as determining the amount of execution fees and determining the execution fees to be paid by the user account that initiated the transaction The amount, calculation of the amount of execution fee to be allocated to each node, and operations such as writing the amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the blockchain.
该代码逻辑可以写入节点上部署的智能合约中,节点在基于智能合约执行交易时,也会基于智能合约执行与执行费用有关的操作。另外,该逻辑代码也可以被写入节点的固件中,节点一方面基于智能合约执行交易,另一方面基于本地固件执行与执行费用有关的操作。The code logic can be written into the smart contract deployed on the node. When the node executes a transaction based on the smart contract, it will also perform operations related to execution fees based on the smart contract. In addition, the logic code can also be written into the firmware of the node. On the one hand, the node executes transactions based on smart contracts, and on the other hand, executes operations related to execution fees based on the local firmware.
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the technical solutions in the embodiments of this specification will be described in detail below in conjunction with the drawings in the embodiments of this specification. Obviously, the described implementation The examples are only a part of the embodiments in this specification, not all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by a person of ordinary skill in the art should fall within the scope of protection.
以下结合附图,详细说明本说明书各实施例提供的技术方案。The technical solutions provided by the embodiments of this specification will be described in detail below with reference to the accompanying drawings.
图1是一种基于联盟链网络的交易执行方法的流程示意图,包括以下步骤:S100:获取待执行的交易。Fig. 1 is a schematic flow chart of a transaction execution method based on a consortium chain network, which includes the following steps: S100: Obtain a transaction to be executed.
图1所示的方法的执行主体是联盟链网络中的每个节点。通常,用户通过自己的用户账户发起交易,将交易发送给用户对接的某个机构的节点,该机构的节点进一步向联盟链网络全网广播交易。各节点基于PBFT算法完成共识之后,会确定已共识的区块,然后,每个节点需要针对区块中每个交易进行执行。上述待执行的交易可以是区块中的任一交易。The main body of execution of the method shown in Figure 1 is each node in the consortium chain network. Generally, a user initiates a transaction through his user account, and sends the transaction to a node of a certain institution that the user is connected to, and the node of the institution further broadcasts the transaction to the entire network of the alliance chain network. After each node completes the consensus based on the PBFT algorithm, it will determine the consensus block, and then each node needs to execute each transaction in the block. The transaction to be executed above can be any transaction in the block.
S102:确定所述交易对应的执行费用数额,以及,触发执行所述交易。S102: Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction.
由于执行交易消耗的计算资源以及存储交易消耗的存储资源都是节点付出的成本,因此,所述交易对应的执行费用数额需要满足:与执行所述交易所消耗的计算资源量正相关,和/或,与存储所述交易所消耗的存储资源量正相关。Since the computing resources consumed by the transaction execution and the storage resources consumed by the storage transaction are costs paid by the node, the amount of execution fees corresponding to the transaction needs to meet: positive correlation with the amount of computing resources consumed by the execution of the transaction, and/ Or, it is positively correlated with the amount of storage resources consumed by storing the transaction.
在实际应用中,发起交易的用户可以在交易中指定执行费用数额,节点从交易中提取执行费用数额即可。用户在交易中指定的执行费用数额通常不得大于其账户余额。当然,用户在交易中指定的执行费用数额通常也大于其账户余额,超出部分作为用户账户的负债。In practical applications, the user who initiates the transaction can specify the execution fee amount in the transaction, and the node can extract the execution fee amount from the transaction. The amount of execution fee specified by the user in the transaction is usually not greater than his account balance. Of course, the amount of execution fee specified by the user in the transaction is usually greater than the account balance, and the excess is regarded as a liability of the user's account.
进一步地,节点可以校验提取的执行费用数额是否足够。例如,节点可以根据执行所述交易所消耗的计算资源量与存储所述交易所消耗的存储资源量计算执行费用数额,如果计算的执行费用数额大于提取的执行费用数额,就会拒绝触发执行所述交易。Further, the node can verify whether the extracted execution fee amount is sufficient. For example, the node can calculate the amount of execution fee based on the amount of computing resources consumed by executing the transaction and the amount of storage resources consumed by storing the transaction. If the amount of calculated execution fee is greater than the amount of extracted execution fee, it will refuse to trigger execution The transaction.
此外,交易中也可以未指定执行费用数额,而是由节点根据执行所述交易所消耗的计算资源量与存储所述交易所消耗的存储资源量计算执行费用数额。如果节点计算的执行费用数额超出用户账户余额,则节点可以拒绝触发执行交易,也可以依然触发执行交易,但是将超出部分作为用户账户的负债。In addition, the execution fee amount may not be specified in the transaction. Instead, the node calculates the execution fee amount based on the amount of computing resources consumed by executing the transaction and the amount of storage resources consumed by storing the transaction. If the execution fee calculated by the node exceeds the user account balance, the node may refuse to trigger the execution of the transaction, or it may still trigger the execution of the transaction, but the excess will be regarded as a liability of the user account.
在本说明书实施例中,所述交易对应的执行费用数额,还可以与所述交易对应的预 期存储时长正相关。由于节点对交易的存储时间越长,付出的成本也越高,因此,本方案也考虑将交易的预期存储时长作为影响交易对应的执行费用数额的一个因素。In the embodiment of this specification, the execution fee amount corresponding to the transaction may also be positively correlated with the expected storage duration corresponding to the transaction. Since the longer the storage time of the node for the transaction, the higher the cost paid, therefore, this solution also considers the expected storage duration of the transaction as a factor that affects the amount of execution fee corresponding to the transaction.
S104:在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额。S104: After triggering the execution of the transaction, determine the amount of the execution fee to be paid by the user account that initiated the transaction based on the amount of the execution fee corresponding to the transaction, and execute the corresponding execution of the transaction based on a preset fee distribution rule The amount of cost, calculate the amount of execution cost to be allocated to each node.
用户账户发起交易,交易由区块链网络中的各节点执行,其本质上是用户账户向各节点支付手续费,以激励各节点执行交易。The user account initiates a transaction, and the transaction is executed by each node in the blockchain network. In essence, the user account pays a fee to each node to encourage each node to execute the transaction.
需要说明的是,步骤S104并不是执行交易的步骤,在实际应用中,根据交易所对应的业务要求,执行交易,这并不是本方案关注的重点。本方案关注的重点是,节点在执行交易的同时,如何获得Gas,并对获得Gas的记录进行存证。It should be noted that step S104 is not a step for executing transactions. In actual applications, executing transactions according to the corresponding business requirements of the exchange is not the focus of this solution. The focus of this program is how to obtain Gas while the node executes the transaction, and keep the record of obtaining Gas.
在本说明书实施例中,预设的费用分配规则可以根据实际需要指定。分配规则可以由联盟链网络中各节点协商确定,也可以由联盟链网络的发起方节点指定。In the embodiments of this specification, the preset cost distribution rules can be specified according to actual needs. The allocation rules can be negotiated and determined by each node in the alliance chain network, or can be specified by the initiator node of the alliance chain network.
例如,分配规则可以是:交易对应的执行费用数额/执行交易的节点数量*节点分配系数,并且,剩余的执行费用数额分配给发起方节点。假设交易对应的执行费用数额为90,执行交易的节点数量为3,节点1的分配系数为50%,节点2的分配系数为60%,节点3的分配系数为100%。那么,节点1分配的执行费用数额为15,节点2分配的执行费用数额为18,节点3分配的执行费用数额为30。此外,剩余的执行费用数额为90-15-18-30=27。假设节点1是发起方节点,那么还可以另行分配给节点1剩余的执行费用数额(27)。For example, the distribution rule may be: the amount of execution fee corresponding to the transaction/the number of nodes executing the transaction*the node distribution coefficient, and the remaining amount of execution cost is allocated to the initiator node. Suppose that the execution fee amount corresponding to the transaction is 90, the number of nodes executing the transaction is 3, the distribution coefficient of node 1 is 50%, the distribution coefficient of node 2 is 60%, and the distribution coefficient of node 3 is 100%. Then, the amount of execution cost allocated by node 1 is 15, the amount of execution cost allocated by node 2 is 18, and the amount of execution cost allocated by node 3 is 30. In addition, the remaining execution cost amount is 90-15-18-30=27. Assuming that node 1 is the initiator node, the remaining execution cost amount of node 1 can also be allocated separately (27).
需要说明的是,在实际应用中,联盟链网络中有的节点可能宕机,导致该节点实际没有执行该交易,对于这种情况,可以设置依然给宕机节点分配相应的执行费用数额,或者,设置不给宕机节点分配相应的执行费用数额。It should be noted that, in actual applications, some nodes in the alliance chain network may be down, resulting in that the node does not actually execute the transaction. In this case, you can set the corresponding execution fee to still be allocated to the down node, or , Setting not to allocate the corresponding execution fee amount to the down node.
S106:将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。S106: Write the amount of execution fees to be paid to the user account that initiated the transaction and the amount of execution fees to be allocated to each node into the blockchain.
在本说明书实施例中,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链,可以对本次交易的执行费用情况进行存证,后续可以基于区块链上的可信存证记录,从用户账户中扣除执行费用,向每个节点的节点账户中增加执行费用。In the embodiment of this specification, the amount of execution fees to be paid by the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain, and the execution cost of this transaction can be recorded. , The follow-up can be based on the trusted deposit record on the blockchain, deduct the execution fee from the user account, and add the execution fee to the node account of each node.
需要说明的是,节点可以将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入所述交易的交易执行结果;其中,所述交易与相应的交易执行结果被写入区块链。由于节点通常会基于智能合约来执行交易,得到执行结果,并会将交易与执行结果写入区块链(一般而言,交易写入区块中的交易树,执行结果锚定到区块中的收据树),因此,相当于通过这种方式实现步骤S106。It should be noted that the node may write the amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the transaction execution result of the transaction; wherein, the transaction corresponds to The transaction execution result is written into the blockchain. Since nodes usually execute transactions based on smart contracts, get the execution results, and write the transactions and execution results into the blockchain (generally speaking, the transaction is written into the transaction tree in the block, and the execution result is anchored to the block Receipt tree), therefore, it is equivalent to implementing step S106 in this way.
此外,节点也可以将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额封装成存证交易,将存证交易放入本地缓存,等待下次共识时将该存证交易打包进区块,进而写入区块链。In addition, the node can also encapsulate the amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node into a deposit certificate transaction, put the deposit certificate transaction in the local cache, and wait for the next consensus Pack the deposit certificate transaction into a block, and then write it to the blockchain.
还需要说明的是,节点账户可以发起兑现交易,以便将节点账户中的Gas兑换成法币,原理类似于用户将用户账户中的Gas兑换成法币,不再赘述。It should also be noted that the node account can initiate a redemption transaction in order to convert the Gas in the node account into legal currency. The principle is similar to that of the user converting the Gas in the user account into legal currency, which will not be repeated.
本说明书实施例所提供的技术方案,联盟链网络中每个节点确定待执行的交易对应的执行费用数额(或称为Gas),执行费用数额与执行交易所需消耗的计算资源量正相关,且与存储交易所消耗的存储资源量正相关。节点在触发执行交易账户,会为发起交易的用户账户确定待支付的执行费用数额,以及确定待分配给每个节点的执行费用数额,并且,还会将上述确定结果写入区块链。In the technical solution provided by the embodiment of this specification, each node in the alliance chain network determines the execution fee amount (or called Gas) corresponding to the transaction to be executed, and the execution fee amount is positively correlated with the amount of computing resources consumed to execute the transaction. And it is positively correlated with the amount of storage resources consumed by storage transactions. When the node triggers the execution transaction account, it will determine the amount of execution fee to be paid for the user account that initiated the transaction, as well as the amount of execution fee to be allocated to each node, and will also write the above determination result into the blockchain.
通过本说明书实施例,提供了一种在联盟链网络的PBFT机制下,激励节点执行交易的技术流程。在该技术流程中,其一,实现了参与执行交易的每个节点都可以获得Gas;其二,不但考虑执行交易所消耗的计算资源量来确定执行费用数额,还会考虑后续存储交易所消耗的存储资源量来确定执行费用数额(而公有链网络的POW机制下,由于只有争取到记账权的节点才会获得Gas,因此在确定Gas时通常不会考虑后续消耗的存储资源量);其三,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链,可以对每个交易的执行费用的支出与收入情况进行可信存证。Through the embodiments of this specification, a technical process for incentivizing nodes to execute transactions under the PBFT mechanism of the alliance chain network is provided. In this technical process, first, it is realized that each node participating in the execution of the transaction can obtain Gas; second, not only the amount of computing resources consumed by the execution of the transaction is considered to determine the amount of execution fees, but also the subsequent consumption of the storage transaction The amount of storage resources to determine the amount of execution costs (and under the POW mechanism of the public chain network, because only the nodes that have obtained the accounting right will get Gas, the subsequent consumption of storage resources is usually not considered when determining the Gas); Third, the amount of execution fees to be paid by the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain, so that the expenditure and income of the execution fees of each transaction can be trusted. Deposit evidence.
此外,本说明书实施例还提供一种基于多个联盟链网络的交易执行方法,节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点,所述方法包括:针对每个联盟链网络,该联盟链网络中每个节点执行:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易 的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。In addition, the embodiment of this specification also provides a transaction execution method based on multiple alliance chain networks, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes, and the method includes: A consortium chain network, where each node in the consortium chain network executes: obtains the transaction to be executed; determines the execution fee amount corresponding to the transaction, and triggers the execution of the transaction; wherein the execution fee amount corresponding to the transaction is equal to The amount of computing resources consumed by the execution of the transaction is positively correlated, and is positively related to the amount of storage resources consumed by the storage of the transaction; after the execution of the transaction is triggered, based on the amount of execution fees corresponding to the transaction, it is determined to initiate the The amount of execution fee to be paid by the user account of the transaction, and the amount of execution fee to be allocated to each node based on the preset fee distribution rule and the amount of execution fee corresponding to the transaction; The amount of execution fees paid and the amount of execution fees to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
图2是本说明书实施例提供的一种交易执行系统的结构示意图,包括联盟链网络;Figure 2 is a schematic structural diagram of a transaction execution system provided by an embodiment of this specification, including a consortium chain network;
所述联盟链网络中的每个节点执行:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。Each node in the alliance chain network executes: obtains the transaction to be executed; determines the execution fee amount corresponding to the transaction, and triggers the execution of the transaction; wherein, the execution fee amount corresponding to the transaction is the same as the execution fee amount The amount of computing resources consumed by the exchange is positively correlated, and is positively related to the amount of storage resources consumed by storing the exchange; after triggering the execution of the transaction, based on the amount of execution fees corresponding to the transaction, determine the initiator of the transaction The amount of execution fees to be paid by the user account, and the amount of execution fees to be allocated to each node based on the preset fee distribution rules and the amount of execution fees corresponding to the transaction; the amount of execution fees to be paid by the user account that initiated the transaction The amount of execution cost and the amount of execution cost to be allocated to each node are written into the blockchain.
图3是本说明书实施例提供的另一种交易执行系统的结构示意图,包括节点网络,所述节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点;针对每个联盟链网络,该联盟链网络中每个节点执行:获取待执行的交易;确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。Figure 3 is a schematic structural diagram of another transaction execution system provided by an embodiment of the specification, including a node network, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes; for each alliance A chain network in which each node in the alliance chain network executes: obtains the transaction to be executed; determines the execution fee amount corresponding to the transaction, and triggers the execution of the transaction; wherein the execution fee amount corresponding to the transaction is the same as the execution fee amount The amount of computing resources consumed by the exchange is positively correlated, and is positively correlated with the amount of storage resources consumed by storing the exchange; after the execution of the transaction is triggered, the transaction is determined to be initiated based on the amount of execution fees corresponding to the transaction The amount of execution fee to be paid for the user account of the user account, and the amount of execution fee to be allocated to each node based on the preset fee distribution rule and the amount of execution fee corresponding to the transaction; the user account that initiated the transaction is to be paid The amount of execution cost and the amount of execution cost to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
如图3所示,区块链1是联盟链网络1对应的区块链,区块链2是联盟链网络2对应的区块链。图3中的一个节点既属于联盟链网络1,又属于联盟链网络2,因此该节点在本地维护有区块链1与区块链2。As shown in Figure 3, block chain 1 is the block chain corresponding to alliance chain network 1, and block chain 2 is the block chain corresponding to alliance chain network 2. A node in Figure 3 belongs to both the alliance chain network 1 and the alliance chain network 2, so the node maintains the blockchain 1 and the blockchain 2 locally.
图4是本说明书实施例提供的一种交易执行装置的结构示意图,应用于联盟链网络中的每个节点,所述装置包括:获取模块401,获取待执行的交易;第一处理模块402,确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;第二处理模块403,在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的 费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;写入模块404,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。FIG. 4 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification, which is applied to each node in the alliance chain network. The device includes: an acquisition module 401 to acquire a transaction to be executed; and a first processing module 402, Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed in executing the transaction, and is related to storing the transaction The amount of storage resources consumed is positively correlated; the second processing module 403, after triggering the execution of the transaction, determines the amount of execution fee to be paid by the user account that initiated the transaction based on the amount of execution fee corresponding to the transaction, and based on the forecast Set the fee distribution rule and the amount of execution fee corresponding to the transaction, calculate the amount of execution fee to be allocated to each node; write module 404, and compare the amount of execution fee to be paid to the user account that initiated the transaction with the amount to be allocated to The amount of execution fee for each node is written into the blockchain.
图5是本说明书实施例提供的一种交易执行装置的结构示意图,节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点,针对每个联盟链网络,所述装置应用于该联盟链网络中的每个节点,所述装置包括:获取模块501,获取待执行的交易;第一处理模块502,确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;第二处理模块503,在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;写入模块504,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。Figure 5 is a schematic structural diagram of a transaction execution device provided by an embodiment of this specification. The node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes. For each alliance chain network, the device application For each node in the alliance chain network, the device includes: an acquisition module 501, which acquires a transaction to be executed; a first processing module 502, which determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; Wherein, the execution fee amount corresponding to the transaction is positively correlated with the amount of computing resources consumed to execute the transaction, and is positively correlated with the amount of storage resources consumed by storing the transaction; the second processing module 503 is triggered when the execution is executed. After the transaction, determine the amount of execution fee to be paid by the user account that initiated the transaction based on the amount of execution fee corresponding to the transaction, and calculate the amount of execution fee to be allocated based on the preset fee allocation rule and the amount of execution fee corresponding to the transaction The amount of execution fee for each node; the writing module 504 writes the amount of execution fee to be paid for the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the blockchain corresponding to the alliance chain network .
本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图1所示的方法。The embodiments of this specification also provide a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method shown in FIG. 1 when the program is executed. .
图6示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。6 shows a more specific hardware structure diagram of a computing device provided by an embodiment of this specification. The device may include a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040 realize the communication connection between each other in the device through the bus 1050.
处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。The processor 1010 may be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for execution related Program to realize the technical solutions provided in the embodiments of this specification.
存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, related program codes are stored in the memory 1020 and called and executed by the processor 1010.
输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。 其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 1030 is used to connect an input/output module to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 1040 is used to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。The bus 1050 includes a path to transmit information between various components of the device (for example, the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040).
需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include the necessary equipment for normal operation. Other components. In addition, those skilled in the art can understand that the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of the present specification, and not necessarily include all the components shown in the figures.
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图1所示的方法。The embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method shown in FIG. 1 is implemented.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务设备,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。From the description of the foregoing implementation manners, it can be known that those skilled in the art can clearly understand that the embodiments of this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of the embodiments of this specification can be embodied in the form of software products, which can be stored in storage media, such as ROM/RAM, Magnetic disks, optical disks, etc., include several instructions to enable a computer device (which may be a personal computer, a service device, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of this specification.
上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现, 或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, methods, modules, or units explained in the foregoing embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment. The device embodiments described above are merely illustrative, and the modules described as separate components may or may not be physically separated. The functions of the modules can be combined in the same way when implementing the solutions of the embodiments of this specification. Or multiple software and/or hardware implementations. It is also possible to select some or all of the modules according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。The above are only specific implementations of the embodiments of this specification. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the embodiments of this specification, several improvements and modifications can be made. These Improvements and retouching should also be regarded as the protection scope of the embodiments of this specification.

Claims (10)

  1. 一种基于联盟链网络的交易执行方法,应用于联盟链网络中的每个节点,所述方法包括:A transaction execution method based on a consortium chain network is applied to each node in the consortium chain network, and the method includes:
    获取待执行的交易;Obtain pending transactions;
    确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed in executing the transaction, and is related to storing the transaction The amount of storage resources consumed is positively correlated;
    在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;After the execution of the transaction is triggered, the amount of execution fee to be paid by the user account that initiated the transaction is determined based on the amount of execution fee corresponding to the transaction, and the amount of execution fee corresponding to the transaction is determined based on the preset fee distribution rule , Calculate the amount of execution cost to be allocated to each node;
    将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。The amount of execution fees to be paid for the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain.
  2. 如权利要求1所述的方法,触发执行所述交易,包括:The method of claim 1, triggering execution of the transaction, comprising:
    判断所述用户账户对应的余额是否小于所述交易对应的执行费用数额;Judging whether the balance corresponding to the user account is less than the execution fee amount corresponding to the transaction;
    若否,则触发执行所述交易。If not, trigger execution of the transaction.
  3. 如权利要求1所述的方法,所述交易对应的执行费用数额,还与所述交易对应的预期存储时长正相关。The method according to claim 1, wherein the amount of execution fee corresponding to the transaction is also positively correlated with the expected storage duration corresponding to the transaction.
  4. 如权利要求1所述的方法,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链,具体包括:The method according to claim 1, writing the amount of execution fee to be paid for the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the blockchain, which specifically includes:
    将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入所述交易的交易执行结果;其中,所述交易与相应的交易执行结果被写入区块链。The amount of execution fees to be paid for the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the transaction execution result of the transaction; wherein the transaction and the corresponding transaction execution result are written into the area Block chain.
  5. 一种基于多个联盟链网络的交易执行方法,节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点,所述方法包括:A transaction execution method based on multiple alliance chain networks. The node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes. The method includes:
    针对每个联盟链网络,该联盟链网络中每个节点执行:For each consortium chain network, each node in the consortium chain network executes:
    获取待执行的交易;Obtain pending transactions;
    确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed in executing the transaction, and is related to storing the transaction The amount of storage resources consumed is positively correlated;
    在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;After the execution of the transaction is triggered, the amount of execution fee to be paid by the user account that initiated the transaction is determined based on the amount of execution fee corresponding to the transaction, and the amount of execution fee corresponding to the transaction is determined based on the preset fee distribution rule , Calculate the amount of execution cost to be allocated to each node;
    将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。The amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
  6. 一种交易执行系统,包括联盟链网络;A transaction execution system, including a consortium chain network;
    所述联盟链网络中的每个节点执行:Each node in the alliance chain network executes:
    获取待执行的交易;Obtain pending transactions;
    确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed in executing the transaction, and is related to storing the transaction The amount of storage resources consumed is positively correlated;
    在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;After the execution of the transaction is triggered, the amount of execution fee to be paid by the user account that initiated the transaction is determined based on the amount of execution fee corresponding to the transaction, and the amount of execution fee corresponding to the transaction is determined based on the preset fee distribution rule , Calculate the amount of execution cost to be allocated to each node;
    将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。The amount of execution fees to be paid for the user account that initiated the transaction and the amount of execution fees to be allocated to each node are written into the blockchain.
  7. 一种交易执行系统,包括节点网络,所述节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点;A transaction execution system includes a node network, the node network includes multiple alliance chain networks, and different alliance chain networks include the same node or different nodes;
    针对每个联盟链网络,该联盟链网络中每个节点执行:For each consortium chain network, each node in the consortium chain network executes:
    获取待执行的交易;Obtain pending transactions;
    确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;Determine the amount of execution fee corresponding to the transaction, and trigger the execution of the transaction; wherein the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed in executing the transaction, and is related to storing the transaction The amount of storage resources consumed is positively correlated;
    在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;After the execution of the transaction is triggered, the amount of execution fee to be paid by the user account that initiated the transaction is determined based on the amount of execution fee corresponding to the transaction, and the amount of execution fee corresponding to the transaction is determined based on the preset fee distribution rule , Calculate the amount of execution cost to be allocated to each node;
    将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。The amount of execution fee to be paid by the user account that initiated the transaction and the amount of execution fee to be allocated to each node are written into the blockchain corresponding to the alliance chain network.
  8. 一种交易执行装置,应用于联盟链网络中的每个节点,所述装置包括:A transaction execution device, which is applied to each node in a consortium chain network, and the device includes:
    获取模块,获取待执行的交易;Obtain the module to obtain the transaction to be executed;
    第一处理模块,确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;The first processing module determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; wherein, the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed by executing the transaction, and is related to The amount of storage resources consumed by the transaction is positively correlated;
    第二处理模块,在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起 所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;The second processing module, after triggering the execution of the transaction, determines the amount of the execution fee to be paid by the user account that initiated the transaction based on the amount of the execution fee corresponding to the transaction, and compares it with the transaction based on a preset fee distribution rule Corresponding amount of execution fee, calculate the amount of execution fee to be allocated to each node;
    写入模块,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入区块链。The writing module writes the amount of execution fees to be paid to the user account that initiated the transaction and the amount of execution fees to be allocated to each node into the blockchain.
  9. 一种交易执行装置,节点网络包含多个联盟链网络,不同的联盟链网络包括相同节点或不同节点,针对每个联盟链网络,所述装置应用于该联盟链网络中的每个节点,所述装置包括:A transaction execution device. A node network includes multiple alliance chain networks. Different alliance chain networks include the same node or different nodes. For each alliance chain network, the device is applied to each node in the alliance chain network. The device includes:
    获取模块,获取待执行的交易;Obtain the module to obtain the transaction to be executed;
    第一处理模块,确定所述交易对应的执行费用数额,以及,触发执行所述交易;其中,所述交易对应的执行费用数额,与执行所述交易所消耗的计算资源量正相关,且与存储所述交易所消耗的存储资源量正相关;The first processing module determines the amount of execution fee corresponding to the transaction, and triggers the execution of the transaction; wherein, the amount of execution fee corresponding to the transaction is positively correlated with the amount of computing resources consumed by executing the transaction, and is related to The amount of storage resources consumed by the transaction is positively correlated;
    第二处理模块,在触发执行所述交易后,基于所述交易对应的执行费用数额,确定发起所述交易的用户账户待支付的执行费用数额,并基于预设的费用分配规则与所述交易对应的执行费用数额,计算待分配给每个节点的执行费用数额;The second processing module, after triggering the execution of the transaction, determines the amount of execution fee to be paid by the user account that initiated the transaction based on the amount of execution fee corresponding to the transaction, and compares it with the transaction based on a preset fee distribution rule Corresponding amount of execution fee, calculate the amount of execution fee to be allocated to each node;
    写入模块,将发起所述交易的用户账户待支付的执行费用数额与待分配给每个节点的执行费用数额写入该联盟链网络对应的区块链。The writing module writes the amount of execution fee to be paid for the user account that initiated the transaction and the amount of execution fee to be allocated to each node into the blockchain corresponding to the alliance chain network.
  10. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1~5任一项所述的方法。A computer device, comprising a memory, a processor, and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program as described in any one of claims 1 to 5 method.
PCT/CN2021/096506 2020-05-28 2021-05-27 Consortium blockchain network-based transaction execution method, and system WO2021239066A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010470182.4 2020-05-28
CN202010470182.4A CN111383019A (en) 2020-05-28 2020-05-28 Transaction execution method and system based on alliance link network

Publications (1)

Publication Number Publication Date
WO2021239066A1 true WO2021239066A1 (en) 2021-12-02

Family

ID=71217694

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096506 WO2021239066A1 (en) 2020-05-28 2021-05-27 Consortium blockchain network-based transaction execution method, and system

Country Status (2)

Country Link
CN (1) CN111383019A (en)
WO (1) WO2021239066A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114666248A (en) * 2022-05-18 2022-06-24 浙商银行股份有限公司 Allocation chain fragmentation transaction distribution method and device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111383019A (en) * 2020-05-28 2020-07-07 支付宝(杭州)信息技术有限公司 Transaction execution method and system based on alliance link network
CN112015822B (en) * 2020-10-20 2021-05-25 支付宝(杭州)信息技术有限公司 Block chain data deleting method and device
CN113570459A (en) * 2020-10-20 2021-10-29 支付宝(杭州)信息技术有限公司 Block chain data deleting method and device
CN111966538B (en) * 2020-10-20 2021-04-27 支付宝(杭州)信息技术有限公司 Block chain data recovery method and device
CN112015596B (en) * 2020-10-20 2021-05-28 支付宝(杭州)信息技术有限公司 Block chain data recovery method and device
CN112926967B (en) * 2021-03-18 2024-02-02 上海零数众合信息科技有限公司 Metering and payment method for blockchain platform
CN113222572A (en) * 2021-05-10 2021-08-06 支付宝(杭州)信息技术有限公司 Transaction execution method and device
CN113222574B (en) * 2021-05-11 2023-07-25 支付宝(杭州)信息技术有限公司 Money transfer method and device based on blockchain system
CN113452769B (en) * 2021-06-23 2022-10-18 上海简苏网络科技有限公司 Network layering method and system based on block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447605A (en) * 2018-10-24 2019-03-08 百度在线网络技术(北京)有限公司 A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
CN110298643A (en) * 2019-08-22 2019-10-01 深圳市先河系统技术有限公司 Service charge distribution method, device and storage medium based on block chain
CN110599141A (en) * 2019-09-16 2019-12-20 上海保险交易所股份有限公司 Method, apparatus, system, and medium for allocating processing fees to nodes
CN110995408A (en) * 2019-12-19 2020-04-10 深圳市超算科技开发有限公司 Distributed computing method and system based on data encryption
CN111383019A (en) * 2020-05-28 2020-07-07 支付宝(杭州)信息技术有限公司 Transaction execution method and system based on alliance link network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107453896B (en) * 2017-06-27 2020-08-04 创新先进技术有限公司 Method and device for processing multiple block chain network data and server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109447605A (en) * 2018-10-24 2019-03-08 百度在线网络技术(北京)有限公司 A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
CN110298643A (en) * 2019-08-22 2019-10-01 深圳市先河系统技术有限公司 Service charge distribution method, device and storage medium based on block chain
CN110599141A (en) * 2019-09-16 2019-12-20 上海保险交易所股份有限公司 Method, apparatus, system, and medium for allocating processing fees to nodes
CN110995408A (en) * 2019-12-19 2020-04-10 深圳市超算科技开发有限公司 Distributed computing method and system based on data encryption
CN111383019A (en) * 2020-05-28 2020-07-07 支付宝(杭州)信息技术有限公司 Transaction execution method and system based on alliance link network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114666248A (en) * 2022-05-18 2022-06-24 浙商银行股份有限公司 Allocation chain fragmentation transaction distribution method and device

Also Published As

Publication number Publication date
CN111383019A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
WO2021239066A1 (en) Consortium blockchain network-based transaction execution method, and system
CN108960822B (en) Block chain-based available resource quota exchange method and device
WO2020015409A1 (en) Method and apparatus for distributing copyright income based on block chain
CN110163590B (en) Payment withholding method and device based on block chain, electronic equipment and storage medium
TW202008196A (en) Transaction method and system based on centralized settlement and block chain deposit certification
WO2020029629A1 (en) Transaction method and system based on centralized settlement and block chain storage
TW202008252A (en) Transaction method and system based on centralized settlement and blockchain deposit certificates
WO2020029628A1 (en) Dual transaction method and system based on centralization and decentralization
WO2020015406A1 (en) Method and device for credit evaluation of copyright user based on block chain
WO2020015408A1 (en) Blockchain-based method and apparatus for issuing reward to work user
CN108960902B (en) Block chain-based set exchange method and device for available resource quota
TW202032472A (en) Account collection record processing method and system based on block chain smart contract
TW202004597A (en) Virtual resource delivery and crowdfunding method and device based on block chain
WO2020015414A1 (en) Method and apparatus for issuing reward to work publisher based on blockchain
TW202018655A (en) Blockchain-based property execution method and system
CN107392582B (en) Method and device for realizing resource transfer and method and device for realizing collection and payment
CN109615379B (en) Generating method and device of rejection processing system
US11393031B2 (en) Blockchain-based method and apparatus for pre-exchanging available resource quotas
CN105989238A (en) Data interaction method and device
CN113222572A (en) Transaction execution method and device
CN117201500A (en) Flow distribution method and device, computer equipment and storage medium
CN109583860A (en) A kind of transaction variation and device based on payment unions

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: 21813482

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: 21813482

Country of ref document: EP

Kind code of ref document: A1