WO2019179192A1 - 区块链交易处理方法、装置及存储介质 - Google Patents

区块链交易处理方法、装置及存储介质 Download PDF

Info

Publication number
WO2019179192A1
WO2019179192A1 PCT/CN2018/123588 CN2018123588W WO2019179192A1 WO 2019179192 A1 WO2019179192 A1 WO 2019179192A1 CN 2018123588 W CN2018123588 W CN 2018123588W WO 2019179192 A1 WO2019179192 A1 WO 2019179192A1
Authority
WO
WIPO (PCT)
Prior art keywords
chain
transaction
partition
cross
partition chain
Prior art date
Application number
PCT/CN2018/123588
Other languages
English (en)
French (fr)
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 WO2019179192A1 publication Critical patent/WO2019179192A1/zh

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
    • 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/02Banking, e.g. interest calculation or account maintenance

Definitions

  • the present application relates to the field of blockchain, and in particular to a high performance blockchain transaction processing system and method.
  • PBFT Byzantine Fault Tolerance
  • the present application provides a high-performance blockchain transaction processing method, which horizontally expands the blockchain, routes transactions to different blockchain partitions for parallel processing, and improves transaction throughput and processing timeliness.
  • the present application provides a blockchain transaction processing method, the method comprising:
  • Receiving step receiving a transaction request initiated by a client user
  • Processing steps Distribute the transaction request to a number of identically structured partition chains for parallel processing.
  • the processing step comprises: performing a modulo operation on the address of each transaction requester and the total number of partitions of the partition chain to obtain a first modulo value, and each transaction is performed according to the correspondence between the first modulo value and the partition chain.
  • the request is sent to the corresponding first partition chain.
  • the present application also provides an electronic device including a memory and a processor.
  • a blockchain transaction processing program is stored on the memory, and when the blockchain transaction processing program is executed by the processor, the following steps are implemented:
  • Receiving step receiving a transaction request initiated by a client user
  • Processing steps Distribute the transaction request to a number of identically structured partition chains for parallel processing.
  • the processing step comprises: performing a modulo operation on the address of each transaction requester and the total number of partitions of the partition chain to obtain a first modulo value, and each transaction is performed according to the correspondence between the first modulo value and the partition chain.
  • the request is sent to the corresponding first partition chain.
  • the present application further provides a computer readable storage medium, including a blockchain transaction processing program, when the blockchain transaction processing program is executed by a processor, The steps in the blockchain transaction processing method as described above are implemented.
  • the blockchain transaction processing method, device and storage medium proposed by the present application distributes the transactions sent to the single blockchain processing to the blockchain partitions of the same architecture on average, and expands the blockchain horizontally.
  • the transaction is routed to different blockchain partitions for parallel processing, which enables transactions to arrive at the second level.
  • Transactions have the same structure in different partitions, ensuring that transactions can be accepted in the process of cross-chain forwarding, and can be applied to a wide range of application scenarios.
  • FIG. 1 is a schematic diagram of a preferred embodiment of an electronic device for implementing a high performance blockchain transaction processing method according to the present application.
  • FIG. 2 is a schematic diagram of horizontal expansion of a blockchain in the blockchain transaction processing method of the present application.
  • FIG. 3 is a schematic view of a partition chain having the same structure in FIG. 2.
  • FIG. 4 is a flow chart of a first preferred embodiment of a blockchain transaction processing method of the present application.
  • FIG. 5 is a flowchart of a second preferred embodiment of a blockchain transaction processing method according to the present application.
  • FIG. 6 is a flow chart of a third preferred embodiment of a blockchain transaction processing method of the present application.
  • FIG. 1 it is a schematic diagram of a preferred embodiment of an electronic device 1 for implementing a high performance blockchain transaction processing method.
  • the electronic device 1 may be a server, a smart phone, a tablet computer, a personal computer, a portable computer, and other electronic devices having computing functions.
  • the electronic device 1 includes a memory 11, a processor 13, a network interface 15, and a communication bus 17.
  • the network interface 15 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • Communication bus 17 is used to implement connection communication between these components.
  • the memory 11 includes at least one type of readable storage medium.
  • the at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card type memory, or the like.
  • the memory 11 may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1.
  • the memory 11 may also be an external storage unit of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and security. Digital (Secure Digital, SD) card, flash card (Flash Card), etc.
  • the memory 11 can be used to store application software installed on the electronic device 1 and various types of data, such as program code of the blockchain transaction processing program 10 and related data generated during the operation thereof.
  • the processor 13 may in some embodiments be a Central Processing Unit (CPU), microprocessor or other data processing chip for running program code or processing data stored in the memory 11.
  • CPU Central Processing Unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11.
  • FIG. 1 shows only the electronic device 1 having the components 11-17 and the blockchain transaction processing program 10, but it should be understood that FIG. 1 does not show all the components of the electronic device 1, and may be implemented more or more instead. Less components.
  • the electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, and the like, and details are not described herein.
  • RF radio frequency
  • the program code of the blockchain transaction processing program 10 is stored in the memory 11 as a computer storage medium, and the processor 13 executes the program of the blockchain transaction processing program 10.
  • the user-initiated transaction request is routed to several blockchain partitions of the same architecture for parallel processing (as shown in Figure 2 and Figure 3).
  • the blockchain transaction processing method implemented by the blockchain transaction processing program 10 at the time of operation will be described below with reference to FIGS. 3 to 6.
  • the blockchain transaction processing method implemented when the processor 13 executes the program code of the blockchain transaction processing program 10 stored in the memory 11 includes:
  • Step S10 Receive a transaction request initiated by a client user.
  • step S20 the transaction request is distributed to a plurality of structurally identical partition chains for parallel processing.
  • the total number of partition chains having the same structure is N (N is a positive integer greater than 1), and when the access layer receives a transaction request sent by the user, according to the address of each transaction requester (similar to a bank) A string of numbers of the account number)
  • the value of the partition number N is modulo, and the transaction request is distributed to the corresponding partition chain.
  • the transaction is distributed with the modulo value of the address and the total number of partition chains N.
  • the transaction may also be distributed according to other mapping relationships.
  • step S20 may be implemented by referring to step S103 in FIG. 5 and step S303 in FIG. 6, and may also refer to more other steps in FIG. 5 and FIG. 6.
  • FIG. 5 it is a flowchart of a second preferred embodiment of the blockchain transaction processing method of the present application.
  • Step S101 Receive a transaction request sent by a user.
  • Step S105 the node of the first partition chain parses the transaction request and related information of the transaction to verify the legality of the transaction request and the validity of the transaction.
  • each partition chain includes a plurality of nodes including, but not limited to, a non-billing node (peer node), a billing node (validator node), and a listening node (listener node).
  • the non-accounting node verifies the legality of the transaction request, that is, determines whether the transaction request belongs to the processing task of the partition chain, and the verification mode is to calculate the address of the transaction requester and the total number of partitions N of the partition chain.
  • the modulus M1 corresponds to the partition chain, for example, whether the value M1 is equal to the identification code of the partition chain.
  • the billing node verifies the validity of the transaction, such as whether the amount involved in the transaction request is within the allowable range.
  • Step S107 The node of the first partition chain determines, according to the parsing result, whether the transaction request is legal and whether the transaction is valid. When it is determined that the transaction request is illegal or the transaction is invalid, step S109 is executed to reject the transaction, the process may be ended, and the rejected transaction related information may be fed back to the user who initiated the transaction request and the related institution. When it is judged that the transaction request is legal and the transaction is valid, step S111 is performed.
  • step S111 the accounting node of the first partition chain packages the transaction into blocks, and a consensus is reached between the accounting nodes.
  • the principle that the accounting node packages the transaction into blocks may be based on the time period. When the preset time period arrives, the transaction received at the current time is packaged into blocks, or may be received according to the number of transactions. When the number of transactions reaches a preset threshold, the transaction is packaged into blocks.
  • Step S113 the listening node of the first partition chain parses the transaction information in the block.
  • Step S115 the intercepting node of the first partition chain determines whether the transaction in the block involves a cross-chain transaction according to the parsing.
  • determining whether a transaction involves a cross-chain transaction is: taking the address of the receiver involved in the transaction and the number of partitions N to obtain a value M2, and determining whether the value M2 corresponds to the partition chain, if corresponding Other partition chains involve cross-chain transactions.
  • the judgment value M2 corresponds to the partition chain
  • the transaction is a transaction in the area, and step S117 is performed to complete the transaction in the first partition chain, and the process ends.
  • step S119 is performed.
  • Step S121 the node of the second partition chain verifies the legality of the cross-chain transaction request and the validity of the transaction.
  • the principles of steps S121, 123, and 125 are similar to the above steps S105, S107, and S109, and are not described herein again.
  • step S127 is performed, and the accounting node of the second partition chain packages the transaction into blocks, and a consensus is reached between the accounting nodes.
  • the monitoring node of the second partition chain feeds back information to the listening node of the first partition chain.
  • FIG. 6 it is a flowchart of a third preferred embodiment of the blockchain transaction processing method of the present application.
  • Step S301 receiving a transaction request sent by a user.
  • step S305 the first node of the first partition chain calculates the modulo value M1' of the requester address and the number of partitions N.
  • the first node is a non-billing node. As shown in Fig. 3, after receiving a transaction request, the non-billing node 1 of the partition chain 1 calculates the modulo value M1' of the requester address and the number of partitions N.
  • Step S307 the first node of the first partition chain verifies whether the transaction request belongs to the transaction of the first partition chain according to the modulo value M1'. If the transaction that does not belong to the first partition chain is verified, it is determined that the transaction request is invalid, and step S309 is executed to reject the transaction. The process can be ended, and the rejected transaction related information can be fed back to the user who initiated the transaction request and related institutions.
  • Step S311 the first node of the first partition chain broadcasts the transaction request to all the second nodes of the first partition chain.
  • the second node is a billing node.
  • the non-billing node 1 broadcasts the transaction request to the accounting nodes 1 to 4.
  • Step S313 the second node of the first partition chain parses the transaction information to verify the validity of the transaction, for example, whether the amount involved in the transaction request is within the allowable range.
  • Step S315 the second node of the first partition chain determines whether the transaction is valid. If the transaction is invalid, step S317 is executed to reject the transaction. The process can be ended, and the rejected transaction related information can be fed back to the user who initiated the transaction request and related institutions.
  • step S319 the second node will package the transaction into blocks, and a consensus is reached between the second nodes.
  • the transaction block reaches a consensus between the accounting nodes 1 to 4.
  • the principle that the accounting node packages the transaction into blocks may be based on the time period. When the preset time period arrives, the transaction received at the current time is packaged into blocks, or may be received according to the number of transactions. When the number of transactions reaches a preset threshold, the transaction is packaged into blocks.
  • Step S321 the third node of the first partition chain listens to the transaction block, parses the transaction in the block, and modulates the address of the transaction receiver and the total number of partitions N to obtain a second modulus value M2.
  • the third node is a listening node, such as the listening nodes 1, 2 in FIG.
  • Step S323 the third node of the first partition chain determines, according to the second modulus value M2, whether the transaction involves a cross-chain transaction.
  • M2 corresponds to the first partition chain
  • step S325 completing the transaction in the first partition chain .
  • the process can be ended, and the relevant information of the transaction completion can be fed back to the user who initiated the transaction request and related institutions.
  • step S327 is performed.
  • the second node is sent to the second node of the second partition chain according to the value M2, and the cross-chain transaction is cached to the local memory.
  • M2 2
  • the listening node 2 of the partition chain 1 reads the digital signature from the local memory (not shown), and then signs the cross-chain transaction.
  • the chain transaction is sent to the billing node 4 of the partition chain 2, and the related information of the cross-chain transaction is cached to the local memory.
  • Step S329 after receiving the cross-chain transaction, the second node of the second partition chain calculates the modulo value M2 of the receiver address and the number of partitions N of the cross-chain transaction.
  • Step S331 the second node of the second partition chain determines whether the cross-chain transaction is legal according to the calculated modulo value M2, that is, whether the transaction of the second partition chain is related. If the determination is not legal, step S333 is performed to reject the request. The process can be ended, and the rejected transaction related information can be fed back to the user who initiated the transaction request and related institutions.
  • Step S335 after the second node of the second partition chain verifies the signature validity of the third node of the first partition chain, the cross-link transaction is sent to the other second nodes in the second partition chain to reach a consensus, and the transaction is completed. For example, after the accounting node 4 of the partition chain 2 in FIG. 3 verifies that the signature of the listening node 2 of the partition chain 1 is valid, the cross-link transaction is generated to the accounting nodes 1, 2, and 3 of the partition chain 2, and the consensus is completed. transaction.
  • Step S337 after the third node of the second partition chain monitors that the cross-chain transaction is completed, notifying the third node in the first partition chain that the transaction is completed, and the third node of the first partition chain deletes the cross-chain transaction cached in the memory.
  • the listening node 1 of the partition chain 2 in FIG. 3 after listening to the completion of the cross-chain transaction, notifies the monitoring node 2 of the partition chain 1 that the transaction is completed. After receiving the transaction completion notification, the listening node 2 of the partition chain 1 deletes the related data of the cross-chain transaction cached in the memory.
  • the third node in the first partition chain waits for the second partition chain involved in the cross-chain transaction to feed back the transaction completion information, and if the feedback information is not received after the timeout, the first partition chain The third node reads the cached data of the cross-chain transaction from the memory and sends it to the corresponding second partition chain again.
  • FIG. 5 and FIG. 6 do not necessarily include all the steps shown in the drawings, and are not limited to the steps shown in the drawings.
  • the conventional processing steps of the blockchain system can be incorporated into the present application according to actual application scenarios.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种区块链交易处理方法,该方法包括接收步骤,接收客户端用户发起的交易请求(S10);及处理步骤,将交易请求分发到若干个结构相同的分区链中并行处理(S20)。还提供一种电子装置及计算机可读存储介质,电子装置的处理器执行存储介质中存储的区块链交易处理程序时,可实现上述区块链交易处理方法。利用上述方法,可对区块链进行水平扩展,将原发送到单一区块链处理的交易平均分散到若干个相同架构的区块链分区中并行处理。交易在不同分区具有相同的结构,能够保证交易在跨链转发的过程中被接受认可。

Description

区块链交易处理方法、装置及存储介质
本申请要求于2018年3月22日提交中国专利局、申请号为201810241996.3、发明名称为“区块链交易处理方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及区块链领域,尤其涉及一种高性能的区块链交易处理系统及方法。
背景技术
基于实用拜占庭容错共识算法(Practical Byzantine Fault Tolerance,PBFT)的区块链系统,在接收到用户发起的交易请求后,要求区块链中的验证节点相互进行三轮投票。当用户请求数量大的情况下,网络通信负担重,尤其是当区块链中节点数量多的情况下,节点间通信量呈节点数的平方级增长,使得通信能力成为了区块链系统处理消息的瓶颈。
发明内容
鉴于以上内容,本申请提供一种高性能的区块链交易处理方法,对区块链进行水平扩展,将交易路由到不同的区块链分区进行并行处理,提高交易吞吐量及处理时效。
为实现上述目的,本申请提供一种区块链交易处理方法,其该方法包括:
接收步骤:接收客户端用户发起的交易请求;及
处理步骤:将交易请求分发到若干个结构相同的分区链中并行处理。
优选地,所述处理步骤包括:将各个交易请求方的地址与分区链的总分区数分别进行取模运算得到第一取模值,根据第一取模值与分区链的对应关系将各个交易请求发送至相应的第一分区链。
此外,本申请还提供一种电子装置,该电子装置包括存储器及处理器。 所述存储器上存储有区块链交易处理程序,该区块链交易处理程序被处理器执行时,实现如下步骤:
接收步骤:接收客户端用户发起的交易请求;及
处理步骤:将交易请求分发到若干个结构相同的分区链中并行处理。
优选地,所述处理步骤包括:将各个交易请求方的地址与分区链的总分区数分别进行取模运算得到第一取模值,根据第一取模值与分区链的对应关系将各个交易请求发送至相应的第一分区链。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括区块链交易处理程序,所述区块链交易处理程序被处理器执行时,可实现如上所述区块链交易处理方法中的步骤。
本申请提出的区块链交易处理方法、装置及存储介质,将发送到单一区块链处理的交易平均分散到若干个相同架构的区块链分区中,对区块链进行了水平扩展,将交易路由到不同的区块链分区进行并行处理,可以实现交易秒级到账。交易在不同分区具有相同的结构,保证交易在跨链转发的过程中可以被接受认可,可适用于广泛的应用场景。
附图说明
图1为本申请实现高性能的区块链交易处理方法的电子装置较佳实施例的示意图。
图2是本申请区块链交易处理方法对区块链进行水平扩展的示意图。
图3为图2中具有相同结构的分区链的示意图。
图4为本申请区块链交易处理方法第一较佳实施例的流程图。
图5为本申请区块链交易处理方法第二较佳实施例的流程图。
图6为本申请区块链交易处理方法第三较佳实施例的流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定 本申请。
如图1所示,是本申请实现高性能的区块链交易处理方法的电子装置1较佳实施例的示意图。
在本实施例中,电子装置1可以是服务器、智能手机、平板电脑、个人电脑、便携计算机以及其它具有运算功能的电子设备。
该电子装置1包括:存储器11、处理器13、网络接口15及通信总线17。其中,网络接口15可选地可以包括标准的有线接口、无线接口(如WI-FI接口)。通信总线17用于实现这些组件之间的连接通信。
存储器11至少包括一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述存储器11可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘。在另一些实施例中,所述存储器11也可以是所述电子装置1的外部存储单元,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
在本实施例中,所述存储器11可以用于存储安装于所述电子装置1的应用软件及各类数据,例如区块链交易处理程序10的程序代码及其运行过程中产生的相关数据。
处理器13在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其它数据处理芯片,用于运行存储器11中存储的程序代码或处理数据。
图1仅示出了具有组件11-17以及区块链交易处理程序10的电子装置1,但是应理解的是,图1并未示出电子装置1的所有组件,可以替代实施更多或者更少的组件。该电子装置1还可以包括射频(Radio Frequency,RF)电路、传感器和音频电路等等,在此不再赘述。
在图1所示的电子装置1实施例中,作为一种计算机存储介质的存储器11中存储区块链交易处理程序10的程序代码,处理器13执行所述区块链交易处理程序10的程序代码时,将用户发起的交易请求路由到若干个架构相同的区块链分区中并行处理(如图2、图3所示)。以下结合图3~图6说明区块链交易处理程序10运行时实现的区块链交易处理方法。
如图4所示,是本申请区块链交易处理方法第一较佳实施例的流程图。在本实施例中,在本实施例中,处理器13执行存储器11中存储的区块链交易处理程序10的程序代码时实现的区块链交易处理方法包括:
步骤S10,接收客户端用户发起的交易请求。
步骤S20,将交易请求分发到若干个结构相同的分区链中并行处理。
如图2所示,具有相同结构的分区链总数为N(N为大于1的正整数),当接入层接收到用户发送的交易请求时,根据每个交易请求方的地址(类似于银行账号的一串数字)对分区数N取模的值,将交易请求分发到相应的分区链。例如,当某个交易请求方的地址对分区数N取模的值为1,该交易请求方的交易请求分发至分区链1处理;当另一个交易请求方的地址对分区数N取模的值为3,则将该交易请求方的交易请求分发至分区链3处理。在本实施例中,是以地址与分区链总数N的取模值对交易进行分发。在其他实施例中,也可以是依据其他映射关系对交易进行分发。
关于步骤S20的具体介绍,请参图5及图6中相关步骤。例如,步骤S20可以参照图5中步骤S103、图6中步骤S303实现,也可以涉及图5、图6中更多其他的步骤。
如图5所示,是本申请区块链交易处理方法第二较佳实施例的流程图。
步骤S101,接收用户发送的交易请求。
步骤S103,根据交易请求方的地址与分区链的总分区数N的取模值M1将该交易请求发送至第一分区链。例如,当M1=1时,该交易请求发送至如图2所示的第一分区链1。
步骤S105,第一分区链的节点解析该交易请求及该交易的相关信息,以验证该交易请求的合法性和交易的有效性。如图3所示,每个分区链包括多个节点,包括但不限于,非记账节点(peer节点)、记账节点(validator节点)及监听节点(listener节点)。接收到交易请求后,非记账节点验证交易请求的合法性,即判断该交易请求是否属于本分区链的处理任务,验证方式为计算交易请求方的地址与分区链的总分区数N的取模值M1是否对应于该分区链,例如值M1是否等于该分区链的识别码。记账节点验证交易的有效性,例如该 交易请求涉及的金额是否在允许范围之内。
步骤S107,第一分区链的节点根据解析结果判断该交易请求是否合法、该交易是否有效。当判断该交易请求不合法、或该交易无效时,执行步骤S109,拒绝交易,流程可以结束,也可以反馈被拒绝的交易相关信息给发起交易请求的用户及相关机构。当判断该交易请求合法且该交易有效时,执行步骤S111。
步骤S111,第一分区链的记账节点将交易打包成区块,在记账节点间达成共识。记账节点将交易打包成区块遵循的原则可以是根据时间周期,当预设的时间周期到达时,将截止当前时间收到的交易打包成区块,也可以是依据交易数量,当收到的交易数量达到预设阈值时,将交易打包成区块。
步骤S113,第一分区链的监听节点解析区块中的交易信息。
步骤S115,第一分区链的监听节点根据解析判断区块中的交易是否涉及跨链交易。在本实施例中,判断一个交易是否涉及跨链交易的方式是:将该交易涉及到的接收方的地址与分区数N取模得到值M2,判断值M2是否对应于本分区链,如果对应的是其他分区链,则涉及跨链交易。当判断值M2对应于本分区链时,该交易为本区内交易,执行步骤S117,在该第一分区链中完成交易,流程结束。当判断值M2对应于其他分区链时,执行步骤S119。
步骤S119,第一分区链的监听节点根据交易接收方的地址与总分区数N的取模值M2,将跨链交易请求发送至第二分区链。例如,当值M2=2时,将该跨链交易请求发送至图2、图3中的分区链2。
步骤S121,第二分区链的节点验证跨链交易请求的合法性和交易的有效性。步骤S121、123、125的原理类似于上述步骤S105、S107、S109,此处不再赘述。当第二分区链的节点判断该跨链交易请求合法且该跨链交易有效时,执行步骤S127,第二分区链的记账节点将交易打包成区块,在记账节点间达成共识,完成交易后由第二分区链的监听节点反馈信息给第一分区链的监听节点。
如图6所示,是本申请区块链交易处理方法第三较佳实施例的流程图。
步骤S301,接收用户发送的交易请求。
步骤S303,根据交易请求方的地址与分区链的总分区数N的取模值M1将该交易请求发送至第一分区链。例如M1=1,该交易请求发送至如图3所示 的分区链1。
步骤S305,第一分区链的第一节点计算请求方地址与分区数N的取模值M1’。在本实施例中,第一节点为非记账节点。如图3所示,分区链1的非记账节点1接收到一个交易请求后,计算该请求方地址与分区数N的取模值M1’。
步骤S307,第一分区链的第一节点根据该取模值M1’验证该交易请求是否属于该第一分区链的交易。若验证不属于该第一分区链的交易,则判断该交易请求不合法,执行步骤S309,拒绝交易。流程可以结束,也可以反馈被拒绝的交易相关信息给发起交易请求的用户及相关机构。
若步骤S307判断交易请求合法,则执行步骤S311。例如,当图3的非记账节点1判断取模值M1’对应的不是分区链1时,拒绝交易,若取模值M1’=1,则判断该交易请求合法。
步骤S311,第一分区链的第一节点广播该交易请求至该第一分区链的所有第二节点。在本实施例中,第二节点为记账节点。如图3所示,非记账节点1将该交易请求广播给记账节点1~4。
步骤S313,第一分区链的第二节点解析交易信息以验证交易的有效性,例如该交易请求涉及的金额是否在允许范围之内。
步骤S315,第一分区链的第二节点判断交易是否有效。若交易无效,则执行步骤S317,拒绝交易。流程可以结束,也可以反馈被拒绝的交易相关信息给发起交易请求的用户及相关机构。
若步骤S315判断交易有效,则执行步骤S319,第二节点将将交易打包成区块,在第二节点间达成共识。如图3所示,交易区块在记账节点1~4之间达成共识。记账节点将交易打包成区块遵循的原则可以是根据时间周期,当预设的时间周期到达时,将截止当前时间收到的交易打包成区块,也可以是依据交易数量,当收到的交易数量达到预设阈值时,将交易打包成区块。
步骤S321,第一分区链的第三节点监听交易区块,解析区块中的交易,将交易接收方的地址与总分区数N取模得到第二取模值M2。在本实施例中,第三节点为监听节点,例如图3中的监听节点1、2。
步骤S323,第一分区链的第三节点根据第二取模值M2判断该交易是否涉及跨链交易。当第二取模值M2对应于该第一分区链时,例如M2=1、对应于分区链1,判断该交易为本分区链内部交易,执行步骤S325,在该第一分 区链中完成交易。流程可以结束,也可以反馈交易完成的相关信息给发起交易请求的用户及相关机构。
当步骤S323判断该交易涉及跨链交易,执行步骤S327,第三节点签名跨链交易后,根据值M2发送至第二分区链的第二节点,并缓存跨链交易到本地内存。例如,M2=2、对应于图3中的分区链2,分区链1的监听节点2从本地内存(图中未示出)中读取数字签名对该跨链交易进行签名后,将该跨链交易发送至分区链2的记账节点4,并将该跨链交易的相关信息缓存至本地内存。
步骤S329,第二分区链的第二节点接收到跨链交易后,计算跨链交易的接收方地址与分区数N的取模值M2。
步骤S331,第二分区链的第二节点根据计算得到的取模值M2判断该跨链交易是否合法,即是否有关该第二分区链的交易。若判断不合法,则执行步骤S333,拒绝请求。流程可以结束,也可以反馈被拒绝的交易相关信息给发起交易请求的用户及相关机构。
步骤S335,第二分区链的第二节点验证第一分区链的第三节点的签名有效性后,将该跨链交易发送给该第二分区链中的其他第二节点达成共识,完成交易。例如,图3中分区链2的记账节点4验证分区链1的监听节点2的签名有效后,将该跨链交易发生给分区链2的记账节点1、2、3达成共识后,完成交易。
步骤S337,第二分区链的第三节点监听到该跨链交易完成后,通知第一分区链中的第三节点交易完成,第一分区链的第三节点删除内存中缓存的跨链交易。例如,图3中分区链2的监听节点1监听到该跨链交易完成后,通知分区链1的监听节点2交易完成。分区链1的监听节点2收到交易完成通知后,删除内存中缓存的该跨链交易的相关数据。
在其他实施例中,在执行步骤S327后,第一分区链中的第三节点等待跨链交易涉及的第二分区链反馈交易完成信息,若超时未收到反馈信息,则第一分区链中的第三节点从内存中读取缓存的该跨链交易的数据,再次发送至相应的第二分区链。
需要指出的是,图5、图6所示的流程图中,并不必然包括图中所示的所有步骤,也不限于图中所示的步骤。此外,有关区块链系统的常规处理步骤, 可以根据实际应用场景纳入本申请。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种区块链交易处理方法,其特征在于,该方法包括:
    接收步骤:接收客户端用户发起的交易请求;及
    处理步骤:将交易请求分发到若干个结构相同的分区链中并行处理。
  2. 如权利要求1所述的区块链交易处理方法,其特征在于,所述处理步骤包括:
    将各个交易请求方的地址与分区链的总分区数分别进行取模运算得到第一取模值,根据第一取模值与分区链的对应关系将各个交易请求分发至相应的第一分区链。
  3. 如权利要求1或2所述的区块链交易处理方法,其特征在于,所述处理步骤还包括:
    第一分区链每接收到一个交易请求时,验证该交易请求的合法性和交易的有效性;
    当验证交易请求合法且交易有效时,第一分区链将交易打包成区块,在第一分区链的节点间达成共识;
    第一分区链判断区块中的交易是否涉及跨链交易;
    当判断不涉及跨链交易时,在第一分区链中完成交易。
  4. 如权利要求3所述的区块链交易处理方法,其特征在于,所述处理步骤还包括:
    当判断涉及跨链交易时,第一分区链根据交易接收方的地址与总分区数的第二取模值将跨链交易请求分别发送至相应的第二分区链;
    第二分区链验证接收到的跨链交易请求的合法性和该跨链交易的有效性;
    当验证跨链交易请求合法且跨链交易有效时,第二分区链将跨链交易打包成区块,在第二分区链的节点间达成共识,完成交易后反馈信息给相应的第一分区链。
  5. 如权利要求3所述的区块链交易处理方法,其特征在于:
    所述第一分区链验证该交易请求是否合法是通过判断该交易请求方的地址与分区链的总分区数的第一取模值是否对应于该第一分区链;
    所述第一分区链判断区块中的一个交易是否涉及跨链交易是通过判断该交易接收方的地址与分区链的总分区数的第二取模值是否对应于该第一分区 链,当该第二取模值对应的不是该第一分区链时,判断该交易涉及跨链交易。
  6. 如权利要求4所述的区块链交易处理方法,其特征在于,所述第二分区链验证接收到的一个跨链交易请求是否合法是通过判断该跨链交易接收方的地址与分区链的总分区数的第二取模值是否对应于该第二分区链。
  7. 如权利要求4所述的区块链交易处理方法,其特征在于,所述第一分区链将跨链交易请求分别发送至相应的第二分区链之前或之后,还执行以下操作:
    将跨链交易请求缓存至该第一分区链的内存。
  8. 如权利要求7所述的区块链交易处理方法,其特征在于,所述第一分区链将跨链交易请求分别发送至相应的第二分区链之后,还执行以下操作:
    当超时未接收到该第二分区链发送的反馈信息时,从内存中读取该跨链交易请求重新发送至该第二分区链。
  9. 如权利要求7所述的区块链交易处理方法,其特征在于,所述第一分区链将跨链交易请求分别发送至相应的第二分区链之后,还执行以下操作:
    当接收到该第二分区链发送的反馈信息时,从内存中删除该跨链交易请求。
  10. 一种电子装置,该电子装置包括存储器及处理器,其特征在于,所述存储器上存储有区块链交易处理程序,该区块链交易处理程序被处理器执行时,实现如下步骤:
    接收步骤:接收客户端用户发起的交易请求;及
    处理步骤:将交易请求分发到若干个结构相同的分区链中并行处理。
  11. 如权利要求10所述的电子装置,其特征在于,所述处理步骤包括:
    将各个交易请求方的地址与分区链的总分区数分别进行取模运算得到第一取模值,根据第一取模值与分区链的对应关系将各个交易请求分发至相应的第一分区链。
  12. 如权利要求10或11所述的电子装置,其特征在于,所述处理步骤还包括:
    第一分区链每接收到一个交易请求时,验证该交易请求的合法性和交易的有效性;
    当验证交易请求合法且交易有效时,第一分区链将交易打包成区块,在 第一分区链的节点间达成共识;
    第一分区链判断区块中的交易是否涉及跨链交易;
    当判断不涉及跨链交易时,在第一分区链中完成交易。
  13. 如权利要求12所述的电子装置,其特征在于,所述处理步骤还包括:
    当判断涉及跨链交易时,第一分区链根据交易接收方的地址与总分区数的第二取模值将跨链交易请求分别发送至相应的第二分区链;
    第二分区链验证接收到的跨链交易请求的合法性和该跨链交易的有效性;
    当验证跨链交易请求合法且跨链交易有效时,第二分区链将跨链交易打包成区块,在第二分区链的节点间达成共识,完成交易后反馈信息给相应的第一分区链。
  14. 如权利要求13所述的电子装置,其特征在于,其特征在于,所述第一分区链将跨链交易请求分别发送至相应的第二分区链之前或之后,还执行以下操作:
    将跨链交易请求缓存至该第一分区链的内存。
  15. 如权利要求14所述的电子装置,其特征在于,所述第一分区链将跨链交易请求分别发送至相应的第二分区链之后,还执行以下操作:
    当超时未接收到该第二分区链发送的反馈信息时,从内存中读取该跨链交易请求重新发送至该第二分区链;
    当接收到该第二分区链发送的反馈信息时,从内存中删除该跨链交易请求。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括区块链交易处理程序,所述区块链交易处理程序被处理器执行时,实现如下步骤:
    接收步骤:接收客户端用户发起的交易请求;及
    处理步骤:将交易请求分发到若干个结构相同的分区链中并行处理。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理步骤包括:
    将各个交易请求方的地址与分区链的总分区数分别进行取模运算得到第一取模值,根据第一取模值与分区链的对应关系将各个交易请求分发至相应的第一分区链。
  18. 如权利要求16或17所述的计算机可读存储介质,其特征在于,所述处理步骤还包括:
    第一分区链每接收到一个交易请求时,验证该交易请求的合法性和交易的有效性;
    当验证交易请求合法且交易有效时,第一分区链将交易打包成区块,在第一分区链的节点间达成共识;
    第一分区链判断区块中的交易是否涉及跨链交易;
    当判断不涉及跨链交易时,在第一分区链中完成交易。
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述处理步骤还包括:
    当判断涉及跨链交易时,第一分区链根据交易接收方的地址与总分区数的第二取模值将跨链交易请求分别发送至相应的第二分区链;
    第二分区链验证接收到的跨链交易请求的合法性和该跨链交易的有效性;
    当验证跨链交易请求合法且跨链交易有效时,第二分区链将跨链交易打包成区块,在第二分区链的节点间达成共识,完成交易后反馈信息给相应的第一分区链。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于:
    所述第一分区链验证该交易请求是否合法是通过判断该交易请求方的地址与分区链的总分区数的第一取模值是否对应于该第一分区链;
    所述第一分区链判断区块中的一个交易是否涉及跨链交易是通过判断该交易接收方的地址与分区链的总分区数的第二取模值是否对应于该第一分区链,当该第二取模值对应的不是该第一分区链时,判断该交易涉及跨链交易;
    所述第二分区链验证接收到的一个跨链交易请求是否合法是通过判断该跨链交易接收方的地址与分区链的总分区数的第二取模值是否对应于该第二分区链。
PCT/CN2018/123588 2018-03-22 2018-12-25 区块链交易处理方法、装置及存储介质 WO2019179192A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810241996.3 2018-03-22
CN201810241996.3A CN108399572A (zh) 2018-03-22 2018-03-22 区块链交易处理方法、装置及存储介质

Publications (1)

Publication Number Publication Date
WO2019179192A1 true WO2019179192A1 (zh) 2019-09-26

Family

ID=63091975

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/123588 WO2019179192A1 (zh) 2018-03-22 2018-12-25 区块链交易处理方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN108399572A (zh)
WO (1) WO2019179192A1 (zh)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399572A (zh) * 2018-03-22 2018-08-14 深圳市网心科技有限公司 区块链交易处理方法、装置及存储介质
JP7362654B2 (ja) 2018-04-27 2023-10-17 エヌチェーン ライセンシング アーゲー 分割されたブロックチェーンネットワークにおけるブロックチェーンのブロックの維持管理
CN109165324A (zh) * 2018-08-20 2019-01-08 深圳市元征科技股份有限公司 一种交易数据封装方法及相关装置
CN110941479B (zh) * 2018-09-25 2023-04-07 广州虎牙信息科技有限公司 任务数据执行方法、服务器以及计算机存储介质
CN109493221B (zh) * 2018-10-26 2021-01-12 全链通有限公司 区块链中交易记录保密方法、设备、网络及存储介质
CN109544310A (zh) * 2018-11-13 2019-03-29 孙晞瑜 一种基于区块链联盟链的快速共识记账方法及其系统
CN109493050B (zh) * 2018-11-21 2021-08-03 北京蓝石环球区块链科技有限公司 基于区块链主链加并行多子链的转账方法
CN109685488A (zh) * 2018-12-24 2019-04-26 杭州复杂美科技有限公司 转账交易分片处理方法、设备和存储介质
CN110020902B (zh) * 2018-12-27 2021-01-08 创新先进技术有限公司 跨链存证方法及访问方法、装置、电子设备
CN109784930B (zh) * 2019-02-18 2023-07-18 深圳市迅雷网络技术有限公司 一种区块链交易数据的处理方法、装置、电子设备及介质
CN110020859B (zh) * 2019-03-28 2022-03-11 杭州秘猿科技有限公司 一种并行执行的区块链共识方法、装置及电子设备
CN110474777B (zh) * 2019-08-09 2023-02-17 刘一涵 记账节点和区块生成方法
CN110619582B (zh) * 2019-09-18 2023-07-14 深圳前海微众银行股份有限公司 区块链交易方法、装置、设备及计算机存储介质
CN111010441B (zh) * 2019-12-18 2022-12-13 深圳市迅雷网络技术有限公司 一种区块链跨链方法、系统及电子设备
CN111144866B (zh) * 2019-12-25 2021-04-30 腾讯科技(深圳)有限公司 数据转移方法、装置、节点设备及存储介质
CN111600908B (zh) * 2020-06-17 2021-07-13 杭州云链趣链数字科技有限公司 数据处理的方法、系统、计算机设备和可读存储介质
CN111738721B (zh) * 2020-06-23 2024-07-23 金蝶软件(中国)有限公司 一种区块链交易监听方法以及相关装置
CN112783975A (zh) * 2020-12-31 2021-05-11 杭州趣链科技有限公司 区块链分区管理及跨分区交易方法与装置
CN113360951B (zh) * 2021-05-12 2022-08-16 电子科技大学 一种基于分区式区块链的电子证据保全方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630609A (zh) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 区块链的打包存储方法
CN106445711A (zh) * 2016-08-28 2017-02-22 杭州云象网络技术有限公司 一种应用于区块链的拜占庭容错共识方法
CN106682984A (zh) * 2016-10-27 2017-05-17 上海亿账通区块链科技有限公司 基于区块链的交易事务处理方法及系统
CN108399572A (zh) * 2018-03-22 2018-08-14 深圳市网心科技有限公司 区块链交易处理方法、装置及存储介质
CN108600315A (zh) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 区块链路由处理方法、装置及存储介质
CN108596613A (zh) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 区块链交易处理方法、装置及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255108B2 (en) * 2016-01-26 2019-04-09 International Business Machines Corporation Parallel execution of blockchain transactions
US10417217B2 (en) * 2016-08-05 2019-09-17 Chicago Mercantile Exchange Inc. Systems and methods for blockchain rule synchronization
CN107241279A (zh) * 2017-06-22 2017-10-10 北京天德科技有限公司 一种基于多级缓冲队列的区块链交易限流方法
CN107392608B (zh) * 2017-07-11 2020-07-07 北京博晨技术有限公司 基于区块链系统的数字资产交易方法及区块链系统
CN107423124A (zh) * 2017-07-27 2017-12-01 中链科技有限公司 一种用于对交易数据进行并行处理的方法
CN107786642B (zh) * 2017-09-30 2020-04-17 上海数据交易中心有限公司 用于数据流通的区块链构建方法及装置、存储介质、服务器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630609A (zh) * 2016-02-24 2016-06-01 杭州复杂美科技有限公司 区块链的打包存储方法
CN106445711A (zh) * 2016-08-28 2017-02-22 杭州云象网络技术有限公司 一种应用于区块链的拜占庭容错共识方法
CN106682984A (zh) * 2016-10-27 2017-05-17 上海亿账通区块链科技有限公司 基于区块链的交易事务处理方法及系统
CN108399572A (zh) * 2018-03-22 2018-08-14 深圳市网心科技有限公司 区块链交易处理方法、装置及存储介质
CN108600315A (zh) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 区块链路由处理方法、装置及存储介质
CN108596613A (zh) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 区块链交易处理方法、装置及存储介质

Also Published As

Publication number Publication date
CN108399572A (zh) 2018-08-14

Similar Documents

Publication Publication Date Title
WO2019179192A1 (zh) 区块链交易处理方法、装置及存储介质
CN108600315B (zh) 区块链路由处理方法、装置及存储介质
US11025714B2 (en) System and method for announcing cryptographic keys on a blockchain
CN106101258B (zh) 一种混合云的接口调用方法、装置及系统
US9648008B2 (en) Terminal identification method, and method, system and apparatus of registering machine identification code
WO2018090331A1 (zh) 区块链网络、物品交易方法、装置及节点设备
CN107493340B (zh) 区块链网络中的数据分发校验方法、装置及系统
WO2018177093A1 (zh) 区块链处理方法、记账节点、验证节点及存储介质
US11107079B2 (en) Methods, systems, apparatuses and devices for verifying credibility of consortium blockchain
KR20160037213A (ko) 전자 토큰 프로세싱
WO2017020618A1 (zh) 一种电子资源处理方法、设备
CN110995751B (zh) 一种基于区块链的大数据智慧医疗养老服务方法及其系统
US10038685B2 (en) Service request authentication method and apparatus
WO2019056971A1 (zh) 一种鉴权方法及设备
CN115378737B (zh) 跨域设备通信信任方法、装置、设备和介质
EP3792855A1 (en) A method and system for executing fast and safe transactions involving a high-latency blockchain
CN113888164A (zh) 区块链交易池实现方法、装置、计算机设备和存储介质
CN113612616A (zh) 一种基于区块链的车辆通信方法和装置
CN111866993A (zh) 无线局域网连接管理方法、装置、软件程序及存储介质
CN113225348B (zh) 请求防重放校验方法和装置
CN111524010B (zh) 平行链共识方法、设备和存储介质
US11501295B2 (en) Object distribution processing
CN111585940B (zh) 一种资源管理方法及其相关设备
CN111163466A (zh) 5g用户终端接入区块链的方法、用户终端设备及介质
CN114500025B (zh) 一种账户标识获取方法、装置、服务器及存储介质

Legal Events

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

Ref document number: 18910921

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25/01/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18910921

Country of ref document: EP

Kind code of ref document: A1