CN110581892B - Block chain based network connection and recovery mechanism - Google Patents

Block chain based network connection and recovery mechanism Download PDF

Info

Publication number
CN110581892B
CN110581892B CN201910873181.1A CN201910873181A CN110581892B CN 110581892 B CN110581892 B CN 110581892B CN 201910873181 A CN201910873181 A CN 201910873181A CN 110581892 B CN110581892 B CN 110581892B
Authority
CN
China
Prior art keywords
node
seed
connection
candidate
network
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
CN201910873181.1A
Other languages
Chinese (zh)
Other versions
CN110581892A (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.)
Shanghai Insurance Exchange Co ltd
Original Assignee
Shanghai Insurance Exchange 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 Shanghai Insurance Exchange Co ltd filed Critical Shanghai Insurance Exchange Co ltd
Priority to CN201910873181.1A priority Critical patent/CN110581892B/en
Publication of CN110581892A publication Critical patent/CN110581892A/en
Application granted granted Critical
Publication of CN110581892B publication Critical patent/CN110581892B/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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4594Address books, i.e. directories containing contact information about correspondents
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1042Peer-to-peer [P2P] networks using topology management mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1048Departure or maintenance mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1053Group management mechanisms  with pre-configuration of logical or physical connections with a determined number of other peers
    • H04L67/1055Group management mechanisms  with pre-configuration of logical or physical connections with a determined number of other peers involving connection limits

Abstract

The present disclosure relates to blockchain based network connectivity and recovery mechanisms. A network networking method based on a block chain comprises a fixed connection node connection step, a block chain network connection step and a block chain network connection step, wherein the fixed connection node connection step is used for enabling an access node to connect at least one fixed connection node in the block chain network; a seed node connection step, in the case that the access node can execute a seed node access mode, of connecting the access node to a seed node in the block chain network, and acquiring an address book of the seed node from the connected seed node, where the address book includes a candidate node list, and the candidate node list at least includes node identification and node connection number information of each candidate node; and a candidate node connection step of causing the access node to select a candidate node for connection according to the node connection number information of the candidate node from the candidate node list of the acquired address book.

Description

Block chain based network connection and recovery mechanism
Technical Field
The present disclosure relates to network networking, and more particularly to blockchain network connection and restoration.
Background
On 11/1/2008, a person who says so is a new idea of electronic money, namely the bitcoin, appears, the economic attribute of the bitcoin is stripped, and the block chain technology supported by the bitcoin has a very good application prospect. Blockchain networks originated in bitcoin are intelligent peer-to-peer networks that identify, propagate, and document information through distributed databases. In a blockchain network, there are no core nodes, all nodes follow a predetermined rule, i.e. a consensus mechanism, which mainly solves the problem of who constructs a block and how to maintain uniformity of blockchains. Therefore, there are consensus nodes and non-consensus nodes in the blockchain network.
In the block chain network connection, when a node is accessed to a network, a common mode is often used to designate fixed network connection at present, and under the condition, the network connection is relatively fixed, network resources are relatively concentrated, some nodes are hot, the number of the connected nodes is large, the network load is large, but the number of the connected nodes is small, the network load is low, the waste of the network connection is caused, and the use of the network resources is unbalanced.
In addition, when a network has a problem, for example, when the network is disconnected, in the existing common mode, the fixed connection nodes are always connected when the network is recovered, and if none of the nodes in the fixed connection nodes can be connected, the nodes cannot be connected to enter the blockchain network, so that the problem that the blockchain network cannot be networked when a plurality of key nodes in the fixed network are down easily occurs.
Therefore, there is a need for an improved network networking mechanism, in particular a network connection and recovery mechanism.
Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Likewise, the problems identified with respect to one or more methods should not be assumed to be recognized in any prior art based on this section unless otherwise indicated.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
In view of this, the present application proposes an improved blockchain network connection and recovery mechanism. The dynamic connection between the access node and the nodes in the network is realized by means of the seed node connection mode, so that the usage amount of the network can be balanced and the usage of network resources can be balanced. On the other hand, the whole blockchain network can be better recovered when the blockchain network has problems, and the problem that the blockchain network cannot be networked when a plurality of key nodes in the fixed network are down is prevented.
In one aspect, the present disclosure proposes a method of network networking based on a blockchain, the method comprising a fixed connection node connection step for causing an access node to connect at least one fixed connection node in a blockchain network; a seed node connection step, in the case that an access node can execute a seed node access mode, of connecting the access node to a seed node in a block chain network, and acquiring an address book of the seed node from the connected seed node, where the address book includes a candidate node list, the candidate node list at least includes node identification and node connection number information of each candidate node, and the node connection number information at least includes an optimal node connection number and a current node connection number of the node; and a candidate node connection step of causing the access node to select a candidate node for connection according to node connection number information of the candidate node from a candidate node list of the acquired address book, wherein in the candidate node connection step, the access node selects a candidate node which is less than the optimal node connection number in the address book by the current node connection number and is not connected with the access node for connection.
In another aspect, the present disclosure proposes a blockchain based network networking device, the device comprising a fixed connection node connection means configured such that an access node connects at least one fixed connection node in a blockchain network; a seed node connecting device configured to, in a case where an access node can execute a seed node access mode, enable the access node to connect a seed node in a block chain network, and obtain an address book of the seed node from the connected seed node, where the address book includes a candidate node list, the candidate node list includes at least a node identifier and node connection number information of each candidate node, and the node connection number information includes at least an optimal node connection number and a current node connection number of the node; and candidate node connection means configured to cause the access node to select a candidate node for connection according to node connection number information of the candidate node from the candidate node list of the acquired address book, wherein the candidate node connection means is further configured to cause the access node to select a candidate node which is less than the optimal node connection number in the address book by the current node connection number and is not connected to the access node for connection.
In yet another aspect, there is provided a device comprising at least one processor and at least one storage device having instructions stored thereon, which when executed by the at least one processor, may cause the at least one processor to perform a method as described herein.
In yet another aspect, a storage medium is provided having stored thereon instructions that, when executed by a processor, may cause performance of a method as described herein.
This disclosure is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Other aspects and advantages of the present technology will become apparent from the following detailed description of the embodiments and the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure. In the drawings, like numbering represents like items.
Embodiments of the present technology are described in detail below with reference to the attached drawing figures, wherein:
fig. 1 is a schematic diagram illustrating a blockchain network topology.
Fig. 2 is a schematic diagram illustrating a blockchain network topology according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flow chart illustrating a method of network networking based on blockchains in accordance with the present disclosure.
Fig. 4 is a block diagram showing a basic configuration of an apparatus for network grouping based on a block chain according to the present disclosure.
Fig. 5 is a schematic diagram illustrating an example flow of network networking based on blockchains according to the present disclosure.
Fig. 6 is an exemplary configuration diagram illustrating a computing device in which embodiments in accordance with the present disclosure may be implemented.
Other features of the present disclosure will become apparent from the following description of exemplary embodiments with reference to the accompanying drawings.
Detailed Description
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The drawings illustrate specific embodiments in which the techniques may be practiced. The embodiments are intended to describe aspects of the technology in sufficient detail to enable those skilled in the art to practice the technology. For purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. It may be evident, however, that the disclosure can be practiced without these specific details. In other instances, well-known structures and devices are not described in detail to avoid unnecessarily obscuring, or obscuring the present disclosure.
Reference in the specification to "one embodiment," "an embodiment," or "an embodiment" means that a feature or features referred to is included in at least one embodiment of the technology. In particular, separate references to "one embodiment," "an embodiment," or "an embodiment" in this specification do not necessarily refer to the same embodiment, and are not mutually exclusive unless so stated and/or unless apparent to one of ordinary skill in the art. For example, features, structures, acts, etc. described in one embodiment may be included in other embodiments, but are not necessarily included. Accordingly, the present techniques may include various combinations and/or integrations of the embodiments described herein.
In the present disclosure, the term "blockchain technology" includes, but is not limited to, distributed storage, peer-to-peer networks, consensus mechanisms, encryption algorithms, etc., and the term "consensus mechanism" generally refers to a mathematical algorithm that establishes trust and gains between different nodes in a blockchain system.
As shown in fig. 1, this is a schematic diagram of a blockchain networking architecture. A blockchain network may include a plurality of nodes that may be classified from a consensus mode into a consensus node and a non-consensus node. The consensus node is a node participating in a blockchain consensus mechanism, and participates in a core consensus algorithm, such as may be responsible for performing consensus operations and producing ledgers. The original common node is written into the initialization block when initialized. A non-consensus node is a node that does not participate in blockchain consensus operations, also referred to as an observation node. The non-consensus network may synchronize the tiles, may receive transactions sent to the blockchain network, and may synchronize the transactions to the consensus node. For example, the non-consensus node only receives the message and synchronizes the record ledger, does not participate in the consensus operation, and does not have the right to vote for consensus. Further, it should be appreciated that the consensus and non-consensus nodes are not fixed, but may be dynamically switched by methods known in the art.
In general, a blockchain network may include a plurality of common nodes and a plurality of non-common nodes, and the plurality of common nodes may be connected and/or communicate with each other in various manners, for example, one common node may connect one or more common nodes as long as one connection line in the network can run through all common nodes; rather, the non-consensus node need only connect and/or communicate with at least one consensus node or non-consensus node to achieve synchronization. Those skilled in the art should understand that the non-consensus nodes are not necessary and can be increased or decreased according to actual needs, wherein the addition of the non-consensus nodes only needs to use the configuration file to access the network. The consensus node may also be switched in or out of the network due to needs or network state changes.
In the existing block chain networking process (especially, the process of connecting nodes to the network, and the network recovery process), a normal mode/fixed connection mode is often adopted for network connection and recovery. In particular, network connections are fixed and cause an imbalance in hardware load, creating problems, and are operated in a manually specified manner. Furthermore, fixed connection nodes are generally nodes that are fixedly connected, and if such nodes are disconnected, they must be reconnected, and if they are not connected, they will be reconnected at regular intervals until they are connected. Thus, in the case where the network cannot be connected, the blockchain network may not be configured.
In the present disclosure, a seed node pattern is introduced. With the seed node mode turned on, then there will be one more type of node in the blockchain network, called a seed node. The seed node is a concept of a p2p network layer, and is independent of whether the node is a consensus node or a non-consensus node, and the consensus node or the non-consensus node can be used. Generally, since the resource consumption of the consensus node is relatively large, we generally use the non-consensus node as the seed node for the efficiency of the whole network.
Fig. 2 shows a schematic diagram of a network structure in the case of turning on the seed node mode of the present disclosure. It can be seen that the network structure includes a consensus node, a non-consensus node (observation node), and a seed node, where the seed node is the non-consensus node (observation node).
According to the disclosure, when a node performs network connection/restoration under the condition of starting a seed node mode, the node connects a seed node, and selects a node from a candidate node list in an address book of the seed node for connection, wherein the address book of the seed node can be generated by the seed node and dynamically changed so as to more comprehensively reflect the connection condition (related to the load condition) of each node in the network, and the node can selectively connect the candidate node according to the specific node connection information of the candidate node, so that network load balancing can be realized. In addition, even when the network fails, the node can be quickly connected to the node in the network, thereby realizing quick recovery of the network.
It should be noted that although one seed node is shown in fig. 2, it should be noted that this is merely exemplary. In the present disclosure, at least one seed node is included in the network structure. For example, two seed nodes may be generally provided in a network structure, so that the nodes can more reliably perform network connection when networking.
A flow diagram of a network networking method 300 of the present disclosure will be described in detail below with reference to fig. 3, which illustrates exemplary operation of an access node in accessing a blockchain network for networking. It should be noted that the access node may be a new node to join the blockchain network, or an original node in the blockchain network that needs to be re-networked after a change in the network connection state, where the change in the network connection state refers to at least one of disconnection from the entire network, disconnection from a part of nodes in the network, and the like.
In step 302 (also referred to as a fixed connection node connection step) wherein the access node connects at least one fixed connection node in the blockchain network.
A fixed connection node is a node in a blockchain network to which an access node should (or must) connect when networking. In particular, a connection is made to a node in the fixed connection node whether or not the seed node mode is turned on. The fixed connection node information may be preset by the network system for the access node. The fixed connection nodes may include consensus nodes and non-consensus nodes.
Preferably, the fixed node usually comprises at least one consensus node, considering that the access node must be connected to the consensus node when networking is performed to ensure that it is not disconnected from the main network. For example, if the access node is a non-consensus node, if the access node is not connected to the consensus node during network networking, at least one consensus node must be configured for the access node, so that the access node connects to the at least one consensus node to ensure that the access node is not disconnected from the main network. For example, when the access node is a consensus node, it is still necessary to plan a network connection mode of the core consensus network for the consensus node in the configuration of the fixed connection node to ensure the integrity and stability of the consensus network. In particular, it is required that an access node, which is a consensus node, must be connected to the consensus node.
It should be noted that in the embodiments of the present disclosure, the common nodes may be connected in various ways as long as the connection is achieved between the common nodes and the entire network has one line running through all the nodes. As an example, a consensus node may connect only one consensus node. For example, in general, one consensus node may be connected with at least two other consensus nodes (e.g., 2, 3, or 4 consensus nodes), such that a more reliable and stable consensus may be achieved.
In step 304 (also referred to as a seed node connection step), in case that the access node can execute a seed node access mode, the access node is enabled to connect a seed node in the blockchain network, and an address book of the seed node is obtained from the connected seed node, the address book contains a candidate node list, the candidate node list at least contains node identification and node connection number information of each candidate node, and the node connection number information at least contains an optimal node connection number and a current node connection number of the node.
According to the present disclosure, the seed node connecting step is performed in case the access node turns on the seed node access mode, for example, it may be determined whether the seed node mode is turned on for the node by setting in configuration parameters of the node. In particular, the seed node mode may be selectively turned on for a new node or each node in the network. For example, when a new node accesses the network or when an original node in the network performs networking again after disconnecting the network, the seed node mode can be selectively performed according to the setting.
According to the present disclosure, preferably, the seed node connecting operation is performed after the fixed connection node connecting operation. In particular, the seed node connection operation is performed at least after the access node has established a connection with at least one consensus node.
According to the present disclosure, the seed node may be an existing consensus node or a non-consensus node in the blockchain network, and preferably is a non-consensus node. According to one embodiment of the present disclosure, a node in a blockchain network may be selectively set as a seed node. For example, for a node in the network, it may be set whether the node is a seed node by setting its configuration parameters. Typically, when a node is set as a seed node, it automatically turns on the seed node mode.
The seed node information may be preset by the network system for the access node. For example, the network system may preset at least one seed node for the access node so that the access node connects when starting the seed node access mode, and in particular, the access node may connect any one of the at least one seed node.
According to the present disclosure, a seed node will generate, record and dynamically update an address book that includes a list of candidate nodes, which refer to nodes in the network that may be connected by an access node. The candidate node list may include at least identification information of the candidate node and node connection number information.
As an example, the identification information of the candidate node may include, for example, a node ID indicating a unique identification of the node in the network, which may be generated by the system for the node using a predetermined algorithm (e.g., a key algorithm, etc.), and will not be described in detail herein. Thus, the access node can find and connect with the node's address information, such as node IP address, node connection port, etc., based on the node ID, and can be included in other databases associated with the node ID. In particular, the address information of the node may also be contained in the address book, associated with the node ID.
As an example, the node connection number information of the candidate node may include at least an optimal node connection number and a current node connection number of the node. The optimal node connection number of the node is the optimal connection node number of the node, and the optimal node connection number is set according to different hardware conditions of each node. The current node connection number of a node refers to how many nodes the node is currently connected to. Preferably, all nodes having a current node connection number less than the optimal node connection number are considered to be properly connected nodes.
The address book of the seed node may be generated or updated in a variety of ways. In particular, the address book of the seed node may be generated or updated on a triggered basis, for example, when other nodes connect the seed node, or periodically, for example, the seed node itself updates periodically, or periodically connects with other seed nodes for updating. It should be noted that when the address book is updated, the previous old information will be replaced with its latest information for the same node. Some exemplary embodiments of address book generation or updating will be exemplarily described below.
According to an embodiment of the present disclosure, when a non-seed node is connected to a seed node, node identification and node connection number information of the non-seed node are added to a candidate node list of an address book of the seed node, so that the address book of the seed node is generated or updated. In particular, when the access node performs network networking as a non-seed node, the information of the access node is also added to the address book of the seed node. This addition operation may be performed before, at the same time as, or after the access node obtains the address book information from the seed node, and the access will then disconnect from the seed node. According to one embodiment of the present disclosure, a non-seed node, e.g., an access node, may periodically connect to the seed node configured for it to provide the seed node with the latest node self information (preferably, node connection number information).
According to an embodiment of the present disclosure, when a seed node is connected to another seed node as an access node, additionally, address books of the seed node and the other seed node are complemented with each other by node information that is not present, and if the same node information is found, the latest node information is retained, subject to a time stamp. So that the address books of both seed nodes maintain the latest node information, and in particular are updated by replacing old information with new information, and are not updated if the address books of both seed nodes are the latest node information. This update operation may be performed after the access node obtains the address book information from the seed node, and the access will then disconnect from the seed node.
According to an embodiment of the present disclosure, the seed node may periodically refresh the address book information and delete the node information that may be disconnected. In particular, when a non-seed node previously connected to a seed node is not connected to the seed node for a certain time, it may be considered that the node has been disconnected, and information of the node will be deleted from the address book of the seed node. The specific time may be set by the system, for example, several hours. As an example, the address book of the seed node may further include a last update time of the node, which indicates a last communication time of the node with the seed node, and if an interval time between a time when the seed node refreshes the address book and the last update time exceeds a specific time set by the system, the node may be considered to be disconnected and information of the node may be deleted from the address book of the seed node.
According to embodiments of the present disclosure, a seed node may update an address book by interacting with other seed nodes. As an example, the seed node may be periodically connected with any or all of the other seed nodes, such that the address books of the seed node and the other seed nodes are complemented by node information that is not available, and if the same node information is found, the latest node information is retained. It should be noted that all seed nodes can maintain the same address book regardless of the connection method.
Thereby, the address book of the seed node can be dynamically changed, such that for the access node the nodes available for network connection/restoration can be dynamically changed, such that the connection balance of the network can be extended.
In step 306 (also referred to as a candidate node connection step), the access node selects a candidate node for connection according to the node connection number information of the candidate node from the candidate node list of the acquired address book, wherein in the candidate node connection step, the access node selects a candidate node which is less than the optimal node connection number in the address book and is not connected with the access node for connection. According to the present disclosure, when nodes are connected, the nodes will not connect already connected nodes in the candidate node list or the self node.
According to an embodiment of the present disclosure, in the candidate node connection step, if there are a plurality of candidate nodes whose optimal node connection number is greater than its current node connection number and which are not connected to the access node, any one of the plurality of candidate nodes may be selected for connection; or a candidate node with the smallest current node connection number in the plurality of candidate nodes can be selected; or a candidate node of the plurality of candidate nodes whose difference between the current node connection number and the optimal node connection number is the largest may be selected.
In particular, according to the present disclosure, when the current connection number of all candidate nodes is equal to or greater than its optimal connection number, the access node's connection will be rejected and alarmed, or the node may reconnect the seed node after a certain time interval to connect according to the updated address book. It should be noted that the re-joined seed node may be any seed node, considering that the address books of all seed nodes are consistent.
Thus, the node connection number information, particularly the optimal node connection number information, indicates the optimal load state set for the node, by performing node connection according to this information, each node that can be operated in the optimal state as much as possible, and the load of the entire network can be effectively distributed among the respective nodes according to the setting of the respective nodes, thereby load balancing the entire blockchain network and balancing the use of network resources.
According to an embodiment of the present disclosure, the node connection number information further includes a maximum node connection number of the node. The maximum node connection number refers to the maximum number of connections that a node can connect, beyond which a newly created node connection is rejected, and in particular, the optimum node connection number will be less than the maximum node connection number.
In the candidate node connection step, if the current node connection number of all candidate nodes of the seed node connected by the access node is equal to or greater than the optimal node connection number of the access node, but the current node connection number of at least one candidate node is still less than the maximum node connection number of the access node, selecting any candidate node in the at least one candidate node for connection, or selecting the candidate node with the minimum current node connection number in the at least one candidate node for connection; or selecting the candidate node with the largest difference between the current node connection number and the maximum node connection number in the at least one candidate node for connection.
In particular, according to the present disclosure, when the current number of connections of all candidate nodes is equal to its maximum number of connections, the access node will no longer connect and alarm, or the node may reconnect the seed node after a certain time interval to connect according to the updated address book. It should be noted that the re-joined seed node may be any seed node, considering that the address books of all seed nodes are consistent.
According to the present disclosure, the attributes of a node may also include a minimum number of connections, which indicates how many connections a node should have in its own minimum to ensure its successful and stable connection to the blockchain network. In particular, when the network connection status of a node in the blockchain network changes and the current node connection number of the node is less than the minimum node connection number of the access node itself, the node will perform a network connection operation to connect other nodes until the current connection number is equal to the minimum connection number. Therefore, the resources of the nodes can be fully utilized and are not idle.
As an example, when the network state of a node changes, such as a new network is accessed, or the node is disconnected from the network, or the node is disconnected from other nodes, it is detected whether the current connection number is less than the minimum connection number, and when the current connection number is less than the minimum connection number, network connection is attempted to connect other nodes. Network networking connection may be performed as described above, for example, at least the above-described seed node connection operation and candidate node connection operation may be performed in a case where the seed node mode is turned on by the node.
In particular, it should be pointed out that as described above, a node must connect a fixed connection node, in particular at least one consensus node, when accessing a blockchain network, so that when the network state of the node changes, for example, when a network is newly accessed, or disconnected from the network, or disconnected from other nodes, and the current connection number of the node is less than the minimum connection number, and the node turns on the seed node mode, the node will first connect the fixed connection node and will not operate in the seed node mode until the connection of the fixed connection node is completed.
According to the present disclosure, since any node must be connected to a fixed connection node, especially at least one consensus node, to ensure that it has access to the blockchain network when the blockchain network is in use, the node may periodically detect a connection with the fixed connection node, especially the consensus node, and immediately perform a connection operation with the fixed connection node, especially the consensus node, upon disconnection.
According to the present disclosure, it is also possible to set whether or not the nodes in the block chain network allow intranet connection, and when the nodes allow intranet connection, the IP address of the intranet will appear in the address book for the nodes to connect. Therefore, when the access node performs network networking, the access node can select a proper connection mode to connect with the candidate node in the address book.
It should be noted that the deployment environment of the block chain is often very complex, and it may happen that some nodes use public network connection and some nodes use intranet connection, and this may result in some nodes being unable to connect with each other due to different networks. Through the setting, the switch of the public network and the internal network is equivalently added, so that the internal network IP address of the node can be presented in the address book for the node to be connected, and the connectivity of the node in the block chain network is effectively improved.
A basic configuration of a network networking device of an embodiment of the present disclosure will be described in detail below with reference to fig. 4.
Fig. 4 is a block diagram illustrating a basic configuration of an apparatus 400 for network grouping based on a blockchain according to an exemplary embodiment of the present disclosure. As shown in fig. 4, the apparatus 400 for dynamically changing a consensus node includes: a fixed connection node connection means 402 configured such that an access node connects at least one fixed connection node in a blockchain network, the at least one fixed connection node comprising at least one consensus node; a seed node connecting means 404 configured to, in a case where the access node can execute a seed node access mode, enable the access node to connect a seed node in the block chain network, and obtain an address book of the seed node from the connected seed node, where the address book includes a candidate node list, where the candidate node list includes at least a node identifier of each candidate node and node connection number information, and the node connection number information includes at least an optimal node connection number and a current node connection number of the node; and candidate node connecting means 406 configured to cause the access node to select a candidate node for connection according to the node connection number information of the candidate node from the candidate node list of the acquired address book, wherein the candidate node connecting means is further configured to cause the access node to select a candidate node which is less than the optimal node connection number in the address book by the current node connection number and is not connected to the access node for connection.
It should be understood by those skilled in the art that the above-mentioned respective devices of the apparatus 400 for network networking based on block chains are not limited to the above-mentioned respective functions, but may implement the functions of the respective steps of the various methods according to the embodiments of the present disclosure as described previously. And the apparatus comprised by the device 400 may not be limited to the above-described apparatus but may comprise means for carrying out the other steps of the aforementioned method according to an embodiment of the present disclosure. The various means of the apparatus 1000 may be implemented by hardware, software, firmware, or any combination thereof. In addition, those skilled in the art will also appreciate that the various devices of the apparatus 400 may be combined or divided into sub-devices as desired.
The following will exemplarily describe a configuration for a node of a blockchain network according to an embodiment of the present disclosure. In particular, an improved configuration of nodes is proposed to be particularly suitable for implementation of the technical solution according to the present disclosure.
A blockchain node according to the present disclosure may have the following relevant configuration parameters, which may be set, stored, transmitted, etc. in various ways as appropriate:
1. fixedly connecting node identifiers;
2. identifying a seed node;
3. whether to start a seed node mode;
4. whether it is a seed node;
5. the optimal number of node connections;
6. a minimum number of node connections;
7. maximum number of node connections;
8. whether intranet connectivity is allowed, an
9. The refresh time.
Specific meanings of the above configuration parameters in the node configuration will be explained below, but it should be noted that the configuration of the block nodes is not limited to the above configuration parameters, and may also include other configuration parameters, such as other configuration parameters known in the art, and will not be described in detail here.
The "fixed connection node identification" may include an ID of the fixed connection node, an IP of the fixed connection node, and a port number of the fixed connection node. The node ID is the unique identification of the node in this network. It may be generated from an algorithm, such as a key algorithm, or may be pre-specified by a network administrator. The node IP indicates the IP address of the node and the port number indicates the port that the node provides services and that other nodes can access. Both of which may be pre-assigned by the system for the node.
A simple example of fixed connection node identification is shown below. The fixed connection node identification may be expressed as agjizxndfginqwdgjasd @ 192.168.0.1: 8000, the elements of which are as follows:
and node ID: agjizxndfginqwdgjasd
And (4) node IP: 192.168.0.1
Port: 8000
It should be noted that the "fixed connection node identity" configuration parameter at a node may contain one or more fixed connection node identities, each of which may be represented as described above.
The "seed node identification" may include an ID of the seed node, an IP of the seed node, and a port number of the seed node. The meaning of the ID of the seed node, the IP of the seed node, and the port number of the seed node is similar to the ID of the fixed connection node, the IP of the fixed connection node, and the port number of the fixed connection node, and will not be described in detail here.
A simple example of seed node identification is shown below. The seed node identification may be expressed as: agjizxndfginqasdfasf @ 192.168.0.3: 8000, the elements are as follows:
and node ID: agjizxndfginqasdasdf
And (4) node ip: 192.168.0.3
Port: 8000
It should be noted that the "seed node identification" configuration parameters at a node may contain one or more fixed connection node identifications, each of which may be represented as described above.
"whether to turn on the seed node mode" indicates whether to turn on the seed node mode for the node, and the node will only connect with the seed node when the seed node mode is turned on. The configuration parameters may be represented in binary form, for example, with 1 for seed node mode on and 0 for seed node mode off, although seed node mode information may be represented in other forms, such as "yes" or "no". The seed node mode may be selectively started for each node in the blockchain network, such that, with the seed node mode turned on, the node may complete network connection and recovery by connecting the seed nodes. Therefore, the working mode of the nodes in the network can be flexibly set, the flexibility of network connection and recovery can be improved, and dynamic balance is further improved. In addition, in the case that the seed node mode is not turned on in the node configuration, the above-mentioned "seed node identification" configuration parameter may not be set, for example, not displayed or displayed as empty.
The "seed node" configuration parameter may indicate whether the node is a seed node. The information may be represented in binary form, e.g., a seed node is indicated with a 1 instead of a 0, although the information may be represented in other forms, e.g., "yes" or "no". When the configuration indicates that the node is a seed node, the nodes exchange address book information with each other when communicating with other seed nodes, and combine and update the information in the address book.
Note that the two configuration parameters of "whether to turn on the seed node mode" and "whether to be a seed node" are typically set in association. In particular, in each node of the blockchain network, if the node is set as a seed node, the node must turn on a seed node mode.
The "optimal node connection number" indicates the optimal node connection number of the own node, which may be set according to the hardware condition of the node or may be set with reference to the historical connection condition of the node. It should be noted that the optimal node connection number configuration may also be set based on other factors/considerations, which will not be described in detail herein.
The "minimum node connection number" indicates how many nodes a node should be connected to at least, which means that a node can be stably and reliably connected to the blockchain network only if the connection number of the node is equal to the minimum node connection number, and which may be set according to various factors/considerations, such as network conditions, historical connection conditions of the node, and the like, and will not be described in detail herein.
The "maximum number of node connections" indicates how many nodes a node can be connected to at most, and generally if the number of connections is exceeded, the node may exceed its maximum load and cause a failure, and therefore, beyond this number of connections, the newly-created connection may be rejected. Which may be set based on various factors/considerations, such as the hardware condition of the node, historical connection conditions, etc., and will not be described in detail herein. The maximum node number may be set explicitly, e.g., considered set, or implicitly, e.g., a system default maximum node number.
"whether intranet connection is allowed" indicates whether the node is allowed to make intranet connection. The information may be represented in binary form, e.g., a seed node is indicated with a 1 instead of a 0, although the information may be represented in other forms, e.g., "yes" or "no".
Specifically, because the deployment environment of the block chain is very complex, some nodes may use public network connection, and some nodes use intranet connection, and some nodes may get through two intranets, so that the addresses of the two intranets may not be connected to each other, and thus, the nodes connected by using intranets may not be connected because the intranet addresses are not clear. Therefore, when this option is yes, the intranet IP will appear in the address book for the connection of each node. When this setting is no, all Intranet IPs (: 10.0.0.0-10.255.255.255: 172.16.0.0-172.31.255.255: 192.168.0.0-192.168.255.255) will not be present in the configuration parameters of the node identification.
The "refresh time" indicates a periodic connection time interval of the node with the seed node. In particular, the node will actively disconnect from the seed node after connecting the seed node to obtain the address book of the seed node and adding its own information to the address book of the seed node. And after the time interval specified by the 'refresh time' configuration parameter is passed, the seed node is reconnected to obtain the latest address book information, and the connection condition with other nodes can be dynamically updated according to the condition, so that the load balance of the network can be regularly carried out.
. The following is one configuration example of a blockchain node according to an embodiment of the present disclosure.
Fixedly connecting the nodes: agjizxndfginqwgsd @ 192.168.0.1: 8000, agjizxndfginqwgsd @ 192.168.0.2: 8000
Seed node: agjizxndfginqasdasdf @ 192.168.0.3: 8000, agjizxndfginqasdasdsd @ 192.168.0.4: 8000
Whether to start the seed node mode: is that
Whether it is a seed node: is that
Optimal node connection number: 10
Minimum number of node connections: 2
Maximum number of node connections: 30
Whether intranet connectivity is allowed: is that
Refreshing time: 30 seconds
It should be noted that the above configuration of the blockchain network node and the setting operation of the configuration are included in the solution according to the present disclosure.
The node configuration in the address book of the seed node will be exemplarily described below. As mentioned before, the node will upload some configuration parameters of itself into the address book of the seed node after connecting with the seed node. In particular, the node adds at least its own node identifier, which may be similar to the aforementioned fixed connection node identifier, seed node identifier, to the address book of the seed node, and will not be described in detail here.
When the node is connected to the seed node, the optimal node connection number and the current node connection number of the node are added to the address book of the seed node as node connection information. In particular, the maximum node connection number of the node may also be added as node connection information to the address book of the seed node, and the meaning of these configuration parameters is the same as described above and will not be described in detail here.
In addition, the address book of the seed node also includes the last update time, which indicates the time when the node last communicated with the seed node. When the seed node manages its own address book, the seed node will refresh the address book periodically, if the time point exceeds a certain time (such as several hours) set in the configuration, the node will be considered to be disconnected, and its related information will be deleted from the address book.
An example of the configuration of one candidate node in the address book of the seed node will be shown below.
And (4) node id: agjizxndfginqwdgjasd
And (4) node ip: 192.168.0.1
Port: 8000
Optimal node connection number: 10
Current node connection number: 5
Maximum number of node connections (optional): 30
And (3) final updating time: 2019-08-06T 10: 35: 45.225893582+08: 00
It should be noted that the list of candidate nodes in the address book may include at least one candidate node, each of which may employ a node configuration as described above. It should be noted, however, that the candidate node configuration in the address book is not limited to the above-described configuration, but may also include other configurations, such as other configurations known in the art, and will not be described in detail herein.
The following describes an exemplary operation procedure for connecting a node to a network to realize networking. The operations herein may be considered as operations performed when a node state changes, including, but not limited to, a new node connecting to a network, a node restoring network connection after disconnecting from a network, a node reconnecting to a network after disconnecting from another node, etc., wherein the nodes performing the network connection operations may all be considered as access nodes.
For the sake of simplicity, the operation flow of the non-seed node as an access node connecting a network according to an embodiment of the present disclosure will be described in detail below with reference to fig. 5.
When an access node is to connect to the network, the node will be assigned at least a fixed connection node for the node to connect to, the information of the fixed connection node being as described above and will not be described in detail here.
First, the access node will connect to the fixed connection node. Here, it should be noted that the fixed connection node connection is generally necessary. For the consensus nodes of the whole block chain network and the core, the network must be planned, and all the consensus nodes can be connected into a stable network in the fixed connection node connection. For the non-common node, the fixed connection node should be set as a common node to ensure that the non-common node does not separate from the common node group and cannot synchronize the block.
It should be noted that the nodes configured in the fixed connection node are all required to remain connected, so if the fixed connection node is found to be disconnected, reconnection is required. Therefore, according to one embodiment, after the operation of the access node connecting with the fixed connection node, the access node may start a thread to periodically detect whether all the nodes in the fixed connection node are connected, and if no connected node is found, initiate the connection.
Next, the access node is checked whether to turn on the seed node mode, and if not, only the most basic fixed connection node connection mode is used. If the seed node is opened, the seed node is disconnected. In particular, in case the node opens the seed node connection mode, the node will be assigned a seed node for the node to connect with, the seed node identification being as described above and will not be described in detail here.
Then, the access node connects to the seed node to obtain the address book. The node randomly selects a seed node from the configured seed nodes to connect, acquires the existing address book after connection, and can temporarily store the existing address book to the local. Furthermore, the node may send its own configuration information to the seed node to be added to the candidate node list of the address book, where the configuration information of the node is configured as the node in the address book as described above, and will not be described in detail here. The node can then actively disconnect from the seed node. Preferably, the node may be periodically connected to the seed node to obtain the latest address book.
Next, nodes are selected from the address book and connected. Specifically, the access node selects a candidate node for connection from the candidate node list of the acquired address book according to the node connection number information of the candidate node.
The node connection number information may include an optimal node connection number, a current node connection number. In this case, a node whose current connection number is less than the optimal connection number of nodes and to which the node itself is not connected is selected from the address book for connection, and if a plurality of nodes are not connected and the optimal connection number of each of the nodes is equal to or greater than the current connection number, the node whose current connection number is the smallest or the node whose difference between the current connection number and the optimal connection number is the largest is selected. If the self is connected with all nodes, the connection is not carried out. If all candidate nodes have reached the optimal node connection number, no connection is made. At this point, either an alarm is issued or the seed node may be reconnected at predetermined intervals to obtain an updated address book for connection.
The node connection number information may particularly also comprise a maximum node connection number. In this case, if the current node connection number of all candidate nodes of the seed node to which the access node is connected is equal to or greater than its optimal node connection number, the candidate node is considered to be selected with the maximum node connection number. For example, if the current node connection number of at least one candidate node is less than the maximum node connection number and is not connected, selecting the candidate node with the minimum current node connection number in the at least one candidate node; or the candidate node with the largest difference between the current node connection number and the maximum node connection number in the at least one candidate node. If the self is connected with all nodes, the connection is not carried out. If all candidate nodes have reached the maximum node connection number, the connection is not performed. At this point, either an alarm is issued or the seed node may be reconnected at predetermined intervals to obtain an updated address book for connection.
Thus, in the manner described above, the access node connects to the candidate node. At this time, whether the current connection number is smaller than the minimum connection number is detected, if so, the operation of connecting the seed node and the candidate node is continued until the current node connection number of the access node is equal to the minimum node connection number.
It should be noted that the above operation of detecting whether the current node connection number is less than the minimum node connection number is exemplary, and may be considered to be triggered in response to a connection state change of the access node, which may be initiated in response to various types of node connection state changes, such as connection of the access node to a fixed node, connection of the access node to a candidate node, disconnection of a node, and so on. Thus, in addition to the above, the operation may alternatively or additionally occur elsewhere in the flow.
As an example, after the fixed connection node is connected, it may be detected whether the current node connection number of the access node is less than the minimum node connection number thereof, and if the current node connection number of the access node is less than the minimum node connection number thereof and the access node has started the seed node mode, the operations of connecting the seed node and the candidate node will be performed. Otherwise, if the current node connection number of the access node is less than the minimum node connection number and the access node does not start the seed node mode, the fixed connection is continued, and if the current node connection number of the access node is equal to the minimum node connection number, the connection is not performed any more.
As an example, when the access node performs a network connection operation in a case where the access node is disconnected from other nodes, the access node may first detect whether the current node connection number is less than the minimum node connection number, and may perform a network connection in a similar operation to the above-described operation depending on the detection result and whether the access node turns on the seed mode, which will not be described in detail herein.
The above operation is an example of the operation in which the access node is a non-seed node. Similar operations may be performed if it is the seed node that performs the network connection operation, but differs in several respects.
1. The seed node identification item of the seed node needs to be configured with other seed nodes. Therefore, in the seed node connection step, after the seed node is connected with other seed nodes, the two parties exchange the address book and update the address book. The updating rule is that address information which is not provided in the two address books is supplemented mutually, and if the same node information is found, the updating time is used as the standard, and the old updating time is covered by the newer updating time.
2. In addition, the seed node is also connected with other seed nodes in the seed node configuration at regular time, and the information in the address book is exchanged with each other to update the address book.
The following exemplarily describes a process of network node recovery after disconnection according to an embodiment of the present disclosure, and it should be noted that this operation is similar to the operation of the above-described node connection network, and thus the network recovery operation will be summarized here as follows.
If one network node disconnects from the other nodes for some reason, the following operations will be performed.
1. The thread of the fixed connection node can find that the connection is disconnected, and the fixed connection node can be continuously connected in a circulating mode until the thread is successfully connected with the fixed connection node. This operation is similar to the fixed connection node connection operation described previously and will not be described in detail here.
2. If the fixed connection node is successfully connected (indicating that the network is successfully recovered), it triggers the detection of whether the connection number is greater than or equal to the minimum connection number (as long as the network status changes, whether the network is newly accessed or disconnected, the judgment is triggered, and another condition is that the seed node mode is opened), and if the connection number is less than the minimum connection number, it triggers the seed node to be disconnected, and the latest address book is obtained, as in the seed node connection operation described above.
3. The nodes are connected according to the nodes recorded in the address book, and the network is recovered, as in the candidate node connection operation described above.
The block chain network formed by the method is more dynamic, can be automatically recovered after the network is disconnected, can be dynamically formed, and can form a better block chain network according to the self-adaptive network condition of the node configuration.
Fig. 6 illustrates an exemplary configuration of a computing device 2000 in which embodiments in accordance with the present disclosure may be implemented. Computing device 2000 is an example of a hardware device to which the above-described aspects of the disclosure may be applied. Computing device 2000 may be any machine configured to perform processing and/or computing. The computing device 2000 may be, but is not limited to, a workstation, a server, a desktop computer, a laptop computer, a tablet computer, a Personal Data Assistant (PDA), a smart phone, an in-vehicle computer, or a combination thereof. The aforementioned consensus node, non-consensus node, seed node, or apparatus for network networking based on blockchains 400, etc., may all or at least partially be implemented by the aforementioned computing apparatus 2000 or an apparatus or system similar thereto.
As shown in fig. 6, computing device 2000 may include one or more elements connected to or in communication with bus 2002, possibly via one or more interfaces. For example, computing device 2000 may include a bus 2002, one or more processors 2004, one or more input devices 2006, and one or more output devices 2008. Bus 2002 may include, but is not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA (eisa) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus, among others. The one or more processing devices 2004 can be any kind of processor and can include, but are not limited to, one or more general-purpose processors or special-purpose processors (such as special-purpose processing chips). Input device 2006 may be any type of input device capable of inputting information to a computing device and may include, but is not limited to, a mouse, a keyboard, a touch screen, a microphone, and/or a remote control. Output device 2008 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. The computing device 2000 may also include or be connected to a non-transitory storage device 2010, which non-transitory storage device 2010 may be any non-transitory and may implement a data storage device, and may include, but is not limited to, a disk drive, an optical storage device, a solid state storageMemory, floppy disks, flexible disks, hard disks, magnetic tape, or any other magnetic medium, compact disks or any other optical medium, ROM (read only memory), RAM (random access memory), cache memory, and/or any other memory chip or module, and/or any other medium from which a computer can read data, instructions, and/or code. The non-transitory storage device 2010 may be removably connected with any interface. The non-transitory storage device 2010 may have stored thereon data/instructions/code for implementing the aforementioned block chain based networking methods and/or steps. Computing device 2000 may also include a communication device 2012, which communication device 2012 may be any kind of device or system capable of enabling communication with external devices and/or networks and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication device, and/or a chipset (such as bluetooth)TMDevices, 1302.11 devices, WiFi devices, WiMax devices, cellular communications facilities, etc.).
The computing device 2000 may also include a working memory 2014. The working memory 2014 may be any type of working memory capable of storing instructions and/or data useful to the processor 2004 and may include, but is not limited to, Random Access Memory (RAM) and Read Only Memory (ROM).
The software elements located on the above-described working memory may include, but are not limited to, an operating system 2016, one or more application programs 2018, drivers, and/or other data and code. The one or more applications 2018 may include instructions for performing the methods and steps for network networking based on blockchains as described above. The aforementioned means/units/elements of apparatus/means 400 for network networking based on blockchains may be implemented by a processor that reads and executes one or more applications 2018. More specifically, for example, the fixed connection node connection apparatus 402 in the aforementioned apparatus 400 may be implemented by the processor 2004 when executing the application 2018 having instructions for performing step S302 of fig. 3. Further, for example, the seed node connection means 404 in the aforementioned apparatus 400 may be implemented by the processor 2004 when executing the application 2018 having instructions for performing step S304 of fig. 3. Further, for example, the candidate node connection means 406 in the aforementioned means 400 may be implemented by the processor 2004 when executing the application 2018 with instructions for performing step S306 of fig. 3. Each of the other foregoing devices 1000 may also be implemented in a similar manner. Executable code or source code of the instructions of the software elements may be stored in a non-transitory computer-readable storage medium (such as storage device 2010 as described above) and may be read into working memory 2014 by compilation and/or installation. Executable or source code for the instructions of the software elements may also be downloaded from a remote location.
It will be appreciated that variations may be made in accordance with specific requirements. For example, customized hardware might be used and/or particular elements might be implemented in hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. In addition, connections to other computing devices (such as network input/output devices) may be employed. For example, some or all of the methods and apparatus of the present disclosure may be implemented in accordance with the present disclosure using assembly language programming hardware (e.g., programmable logic circuits including Field Programmable Gate Arrays (FPGAs) and/or Programmable Logic Arrays (PLAs)) or hardware programming languages of logic and algorithms (e.g., VERILOG, VHDL, C + +).
It should be further understood that the elements of computing device 2000 may be distributed throughout a network. For example, some processes may be performed using one processor while other processes are performed using other remote processors. Other elements of the computer system 2000 may be similarly distributed. Thus, the computing device 2000 may be understood as a distributed computing system that performs processing at multiple sites.
It should be noted that the methods and apparatus described herein may be implemented as software, firmware, hardware, or any combination thereof. Some components may be implemented as software running on a digital signal processor or microprocessor, for example. Other components may be implemented as hardware and/or application specific integrated circuits, for example. The order of the steps of the method described above is merely illustrative, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as a program recorded in a recording medium, including machine-readable instructions for implementing a method according to the present disclosure. Accordingly, the present disclosure also encompasses a recording medium storing a program for implementing the method according to the present disclosure.
Those skilled in the art will appreciate that the boundaries between the above described operations merely illustrative. Multiple operations may be combined into a single operation, single operations may be distributed in additional operations, and operations may be performed at least partially overlapping in time. Moreover, alternative embodiments may include multiple instances of a particular operation, and the order of operations may be altered in various other embodiments. However, other modifications, variations, and alternatives are also possible. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Various exemplary implementations of implementing the concepts of the present disclosure are contemplated in accordance with embodiments of the present disclosure, including but not limited to:
an exemplary embodiment 1. a network networking method based on a block chain, comprising:
a fixed connection node connection step for connecting an access node to at least one fixed connection node in the blockchain network;
a seed node connection step, in the case that an access node can execute a seed node access mode, of connecting the access node to a seed node in a block chain network, and acquiring an address book of the seed node from the connected seed node, where the address book includes a candidate node list, the candidate node list at least includes node identification and node connection number information of each candidate node, and the node connection number information at least includes an optimal node connection number and a current node connection number of the node; and
a candidate node connection step of causing the access node to select a candidate node for connection according to node connection number information of the candidate node from the candidate node list of the acquired address book,
in the candidate node connection step, the access node selects a candidate node which is less than the optimal node connection number in the address book and is not connected with the access node for connection.
Exemplary embodiment 2. the network networking method according to exemplary embodiment 1, wherein, in the candidate node connection step, if there are a plurality of candidate nodes whose current node connection number is less than its optimal node connection number and which are not connected to the access node, one of the following is selected for connection:
a candidate node with the smallest current node connection number in the plurality of candidate nodes; or
The candidate node with the largest difference between the current node connection number and the optimal node connection number in the plurality of candidate nodes.
Exemplary embodiment 3 the network networking method according to exemplary embodiment 1, wherein the node connection number information further includes a maximum node connection number of the nodes, and
in the candidate node connection step, if the current node connection number of all candidate nodes of the seed node connected by the access node is equal to or greater than the optimal node connection number, but at least one candidate node of which the current node connection number is less than the maximum node connection number and is not connected with the access node is still existed, selecting one of the following nodes for connection:
the candidate node with the minimum current node connection number in the at least one candidate node; or
The candidate node with the largest difference between the current node connection number and the maximum node connection number in the at least one candidate node.
Exemplary embodiment 4. the network networking method according to exemplary embodiment 1, wherein, in case that the current node connection number of the access node is still less than its minimum node connection number after the candidate node connection step, the seed node connection step and the candidate node connection step are performed again until the current node connection number of the access node is equal to its minimum node connection number.
Exemplary embodiment 5. the network networking method according to exemplary embodiment 1, wherein the address book of the seed node is updated in at least one of the following ways:
when a non-seed node is newly connected or is periodically connected to the seed node, the node identification and node connection number information of the access node are added into a candidate node list of an address book of the seed node;
when a non-seed node which is connected with the seed node previously is not connected with the seed node after a certain time, deleting the information of the node from the address book of the seed node; and
the seed node is connected with any one or all of other seed nodes, so that the address books of the seed node and other seed nodes are supplemented with node information which is not available, and if the same node information is found, the latest node information is kept.
Exemplary embodiment 6. the network networking method according to exemplary embodiment 1, wherein the method is started to execute when a node newly accesses a blockchain network, or when the node recovers the network after disconnecting from the blockchain network, or when the network connection state of a node in the blockchain network changes and the current node connection number of the node is less than the minimum node connection number of the access node itself.
Exemplary embodiment 7. the network networking method according to exemplary embodiment 1, wherein the access node disconnects from the seed node after connecting to the seed node to obtain the address book, and wherein the access node periodically connects to the seed node to provide node connection number information of the access node itself to the seed node.
Example 8. the network networking method according to example 1, wherein the access node can be set as a seed node for network networking, and
when the access node is used as a seed node for network networking, in the seed node connection step, address books of the access node and other seed nodes are supplemented with node information which is not available, and if the same node information is found, the latest node information is kept.
Exemplary embodiment 9. the network networking method according to exemplary embodiment 1, wherein the seed node connection step and the candidate node connection step are performed after the access node is connected to the at least one consensus node.
Exemplary embodiment 10. the network networking method according to exemplary embodiment 1, wherein the access node periodically detects the connection with the fixed connection node and immediately performs the fixed connection node connection operation upon disconnection from the fixed connection node.
Exemplary embodiment 11 the network networking method according to exemplary embodiment 1, further comprising:
whether the node allows intranet connection is set, and
when the node allows intranet connectivity, the intranet's IP address will appear in the address book for the node to connect to.
Exemplary embodiment 12 the network networking method according to exemplary embodiment 1, wherein the access node is assigned with at least one seed node, and in the seed node accessing step, the access node randomly selects any seed node of the at least one seed node for connection.
Exemplary embodiment 13 the method of networking according to exemplary embodiment 1, wherein the at least one fixed connection node comprises at least one consensus node.
Example embodiment 14. an apparatus, comprising:
at least one processor; and
at least one storage device having instructions stored thereon that, when executed by the at least one processor, may cause the at least one processor to perform the method of any of exemplary embodiments 1-12.
Example embodiment 15 a computer readable storage medium having stored thereon instructions, which when executed by a processor, cause performance of a method according to any one of example embodiments 1-12.
Example embodiment 16. a blockchain-based networking device, comprising:
a fixed connection node connection means configured such that an access node connects at least one fixed connection node in the blockchain network;
a seed node connecting device configured to, in a case where an access node can execute a seed node access mode, enable the access node to connect a seed node in a block chain network, and obtain an address book of the seed node from the connected seed node, where the address book includes a candidate node list, the candidate node list includes at least a node identifier and node connection number information of each candidate node, and the node connection number information includes at least an optimal node connection number and a current node connection number of the node; and
candidate node connection means configured to cause the access node to select a candidate node for connection in accordance with node connection number information of the candidate node from the candidate node list of the acquired address book,
wherein the candidate node connection means is configured to cause the access node to select a candidate node in the address book, which is less than the optimal node connection number and is not connected with the access node, for connection.
An exemplary embodiment 17. the network networking device according to exemplary embodiment 16, wherein the candidate node connection means is configured to, if there are a plurality of candidate nodes whose current node connection number is less than its optimal node connection number and which are not connected to the access node, cause the access node to select one of:
a candidate node with the smallest current node connection number in the plurality of candidate nodes; or
The candidate node with the largest difference between the current node connection number and the optimal node connection number in the plurality of candidate nodes.
Exemplary embodiment 18 the network networking device according to exemplary embodiment 16, wherein the node connection number information further includes a maximum node connection number of the nodes, and
the candidate node connection means is configured to, if the current node connection number of all candidate nodes of the seed node to which the access node is connected is equal to or greater than its optimal node connection number but there remains at least one candidate node whose current node connection number is less than its maximum node connection number and which is not connected to the access node, cause the access node to select one of:
the candidate node with the minimum current node connection number in the at least one candidate node; or
The candidate node with the largest difference between the current node connection number and the maximum node connection number in the at least one candidate node.
Example embodiment 19. the network networking device according to example embodiment 16, wherein, in a case where the current node connection number of the access node is still less than its minimum node connection number after the access node connects the candidate node, the seed node connecting means and the candidate node connecting means operate again until the current node connection number of the access node is equal to its minimum node connection number.
Example embodiment 20. a network networking device according to example embodiment 16, wherein the address book of the seed node is updated in at least one of the following ways:
when a non-seed node is newly connected or is periodically connected to the seed node, the node identification and node connection number information of the access node are added into a candidate node list of an address book of the seed node;
when a non-seed node which is connected with the seed node previously is not connected with the seed node after a certain time, deleting the information of the node from the address book of the seed node; and
the seed node is connected with any one or all of other seed nodes, so that the address books of the seed node and other seed nodes are supplemented with node information which is not available, and if the same node information is found, the latest node information is kept.
Example embodiment 21. the network networking device according to example embodiment 16, wherein the device is started to perform the operation when a node newly accesses a blockchain network, or when a node recovers the network after disconnecting from the blockchain network, or when a network connection state of a node in the blockchain network changes and a current node connection number of the node is less than a minimum node connection number of an access node itself.
Example embodiment 22. the network networking device of example embodiment 16, wherein the access node, after connecting to the seed node to obtain the address book, will disconnect from the seed node, and wherein the access node periodically connects to the seed node to provide node connection number information of the access node itself to the seed node.
Example embodiment 23. the network networking device according to example embodiment 16, wherein the access node can be set as a seed node for network networking, and
the seed node connection means is configured such that, when the access node performs network networking as a seed node, the address books of the access node and the other seed nodes are complemented with each other with node information that is not present, and if the same node information is found, the latest node information is retained.
Example embodiment 24. the network networking device according to example embodiment 16, wherein the seed node connection means and the candidate node connection means operate after the access node connects to the at least one consensus node.
Exemplary embodiment 25. the network networking device of exemplary embodiment 16, wherein the access node periodically detects the connection with the fixed connection node and immediately performs the fixed connection node connection operation upon disconnection from the fixed connection node.
Example embodiment 26 the network networking device of example embodiment 16, further comprising means for:
whether the node allows intranet connection is set, and
when the node allows intranet connectivity, the intranet's IP address will appear in the address book for the node to connect to.
Example embodiment 27. the network networking device of example embodiment 16, wherein the access node is assigned at least one seed node, and the seed node access means is configured to cause the access node to randomly select any of the at least one seed node for connection.
Example embodiment 28 the network networking device of example embodiment 16, wherein the at least one fixed connection node comprises at least one consensus node.
Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood that the disclosure is not limited to the disclosed example embodiments. The above examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. The embodiments disclosed herein may be arbitrarily combined, as well as variously modified, without departing from the spirit and scope of the disclosure. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (9)

1. A network networking method based on a block chain comprises the following steps:
a fixed connection node connection step for connecting an access node to at least one fixed connection node in the blockchain network;
a seed node connection step, in the case that the access node can execute a seed node access mode, of connecting the access node to a seed node in the block chain network, and obtaining an address book of the seed node from the connected seed node, where the address book includes a candidate node list, the candidate node list at least includes node identifiers of candidate nodes and node connection number information, and the node connection number information at least includes an optimal node connection number of the candidate nodes and a current node connection number, where the optimal node connection number of the candidate nodes indicates an optimal load state set for the candidate nodes; and
a candidate node connection step of causing the access node to select a candidate node for connection according to node connection number information of the candidate node from the candidate node list of the acquired address book,
wherein, in the candidate node connection step, the access node selects a candidate node which is less than the optimal node connection number in the address book and is not connected with the access node for connection,
wherein, under the condition that the current node connection number of the access node is still less than the minimum node connection number thereof after the candidate node connection step, the seed node connection step and the candidate node connection step are executed again until the current node connection number of the access node is equal to the minimum node connection number thereof, and
wherein the method further comprises:
whether the node allows intranet connection is set, and
when the node allows intranet connectivity, the intranet's IP address will appear in the address book for the node to connect to.
2. The network networking method according to claim 1, wherein, in the candidate node connection step, if there are a plurality of candidate nodes whose current node connection number is less than its optimal node connection number and which are not connected to the access node, one of the following is selected for connection:
a candidate node with the smallest current node connection number in the plurality of candidate nodes; or
The candidate node with the largest difference between the current node connection number and the optimal node connection number in the plurality of candidate nodes.
3. The network networking method of claim 1, wherein the node connection number information further includes a maximum node connection number of nodes, and
in the candidate node connection step, if the current node connection number of all candidate nodes of the seed node connected by the access node is equal to or greater than the optimal node connection number, but at least one candidate node of which the current node connection number is less than the maximum node connection number and is not connected with the access node is still existed, selecting one of the following nodes for connection:
the candidate node with the minimum current node connection number in the at least one candidate node; or
The candidate node with the largest difference between the current node connection number and the maximum node connection number in the at least one candidate node.
4. The network networking method of claim 1, wherein the address book of the seed node is updated in at least one of the following ways:
when a non-seed node is newly connected or is periodically connected to the seed node, the node identification and node connection number information of the access node are added into a candidate node list of an address book of the seed node;
when a non-seed node which is connected with the seed node previously is not connected with the seed node after a certain time, deleting the information of the node from the address book of the seed node; and
the seed node is connected with any one or all of other seed nodes, so that the address books of the seed node and other seed nodes are supplemented with node information which is not available, and if the same node information is found, the latest node information is kept.
5. The networking method of claim 1,
when a node is newly accessed into the block chain network, or the network is recovered after the node is disconnected from the block chain network, or the network connection state of the node in the block chain network changes and the current node connection number of the node is less than the minimum node connection number of the access node, the method is started to be executed.
6. The network networking method of claim 1, wherein the access node will disconnect from the seed node after connecting to the seed node to obtain the address book, and wherein the access node periodically connects to the seed node to provide node connection number information of the access node itself to the seed node.
7. The network networking method of claim 1, wherein the access node is configurable as a seed node for network networking, and
when the access node is used as a seed node for network networking, in the seed node connection step, address books of the access node and other seed nodes are supplemented with node information which is not available, and if the same node information is found, the latest node information is kept.
8. The network networking method of claim 1, wherein the seed node connecting step and the candidate node connecting step are performed after the access node is connected to the at least one consensus node.
9. The network networking method of claim 1, wherein the access node periodically detects the connection with the fixed connection node and immediately performs the fixed connection node connection operation upon disconnection from the fixed connection node.
CN201910873181.1A 2019-09-17 2019-09-17 Block chain based network connection and recovery mechanism Active CN110581892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910873181.1A CN110581892B (en) 2019-09-17 2019-09-17 Block chain based network connection and recovery mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910873181.1A CN110581892B (en) 2019-09-17 2019-09-17 Block chain based network connection and recovery mechanism

Publications (2)

Publication Number Publication Date
CN110581892A CN110581892A (en) 2019-12-17
CN110581892B true CN110581892B (en) 2022-04-01

Family

ID=68811341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910873181.1A Active CN110581892B (en) 2019-09-17 2019-09-17 Block chain based network connection and recovery mechanism

Country Status (1)

Country Link
CN (1) CN110581892B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111047448A (en) * 2019-12-30 2020-04-21 国家计算机网络与信息安全管理中心 Analysis method and device for multi-channel data fusion
CN113239098B (en) * 2021-07-14 2021-09-28 腾讯科技(深圳)有限公司 Data management method, computer and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425916A (en) * 2007-11-02 2009-05-06 兄弟工业株式会社 Tree-type broadcast communication system, reconnection process method, communication node device, node process program, server device, and server process program
CN101924777A (en) * 2009-06-17 2010-12-22 中国移动通信集团公司 Method, system and equipment for searching active nodes in P2P streaming media system
CN101969448A (en) * 2009-06-17 2011-02-09 中国移动通信集团公司 Method, system and equipment for searching active node in P2P streaming media system
CN107231239A (en) * 2017-06-27 2017-10-03 中国联合网络通信集团有限公司 Create generation block method for anti-counterfeit and device
CN107579848A (en) * 2017-08-30 2018-01-12 上海保险交易所股份有限公司 The method that common recognition node is dynamically changed in practical Byzantine failure tolerance common recognition mechanism
TW201824818A (en) * 2016-12-23 2018-07-01 現代財富控股有限公司 Node list maintenance system based on blockchain and method thereof
CN110149221A (en) * 2019-04-28 2019-08-20 众安信息技术服务有限公司 A kind of construction method and device of the adaptive network based on alliance's chain

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9948704B2 (en) * 2016-04-07 2018-04-17 International Business Machines Corporation Determining a best fit coordinator node in a database as a service infrastructure
US10333849B2 (en) * 2016-04-28 2019-06-25 Nicira, Inc. Automatic configuration of logical routers on edge nodes

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425916A (en) * 2007-11-02 2009-05-06 兄弟工业株式会社 Tree-type broadcast communication system, reconnection process method, communication node device, node process program, server device, and server process program
CN101924777A (en) * 2009-06-17 2010-12-22 中国移动通信集团公司 Method, system and equipment for searching active nodes in P2P streaming media system
CN101969448A (en) * 2009-06-17 2011-02-09 中国移动通信集团公司 Method, system and equipment for searching active node in P2P streaming media system
TW201824818A (en) * 2016-12-23 2018-07-01 現代財富控股有限公司 Node list maintenance system based on blockchain and method thereof
CN107231239A (en) * 2017-06-27 2017-10-03 中国联合网络通信集团有限公司 Create generation block method for anti-counterfeit and device
CN107579848A (en) * 2017-08-30 2018-01-12 上海保险交易所股份有限公司 The method that common recognition node is dynamically changed in practical Byzantine failure tolerance common recognition mechanism
CN110149221A (en) * 2019-04-28 2019-08-20 众安信息技术服务有限公司 A kind of construction method and device of the adaptive network based on alliance's chain

Also Published As

Publication number Publication date
CN110581892A (en) 2019-12-17

Similar Documents

Publication Publication Date Title
CN108712457B (en) Method and device for adjusting dynamic load of back-end server based on Nginx reverse proxy
CN105407117B (en) The methods, devices and systems of distributed backup data
KR20120018178A (en) Swarm-based synchronization over a network of object stores
CN107404509B (en) Distributed service configuration system and information management method
US9326237B2 (en) Method, apparatus and computer program product providing performance and energy optimization for mobile computing
CN110581892B (en) Block chain based network connection and recovery mechanism
CN109173270B (en) Game service system and implementation method
US10866965B2 (en) Data replicating systems and data replicating methods
CN111338806B (en) Service control method and device
CN106209943A (en) The system of selection of communication node and device
KR20150111952A (en) Method and system for using a recursive event listener on a node in hierarchical data structure
WO2022134797A1 (en) Data fragmentation storage method and apparatus, a computer device, and a storage medium
CN112003943A (en) Voice data synchronization method and device
CN103281346A (en) Disconnection reconnection method, network system and proxy server
CN110493122A (en) A kind of synchronous method of session information, calculates equipment and storage medium at device
CN111884844A (en) Message service access method and device based on zookeeper
CN112612769A (en) File processing method, device and storage medium
JP2016144169A (en) Communication system, queue management server, and communication method
CN108810166A (en) Route management method, system, computer equipment and computer readable storage medium
CN115023919A (en) Firewall rule updating method and device, server and storage medium
US20170300553A1 (en) System and methodology for propagating modifications in key-value pairs across a cluster of computers
WO2022134830A1 (en) Method and apparatus for processing block node data, computer device, and storage medium
CN112087506B (en) Cluster node management method and device and computer storage medium
CN111698337B (en) Method, device and equipment for establishing communication connection
CN110569231B (en) Data migration method, device, equipment and 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
CB02 Change of applicant information

Address after: 200120 T3, 1788, 1800 Century Avenue, free trade Experimental Zone, Pudong New Area, Shanghai

Applicant after: Shanghai insurance exchange, Limited by Share Ltd

Address before: 200120 Shanghai East Road Pudong New Area Financial Information Center 22

Applicant before: Shanghai insurance exchange, Limited by Share Ltd

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant