CN112598418A - Parallel chain supervision consensus method, equipment and storage medium - Google Patents

Parallel chain supervision consensus method, equipment and storage medium Download PDF

Info

Publication number
CN112598418A
CN112598418A CN202011425289.3A CN202011425289A CN112598418A CN 112598418 A CN112598418 A CN 112598418A CN 202011425289 A CN202011425289 A CN 202011425289A CN 112598418 A CN112598418 A CN 112598418A
Authority
CN
China
Prior art keywords
height
consensus
execution result
parallel 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.)
Granted
Application number
CN202011425289.3A
Other languages
Chinese (zh)
Other versions
CN112598418B (en
Inventor
马登极
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202011425289.3A priority Critical patent/CN112598418B/en
Publication of CN112598418A publication Critical patent/CN112598418A/en
Application granted granted Critical
Publication of CN112598418B publication Critical patent/CN112598418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction

Abstract

The invention provides a parallel chain supervision consensus method, equipment and a storage medium, which relate to the technical field of block chains and the like, and the method comprises the following steps: executing respective consensus transactions of the first heights of the first parallel chains to obtain first execution results passing the consensus, updating the first pre-consensus heights of the first parallel chains to the first heights on the main chain, and adding one to the continuous growth heights to update the continuous growth heights; when the continuous growth height is larger than a first value, adding one to the first common height of the first parallel chain on the main chain to update the first common height; when the second execution result is different from the third execution result, updating the first pre-consensus height and the first consensus height to a third height minus one on the main chain, and resetting the continuous increase height; and executing a plurality of regenerated supervision transactions and/or consensus transactions of the third height, and returning to judge whether the second execution result is the same as the third execution result. The application ensures that the consensus of the parallel chains is correctly increased.

Description

Parallel chain supervision consensus method, equipment and storage medium
Technical Field
The application relates to the technical field of parallel chains, in particular to a parallel chain supervision consensus method, parallel chain supervision consensus equipment and a storage medium.
Background
In the prior parallel chain technology, a parallel chain consensus node N1-N7 is assumed to be arranged on a parallel chain parachain 1; even if the N6 and the N7 find that the N1 to the N5 jointly cheat, the N6 and the N7 cannot change the parallel chain consensus contribution of the block (100) according to the consensus transaction generated by the generated block (100) if the N1 to the N5 jointly cheat the generated block (100). That is, the execution result of the joint cheating is different from the execution results of N6 and N7, and N6 and N7 can only be passively received, and cannot correct the final consensus result, which may cause asset loss.
Disclosure of Invention
In view of the above-mentioned deficiencies or inadequacies in the prior art, it would be desirable to provide a parallel chain supervised consensus method, apparatus and storage medium that ensure a correct growth of parallel chain consensus.
In a first aspect, the present invention provides a parallel chain supervision consensus method applicable to a main chain node, where a parallel chain is configured with one or more supervision nodes, the method including:
executing respective consensus transactions of the first heights of the first parallel chains to obtain first execution results passing the consensus, updating the first pre-consensus heights of the first parallel chains to the first heights on the main chain, and adding one to the continuous growth heights to update the continuous growth heights;
when the continuous growth height is larger than a first value, adding one to the first common height of the first parallel chain on the main chain to update the first common height;
executing each of the supervised transactions of the third level of the first parallel chain to obtain a second execution result by consensus; the third height is greater than the first common identification height and not greater than the first pre-common identification height, and the third execution result is a common execution result obtained by executing the common transactions at the third height of the first parallel chain; and the number of the first and second groups,
judging whether the second execution result is the same as the third execution result:
if not, updating the first pre-consensus height and the first consensus height to a third height minus one on the main chain, and resetting the continuous increase height; and the number of the first and second groups,
executing a plurality of regenerated supervision transactions and/or consensus transactions of a third height, and returning and judging whether the second execution result is the same as the third execution result or not after obtaining a second execution result and/or a third execution result which passes consensus again; wherein the regenerated consensus transaction of the third height is generated by the consensus node of the first parallel chain when the last generated consensus transaction of the third height is checked out as an error, and the regenerated supervised transaction of the first height is generated by the supervision node of the first parallel chain when the last generated supervised transaction of the third height is checked out as an error.
In a second aspect, the present invention provides a parallel chain supervision consensus method applied to a supervision node, where a parallel chain is configured with one or more supervision nodes, the method including:
obtaining and executing common recognition transactions of a first height of a current parallel chain from a main chain to obtain a first execution result passing the common recognition; the first execution result is used for updating the first pre-consensus height of the current parallel chain to be a first height on the main chain by each main chain node;
monitoring whether the execution result of the generated first parallel chain block with the first height is the same as the first execution result:
if so, updating the first pre-consensus height of the current parallel chain to be a first height on the current parallel chain, and adding one to the continuous increase height to update the continuous increase height; and the number of the first and second groups,
when the continuous increase height is larger than a first numerical value, adding one to the first common knowledge height of the current parallel chain on the current parallel chain to update the first common knowledge height;
if not, generating a first supervised transaction according to the first parallel chain block and sending the first supervised transaction to the main chain so that each main chain node executes each supervised transaction including the first height of the first supervised transaction to obtain a second execution result passing the consensus, and judging whether the first execution result is the same as the second execution result: if not, updating the first pre-consensus height and the first consensus height of the current parallel chain to the first height minus one on the main chain; and the number of the first and second groups,
obtaining and executing each supervised transaction from the main chain to obtain a second execution result by consensus; and the number of the first and second groups,
judging whether the first execution result is the same as the second execution result:
if not, updating the first pre-consensus height and the first consensus height to be the first height minus one on the current parallel chain, and resetting the continuous increase height; and the number of the first and second groups,
check if the last generated first supervised transaction was erroneous:
if so, regenerating the first supervised transaction and sending the first supervised transaction to the main chain so that each main chain node executes a plurality of regenerated supervised transactions and/or consensus transactions with the first height, and returning and judging whether the first execution result is the same as the second execution result after obtaining a second execution result and/or a first execution result which passes consensus again; the newly generated consensus transaction with the first height is generated by the consensus node of the current parallel chain when the last generated consensus transaction with the first height is checked out to be wrong; the other regenerated supervised transactions of the first altitude are generated by other supervising nodes of the current parallel chain when the last generated supervised transaction of the first altitude is checked out; and the number of the first and second groups,
and acquiring and executing the consensus transaction and/or the supervision transaction of the regenerated first height from the main chain, and returning and judging whether the first execution result is the same as the second execution result or not after acquiring the first execution result and/or the second execution result which passes the consensus again.
In a third aspect, the present invention provides a parallel chain supervision consensus method applicable to a consensus node, where a parallel chain is configured with one or more supervision nodes, the method including:
obtaining and executing respective consensus transactions of a first height of a current parallel chain from a main chain to obtain a first execution result passing consensus, updating the first pre-consensus height of the current parallel chain to the first height on the current parallel chain, and adding one to the continuous growth height to update the continuous growth height; the first execution result is used for updating the first pre-consensus height of the current parallel chain to be a first height on the main chain by each main chain node;
when the continuous increase height is larger than a first numerical value, adding one to the first common knowledge height of the current parallel chain on the current parallel chain to update the first common knowledge height;
executing each supervised transaction at a third level of the current parallel chain to obtain a second execution result passing consensus; the third height is greater than the current first consensus height and not greater than the current first pre-consensus height, and the third execution result is a consensus execution result obtained by executing each consensus transaction at the third height of the first parallel chain;
judging whether the second execution result is the same as the third execution result:
if not, updating the first pre-consensus height and the first consensus height to a third height minus one on the current parallel chain, and resetting the continuous increase height; and the number of the first and second groups,
check if the last generated first consensus transaction of the third height is erroneous:
if so, regenerating the first consensus transaction and sending the first consensus transaction to the main chain, so that each main chain node executes a plurality of regenerated third-height supervised transactions and/or consensus transactions including the first consensus transaction, and after obtaining a second execution result and/or a third execution result which passes consensus again, returning to judge whether the second execution result is the same as the third execution result; wherein, the other regenerated consensus transaction of the third height is generated by other consensus nodes of the current parallel chain when the last generated consensus transaction of the third height is checked out to be wrong; other regenerated supervised transactions of the third height are generated by the supervision node of the current parallel chain when the supervision node of the last generated supervised transaction of the third height is checked out to be wrong; and the number of the first and second groups,
and acquiring and executing the consensus transaction and/or the supervision transaction of the regenerated third height from the main chain, and returning and judging whether the second execution result is the same as the third execution result or not after acquiring the second execution result and/or the third execution result which passes the consensus again.
In a fourth 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 a parallel chain supervised consensus method provided according to embodiments of the present invention.
In a fifth aspect, the present invention further provides a storage medium storing a computer program, the computer program enabling a computer to execute the parallel chain supervised consensus method provided according to the embodiments of the present invention.
Embodiments of the present invention provide a parallel chain supervision consensus method, apparatus, and storage medium, by performing consensus transactions of a first height of a first parallel chain to obtain a first execution result by consensus, updating a first pre-consensus height of the first parallel chain to the first height on a main chain, and adding one to a continuous growth height to update the continuous growth height; when the continuous growth height is larger than a first value, adding one to the first common height of the first parallel chain on the main chain to update the first common height; executing each of the supervised transactions of the third level of the first parallel chain to obtain a second execution result by consensus; when the second execution result is different from the third execution result, updating the first pre-consensus height and the first consensus height to a third height minus one on the main chain, and resetting the continuous increase height; and executing a plurality of regenerated supervision transactions and/or consensus transactions of a third height, and returning a method for judging whether the second execution result is the same as the third execution result or not after obtaining a second execution result and/or a third execution result which passes consensus again, so as to ensure that the parallel chain consensus is increased correctly.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a parallel chain supervision consensus method according to an embodiment of the present invention.
Fig. 2 is a flowchart of another parallel chain supervision consensus method according to an embodiment of the present invention.
Fig. 3 is a flowchart of another parallel chain supervision consensus method according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of a parallel chain supervision consensus method according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides a parallel chain supervision consensus method applicable to a main chain node, where a parallel chain is configured with one or more supervision nodes, and the method includes:
s12: executing respective consensus transactions of the first heights of the first parallel chains to obtain first execution results passing the consensus, updating the first pre-consensus heights of the first parallel chains to the first heights on the main chain, and adding one to the continuous growth heights to update the continuous growth heights;
s14: when the continuous growth height is larger than a first value, adding one to the first common height of the first parallel chain on the main chain to update the first common height;
s161: executing each of the supervised transactions of the third level of the first parallel chain to obtain a second execution result by consensus; the third height is greater than the first common identification height and not greater than the first pre-common identification height, and the third execution result is a common execution result obtained by executing the common transactions at the third height of the first parallel chain; and the number of the first and second groups,
s1621: judging whether the second execution result is the same as the third execution result:
otherwise, step S1622 is executed: updating the first pre-consensus height and the first consensus height to a third height minus one on the main chain, and resetting the continuous increase height; and the number of the first and second groups,
s1623: executing a plurality of regenerated supervision transactions and/or consensus transactions of a third height, and returning and judging whether the second execution result is the same as the third execution result or not after obtaining a second execution result and/or a third execution result which passes consensus again; wherein the regenerated consensus transaction of the third height is generated by the consensus node of the first parallel chain when the last generated consensus transaction of the third height is checked out as an error, and the regenerated supervised transaction of the first height is generated by the supervision node of the first parallel chain when the last generated supervised transaction of the third height is checked out as an error.
Specifically, take the first value as 10 as an example; supposing that 10 parallel chain nodes N1-N10 are arranged on a parallel chain parachain1, wherein N1-N4 are consensus nodes, N5-N7 are supervision nodes, and N8-N10 are common parallel chain nodes; the consensus height and the consensus height of the current parachain1 were both 100.
The respective main chain nodes perform step S12, perform respective consensus transactions of 101 of the parachain1 to obtain an execution result by consensus, update the pre-consensus height of the parachain1 to 101, and update the continuous growth height to 1 on the main chain;
N1-N10 obtain and execute each consensus transaction of 101 of parachain1 from the main chain to obtain execution results by consensus, update the pre-consensus height of parachain1 to 101 and the continuous growth height to 1 on parachain 1;
the respective main chain nodes perform step S12, perform respective consensus transactions of 102 of the parachain1 to obtain an execution result by consensus, update the pre-consensus height of the parachain1 to 102, and update the continuous growth height to 2 on the main chain;
N1-N10 obtain and execute each consensus transaction of 102 of parachain1 from the main chain to obtain execution results by consensus, update the pre-consensus height of parachain1 to 102 and the continuous growth height to 1 on parachain 1;
repeating the step S12 by each main chain node until the pre-consensus height of the parachain1 is updated to 111 and the continuous growth height is updated to 11 on the main chain;
in the same way, N1-N10 are repeatedly executed until the pre-consensus height of the parachain1 is updated to 110 and the continuous growth height is updated to 11 on the parachain 1;
when the continuous growth height is increased to 11 and is larger than 10, each main chain node executes the step S14, and the consensus height of the parachain1 is updated to 101 on the main chain;
the continuous growth height increased to 11, which was greater than 10, and N1-N10 updated the consensus height of parachain1 to 101 on parachain 1.
The respective main chain nodes perform step S12, perform respective consensus transactions of 112 of the parachain1 to obtain an execution result by consensus, update the pre-consensus height of the parachain1 to 112, and update the continuous growth height to 12 on the main chain;
N1-N10 obtain and execute the consensus transactions of 112 of parachain1 from the main chain to obtain execution results by consensus, update the pre-consensus height of parachain1 to 112 on parachain1, and update the continuous growth height to 12;
when the continuous growth height is increased to 12 and is larger than 10, each main chain node executes the step S14, and the consensus height of the parachain1 is updated to 102 on the main chain;
the continuous growth height increased to 12, which was greater than 10, and N1-N10 updated the consensus height of parachain1 to 102 on parachain 1.
The respective main chain nodes perform step S12, perform respective consensus transactions of 113 of the parachain1 to obtain an execution result by consensus, update the pre-consensus height of the parachain1 to 113, and update the continuous growth height to 13 on the main chain;
N1-N10 obtain and execute the consensus transactions of 113 of parachain1 from the main chain to obtain execution results by consensus, update the pre-consensus height of parachain1 to 113 and the continuous growth height to 13 on parachain 1;
when the continuous growth height is increased to 13 and is larger than 10, each main chain node executes the step S14, and the consensus height of the parachain1 is updated to 103 on the main chain;
the continuous growth height increased to 13, greater than 10, and N1-N10 updated the consensus height of parachain1 to 103 on parachain 1.
When the N5, the N6 and the N7 monitor that the execution result of 113 generated by the N5, the N6 and the N7 is different from result, the N5, the N6 and the N7 respectively generate 112 supervision transactions and send the supervision transactions to a main chain;
each main chain node executes step S161, executing each supervised transaction of 113 of parachain1 to obtain an execution result' through consensus;
each main chain node executes step S1621 to determine whether result and result' are the same:
because result and result' are different, each main chain node executes step S1622, updates the pre-consensus height and the consensus height of parachain1 to 112 on the main chain, and clears the continuous growth height;
N1-N10 obtain and execute each supervised transaction of 113 of parachain1 from the main chain to obtain an execution result' through consensus;
N1-N10 judges whether result is the same as result': because result and result' are different, N1-N10 updates the pre-consensus height and consensus height of parachain1 to 112 on parachain1, and clears the continuous growth height;
N1-N4 respectively check whether the previously generated consensus transaction of 113 is wrong, if so, the consensus transaction of 113 is regenerated and sent to the main chain;
N5-N7 respectively check whether the supervision transaction of 113 generated last time is wrong, if so, the supervision transaction of 113 is regenerated and sent to the main chain;
each main chain node executes the step S1623, executes a plurality of regenerated supervision transactions and/or consensus transactions of 113, and returns to the step S1621 after obtaining the result and/or result' which passes the consensus again;
N1-N10 obtain and execute a plurality of regenerated 113 supervision transactions and/or consensus transactions from the main chain, and after obtaining the results and/or results 'which pass the consensus again, return to judge whether the results and the results' are the same.
In the prior art, after the step S1621 is returned, if the main chain nodes find that the result and/or result' passing the consensus again are the same, the consensus transaction of 113 sent by N1-N4 is waited; and after the N1-N10 find the result and/or result' which pass the consensus again to be the same, N1-N4 send the regenerated 113 consensus transaction to the main chain node.
In further embodiments, the first value may be configured according to actual requirements, for example, configured as 20, and the same technical effect may be achieved.
In more embodiments, the configurations of the consensus node, the supervision node, and the common parallel link node on the parallel chain are not limited to the above examples, and may also be configured according to actual requirements, so that the same technical effect may be achieved.
It should be noted that, as will be understood by those skilled in the art, the supervised transaction may be a consensus transaction generated by the supervising node, that is, the transaction structure of the supervised transaction is identical to the transaction structure of the consensus transaction; the transaction structure of the supervised transaction can also be configured according to actual requirements, and only the main chain node and the parallel chain node are required to still obtain corresponding execution results when the supervised transaction is executed.
It should be noted that, as will be understood by those skilled in the art, there are many scenarios in which the consensus node and the supervision node check out the last generated consensus transaction/supervision transaction error, including, but not limited to, the consensus node and the supervision node not updating the version information in time, and the consensus node performing joint cheating.
It should be noted that a person skilled in the art should also be able to imagine that the supervising node can be arranged in a role that can be trusted by the operator of parachain 1. Furthermore, when the supervision node is deployed, a certain deposit needs to be paid.
It should be noted that, those skilled in the art should associate that, several penalty measures may be configured according to actual requirements, for example, if it is determined for the first time that the first execution result is different from the second execution result, and the difference is caused by joint cheating of the consensus node, part of assets of the consensus node should be transferred to the supervision node. Further, the portion of assets may also be configured according to actual needs, such as configured as frozen deposits, or configured as mining rewards that the consensus node should obtain to generate the first parallel chain block of the first height.
In this embodiment, the supervision node and the consensus node participate in consensus, and when the consensus is divergent, the consensus is suspended until either party corrects the consensus result to reach the consensus again, and then the consensus is continued. Therefore, the consensus is suspended before the wrong consensus result is generated, and the method of randomly and randomly checking the penalty after the consensus is not adopted to manage the consensus, so that the method is more reasonable. The above embodiment ensures that the parallel strand consensus grows correctly.
Preferably, the supervised transaction is generated by each supervising node of the first parallel chain according to the second parallel chain block when the second parallel chain block with the third height is monitored to be a non-empty block and the execution result of the second parallel chain block is different from the third execution result.
According to the embodiment, the supervision node generates the supervision transaction only according to the non-empty block when the execution result of the second parallel chain block is different from the third execution result, namely, the supervision transaction is not generated on the empty block, so that the workload of the supervision node is reduced.
Fig. 2 is a flowchart of another parallel chain supervision consensus method according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, the present invention provides a parallel chain supervision consensus method suitable for a supervision node, where a parallel chain is configured with one or more supervision nodes, and the method includes:
s22: obtaining and executing common recognition transactions of a first height of a current parallel chain from a main chain to obtain a first execution result passing the common recognition; the first execution result is used for updating the first pre-consensus height of the current parallel chain to be a first height on the main chain by each main chain node;
s241: monitoring whether the execution result of the generated first parallel chain block with the first height is the same as the first execution result:
if yes, go to step S242: updating the first pre-consensus height of the current parallel chain to a first height on the current parallel chain, and adding one to the continuous growth height to update the continuous growth height; and the number of the first and second groups,
s243: when the continuous increase height is larger than a first numerical value, adding one to the first common knowledge height of the current parallel chain on the current parallel chain to update the first common knowledge height;
otherwise, step S244 is executed: generating a first supervised transaction according to the first parallel chain block and sending the first supervised transaction to the main chain, so that each main chain node executes each supervised transaction including a first height of the first supervised transaction to obtain a second execution result passing consensus, and judging whether the first execution result is the same as the second execution result: if not, updating the first pre-consensus height and the first consensus height of the current parallel chain to the first height minus one on the main chain; and the number of the first and second groups,
s245: obtaining and executing each supervised transaction from the main chain to obtain a second execution result by consensus; and the number of the first and second groups,
s2461: judging whether the first execution result is the same as the second execution result:
otherwise, step S2462 is executed: updating the first pre-consensus height and the first consensus height to be the first height minus one on the current parallel chain, and resetting the continuous increase height; and the number of the first and second groups,
s24631: check if the last generated first supervised transaction was erroneous:
if yes, go to step S24632: regenerating the first supervised transaction and sending the first supervised transaction to the main chain so that each main chain node executes a plurality of regenerated supervised transactions and/or consensus transactions with the first height, and returning and judging whether the first execution result is the same as the second execution result or not after obtaining a second execution result and/or a first execution result which passes the consensus again; the newly generated consensus transaction with the first height is generated by the consensus node of the current parallel chain when the last generated consensus transaction with the first height is checked out to be wrong; the other regenerated supervised transactions of the first altitude are generated by other supervising nodes of the current parallel chain when the last generated supervised transaction of the first altitude is checked out; and the number of the first and second groups,
s24633: and acquiring and executing the consensus transaction and/or the supervision transaction of the regenerated first height from the main chain, and returning and judging whether the first execution result is the same as the second execution result or not after acquiring the first execution result and/or the second execution result which passes the consensus again.
The principle of the parallel chain supervision consensus in the above embodiment can refer to the method shown in fig. 1, and is not described herein again.
Preferably, monitoring whether the execution result of the first parallel chain block of the generated first height is the same as the first execution result comprises:
judging whether the generated first parallel chain block with the first height is a blank block:
if not, monitoring whether the execution result of the first parallel chain block with the first height is the same as the first execution result.
The parallel chain supervision consensus principle of the above embodiment can refer to a method of a preferred embodiment shown in fig. 1, and is not described herein again.
Fig. 3 is a flowchart of another parallel chain supervision consensus method according to an embodiment of the present invention. As shown in fig. 3, in this embodiment, the present invention provides a parallel chain supervision consensus method suitable for a consensus node, where a parallel chain is configured with one or more supervision nodes, and the method includes:
s32: obtaining and executing respective consensus transactions of a first height of a current parallel chain from a main chain to obtain a first execution result passing consensus, updating the first pre-consensus height of the current parallel chain to the first height on the current parallel chain, and adding one to the continuous growth height to update the continuous growth height; the first execution result is used for updating the first pre-consensus height of the current parallel chain to be a first height on the main chain by each main chain node;
s34: when the continuous increase height is larger than a first numerical value, adding one to the first common knowledge height of the current parallel chain on the current parallel chain to update the first common knowledge height;
s36: executing each supervised transaction at a third level of the current parallel chain to obtain a second execution result passing consensus; the third height is greater than the current first consensus height and not greater than the current first pre-consensus height, and the third execution result is a consensus execution result obtained by executing each consensus transaction at the third height of the first parallel chain;
s381: judging whether the second execution result is the same as the third execution result:
otherwise, step S382 is executed: updating the first pre-consensus height and the first consensus height to a third height minus one on the current parallel chain, and resetting the continuous increase height; and the number of the first and second groups,
s3831: check if the last generated first consensus transaction of the third height is erroneous:
if yes, go to step S3832: regenerating the first consensus transaction and sending the first consensus transaction to the main chain so that each main chain node can execute a plurality of regenerated third-height supervised transactions and/or consensus transactions including the first consensus transaction, and returning and judging whether the second execution result is the same as the third execution result or not after obtaining a second execution result and/or a third execution result which passes consensus again; wherein, the other regenerated consensus transaction of the third height is generated by other consensus nodes of the current parallel chain when the last generated consensus transaction of the third height is checked out to be wrong; other regenerated supervised transactions of the third height are generated by the supervision node of the current parallel chain when the supervision node of the last generated supervised transaction of the third height is checked out to be wrong; and the number of the first and second groups,
s3833: and acquiring and executing the consensus transaction and/or the supervision transaction of the regenerated third height from the main chain, and returning and judging whether the second execution result is the same as the third execution result or not after acquiring the second execution result and/or the third execution result which passes the consensus again.
The principle of the parallel chain supervision consensus in the above embodiment can refer to the method shown in fig. 1, and is not described herein again.
Preferably, the supervised transaction is generated by each supervising node of the first parallel chain according to the second parallel chain block when the second parallel chain block with the third height is monitored to be a non-empty block and the execution result of the second parallel chain block is different from the third execution result.
The parallel chain supervision consensus principle of the above embodiment can refer to a method of a preferred embodiment shown in fig. 1, and is not described herein again.
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention. As shown in fig. 4, as another aspect, the present application also provides an apparatus including one or more Central Processing Units (CPUs) 401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the device 400 are also stored. The CPU401, ROM402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. 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 comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present 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, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block 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 will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (8)

1. A parallel chain supervision consensus method, wherein a parallel chain is configured with one or more supervision nodes, the method being applicable to a main chain node, the method comprising:
executing respective consensus transactions of a first height of a first parallel chain to obtain a first execution result by consensus, updating a first pre-consensus height of the first parallel chain to the first height on a main chain, adding a continuous growth height to update the continuous growth height;
when the continuous growth height is larger than a first value, adding one to a first consensus height of the first parallel chain on the main chain to update the first consensus height;
executing each of the supervised transactions of the third level of the first parallel chain to obtain a second execution result by consensus; wherein the supervised transaction is generated by each supervising node of the first parallel chain according to a second parallel chain block of the third height when monitoring that an execution result of the second parallel chain block is different from a third execution result, the third height is greater than the first consensus height and not greater than the first pre-consensus height, and the third execution result is a consensus execution result obtained by executing each consensus transaction of the third height of the first parallel chain; and the number of the first and second groups,
judging whether the second execution result is the same as the third execution result:
if not, updating the first pre-consensus height and the first consensus height to the third height minus one on the main chain, and clearing the continuous increase height; and the number of the first and second groups,
executing a plurality of regenerated supervision transactions and/or consensus transactions of the third height, and returning to judge whether the second execution result is the same as the third execution result or not after obtaining a second execution result and/or a third execution result which passes consensus again; wherein the regenerated consensus transaction of the third height is generated by the consensus node of the first parallel chain when checking out the last generated consensus transaction error of the third height, and the regenerated supervised transaction of the first height is generated by the supervision node of the first parallel chain when checking out the last generated supervised transaction error of the third height.
2. The method of claim 1, wherein the supervised transaction is generated by each supervising node of the first parallel chain from a second parallel chain block of the third height when the generated second parallel chain block is monitored to be a non-empty block and an execution result of the second parallel chain block is different from a third execution result.
3. A parallel chain supervision consensus method, wherein a parallel chain is configured with one or more supervision nodes, the method being adapted to a supervision node, the method comprising:
obtaining and executing common recognition transactions of a first height of a current parallel chain from a main chain to obtain a first execution result passing the common recognition; wherein each consensus transaction is further used for each main chain node to execute each consensus transaction to obtain a first execution result passing consensus, and the first execution result is used for each main chain node to update a first pre-consensus height of a current parallel chain on the main chain to the first height;
monitoring whether the execution result of the generated first parallel chain block of the first height is the same as the first execution result:
if so, updating a first pre-consensus height of the current parallel chain to the first height on the current parallel chain, and adding one to the continuous increase height to update the continuous increase height; and the number of the first and second groups,
when the continuous increase height is larger than a first value, adding one to a first common height of the current parallel chain on the current parallel chain to update the first common height;
if not, generating a first supervised transaction according to the first parallel chain block and sending the first supervised transaction to a main chain so that each main chain node executes each supervised transaction including the first height of the first supervised transaction to obtain a second execution result passing consensus, and judging whether the first execution result is the same as the second execution result: if not, updating the first pre-consensus height and the first consensus height of the current parallel chain to the first height minus one on the main chain; and the number of the first and second groups,
obtaining and executing each of the supervised transactions from the main chain to obtain a second execution result by consensus; and the number of the first and second groups,
judging whether the first execution result is the same as the second execution result:
if not, updating the first pre-consensus height and the first consensus height to the first height minus one on the current parallel chain, and resetting the continuous increase height; and the number of the first and second groups,
checking whether the first supervised transaction generated last time was erroneous:
if so, regenerating the first supervised transaction and sending the regenerated first height supervised transaction and/or consensus transaction to a main chain for each main chain node to execute a plurality of regenerated first height supervised transactions and/or consensus transactions, and returning to judge whether the first execution result is the same as the second execution result after obtaining a second execution result and/or a first execution result which passes consensus again; wherein the newly generated consensus transaction of the first height is generated by a consensus node of a current parallel chain when the last generated consensus transaction of the first height is checked out to be wrong; other regenerated supervised transactions of the first altitude are generated by other supervising nodes of the current parallel chain when the last generated supervised transaction of the first altitude is checked for errors; and the number of the first and second groups,
and acquiring and executing the newly generated consensus transaction and/or supervision transaction with the first height from the main chain, and returning to judge whether the first execution result is the same as the second execution result or not after acquiring the newly identified first execution result and/or second execution result.
4. The method of claim 3, wherein the monitoring whether the generated execution result of the first parallel chain block of the first height is the same as the first execution result comprises:
judging whether the generated first parallel chain block with the first height is a blank block:
and if not, monitoring whether the execution result of the generated first parallel chain block with the first height is the same as the first execution result.
5. A parallel chain supervision consensus method, wherein a parallel chain is configured with one or more supervision nodes, the method being applicable to consensus nodes, the method comprising:
obtaining and executing respective consensus transactions of a first height of a current parallel chain from a main chain to obtain a first execution result passing consensus, updating a first pre-consensus height of the current parallel chain to the first height on the current parallel chain, and adding one to a continuous growth height to update the continuous growth height; wherein each consensus transaction is further used for each main chain node to execute each consensus transaction to obtain a first execution result passing consensus, and the first execution result is used for each main chain node to update a first pre-consensus height of a current parallel chain on the main chain to the first height;
when the continuous increase height is larger than a first value, adding one to a first common height of the current parallel chain on the current parallel chain to update the first common height;
executing each supervised transaction at a third level of the current parallel chain to obtain a second execution result passing consensus; wherein the supervised transaction is generated by each supervising node of the current parallel chain according to the second parallel chain block when monitoring that the execution result of the second parallel chain block of the generated third height is different from a third execution result, the third height is greater than the current first consensus height and not greater than the current first pre-consensus height, and the third execution result is a consensus execution result obtained by executing each consensus transaction of the third height of the first parallel chain;
judging whether the second execution result is the same as the third execution result:
if not, updating the first pre-consensus height and the first consensus height to the third height minus one on the current parallel chain, and resetting the continuous increase height; and the number of the first and second groups,
checking whether the last generated first consensus transaction of the third height is erroneous:
if so, regenerating the first consensus transaction and sending the first consensus transaction to a main chain, so that each main chain node executes a plurality of regenerated supervision transactions with the third height and/or consensus transactions including the first consensus transaction, and after obtaining a second execution result and/or a third execution result which passes consensus again, returning to the judgment whether the second execution result is the same as the third execution result; wherein other regenerated consensus transaction of the third altitude is generated by other consensus nodes of the current parallel chain when the last generated consensus transaction of the third altitude is checked out to be wrong; other regenerated supervised transactions of the third altitude are generated by the supervisory node of the current parallel chain when the last generated supervised transaction of the third altitude is checked out to be wrong; and the number of the first and second groups,
and acquiring and executing the newly generated consensus transaction and/or supervision transaction with the third height from the main chain, and returning to judge whether the second execution result is the same as the third execution result or not after acquiring a second execution result and/or a third execution result which passes consensus again.
6. The method of claim 5, wherein the supervised transaction is generated by each supervising node of the first parallel chain from a second parallel chain block of the third height when the generated second parallel chain block is monitored to be a non-empty block and an execution result of the second parallel chain block is different from a third execution result.
7. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-6.
8. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-6.
CN202011425289.3A 2020-12-09 2020-12-09 Parallel chain supervision consensus method, device and storage medium Active CN112598418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011425289.3A CN112598418B (en) 2020-12-09 2020-12-09 Parallel chain supervision consensus method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011425289.3A CN112598418B (en) 2020-12-09 2020-12-09 Parallel chain supervision consensus method, device and storage medium

Publications (2)

Publication Number Publication Date
CN112598418A true CN112598418A (en) 2021-04-02
CN112598418B CN112598418B (en) 2023-11-28

Family

ID=75191125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011425289.3A Active CN112598418B (en) 2020-12-09 2020-12-09 Parallel chain supervision consensus method, device and storage medium

Country Status (1)

Country Link
CN (1) CN112598418B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium
US20200162263A1 (en) * 2018-11-15 2020-05-21 Eleven01 International Limited System and method of validation of block chain by secondary chain having incentivization and insurance coverage powered by proof of work

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium
US20200162263A1 (en) * 2018-11-15 2020-05-21 Eleven01 International Limited System and method of validation of block chain by secondary chain having incentivization and insurance coverage powered by proof of work

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
任盈之;夏晓蕾;: "区块链共识层专利技术综述", 中国发明与专利, no. 10 *

Also Published As

Publication number Publication date
CN112598418B (en) 2023-11-28

Similar Documents

Publication Publication Date Title
CN109558454B (en) Parallel chain mining consensus method, apparatus and storage medium
US20070260563A1 (en) Method to continuously diagnose and model changes of real-valued streaming variables
US20190079965A1 (en) Apparatus and method for real time analysis, predicting and reporting of anomalous database transaction log activity
CN107992410B (en) Software quality monitoring method and device, computer equipment and storage medium
EP3531285A2 (en) Ace: assurance, composed and explained
CN111290922A (en) Service operation health degree monitoring method and device
CN112184227A (en) Parallel chain supervision consensus method, equipment and storage medium
CN114363212B (en) Equipment detection method, device, equipment and storage medium
CN115730947A (en) Bank customer loss prediction method and device
Strasser et al. Diagnostic alarm sequence maturation in timed failure propagation graphs
CN112598418A (en) Parallel chain supervision consensus method, equipment and storage medium
CN110691122A (en) Parallel chain consensus method, device and storage medium
CN111106953B (en) Method and device for analyzing abnormal root cause
CN103713990A (en) Method and device for predicting defaults of software
CN112734574A (en) Transaction execution method, computer device, and storage medium
CN115328621A (en) Transaction processing method, device and equipment based on block chain and storage medium
CN112346995B (en) Banking industry-based test risk prediction model construction method and device
CN115391148A (en) Anomaly detection method and apparatus
CN111932131B (en) Service data processing method and device
Johnson et al. Towards Self-Adaptive Disaster Management Systems.
CN112733202A (en) Parallel chain supervision consensus method, computer device and storage medium
CN113626532B (en) Illegal node identification method, anti-cheating method, computer device and storage medium
CN111144935A (en) Big data-based sleep member awakening method and system, server and medium
CN111815442B (en) Link prediction method and device and electronic equipment
Abouzeid et al. A Method to Improving Artifact Anomaly Detection in a Temporal Structured Workflow

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