CN114844891B - Block chain consensus method and system based on Raft algorithm - Google Patents

Block chain consensus method and system based on Raft algorithm Download PDF

Info

Publication number
CN114844891B
CN114844891B CN202210420723.1A CN202210420723A CN114844891B CN 114844891 B CN114844891 B CN 114844891B CN 202210420723 A CN202210420723 A CN 202210420723A CN 114844891 B CN114844891 B CN 114844891B
Authority
CN
China
Prior art keywords
leader
candidate
node
log
follower
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210420723.1A
Other languages
Chinese (zh)
Other versions
CN114844891A (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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202210420723.1A priority Critical patent/CN114844891B/en
Publication of CN114844891A publication Critical patent/CN114844891A/en
Application granted granted Critical
Publication of CN114844891B publication Critical patent/CN114844891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • 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
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • H04L2209/463Electronic voting
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a block chain consensus method and a system based on a Raft algorithm, which belong to the technical field of block chain consensus, and solve the technical problem that the damage caused by wrongly doing nodes cannot be avoided, the potential safety hazard that the original Raft algorithm possibly causes splitting due to cluster expansion is eliminated, and the adopted technical scheme is as follows: newly adding observer nodes on the basis of leader, follower and candidate nodes, and setting random timeout time for all nodes except the observer nodes by the initial state of the cluster; during the leader election process, the observer monitors the candidate, identifies whether the candidate is a bad node, and has final decision rights for the leader generation; when the leader generates, performing log replication RPC information on all nodes including observers, wherein the observers do not feed back information; during a cluster change, the watcher sends a new log entry to the leader, which broadcasts the new log entry and places the new log entry into the local state machine.

Description

Block chain consensus method and system based on Raft algorithm
Technical Field
The invention relates to the technical field of block chain consensus, in particular to a block chain consensus method and system based on a Raft algorithm.
Background
Blockchains are novel application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. Blockchain (Blockchain) is essentially a de-centralized database, a string of data blocks that are generated in association using cryptographic methods, for verifying the validity of its information (anti-counterfeiting) and generating the next block.
Currently, common mechanisms for blockchain include the POW mechanism, the POS mechanism, and the DPOS mechanism. The above mechanisms have drawbacks in terms of resource consumption, security and consensus time. For example, the resource consumption of the POW mechanism is large, the whole network is required to participate in the operation together each time the consensus is achieved, a certain computing time is required to be consumed, and the performance efficiency is low; the POS mechanism and DPOS mechanism determine the probability of generating a block based on the weight held by the user, but do not maintain the ecology and security of the blockchain system itself.
The Lift algorithm is a consistency consensus algorithm, emphasizes that the lift algorithm is easy to understand, is easy to engineer and realize, and has the advantages of high efficiency and the like. The Raft algorithm achieves consistency by electing the leader, who then sends heartbeat messages and log replication. However, the traditional Raft algorithm can only tolerate fault nodes and cannot avoid the damage caused by disqualified nodes, so that if the disqualified nodes appear in the cluster, the performance is seriously affected by using the traditional Raft algorithm, and the security of the system is seriously damaged even under the disturbance of the disqualified nodes.
The traditional Raft algorithm also shows a little debilitation on cluster expansion, and as the leader obtains most votes, the leader can split during expansion, so that the instability of system operation is increased.
Disclosure of Invention
The invention aims to provide a block chain consensus method and system based on a Raft algorithm, which are used for solving the problem that the damage caused by bad nodes cannot be avoided and eliminating the potential safety hazard of splitting possibly caused by cluster expansion of the original Raft algorithm.
The invention aims to realize a block chain consensus method based on a Raft algorithm, which is to newly add observer nodes on the basis of leader, follower and candidate nodes, wherein the initial state of a cluster sets random timeout time for all nodes except the observer nodes; during the leader election process, the observer monitors the candidate, identifies whether the candidate is a bad node, and has final decision rights for the leader generation; when the leader generates, performing log replication RPC information on all nodes including observers, wherein the observers do not feed back information; during a cluster change, the watcher sends a new log entry to the leader, which broadcasts the new log entry and places the new log entry into the local state machine.
Preferably, the method is specifically as follows:
cluster initialization: initially except for an inherent viewpoint N 0 All nodes are followers, except;
electing a leader: triggering a request voting RPC of a candidate to perform leader election through the fact that the follower does not receive heartbeat information;
identifying a bad node: performing disfiguring node identification on the candidate when the candidate initiates the request voting RPC so as to relieve performance pressure and ensure cluster security;
replication log: the log consists of a plurality of log items, each log item consists of an instruction, an index value and an tenure number, and the form is as follows:
the above formula indicates that the log is composed of a plurality of log entries; journal (Journal) i Representing a log;representing log entries; />Representing the index value; termNum j Representing the tenn number; />Representing an instruction;
with respect to member changes.
Preferably, the follower is adapted to receive and process messages from the leader, when the leader heartbeat information T 0 Recommending the candidate to be the user when the time is out; the follower node is in the form of: n (N) i <Node i ,TermNum j ,T i ,Vote i ,Journal i >The method comprises the steps of carrying out a first treatment on the surface of the Wherein,1≤i≤n;j=0,1,2…;Vote i =0, 1; n is the number of nodes in the initial state cluster; journal (Journal) i Is a log; vote i Initial value is 1, T i A random timeout time set for each follower node;
The candidate is used for sending a request voting RPC message to other nodes and becomes a leader when winning most votes;
the leader is used for processing the write request, managing log replication and sending heartbeat information T 0 At the same time, only one leader can exist in the cluster;
the observer is used for identifying whether the candidate is a wrongly-used node when the candidate initiates the request voting RPC and assisting the cluster capacity expansion; wherein, the observer is regarded as a trusted node, and the form is: w (W)<TermNum j+1 ,Wvote,Journal j+1 >The method and the device have the advantages that the unreliability of the role of the observer caused by the problem of the observer is avoided, so that the stability of the system is improved, and the damage of external attack to the system is reduced; the TermNum of the W node and the catalog item of the Journal synchronous leader have the Wvot initial value of 1, and when judging the candidate C i To disqualify a node, it is set to 0.
Preferably, the election leader is specifically as follows:
no leader in the initial cluster, when the timeout time T of any node i First arrive and no heartbeat information T from the leader is received in the process 0 Will make its own tendiness number TermNum j Adding one to make oneself become candidate C i <i,Votes,TermNum j+1 ,Journal i >The method comprises the steps of carrying out a first treatment on the surface of the Casting a vote to oneself and initiating request voting RPC to all other nodes, the formula is as follows:
TermNum j+1 =TermNum j +1;
Votes=0+1;
Wherein, termNum j Representing the last tenn number, and the default value is 0; votes default value of 0, when one follower N i Become candidate C i Later, votes will acquire the data from C i I.e. self-increasing one;
when other followers receive voting requests from nodes with larger tenninal numbers and do not vote within the tenninal numbers of the candidates, the follower nodes will cast the votes to the candidate nodes initiating the request for voting RPC message, and then the voted followers self-increment their tenninal numbers to be consistent with the voted candidates, concretely as follows:
Votes+Vote b
Vote b =0;
C a <a,Votes,TermNum j+1 ,Journal a >representing a candidate; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b >Representing follower nodes; votes+Vote b Representing the follower voting on the candidate; vote b Representing a vote owned by a follower; the method comprises the steps that a candidate initiates a request voting RPC to a follower, the follower votes on the candidate, and the follower vote is emptied;
if a candidate node C i <i,Votes,TermNum j+1 >At a timeout time T i Internally win Big size Most votes will become the new leader L in the period number, i.e. the period of the present period, after the observer votes are obtained i The formula is as follows:
the above indicates that the election time cannot exceed a timeout periodAll votes obtained by the candidates must be greater than 50% of the number of all follower nodes and votes for the observer nodes must be obtained; votes represents the number of Votes currently obtained for the candidate; vote i A vote representing a follower of the vote; t represents the time of election; t (T) i Representing a timeout period; n represents the number of follower nodes; wvot represents the vote of the observer node;
when the new leader is selected, it will take the form of T i And sending heartbeat information periodically in time to prevent other nodes from initiating new elections.
Preferably, the election rule is specifically as follows:
(1) periodically sending heartbeat information to all nodes by the leader during the period of the discretion to inform the follower and the observer of the identity of the leader, and preventing the follower from becoming a new round of election initiated by the candidate;
(2) if any follower node does not receive the heartbeat signal from the leader within a random timeout period, the follower node will be promoted to be a candidate and a request voting RPC message is initiated to other nodes;
(3) only one leader can exist at the same time in one period;
(4) in one round of voting, the candidate votes the candidate, other nodes vote according to the order of first come first cast, and the follower has and only one vote in one round of voting;
(5) log integrity, namely the size of a corresponding tenure number value of the last record of the node log item; follower N with high log integrity b Refusing to vote to candidate C whose log integrity is low a The method is characterized by comprising the following steps:
a n <b n
the above indicates that when a candidate initiates an RPC voting request to a follower, if the period number value of the follower is greater than the period number value of the candidate, the follower refuses to vote for the candidate; c (C) a <a,Votes,TermNum j+1 ,Journal a Represents a candidate node that initiates a voting request; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b Represents follower nodes that have not voted yet; journal (Journal) b A log representing a follower node; journal (Journal) a A log representing candidate nodes that initiated the voting RPC request; a, a n Subscript representing the candidate node log index; b n A subscript representing a follower node log index;
(6) for the candidate, even if the candidate obtains most votes (most votes are more than 1/2 votes), the candidate can become a leader after obtaining a special vote of the observer node;
the leader tenure rules are specifically as follows:
(1) the period of the present period of the leader is represented by the period number;
(2) when the follower waits for the time out of the heartbeat time, the follower adds one to the own tenure number when becoming a candidate;
(3) when one node finds that the own tenure number is smaller than that of other nodes, the own tenure number is the same as the maximum value;
(4) When one leader or candidate finds that own tenure number is smaller than other nodes, the follower identity is immediately restored;
(5) a node receives a request for a tenn number value smaller than its own tenn number, and directly refuses the request.
Preferably, the identifying of the offending node is specifically as follows:
setting a new role observer in the cluster, and when a candidate initiates a request voting (RPC) message, the observer monitors whether the candidate node has abnormal behavior in the execution process:
if abnormal behavior is monitored, the observer will not vote for the candidate and broadcast the tenure number of the candidate to keep all nodes consistent with the tenure number of the candidate, and then start the next round of voting;
if no abnormal behavior is found in the candidate voting process, the observer node votes for most votes after it obtains them, specifically as follows:
the above equation indicates that during the voting process, the observer node will detect the candidate node, will not vote for it if it is abnormal, and will broadcast its tenure number to all follower nodes; voting for the abnormality if it does not occur; w (W)<TermNum j+1 ,Wvote,Journal j+1 >Representing observer nodes; c (C) a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; wvot represents the vote of the observer node; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i >Representing follower nodes.
Preferably, the replication log is specifically as follows:
after receiving the client request, the leader creates a new log entry based on the instruction in the client request and attaches the new log entry to the local log;
copying the log items to other servers through the log copy RPC message;
judging whether the leader receives the corresponding successful copy:
when the leader receives most of the copy success responses, the log entries are applied to the state machine corresponding to the leader and success is returned to the client;
when the leader does not receive the response of successful copying, the leader returns an error to the client;
when the follower receives the heartbeat message or the new log replication RPC message, if the follower finds that the leader has submitted any log item but is not applied, the follower will apply the log item to a local state machine, specifically as follows:
the above formula shows that when the leader receives the log replication request from the client, a new log entry is created based on the instruction in the request and added to the local log, then the new log is replicated to the follower by sending the log replication RPC, when the follower successfully replicates the log, the corresponding replication success is sent to the leader, when the leader receives the superword If the node copy of 1/2 is successful, the log item is applied to a state machine corresponding to the leader and success is returned to the client; client represents a Client; l (L) b <b,TermNum j+1 ,T b ,Journal b >Representing a leader node; journal (Journal) b A log representing the leader;representing a newly appended log entry; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i Representing follower; cnt represents the number of replication success responses received by the leader; FSM represents a local state machine;
the consistency of the log refers to that the leader copies the log item of the leader by forcing the follower to realize the consistency of the log, and the method specifically comprises the following steps:
the leader finds the maximum index value of the same log item as the leader node through consistency check of the log copy RPC message;
the leader forces the follower to update and cover inconsistent log entries, so that the consistency of the log is realized;
the leader performs a separate consistency check for each follower.
More preferably, the member changes are specifically as follows:
using the observer node to send the newly configured log item to the leader, and integrating the missing part of the newly configured log item into the log item of the leader;
the leader broadcasts new log items to the cluster, and submits the newly configured log items to a local state machine after receiving most of successful replication responses to complete member changes of auxiliary nodes of the observer cluster, wherein the method comprises the following steps:
When the capacity of the cluster is to be expanded, the observer node updates the own log firstly, then informs the leader of copying the log of the observer through the log copying RPC, and then the leader sends the log copying RPC to the follower to copy the new log into the follower node; { NewNi } represents a node to be newly added, W < TermNum j+1 ,Wvote,Journal j+1 Represents observer; l (L) b <b,TermNum j+1 ,T b ,Journal j+1 Cnt > represents a leader; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i And > represents the follower.
A block chain consensus system based on a Raft algorithm, the system comprising,
an initialization module for cluster initialization, i.e. setting a point of view N except for one inherent in the beginning 0 All nodes are followers, except;
the election module is used for triggering the request voting RPC of the candidate to perform leader election through the fact that the follower does not receive the heartbeat information;
the identification module is used for identifying the dislike node of the candidate when the candidate initiates the request voting RPC so as to relieve the performance pressure and ensure the cluster security;
the replication module is used for creating a new log item based on an instruction in the client request, adding the new log item into a local log, and replicating the log item to other servers through a log replication RPC message;
and the change module is used for sending the newly configured log item to the leader by using the observer node, integrating the missing part of the newly configured log item into the log item by the leader, broadcasting the new log item to the cluster by the leader, and submitting the newly configured log item of the leader to the local state machine after receiving most of successful replication responses to complete member change of the observer cluster auxiliary node.
A computer readable storage medium having stored therein computer executable instructions that when executed by a processor perform a blockchain consensus method based on a Raft algorithm as described above.
The block chain consensus method and system based on the Raft algorithm have the following advantages:
the invention adds observer node, which can judge whether it is a wrongly generated node before the generation of new leader, and has final decision right to the generation of leader; the observer node only works in the election process, and only monitors one node, so that the performance can be improved to the greatest extent, the consumption of resources is reduced, and the potential safety hazard that the original Raft algorithm cannot screen the bad node is solved;
secondly, the invention realizes the member change of the observer auxiliary node, namely, the newly added observer node is used, and the risk that a plurality of leaders can appear when the new node cluster is added by the original Raft algorithm is solved;
thirdly, the invention adds a new class of observer nodes on the basis of the original three nodes of the Raft, monitors the observer nodes in the process of initiating a request for voting RPC by a candidate, if the observer finds that the observer nodes are bad nodes, the observer will not vote on the candidate, the observer cannot become a leader if the observer cannot vote on the candidate, namely, an inherent trusted node is assumed on the basis of the original algorithm, and the observer nodes are used for assisting in distinguishing the bad nodes and preventing splitting during cluster expansion;
The observer nodes are newly added on the basis of the original algorithm, a new method is provided for identifying the wrongly nodes and carrying out cluster expansion in the interaction links of the leader, the follower and the candidate nodes, the problem that the harm caused by the wrongly nodes cannot be avoided by the original algorithm is solved, and the potential safety hazard that the original algorithm possibly causes splitting due to the cluster expansion is eliminated;
the invention recognizes the dislike node when the candidate initiates the request voting RPC, so as to lighten the performance pressure and ensure the cluster security.
Drawings
The invention is further described below with reference to the accompanying drawings.
FIG. 1 is a flow chart diagram of a block chain consensus method based on a Raft algorithm;
fig. 2 is a flow diagram of a replication log.
Detailed Description
The block chain consensus method and system based on the Raft algorithm of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
Example 1:
as shown in figure 1, the block chain consensus method based on the Raft algorithm comprises the steps of adding observer nodes on the basis of leader, follower and candidate nodes, and setting random timeout time for all nodes except the observer nodes by the initial state of a cluster; during the leader election process, the observer monitors the candidate, identifies whether the candidate is a bad node, and has final decision rights for the leader generation; when the leader generates, performing log replication RPC information on all nodes including observers, wherein the observers do not feed back information; in the cluster changing process, the observer sends a new log item to a leader, and the leader broadcasts the new log item and puts the new log item into a local state machine; the method comprises the following steps:
S1, initializing a cluster: initially except for an inherent viewpoint N 0 All nodes are followers, except;
s2, electing a leader: triggering a request voting RPC of a candidate to perform leader election through the fact that the follower does not receive heartbeat information;
s3, identifying a bad node: performing disfiguring node identification on the candidate when the candidate initiates the request voting RPC so as to relieve performance pressure and ensure cluster security;
s4, copying logs: the log consists of a plurality of log items, each log item consists of an instruction, an index value and an tenure number, and the form is as follows:
the formula represents that the log consists of a plurality of log items, wherein each log item consists of an index value, an tenure number and an instruction; journal (Journal) i A log representing channel i;an index value representing an nth log entry of the log; termNum j Representing the last tenn number; />Instructions representing an nth log entry of the log;
s5, changing the member.
The follower in this embodiment is used to accept and process messages from the leader, when the leader heartbeat information T 0 Recommending the candidate to be the user when the time is out; the follower node is in the form of: n (N) i <Node i ,TermNum j ,T i ,Vote i ,Journal i >The method comprises the steps of carrying out a first treatment on the surface of the Wherein i is more than or equal to 1 and less than or equal to n; j=0, 1,2 …; vote i =0, 1; n is the number of nodes in the initial state cluster; journal (Journal) i Is a log; vote i Initial value is 1, T i A random timeout time set for each follower node;
the candidate is used for sending a request voting RPC message to other nodes and becomes a leader when winning most votes;
the leader is used for processing the write request, managing log replication and sending heartbeat information T 0 At the same time, only one leader can exist in the cluster;
the observer is used for identifying whether the candidate is a wrongly-used node when the candidate initiates the request voting RPC and assisting the cluster capacity expansion; wherein, the observer is regarded as a trusted node, and the form is: w (W)<TermNum j+1 ,Wvote,Journal j+1 >The method and the device have the advantages that the unreliability of the role of the observer caused by the problem of the observer is avoided, so that the stability of the system is improved, and the damage of external attack to the system is reduced; term of W nodeNum and Journal synchronize the catalog entry of the leader, wvot initial value is 1, when judging candidate C i To disqualify a node, it is set to 0.
The election leader in step S2 of this embodiment is specifically as follows:
s201, no leader exists in the initial cluster, and when the timeout time T of any node is up i First arrive and no heartbeat information T from the leader is received in the process 0 Will make its own tendiness number TermNum j Adding one to make oneself become candidate C i <i,Votes,TermNum j+1 ,Journal i >; casting a vote to oneself and initiating request voting RPC to all other nodes, the formula is as follows:
TermNum j+1 =TermNum j +1;
Votes=0+1;
wherein, termNum j Representing the last tenn number, and the default value is 0; votes default value of 0, when one follower N i Become candidate C i Later, votes will acquire the data from C i I.e. self-increasing one;
s202, when other followers receive voting requests from nodes with larger tenure numbers and do not vote in the tenure numbers of candidates, the follower nodes cast the votes to the candidate nodes initiating the request for voting RPC messages, and then the tenure numbers of the voted followers are self-increased to be consistent with the voted candidates, specifically as follows:
Votes+Vote b
Vote b =0;
the above formula indicates that the candidate node a sends a request voting RPC message to the follower node with the period number of a minus one, and then the follower node votes on the candidate node, so that the vote of the follower node is minus one, and the vote obtained by the candidate node is plus one; c (C) a <a,Votes,TermNum j+1 ,Journal a Represents a candidate node that initiates a voting request; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b Represents follower nodes that have not voted yet; votes represents the number of Votes currently obtained for the candidate; vote b Representing votes cast by the follower node;
S203, if a candidate node C i <i,Votes,TermNum j+1 >At a timeout time T i Internally win Big size Most votes will become the new leader L in the period number, i.e. the period of the present period, after the observer votes are obtained i The formula is as follows:
the above equation indicates that the election time cannot exceed a timeout time, that all votes obtained by the candidate must be greater than 50% of the number of all follower nodes, and that votes of the observer nodes must be obtained; votes represents the number of Votes currently obtained for the candidate; vote i A vote representing a follower of the vote; t represents the time of election; t (T) i Representing a timeout period; n represents the number of follower nodes; wvot represents the vote of the observer node;
s204, when the new leader is selected, taking T as i And sending heartbeat information periodically in time to prevent other nodes from initiating new elections.
The election rule in this embodiment is specifically as follows:
(1) periodically sending heartbeat information to all nodes by the leader during the period of the discretion to inform the follower and the observer of the identity of the leader, and preventing the follower from becoming a new round of election initiated by the candidate;
(2) if any follower node does not receive the heartbeat signal from the leader within a random timeout period, the follower node will be promoted to be a candidate and a request voting RPC message is initiated to other nodes;
(3) Only one leader can exist at the same time in one period;
(4) in one round of voting, the candidate votes the candidate, other nodes vote according to the order of first come first cast, and the follower has and only one vote in one round of voting;
(5) log integrity, namely the size of a corresponding tenure number value of the last record of the node log item; follower N with high log integrity b Refusing to vote to candidate C whose log integrity is low a The method is characterized by comprising the following steps:
a n <b n
the above indicates that when a candidate initiates an RPC voting request to a follower, if the period number value of the follower is greater than the period number value of the candidate, the follower refuses to vote for the candidate; c (C) a <a,Votes,TermNum j+1 ,Journal a Represents one hairCandidate nodes that initiate voting requests; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b Represents follower nodes that have not voted yet; journal (Journal) b A log representing a follower node; journal (Journal) a A log representing candidate nodes that initiated the voting RPC request; a, a n Subscript representing the candidate node log index; b n A subscript representing a follower node log index;
(6) for the candidate, even if the candidate obtains most votes (most votes are more than 1/2 votes), the candidate can become a leader after obtaining a special vote of the observer node;
The leader tening rule in this embodiment is specifically as follows:
(1) the period of the present period of the leader is represented by the period number;
(2) when the follower waits for the time out of the heartbeat time, the follower adds one to the own tenure number when becoming a candidate;
(3) when one node finds that the own tenure number is smaller than that of other nodes, the own tenure number is the same as the maximum value;
(4) when one leader or candidate finds that own tenure number is smaller than other nodes, the follower identity is immediately restored;
(5) a node receives a request for a tenn number value smaller than its own tenn number, and directly refuses the request.
The identifying bad nodes in step S3 of this embodiment is specifically as follows:
setting a new role observer in the cluster, and when a candidate initiates a request voting (RPC) message, the observer monitors whether the candidate node has abnormal behavior in the execution process:
(1) if abnormal behavior is detected, the observer will not vote for the candidate and broadcast the tenure number of the candidate to keep all nodes consistent with the tenure number of the candidate, and then the next round of voting is started;
(2) If no abnormal behavior is found in the candidate voting process, the observer node votes for most votes after the observer node obtains the votes, specifically as follows:
the above equation indicates that during the voting process, the observer node will detect the candidate node, will not vote for it if it is abnormal, and will broadcast its tenure number to all follower nodes; voting for the abnormality if it does not occur; w (W)<TermNum j+1 ,Wvote,Journal j+1 >Representing observer nodes; c (C) a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; wvot represents the vote of the observer node; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i >Representing follower nodes;
as shown in fig. 2, the replication log in step S4 of this embodiment is specifically as follows:
s401, after receiving a client request, a leader creates a new log item based on an instruction in the client request and adds the new log item to a local log;
s402, copying the log items to other servers through the log copy RPC message;
s403, judging whether the leader receives the corresponding successful copy:
(1) when the leader receives most of the copy success responses, the log entries are applied to the state machine corresponding to the leader, and success is returned to the client;
(2) when the leader does not receive the response of successful copying, the leader returns an error to the client;
S404, after the follower receives the heartbeat message or the new log replication RPC message, if the follower finds that the leader has submitted any log item but is not applied, the follower will apply the log item to a local state machine, specifically as follows:
the formula shows that when a leader receives a log replication request from a client, a new log item is created based on an instruction in the request and is added into a local log, then the new log is replicated to a follower through sending a log replication RPC, after the follower successfully replicates the log, the corresponding replication success is sent to the leader, when the leader receives a node replication success response exceeding 1/2, the log item is applied to a state machine corresponding to the leader, and success is returned to the client; client represents a Client; l (L) b <b,TermNum j+1 ,T b ,Journal b >Representing a leader node; journal (Journal) b A log representing the leader;representing a newly appended log entry; n (N) i <i,TermNum j ,T i ,Votes i ,Journal i >Representing the follower; cnt represents the leaderThe number of received copy success responses; FSM represents a local state machine.
The consistency of the log in this embodiment refers to that the leader copies its own log entry by forcing the follower to realize the consistency of the log, specifically as follows:
(1) The leader finds the maximum index value of the same log item as the leader node through consistency check of the log copy RPC message;
(2) The leader forces the follower to update the log item which is not consistent in coverage, so that the consistency of the log is realized;
(3) The leader performs a separate consistency check for each follower.
The member change in step S5 of this embodiment is specifically as follows:
s501, using an observer node to send a newly configured log item to a leader, and integrating a missing part of the newly configured log item into the log item of the leader;
s502, broadcasting new log items to the cluster by a leader, and submitting the newly configured log items to a local state machine after receiving most of successful replication responses to complete member changes of auxiliary nodes of the observer cluster, wherein the method comprises the following steps:
when the capacity of the cluster is to be expanded, the observer node updates the own log firstly, then informs the leader of copying the log of the observer through the log copying RPC, and then the leader sends the log copying RPC to the follower to copy the new log into the follower node; { NewNi } representsNodes to be newly added; w (W)<TermNum j+1 ,Wvote,Journal j+1 >Representing a viewer; l (L) b <b,TermNum j+1 ,T b ,Journal j+1 ,Cnt>Representing a leader; n (N) i <i,TermNum j ,T i ,vOTE i ,Journal i >Representing the follower.
Example 2:
the present embodiment provides a block chain consensus system based on a Raft algorithm, the system comprising,
an initialization module for cluster initialization, i.e. setting a point of view N except for one inherent in the beginning 0 All nodes are followers, except;
the election module is used for triggering the request voting RPC of the candidate to perform leader election through the fact that the follower does not receive the heartbeat information;
the identification module is used for identifying the dislike node of the candidate when the candidate initiates the request voting RPC so as to relieve the performance pressure and ensure the cluster security;
the replication module is used for creating a new log item based on an instruction in the client request, adding the new log item into a local log, and replicating the log item to other servers through a log replication RPC message;
and the change module is used for sending the newly configured log item to the leader by using the observer node, integrating the missing part of the newly configured log item into the log item by the leader, broadcasting the new log item to the cluster by the leader, and submitting the newly configured log item of the leader to the local state machine after receiving most of successful replication responses to complete member change of the observer cluster auxiliary node.
Example 3:
the present embodiment also provides a computer readable storage medium having stored therein a plurality of instructions, the instructions being loaded by a processor, to cause the processor to perform the method for blockchain consensus based on the Raft algorithm in any of the embodiments of the present invention. Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion unit connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion unit is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the 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 scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (7)

1. A block chain consensus method based on a Raft algorithm is characterized in that observer nodes are newly added on the basis of leader, follower and candidate nodes, and a cluster initial state sets random timeout time for all nodes except the observer nodes; during the leader election process, the observer monitors the candidate, identifies whether the candidate is a bad node, and has final decision rights for the leader generation; when the leader generates, performing log replication RPC information on all nodes including observers, wherein the observers do not feed back information; in the cluster changing process, the observer sends a new log item to a leader, and the leader broadcasts the new log item and puts the new log item into a local state machine; the method comprises the following steps:
Cluster initialization: initially except for an inherent viewpoint N 0 All nodes are followers, except;
electing a leader: triggering a request voting RPC of a candidate to perform leader election through the fact that the follower does not receive heartbeat information; the method comprises the following steps:
no leader in the initial cluster, when the timeout time T of any node i First arrive and no heartbeat information T from the leader is received in the process 0 Will make its own tendiness number TermNum j Adding one to make oneself become candidate C i <i,Votes,TermNum j+1 ,Journal i >The method comprises the steps of carrying out a first treatment on the surface of the Casting a vote to oneself and initiating request voting RPC to all other nodes, the formula is as follows:
TermNum j+1 =TermNum j +1;
Votes=0+1;
wherein, termNum j Representing the last tenn number, and the default value is 0; votes default value of 0, when one follower N i Become candidate C i Later, votes will acquire the data from C i I.e. self-increasing one;
when other followers receive voting requests from nodes with larger tenninal numbers and do not vote within the tenninal numbers of the candidates, the follower nodes will cast the votes to the candidate nodes initiating the request for voting RPC message, and then the voted followers self-increment their tenninal numbers to be consistent with the voted candidates, concretely as follows:
Votes+Vote b
Vote b =0;
Wherein C is a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b >A follower node representing that there has been no vote; votes represents the number of Votes currently obtained for the candidate; vote b Representing votes cast by the follower node; the formula indicates that a candidate node a sends a request voting RPC message to the follower node with the period number of a minus one, and then the follower node votes on the candidate node, so that the vote of the follower node is minus one, and the vote obtained by the candidate node is plus one;
if a candidate node C i <i,Votes,TermNum j+i >At a timeout time T i Internally win Big size Most votes will become the new leader L in the period number, i.e. the period of the present period, after the observer votes are obtained i The formula is as follows:
the above equation indicates that the election time cannot exceed a timeout time, that all votes obtained by the candidate must be greater than 50% of the number of all follower nodes, and that votes of the observer nodes must be obtained; votes represents the number of Votes currently obtained for the candidate; vote i A vote representing a follower of the vote; t represents the time of election; t (T) i Representing a timeout period, n representing the number of follower nodes; wvot represents the vote of the observer node;
When the new leader is selected, it will take the form of T i The heartbeat information is sent periodically in time, so that other nodes are prevented from initiating new elections;
identifying a bad node: performing disfiguring node identification on the candidate when the candidate initiates a request voting RPC; the method comprises the following steps:
setting a new role observer in the cluster, and when a candidate initiates a request voting (RPC) message, the observer monitors whether the candidate node has abnormal behavior in the execution process:
if abnormal behavior is monitored, the observer will not vote for the candidate and broadcast the tenure number of the candidate to keep all nodes consistent with the tenure number of the candidate, and then start the next round of voting;
if no abnormal behavior is found in the candidate voting process, the observer node votes for most votes after it obtains them, specifically as follows:
wherein the above formula indicates that during the voting process, the observer node will detect the candidate node, if it is abnormal, it will not vote for it, and broadcast its tenure number to all follower nodes; if no abnormality occurs, throw itA ticket; w (W)<TermNum j+1 ,Wvote,Journal j+1 >Representing observer nodes; c (C) a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; wvot represents the vote of the observer node; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i >Representing follower nodes;
replication log: the log consists of a plurality of log items, each log item consists of an instruction, an index value and an tenure number, and the form is as follows:
the above expression log consists of a plurality of log items, wherein each log item consists of an index value, an tenure number and an instruction; journal (Journal) i A log representing channel i;an index value representing an nth log entry of the log; termNum j Representing the last tenn number; />Instructions representing an nth log entry of the log;
with respect to member changes.
2. The method of claim 1, wherein the follower is configured to receive and process a message from a leader when the leader is heartbeat information T 0 Recommending the candidate to be the user when the time is out; the follower node is in the form of: n (N) i <Node i ,TermNum j ,T i ,Vote i ,Journal i >The method comprises the steps of carrying out a first treatment on the surface of the Wherein i is more than or equal to 1 and less than or equal to n; j=0, 1,2 …; vote i =0, 1; n is the number of nodes in the initial state cluster; journal (Journal) i Is a log; vote i Initial valueIs 1, T i A random timeout time set for each follower node;
the candidate is used for sending a request voting RPC message to other nodes and becomes a leader when winning more than 1/2 votes;
the leader is used for processing the write request, managing log replication and sending heartbeat information T 0 At the same time, only one leader can exist in the cluster;
the observer is used for identifying whether the candidate is a wrongly-used node when the candidate initiates the request voting RPC and assisting the cluster capacity expansion; wherein, the observer is regarded as a trusted node, and the form is: w (W)<TermNum j+1 ,Wvote,Journal j+1 >The TermNum of the W node and the catalog item of the Journal synchronous leader have Wvot initial value of 1, and when judging the candidate C i To disqualify a node, it is set to 0.
3. The method for block chain consensus based on the Raft algorithm according to claim 1, wherein the election rule is specifically as follows:
(1) periodically sending heartbeat information to all nodes by the leader during the period of the discretion to inform the follower and the observer of the identity of the leader, and preventing the follower from becoming a new round of election initiated by the candidate;
(2) if any follower node does not receive the heartbeat signal from the leader within a random timeout period, the follower node will be promoted to be a candidate and a request voting RPC message is initiated to other nodes;
(3) only one leader can exist at the same time in one period;
(4) in one round of voting, the candidate votes the candidate, other nodes vote according to the order of first come first cast, and the follower has and only one vote in one round of voting;
(5) Log integrity, namely the size of a corresponding tenure number value of the last record of the node log item; follower N with high log integrity b Refusing to vote to candidate C whose log integrity is low a The method is characterized by comprising the following steps:
a n <b n
wherein, the above formula indicates that when a candidate initiates an RPC voting request to a follower, if the period number value of the follower is greater than the period number value of the candidate, the follower refuses to vote to the candidate; c (C) a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b >A follower node representing that there has been no vote; journal (Journal) b A log representing a follower node; journal (Journal) a A log representing candidate nodes that initiated the voting RPC request; a, a n Subscript representing the candidate node log index; b n A subscript representing a follower node log index;
(6) for the candidate, even if the candidate obtains more than 1/2 of the votes, the candidate can become the leader after obtaining the special votes of the observer nodes;
the leader tenure rules are specifically as follows:
(1) the period of the present period of the leader is represented by the period number;
(2) when the follower waits for the time out of the heartbeat time, the follower adds one to the own tenure number when becoming a candidate;
(3) When one node finds that the own tenure number is smaller than that of other nodes, the own tenure number is the same as the maximum value;
(4) when one leader or candidate finds that own tenure number is smaller than other nodes, the follower identity is immediately restored;
(5) a node receives a request for a tenn number value smaller than its own tenn number, and directly refuses the request.
4. The method of claim 1, wherein the replication log is specifically as follows:
after receiving the client request, the leader creates a new log entry based on the instruction in the client request and attaches the new log entry to the local log;
copying the log items to other servers through the log copy RPC message;
judging whether the leader receives the corresponding successful copy:
when the leader receives a node copy success response exceeding 1/2, the log item is applied to a state machine corresponding to the leader, and success is returned to the client;
when the leader does not receive the response of successful copying, the leader returns an error to the client;
when the follower receives the heartbeat message or the new log replication RPC message, if the follower finds that the leader has submitted any log item but is not applied, the follower will apply the log item to a local state machine, specifically as follows:
The above formula shows that when the leader receives a log replication request from a client, a new log item is created based on an instruction in the request and added into a local log, then the new log is replicated to a follower by sending a log replication RPC, after the follower successfully replicates the log, the successful replication response is sent to the leader, when the leader receives a node replication success response exceeding 1/2, the log item is applied to a state machine corresponding to the leader, and success is returned to the client; client represents a Client; l (L) b <b,TermNum j+1 ,T b ,Journal b >Representing a leader node; journal (Journal) b A log representing the leader;representing a newly appended log entry; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i >Representing the follower; cnt represents the number of replication success responses received by the leader; FSM represents a local state machine;
the consistency of the log refers to that the leader copies the log item of the leader by forcing the follower to realize the consistency of the log, and the method specifically comprises the following steps:
the leader finds the maximum index value of the same log item as the leader node through consistency check of the log copy RPC message;
the leader forces the follower to update and cover inconsistent log entries, so that the consistency of the log is realized;
the leader performs a separate consistency check for each follower.
5. The method of claim 1-4, wherein the member changes are as follows:
using the observer node to send the newly configured log item to the leader, and integrating the missing part of the newly configured log item into the log item of the leader;
the leader broadcasts new log items to the cluster, and submits the newly configured log items to a local state machine after receiving most of successful replication responses to complete member changes of auxiliary nodes of the observer cluster, wherein the method comprises the following steps:
when the capacity of the cluster is to be expanded, the observer node updates the own log firstly, then informs the leader of copying the log of the observer through the log copying RPC, and then the leader sends the log copying RPC to the follower to copy the new log into the follower node; { NewNi } represents a node to be newly added; w (W)<TermNum j+1 ,Wvote,Journal j+1 >Representing a viewer; l (L) b <b,TermNum j+1 ,T b ,Journal j+1 ,Cnt>Representing a leader; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i >Representing the follower.
6. A block chain consensus system based on a Raft algorithm is characterized in that the system comprises,
an initialization module for cluster initialization, i.e. setting a point of view N except for one inherent in the beginning 0 All nodes are followers, except;
The election module is used for triggering the request voting RPC of the candidate to perform leader election through the fact that the follower does not receive the heartbeat information; wherein, the election leader is specifically as follows:
no leader in the initial cluster, when the timeout time T of any node i First arrive and no heartbeat information T from the leader is received in the process 0 Will make its own tendiness number TermNum j Adding one to make oneself become candidate C i <i,Votes,TermNum j+1 ,Journal i >The method comprises the steps of carrying out a first treatment on the surface of the Casting a vote to oneself and initiating request voting RPC to all other nodes, the formula is as follows:
TermNum j+1 =TermNum j +1;
Votes=0+1;
wherein, termNum j Representing the last tenn number, and the default value is 0; votes default value of 0, when one follower N i Become candidate C i Later, votes will acquire the data from C i I.e. self-increasing one;
when other followers receive voting requests from nodes with larger tenninal numbers and do not vote within the tenninal numbers of the candidates, the follower nodes will cast the votes to the candidate nodes initiating the request for voting RPC message, and then the voted followers self-increment their tenninal numbers to be consistent with the voted candidates, concretely as follows:
<b,TermNum j ,T b ,Vote b ,Journal b >;
Votes+Vote b
Vote b =0;
wherein C is a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; n (N) b <b,TermNum j ,T b ,Vote b ,Journal b >A follower node representing that there has been no vote; votes represents the number of Votes currently obtained for the candidate; vote b Representing votes cast by the follower node; the formula indicates that a candidate node a sends a request voting RPC message to the follower node with the period number of a minus one, and then the follower node votes on the candidate node, so that the vote of the follower node is minus one, and the vote obtained by the candidate node is plus one;
if a candidate node C i <i,Votes,TermNum j+1 >At a timeout time T i Most votes are won in the time, the new leader L in the time number of the time after the observer votes are obtained i The formula is as follows:
<b,TermNum j+1 ,T b ,Journal b ,Cnt>;
the above equation indicates that the election time cannot exceed a timeout time, that all votes obtained by the candidate must be greater than 50% of the number of all follower nodes, and that votes of the observer nodes must be obtained; votes represents the number of Votes currently obtained for the candidate; vote i A vote representing a follower of the vote; t represents the time of election; t (T) i Representing a timeout period, n representing the number of follower nodes; wvot represents the vote of the observer node;
when the new leader is selected, it will take the form of T i The heartbeat information is sent periodically in time, so that other nodes are prevented from initiating new elections;
The identification module is used for identifying the disqualified node when the candidate initiates the request voting RPC; the identifying of the offending node is specifically as follows:
setting a new role observer in the cluster, and when a candidate initiates a request voting (RPC) message, the observer monitors whether the candidate node has abnormal behavior in the execution process:
if abnormal behavior is monitored, the observer will not vote for the candidate and broadcast the tenure number of the candidate to keep all nodes consistent with the tenure number of the candidate, and then start the next round of voting;
if no abnormal behavior is found in the candidate voting process, the observer node votes for most votes after it obtains them, specifically as follows:
<a,Votes,TermNum j+1 ,Journal a
wherein the above formula indicates that during the voting process, the observer node will detect the candidate node, if it is abnormal, it will not vote for it, and broadcast its tenure number to all follower nodes; voting for the abnormality if it does not occur; w (W)<TermNum j+1 ,Wvote,Journal j+1 >Representing observer nodes; c (C) a <a,Votes,TermNum j+1 ,Journal a >Representing a candidate node that initiates a voting request; wvot represents the vote of the observer node; n (N) i <i,TermNum j ,T i ,Vote i ,Journal i >Representing follower nodes;
the replication module is used for creating a new log item based on an instruction in the client request, adding the new log item into a local log, and replicating the log item to other servers through a log replication RPC message;
And the change module is used for sending the newly configured log item to the leader by using the observer node, integrating the missing part of the newly configured log item into the log item by the leader, broadcasting the new log item to the cluster by the leader, and submitting the newly configured log item of the leader to the local state machine after receiving most of successful replication responses to complete member change of the observer cluster auxiliary node.
7. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor perform the method of block chain consensus based on a Raft algorithm according to any one of claims 1 to 5.
CN202210420723.1A 2022-04-21 2022-04-21 Block chain consensus method and system based on Raft algorithm Active CN114844891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210420723.1A CN114844891B (en) 2022-04-21 2022-04-21 Block chain consensus method and system based on Raft algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210420723.1A CN114844891B (en) 2022-04-21 2022-04-21 Block chain consensus method and system based on Raft algorithm

Publications (2)

Publication Number Publication Date
CN114844891A CN114844891A (en) 2022-08-02
CN114844891B true CN114844891B (en) 2024-04-12

Family

ID=82566568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210420723.1A Active CN114844891B (en) 2022-04-21 2022-04-21 Block chain consensus method and system based on Raft algorithm

Country Status (1)

Country Link
CN (1) CN114844891B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115250277B (en) * 2022-08-09 2023-09-05 西安邮电大学 Method for adapting consensus mechanism to edge buffer system based on alliance chain
CN116723192B (en) * 2023-08-10 2023-11-28 苏州海加网络科技股份有限公司 Distributed consensus system based on federal learning and operation method thereof

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109272631A (en) * 2017-07-17 2019-01-25 卡巴斯基实验室股份制公司 The system and method for determining the ballot paper of the voter collected by electronic voting
CN109923536A (en) * 2016-11-10 2019-06-21 斯沃尔德斯股份有限公司 Method and apparatus for the distributed data base including anonymous entry
CN110855793A (en) * 2019-11-19 2020-02-28 南昌航空大学 Distributed system consensus method
CN111988203A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Node election method, device and storage medium
CN112789823A (en) * 2019-09-11 2021-05-11 李敏宰 Block chain-based election network system and election method
CN113127565A (en) * 2021-04-28 2021-07-16 联通沃音乐文化有限公司 Method and device for synchronizing distributed database nodes based on external observer group
US11088996B1 (en) * 2021-02-10 2021-08-10 SecureCo, Inc. Secure network protocol and transit system to protect communications deliverability and attribution
CN114268532A (en) * 2021-11-24 2022-04-01 华人运通(上海)云计算科技有限公司 Raft protocol-based election method, distributed system and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020096560A1 (en) * 2001-01-20 2002-07-25 Page John S. Postage stamp voting method in elections
US10938662B2 (en) * 2018-07-17 2021-03-02 Software Ag System and/or method for maintaining highly-available, consistent, partition-tolerant clusters using client voters
EP4070221A1 (en) * 2019-12-02 2022-10-12 Schvey, Inc. D/B/A/ Axoni Cross-partition calls in partitioned, tamper-evident data stores
US11514029B2 (en) * 2020-10-14 2022-11-29 Oracle International Corporation System and method for high performance multi-statement interactive transactions with snapshot isolation in a scale-out database

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109923536A (en) * 2016-11-10 2019-06-21 斯沃尔德斯股份有限公司 Method and apparatus for the distributed data base including anonymous entry
CN109272631A (en) * 2017-07-17 2019-01-25 卡巴斯基实验室股份制公司 The system and method for determining the ballot paper of the voter collected by electronic voting
CN112789823A (en) * 2019-09-11 2021-05-11 李敏宰 Block chain-based election network system and election method
CN110855793A (en) * 2019-11-19 2020-02-28 南昌航空大学 Distributed system consensus method
CN111988203A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Node election method, device and storage medium
US11088996B1 (en) * 2021-02-10 2021-08-10 SecureCo, Inc. Secure network protocol and transit system to protect communications deliverability and attribution
CN113127565A (en) * 2021-04-28 2021-07-16 联通沃音乐文化有限公司 Method and device for synchronizing distributed database nodes based on external observer group
CN114268532A (en) * 2021-11-24 2022-04-01 华人运通(上海)云计算科技有限公司 Raft protocol-based election method, distributed system and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Hyperledger Fabric共识机制优化方案;孟吴同,张大伟;自动化学报;1-14 *
一种面向Fabric区块链应用软件的体系结构演化算法;赵会群;张隆龙;;软件(07);全文 *
关于Borda计分法则在职称评定投票规则中的一些探讨;王倩;高红伟;张宇宙;代业明;;青岛大学学报(工程技术版)(03);全文 *
基于Raft一致性协议的高可用性实现;张晨东;郭进伟;刘柏众;储佳佳;周敏奇;钱卫宁;;华东师范大学学报(自然科学版)(05);全文 *

Also Published As

Publication number Publication date
CN114844891A (en) 2022-08-02

Similar Documents

Publication Publication Date Title
CN114844891B (en) Block chain consensus method and system based on Raft algorithm
Cachin et al. Blockchain consensus protocols in the wild
EP3649558B1 (en) Method and system for a distributed computing system
US20180308091A1 (en) Fairness preserving byzantine agreements
CN112883114A (en) Transaction processing method and device applied to block chain
EP4332870A1 (en) Transaction data processing method and apparatus, computer device and storage medium
CN111988203B (en) Node election method, device and storage medium
US11295402B2 (en) Blockchain-based property repair
WO2022048357A1 (en) Transaction endorsement method and apparatus, and storage medium
US20190268153A1 (en) Event execution using a blockchain approach
US20190303882A1 (en) Blockchain-based property utilization
CN110581887B (en) Data processing method, device, block chain node and storage medium
JP2020530958A (en) Computer implementation systems and methods related to binary blockchains that make up a pair of combined blockchains
US20210216527A1 (en) Parallel blockchain processing
CN113612618B (en) Alliance chain consensus method and device
US20240004930A1 (en) System and method for pre-indexing filtering and correction of documents in search systems
CN113704024B (en) Data processing method, device, related equipment and storage medium
JP2005502957A (en) Exactly one-time cache framework
CN113609229B (en) Method and device for fast log replication in Fabric block chain
CN115664706A (en) Double-chain structure-based non-permission block chain node detection and excitation method and system
US20200358597A1 (en) Blockchain-based data processing
US7051065B2 (en) Method and system for performing fault-tolerant online validation of service requests
Nezhadsistani et al. Blockchain consensus algorithms: Past, present, and future trends
US20240144268A1 (en) Control method, non-transitory computer-readable storage medium for storing control program, and information processing apparatus
EP4369658A2 (en) Method of storing blockchain transaction data using fountain codes and apparatus for the same

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