CN112436962B - Block chain consensus network dynamic expansion method, electronic device, system and medium - Google Patents

Block chain consensus network dynamic expansion method, electronic device, system and medium Download PDF

Info

Publication number
CN112436962B
CN112436962B CN202011262145.0A CN202011262145A CN112436962B CN 112436962 B CN112436962 B CN 112436962B CN 202011262145 A CN202011262145 A CN 202011262145A CN 112436962 B CN112436962 B CN 112436962B
Authority
CN
China
Prior art keywords
consensus
node
nodes
network
blockchain
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
CN202011262145.0A
Other languages
Chinese (zh)
Other versions
CN112436962A (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.)
Mrray Chengdu Technology Co ltd
Original Assignee
Mrray Chengdu 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 Mrray Chengdu Technology Co ltd filed Critical Mrray Chengdu Technology Co ltd
Priority to CN202011262145.0A priority Critical patent/CN112436962B/en
Publication of CN112436962A publication Critical patent/CN112436962A/en
Application granted granted Critical
Publication of CN112436962B publication Critical patent/CN112436962B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a dynamic expansion method, electronic equipment, a system and a medium of a block chain consensus network, wherein the method comprises the steps of firstly obtaining the number of consensus nodes set by an expansion request according to the node expansion request, and then determining the number of intermediate state consensus nodes according to the number of consensus nodes set by the expansion request; adding a new node to the blockchain network to enable the number of the common identification nodes of the blockchain network to reach the number of the common identification nodes in the intermediate state, and then further adding a new node to the blockchain network to enable the number of the common identification nodes of the blockchain network to reach the number of the common identification nodes set by the expansion request; because the number of the consensus nodes of the block chain network reaches the number of the consensus nodes in the intermediate state and meets the basic condition that the expanded block chain network still works normally, the invention can add a large number of consensus nodes to the block chain consensus network and realize the stable expansion of the block chain consensus network.

Description

Block chain consensus network dynamic expansion method, electronic device, system and medium
Technical Field
The present invention relates to a blockchain technology, and in particular, to a method, an electronic device, a system, and a medium for dynamically expanding a blockchain consensus network.
Background
The PBFT algorithm is an abbreviation of Practical Byzantine Fault Tolerance, means a Byzantine Fault-tolerant algorithm, is an efficient Byzantine problem solution, and is also a core algorithm on a block chain platform. The PBFT algorithm allows the system to have malicious nodes not exceeding f = (n-1)/3, namely when the number of the malicious nodes does not exceed f, the safety and the effectiveness of the consensus system can be still ensured.
Currently, for a consensus network constructed based on a PBFT algorithm, although addition and deletion operations can be performed on nodes through a management end; the adding and deleting operations are usually performed on nodes with abnormal consensus, such as failure, falsification or information discarding, etc., which occur in the blockchain network, and the adding and deleting operations are fewer and only need to satisfy the consensus condition. However, no scheme for realizing robust extension of the blockchain consensus network by adding a large number of consensus nodes to the blockchain consensus network exists at present.
Disclosure of Invention
In view of the above-described deficiencies of the prior art, it is an object of the present invention to: the block chain consensus network dynamic expansion method is provided, a large number of consensus nodes can be added to the block chain consensus network, and robust expansion of the block chain consensus network is achieved.
In order to achieve the purpose, the invention provides the following technical scheme:
a dynamic expansion method of a block chain consensus network comprises the following steps:
s1: after receiving a node expansion request, acquiring the number of consensus nodes set by the node expansion request;
s2: determining the number of the intermediate state consensus nodes according to the number of the consensus nodes set by the node expansion request; wherein, the number of consensus nodes set by the node expansion request is 3f +1, the number of the intermediate state consensus nodes is 2f +1, and f is an integer greater than 1;
s3: judging whether the number of the nodes registered under the channel exceeds the number of the intermediate state consensus nodes or not; if not, registering the node to the channel, and continuing to execute the step S3; if yes, executing step S4;
s4: initiating a vote for adding a new node by a consensus node in the blockchain network, and adding the new node into the blockchain network when each consensus node approves the vote, or continuing to execute the step S4;
s5: judging whether the number of the consensus nodes in the block chain network reaches the number of the intermediate state consensus nodes or not; if not, continuing to execute the step S4; if yes, executing step S6;
s6: judging whether the number of the nodes registered under the channel exceeds the number of the common nodes set by the node expansion request or not; if not, registering the node with the channel, and continuing to execute the step S6; if yes, executing step S7;
s7: initiating a vote for adding a new node by a consensus node in the blockchain network, and adding the new node into the blockchain network when each consensus node approves the vote, or continuing to execute the step S7;
s8: judging whether the number of the consensus nodes in the block chain network reaches the number of the consensus nodes set by the node expansion request; if not, continuing to execute the step S7; and if so, ending.
According to a specific implementation manner, in the dynamic expansion method of the block chain consensus network, node information provided when the node registers in the channel includes a preset weight value; and initiating a vote for adding a new node by a consensus node in the blockchain network, and sequentially selecting nodes to add into the blockchain network for consensus according to the sorting of the numerical values of the weight values.
Further, when the number of times of voting for adding the corresponding new node initiated by the consensus node in the blockchain network exceeds a preset number of times, voting for adding the next new node is initiated.
In another aspect of the present invention, there is also provided an electronic device configured to: when participating in the block chain consensus network, the block chain consensus network dynamic expansion method is implemented.
In another aspect of the present invention, a blockchain system is further provided, which includes at least four consensus nodes for forming a blockchain consensus network, and at least three nodes not participating in the blockchain consensus network, where each node employs the electronic device of the present invention.
In another aspect of the present invention, a readable storage medium is further provided, on which one or more programs are stored, where the one or more programs, when executed by one or more processors, implement the dynamic extension method for a blockchain consensus network of the present invention.
Compared with the prior art, the invention has the following beneficial effects:
the invention relates to a dynamic expansion method of a block chain consensus network, which comprises the steps of firstly obtaining the number of consensus nodes set by an expansion request according to the node expansion request, and then determining the number of intermediate state consensus nodes according to the number of consensus nodes set by the expansion request; adding a new node to the blockchain network to enable the number of the common identification nodes of the blockchain network to reach the number of the intermediate-state common identification nodes, and then further adding a new node to the blockchain network to enable the number of the common identification nodes of the blockchain network to reach the number of the common identification nodes set by the expansion request; because the number of the consensus nodes of the block chain network reaches the number of the consensus nodes in the intermediate state and meets the basic condition that the expanded block chain network still works normally, the invention can add a large number of consensus nodes to the block chain consensus network and realize the stable expansion of the block chain consensus network.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention;
FIG. 2 is a block chain system according to the present invention.
Detailed Description
The following embodiments of the present invention are provided by way of specific examples, and other advantages and effects of the present invention will be readily apparent to those skilled in the art from the disclosure herein. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention.
As shown in fig. 1, the method for dynamically expanding a blockchain consensus network of the present invention includes the following steps:
s1: after receiving a node expansion request, acquiring the number of consensus nodes set by the node expansion request;
s2: determining the number of the consensus nodes in the intermediate state according to the number of the consensus nodes set by the node expansion request; wherein, the number of consensus nodes set by the node expansion request is 3f +1, the number of the intermediate state consensus nodes is 2f +1, and f is an integer greater than 1;
s3: judging whether the number of the nodes registered under the channel exceeds the number of the intermediate state consensus nodes or not; if not, registering the node with the channel, and continuing to execute the step S3; if yes, executing step S4;
s4: initiating a vote for adding a new node by a consensus node in the blockchain network, and adding the new node into the blockchain network when each consensus node approves the vote, or continuing to execute the step S4;
s5: judging whether the number of the consensus nodes in the block chain network reaches the number of the intermediate state consensus nodes or not; if not, continuing to execute the step S4; if yes, executing step S6;
s6: judging whether the number of the nodes registered under the channel exceeds the number of the common nodes set by the node expansion request or not; if not, registering the node with the channel, and continuing to execute the step S6; if yes, executing step S7;
s7: initiating a vote for adding a new node by a consensus node in the blockchain network, and adding the new node into the blockchain network when each consensus node approves the vote, or continuing to execute the step S7;
s8: judging whether the number of the consensus nodes in the block chain network reaches the number of the consensus nodes set by the node expansion request; if not, continuing to execute the step S7; and if so, ending.
In specific implementation, the node information provided when the node is registered in the channel contains a preset weight value; and initiating a vote for adding a new node by the consensus node in the block chain network, and sequentially selecting nodes to add into the block chain network for consensus according to the sorting of the numerical values of the weight values. The weighted values may represent index parameters such as a network state, a performance index, a reliability, and a synchronization degree of block data in a block chain network of the node in a numerical form, and the weighted values may be calculated and updated by detecting data of different index parameters. Therefore, the weighted values of the nodes can be set manually or dynamically updated through detection and calculation, so that the nodes with better evaluation can be selected to be added into the block chain network according to the weighted values, and the robustness of the block chain consensus network can be guaranteed better.
In fact, when the consensus nodes in the block chain network initiate the voting for adding the corresponding new node, if it is required that the consensus nodes in the current block chain network all vote for the vote, and there may be a situation that the node vote for the vote occurs, at this time, the corresponding consensus nodes may continue to initiate the voting for adding the corresponding new node, but if the voting number for initiating the addition of the corresponding new node exceeds the preset number, the voting for adding the next new node is initiated. Therefore, the problem that the follow-up process cannot be continued due to the new node can be avoided. Of course, there may be a case where when there is a node in the preceding blockchain network that is identified as abnormal or intentionally badly, a preset number of attempts may be set, and if a certain node is badly voted for in consecutive rounds, the node may be regarded as abnormal or badly, and a new node may be added to replace the node.
In the dynamic expansion method of the blockchain consensus network, if the nodes are registered under the channel but do not participate in the consensus of the blockchain consensus network currently, but a large amount of blockchain data needs to be synchronized in order to avoid the nodes being selected to participate in the blockchain consensus network, so when the blockchain network generates blocks, the nodes are synchronized with the blocks in the blockchain by the consensus nodes. Certainly, the data transmission relationship between the consensus node and the nodes is fixed, that is, the consensus node is configured to perform block data synchronization on the specific node; or the data transmission relation between the consensus node and the nodes is not fixed, and the data transmission relation can be adjusted in real time according to the network connection condition between the consensus node and the backup node.
In a specific embodiment, the blockchain network with the scene current consensus node number of 4 is extended to a consensus node of 7: the specific implementation steps are as follows:
(1) And calculating the number of the intermediate state consensus nodes. Since the number of consensus nodes set by the node expansion request is 7, that is, 3f +1=7, the number of intermediate state consensus nodes is 6, that is, 2f +1=5. Under the condition that the current consensus network can work normally, at least 2f +1 consensus nodes are required to exist, then the number of the consensus nodes of the channel is updated to be 5 through the management terminal, and then the channel information uplink logic is executed.
(2) When the consensus node detects that the number of the consensus nodes of the channel is modified and is greater than the current value, voting is initiated, and a healthy node with a large weight value is selected from the nodes registered under the channel and added into the consensus layer until the number of the consensus nodes satisfies 2f +1, which in this embodiment is 5.
(3) Then, the number of the common node of the channel is updated to 7 by the management terminal, and then the uplink logic of the channel information is executed.
(4) When the consensus node detects that the number of consensus nodes of the channel is modified and is greater than the current value, voting is initiated, and a healthy node with a large weight value is selected from the backup nodes and added into the consensus layer until the number of consensus nodes satisfies 3f +1, which is 7 in this embodiment. In this way, the block chain network with the current number of the common nodes of 4 is expanded to the common nodes of 7.
In another aspect of the present invention, there is also provided an electronic device configured to: when participating in the blockchain consensus network, the method for dynamically expanding the blockchain consensus network is implemented.
As shown in fig. 2, in another aspect of the present invention, a blockchain system is further provided, which includes at least four consensus nodes for forming a blockchain consensus network, and at least three nodes that do not participate in the blockchain consensus network, where each node employs the electronic device of the present invention.
In another aspect of the present invention, a readable storage medium is further provided, on which one or more programs are stored, where the one or more programs, when executed by one or more processors, implement the dynamic extension method for a blockchain consensus network of the present invention.
It should be understood that the disclosed system may be implemented in other ways. For example, the division of the modules into only one logical functional division may be implemented in practice in other ways, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the communication connection between the modules may be an indirect coupling or communication connection through some interfaces, devices or units, and may be electrical or in other forms.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is substantially or partly contributed by the prior art, or all or part of the technical solution may be embodied in 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 perform 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 Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.

Claims (6)

1. A dynamic expansion method of a block chain consensus network is characterized by comprising the following steps:
s1: after receiving a node expansion request, acquiring the number of consensus nodes set by the node expansion request;
s2: determining the number of the intermediate state consensus nodes according to the number of the consensus nodes set by the node expansion request; wherein, the number of consensus nodes set by the node expansion request is 3f +1, the number of the intermediate state consensus nodes is 2f +1, and f is an integer greater than 1;
s3: judging whether the number of the nodes registered under the channel exceeds the number of the intermediate state consensus nodes or not; if not, registering the node with the channel, and continuing to execute the step S3; if yes, executing step S4;
s4: initiating a vote for adding a new node by a consensus node in the blockchain network, and adding the new node into the blockchain network when each consensus node approves the vote, or continuing to execute the step S4;
s5: judging whether the number of the consensus nodes in the block chain network reaches the number of the intermediate state consensus nodes or not; if not, continuing to execute the step S4; if yes, executing step S6;
s6: judging whether the number of the nodes registered under the channel exceeds the number of the consensus nodes set by the node expansion request or not; if not, registering the node with the channel, and continuing to execute the step S6; if yes, executing step S7;
s7: initiating a vote for adding a new node by the consensus nodes in the block chain network, and adding the new node into the block chain network when each consensus node votes for the vote, otherwise, continuing to execute the step S7;
s8: judging whether the number of the consensus nodes in the block chain network reaches the number of the consensus nodes set by the node expansion request; if not, continuing to execute the step S7; and if so, ending.
2. The method of claim 1, wherein node information provided when the node registers in the tunnel includes a predetermined weight value; and initiating a vote for adding a new node by a consensus node in the blockchain network, and sequentially selecting nodes to add into the blockchain network for consensus according to the sorting of the numerical values of the weight values.
3. The method as claimed in claim 2, wherein when the number of votes for a consensus node to initiate adding a corresponding new node in the blockchain network exceeds a predetermined number, a vote for adding a next new node is initiated.
4. An electronic device, configured to: the method of any one of claims 1 to 3 is implemented when participating in a blockchain consensus network.
5. A blockchain system comprising at least four consensus nodes for forming a blockchain consensus network, and at least three nodes not participating in the blockchain consensus network, wherein each node employs the electronic device of claim 4.
6. A readable storage medium having one or more programs stored thereon, wherein the one or more programs, when executed by one or more processors, implement the method for dynamic extension of a blockchain consensus network according to any one of claims 1 to 3.
CN202011262145.0A 2020-11-12 2020-11-12 Block chain consensus network dynamic expansion method, electronic device, system and medium Active CN112436962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011262145.0A CN112436962B (en) 2020-11-12 2020-11-12 Block chain consensus network dynamic expansion method, electronic device, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011262145.0A CN112436962B (en) 2020-11-12 2020-11-12 Block chain consensus network dynamic expansion method, electronic device, system and medium

Publications (2)

Publication Number Publication Date
CN112436962A CN112436962A (en) 2021-03-02
CN112436962B true CN112436962B (en) 2023-04-18

Family

ID=74701270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011262145.0A Active CN112436962B (en) 2020-11-12 2020-11-12 Block chain consensus network dynamic expansion method, electronic device, system and medium

Country Status (1)

Country Link
CN (1) CN112436962B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204597B (en) * 2021-05-06 2022-06-24 杭州复杂美科技有限公司 Method, equipment and storage medium for horizontal extension of block chain executor
CN117544472B (en) * 2024-01-08 2024-03-22 中国信息通信研究院 Node management method and device for distributed network, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171829A (en) * 2017-04-24 2017-09-15 杭州趣链科技有限公司 A kind of dynamic node management method for algorithm realization of being known together based on BFT
CN111131399A (en) * 2019-12-03 2020-05-08 北京海益同展信息科技有限公司 Method and device for dynamically increasing consensus nodes in block chain

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108768665B (en) * 2018-07-02 2021-06-08 上海达家迎信息科技有限公司 Block chain generation method and device, computer equipment and storage medium
CN109347901B (en) * 2018-08-23 2020-12-15 泰链(厦门)科技有限公司 Method, medium, device and system for realizing consensus mechanism of block chain system
CN110298660A (en) * 2019-06-13 2019-10-01 广东投盟科技有限公司 Node administration method based on block chain
CN111444210B (en) * 2020-03-26 2021-11-05 腾讯科技(深圳)有限公司 Block chain consensus node management method, device, equipment and storage medium
CN111464353B (en) * 2020-03-31 2022-12-09 财付通支付科技有限公司 Block link point management method, device, computer and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171829A (en) * 2017-04-24 2017-09-15 杭州趣链科技有限公司 A kind of dynamic node management method for algorithm realization of being known together based on BFT
CN111131399A (en) * 2019-12-03 2020-05-08 北京海益同展信息科技有限公司 Method and device for dynamically increasing consensus nodes in block chain

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Mingyu Hou等.A Blockchain Based Architecture for IoT Data Sharing Systems.《2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops)》.2020,全文. *
韩嗣诚.优化可扩展的拜占庭容错共识算法.《物联网学报》.2020,全文. *

Also Published As

Publication number Publication date
CN112436962A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN112436962B (en) Block chain consensus network dynamic expansion method, electronic device, system and medium
CN112069169B (en) Block data storage method and device, electronic equipment and readable storage medium
CN112087497B (en) Data synchronization method and device, electronic equipment and readable storage medium
CN108228789B (en) Synchronous abnormity recovery method and device triggered by slave node
CN114185678A (en) Data storage method, device, equipment and storage medium
US11341842B2 (en) Metering data management system and computer readable recording medium
CN110619022B (en) Node detection method, device, equipment and storage medium based on block chain network
CN112184436A (en) Data synchronization method, electronic device and readable storage medium
CN110740064A (en) Distributed cluster node fault processing method, device, equipment and storage medium
CN111404737B (en) Disaster recovery processing method and related device
CN112511338A (en) Block chain consensus network dynamic recovery method, electronic device, system and medium
CN111092956A (en) Resource synchronization method, device, storage medium and equipment
CN112202863B (en) Data synchronization method and device, electronic equipment and readable storage medium
CN112258184B (en) Method, apparatus, electronic device and readable storage medium for freezing blockchain network
CN112911011B (en) Block generation control method applied to block chain and related device
CN109254880A (en) A kind of method and device handling database delay machine
CN112511337A (en) Block chain consensus network self-recovery method, electronic device, system and storage medium
CN111917826A (en) PBFT consensus algorithm based on block chain intellectual property protection
CN112486726A (en) Time-light rollback method and system for block chain
CN113568710B (en) High availability realization method, device and equipment for virtual machine
CN113708977B (en) Method, device, computer equipment and storage medium for acquiring root cause alarm information
CN112801769B (en) Accounting data processing method, device and system
CN117235145A (en) Data processing method and device, electronic equipment and storage medium
CN115640129A (en) Timed task data processing method and device, electronic equipment and storage medium
CN117992501A (en) Database cluster brain crack prevention method and device, electronic equipment and storage medium

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