CN110896389A - Block chain consensus method and device - Google Patents

Block chain consensus method and device Download PDF

Info

Publication number
CN110896389A
CN110896389A CN201811063657.7A CN201811063657A CN110896389A CN 110896389 A CN110896389 A CN 110896389A CN 201811063657 A CN201811063657 A CN 201811063657A CN 110896389 A CN110896389 A CN 110896389A
Authority
CN
China
Prior art keywords
node
consensus
confirmed
service data
controlling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811063657.7A
Other languages
Chinese (zh)
Other versions
CN110896389B (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.)
Potevio Information Technology Co Ltd
Original Assignee
Potevio 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 Potevio Information Technology Co Ltd filed Critical Potevio Information Technology Co Ltd
Priority to CN201811063657.7A priority Critical patent/CN110896389B/en
Publication of CN110896389A publication Critical patent/CN110896389A/en
Application granted granted Critical
Publication of CN110896389B publication Critical patent/CN110896389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a block chain consensus method and a block chain consensus device, wherein the method comprises the following steps: when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively; when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block; the accounting node is randomly obtained from the consensus nodes in the consensus set; and controlling each consensus node in the consensus set to perform consensus on the blocks. The embodiment of the invention improves the consensus efficiency.

Description

Block chain consensus method and device
Technical Field
The embodiment of the invention relates to the technical field of block chains, in particular to a block chain consensus method and device.
Background
The consensus algorithm of the blockchain is used to guarantee the data to be untrustworthy and not forged. The consensus algorithm enables a newly generated block to achieve consensus on the whole network within an acceptable time through multi-node joint calculation and network propagation.
Currently, the most widely used blockchain consensus algorithm is Proof of Work (POW), but the POW consensus efficiency is low and causes huge power waste. The later proposed Proof of equity (POS) and authorized Proof of equity (DPOS) both solve the problem of power waste to some extent, but POS is mainly developed for application in the financial field, needs to be issued by means of Initial Public Offering (IPO), and therefore often needs to be used in combination with POW, and the consensus efficiency is not high; the DPOS has the problems of low voting enthusiasm, improper processing of malicious nodes and the like, and the consensus efficiency is also low.
Disclosure of Invention
The embodiment of the invention provides a block chain consensus method and a block chain consensus device, which are used for solving the problem of low consensus efficiency of a consensus algorithm in the prior art.
In view of the foregoing problems, in a first aspect, an embodiment of the present invention provides a method for identifying a blockchain, where the method includes:
when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively;
when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set;
controlling each consensus node in the consensus set to agree on the block.
In a second aspect, an embodiment of the present invention provides an apparatus for block chain consensus, where the apparatus includes:
the system comprises a first control module, a second control module and a third control module, wherein the first control module is used for controlling a verification node in a first node set and each common identification node in a common identification set to carry out validity verification on service data to be confirmed when detecting that the first node set in a plurality of node sets in a block chain network generates the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively;
the second control module is used for controlling an accounting node in the consensus set to account the to-be-confirmed service data within a preset time range and generate a block when detecting that the verification node in the first node set and each consensus node in the consensus set verify that the to-be-confirmed service data is legal; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set;
and the third control module is used for controlling each consensus node in the consensus set to perform consensus on the block.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the block chain consensus method when executing the computer program.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the block chain consensus method.
The consensus method and device for block chains provided by the embodiments of the present invention obtain node sets by aggregating based on seed nodes authorized in advance, and then select at least one consensus node from each node set to form a consensus set, when it is detected that a first node set of a plurality of node sets generates to-be-confirmed service data and both the first node set and the consensus set verify that the to-be-confirmed service data is legal, control a node generated in the consensus set to account for the to-be-confirmed service data and generate a block, and then control each consensus node in the consensus set to perform consensus on the block, so that the to-be-confirmed service data newly generated in a block chain network can be quickly verified by the consensus node and generate a block, and thus a newly generated block can be quickly identified by the consensus nodes in the consensus set, and further, based on the relation between the consensus set and the node set, the total network consensus is achieved, the consensus efficiency of the blocks in the block chain network is improved, the total network consensus is rapidly achieved in the block chain network of the alliance, and the problem of low consensus efficiency in the prior art is solved.
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 those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating the steps of a block chain consensus method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a block chain consensus device according to an embodiment of the present invention;
fig. 3 shows a block diagram of an electronic device in an embodiment of the 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 embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, which is a flowchart illustrating a method for identifying a blockchain according to an embodiment of the present invention, the method includes the following steps:
step 101: when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed.
In this step, specifically, the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively.
In addition, specifically, in this embodiment, a preset number of nodes in the first node set may be defined as the verification nodes in advance, that is, when the blockchain network is started, the preset number of verification nodes in the first node set may be initialized.
In this way, in this embodiment, first all nodes in the blockchain network are aggregated to obtain a plurality of node sets, and then at least one consensus node is elected from each node set to form a consensus set, so that when service data to be confirmed is generated in the blockchain network, which node set is generated can be known definitely. At this time, if it is detected that any one node set (defined as a first node set) in the plurality of node sets generates the service data to be confirmed, each common identification node in the first node set and the common identification set may be directly controlled to perform validity verification on the service data to be confirmed, so that validity verification efficiency is ensured and validity verification accuracy is provided.
When the verification node in the first node set and each common identification node in the common identification set are controlled to carry out validity verification on the service data to be confirmed, when the first node set in a plurality of node sets in a block chain network is detected to generate the service data to be confirmed, the verification node in the first node set is controlled to carry out validity verification on the service data to be confirmed; then when the verification node verifies that the service data to be confirmed is legal, controlling the node generating the service data to be confirmed in the first node set to flood the service data to be confirmed to each node in the first node set; and finally, when detecting that the common identification node obtained by election in the first node set receives the service data to be confirmed, controlling the common identification node obtained by election in the first node set to flood the service data to be confirmed to each common identification node in the common identification set, and controlling each common identification node in the common identification set to respectively carry out validity verification on the service data to be confirmed.
Specifically, each common node in the common node set is generated by a node in the node set, so that when the service data to be confirmed is flooded to each node in the first node set, the service data to be confirmed is flooded to the common node generated in the first node set, and at this time, the first node set and the common node set establish a connection based on the common node, so that the common node in the first node set can be controlled to flood the service data to be confirmed to each common node in the common node set.
Therefore, when the first node set verifies that the service data to be confirmed is legal and floods to each node in the first set, the common identification node selected from the first node set is controlled to flood the service data to be confirmed to each common identification node in the common identification set, complexity of a confirming process of illegal service data to be confirmed is avoided, and filtering efficiency of illegal service data to be confirmed is improved.
Step 102: when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block.
In this step, specifically, the accounting node is randomly obtained from the consensus nodes in the consensus set. That is, when the consensus set is obtained by election, an accounting node can be selected from the consensus set by using a random algorithm, and the accounting node accounts the service data to be confirmed in a preset time range and generates a block.
It should be noted that, one accounting node records all the to-be-confirmed service data in a preset time range according to the time stamp, and another accounting node can concurrently account for the to-be-confirmed service data in another time range at the same time, that is, different accounting nodes can concurrently record the to-be-confirmed service data in different time ranges, so as to ensure the accounting efficiency.
Step 103: and controlling each consensus node in the consensus set to perform consensus on the blocks.
In this step, specifically, after the block is generated by the accounting node, each consensus node in the consensus set may be controlled to perform consensus on the block.
When controlling each consensus node in the consensus set to perform consensus on the block, the accounting node in the consensus set may be controlled to flood the block to each consensus node in the consensus set, and control each consensus node in the consensus set to perform consensus on the block respectively.
Specifically, since the accounting node is a randomly selected consensus node in the consensus set, the accounting node can be directly controlled to flood the block to each consensus node in the consensus set, so that consensus of each consensus node on the block is completed.
In addition, after controlling each common node in the common node set to perform common identification on the block, for each common node in the common node set, controlling each common node to forward the block to the node set elected to obtain the common node, so that the node set forwarded to obtain the block completes flooding on the block.
Therefore, after each common node in the common identification set performs common identification on the block, the common node in the common identification set can be controlled to forward the block to the node set generating the common node, and the common node is generated in each node set, so that the block can be forwarded to all the node sets, the block can be controlled to flood to all the nodes in all the node sets, and the uplink process of all the nodes in the block chain network is completed.
In this embodiment, all nodes in the block chain network are aggregated to obtain a plurality of node sets, then at least one consensus node is obtained from each node set to form a consensus set, when it is detected that a first node set in the plurality of node sets generates service data to be confirmed and the first node set and the consensus set both verify that the service data to be confirmed is legal, the accounting node generated in the consensus set is controlled to account the service data to be confirmed and generate a block, then each consensus node in the consensus set is controlled to perform consensus on the block, so that the service data to be confirmed newly generated in the block chain network can be quickly verified by the consensus node and generate a block, and thus the newly generated block can be quickly identified by the consensus node in the consensus set, and further based on the relationship between the consensus set and the node sets, the method achieves the total network consensus, improves the consensus efficiency of the blocks in the block chain network, achieves the rapid achievement of the total network consensus in the block chain network of the alliance, and solves the problem of low consensus efficiency in the prior art.
Further, before controlling each of the verification node in the first node set and the consensus node in the consensus set to perform validity verification on the service data to be confirmed, the node set and the consensus set in the block chain network also need to be acquired.
Specifically, when the node set and the consensus set in the block chain network are obtained, a plurality of seed nodes authorized in advance and the block forwarding times of each node in the block chain network may be obtained first; then according to the block forwarding times of each node in the block chain network, all nodes in the block chain network are aggregated to obtain a plurality of node sets respectively based on at least one seed node; aiming at each node set, controlling other node sets except the aimed node set in the node sets to select at least one consensus node from the aimed node set through a preset election algorithm; and finally, forming the consensus set by all the consensus nodes elected from all the node sets.
Specifically, in this embodiment, a node authorized offline in advance may be recorded as a seed node, and the seed node authorized offline is generated in each service system owned by a federation member in the area chain network, has stable bandwidth and storage resources, and can ensure online time. In addition, the number of the seed nodes is larger than that of the node sets, and each node set can be rebuilt according to a time period so as to ensure the accuracy of the established node sets.
In addition, specifically, it should be noted that in this embodiment, when all nodes in the blockchain network are aggregated based on at least one seed node to obtain a plurality of node sets, the nodes with the block forwarding times greater than the preset value may be aggregated to obtain one node set based on one seed node, and the nodes with the block forwarding times greater than the preset value may also be aggregated to obtain one node set based on more than two seed nodes until all nodes are aggregated, that is, the number of seed nodes included in one node set is not limited herein.
In addition, specifically, the nodes in the node set include nodes at the same level and/or multiple levels of nodes, that is, the present embodiment does not limit the number of levels in which the nodes are located, so that a multi-level dynamic node set is adopted, which provides convenience for consensus of a federation chain.
In addition, specifically, after the node set is obtained, other node sets may be controlled to obtain the consensus node of the node set through election by using a preset election algorithm. Wherein the number of all the consensus nodes elected from all the node sets is an odd number. Of course, the number of consensus nodes generated by electing within a node set is not limited herein, and the consensus set is re-elected as the node set is established. The conditions of the preset election algorithm may include a network response speed, a lifetime in the blockchain network, and the like.
In this way, in this embodiment, by acquiring the node set and the consensus set in the blockchain network, the service data to be confirmed and the block can be verified and consensus in the node set and the consensus set, and based on the relationship that all the consensus nodes in one consensus set are from all the node sets, the consensus efficiency of the block is provided.
In addition, as shown in fig. 2, the apparatus for identifying a block chain in an embodiment of the present invention includes:
a first control module 201, configured to control a verification node in a first node set and each common identification node in a common identification set to perform validity verification on to-be-confirmed service data when detecting that the to-be-confirmed service data is generated by the first node set in a plurality of node sets in a blockchain network; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively;
a second control module 202, configured to, when it is detected that the verification node in the first node set and each of the consensus nodes in the consensus set verify that the to-be-confirmed service data is legal, control an accounting node in the consensus set to account for the to-be-confirmed service data within a preset time range and generate a block; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set;
a third control module 203 for controlling each consensus node in the consensus set to consensus on the block.
Optionally, the apparatus further comprises:
an obtaining module, configured to obtain a node set and a consensus set in the blockchain network;
the acquisition module includes:
the first acquisition unit is used for acquiring a plurality of seed nodes authorized in advance and the block forwarding times of each node in the block chain network;
a second obtaining unit, configured to aggregate all nodes in the blockchain network to obtain a plurality of node sets based on at least one seed node according to the block forwarding frequency of each node in the blockchain network;
a third obtaining unit, configured to control, for each node set, other node sets, except for the targeted node set, in the multiple node sets to select at least one common node from the targeted node set through a preset election algorithm;
and the fourth acquisition unit is used for forming the consensus set by all the consensus nodes elected from all the node sets.
Optionally, the first control module 201 includes:
the system comprises a first control unit, a second control unit and a third control unit, wherein the first control unit is used for controlling a verification node in a first node set to carry out validity verification on service data to be confirmed when the fact that the first node set in a plurality of node sets in a block chain network generates the service data to be confirmed is detected;
a second control unit, configured to control, when it is detected that the verification node verifies that the to-be-confirmed service data is valid, a node in the first node set that generates the to-be-confirmed service data to flood the to-be-confirmed service data to each node in the first node set;
and a third control unit, configured to, when it is detected that the service data to be confirmed is received by the consensus node elected from the first node set, control the consensus node elected from the first node set to flood the service data to be confirmed to each consensus node in the consensus set, and control each consensus node in the consensus set to perform validity verification on the service data to be confirmed respectively.
Optionally, the third control module 203 is configured to control an accounting node in the consensus set to flood the block to each consensus node in the consensus set, and control each consensus node in the consensus set to respectively perform consensus on the block.
Optionally, the apparatus further comprises:
and a fourth control module, configured to control, for each common node in the common node set, each common node to forward the block to the node set elected to obtain the common node, so that the node set forwarded to obtain the block completes flooding of the block.
The block chain consensus device provided in this embodiment obtains a plurality of node sets by aggregating all nodes in a block chain network, and then obtains at least one consensus node from each node set to form a consensus set by selecting, when it is detected that a first node set in the plurality of node sets generates to-be-confirmed service data and both the first node set and the consensus set verify that the to-be-confirmed service data is legal, controls a billing node generated in the consensus set to bill the to-be-confirmed service data and generate a block, and then controls each consensus node in the consensus set to perform consensus on the block, so that the to-be-confirmed service data newly generated in the block chain network can be quickly verified by the consensus node and generate the block, and thus the newly generated block can be quickly identified by the consensus node in the consensus set, and further based on a relationship between the consensus set and the node sets, the method achieves the total network consensus, improves the consensus efficiency of the blocks in the block chain network, and achieves the rapid total network consensus in the block chain network of the alliance.
It should be noted that, in the embodiment of the present invention, the related functional modules may be implemented by a hardware processor (hardware processor), and the same technical effect can be achieved, which is not described herein again.
In yet another embodiment of the present invention, an electronic device is provided, as shown in fig. 3, which includes a memory (memory)301, a processor (processor)302, and a computer program stored on the memory 301 and executable on the processor 302. The memory 301 and the processor 302 complete communication with each other through the bus 303. The processor 302 is configured to call program instructions in the memory 301 to perform the following method: when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively; when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set; controlling each consensus node in the consensus set to agree on the block.
The electronic device provided by the embodiment of the invention can execute specific steps in the block chain consensus method and can achieve the same technical effect, and the specific steps are not described herein.
Further, the program instructions in the memory 301 may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In a further embodiment of the invention, a non-transitory computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, is operative to perform the method of: when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively; when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set; controlling each consensus node in the consensus set to agree on the block.
The non-transitory computer-readable storage medium provided by the embodiment of the present invention can perform specific steps in the block chain consensus method, and can achieve the same technical effects, which are not described in detail herein.
In yet another embodiment of the present invention, a computer program product is provided, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that when executed by a computer perform the method of: when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively; when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set; controlling each consensus node in the consensus set to agree on the block.
The computer program product provided by the embodiment of the present invention can execute specific steps in the block chain consensus method, and can achieve the same technical effect, which is not described in detail herein.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A method for block chain consensus, the method comprising:
when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set and each common identification node in the common identification set to carry out validity verification on the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively;
when detecting that the verification node in the first node set and each common identification node in the common identification set verify that the service data to be confirmed is legal, controlling an accounting node in the common identification set to account for the service data to be confirmed in a preset time range and generating a block; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set;
controlling each consensus node in the consensus set to agree on the block.
2. The method according to claim 1, wherein before controlling the validation node in the first node set and each of the consensus nodes in the consensus set to validate the service data to be validated, the method further comprises:
acquiring a node set and a consensus set in the block chain network; wherein the content of the first and second substances,
the acquiring a node set and a consensus set in the blockchain network includes:
obtaining a plurality of seed nodes authorized in advance and the block forwarding times of each node in the block chain network;
according to the block forwarding times of each node in the block chain network, aggregating all nodes in the block chain network based on at least one seed node respectively to obtain a plurality of node sets;
for each node set, controlling other node sets except the targeted node set in the node sets to select at least one consensus node from the targeted node set through a preset election algorithm;
and forming the consensus set by all the consensus nodes elected from all the node sets.
3. The method of claim 1, wherein when it is detected that a first node set of a plurality of node sets generates the traffic data to be confirmed in the blockchain network, controlling a verification node in the first node set and each common identification node in the common identification set to perform validity verification on the traffic data to be confirmed comprises:
when detecting that a first node set in a plurality of node sets in a block chain network generates service data to be confirmed, controlling a verification node in the first node set to carry out validity verification on the service data to be confirmed;
when the verification node verifies that the service data to be confirmed is legal, controlling the node generating the service data to be confirmed in the first node set to flood the service data to be confirmed to each node in the first node set;
when detecting that the common identification node elected in the first node set receives the service data to be confirmed, controlling the common identification node elected in the first node set to flood the service data to be confirmed to each common identification node in the common identification set, and controlling each common identification node in the common identification set to respectively carry out validity verification on the service data to be confirmed.
4. The method of claim 1, wherein the controlling each consensus node in the consensus set to agree on the block comprises:
and controlling accounting nodes in the consensus set to flood the blocks to each consensus node in the consensus set, and controlling each consensus node in the consensus set to respectively perform consensus on the blocks.
5. The method of claim 1, wherein after controlling each consensus node in the consensus set to agree on the block, the method further comprises:
and for each common node in the common node set, controlling each common node to forward the block to the node set which obtains the common node by election, so that the node set which obtains the block by forwarding completes the flooding of the block.
6. An apparatus for block chain consensus, the apparatus comprising:
the system comprises a first control module, a second control module and a third control module, wherein the first control module is used for controlling a verification node in a first node set and each common identification node in a common identification set to carry out validity verification on service data to be confirmed when detecting that the first node set in a plurality of node sets in a block chain network generates the service data to be confirmed; the node set is obtained by aggregating seed nodes authorized in advance, and the consensus nodes in the consensus set are obtained by electing from each node set respectively;
the second control module is used for controlling an accounting node in the consensus set to account the to-be-confirmed service data within a preset time range and generate a block when detecting that the verification node in the first node set and each consensus node in the consensus set verify that the to-be-confirmed service data is legal; wherein the accounting node is randomly obtained from the consensus nodes in the consensus set;
and the third control module is used for controlling each consensus node in the consensus set to perform consensus on the block.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the block chain consensus method according to one of the claims 1 to 5 when executing the computer program.
8. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the block chain consensus method according to one of the claims 1 to 5.
CN201811063657.7A 2018-09-12 2018-09-12 Block chain consensus method, electronic equipment and computer-readable storage medium Active CN110896389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811063657.7A CN110896389B (en) 2018-09-12 2018-09-12 Block chain consensus method, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811063657.7A CN110896389B (en) 2018-09-12 2018-09-12 Block chain consensus method, electronic equipment and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN110896389A true CN110896389A (en) 2020-03-20
CN110896389B CN110896389B (en) 2022-03-15

Family

ID=69785087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811063657.7A Active CN110896389B (en) 2018-09-12 2018-09-12 Block chain consensus method, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN110896389B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111612445A (en) * 2020-05-21 2020-09-01 腾讯科技(深圳)有限公司 Data processing method, system, device and storage medium based on block chain
CN112039860A (en) * 2020-08-18 2020-12-04 上海简苏网络科技有限公司 Method and device for realizing joint consensus fragmentation in alliance chain
CN114650289A (en) * 2020-12-02 2022-06-21 王志诚 Method and device for block chain consensus
CN114826626A (en) * 2022-07-01 2022-07-29 得分数字科技(珠海)有限公司 Consensus node election method and device, storage medium and node equipment
CN115242497A (en) * 2022-07-21 2022-10-25 贵州风雷科技有限公司 Block chain-based data tamper-proof method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450981A (en) * 2017-05-31 2017-12-08 阿里巴巴集团控股有限公司 A kind of block chain common recognition method and apparatus
CN107864198A (en) * 2017-11-07 2018-03-30 济南浪潮高新科技投资发展有限公司 A kind of block chain common recognition method based on deep learning training mission
WO2018156763A1 (en) * 2017-02-22 2018-08-30 Alibaba Group Holding Limited Business verification method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018156763A1 (en) * 2017-02-22 2018-08-30 Alibaba Group Holding Limited Business verification method and apparatus
CN107450981A (en) * 2017-05-31 2017-12-08 阿里巴巴集团控股有限公司 A kind of block chain common recognition method and apparatus
CN107864198A (en) * 2017-11-07 2018-03-30 济南浪潮高新科技投资发展有限公司 A kind of block chain common recognition method based on deep learning training mission

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111612445A (en) * 2020-05-21 2020-09-01 腾讯科技(深圳)有限公司 Data processing method, system, device and storage medium based on block chain
CN112039860A (en) * 2020-08-18 2020-12-04 上海简苏网络科技有限公司 Method and device for realizing joint consensus fragmentation in alliance chain
CN114650289A (en) * 2020-12-02 2022-06-21 王志诚 Method and device for block chain consensus
CN114826626A (en) * 2022-07-01 2022-07-29 得分数字科技(珠海)有限公司 Consensus node election method and device, storage medium and node equipment
CN114826626B (en) * 2022-07-01 2022-09-02 得分数字科技(珠海)有限公司 Consensus node election method and device, storage medium and node equipment
CN115242497A (en) * 2022-07-21 2022-10-25 贵州风雷科技有限公司 Block chain-based data tamper-proof method and system

Also Published As

Publication number Publication date
CN110896389B (en) 2022-03-15

Similar Documents

Publication Publication Date Title
CN110896389B (en) Block chain consensus method, electronic equipment and computer-readable storage medium
CN107171810B (en) Verification method and device of block chain
CN109831425B (en) Block chain consensus method, device, equipment and computer readable storage medium
WO2020258925A1 (en) Blockchain-based service information processing method, device, and readable storage medium
US9807092B1 (en) Systems and methods for classification of internet devices as hostile or benign
CN109493221B (en) Method, device, network and storage medium for keeping transaction records secret in block chain
US9356958B2 (en) Apparatus and method for protecting communication pattern of network traffic
CN107276765A (en) The processing method and processing device known together in block chain
KR101827373B1 (en) Block window module having agreement algorithm for limiting mining, managing server and virtual money exchange system and method
CN111277553B (en) Credible node determination method and device based on block chain network
CN109359978B (en) Intelligent contract trading method and system based on block chain network
CN109447799B (en) Intelligent contract trading method and system based on block chain network
CN109166040B (en) Transaction auditing method, device, equipment and storage medium based on block chain
CN108848113A (en) Client device log-in control method, device, storage medium and server
CN109756460B (en) Replay attack prevention method and device
CN107517200B (en) Malicious crawler defense strategy selection method for Web server
WO2020182430A1 (en) Methods of electing leader nodes in a blockchain network using a role-based consensus protocol
CN111865595B (en) Block chain consensus method and device
CN116233177A (en) Block chain and dynamic reputation based Internet of vehicles data secure sharing method and system
CN110460471B (en) Super node election method, device and storage medium
CN109493040B (en) Anti-double-flower attack processing method and device based on block chain
CN111260348A (en) Fair payment system based on intelligent contract in Internet of vehicles and working method thereof
KR102121658B1 (en) Block chain system in d2d communication environments and constructing method thereof
CN114169670A (en) Block chain two-stage consensus method, device, equipment and medium
CN112511312B (en) Assembled consensus 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