Block chain consensus method and device based on directed acyclic graph, and computer equipment
By introducing the concept of view into the blockchain consensus algorithm, the problem of delay in submitting proposals in the blockchain consensus algorithm based on directed acyclic graph is solved, and consensus submission is realized in each round, improving consensus efficiency.
Patent Information
- Application Number
- CN202411737980.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The blockchain consensus algorithm based on directed acyclic graph has the problem of delay in submitting proposals. The existing algorithm requires multiple rounds of voting and confirmation to submit proposals, resulting in a high delay.
Introducing the view concept, the submission unit generated in each round corresponds to multiple views, and by determining the anchor vertex to generate the next submission unit after successful submission, including the proposal round, the voting round and the decision round, allowing consensus in each round Submit, reducing the delay in submitting proposals.
It improves the consensus efficiency of blockchain consensus nodes, reduces the delay in submitting proposals, and improves the efficiency of blockchain consensus process.
Smart Images

Figure CN119203257A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of blockchain technology, and in particular, relate to a blockchain consensus method, apparatus, and computer equipment based on a directed acyclic graph. Background Art
[0002] The consensus mechanism is one of the cores of blockchain. The Byzantine fault tolerance (BFT) algorithm based on directed acyclic graph (DAG) is one of the commonly used algorithms to implement the blockchain consensus mechanism. Taking the DAG-based Byzantine fault-tolerant distributed consistency system as an example, in practical applications, it is necessary to verify and reach consensus on the node's proposal. However, in the above distributed consistency system, not only the proposal of a single master node is verified and reached consensus, but all validator nodes participating in the consensus are allowed to make proposals at the same time, and the causal order of these proposals is maintained through the DAG structure. Since DAG is a local structure, the process of submitting these proposals maintained by the DAG structure is very complicated. The DAG structure seen by each node at the same time may be incomplete, and a more stringent confirmation round is required to submit the proposal in the DAG, which results in higher latency for the consensus algorithm based on the DAG structure.
[0003] In existing BFT algorithms, such as the DagRider algorithm, the Tusk algorithm, or the Bullshark algorithm, the consensus process requires multiple rounds of voting to build a DAG, and each round of proposals needs to be confirmed by the subsequent rounds before they can be submitted.
[0004] For example, Figures 1 to 3 The following are schematic diagrams of using the DagRider algorithm, Tusk algorithm, and Bullshark algorithm for consensus. In order to ensure the security and consistency of proposal submission, these algorithms must submit an "anchor vertex" after two or more rounds. The submission of proposals in other vertices must be submitted by reference when the "anchor vertex" is submitted. Compared with traditional non-DAG structure algorithms, this results in a higher submission delay. For example, in Figure 1 In the DagRider algorithm shown, proposal v2 in the 5th round needs to be submitted in the 8th round, that is, the anchor vertex can only be submitted once every 4 rounds. Figure 2 and Figure 3In the Tusk algorithm and Bullshark algorithm shown in the figure, L1 and L2, S1A and S1B are the "anchor vertices" submitted twice in the two algorithms respectively. It can be seen that although the Tusk algorithm and the Bullshark algorithm reduce the number of rounds submitted by DAG, it is still necessary to submit an "anchor vertex" every 2 rounds, that is, the proposal L1 or S1A in the first round can be submitted in the second round. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a blockchain consensus method, apparatus and computer equipment based on a directed acyclic graph, so as to improve the consensus efficiency of consensus nodes in the blockchain and reduce the proposal submission delay generated during the consensus process.
[0006] A first aspect of an embodiment of the present application provides a blockchain consensus method based on a directed acyclic graph, wherein the directed acyclic graph is generated by expansion of multiple consensus nodes in the blockchain during each round of consensus, and each submission unit generated based on three consecutive rounds corresponds to each view in the directed acyclic graph; wherein each view is generated in each round, and the method includes: Determining an anchor vertex in a k-th view, wherein the k-th view corresponds to the k-th submission unit; After the anchor vertex in the k-th view is successfully submitted, a k+1-th submission unit is generated in the k+1-th view; wherein the three consecutive rounds included in the k+1-th submission unit are respectively a proposal round, a voting round and a decision round of the k+1-th submission unit, the proposal round of the k+1-th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
[0007] In an embodiment of the present application, in the initial state, k=1, the first view coincides with the first submission unit, and the proposal round, voting round and decision round of the first submission unit are respectively the first round, the second round and the third round in the directed acyclic graph.
[0008] In a possible implementation of the embodiment of the present application, the method further includes: If the anchor vertex in the k-th view is not successfully submitted, a k+1-th submission unit is generated after the k-th submission unit; wherein the proposal round of the k+1-th submission unit is the voting round of the k-th submission unit.
[0009] In another possible implementation of the embodiment of the present application, after the k+1th submission unit is generated after the kth submission unit, the method further includes: Determine the anchor vertex in the k+1th view corresponding to the k+1th submission unit, and determine the consensus of the anchor vertex in the k+1th view; According to the consensus of the anchor vertices in the k+1th view, consensus is reached on the anchor vertices in the kth view that have not been successfully submitted.
[0010] In one example, the consensus of the anchor vertices in the k+1th view includes that the anchor vertices in the k+1th view satisfy a submission condition, and the consensus on the anchor vertices in the k+1th view that have not been successfully submitted is performed according to the consensus of the anchor vertices in the k+1th view, including: When the anchor vertex in the k+1th view meets the submission condition, confirm whether there is a path from the anchor vertex in the k+1th view to the anchor vertex in the kth view in the directed acyclic graph; If there is a path in the directed acyclic graph from the anchor vertex in the k+1th view to the anchor vertex in the kth view, submit the anchor vertex in the kth view before submitting the anchor vertex in the k+1th view; If there is no path in the directed acyclic graph from the anchor vertex in the k+1th view to the anchor vertex in the kth view, the anchor vertex in the k+1th view is submitted.
[0011] In another example, the consensus status of the anchor vertex in the k+1th view includes that the anchor vertex in the k+1th view does not satisfy the submission condition, and the consensus on the anchor vertex in the k+1th view that has not been successfully submitted according to the submission status of the anchor vertex in the k+1th view includes: When the anchor vertex in the k+1th view does not meet the submission condition, a k+2th submission unit is generated after the k+1th submission unit; wherein the proposal round of the k+2th submission unit is the decision round of the k+1th submission unit.
[0012] In the embodiment of the present application, each submission unit generated in three consecutive rounds includes multiple views in the directed acyclic graph, and the method further includes: Anchor vertices from multiple views are submitted during each round of consensus.
[0013] In a possible implementation of the embodiment of the present application, submitting anchor vertices in multiple views in each round of consensus process includes: A plurality of views included in each submission unit are represented as view mn by two digits, wherein view mn represents the mth view of the nth round, and the number of views generated in the directed acyclic graph is less than or equal to the number of the plurality of consensus nodes; After the anchor vertex in the m-th view of the n-th round is successfully submitted, consensus is reached on the anchor vertex in the m+1-th view of the n-th round; If the anchor vertex in the m+1th view of the nth round is successfully submitted, consensus is reached on the anchor vertex in the m+2th view of the nth round; If the anchor vertex in the m+1th view of the nth round is not successfully submitted, after pausing the consensus on the anchor vertices in the remaining views of the nth round, consensus is performed on the anchor vertex in the m+1th view of the n+2th round until the consensus on the anchor vertices in each view is completed.
[0014] In another possible implementation of the embodiment of the present application, after pausing consensus on the anchor vertices in the remaining views of the nth round, consensus on the anchor vertices in the m+1th view of the n+2th round is reached until consensus on the anchor vertices in each view is completed, including: When an anchor vertex in any view of the n+2th round meets the submission condition and the anchor vertex that meets the submission condition has a path in the directed acyclic graph pointing to an anchor vertex in a view that was not successfully submitted in the nth round and is in a paused state, the anchor vertex in the view corresponding to the path in the nth round is resubmitted until the consensus of the anchor vertices in each view is reached.
[0015] In an embodiment of the present application, the submission condition that is satisfied when the anchor vertex in the kth view is successfully submitted is that the anchor vertex in the kth view obtains the support of at least f+1 consensus nodes in the voting round corresponding to the kth submission unit, where f is the number of malicious nodes among the multiple consensus nodes.
[0016] A second aspect of an embodiment of the present application provides a blockchain consensus device based on a directed acyclic graph, wherein the directed acyclic graph is generated by expansion of multiple consensus nodes in the blockchain during each round of consensus, and each submission unit generated based on three consecutive rounds corresponds to each view in the directed acyclic graph; wherein each view is generated in each round, and the device includes: A determination module, configured to determine an anchor vertex in a k-th view, wherein the k-th view corresponds to the k-th submission unit; A consensus module, configured to generate a k+1th submission unit in the k+1th view after the anchor vertex in the k-th view is successfully submitted; wherein the three consecutive rounds included in the k+1th submission unit are respectively a proposal round, a voting round and a decision round of the k+1th submission unit, the proposal round of the k+1th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
[0017] A third aspect of an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the computer device implements a method as described in any one of the above-mentioned first aspects.
[0018] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, a method as described in any one of the above-mentioned first aspects is implemented.
[0019] A fifth aspect of an embodiment of the present application provides a computer program product, including a computer program, which enables any method in the above-mentioned first aspect to be executed when the computer program is run.
[0020] Compared with the prior art, the embodiments of the present application have the following beneficial effects: In the embodiment of the present application, by introducing the concept of view in the blockchain consensus process based on DAG, the DAG generated by the expansion of multiple consensus nodes in the blockchain in each round of consensus process can be corresponded to multiple views, so that each submission unit generated based on three consecutive rounds corresponds to each view in the DAG, and each view is guaranteed to be generated in each round. Therefore, the kth view can correspond to the kth submission unit. By determining the anchor vertex in the kth view, the k+1th submission unit can be generated in the k+1th view after the anchor vertex in the kth view is successfully submitted. The three consecutive rounds included in the above k+1th submission unit are respectively the proposal round, voting round and decision round of the k+1th submission unit, and the proposal round of the k+1th submission unit is the voting round of the kth submission unit. In this way, when realizing the consensus of the proposals of each node in the blockchain, a consensus submission can be performed in each round of the DAG, which improves the consensus efficiency of the consensus nodes in the blockchain and reduces the proposal submission delay generated in the consensus process. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 It is a schematic diagram of using the DagRider algorithm for consensus in the prior art; Figure 2It is a schematic diagram of using Tusk algorithm for consensus in the prior art; Figure 3 It is a schematic diagram of using the Bullshark algorithm for consensus in the prior art; Figure 4 is a schematic diagram of a directed acyclic graph provided in an embodiment of the present application; Figure 5 is a schematic diagram of another directed acyclic graph provided in an embodiment of the present application; Figure 6 is a schematic diagram of another directed acyclic graph provided in an embodiment of the present application; Figure 7 is a schematic diagram of another directed acyclic graph provided in an embodiment of the present application; Figure 8 It is a schematic diagram of a blockchain consensus method based on a directed acyclic graph provided in an embodiment of the present application; Fig. 9 is a schematic diagram of a directed acyclic graph including multiple views in a submission unit provided in an embodiment of the present application; Fig.10 It is a schematic diagram of a blockchain consensus device based on a directed acyclic graph provided in an embodiment of the present application; Fig.11 It is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the present application.
[0024] Before introducing the specific technical solutions of the embodiments of the present application, a brief introduction to the relevant knowledge that may be involved in the embodiments of the present application is first given.
[0025] like Figure 4 , which is a schematic diagram of a directed acyclic graph DAG provided in an embodiment of the present application. The DAG involved in the embodiment of the present application can be generated by the expansion of multiple consensus nodes in the blockchain in each round of consensus process. Specifically, Figure 4Each vertex in the DAG shown can represent a consensus proposal. The DAG can be expanded in rounds. Each consensus node in the blockchain can broadcast a proposal generated by the node in each round. Each proposal needs to be verified and confirmed by other consensus nodes. The above confirmation process can be completed by reliable broadcast ReliableBroadcast, and other consensus nodes need to sign and vote on the received proposals. Each consensus node can only enter the next round after receiving a sufficient number of confirmed proposals in the current round. The specific value of the above sufficient number can be 2f+1, that is, each consensus node can only enter the next round after receiving at least 2f+1 confirmed proposals in the current round. The above f is the number of malicious nodes in the system. When entering the next round, each new proposal proposed by each consensus node needs to reference at least 2f+1 proposals in the previous round.
[0026] The unit for submitting proposals in DAG can be called a submission unit Wave. A submission unit Wave can be divided into three rounds, namely Propose Round, Vote Round and Decision Round. Figure 4 Round 1, Round 2, and Round 3. Therefore, Figure 4 The DAG shown includes a complete submission unit Wave.
[0027] Among them, the Propose Round can refer to the round in which the proposal that is selected to be submitted is located, such as Figure 4 As shown, the second vertex L in Round 1 represents the proposal that is expected to be submitted, and this vertex can also be called the "anchor vertex".
[0028] Voting Round refers to the round in which a submitted proposal is cited and supported by subsequent proposals, such as Figure 4 There are three vertices in Round 2 that support L1. Figure 4 The condition for the "anchor vertex" L1 to be submitted is that there are at least f+1 vertices that support L1 in the voting round VoteRound. In DAG, whether the vertices in the voting round Vote Round support the "anchor vertex" can be represented by the straight lines with arrows between the vertices. For example, Figure 4 There are straight lines pointing to the "anchor vertex" L1 from the three vertices in the voting round Vote Round, which means that these three vertices can vote for the "anchor vertex" L1 during the voting process.
[0029] The Decision Round can be used to ensure the security of the proposal submitted this time. The Decision Round references at least 2f+1 vertices of the Vote Round, and the vertices that can be submitted will be referenced by the vertices of f+1 Vote Rounds. Therefore, as long as the "anchor vertex" of the Propose Round can be submitted, at least one reference path to the "anchor vertex" can be found in the Decision Round.
[0030] In an embodiment of the present application, if a proposal vertex in the Propose Round does not obtain sufficient references in the Vote Round, that is, there are less than f+1 vertices in the Vote Round that vote in favor of the proposal of the above vertex, then the proposal can be submitted only in the next submission unit Wave.
[0031] like Figure 5 , which is a schematic diagram of another DAG provided in an embodiment of the present application. Figure 5 The DAG shown includes two submission units, namely submission unit Wave 1 and submission unit Wave 2. Figure 5 In the example, the vertex L1 in Round 1 is only supported by one vertex in Round 2, that is, Figure 5 In this submission algorithm, only the second vertex in Round 2 supports vertex L1, so the proposal of vertex L1 cannot be submitted in submission unit Wave 1. Round 3 is both the decision round of submission unit Wave 1 and the proposal round of submission unit Wave 2. Figure 5 L2 in represents the proposal of the vertex, that is, the proposal waiting to be submitted in the submission unit Wave 2.
[0032] In the submission unit Wave 2, L2 is supported by 3 vertices in the voting round of the current submission unit, Wave 2, which is Round 4, indicating that L2 can be submitted. At this time, there are the following two situations: ① There is a reference path from vertex L2 to vertex L1 (such as Figure 5 In this case, you can submit a proposal for vertex L1 before submitting a proposal for vertex L2. Figure 5 In the figure, vertex L1 is drawn with a dotted line, indicating that the vertex can be submitted indirectly through the subsequent "anchor vertex".
[0033] ② There is no reference path from vertex L2 to vertex L1 (i.e. Figure 5If the path indicated by the bold line does not exist), then when submitting the L2 proposal, you can skip submitting the vertex proposal in the submission unit Wave 1 and directly submit the vertex L2 proposal of Wave 2.
[0034] In the embodiment of the present application, the submission process for the "anchor vertex" may be: in addition to submitting the proposal of the "anchor vertex" itself, the proposals of all vertices referenced by the "anchor vertex" that have not been submitted in the previous submission unit may also be submitted. Figure 5 In the DAG shown, when L2's proposal can be submitted, the proposals of the three vertices in Round 2 referenced by L2 will also be submitted. After the proposals of these vertices are submitted, they will be processed by the upper-layer application. For example, in a blockchain system, the proposals in these vertices can be assembled into a block and recorded in the blockchain ledger.
[0035] Based on the above introduction, the embodiment of the present application explains DAG by introducing the concept of view View. A unique "anchor vertex" can be determined in each view View. Each submission unit Wave corresponds to a view View, which can be used to submit a unique "anchor vertex". In the initial state, the first view View 1 can overlap with the first submission unit Wave 1. It should be pointed out that, unless otherwise specified, the submission to a vertex described in the embodiment of the present application represents the submission of a proposal for the vertex.
[0036] like Figure 6 , which is a schematic diagram of another DAG provided in an embodiment of the present application. Figure 6 In the DAG shown, view View can be generated in each round, that is, the first round Round 1 generates the first view View 1, and the first view View 1 corresponds to the first submission unit Wave 1; the second round Round 2 generates the second view View 2, and the second view View2 corresponds to the second submission unit Wave 2; ... the kth round Round k generates the kth view View k, and the kth view Viewk corresponds to the kth submission unit Wave k.
[0037] according to Figure 6 As shown in Figure 1, the first view View 1 corresponds to the first submission unit Wave 1, which includes three consecutive rounds, namely the proposal round, voting round and decision round mentioned above, which also corresponds to Figure 6 Round 1, Round 2, and Round 3 in the submission unit Wave 1. In the view View 1 corresponding to the submission unit Wave 1, the only "anchor vertex" is the vertex L1 in Round 1.
[0038] like Figure 7 , which is a schematic diagram of another DAG provided in an embodiment of the present application, Figure 7 The DAG shown is in Figure 6 The DAG shown in the figure is further improved. Figure 7 The DAG in is interpreted using the view View, and after the "anchor vertex" in the current view View is successfully submitted, a new submission unit will be generated in the next view View. For example, in Figure 7 In the example, vertex L1 is the "anchor vertex" selected by view View 1 in submission unit Wave 1, which includes Figure 7 Round 1, Round 2, and Round 3 in the voting round. The "anchor vertex" L1 meets the submission conditions in its submission unit Wave1 (i.e., L1 obtains the support of f+1 vertices in the voting round), and can complete the submission. After L1 is successfully submitted, a new submission unit will be generated in the next view View, i.e., the second view View 2. This view View 2 corresponds to the second submission unit, i.e., Wave 2. The second submission unit Wave 2 includes Figure 7 As shown in the figure, Round 2, Round 3 and Round 4 belong to the proposal round, voting round and decision round of the submission unit Wave 2 respectively.
[0039] The "anchor vertex" in the above submission unit Wave 2 is vertex L2 in Round 2. After vertex L2 is submitted, a new submission unit, Wave 3, will be generated in the next view, View 3. The proposal round, voting round, and decision round in the submission unit Wave 3 are respectively Figure 7 Round 3, Round 4, and Round 5 are shown in .
[0040] In the embodiment of the present application, if the "anchor vertex" in a certain view View is not successfully submitted, a new submission unit will be generated after the original submission unit. Figure 7 As shown in the figure, the "anchor vertex" L3 of the third view View 3 failed to complete the submission (the "anchor vertex" L3 is only supported by one vertex in Round 4), and the new submission unit will be generated after the original submission unit. Specifically, the original submission unit is the submission unit Wave 3 corresponding to the third view View 3, which includes the proposal round, voting round and decision round as follows: Figure 7Round 3, Round 4 and Round 5 in the first submission unit, then the new submission unit is the submission unit Wave 5 corresponding to Round 5, Round 6 and Round 7. This ensures that the decision round (Round 5) in the previous submission unit Wave 3 coincides with the proposal round (Round 5) in the next submission unit Wave 5. In the submission unit Wave 5, the "anchor vertex" is vertex L5.
[0041] Assumptions Figure 7 There is a path between the "anchor vertex" L5 and L3, so L3 can be submitted before L5. In this way, after the vertex L3 is submitted, the condition "After the "anchor vertex" in the current view View is successfully submitted, a new submission unit will be generated in the next view View". Therefore, the new submission unit will be generated in the round where the view View 4 is located, that is, Round 4, Round 5, and Round 6.
[0042] In the embodiment of the present application, if the "anchor vertex" of a certain view View cannot be submitted directly in its own submission unit, nor can it be submitted indirectly in subsequent submission units, then the algorithm will "skip" all Views between this View and the most recently submitted View. For example, Figure 7 As shown in the figure, the "anchor vertex" L4 of view View 4 does not exist (it may not receive this proposal due to network problems, or the node responsible for the proposal fails and does not generate a proposal), and cannot be indirectly submitted through the subsequent submission units, namely the "anchor vertex" L6 of the submission unit Wave 6 corresponding to Round 6, Round 7, and Round 8. After the "anchor vertex" L6 is successfully submitted, View 4 and View 5 will be skipped, and the next submission unit will be generated in View 7. The submission unit corresponding to View 7, namely Wave 7, includes Figure 7 The three consecutive rounds starting with Round 7 shown in Figure 7 not fully shown).
[0043] The technical solution of the present application is described below through specific embodiments.
[0044] Reference Figure 8 , shows a schematic diagram of a blockchain consensus method based on a directed acyclic graph provided in an embodiment of the present application, which may specifically include the following steps: S801. Determine an anchor vertex in a k-th view, where the k-th view corresponds to a k-th submission unit.
[0045] It should be noted that the embodiments of the present application can be applied to computer devices, that is, the execution subject of the embodiments of the present application can be a computer device, and the computer device can achieve consensus on the proposals of each node in the blockchain based on DAG by executing the various steps provided in the embodiments of the present application. Specifically, the above consensus process can be implemented by the computer device through the algorithm introduced in the aforementioned embodiments.
[0046] In the embodiment of the present application, the directed acyclic graph DAG can be extended and generated by multiple consensus nodes in the blockchain in each round of consensus process, and each submission unit Wave generated based on three consecutive rounds corresponds to each view View in the DAG. Figure 6 and Figure 7 As described in the introduction to the corresponding implementation example section, the implementation example of the present application introduces the concept of view View to explain DAG, and the k-th view, View k, corresponds to the k-th submission unit, Wave k. Therefore, in the initial state, k=1, and the first view View 1 coincides with the first submission unit Wave 1. The three consecutive rounds contained in each submission unit are the proposal round, voting round, and decision round of this submission unit, and the proposal round, voting round, and decision round of the first submission unit are the first round, the second round, and the third round in the DAG, respectively, which also corresponds to the rounds contained in the first view View 1.
[0047] In the embodiment of the present application, each view is generated in each round. Specifically, in each round, a view with the round as the proposal round will be generated, and the three consecutive rounds with the corresponding round as the proposal round in the view are a submission unit, and these three rounds are the proposal round, voting round and decision round of the current view or the current submission unit. Exemplarily, in the first round, a view with the first round as the proposal round is generated, and at this time, the three consecutive rounds, namely the first round, the second round and the third round, belong to the same submission unit (the same view); in the second round, a view with the second round as the proposal round is generated, and at this time, the three consecutive rounds, namely the second round, the third round and the fourth round, belong to the same submission unit (the same view); in the third round, a view with the third round as the proposal round is generated, and at this time, the three consecutive rounds, namely the third round, the fourth round and the fifth round, belong to the same submission unit (the same view), and so on.
[0048] During the consensus process, the anchor vertex in the kth view can be determined. Where k is a positive integer. For example, the consensus process starts from the first view View 1 in the first round, and the anchor vertex in the first view View 1 can be determined at this time. Each view includes only one anchor vertex.
[0049] S802. After the anchor vertex in the k-th view is successfully submitted, a k+1-th submission unit is generated in the k+1-th view; wherein the three consecutive rounds included in the k+1-th submission unit are respectively a proposal round, a voting round and a decision round of the k+1-th submission unit, the proposal round of the k+1-th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
[0050] In an embodiment of the present application, the submission condition that the anchor vertex in each view is successfully submitted and meets may be: the anchor vertex in the view obtains the support of at least f+1 consensus nodes in the voting round of the corresponding submission unit, and the above f represents the number of malicious nodes among the multiple consensus nodes. Therefore, the submission condition that the anchor vertex in the k-th view should meet to be successfully submitted is that the anchor vertex in the k-th view obtains the support of at least f+1 consensus nodes in the voting round of the corresponding k-th submission unit. For example, in the initial state, view View 1 includes rounds 1, 2, and 3. The anchor vertex in view View 1 is successfully submitted and meets the support of at least f+1 consensus nodes in the voting round, i.e., round 2, that is, there are at least f+1 vertices in round 2 that support the above anchor vertex. This is reflected in the DAG, which means that there are at least f+1 paths from the current vertex to the anchor point in round 2.
[0051] In the embodiment of the present application, after the anchor vertex in the kth view is successfully submitted, the k+1th submission unit will be generated in the k+1th view. The three consecutive rounds included in the k+1th submission unit are the proposal round, voting round and decision round of the k+1th submission unit.
[0052] For example, Figure 7 As shown, vertex L1 is the "anchor vertex" selected in view View 1 in submission unit Wave 1, which includes Figure 7 The first, second and third rounds of the voting process. The "anchor vertex" L1 meets the submission conditions in its submission unit Wave 1 (i.e., L1 obtains the support of f+1 vertices in the voting round), and can complete the submission. After L1 is successfully submitted, a new submission unit will be generated in the next view View, i.e., the second view View 2. This view View2 corresponds to the second submission unit, i.e., Wave 2. The second submission unit Wave 2 includes Figure 7 The 2nd, 3rd and 4th rounds shown in the figure belong to the proposal round, voting round and decision round of the submission unit Wave 2 respectively.
[0053] In an embodiment of the present application, there is a situation where the anchor vertex in the k-th view is not successfully submitted, that is, the anchor vertex in the k-th view does not obtain the support of at least f+1 vertices in the voting round. At this time, a new submission unit will be generated after the k-th submission unit, and the new submission unit may be the k+2-th submission unit. In this case, the proposal round of the k+2-th submission unit is the decision round of the k-th submission unit. That is, the proposal round of the k+2-th submission unit coincides with the decision round of the k-th submission unit.
[0054] For example, Figure 7 As shown in the figure, the "anchor vertex" L3 of the third view View 3 has only one vertex support in the fourth round and fails to complete the submission. In this way, the new submission unit will be generated after the original submission unit, which is the submission unit corresponding to the third view View 3, including Figure 7 Since the proposal round of the new submission unit generated after the original submission unit coincides with the decision round of the original submission unit, the proposal round of the new submission unit generated after the original submission unit is Figure 7 In the 5th round of Figure 7 The 5th round is the proposal round, the 6th round is the voting round, and the 7th round is the decision round. The view corresponding to the new submission unit is Figure 7 View 5 in the view.
[0055] In a possible implementation of the embodiment of the present application, if the anchor vertex in the k-th view is not successfully submitted, and the new submission unit is generated after the original submission unit, that is, the k+2-th submission unit is generated after the k-th submission unit. At this time, the anchor vertex in the k+2-th view corresponding to the k+2-th submission unit can be determined, and the consensus of the anchor vertex in the k+2-th view can be determined. According to the consensus of the anchor vertex in the k+2-th view, the anchor vertex in the k+2-th view that has not been successfully submitted can be consensused.
[0056] For example, Figure 7 As shown, the anchor vertex in the submission unit corresponding to the third view View 3 has not been successfully submitted, and the newly generated submission unit is the submission unit corresponding to the fifth view View 3. The anchor vertex in the new submission unit is L5. The computer device can reach a consensus on the vertex L3 that has not been successfully submitted based on the consensus of the anchor vertex L5.
[0057] In the embodiment of the present application, the consensus of the anchor vertex in the k+2th view includes two situations, that is, the anchor vertex in the k+2th view meets the submission condition, or the anchor vertex in the k+2th view does not meet the submission condition. The consensus process of these two situations is described below.
[0058] When the anchor vertex in the k+2th view meets the submission condition, when consensus is reached on the anchor vertex in the kth view that has not been successfully submitted, it can be confirmed whether there is a path from the anchor vertex in the k+2th view to the anchor vertex in the kth view in the DAG. Figure 7 Check whether there is a path from anchor vertex L5 to L3 in the DAG shown.
[0059] If there is a path in the DAG pointing from the anchor vertex in the k+2th view to the anchor vertex in the kth view, the computer device may first submit the anchor vertex in the kth view before submitting the anchor vertex in the k+2th view, and then submit the anchor vertex in the k+2th view.
[0060] If there is no path in the DAG pointing from the anchor vertex in the k+2th view to the anchor vertex in the kth view, the computer device may directly submit the anchor vertex in the k+2th view.
[0061] For example, assuming Figure 7 In the DAG shown, there is a path from anchor vertex L5 to L3. The computer device can submit anchor vertex L3 first, and then submit anchor vertex L5. Since after anchor vertex L3 is submitted, the condition that "after the "anchor vertex" in the current view View is successfully submitted, a new submission unit will be generated in the next view View" is met, and the new submission unit will be generated in the next view of the view where L3 is located, that is, Figure 7 The view in View 4 is generated.
[0062] like Figure 7 As shown, if there is no path from anchor vertex L5 to L3 in the DAG, the computer device can directly submit the anchor vertex L5.
[0063] In another case, if the anchor vertex in the k+2th view does not meet the submission condition, the computer device should generate a new submission unit after the k+2th submission unit when reaching a consensus on the anchor vertex in the k+2th view that has not been successfully submitted according to the submission status of the anchor vertex in the k+2th view. Since the proposal round of the new submission unit is the decision round of the current submission unit, the new submission unit generated after the k+2th submission unit is the k+4th submission unit. The proposal round of the above k+4th submission unit is the decision round of the k+2th submission unit.
[0064] In the embodiment of the present application, by introducing the concept of view in the blockchain consensus process based on DAG, the DAG generated by the expansion of multiple consensus nodes in the blockchain in each round of consensus process can be corresponded to multiple views, so that each submission unit generated based on three consecutive rounds corresponds to each view in the DAG, and each view is guaranteed to be generated in each round. Therefore, the kth view can correspond to the kth submission unit. By determining the anchor vertex in the kth view, the k+1th submission unit can be generated in the k+1th view after the anchor vertex in the kth view is successfully submitted. The three consecutive rounds included in the above k+1th submission unit are respectively the proposal round, voting round and decision round of the k+1th submission unit, and the proposal round of the k+1th submission unit is the voting round of the kth submission unit. In this way, when realizing the consensus of the proposals of each node in the blockchain, a consensus submission can be performed in each round of the DAG, which improves the consensus efficiency of the consensus nodes in the blockchain and reduces the proposal submission delay generated in the consensus process.
[0065] Based on the consensus methods provided in the above embodiments, each submission unit generated based on three consecutive rounds can also include multiple views in the DAG, that is, the embodiment of the present application allows each submission unit to include multiple views by allowing each view to be generated in each round, so that anchor vertices in multiple views can be submitted in the consensus process of each round. In other words, multiple anchor vertices can be submitted in each round of the DAG.
[0066] like Fig. 9 , which is a schematic diagram of another DAG provided in an embodiment of the present application. Fig. 9 In the DAG shown in , each submission unit includes multiple views. Fig. 9 In the process of consensus on each consensus node in the blockchain, the DAG shown in the figure can use two numbers to represent the multiple views included in each submission unit as view mn, and the above view mn can represent the mth view of the nth round. Among them, the number of views generated in the DAG should be less than or equal to the number of multiple consensus nodes. That is, the maximum number of views in the DAG should not exceed the number of consensus nodes in the system. Specifically, Fig. 9 As shown, an example is shown in which a maximum of 4 views can be defined in a DAG structure generated by 4 consensus nodes. Fig. 9 Each view in View is represented by two numbers, View mn or View mn or View View mn, which means the mth view in the nth round. For example, Fig. 9 View 3-2 in the figure represents the third view of the second round in the DAG.
[0067] Based on Fig. 9 When the DAG shown performs consensus on the consensus nodes, similar to the first step in each of the aforementioned embodiments, after the anchor vertex of each view is successfully submitted, the computer device will attempt to submit the anchor vertex of the next view.
[0068] For ease of description, in the embodiments of the present application, three consecutive rounds are used to represent a submission unit. For example, the submission unit Round x / y / z represents a submission unit corresponding to the consecutive rounds x, y, and z, where the round x is the proposal round of the submission unit Round x / y / z, the round y is the voting round of the submission unit Round x / y / z, and the round z is the decision round of the submission unit Round x / y / z.
[0069] For example, in Fig. 9 In the example, View 1-1 is the anchor vertex of the first view in the submission unit Round 1 / 2 / 3 corresponding to the first, second, and third rounds. The proposal round, voting round, and decision round in the submission unit Round 1 / 2 / 3 are also Fig. 9 View 2-1 is also the anchor vertex in the second view of the submission unit Round1 / 2 / 3 corresponding to the above rounds 1, 2, and 3. Fig. 9 The anchor vertex represented by View 1-1 in the above example can be successfully submitted, and after successfully submitting the anchor vertex, the computer device can continue to submit the anchor vertex represented by View 2-1. Similarly, after successfully submitting all anchor vertices in the submission unit Round 1 / 2 / 3, the computer device will continue to submit in the new submission unit Round 2 / 3 / 4.
[0070] Similar to the consensus process described in the aforementioned embodiments, if the anchor vertex in the previous view fails to be successfully submitted, a new submission unit will be generated after the original submission unit and attempt to submit the anchor vertex of the same view.
[0071] For example, in Fig. 9 In the example, the anchor vertex represented by View 2-2 cannot be submitted in submission unit Round 2 / 3 / 4, so the submission unit is updated to Round 4 / 5 / 6. Fig. 9The anchor vertices represented by View 3-2, View 4-2, View 1-3, View2-3, View 3-3, View 4-3, and View 1-4 in the new submission unit cannot be submitted temporarily. The anchor vertex of the same view in the new submission unit, that is, the anchor vertex represented by View 2-4, meets the submission conditions and can be submitted. Since there is a path from View2-4 to View 2-2 in the DAG, the anchor vertex represented by View 2-2 can be submitted first. Once View 2-2 is submitted, the suspended Views will be submitted again starting from View 3-2.
[0072] Similarly, if an anchor vertex in a view cannot be submitted directly in its own submission unit, nor can it be submitted indirectly by an anchor vertex of the same view in a subsequent submission unit, the computer device will "skip" all views between this view and the most recently submitted view during the execution of the consensus algorithm. Fig. 9 In the example, the anchor vertex represented by View 2-3 cannot be submitted directly, nor can it be submitted indirectly by the anchor vertex represented by View 2-5. Therefore, all vertices between View 2-3 and View 2-5 will be skipped during the consensus process, and submission will start from View 3-5.
[0073] Based on the above introduction, when the computer device submits anchor vertices in multiple views during each round of consensus, after the anchor vertex in the mth view of the nth round is successfully submitted, the computer device can reach a consensus on the anchor vertex in the m+1th view of the nth round. In the initial state, the values of m and n can both be 1. Thereafter, the values of m and n can increase in natural number order. Therefore, in the initial state, the computer device can first try to submit the anchor vertex in the first view of the first round. If the anchor vertex in the first view of the first round is successfully submitted, the computer device can try to reach a consensus on the anchor vertex in the m+1th view of the nth round, that is, the second view of the first round.
[0074] In the embodiment of the present application, if the anchor vertex in the m+1th view of the nth round is successfully submitted, the computer device can reach a consensus on the anchor vertex in the m+2th view of the nth round. If the anchor vertex in the m+1th view of the nth round is not successfully submitted, the computer device can reach a consensus on the anchor vertex in the m+1th view of the n+2th round after pausing the consensus on the anchor vertices in the remaining views of the nth round, until the consensus on the anchor vertices in each view is completed.
[0075] In a possible implementation of the embodiment of the present application, after pausing consensus on the anchor vertices in the remaining views of the nth round, consensus is reached on the anchor vertices in the m+1th view of the n+2th round until consensus on the anchor vertices in each view is completed, which may specifically include: When an anchor vertex in any view of the n+2th round meets the submission condition and the anchor vertex that meets the submission condition has a path in the DAG pointing to the anchor vertex in the view that was not successfully submitted in the nth round that is in a paused state, the computer device can resubmit the anchor vertex in the view corresponding to the above path in the nth round until the consensus of the anchor vertices in each view is reached.
[0076] The embodiment of the present application sets the submission of multiple anchor vertices in each round, which can reduce the submission delay of ordinary vertices that are not anchor vertices, thereby improving the submission efficiency of proposals of each consensus node in the entire consensus process and reducing the submission delay.
[0077] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0078] Reference Fig.10 , shows a schematic diagram of a blockchain consensus device based on a directed acyclic graph provided by an embodiment of the present application, wherein the directed acyclic graph can be generated by multiple consensus nodes in the blockchain in each round of consensus process, and each submission unit generated based on three consecutive rounds corresponds to each view in the directed acyclic graph; wherein each view can be generated in each round. The above-mentioned device can specifically include a determination module 1001 and a consensus module 1002, wherein: A determination module 1001 is used to determine an anchor vertex in a k-th view, where the k-th view corresponds to a k-th submission unit; The consensus module 1002 is used to generate a k+1th submission unit in the k+1th view after the anchor vertex in the k-th view is successfully submitted; wherein the three consecutive rounds included in the k+1th submission unit are respectively a proposal round, a voting round and a decision round of the k+1th submission unit, the proposal round of the k+1th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
[0079] In an embodiment of the present application, in the initial state, k=1, the first view coincides with the first submission unit, and the proposal round, voting round and decision round of the first submission unit are respectively the first round, the second round and the third round in the directed acyclic graph.
[0080] In a possible implementation of the embodiment of the present application, the consensus module 1002 may also be used to: If the anchor vertex in the k-th view is not successfully submitted, a k+1-th submission unit is generated after the k-th submission unit; wherein the proposal round of the k+1-th submission unit is the decision round of the k-th submission unit.
[0081] In another possible implementation of the embodiment of the present application, after the consensus module 1002 generates the k+1th submission unit after the kth submission unit, it can also be used to: Determine the anchor vertex in the k+1th view corresponding to the k+1th submission unit, and determine the consensus of the anchor vertex in the k+1th view; According to the consensus of the anchor vertices in the k+1th view, consensus is reached on the anchor vertices in the kth view that have not been successfully submitted.
[0082] In a possible implementation of the embodiment of the present application, the consensus of the anchor vertex in the k+1th view may include that the anchor vertex in the k+1th view satisfies the submission condition. At this time, the consensus module 1002 may be used to: When the anchor vertex in the k+1th view meets the submission condition, confirm whether there is a path from the anchor vertex in the k+1th view to the anchor vertex in the kth view in the directed acyclic graph; If there is a path in the directed acyclic graph from the anchor vertex in the k+1th view to the anchor vertex in the kth view, submit the anchor vertex in the kth view before submitting the anchor vertex in the k+1th view; If there is no path in the directed acyclic graph from the anchor vertex in the k+1th view to the anchor vertex in the kth view, the anchor vertex in the k+1th view is submitted.
[0083] In another possible implementation of the embodiment of the present application, the consensus of the anchor vertex in the k+1th view may include that the anchor vertex in the k+1th view does not meet the submission condition. At this time, the consensus module 1002 can be used to: When the anchor vertex in the k+1th view does not meet the submission condition, a k+2th submission unit is generated after the k+1th submission unit; wherein the proposal round of the k+2th submission unit is the decision round of the k+1th submission unit.
[0084] In another possible implementation of the embodiment of the present application, each submission unit generated based on three consecutive rounds may include multiple views in the directed acyclic graph, and the consensus module 1002 may also be used to: Anchor vertices from multiple views are submitted during each round of consensus.
[0085] When the above device is used to submit anchor vertices in multiple views in each round of consensus process, the consensus module 1002 can be specifically used to: A plurality of views included in each submission unit are represented as view mn by two digits, wherein view mn represents the mth view of the nth round, and the number of views generated in the directed acyclic graph is less than or equal to the number of the plurality of consensus nodes; After the anchor vertex in the m-th view of the n-th round is successfully submitted, consensus is reached on the anchor vertex in the m+1-th view of the n-th round; If the anchor vertex in the m+1th view of the nth round is successfully submitted, consensus is reached on the anchor vertex in the m+2th view of the nth round; If the anchor vertex in the m+1th view of the nth round is not successfully submitted, after pausing the consensus on the anchor vertices in the remaining views of the nth round, consensus is performed on the anchor vertex in the m+1th view of the n+2th round until the consensus on the anchor vertices in each view is completed.
[0086] In a possible implementation of the embodiment of the present application, the consensus module 1002 may also be used to: When an anchor vertex in any view of the n+2th round meets the submission condition and the anchor vertex that meets the submission condition has a path in the directed acyclic graph pointing to an anchor vertex in a view that was not successfully submitted in the nth round and is in a paused state, the anchor vertex in the view corresponding to the path in the nth round is resubmitted until the consensus of the anchor vertices in each view is reached.
[0087] In an embodiment of the present application, the submission condition that is satisfied for the anchor vertex in the kth view to be successfully submitted may be: the anchor vertex in the kth view obtains the support of at least f+1 consensus nodes in the voting round corresponding to the kth submission unit, where f is the number of malicious nodes among the multiple consensus nodes.
[0088] An embodiment of the present application provides a blockchain consensus device based on a directed acyclic graph. By applying the device, each step in the aforementioned method embodiments can be implemented.
[0089] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0090] Reference Fig.11 , shows a schematic diagram of a computer device provided by an embodiment of the present application. Fig.11 As shown, the computer device 1100 in the embodiment of the present application includes: a processor 1110, a memory 1120, and a computer program 1121 stored in the memory 1120 and executable on the processor 1110. When the processor 1110 executes the computer program 1121, the steps in each embodiment of the above-mentioned blockchain consensus method based on a directed acyclic graph are implemented, for example Figure 8 Alternatively, when the processor 1110 executes the computer program 1121, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig.10 Functions of modules 1001 to 1002 are shown.
[0091] Exemplarily, the computer program 1121 may be divided into one or more modules / units, which are stored in the memory 1120 and executed by the processor 1110 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 1121 in the computer device 1100. For example, the computer program 1121 may be divided into a determination module and a consensus module, and the specific functions of each module are as follows: A determination module, configured to determine an anchor vertex in a k-th view, wherein the k-th view corresponds to the k-th submission unit; A consensus module, configured to generate a k+1th submission unit in the k+1th view after the anchor vertex in the k-th view is successfully submitted; wherein the three consecutive rounds included in the k+1th submission unit are respectively a proposal round, a voting round and a decision round of the k+1th submission unit, the proposal round of the k+1th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
[0092] The computer device 1100 may be an electronic device for implementing the steps in the above-mentioned method embodiments, for example, the computer device 1100 may be a desktop computer, a cloud server, etc. The computer device 1100 may include, but is not limited to, a processor 1110 and a memory 1120. Those skilled in the art will understand that Fig.11 It is only an example of the computer device 1100 and does not constitute a limitation of the computer device 1100. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 1100 may also include input and output devices, network access devices, buses, etc.
[0093] The processor 1110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0094] The memory 1120 may be an internal storage unit of the computer device 1100, such as a hard disk or memory of the computer device 1100. The memory 1120 may also be an external storage device of the computer device 1100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 1100. Further, the memory 1120 may also include both an internal storage unit of the computer device 1100 and an external storage device. The memory 1120 is used to store the computer program 1121 and other programs and data required by the computer device 1100. The memory 1120 may also be used to temporarily store data that has been output or is to be output.
[0095] An embodiment of the present application further discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the methods described in the above embodiments are implemented.
[0096] The embodiments of the present application further disclose a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the methods described in the above embodiments are implemented.
[0097] The embodiments of the present application further disclose a computer program product, including a computer program. When the computer program is run on a computer, the computer is enabled to execute the methods described in the aforementioned embodiments.
[0098] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A blockchain consensus method based on directed acyclic graph, characterized in that: The directed acyclic graph is generated by the expansion of multiple consensus nodes in the blockchain in each round of consensus process, and each submission unit generated based on three consecutive rounds corresponds to each view in the directed acyclic graph; wherein each view is generated in each round, and the method includes: Determining an anchor vertex in a k-th view, wherein the k-th view corresponds to the k-th submission unit; After the anchor vertex in the k-th view is successfully submitted, a k+1-th submission unit is generated in the k+1-th view; wherein the three consecutive rounds included in the k+1-th submission unit are respectively a proposal round, a voting round and a decision round of the k+1-th submission unit, the proposal round of the k+1-th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
2. The method according to claim 1, characterized in that In the initial state, k=1, the first view coincides with the first submission unit, and the proposal round, voting round and decision round of the first submission unit are respectively the first round, the second round and the third round in the directed acyclic graph.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: If the anchor vertex in the k-th view is not successfully submitted, a k+2-th submission unit is generated after the k-th submission unit; wherein the proposal round of the k+2-th submission unit is the decision round of the k-th submission unit.
4. The method according to claim 3, characterized in that After generating a k+2th submission unit after the kth submission unit, the method further includes: Determine the anchor vertex in the k+2th view corresponding to the k+2th submission unit, and determine the consensus of the anchor vertex in the k+2th view; According to the consensus of the anchor vertices in the k+2th view, consensus is performed on the anchor vertices in the kth view that have not been successfully submitted.
5. The method according to claim 4, characterized in that The consensus of the anchor vertices in the k+2th view includes that the anchor vertices in the k+2th view meet a submission condition, and the consensus on the anchor vertices in the k+2th view that have not been successfully submitted is performed according to the consensus of the anchor vertices in the k+2th view, including: When the anchor vertex in the k+2th view satisfies the submission condition, confirming whether there is a path from the anchor vertex in the k+2th view to the anchor vertex in the kth view in the directed acyclic graph; If there is a path in the directed acyclic graph from the anchor vertex in the k+2th view to the anchor vertex in the kth view, submit the anchor vertex in the kth view before submitting the anchor vertex in the k+2th view; If there is no path in the directed acyclic graph from the anchor vertex in the k+2th view to the anchor vertex in the kth view, the anchor vertex in the k+2th view is submitted.
6. The method according to claim 4, characterized in that The consensus status of the anchor vertex in the k+2th view includes that the anchor vertex in the k+2th view does not satisfy a submission condition, and the consensus on the anchor vertex in the k+2th view that has not been successfully submitted is performed according to the submission status of the anchor vertex in the k+2th view, including: When the anchor vertex in the k+2th view does not meet the submission condition, a k+4th submission unit is generated after the k+2th submission unit; wherein the proposal round of the k+4th submission unit is the decision round of the k+2th submission unit.
7. The method according to any one of claims 1 or 2 or 4 to 6, characterized in that: Based on that each submission unit generated in three consecutive rounds includes multiple views in the directed acyclic graph, the method further includes: Anchor vertices from multiple views are submitted during each round of consensus.
8. The method according to claim 7, characterized in that The anchor vertices in multiple views are submitted during each round of consensus, including: A plurality of views included in each submission unit are represented as view mn by two digits, wherein view mn represents the mth view of the nth round, and the number of views generated in the directed acyclic graph is less than or equal to the number of the plurality of consensus nodes; After the anchor vertex in the m-th view of the n-th round is successfully submitted, consensus is reached on the anchor vertex in the m+1-th view of the n-th round; If the anchor vertex in the m+1th view of the nth round is successfully submitted, consensus is reached on the anchor vertex in the m+2th view of the nth round; If the anchor vertex in the m+1th view of the nth round is not successfully submitted, after pausing the consensus on the anchor vertices in the remaining views of the nth round, consensus is performed on the anchor vertex in the m+1th view of the n+1th round until the consensus on the anchor vertices in each view is completed.
9. The method according to claim 8, characterized in that After pausing consensus on the anchor vertices in the remaining views of the nth round, consensus is reached on the anchor vertices in the m+1th view of the n+1th round until consensus on the anchor vertices in each view is completed, including: When an anchor vertex in any view of the n+1th round meets the submission condition and the anchor vertex that meets the submission condition has a path in the directed acyclic graph pointing to an anchor vertex in a view that was not successfully submitted in the nth round and is in a paused state, the anchor vertex in the view corresponding to the path in the nth round is resubmitted until the consensus of the anchor vertices in each view is reached.
10. The method according to any one of claims 1 or 2 or 4 to 6 or 8 or 9, characterized in that: The submission condition that the anchor vertex in the k-th view is successfully submitted is that the anchor vertex in the k-th view obtains the support of at least f+1 consensus nodes in the voting round of the corresponding k-th submission unit, and f is the number of malicious nodes in the multiple consensus nodes.
11. A blockchain consensus device based on a directed acyclic graph, characterized in that: The directed acyclic graph is generated by the expansion of multiple consensus nodes in the blockchain in each round of consensus process, and each submission unit generated based on three consecutive rounds corresponds to each view in the directed acyclic graph. The device includes: A determination module, configured to determine an anchor vertex in a k-th view, wherein the k-th view corresponds to the k-th submission unit; A consensus module, configured to generate a k+1th submission unit in the k+1th view after the anchor vertex in the k-th view is successfully submitted; wherein the three consecutive rounds included in the k+1th submission unit are respectively a proposal round, a voting round and a decision round of the k+1th submission unit, the proposal round of the k+1th submission unit is the voting round of the k-th submission unit, and k is a positive integer.
12. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the computer device is caused to implement the method according to any one of claims 1 to 10.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the method according to any one of claims 1 to 10 is executed.
Citation Information
Patent Citations
Asynchronous Byzantine consensus method and system based on DAG
CN113923217A
Cluster change method and device, electronic equipment and computer readable storage medium
CN116723200A
Data synchronization method and device, electronic equipment and computer readable storage medium
CN116846916A
Block chain consensus achievement method and device based on directed acyclic graph
CN117478301A
Asynchronous network consensus method and device, electronic equipment and readable storage medium
CN117527266A
