CN109831514B - Parallel chain consensus method, data exception handling method, device and storage medium - Google Patents
Parallel chain consensus method, data exception handling method, device and storage medium Download PDFInfo
- Publication number
- CN109831514B CN109831514B CN201910157805.XA CN201910157805A CN109831514B CN 109831514 B CN109831514 B CN 109831514B CN 201910157805 A CN201910157805 A CN 201910157805A CN 109831514 B CN109831514 B CN 109831514B
- Authority
- CN
- China
- Prior art keywords
- parachain
- consensus
- node
- main chain
- transaction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000003672 processing method Methods 0.000 claims abstract description 10
- 230000002159 abnormal effect Effects 0.000 claims description 29
- 238000012545 processing Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 230000001360 synchronised effect Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 238000013475 authorization Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Hardware Redundancy (AREA)
Abstract
本发明提供平行链共识方法、数据异常处理方法、设备和存储介质,该方法包括:在主链生成第一平行链区块的共识结果后,从对应的主链节点同步第一平行链区块的第一共识交易,执行第一共识交易以生成第一执行结果;其中,第一共识交易包括通过平行链‑主链共识的第一平行链区块的若干第一交易的执行结果;将第一执行结果与当前平行链节点执行若干第一交易生成的第二执行结果对比是否一致:是,则平行链共识成功,增加第一平行链的共识高度;否,则平行链共识失败,不增加第一平行链的共识高度。本发明通过将执行第一共识交易的执行结果与本节点执行的同步主链交易的第二执行结果对比,能够及时发现攻击者的篡改,进一步确保了共识结果的准确性。
The present invention provides a parallel chain consensus method, data exception processing method, equipment and storage medium. The method includes: after the main chain generates the consensus result of the first parallel chain block, synchronizing the first parallel chain block from the corresponding main chain node The first consensus transaction is executed, and the first consensus transaction is executed to generate the first execution result; wherein, the first consensus transaction includes the execution results of several first transactions of the first parachain block that have passed the parachain-main chain consensus; Whether the first execution result is consistent with the second execution result generated by the current parachain node executing several first transactions: Yes, the parachain consensus is successful, and the consensus height of the first parachain is increased; No, the parachain consensus fails, and no increase The consensus height of the first parachain. By comparing the execution result of executing the first consensus transaction with the second execution result of the synchronized main chain transaction executed by the node, the present invention can detect the tampering of the attacker in time, and further ensure the accuracy of the consensus result.
Description
技术领域technical field
本申请涉及区块链信息技术领域,具体涉及一种平行链共识方法、数据异常处理方法、设备和存储介质。The present application relates to the field of blockchain information technology, in particular to a parallel chain consensus method, data exception processing method, equipment and storage medium.
背景技术Background technique
现有的平行链共识中,都是平行链执行完属于本条链的交易后,将执行结果发送给主链进行共识,平行链只需要同步主链的共识结果以完成平行链共识。这种情况直接同步主链共识结果的方案很容易造成共识结果遭到篡改但平行链节点不知道的现象,等平行链发现后可能区块高度已经增长了许多,造成了很大的损失。In the existing parachain consensus, after the parachain executes the transaction belonging to the chain, the execution result is sent to the main chain for consensus, and the parachain only needs to synchronize the consensus result of the main chain to complete the parachain consensus. In this case, the scheme of directly synchronizing the consensus results of the main chain can easily lead to the phenomenon that the consensus results are tampered with but the parachain nodes do not know it. After the parachain is discovered, the block height may have increased a lot, causing great losses.
发明内容SUMMARY OF THE INVENTION
鉴于现有技术中的上述缺陷或不足,期望提供一种具有校验功能的平行链共识方法、设备和存储介质。In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a parachain consensus method, device and storage medium with a verification function.
第一方面,本发明提供一种平行链共识方法,该方法适用于平行链节点,该方法包括:In a first aspect, the present invention provides a parachain consensus method, the method is suitable for parachain nodes, and the method includes:
在主链生成第一平行链区块的共识结果后,从对应的主链节点同步第一平行链区块的第一共识交易,执行第一共识交易以生成第一执行结果;其中,第一共识交易包括通过平行链-主链共识的第一平行链区块的若干第一交易的执行结果;After the main chain generates the consensus result of the first parachain block, synchronize the first consensus transaction of the first parachain block from the corresponding main chain node, and execute the first consensus transaction to generate the first execution result; wherein, the first The consensus transaction includes the execution results of several first transactions of the first parachain block through the parachain-mainchain consensus;
将第一执行结果与当前平行链节点执行若干第一交易生成的第二执行结果对比是否一致:Compare whether the first execution result is consistent with the second execution result generated by the current parachain node executing several first transactions:
是,则平行链共识成功,增加第一平行链的共识高度;If yes, the parachain consensus is successful, increasing the consensus height of the first parachain;
否,则平行链共识失败,不增加第一平行链的共识高度。Otherwise, the parachain consensus fails, and the consensus height of the first parachain is not increased.
进一步,若平行链共识失败,则判断当前平行链节点是否发生故障:Further, if the parachain consensus fails, determine whether the current parachain node fails:
是,处理本平行链节点故障后继续执行从对应的主链节点同步第一平行链区块的第一共识交易及后续步骤;Yes, continue to execute the first consensus transaction and subsequent steps of synchronizing the first parachain block from the corresponding main chain node after processing the failure of this parachain node;
否,发送数据异常交易至对应的主链节点,以供主链节点判断共识失败原因并处理。No, send abnormal data transactions to the corresponding main chain node, so that the main chain node can determine the cause of consensus failure and deal with it.
第二方面,本发明提供一种数据异常处理方法,该方法适用于主链节点,该方法包括:In a second aspect, the present invention provides a data exception processing method, which is suitable for main chain nodes, and the method includes:
接收对应的平行链节点发送的数据异常交易;其中,数据异常交易由平行链节点判断第一执行结果与平行链节点执行若干第一交易生成的第二执行结果对比不一致导致的平行链共识失败并非本平行链节点故障造成后发送,第一执行结果由平行链节点同步并执行第一共识交易生成,第一共识交易包括通过平行链-主链共识的第一平行链区块的若干第一交易的执行结果;Receive the abnormal data transaction sent by the corresponding parachain node; wherein, the parachain consensus failure caused by the inconsistency between the parachain node's judgment of the first execution result and the second execution result generated by the parachain node executing several first transactions for the abnormal data transaction is not This parachain node is sent after failure, and the first execution result is generated by the parachain node synchronizing and executing the first consensus transaction. The first consensus transaction includes several first transactions of the first parachain block that have passed the parachain-main chain consensus. the execution result;
根据数据异常交易对异常数据进行判断并处理,以供平行链节点从对应的主链节点同步并执行第一平行链区块的第一共识交易以生成第一执行结果,并判断第一执行结果与平行链节点执行若干第一交易生成的第二执行结果对比是否一致。Judging and processing the abnormal data according to the abnormal data transaction, so that the parachain node can synchronize from the corresponding main chain node and execute the first consensus transaction of the first parachain block to generate the first execution result, and judge the first execution result Whether it is consistent with the second execution result generated by the parachain node executing several first transactions.
进一步,根据数据异常交易对异常数据进行判断并处理包括:Further, judging and processing abnormal data according to abnormal data transactions includes:
根据异常数据判断主链是否分叉:是,则进行回滚操作。Determine whether the main chain is forked according to the abnormal data: if yes, then roll back.
第三方面,本发明还提供一种设备,包括一个或多个处理器和存储器,其中存储器包含可由该一个或多个处理器执行的指令以使得该一个或多个处理器执行根据本发明各实施例提供的平行链共识,数据异常处理方法。In a third aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform various functions according to the present invention. The parachain consensus and data exception processing method provided by the embodiment.
第四方面,本发明还提供一种存储有计算机程序的存储介质,该计算机程序使计算机执行根据本发明各实施例提供的平行链共识,数据异常处理方法。In a fourth aspect, the present invention further provides a storage medium storing a computer program, the computer program enables a computer to execute the parachain consensus and data exception processing method provided according to the embodiments of the present invention.
本发明诸多实施例提供的一种平行链共识方法、设备和存储介质通过将同步并执行平行链节点发送到主链上的通过平行链-主链共识后的第一共识交易,并将执行结果与本节点执行的同步主链交易的第二执行结果对比,通过平行链节点的对比校验,能够及时发现攻击者的篡改,进一步确保了共识结果的准确性。A parachain consensus method, device, and storage medium provided by various embodiments of the present invention send the synchronization and execution parachain node to the first consensus transaction on the main chain after the parachain-main chain consensus, and send the execution result to the first consensus transaction on the main chain. Compared with the second execution result of the synchronous main chain transaction executed by this node, the tampering by the attacker can be detected in time through the comparison and verification of the parachain node, which further ensures the accuracy of the consensus result.
本发明一些实施例提供的一种平行链共识方法、设备和存储介质进一步通过平行链共识失败后及时自查原因或及时通知主链节点,以便针对失败原因作出处理,提高了平行链共识的效率。A parachain consensus method, device and storage medium provided by some embodiments of the present invention further self-check the cause or notify the main chain node in time after the parachain consensus fails, so as to deal with the failure cause and improve the efficiency of the parachain consensus .
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1为本发明一实施例提供的一种平行链共识方法的场景示意图。FIG. 1 is a schematic diagram of a scenario of a parachain consensus method provided by an embodiment of the present invention.
图2为本发明一实施例提供的一种平行链共识方法的流程图FIG. 2 is a flowchart of a parachain consensus method provided by an embodiment of the present invention
图3为图2所示方法一优选实施方式的流程图。FIG. 3 is a flowchart of a preferred embodiment of the method shown in FIG. 2 .
图4为本发明一实施例提供的一种数据异常处理方法的流程图。FIG. 4 is a flowchart of a data exception processing method according to an embodiment of the present invention.
图5为本发明一实施例提供的一种设备的结构示意图。FIG. 5 is a schematic structural diagram of a device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
本发明提供一种平行链节点对通过平行链-主链共识机制共识的区块进行平行链侧共识的的解决方案。在本发明中,一条主链可以配置一条或多条平行链。The present invention provides a solution for a parallel chain node to perform a consensus on a parallel chain side for a block that is agreed through a parallel chain-main chain consensus mechanism. In the present invention, one main chain may be configured with one or more parallel chains.
一条平行链的每个节点分别对应于不同的主链节点,并可以与对应的主链节点进行通信,平行链的各节点之间相互不能进行通信。Each node of a parachain corresponds to a different main chain node, and can communicate with the corresponding main chain node, and each node of the parachain cannot communicate with each other.
平行链-主链的共识机制借助于主链的共识:平行链中配置有若干个授权节点(通常为3f+1个,f为正整数),各授权节点分别打包待共识区块的区块信息并发送至对应的主链节点,主链节点将各区块信息记录至主链上,并验证各区块信息中是否有不少于第一阈值数量的区块信息相同:是,则该平行链区块通过共识,并为该平行链区块配置用于认证的commit标识,待共识区块的区块信息为执行本条平行链的交易的执行结果,以共识交易的形式发送至对应的主链节点。The consensus mechanism of parachain-main chain relies on the consensus of the main chain: there are several authorized nodes (usually 3f+1, f is a positive integer) configured in the parallel chain, and each authorized node packages the blocks of the block to be consensus separately. The information is sent to the corresponding main chain node. The main chain node records the information of each block on the main chain, and verifies whether the information of each block is not less than the first threshold number of blocks with the same information: yes, then the parallel chain The block passes the consensus, and configures the commit identifier for authentication for the parachain block. The block information of the block to be consensus is the execution result of the transaction of this parachain, which is sent to the corresponding main chain in the form of a consensus transaction. node.
图1为本发明一实施例提供的一种平行链共识方法的场景示意图。FIG. 1 is a schematic diagram of a scenario of a parachain consensus method provided by an embodiment of the present invention.
如图1所示,在本实施例中,以主链配置若干节点(A,B,C,…,T,…),第一平行链配置10个节点(a1,b1,c1,…,t1),其中节点a1,b1,c1,d1配置为第一平行链的授权节点为例,对本发明的平行链共识方案进行详细阐述。As shown in Fig. 1, in this embodiment, several nodes (A, B, C, ..., T, ...) are configured in the main chain, and 10 nodes (a1, b1, c1, ..., t1) are configured in the first parallel chain ), where the nodes a1, b1, c1, and d1 are configured as the authorization nodes of the first parachain as an example, and the parachain consensus scheme of the present invention is described in detail.
图1中,客户终端将第一平行链的交易(如tx1,tx2,……)发送到主链上,第一平行链的各节点从对应的主链节点同步tx1,tx2等交易并执行,则共识交易中为执行tx1,tx2……等交易的执行结果。In Figure 1, the client terminal sends the transactions of the first parachain (such as tx1, tx2, ...) to the main chain, and each node of the first parachain synchronizes and executes transactions such as tx1, tx2 from the corresponding main chain node, Then the consensus transaction is the execution result of executing tx1, tx2...etc.
图2为本发明一实施例提供的一种平行链共识方法流程图。FIG. 2 is a flowchart of a parachain consensus method provided by an embodiment of the present invention.
如图2所示,在本实施例中,本发明提供一种平行链共识方法,本方法适用于平行链节点(例如图1所示的a1,b1,c1,d1……)包括:As shown in FIG. 2 , in this embodiment, the present invention provides a parachain consensus method, which is applicable to parachain nodes (for example, a1, b1, c1, d1, etc. shown in FIG. 1 ) including:
S11、在主链生成第一平行链区块的共识结果后,从对应的主链节点同步第一平行链区块的第一共识交易,执行第一共识交易以生成第一执行结果;其中,第一共识交易包括通过平行链-主链共识的第一平行链区块的若干第一交易的执行结果;S11. After the main chain generates the consensus result of the first parachain block, synchronize the first consensus transaction of the first parachain block from the corresponding main chain node, and execute the first consensus transaction to generate the first execution result; wherein, The first consensus transaction includes execution results of several first transactions of the first parachain block that have passed the parachain-main chain consensus;
S12、将第一执行结果与当前平行链节点执行若干第一交易生成的第二执行结果对比是否一致:S12. Compare whether the first execution result is consistent with the second execution result generated by the current parachain node executing several first transactions:
是,则平行链共识成功,增加第一平行链的共识高度;If yes, the parachain consensus is successful, increasing the consensus height of the first parachain;
否,则平行链共识失败,不增加第一平行链的共识高度。Otherwise, the parachain consensus fails, and the consensus height of the first parachain is not increased.
以图1所示场景图为例,第一平行链的各平行链节点(a1,b1,c1,d1……)分别向对应的主链节点同步交易tx1,tx2,执行tx1,tx2后生成执行结果m2,第一平行链的授权节点(如图1所示的a1,b1,c1,d1)将执行结果打包生成第一平行链区块的第一共识交易发送至对应的主链节点,以供主链节点通过平行链-主链共识机制共识,在主链通过第一平行链区块的共识并记录在主链上后,各平行链节点同步第一共识交易,并执行第一共识交易生成第一执行结果m1,将第一执行结果m1和各平行链节点前期执行tx1,tx2生成的执行结果m2对比,若一致,则平行链共识成功,则平行链的共识高度增加,否则不增加平行链的共识高度。Taking the scene diagram shown in Figure 1 as an example, each parachain node (a1, b1, c1, d1...) of the first parachain synchronizes the transactions tx1, tx2 to the corresponding main chain nodes, and executes tx1, tx2 and generates execution. As a result of m2, the authorization node of the first parachain (a1, b1, c1, d1 as shown in Figure 1) packages the execution result to generate the first consensus transaction of the first parachain block and sends it to the corresponding main chain node to For the main chain nodes to reach consensus through the parachain-main chain consensus mechanism, after the main chain passes the consensus of the first parachain block and records it on the main chain, each parachain node synchronizes the first consensus transaction and executes the first consensus transaction Generate the first execution result m1, and compare the first execution result m1 with the execution result m2 generated by the previous execution of tx1 and tx2 by each parachain node. If they are consistent, the parachain consensus is successful, and the consensus height of the parachain increases, otherwise it does not increase The consensus height of the parachain.
本实施例通过平行链节点同步共识交易,而不是直接同步主链共识结果,将计算共识交易的结果与本节点计算的同步本条链的交易的执行结果对比,及时发现主链共识结果被篡改或者分叉等情况。In this embodiment, instead of directly synchronizing the consensus result of the main chain, the consensus transaction is synchronized by the parallel chain nodes, and the result of calculating the consensus transaction is compared with the execution result of the transaction synchronizing the current chain calculated by the node, and it is timely to find out that the consensus result of the main chain has been tampered with or Forks, etc.
图3为图2所示方法一优选实施方式的流程图。FIG. 3 is a flowchart of a preferred embodiment of the method shown in FIG. 2 .
如图3所示,在本实施例中,上述方法还包括:As shown in Figure 3, in this embodiment, the above method further includes:
S13、若平行链共识失败,则判断当前平行链节点是否发生故障:S13. If the parachain consensus fails, determine whether the current parachain node fails:
是,处理本平行链节点故障后继续执行从对应的主链节点同步第一平行链区块的第一共识交易及后续步骤;Yes, continue to execute the first consensus transaction and subsequent steps of synchronizing the first parachain block from the corresponding main chain node after processing the failure of this parachain node;
否,发送数据异常交易至对应的主链节点,以供主链节点判断共识失败原因并处理。No, send abnormal data transactions to the corresponding main chain node, so that the main chain node can determine the cause of consensus failure and deal with it.
具体地,如果平行链共识失败,则当前节点判断是否是本节点发生故障,如硬盘出现问题,版本不一致等情况,若是,则及时解除故障原因,重新同步第一共识交易,以便及时完成平行链共识。若不是本节点发生故障,则向对应的主链节点发送数据异常交易,主链节点根据数据异常交易判断共识失败的原因是否是主链造成的,比如主链发生分叉情况,或者是主链参与共识的若干节点联合作弊的情况,又或者是主链的共识结果遭到恶意篡改等其他情况。Specifically, if the parachain consensus fails, the current node judges whether the node is faulty, such as a problem with the hard disk, inconsistent versions, etc. If so, remove the cause of the failure in time and resynchronize the first consensus transaction to complete the parachain in time. consensus. If it is not the failure of this node, the abnormal data transaction is sent to the corresponding main chain node, and the main chain node judges whether the cause of the consensus failure is caused by the main chain according to the abnormal data transaction, such as the main chain forks, or the main chain. Several nodes participating in the consensus are jointly cheating, or the consensus result of the main chain has been maliciously tampered with and other situations.
另外,由于平行链节点之间互不通信,如果在检查本节点未发生故障后,在向对应主链节点的同时还向区块链系统的运营方发送信息,以便运营方排查故障原因,从而避免发送共识交易的平行链授权节点联合作弊的情况发生。In addition, since the parachain nodes do not communicate with each other, if after checking that the node is not faulty, it will send information to the operator of the blockchain system at the same time as the corresponding main chain node, so that the operator can check the cause of the failure, thereby Avoid the occurrence of fraudulent alliances of parachain authorized nodes sending consensus transactions.
图4为本发明一实施例提供的一种数据异常处理方法的流程图。FIG. 4 is a flowchart of a data exception processing method according to an embodiment of the present invention.
如图4所示,在本实施例中,本发明提供一种数据异常处理方法,该方法适用于主链节点,上述方法包括:As shown in FIG. 4 , in this embodiment, the present invention provides a data exception processing method, which is applicable to main chain nodes, and the above method includes:
S21、接收对应的平行链节点发送的数据异常交易;其中,数据异常交易由平行链节点判断第一执行结果与平行链节点执行若干第一交易生成的第二执行结果对比不一致导致的平行链共识失败并非本平行链节点故障造成后发送,第一执行结果由平行链节点同步并执行第一共识交易生成,第一共识交易包括通过平行链-主链共识的第一平行链区块的若干第一交易的执行结果;S21. Receive the abnormal data transaction sent by the corresponding parachain node; wherein, for the abnormal data transaction, the parachain consensus is caused by the parachain node judging that the first execution result is inconsistent with the second execution result generated by the parachain node executing several first transactions. The failure is not sent after the failure of the parachain node. The first execution result is generated by the parachain node synchronizing and executing the first consensus transaction. The first consensus transaction includes several first parachain blocks that have passed the parachain-main chain consensus. 1. the execution result of the transaction;
S22、根据数据异常交易对异常数据进行判断并处理,以供平行链节点从对应的主链节点同步并执行第一平行链区块的第一共识交易以生成第一执行结果,并判断第一执行结果与平行链节点执行若干第一交易生成的第二执行结果对比是否一致。S22. Judge and process the abnormal data according to the abnormal data transaction, so that the parachain node can synchronize from the corresponding main chain node and execute the first consensus transaction of the first parachain block to generate the first execution result, and judge the first Whether the execution result is consistent with the second execution result generated by the parachain node executing several first transactions.
具体地,图4所示的方法与图2所示方法的执行原理一致,在此不再赘述。Specifically, the execution principle of the method shown in FIG. 4 is the same as that of the method shown in FIG. 2 , and details are not described herein again.
优选地,步骤S22中所述的根据数据异常交易对异常数据进行判断并处理,包括:Preferably, judging and processing the abnormal data according to the abnormal data transaction described in step S22 includes:
S221、根据所述异常数据判断主链是否分叉:是,则进行回滚操作。S221. Determine whether the main chain is forked according to the abnormal data: if yes, perform a rollback operation.
具体地,主链节点收到对应平行链节点发送的数据异常交易后,根据异常数据判断是否是主链分叉导致的平行链共识失败,若是,则执行回滚操作。Specifically, after receiving the abnormal data transaction sent by the corresponding parachain node, the main chain node determines whether the parachain consensus fails due to the main chain fork according to the abnormal data, and if so, executes a rollback operation.
上述实施例中,通过平行链节点向主链节点发送数据异常交易,可以使主链节点及时查找自身原因,如果是由于主链分叉导致平行链共识失败,还可以使主链节点提前执行回滚操作,不用等到大量平行链共识失败后或者主链节点执行多个区块后发现分叉再回滚,极大的提高了执行效率。In the above embodiment, the abnormal data transaction sent by the parachain node to the main chain node can enable the main chain node to find its own cause in time, and if the parachain consensus fails due to the main chain fork, the main chain node can also be made to execute the callback in advance. The rollback operation does not have to wait until a large number of parallel chain consensus fails or the main chain node finds a fork and then rolls back after executing multiple blocks, which greatly improves the execution efficiency.
图5为本发明一实施例提供的一种设备的结构示意图。FIG. 5 is a schematic structural diagram of a device according to an embodiment of the present invention.
如图5所示,作为另一方面,本申请还提供了一种设备700,包括一个或多个中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM703中,还存储有设备700操作所需的各种程序和数据。CPU701、ROM702以及RAM703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 5 , as another aspect, the present application also provides a device 700 including one or more central processing units (CPUs) 701 , which can operate according to a program stored in a read only memory (ROM) 702 or Various appropriate actions and processes are executed from the program loaded into the random access memory (RAM) 703 from the
以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。The following components are connected to the I/O interface 705: an
特别地,根据本公开的实施例,上述任一实施例描述的平行链共识方法和数据异常处理方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行平行链共识方法和数据异常处理方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。In particular, according to the embodiments of the present disclosure, the parachain consensus method and the data exception processing method described in any of the above embodiments can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for executing a parachain consensus method and a data exception handling method. In such an embodiment, the computer program may be downloaded and installed from the network via the
作为又一方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例的装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,该程序被一个或者一个以上的处理器用来执行描述于本申请的平行链共识方法和数据异常处理方法。As yet another aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium may be a computer-readable storage medium included in the apparatus of the foregoing embodiment; A computer-readable storage medium in a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the parachain consensus method and data exception handling method described in this application.
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这根据所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以通过执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以通过专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by dedicated hardware-based systems that perform the specified functions or operations , or can be implemented by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,例如,各所述单元可以是设置在计算机或移动智能设备中的软件程序,也可以是单独配置的硬件装置。其中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。The units or modules involved in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner. The described units or modules may also be provided in the processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be a separately configured hardware device. Wherein, the names of these units or modules do not constitute limitations on the units or modules themselves under certain circumstances.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离本申请构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover, without departing from the concept of the present application, the above-mentioned technical features or Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above-mentioned features with the technical features disclosed in this application (but not limited to) with similar functions.
Claims (6)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910157805.XA CN109831514B (en) | 2019-03-02 | 2019-03-02 | Parallel chain consensus method, data exception handling method, device and storage medium |
PCT/CN2020/075945 WO2020177537A1 (en) | 2019-03-02 | 2020-02-20 | Parallel chain consensus method, data exception processing method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910157805.XA CN109831514B (en) | 2019-03-02 | 2019-03-02 | Parallel chain consensus method, data exception handling method, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109831514A CN109831514A (en) | 2019-05-31 |
CN109831514B true CN109831514B (en) | 2020-06-09 |
Family
ID=66865161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910157805.XA Active CN109831514B (en) | 2019-03-02 | 2019-03-02 | Parallel chain consensus method, data exception handling method, device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109831514B (en) |
WO (1) | WO2020177537A1 (en) |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109831514B (en) * | 2019-03-02 | 2020-06-09 | 杭州复杂美科技有限公司 | Parallel chain consensus method, data exception handling method, device and storage medium |
CN110287263B (en) * | 2019-06-28 | 2021-03-16 | 杭州复杂美科技有限公司 | Parallel chain self-consensus method, device and storage medium |
CN110442448B (en) * | 2019-07-04 | 2021-10-01 | 杭州复杂美科技有限公司 | Block generation method, device and storage medium |
CN110445853B (en) * | 2019-07-29 | 2021-08-06 | 杭州复杂美科技有限公司 | Parallel chain node excitation method, device and storage medium |
CN110443708B (en) * | 2019-07-29 | 2022-03-04 | 杭州复杂美科技有限公司 | Parallel chain transaction method, device and storage medium |
CN110428332A (en) * | 2019-07-29 | 2019-11-08 | 杭州复杂美科技有限公司 | A kind of across the chain method of commerce of parallel chain, equipment and storage medium |
CN110473093A (en) * | 2019-07-29 | 2019-11-19 | 杭州复杂美科技有限公司 | Parallel chain assets transfer method, equipment and storage medium |
CN110535933B (en) * | 2019-08-26 | 2021-07-06 | 杭州复杂美科技有限公司 | Parallel chain consensus method, device and storage medium |
CN111242780A (en) * | 2020-01-12 | 2020-06-05 | 杭州复杂美科技有限公司 | Method, device and storage medium for sending consensus transaction |
CN111275437B (en) * | 2020-01-12 | 2023-05-30 | 杭州复杂美科技有限公司 | Parallel chain consensus method, apparatus and storage medium |
CN111524011B (en) * | 2020-05-06 | 2023-05-30 | 杭州复杂美科技有限公司 | Parallel link consensus validation method, apparatus, and storage medium |
CN112184251B (en) * | 2020-09-30 | 2024-12-27 | 杭州银信宝科技有限公司 | Asset transfer method, device and storage medium |
CN112733202B (en) * | 2021-01-11 | 2022-09-13 | 杭州复杂美科技有限公司 | Parallel chain supervision consensus method, computer device and storage medium |
CN112819625B (en) * | 2021-02-01 | 2023-11-28 | 杭州复杂美科技有限公司 | Parallel chain arbitration consensus method, computer device, and storage medium |
CN112948388B (en) * | 2021-03-05 | 2024-12-20 | 林上煜 | Parallel chain arbitration consensus method, computer device and storage medium |
CN112948496B (en) * | 2021-03-05 | 2023-11-24 | 杭州复杂美科技有限公司 | Parallel chain block generation method, computer device and storage medium |
CN113110934A (en) * | 2021-04-09 | 2021-07-13 | 杭州复杂美科技有限公司 | Parallel chain block generation method, computer device, and storage medium |
CN114140102B (en) * | 2021-12-02 | 2025-01-07 | 鄂尔多斯市综保科技有限公司 | Transaction sending method, computer device and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105719185A (en) * | 2016-01-22 | 2016-06-29 | 杭州复杂美科技有限公司 | Block chain data comparison and consensus method |
CN106447309A (en) * | 2016-11-13 | 2017-02-22 | 杭州复杂美科技有限公司 | Across-chain transaction of source chain and lateral chain |
CN107147735A (en) * | 2017-05-12 | 2017-09-08 | 北京博晨技术有限公司 | A kind of distributed account book system based on hierarchy |
CN107742210A (en) * | 2017-10-13 | 2018-02-27 | 布比(北京)网络技术有限公司 | A cross-chain transfer system and method between different blockchains |
CN107888562A (en) * | 2017-10-13 | 2018-04-06 | 布比(北京)网络技术有限公司 | Interconnect serobila architecture |
CN107909369A (en) * | 2017-10-13 | 2018-04-13 | 布比(北京)网络技术有限公司 | Based on the common recognition method, apparatus merchandised across chain and storage medium |
CN108805701A (en) * | 2018-04-19 | 2018-11-13 | 深圳市网心科技有限公司 | Across the chain transaction processing system of multi-tiling chain and method, block catenary system and storage medium |
CN109271446A (en) * | 2018-08-30 | 2019-01-25 | 杭州复杂美科技有限公司 | A kind of parallel chain method of data synchronization, equipment and storage medium |
CN109325762A (en) * | 2018-08-30 | 2019-02-12 | 杭州复杂美科技有限公司 | Across the chain method of commerce of parallel chain, equipment and storage medium |
CN109410045A (en) * | 2018-08-30 | 2019-03-01 | 杭州复杂美科技有限公司 | A kind of parallel chain common recognition method, equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11146380B2 (en) * | 2017-08-03 | 2021-10-12 | Parity Technologies Ltd. | Methods and systems for a heterogeneous multi-chain framework |
CN107862216B (en) * | 2017-10-13 | 2021-04-06 | 布比(北京)网络技术有限公司 | Privacy protection method, device and storage medium for anonymous cross-link transaction |
CN108984784B (en) * | 2018-07-26 | 2020-04-14 | 百度在线网络技术(北京)有限公司 | Application implementation method, device, equipment and storage medium based on block chain network |
CN109377365B (en) * | 2018-10-18 | 2020-09-15 | 杭州复杂美科技有限公司 | Asset transfer method, device and storage medium |
CN109831514B (en) * | 2019-03-02 | 2020-06-09 | 杭州复杂美科技有限公司 | Parallel chain consensus method, data exception handling method, device and storage medium |
-
2019
- 2019-03-02 CN CN201910157805.XA patent/CN109831514B/en active Active
-
2020
- 2020-02-20 WO PCT/CN2020/075945 patent/WO2020177537A1/en active Application Filing
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105719185A (en) * | 2016-01-22 | 2016-06-29 | 杭州复杂美科技有限公司 | Block chain data comparison and consensus method |
CN106447309A (en) * | 2016-11-13 | 2017-02-22 | 杭州复杂美科技有限公司 | Across-chain transaction of source chain and lateral chain |
CN107147735A (en) * | 2017-05-12 | 2017-09-08 | 北京博晨技术有限公司 | A kind of distributed account book system based on hierarchy |
CN107742210A (en) * | 2017-10-13 | 2018-02-27 | 布比(北京)网络技术有限公司 | A cross-chain transfer system and method between different blockchains |
CN107888562A (en) * | 2017-10-13 | 2018-04-06 | 布比(北京)网络技术有限公司 | Interconnect serobila architecture |
CN107909369A (en) * | 2017-10-13 | 2018-04-13 | 布比(北京)网络技术有限公司 | Based on the common recognition method, apparatus merchandised across chain and storage medium |
CN108805701A (en) * | 2018-04-19 | 2018-11-13 | 深圳市网心科技有限公司 | Across the chain transaction processing system of multi-tiling chain and method, block catenary system and storage medium |
CN109271446A (en) * | 2018-08-30 | 2019-01-25 | 杭州复杂美科技有限公司 | A kind of parallel chain method of data synchronization, equipment and storage medium |
CN109325762A (en) * | 2018-08-30 | 2019-02-12 | 杭州复杂美科技有限公司 | Across the chain method of commerce of parallel chain, equipment and storage medium |
CN109410045A (en) * | 2018-08-30 | 2019-03-01 | 杭州复杂美科技有限公司 | A kind of parallel chain common recognition method, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109831514A (en) | 2019-05-31 |
WO2020177537A1 (en) | 2020-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109831514B (en) | Parallel chain consensus method, data exception handling method, device and storage medium | |
CN110597907B (en) | Cross-block-chain data information synchronization method, device, equipment and medium | |
CN109410045B (en) | Parallel chain consensus method, equipment and storage medium | |
CN109087101B (en) | Transaction verification method, device, storage medium and electronic device | |
US20210326813A1 (en) | Parallel Chain Cross-Chain Transaction Method, Device and Storage Medium | |
CN110084601B (en) | Parallel chain main chain transaction state synchronization method, equipment and storage medium | |
US20200134613A1 (en) | Method and Apparatus for Running Smart Contract | |
US7797414B2 (en) | Establishing a logical path between servers in a coordinated timing network | |
KR102077898B1 (en) | Data storage upon database failure | |
CN109377365B (en) | Asset transfer method, device and storage medium | |
US10795910B2 (en) | Robust communication system for guaranteed message sequencing with the detection of duplicate senders | |
WO2015062461A1 (en) | Method and system for verifying user identity of an online application | |
WO2023040364A1 (en) | Consensus method and apparatus, and blockchain system | |
US9589153B2 (en) | Securing integrity and consistency of a cloud storage service with efficient client operations | |
CN109995585B (en) | Exception handling method, device and storage medium | |
CN112184436B (en) | Data synchronization method, electronic device and readable storage medium | |
WO2012059393A1 (en) | Remote recovery with checkpoints and intention logs | |
WO2022205957A1 (en) | Method and apparatus for transferring message across chains on basis of relay device | |
US20150074063A1 (en) | Methods and systems for detecting data divergence and inconsistency across replicas of data within a shared-nothing distributed database | |
CN108989052A (en) | transaction request processing method and system | |
CN112347193A (en) | Transaction packaging method and device based on block chain and electronic equipment | |
CN114637611A (en) | Information processing method and device based on message queue and computer equipment | |
JP7561398B2 (en) | Method and device for validating database query results | |
CN111245897B (en) | Data processing method, device, system, storage medium and processor | |
CN110619022B (en) | Node detection method, device, equipment and storage medium based on block chain network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |