CN115174565A - Consensus method and device based on block chain fragmentation technology - Google Patents

Consensus method and device based on block chain fragmentation technology Download PDF

Info

Publication number
CN115174565A
CN115174565A CN202210551188.3A CN202210551188A CN115174565A CN 115174565 A CN115174565 A CN 115174565A CN 202210551188 A CN202210551188 A CN 202210551188A CN 115174565 A CN115174565 A CN 115174565A
Authority
CN
China
Prior art keywords
node
consensus
nodes
fragment
weight
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
CN202210551188.3A
Other languages
Chinese (zh)
Other versions
CN115174565B (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.)
Beijing Jingan Yun Xin Technology Co ltd
State Grid Corp of China SGCC
State Grid Henan Electric Power Co Ltd
Information and Telecommunication Branch of State Grid Henan Electric Power Co Ltd
Original Assignee
Beijing Jingan Yun Xin Technology Co ltd
State Grid Corp of China SGCC
State Grid Henan Electric Power Co Ltd
Information and Telecommunication Branch of State Grid Henan Electric Power 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 Beijing Jingan Yun Xin Technology Co ltd, State Grid Corp of China SGCC, State Grid Henan Electric Power Co Ltd, Information and Telecommunication Branch of State Grid Henan Electric Power Co Ltd filed Critical Beijing Jingan Yun Xin Technology Co ltd
Priority to CN202210551188.3A priority Critical patent/CN115174565B/en
Publication of CN115174565A publication Critical patent/CN115174565A/en
Application granted granted Critical
Publication of CN115174565B publication Critical patent/CN115174565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a consensus method and a consensus device based on a block chain fragmentation technology, wherein the method comprises the following steps: acquiring the weight score of each node according to historical working information; according to the weight scores, randomly distributing corresponding fragments to each node in sequence; and carrying out consensus work in the segments by using a practical Byzantine fault-tolerant algorithm. According to the consensus method and device based on the block chain fragmentation technology, provided by the invention, based on the historical working information of the nodes, the behaviors of the nodes are scored to determine the weight scores of the nodes, then the corresponding fragments are randomly distributed to the nodes by using the weight scores, and the consensus work in the fragments is carried out through a practical Byzantine fault-tolerant algorithm, so that the safety of the node fragments is improved, and the transverse expansion of a block chain is effectively realized.

Description

Consensus method and device based on block chain fragmentation technology
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a consensus method and device based on a blockchain fragmentation technology.
Background
A Practical Byzantine Fault-tolerant algorithm (PBFT) is a widely used consensus algorithm in a federation chain, and is well balanced in terms of security and fairness, but can only exert good performance in networks with a small number of network nodes. With the continuous addition of the nodes, the consensus efficiency is gradually reduced, and the lateral expansibility is not available.
The fragmentation technology originally originated from the application of the database and is used for the horizontal expansion of the database, and the technology can also be applied to a block chain, so that a possible solution is provided for the horizontal expansion of the block chain.
However, the existing node fragmentation method has poor safety, and the transverse expansion of the block chain is difficult to be effectively realized.
Disclosure of Invention
The invention provides a consensus method based on a block chain fragmentation technology, which is used for solving the defect of poor safety in the prior art.
In a first aspect, the present invention provides a consensus method based on a blockchain fragmentation technology, including: acquiring the weight score of each node according to historical working information; according to the weight scores, randomly distributing corresponding fragments to each node in sequence; and carrying out intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
According to the consensus method based on the block chain fragmentation technology provided by the invention, the corresponding fragments are sequentially randomly distributed to each node according to the weight scores, and the consensus method comprises the following steps: acquiring a fragment list to be selected; the number of nodes of each fragment in the list of fragments to be selected is the least among all the fragments; and randomly selecting one fragment from the to-be-selected fragment list as the fragment of the node.
According to the consensus method based on the blockchain fragmentation technology provided by the invention, under the condition that the nodes are honest nodes, the weight score of each node is obtained according to the historical work information, and the consensus method comprises the following steps: and determining the honest node weight fraction by using a sigmoid function according to the historical working information.
According to the consensus method based on the blockchain fragmentation technology provided by the invention, under the condition that the node is a fault node, the obtaining of the weight score of each node according to the historical working information comprises the following steps: setting the weight fraction of the fault node which does not react to the consensus information as a preset threshold value; the preset threshold is determined based on the sigmoid function.
According to the consensus method based on the block chain fragmentation technology provided by the invention, under the condition that the nodes are honest nodes, the weight score of each node is obtained according to the historical working information, and the consensus method comprises the following steps: the weight score of a malicious node that erroneously reacts to consensus information is set to zero.
According to the consensus method based on the block chain fragmentation technology provided by the invention, before the mutual consensus work in the fragments is carried out by using a practical Byzantine fault-tolerant algorithm, the method further comprises the following steps: selecting nodes from the fragments according to the weight scores to form a candidate node set; and based on a stock right equity certification algorithm, determining leader nodes of the fragments from the candidate node set so as to perform intra-fragment consensus work by utilizing a practical Byzantine fault-tolerant algorithm.
In a second aspect, the present invention further provides a consensus device based on the blockchain fragmentation technology, including: the system comprises a weight score acquisition module, a fragment distribution module and a fragment internal consensus module;
the weight score acquisition module is used for acquiring the weight score of each node according to the historical working information;
the fragment distribution module is used for sequentially and randomly distributing corresponding fragments to each node according to the weight fraction;
and the intra-fragment consensus module is used for performing intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the consensus method based on the blockchain fragmentation technique as described in any one of the above.
In a fourth aspect, the present invention further provides a non-transitory computer readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the consensus method based on the blockchain fragmentation technique as described in any of the above.
In a fifth aspect, the present invention also provides a computer program product comprising a computer program, which when executed by a processor, implements the consensus method based on blockchain fragmentation as described in any of the above.
According to the consensus method and device based on the block chain fragmentation technology, the behavior of the nodes is scored based on the historical work information of the nodes to determine the weight scores of the nodes, the corresponding fragments are randomly distributed to the nodes by using the weight scores, and the consensus work in the fragments is carried out through a practical Byzantine fault-tolerant algorithm, so that the safety of the node fragments is improved, and the transverse expansion of a block chain is effectively realized.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a consensus method based on a blockchain fragmentation technique according to the present invention;
FIG. 2 is a schematic diagram of a weight score reward strategy for nodes provided by the present invention;
FIG. 3 is a diagram illustrating the consensus throughput for different blockchain fragmentation schemes provided by the present invention;
fig. 4 is a schematic structural diagram of a consensus device based on the blockchain fragmentation technique according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that in the description of the embodiments of the present invention, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
In the invention, a main chain is used for processing the transaction of each fragment and the weight adjustment of the whole node. Based on this, the present invention divides nodes into four categories: (1) the leader node: the node is selected by pushing and is responsible for publishing the pre-preparation information in the fragment by consensus and publishing and writing the result of consensus in the fragment into the block chain; (2) honest nodes: the device is responsible for consensus work in the fragments and can make correct response to the consensus information; (3) malicious nodes: the system comprises a fault node in the system and a node which is controlled by an enemy and responds to the consensus information in error; and (4) a supervision node: and (4) not participating in the consensus process, and recording the consensus process and the result every time.
The transaction in each fragment is firstly identified and voted by all nodes in the fragment, then the leader node of each fragment carries out one-time identification again on the transaction in the fragment which has achieved the identification, and finally the identification result is linked; the weight score of each node is commonly maintained by all nodes, and the weight score of a node consists of two parts: firstly, the node pair makes the sum of effective work on the consensus result; second is the frequency of the operation.
The distribution of the fragments and the selection of the leader node in the fragments are selected according to the weight scores of the nodes. The update time of the node weight fraction is much longer than the transaction consensus update time, for example, after tens of transaction consensus updates, the node weight update is performed once, and a reputation quick consensus is generated on the chain.
And after one consensus update, carrying out once node reallocation simultaneously. Reducing the update frequency of the node weight can reduce the impact of frequent re-fragmentation on system performance.
The following describes a consensus method and apparatus based on blockchain fragmentation provided by embodiments of the present invention with reference to fig. 1-5.
Fig. 1 is a schematic flow chart of a consensus method based on a blockchain fragmentation technique provided in the present invention, as shown in fig. 1, including but not limited to the following steps:
step 101: and acquiring the weight score of each node according to the historical working information.
In order to ensure the safety and reliability of the whole fragmentation scheme, the acquisition of the weight scores of the nodes is an important part of the method provided by the invention.
The invention can score and evaluate the node work through the weight scores based on the node consensus behavior generated by each node during the previous work, namely historical work information.
Optionally, for honesty of the nodes, the weight scores of the nodes are increased to be used as rewards; for the dishonest behavior of a node, the weight score is reduced as a penalty. In this way, the weight scores of the nodes may be set.
Alternatively, the punishment for the dishonest behavior of the node is greater than the incentive for the dishonest node, for example, if the node submits misleading consensus results in consensus, it may lose all weight accumulation, because the dishonest behavior may cause devastating results to the entire blockchain system.
Step 102: and according to the weight scores, randomly distributing corresponding fragments to each node in sequence.
After determining the weight scores of the nodes, the fragmentation strategies of the nodes can be further designed according to the weight scores.
Optionally, the invention may perform descending order arrangement on all the nodes according to the weight scores, and then randomly allocate the corresponding fragments to each node in sequence.
It should be noted that, in order to ensure security, in the process of allocating a fragment to each node, randomness of allocation may be ensured by introducing a random factor.
Step 103: and carrying out intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
After the segmentation is performed through the weight fraction, the invention adopts a Practical Byzantine Fault Tolerance (PBFT) algorithm as a consensus algorithm. The PBFT algorithm achieves a good balance between security and fairness. After receiving the consensus information transmitted by the client, the main node (leader node) verifies whether both transaction parties are in the sub-slices of the main node, and after verification is successful, intra-slice consensus is performed, and a consensus consistency protocol is described as follows:
(1) PRE-PREPAR stage: the leader node receives the PRE-PREPARE message sent by the client and broadcasts the message to all nodes participating in the consensus.
(2) The PREPARE stage: after receiving the PRE-PREPARE message sent by the leader node, the slave node generates a PREPARE message and selectively broadcasts the PREPARE message to the nodes in the own consensus domain. If more than 2f +1 correct prepare messages are received, the COMMIT phase is entered. Where f is the maximum number of byzantine nodes that the network can tolerate.
(3) A COMMIT phase: the nodes generate and broadcast the COMMIT messages to the nodes in the consensus domain, the other nodes verify the COMMIT messages, and the nodes complete 2f +1 COMMIT messages and then perform REPLY stage.
(4) A REPLY stage: after f +1 identical REPLY messages are collected by the client, the client can confirm that the messages are identified, and can write the messages on the block chain.
According to the consensus method based on the block chain fragmentation technology, provided by the invention, based on the historical work information of the nodes, the behaviors of the nodes are scored to determine the weight scores of the nodes, then the corresponding fragments are randomly distributed to the nodes by using the weight scores, and the consensus work in the fragments is carried out through a practical Byzantine fault-tolerant algorithm, so that the safety of the node fragments is improved, and the transverse expansion of a block chain is effectively realized.
Based on the content of the foregoing embodiment, as an alternative embodiment, a method for obtaining the weight score of each node according to the historical work information is described below.
Aiming at the reward of honest nodes, strategies of careful start, quick reward and smooth end are adopted. Fig. 2 is a schematic diagram of a node weight score reward strategy provided by the present invention, as shown in fig. 2, the ordinate represents the weight score of the node, and the abscissa represents the time of continuous honest work.
The node does honest work in the first few epochs, but at this time it cannot be completely determined that it must be an honest and reliable node, i.e. an honest node, so the accumulation of the weight scores at the beginning of the work can be slow, i.e. the careful start strategy is adopted. However, if the time of continuous honest work of the node exceeds the initial set threshold, the credibility of the node can be basically determined, and a weight reward can be quickly provided for the node, so that the node plays an important role in the next work, namely, a quick reward strategy is adopted. But the system will immediately clear its weight score if it has made the wrong work in the following work. After the weight scores of the nodes are accumulated to a sufficient height (for example, the weight scores are more than 0.95), a strategy of 'smooth end' is adopted for rewarding the nodes, and in order to prevent the phenomenon that the weight scores are uneven due to the fact that the scores of certain honest nodes are too high. The following formula is therefore taken as the weight score reward strategy for honest nodes:
WS i =α*sigmoid(β*T i )
wherein WS i A weight score representing node i; α is the maximum weight fraction, α =1 in the present invention; beta is a parameter for adjusting quick forward strategy starting and can be set according to actual needs; t is i The time for the node i to continuously honestly work.
As can be seen from the above-described weight score calculation method, the weight score can be calculated for each node using the historical operation information.
In the invention, the accumulated scores can be kept only by the correct work of the nodes, and for the fault nodes which do not react to the consensus information, the weight scores of the fault nodes are reduced to a preset threshold value, so that the reasonable right of the fault nodes after fault recovery is ensured. The preset threshold is a weight score corresponding to the quick reward strategy when the quick reward strategy is started.
Optionally, for a malicious node, once it makes an incorrect reaction to the consensus information, its weight score is cleared, so as to prevent it from destroying the consensus in subsequent work.
Based on the content of the foregoing embodiment, as an optional embodiment, sequentially randomly allocating a corresponding segment to each node according to the weight score includes: acquiring a fragment list to be selected; the number of nodes of each fragment in the to-be-selected fragment list is the least in all fragments; and randomly selecting one fragment from the to-be-selected fragment list as the fragment of the node.
It should be noted that, in the process of matching the corresponding segment to each node. The following three objectives need to be met: firstly, each node is guaranteed to be allocated to one fragment and can be allocated to only one fragment; secondly, to ensure that the allocation policy of a node is unpredictable, if a node can make an attacker guess that it will be allocated to that fragment before allocation, it is very dangerous, so the present invention introduces a random factor in the allocation process to ensure that the allocation process is random; thirdly, each fragment is ensured to be similar, that is, the sum of the weight scores of the nodes in the fragment is approximately equal, which is to prevent that the unreasonable distribution of the fragment nodes results in that almost all the fragments are faulty nodes or malicious nodes, and finally the common knowledge of the fragments is destroyed.
The following is a brief description of a pseudo code flow of the weight score based node assignment algorithm of the present invention.
Step 1, initializing relevant parameters.
And 2, sequencing the weight scores of the nodes, wherein WS' = sort (WS).
And 3, executing the following operation steps for each node i (the value range of i is 1 to n) which is sequenced according to the weight fraction:
step 3.1, obtaining a fragment list S' = { S ] to be selected 1 ’,s 2 ’,…,s j ' }, wherein j slices in the to-be-selected slice list S ' all meet the condition that the number of nodes in the to-be-selected slice list S ' is the least in all slices;
step 3.2, obtaining the random number r corresponding to the node i by utilizing the random number generation function Rg () and the system time t i =Rg(t);
Step 3.3, selecting the fragment s from the list of fragments to be selected c ' as a fragment of node i, where c = r i % j, "%" are the remaining symbols.
Note that WS = { WS) in step 2 above 1 ,ws 2 ,…,ws n And the sort () is a sorting function, the WS can be sorted from large to small, and then the nodes are sorted, and the WS' represents the sorted set of the weight scores.
The final fragmentation scheme can be formed by allocating fragments to each node through the algorithm process, and a set S = { S } containing k fragments is obtained 1 ,s 2 ,…,s k }。
The node distribution strategy based on the weight scores determines the slicing positions of the nodes according to the weight scores of the nodes and the random numbers based on the system time. The nodes are sorted in descending order according to the updated weight scores, and the node with the highest weight score is distributed first each time.
For each node, first, each fragment in the to-be-selected fragment list S 'and S' is obtained, and the number of nodes in each fragment is the least among all fragments. Therefore, the nodes with similar scores are not distributed to the same fragment area, and the overall scores of all the fragments are kept similar as a whole.
Then, a random number is obtained, and the slicing position of the node is selected according to the random number to prevent the node from being predicted. By such an approach, three design goals of the node allocation strategy are met.
Based on the content of the foregoing embodiment, as an optional embodiment, the consensus method based on the blockchain fragmentation technique provided by the present invention further includes, before performing intra-fragment consensus work by using a practical byzantine fault-tolerant algorithm: selecting nodes from the fragments according to the weight scores to form a candidate node set; and based on a stock right equity certification algorithm, determining leader nodes of the fragments from the candidate node set so as to perform intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
Similar to the fragmentation process, the selection of the leader node is also an important factor for ensuring the safety and feasibility of the whole fragmentation consensus scheme. Because the leader node is responsible for more responsibility than other nodes, and once a malicious node is selected as the leader node, the malicious node can tamper with the consensus information and write the wrong consensus information on the chain, which is fatal to the whole system. Therefore, it is very important to guarantee the credibility of the leader node, and the following factors are also satisfied: (1) randomness is also needed for the selection of the leader node, and is the same as the fragmentation rule, so that the enemy is prevented from directionally attacking the preselected nodes for fair rights of all trusted nodes; (2) the variability is different from the situation that the re-fragmentation is carried out after a plurality of times of transaction consensus in the fragmentation rule, and the leader node needs to reselect once before each time of transaction consensus so as to further ensure the safety in the consensus process in the fragmentation; (3) the fairness can give more opportunities to the nodes with high weight scores to become leader nodes, and meanwhile, the node weight updating scheme ensures that the weight scores of honest nodes do not differ much, so that the phenomenon of overlarge single node rights can not be caused.
Therefore, the invention adopts a Proof of equity (Proof of stamp, poS) algorithm as an algorithm for selecting the leader node. Meanwhile, in order to ensure that the malicious node is not selected to become the leader node, before the leader node is selected by utilizing a PoS algorithm, the method carries out node pretreatment for the first time.
Optionally, the nodes in the fragments are arranged in a descending order according to the weight fraction, then the nodes of the last 1/3 are screened out, and the remaining nodes form a candidate node set of the leader node. And finally, picking out the leader node of the fragment from the candidate node set by using a PoS algorithm.
After the leader node of the segment is confirmed, the PBFT algorithm can be used for intra-segment consensus.
In order to prove the superiority of the present invention, experimental analysis is performed on the consensus method based on the block chain fragmentation technology, which may also be referred to as a dynamic weight-based byzantine fault-tolerant consensus algorithm (abbreviated as DWS _ BFT).
The experimental process mainly tests the throughput of the algorithm and the safety of the algorithm, compares the algorithm with some current fragmentation algorithms, and analyzes the effectiveness of DWS _ BFT.
Because each committee parallel processing transaction in the section block chain, committee quantity is along with the node number increase and constantly increase, consequently section block chain has horizontal expansibility, will verify in the experiment whether DWS _ BFT has horizontal expansibility to compare with current section algorithm.
The safety is an important characteristic and a basic requirement of a block chain, the proportion of various nodes in the improved algorithm can be analyzed in an experiment, and meanwhile, the safety of a single committee can also be analyzed, and the anti-attack capability of the algorithm can be verified. The experiment simulates a multi-node network environment through one server, and the test system is Ubuntu18.04.
Firstly, the throughput of the algorithm is tested, the nodes are divided into a plurality of fragments in DWS _ BFT, and in the test, the size of a single fragment is set to be 50 nodes. The throughput performance of different consensus algorithms under 50, 100, 150, 200 and 250 nodes is tested experimentally. The experiment measures the performance of the consensus algorithm using an average throughput over 1 minute, preventing accidental situations.
Fig. 3 is a schematic diagram of consensus throughput of different blockchain fragmentation schemes provided by the present invention, and it can be seen from fig. 3 that the throughput of omnilegger using a fragmentation technique and a dynamic weight-based byzantine fault-tolerant consensus algorithm (DWS _ BFT) increases with the increase of the number of nodes, and the average throughput of the PBFT algorithm decreases with the increase of the number of nodes, which shows that the consensus algorithm has scalability after using a fragmentation technique, and the fragmentation technique can greatly improve the performance of the consensus algorithm. The average throughput of DWS _ BFT in one minute is higher than OmniLedger, which shows that DWS _ BFT can more fully utilize the computing resources of each node.
The following experiment observed the proportion of correct nodes in different consensus algorithms when errors occurred under continuous operation. In the experiment, the number of correct nodes when the system fails is set under the condition that the network initially has 50, 100, 150, 200 and 250 nodes and gradually takes the correct nodes off line. The proportion of correct nodes when errors occur in PBFT and DWS _ BFT is about 2/3, and Omni Ledger is about 1/2. This proves that the dynamic weight rule can ensure that the proportion of the correct node in each fragment is close to the total proportion of the correct node in the network, and is due to other fragmentation schemes. Therefore DWS _ BFT is able to resist adversary attacks with adaptation capability.
In summary, the consensus method based on the blockchain fragmentation technology provided by the present invention has the following advantages: it achieves both scalability and robustness. The DWS _ BFT updates the node weight fraction according to the continuous and correct working condition of the node, reasonably selects the node to different fragments according to the weight fraction to achieve the balance among the fragments, and ensures the robustness of the fragment system. The transaction is processed by each fragment in parallel to realize the lateral expansibility and improve the performance of the consensus algorithm.
Fig. 4 is a schematic structural diagram of a consensus apparatus based on blockchain fragmentation technology provided in the present invention, as shown in the figure, the apparatus includes: a weight score obtaining module 401, a fragment distributing module 402, and a fragment internal consensus module 403.
The weight score obtaining module 401 is configured to obtain a weight score of each node according to historical work information;
the fragment distribution module 402 is configured to sequentially distribute corresponding fragments to each node randomly according to the weight scores;
and a piece internal consensus module 403, configured to perform piece internal consensus work by using a practical byzantine fault-tolerant algorithm.
The consensus device based on the block chain fragmentation technology provided by the invention scores the behavior of the nodes based on the historical work information of the nodes to determine the weight scores of the nodes, randomly distributes the corresponding fragments for the nodes by using the weight scores, and performs consensus work in the fragments by using a practical Byzantine fault-tolerant algorithm, thereby improving the safety of the node fragments and effectively realizing the transverse expansion of the block chain.
It should be noted that, in the consensus device based on the blockchain fragmentation technology provided in the embodiment of the present invention, during specific operation, the consensus method based on the blockchain fragmentation technology described in any of the above embodiments may be performed, which is not described in detail in this embodiment.
Fig. 5 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor) 510, a communication Interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 530 communicate with each other via the communication bus 540. The processor 510 may invoke logic instructions in the memory 530 to perform a consensus method based on blockchain fragmentation, the method comprising: acquiring the weight score of each node according to historical working information; according to the weight fraction, randomly distributing corresponding fragments for each node in sequence; and carrying out consensus work in the segments by using a practical Byzantine fault-tolerant algorithm.
In addition, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer, the computer can execute the consensus method based on the blockchain slicing technique provided by the above methods, the method includes: acquiring the weight score of each node according to historical working information; according to the weight scores, randomly distributing corresponding fragments to each node in sequence; and carrying out consensus work in the segments by using a practical Byzantine fault-tolerant algorithm.
In yet another aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the consensus method based on blockchain fragmentation provided in the foregoing embodiments, the method including: acquiring the weight score of each node according to historical working information; according to the weight scores, randomly distributing corresponding fragments to each node in sequence; and carrying out intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A consensus method based on a blockchain fragmentation technique is characterized by comprising the following steps:
acquiring the weight score of each node according to historical working information;
according to the weight fraction, randomly distributing corresponding fragments for each node in sequence;
and carrying out intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
2. The method according to claim 1, wherein the randomly assigning the corresponding segment to each node in turn according to the weight score comprises:
acquiring a fragment list to be selected; the number of nodes of each fragment in the list of fragments to be selected is the least among all the fragments;
and randomly selecting one fragment from the to-be-selected fragment list as the fragment of the node.
3. The consensus method for blockchain fragmentation based on claim 1, wherein the obtaining the weight score of each node according to the historical working information in case that the node is an honest node comprises:
and determining the honest node weight fraction by using a sigmoid function according to the historical working information.
4. The method according to claim 3, wherein in the case that the node is a failed node, the obtaining the weight score of each node according to the historical operating information includes:
setting the weight fraction of the fault node which does not react to the consensus information as a preset threshold value; the preset threshold is determined based on the sigmoid function.
5. The consensus method for blockchain fragmentation based on claim 1, wherein the obtaining the weight score of each node according to the historical working information in case that the node is an honest node comprises:
the weight score of a malicious node that erroneously reacts to consensus information is set to zero.
6. The consensus method of claim 1, further comprising, before performing intra-segment consensus using a practical Byzantine fault-tolerant algorithm:
selecting nodes from the fragments according to the weight scores to form a candidate node set;
and based on a stock right equity certification algorithm, determining leader nodes of the fragments from the candidate node set so as to perform intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
7. A consensus device based on blockchain fragmentation is characterized by comprising:
the weight score acquisition module is used for acquiring the weight score of each node according to the historical working information;
the fragment distribution module is used for sequentially and randomly distributing corresponding fragments to each node according to the weight fraction;
and the intra-fragment consensus module is used for performing intra-fragment consensus work by using a practical Byzantine fault-tolerant algorithm.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the consensus method based on block chain fragmentation technique of any one of claims 1 to 6 when executing the computer program.
9. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the consensus method based on blockchain fragmentation technique as claimed in any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program when executed by a processor implements the method for consensus on blockchain fragmentation technique of any of claims 1 to 6.
CN202210551188.3A 2022-05-18 2022-05-18 Consensus method and device based on block chain slicing technology Active CN115174565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210551188.3A CN115174565B (en) 2022-05-18 2022-05-18 Consensus method and device based on block chain slicing technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210551188.3A CN115174565B (en) 2022-05-18 2022-05-18 Consensus method and device based on block chain slicing technology

Publications (2)

Publication Number Publication Date
CN115174565A true CN115174565A (en) 2022-10-11
CN115174565B CN115174565B (en) 2023-08-15

Family

ID=83483043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210551188.3A Active CN115174565B (en) 2022-05-18 2022-05-18 Consensus method and device based on block chain slicing technology

Country Status (1)

Country Link
CN (1) CN115174565B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040305A (en) * 2018-09-10 2018-12-18 浙江天脉领域科技有限公司 Block chained record method based on heterogeneous hierarchical dynamic topology fragment
CN110677485A (en) * 2019-09-30 2020-01-10 大连理工大学 Dynamic layered Byzantine fault-tolerant consensus method based on credit
CN112487091A (en) * 2020-12-02 2021-03-12 深圳前海微众银行股份有限公司 Method and device for determining block chain consensus node
CN113037504A (en) * 2021-05-28 2021-06-25 北京邮电大学 Node excitation method and system under fragment-based unauthorized block chain architecture
CN113422661A (en) * 2021-04-30 2021-09-21 海南大学 Credible broadband spectrum sensing method based on active and passive credibility division
US20210350891A1 (en) * 2020-01-15 2021-11-11 Ledgerdomain Inc Secure Messaging in a Machine Learning Blockchain Network
CN113793209A (en) * 2021-09-01 2021-12-14 浙江数秦科技有限公司 Intelligent litigation system based on block chain
CN114003584A (en) * 2021-11-02 2022-02-01 贵州大学 Byzantine fault-tolerant consensus method based on evolutionary game

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040305A (en) * 2018-09-10 2018-12-18 浙江天脉领域科技有限公司 Block chained record method based on heterogeneous hierarchical dynamic topology fragment
CN110677485A (en) * 2019-09-30 2020-01-10 大连理工大学 Dynamic layered Byzantine fault-tolerant consensus method based on credit
US20210350891A1 (en) * 2020-01-15 2021-11-11 Ledgerdomain Inc Secure Messaging in a Machine Learning Blockchain Network
CN112487091A (en) * 2020-12-02 2021-03-12 深圳前海微众银行股份有限公司 Method and device for determining block chain consensus node
CN113422661A (en) * 2021-04-30 2021-09-21 海南大学 Credible broadband spectrum sensing method based on active and passive credibility division
CN113037504A (en) * 2021-05-28 2021-06-25 北京邮电大学 Node excitation method and system under fragment-based unauthorized block chain architecture
CN113793209A (en) * 2021-09-01 2021-12-14 浙江数秦科技有限公司 Intelligent litigation system based on block chain
CN114003584A (en) * 2021-11-02 2022-02-01 贵州大学 Byzantine fault-tolerant consensus method based on evolutionary game

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王群、李馥娟、倪雪莉、夏玲玲、王振力: ""区块链共识算法及应用研究"", 《计算机科学与探索》, vol. 16, no. 6, pages 1214 - 1242 *
蔡婷、林晖、陈武辉、郑子彬、余阳: ""区块链赋能的高效物联网数据激励共享方案"", 《软件学报》, vol. 32, no. 4, pages 953 - 972 *

Also Published As

Publication number Publication date
CN115174565B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
Vastel et al. Fp-stalker: Tracking browser fingerprint evolutions
CN110049029B (en) Consensus node determination method, device, computer equipment and storage medium
CN111026578B (en) Intelligent contract security detection method based on prophetic machine
CN111131209B (en) Improved efficient consensus method, system, computer device and storage medium
Panconesi et al. Fast hare: A fast heuristic for single individual SNP haplotype reconstruction
CN112003942B (en) Method, system, node device and storage medium for responding to link-down data request
CN109819022A (en) A kind of block chain common recognition method based on credit appraisal
CN110796547A (en) Improved practical Byzantine fault-tolerant system based on alliance block chain
CN110673914B (en) View switching method for block chain consensus and block chain system
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN112968883B (en) Block chain heterogeneous consensus method with high safety and terminal
CN111478970A (en) Power grid Web application mimicry defense system
CN113660125B (en) Consensus method and device based on random trusted committee
CN107426148B (en) Crawler-resisting method and system based on running environment feature recognition
CN112738172B (en) Block chain node management method and device, computer equipment and storage medium
CN111786946B (en) Mimicry cloud service heterogeneous execution body scheduling method and device
CN113422782A (en) Cloud service vulnerability analysis method and artificial intelligence analysis system based on big data
CN112003941A (en) Method, system, node device and storage medium for distributing downlink data request
CN111414420A (en) Improved PBFT block chain consensus method
CN113407951A (en) Cloud service vulnerability repairing method based on artificial intelligence and big data analysis system
CN115796261A (en) Block chain-based lightweight group consensus federated learning method
CN113259179A (en) Byzantine fault-tolerant consensus method and system based on node scoring
CN112398949A (en) Transaction confirmation method, system, device and computer equipment
CN114143060B (en) Information security prediction method based on artificial intelligence prediction and big data security system
CN115022326A (en) Block chain Byzantine fault-tolerant consensus method based on collaborative filtering recommendation

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