CN109831425B - Block chain consensus method, device, equipment and computer readable storage medium - Google Patents

Block chain consensus method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN109831425B
CN109831425B CN201910073385.7A CN201910073385A CN109831425B CN 109831425 B CN109831425 B CN 109831425B CN 201910073385 A CN201910073385 A CN 201910073385A CN 109831425 B CN109831425 B CN 109831425B
Authority
CN
China
Prior art keywords
consensus
request
block chain
block
main node
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
CN201910073385.7A
Other languages
Chinese (zh)
Other versions
CN109831425A (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201910073385.7A priority Critical patent/CN109831425B/en
Publication of CN109831425A publication Critical patent/CN109831425A/en
Application granted granted Critical
Publication of CN109831425B publication Critical patent/CN109831425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a block chain consensus method, a block chain consensus device, a block chain consensus equipment and a computer readable storage medium, wherein the block chain consensus method comprises the following steps: receiving a consensus request initiated by a main node, wherein the consensus request is broadcasted to a block chain after the main node signs through a private key of the main node, and each main node continuously produces a preset number of blocks; verifying the consensus request through a prestored public key of the main node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information; and if the number of the confirmation information exceeds a preset threshold value, generating a new block according to the consensus request. By immediately auditing according to the consensus request after receiving the consensus request, and outputting the block when the confirmation information exceeds a preset threshold value, the block generation efficiency can be improved.

Description

Block chain consensus method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of blockchain, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for identifying blockchain.
Background
The blockchain technology is a brand new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus algorithms to generate and update data, cryptographically secures data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data.
The consensus mechanism is a core feature of the blockchain and is a scheme for ensuring consistency of the blockchain system under a distributed architecture. Currently, there are also a number of consensus algorithms in the mainstream: proof of workload (Proof of Work, abbreviated as POW), Proof of rights and interests (Proof of stamp, abbreviated as POS), Proof of authorized equity (freed Proof of stamp, abbreviated as DPOS), Practical Byzantine Fault Tolerance (PBFT), and the like. For example, the POW relies on the machine to perform mathematical operation to obtain the accounting right, the resource consumption is higher than that of other consensus mechanisms, the monitorability is weak, meanwhile, the consensus is achieved every time, the operation needs to be jointly participated in by the whole network, the performance efficiency is lower, and 50% of nodes in the whole network are allowed to make errors in the fault tolerance. The POS has the main idea that the difficulty in obtaining the node accounting right is in inverse proportion to the rights and interests held by the nodes, compared with the PoW, the resource consumption caused by mathematical operation is reduced to a certain extent, the performance is correspondingly improved, but the method still obtains the accounting right based on Hash operation competition, and the supervision performance is weak. The consensus mechanism is the same fault tolerance as PoW. The method is an upgrading consensus mechanism of the Pow, and the ore excavation difficulty is reduced in equal proportion according to the proportion and time of token tokens occupied by each node, so that the speed of finding random numbers is increased. DPOS is authenticated and billed by agents by electing several agents. Its compliance supervision, performance, resource consumption and fault tolerance are similar to PoS. Similar to the board voting, the bearer throws a certain number of nodes, and the agent verifies and bills.
However, when the block chain consensus is performed by the method, even if other witnesses receive the current new block, the new block cannot be confirmed, and the previous block can be confirmed by the production block only when the witness turns to the block output, so that the confirmation of the new block needs 45 seconds, and the efficiency is low.
Disclosure of Invention
The invention provides a block chain consensus method, a block chain consensus device, block chain consensus equipment and a computer-readable storage medium, which are used for solving the technical problem that the existing block chain consensus mechanism is low in new block confirmation efficiency.
The first aspect of the present invention provides a block chain consensus method, including:
receiving a consensus request initiated by a main node, wherein the consensus request is broadcasted to a block chain after the main node signs through a private key of the main node, and each main node continuously produces a preset number of blocks;
verifying the consensus request through a prestored public key of the main node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information;
and if the number of the confirmation information exceeds a preset threshold value, generating a new block according to the consensus request.
Another aspect of the present invention provides a block chain consensus apparatus, including:
the system comprises a consensus request receiving module, a block chain sending module and a block chain receiving module, wherein the consensus request receiving module is used for receiving a consensus request initiated by a main node, the consensus request is broadcasted to the block chain after the main node signs through a private key of the main node, and each main node continuously produces a preset number of blocks;
the first verification module is used for verifying the consensus request through a prestored public key of the main node and sending verification information according to a verification result, wherein the verification information comprises confirmation information and doubtful information;
and the generating module is used for generating a new block according to the consensus request if the number of the confirmation information is detected to exceed a preset threshold value.
Still another aspect of the present invention provides a block chain consensus apparatus, including: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the block chain consensus method as described above.
Yet another aspect of the present invention is to provide a computer-readable storage medium having stored therein computer-executable instructions for implementing the block chain consensus method as described above when executed by a processor.
The block chain consensus method, the block chain consensus device, the block chain consensus equipment and the computer readable storage medium provided by the invention receive a consensus request initiated by a main node, wherein the consensus request is broadcasted to a block chain after the main node signs through a private key of the main node, and each main node continuously produces a preset number of blocks; verifying the consensus request through a prestored public key of the main node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information; and if the number of the confirmation information exceeds a preset threshold value, generating a new block according to the consensus request. By immediately auditing according to the consensus request after receiving the consensus request, and outputting the block when the confirmation information exceeds a preset threshold value, the block generation efficiency can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in 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 other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a block chain consensus method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a block chain consensus method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a block chain consensus method according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating a block chain consensus method according to a fourth embodiment of the present invention;
fig. 5 is a flowchart illustrating a block chain consensus method according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a block chain consensus device according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a block chain consensus apparatus according to a seventh embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other examples obtained based on the examples in the present invention are within the scope of the present invention.
The consensus mechanism is a core feature of the blockchain and is a scheme for ensuring consistency of the blockchain system under a distributed architecture. Currently, there are also a number of consensus algorithms in the mainstream: proof of workload (Proof of Work, abbreviated as POW), Proof of rights and interests (Proof of stamp, abbreviated as POS), Proof of authorized equity (freed Proof of stamp, abbreviated as DPOS), Practical Byzantine Fault Tolerance (PBFT), and the like. For example, the POW relies on the machine to perform mathematical operation to obtain the accounting right, the resource consumption is higher than that of other consensus mechanisms, the monitorability is weak, meanwhile, the consensus is achieved every time, the operation needs to be jointly participated in by the whole network, the performance efficiency is lower, and 50% of nodes in the whole network are allowed to make errors in the fault tolerance. The POS has the main idea that the difficulty in obtaining the node accounting right is in inverse proportion to the rights and interests held by the nodes, compared with the PoW, the resource consumption caused by mathematical operation is reduced to a certain extent, the performance is correspondingly improved, but the method still obtains the accounting right based on Hash operation competition, and the supervision performance is weak. The consensus mechanism is the same fault tolerance as PoW. The method is an upgrading consensus mechanism of the Pow, and the ore excavation difficulty is reduced in equal proportion according to the proportion and time of token tokens occupied by each node, so that the speed of finding random numbers is increased. DPOS is authenticated and billed by agents by electing several agents. Its compliance supervision, performance, resource consumption and fault tolerance are similar to PoS. Similar to the board voting, the bearer throws a certain number of nodes, and the agent verifies and bills. However, when the block chain consensus is performed by the method, even if other witnesses receive the current new block, the new block cannot be confirmed, and the previous block can be confirmed by the production block only when the witness turns to the block output, so that the confirmation of the new block needs 45 seconds, and the efficiency is low. In order to solve the above technical problem, the present invention provides a block chain consensus method, apparatus, device and computer readable storage medium.
It should be noted that the method, apparatus, device, and computer-readable storage medium for block chain consensus provided in the present application may be applied in any scenario of block chain consensus.
Fig. 1 is a schematic flow chart of a block chain consensus method according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101, receiving a consensus request initiated by a main node, wherein the consensus request is broadcasted to a block chain after the main node signs a signature through a private key of the main node, and each main node continuously produces a preset number of blocks;
102, verifying the consensus request through a pre-stored public key of the main node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information;
and 103, if the number of the confirmation information is detected to exceed a preset threshold value, generating a new block according to the consensus request.
In this embodiment, when the master node wants to generate a new tile, the master node may initiate a consensus request, encrypt the consensus request by using a private key of the master node itself, and broadcast the encrypted consensus request to the tile chain, so that all other nodes in the tile chain can receive the consensus information. Accordingly, nodes in the block chain except the master node may receive the consensus request, and in order to improve the block output efficiency of the block chain, the consensus request may be checked after being received. In order to ensure the validity of the consensus request, the consensus request can be verified through a preset public key of the main node, audit information is sent according to a verification result, wherein the audit information comprises confirmation information and doubtful information, and the audit information is broadcasted to the block chain, so that all other nodes in the block chain can receive the audit information. Accordingly, if it is detected that the number of currently received acknowledgement messages exceeds a preset threshold, the preset threshold may be set according to an actual situation, for example, the preset threshold may be two thirds of all nodes in the block chain. If the number of the currently received confirmation information is detected to exceed the preset threshold, most nodes in the representation block chain represent confirmation to the consensus request, namely the consensus is achieved, and at this time, a new block can be generated according to the consensus request. It should be noted that network delay often affects the speed of block generation, for example, a 0.5 second acknowledgement time often results in the next block generator not receiving the block of the previous block generator and generating the next block, and the next block generator ignores the previous block, resulting in a split block chain (two blocks at the same block height). Therefore, in order to reduce the impact of network delay on the block-out speed, each master node may be specified to continuously produce a preset number of blocks, which exceeds a preset minimum threshold and is greater than a preset maximum threshold. That is, each witness is also responsible for the previous block production, but changes from the first 1 produced only to N produced. In the worst case, the last or two of the N blocks may be skipped by the next witness due to network delay or other unexpected reasons, but the first ones of the N blocks will have sufficient time to pass to the next witness. The whole network broadcasting is carried out immediately after each block is produced, and the block producer waits for 0.5 second to produce the next block and receives the confirmation result of other visitors to the previous block. The production of the new block and the receipt of the old block acknowledgement are performed simultaneously. In most cases, the transaction will be confirmed (irreversible) within 1 second. This includes 0.5 seconds of block production and the time required for other witness confirmation. Under the common identification mechanism, when each node generates a new block, the whole network still broadcasts, after other nodes receive the new block, the block is immediately verified, the block with the verified signature is immediately returned to the block outlet node of the new block, and the new block is confirmed without waiting for the other nodes to generate the new block. From the current out-of-block node perspective, the node produces a block and broadcasts throughout the network, and then receives confirmation of the block from other nodes, and at the instant of receiving 2/3 the block (including the transaction therein) is irreversible.
In the block chain consensus method provided by this embodiment, a consensus request initiated by a master node is received, where the consensus request is broadcasted to a block chain after the master node signs a signature with its own private key, and each master node continuously produces a preset number of blocks; verifying the consensus request through a prestored public key of the main node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information; and if the number of the confirmation information exceeds a preset threshold value, generating a new block according to the consensus request. By immediately auditing according to the consensus request after receiving the consensus request, and outputting the block when the confirmation information exceeds a preset threshold value, the block generation efficiency can be improved.
Fig. 2 is a schematic flow chart of a block chain consensus method according to a second embodiment of the present invention, where the method includes:
step 201, receiving a consensus request initiated by a master node, wherein the consensus request is broadcasted to a block chain after the master node signs through a private key of the master node, and each master node continuously produces a preset number of blocks;
step 202, judging the legality of the consensus request through a pre-stored public key of the main node;
step 203, if the consensus request is legal, broadcasting confirmation information into a block chain according to a verification result;
step 204, if the consensus request is illegal, broadcasting the suspect information to the block chain according to the verification result;
step 205, if it is detected that the number of the acknowledgement messages exceeds a preset threshold, generating a new block according to the consensus request.
In this embodiment, after the master node sends the consensus request, the nodes in the blockchain except for the master node may receive the consensus request, and in order to improve the block output efficiency of the blockchain, the consensus request may be checked after receiving the consensus request. In order to ensure the validity of the consensus request, the consensus request can be verified through a preset public key of the main node, and audit information is sent according to a verification result. Specifically, the validity of the consensus request may be determined by a pre-stored public key of the master node, and if the consensus request is determined to be valid, the confirmation information may be broadcast to the block chain according to the verification result, and correspondingly, if the consensus request is determined to be invalid, the doubtful information may be broadcast to the block chain according to the verification result. It is understood that before sending the verification result, each node may encrypt the verification result by its own private key and broadcast the encrypted verification result into the blockchain.
In the block chain consensus method provided in this embodiment, the validity of the consensus request is determined by a pre-stored public key of the master node, if the consensus request is legal, confirmation information is broadcast to the block chain according to a verification result, and if the consensus request is illegal, doubtful information is broadcast to the block chain according to the verification result, so that the validity of the consensus request can be ensured on the basis of improving the block chain block exit efficiency.
Fig. 3 is a schematic flow chart of a block chain consensus method according to a third embodiment of the present invention, where on the basis of any of the foregoing embodiments, as shown in fig. 3, the method further includes:
step 301, receiving a transaction request sent by an initiator, wherein the transaction request is broadcasted to a block chain after the initiator signs a signature through a private key of the initiator, and each master node continuously produces a preset number of blocks;
step 302, judging whether the initiator is a main node;
step 303, if yes, verifying the validity of the transaction request, if the transaction request is legal, storing the transaction request to a preset storage path, and if the transaction request is illegal, deleting the transaction request;
step 304, if not, forwarding the transaction request;
step 305, receiving a consensus request initiated by a master node, wherein the consensus request is broadcasted to a block chain after the master node signs through a private key of the master node;
step 306, verifying the consensus request through a pre-stored public key of the master node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and doubtful information;
and 307, if the number of the confirmation information is detected to exceed a preset threshold value, generating a new block according to the consensus request.
In this embodiment, when the initiator of the transaction in the blockchain initiates a transaction, the transaction request is broadcasted to the whole network after the transaction is signed by using the private key, and accordingly, other nodes in the blockchain can receive the transaction request. After receiving the transaction request, it is first necessary to determine whether the initiator of the transaction request is a preset master node, and if so, the validity of the transaction request may be verified. Specifically, the transaction request may be verified through a pre-stored public key of the initiator, and if the transaction request is verified to be legal, the transaction request may be stored to a preset storage path, and accordingly, if the transaction request is verified to be illegal, the transaction request may be directly deleted. In addition, if it is detected that the initiator of the transaction request is not the master node in the blockchain, the transaction request may not be verified, and the transaction request may be directly forwarded to the blockchain.
In the block chain consensus method provided by this embodiment, a transaction request sent by an initiator is received, where the transaction request is broadcast to a block chain after being signed by a private key of the initiator, and it is determined whether the initiator is a master node, if so, the validity of the transaction request is verified, if the transaction request is legal, the transaction request is stored to a preset storage path, if the transaction request is illegal, the transaction request is deleted, and if not, the transaction request is forwarded, thereby providing a basis for subsequently improving block output efficiency.
Fig. 4 is a schematic flow chart of a block chain consensus method according to a fourth embodiment of the present invention, where on the basis of any of the foregoing embodiments, as shown in fig. 4, the method further includes:
step 401, receiving a consensus request initiated by a master node, wherein the consensus request is broadcasted to a block chain after the master node signs a signature through a private key of the master node, and each master node continuously produces a preset number of blocks;
step 402, verifying the consensus request through a pre-stored public key of the master node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information;
step 403, if the number of the confirmation information is detected to exceed a preset threshold value, generating a new block according to the consensus request;
step 404, if the broadcast information generated by the block is received, deleting the transaction request currently cached.
In this embodiment, a consensus request initiated by a master node is received, the consensus request is verified, and after a block output operation is performed when it is detected that acknowledgement information exceeds a preset threshold, block output information may be broadcasted to a block chain to indicate that a currently output block is successful. Therefore, to further improve the chunking efficiency, other chunks that do not validate the consensus request may delete the currently cached transaction request so that it can validate the next consensus request as soon as possible.
The block chain consensus method provided in this embodiment deletes the transaction request currently cached by receiving the broadcast information generated by the block, thereby effectively increasing the block speed of the block chain.
Fig. 5 is a schematic flow chart of a block chain consensus method according to a fifth embodiment of the present invention, where on the basis of any of the foregoing embodiments, as shown in fig. 5, the method includes:
step 501, receiving a consensus request initiated by the master node according to a block output sequence agreed by each master node in a current block chain, wherein the consensus request is broadcasted to the block chain after the master node signs through a private key of the master node, and each master node continuously produces a preset number of blocks;
step 502, verifying the consensus request through a pre-stored public key of the master node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information;
step 503, if it is detected that the number of the acknowledgement messages exceeds a preset threshold, generating a new block according to the consensus request.
In this embodiment, the network delay often results in low block-out efficiency of the block chain, for example, the acknowledgement time of 0.5 seconds often results in that the next block-out person does not receive the block of the previous block-out person yet, and the next block-out person ignores the previous block if the next block is generated, resulting in a block chain split (two blocks at the same block height). Such as: two nodes with far routing distance on the network, for example, if the network delay of china and the usa is sometimes 300ms, then it is very likely that the witness in the usa will find out its own new block if it does not receive the new block of the witness in china, and then the block of the witness in china will be skipped by the witness in the usa. Therefore, in order to solve the above technical problem, a consensus request initiated by a master node according to the block-out order agreed by each master node in the current block chain may be received. For example, the original random block output sequence may be changed to a block output sequence determined by the uniform negotiation among all the master nodes around the world, so that the master nodes with low network connection delay may output blocks adjacently. Such as: the chinese witness is followed by the korean witness, then followed by the japanese witness, and so on. This may greatly reduce network latency between witnesses. To ensure that everything is done and that no witness is skipped because of network delay, we provide that each witness continues to produce N blocks above a certain minimum threshold, a number less than the maximum number threshold, i.e., each witness is still responsible for the previous block production, but changes from the first 1 produced only to N produced. In the worst case, the last or two of the N blocks may be skipped by the next witness due to network delay or other unexpected reasons, but the first ones of the N blocks will have sufficient time to pass to the next witness. The whole network broadcasting is carried out immediately after each block is produced, and the block producer waits for 0.5 second to produce the next block and receives the confirmation result of other visitors to the previous block. The production of the new block and the receipt of the old block acknowledgement are performed simultaneously. In most cases, the transaction will be confirmed (irreversible) within 1 second. This includes 0.5 seconds of block production and the time required for other witness confirmation. Once the block reaches the irreversible state (2/3 witness confirmation), forking cannot be performed before, ensuring permanent trust of the transaction. In addition, even if most witnesses want to branch the block chain, the block chain can only compete with the main chain at the same speed (0.5 second), and even if only one witness is left in the main chain, the branch chain can never catch up with the main chain, so that the stability of the system is ensured.
In the block chain consensus method provided in this embodiment, the host node receives a consensus request initiated according to the block output sequence agreed by each host node in the current block chain, so that the stability of the block chain can be ensured on the basis of improving the block output efficiency of the block chain.
Fig. 6 is a schematic structural diagram of a block chain consensus device according to a sixth embodiment of the present invention, where as shown in fig. 6, the device includes:
a consensus request receiving module 61, configured to receive a consensus request initiated by a master node, where the consensus request is broadcasted to a block chain after being signed by the master node through a private key of the master node, and each master node continuously produces a preset number of blocks;
the first verification module 62 is configured to verify the consensus request by using a pre-stored public key of the master node, and send verification information according to a verification result, where the verification information includes confirmation information and suspicion information;
a generating module 63, configured to generate a new block according to the consensus request if it is detected that the number of the acknowledgement messages exceeds a preset threshold.
Further, on the basis of any of the above embodiments, the verification module includes:
the verification unit is used for judging the legality of the consensus request through a pre-stored public key of the main node;
the first processing unit is used for broadcasting confirmation information to the block chain according to a verification result if the consensus request is legal;
and the second processing unit is used for broadcasting the doubtful information to the block chain according to the verification result if the consensus request is illegal.
Further, on the basis of any one of the above embodiments, the apparatus further includes:
the system comprises a transaction request receiving module, a block chain sending module and a block processing module, wherein the transaction request receiving module is used for receiving a transaction request sent by an initiator, and the transaction request is broadcasted to the block chain after the initiator signs through a private key of the initiator;
the judging module is used for judging whether the initiator is a main node or not;
the second verification module is used for verifying the validity of the transaction request if the transaction request is legal, storing the transaction request to a preset storage path if the transaction request is legal, and deleting the transaction request if the transaction request is illegal;
and the forwarding module is used for forwarding the transaction request if the transaction request is not received.
Further, on the basis of any one of the above embodiments, the apparatus further includes:
a deleting module for deleting the transaction request currently cached if the broadcast information generated by the block is received,
further, on the basis of any of the above embodiments, the consensus request receiving module includes:
a request receiving unit, configured to receive a consensus request initiated by the master node according to a block-out sequence agreed by each master node in the current block chain.
Fig. 7 is a schematic structural diagram of a blockchain consensus apparatus according to a seventh embodiment of the present invention, where as shown in fig. 7, the blockchain consensus apparatus includes: a memory 71, a processor 72;
a memory 71; a memory 71 for storing instructions executable by the processor 72;
wherein the processor 72 is configured to execute the blockchain consensus method according to any of the above embodiments by the processor 72.
Yet another embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the block chain consensus method according to any one of the above embodiments is implemented.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (6)

1. A block chain consensus method, comprising:
receiving a consensus request initiated by a main node, wherein the consensus request is broadcasted to a block chain after the main node signs through a private key of the main node, and each main node continuously produces a preset number of blocks;
verifying the consensus request through a prestored public key of the main node, and sending verification information according to a verification result, wherein the verification information comprises confirmation information and suspicion information;
if the number of the confirmation information exceeds a preset threshold value, generating a new block according to the consensus request;
the verifying the consensus request through a pre-stored public key of the master node, and sending audit information according to a verification result, comprising:
judging the legality of the consensus request through a pre-stored public key of the main node;
if the consensus request is legal, broadcasting confirmation information to the block chain according to a verification result;
if the consensus request is illegal, the doubtful information is broadcasted to the block chain according to the verification result;
before receiving a consensus request initiated by a host node, receiving a transaction request sent by an initiator, wherein the transaction request is broadcasted to a block chain after the initiator signs through a private key of the initiator, and the method comprises the following steps:
judging whether the initiator is a main node or not;
if the transaction request is legal, verifying the legality of the transaction request, if the transaction request is legal, storing the transaction request to a preset storage path, and if the transaction request is illegal, deleting the transaction request.
2. The method of claim 1, wherein after generating a new block according to the consensus request if the number of the detected acknowledgment messages exceeds a predetermined threshold, further comprising:
and if the broadcast information generated by the block is received, deleting the transaction request currently cached.
3. The method according to claim 1 or 2, wherein the receiving of the consensus request initiated by the master node comprises:
and receiving a consensus request initiated by the main node according to the block output sequence agreed by each main node in the current block chain.
4. A blockchain consensus apparatus, comprising:
the system comprises a consensus request receiving module, a block chain sending module and a block chain receiving module, wherein the consensus request receiving module is used for receiving a consensus request initiated by a main node, the consensus request is broadcasted to the block chain after the main node signs through a private key of the main node, and each main node continuously produces a preset number of blocks;
the first verification module is used for verifying the consensus request through a prestored public key of the main node and sending verification information according to a verification result, wherein the verification information comprises confirmation information and doubtful information;
the generating module is used for generating a new block according to the consensus request if the number of the confirmation information is detected to exceed a preset threshold value;
the system comprises a transaction request receiving module, a block chain sending module and a block processing module, wherein the transaction request receiving module is used for receiving a transaction request sent by an initiator, and the transaction request is broadcasted to the block chain after the initiator signs through a private key of the initiator;
the judging module is used for judging whether the initiator is a main node or not;
the second verification module is used for verifying the validity of the transaction request if the transaction request is legal, storing the transaction request to a preset storage path if the transaction request is legal, and deleting the transaction request if the transaction request is illegal;
the forwarding module is used for forwarding the transaction request if the transaction request is not received;
the first authentication module includes:
the verification unit is used for judging the legality of the consensus request through a pre-stored public key of the main node;
the first processing unit is used for broadcasting confirmation information to the block chain according to a verification result if the consensus request is legal;
and the second processing unit is used for broadcasting the doubtful information to the block chain according to the verification result if the consensus request is illegal.
5. A blockchain consensus device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the blockchain consensus method of any one of claims 1-3 by the processor.
6. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, are configured to implement the block chain consensus method according to any one of claims 1-3.
CN201910073385.7A 2019-01-25 2019-01-25 Block chain consensus method, device, equipment and computer readable storage medium Active CN109831425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910073385.7A CN109831425B (en) 2019-01-25 2019-01-25 Block chain consensus method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910073385.7A CN109831425B (en) 2019-01-25 2019-01-25 Block chain consensus method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109831425A CN109831425A (en) 2019-05-31
CN109831425B true CN109831425B (en) 2022-02-15

Family

ID=66862405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910073385.7A Active CN109831425B (en) 2019-01-25 2019-01-25 Block chain consensus method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109831425B (en)

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110223174B (en) * 2019-05-23 2021-07-09 北京清红微谷技术开发有限责任公司 Block transaction accounting method and system, data processing terminal and block chain system
CN110351067B (en) * 2019-06-12 2023-04-07 南京理工大学 Block chain consensus method for master-slave multi-chains
CN110300167B (en) * 2019-06-28 2020-07-31 京东数字科技控股有限公司 Service information processing method and device based on block chain and readable storage medium
CN110460661A (en) * 2019-08-09 2019-11-15 成都薇米创想科技有限公司 A kind of common recognition algorithm based on block chain
CN110517141B (en) * 2019-08-27 2023-06-13 深圳前海微众银行股份有限公司 Consensus method and device based on block chain system
CN110648234B (en) * 2019-09-12 2022-08-19 广州蚁比特区块链科技有限公司 Block generation method and device
CN110597918A (en) * 2019-09-23 2019-12-20 腾讯科技(深圳)有限公司 Account management method and device and computer readable storage medium
CN110661658B (en) * 2019-09-23 2022-08-12 腾讯科技(深圳)有限公司 Node management method and device of block chain network and computer storage medium
CN110990408B (en) * 2019-12-02 2023-09-19 中国银行股份有限公司 Business information collaboration method based on block chain, business system and alliance chain
CN111131399B (en) * 2019-12-03 2021-11-26 北京海益同展信息科技有限公司 Method and device for dynamically increasing consensus nodes in block chain
CN112910648B (en) * 2019-12-03 2023-04-07 北京百度网讯科技有限公司 Consensus method and device for privacy states of block chain
CN112994891B (en) * 2019-12-18 2023-07-14 中国移动通信集团浙江有限公司 Transaction request consensus method and system based on threshold signature
CN111242778B (en) * 2019-12-31 2023-07-28 布比(北京)网络技术有限公司 Data processing method, device, computer equipment and storage medium
CN111445241A (en) * 2020-02-28 2020-07-24 杭州泛链科技有限公司 Hybrid consensus method and device combining POW and POS
CN111368343B (en) * 2020-03-31 2022-11-01 北京俩撇科技有限公司 Block chain system, data storage method and device
CN113495920B (en) * 2020-04-02 2023-06-16 国家广播电视总局广播电视科学研究院 Content auditing system, method and device based on blockchain and storage medium
CN111524011B (en) * 2020-05-06 2023-05-30 杭州复杂美科技有限公司 Parallel link consensus validation method, apparatus, and storage medium
CN111600960A (en) * 2020-05-22 2020-08-28 昆明大棒客科技有限公司 Switching method of hybrid consensus mechanism in block chain and related equipment
CN111723406B (en) * 2020-06-08 2023-04-28 上海朝夕网络技术有限公司 Block chain consensus algorithm and system
CN111711526B (en) * 2020-06-16 2024-03-26 深圳前海微众银行股份有限公司 Method and system for consensus of block chain nodes
CN112118239B (en) * 2020-09-03 2022-01-11 腾讯科技(深圳)有限公司 Block chain consensus method and device, electronic equipment and storage medium
CN112507019A (en) * 2020-11-20 2021-03-16 南京航空航天大学 PBFT consensus system and method based on intelligent contracts
CN112541763A (en) * 2020-12-11 2021-03-23 军工保密资格审查认证中心 Block consensus approval method and device for block chain manager
CN112907369B (en) * 2021-02-08 2022-04-12 网易(杭州)网络有限公司 Block chain-based data consensus method and device, electronic equipment and storage medium
CN113014635A (en) * 2021-02-19 2021-06-22 卓尔智联(武汉)研究院有限公司 Node type division method and device of block chain system and block chain system
CN112988893B (en) * 2021-03-15 2023-05-12 中国联合网络通信集团有限公司 Information management method, system, block chain node and medium based on block chain
CN113225191B (en) * 2021-03-24 2024-02-13 湖南宸瀚信息科技有限责任公司 Generation method and device of consensus node, storage medium and processor

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656974A (en) * 2016-10-17 2017-05-10 江苏通付盾科技有限公司 Block chain grouping consensus method and system
CN106789095A (en) * 2017-03-30 2017-05-31 腾讯科技(深圳)有限公司 Distributed system and message treatment method
CN107196900A (en) * 2017-03-24 2017-09-22 阿里巴巴集团控股有限公司 A kind of method and device for verification of knowing together
CN107392611A (en) * 2017-03-24 2017-11-24 阿里巴巴集团控股有限公司 A kind of method and device for sending Transaction Information and common recognition checking
CN107395659A (en) * 2017-03-28 2017-11-24 阿里巴巴集团控股有限公司 A kind of method and device of service handling and common recognition
CN108122165A (en) * 2017-12-15 2018-06-05 北京中电普华信息技术有限公司 A kind of block chain common recognition method and system
CN108985772A (en) * 2018-07-02 2018-12-11 上海达家迎信息科技有限公司 A kind of verification method, device, equipment and the storage medium of block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10230756B2 (en) * 2015-11-25 2019-03-12 International Business Machines Corporation Resisting replay attacks efficiently in a permissioned and privacy-preserving blockchain network
CN107395353B (en) * 2017-04-24 2020-01-31 阿里巴巴集团控股有限公司 block chain consensus method and device
US11922363B2 (en) * 2017-07-05 2024-03-05 United Parcel Service Of America, Inc. Counterparty physical proximity verification for digital asset transfers
CN108182635A (en) * 2017-12-18 2018-06-19 深圳前海微众银行股份有限公司 Block chain common recognition method, system and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656974A (en) * 2016-10-17 2017-05-10 江苏通付盾科技有限公司 Block chain grouping consensus method and system
CN107196900A (en) * 2017-03-24 2017-09-22 阿里巴巴集团控股有限公司 A kind of method and device for verification of knowing together
CN107392611A (en) * 2017-03-24 2017-11-24 阿里巴巴集团控股有限公司 A kind of method and device for sending Transaction Information and common recognition checking
CN107395659A (en) * 2017-03-28 2017-11-24 阿里巴巴集团控股有限公司 A kind of method and device of service handling and common recognition
CN106789095A (en) * 2017-03-30 2017-05-31 腾讯科技(深圳)有限公司 Distributed system and message treatment method
CN108122165A (en) * 2017-12-15 2018-06-05 北京中电普华信息技术有限公司 A kind of block chain common recognition method and system
CN108985772A (en) * 2018-07-02 2018-12-11 上海达家迎信息科技有限公司 A kind of verification method, device, equipment and the storage medium of block chain

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
【许晓笛】详解 EOS 的新共识机制 BFT-DPoS_圆方圆学院的博客-CSDN博客;佚名;《https://blog.csdn.net/yuanfangyuan_block/article/details/79872614》;20180409;正文第1-3页 *
EOS 高吞吐量的杀手锏 BFT-DPoS;佚名;《https://zhuanlan.zhihu.com/p/52306079》;20181213;正文第1-4页 *
EOS.IO Technical White Paper v2;佚名;《https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md》;20180316;全文 *
区块链共识算法的发展现状与展望;袁勇;《自动化学报》;20180927;第44卷(第11期);全文 *

Also Published As

Publication number Publication date
CN109831425A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN109831425B (en) Block chain consensus method, device, equipment and computer readable storage medium
CN109936457B (en) Block chain multi-party witness method, device, equipment and computer readable storage medium
CN107483509B (en) A kind of auth method, server and readable storage medium storing program for executing
CN106385319B (en) Method and system for verifying information in block chain network
CN107171810B (en) Verification method and device of block chain
KR102019211B1 (en) Method for generating block chain capable of overcoming byzantine fault
KR20170137388A (en) A method for ensuring integrity by using a blockchain technology
CN110177124B (en) Identity authentication method based on block chain and related equipment
CN109408595B (en) Block chain accounting method, device and computer readable storage medium
US11366932B2 (en) Consensus method and data verification method, apparatus, and system of consortium blockchain
CN111314067A (en) Block storage method and device, computer equipment and storage medium
CN112600678B (en) Data processing method, device, equipment and storage medium
CN108768618B (en) IP soft core authorization method, device and medium based on block chain
CN111275438A (en) Consensus method, device, equipment and storage medium for block chain network
CN113536284A (en) Method, device, equipment and storage medium for verifying digital certificate
CN110719167A (en) Block chain-based signcryption method with timeliness
CN111371556B (en) Block link point accounting method, device, equipment and storage medium
CN112101945B (en) Method and system for supervising block chain content
CN112994891B (en) Transaction request consensus method and system based on threshold signature
CN112118292A (en) Method, apparatus, network node and storage medium for cross-link communication
CN111553672A (en) Data processing method and device, electronic equipment and storage medium
CN110730186A (en) Token issuing method, accounting node and medium based on block chain
CN115102697A (en) Method, device and storage medium for realizing participation of two transaction parties on blockchain in generation of random number
CN115396443A (en) Time factor-based alliance chain consensus method, device, equipment and storage medium
CN112907246B (en) BFT protocol and PoW mechanism-based block chain consensus protocol implementation method and system

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