CN112532438B - Method and device for determining communication network structure of alliance chain and electronic equipment - Google Patents

Method and device for determining communication network structure of alliance chain and electronic equipment Download PDF

Info

Publication number
CN112532438B
CN112532438B CN202011326370.6A CN202011326370A CN112532438B CN 112532438 B CN112532438 B CN 112532438B CN 202011326370 A CN202011326370 A CN 202011326370A CN 112532438 B CN112532438 B CN 112532438B
Authority
CN
China
Prior art keywords
node
nodes
level
main
master
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
CN202011326370.6A
Other languages
Chinese (zh)
Other versions
CN112532438A (en
Inventor
张雅楠
姜鹏
陈志明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202011326370.6A priority Critical patent/CN112532438B/en
Publication of CN112532438A publication Critical patent/CN112532438A/en
Application granted granted Critical
Publication of CN112532438B publication Critical patent/CN112532438B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • 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/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a method and a device for determining a communication network structure of a alliance chain and electronic equipment. The method comprises the following steps: determining a specified number of first committee nodes from the first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain; determining a main node from the election nodes according to the network connection condition among the election nodes; determining an auxiliary node and a next-level node from the second node according to the network connection condition between the second node and the main node; respectively dividing the nodes into node groups corresponding to the next-level nodes; and taking each next-level node as a main node of the node group, taking the node in the node group as a second node, and repeatedly executing the steps of determining the auxiliary node and the next-level node until the lowest-level node is determined. The scheme can optimize the communication network structure in the alliance chain, and provides a basis for step-by-step transmission and ordered synchronous transmission of the messages according to the levels and reduction of network overhead during message synchronization.

Description

Method and device for determining communication network structure of alliance chain and electronic equipment
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method and an apparatus for determining a communication network structure of a federation chain, and an electronic device.
Background
A blockchain is a decentralized system, and messages within a blockchain are synchronized between nodes of the blockchain. In the prior art, a gossip protocol is generally adopted for message synchronization in a block chain system, information is spread out between nodes in a near-out-of-order manner, and the bandwidth occupation between networks is large. In addition, the positions of the nodes in the alliance chain are equal, and when the number of the nodes is too large, the message synchronization efficiency is low.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks. The technical scheme adopted by the application is as follows:
in a first aspect, an embodiment of the present application provides a method for determining a communication network structure of a federation chain, where the method includes:
determining a specified number of first committee nodes from the first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain, wherein the first nodes are all nodes except the specified nodes in the alliance chain;
determining a main node from election nodes according to the network connection condition among the election nodes, wherein the election nodes comprise designated nodes and first committee nodes;
according to the network connection condition between the second node and the main node, determining a secondary node corresponding to the main node and a next-level node of the main node from the second node, and respectively dividing all nodes except the main node, the secondary node corresponding to the main node and the next-level node of the main node in the alliance chain into node groups corresponding to the next-level node of each main node, wherein the second node is all nodes except the main node in the alliance chain;
and taking the next-level node of the master node as the master node, taking the nodes in the node group as the second nodes, repeatedly executing the steps of determining the secondary node corresponding to the master node and the next-level node of the master node from the second nodes according to the network connection condition between the second nodes and the master node, and dividing all the nodes except the master node, the secondary node corresponding to the master node and the next-level node of the master node in the alliance chain into node groups corresponding to the next-level nodes of the master nodes respectively until the sum of the number of the secondary nodes corresponding to the master node and the number of the next-level nodes of the master node is not more than the designated number.
Optionally, determining a specified number of first committee nodes from the first nodes according to network connection conditions of the specified nodes in the federation chain and the first nodes in the federation chain, including:
sequencing the first nodes in the alliance chain based on the sequence of the network connection conditions with the designated nodes in the alliance chain from good to bad;
a first committee node is determined for a prescribed number of first nodes that are top in the ranking.
Optionally, the determining, by the network connection condition including a network connectivity index, a master node from the election nodes according to the network connection condition between the election nodes includes:
summing network communication indexes between any election node in the election nodes and election nodes except for any election node;
and determining any elected node with the highest corresponding summation result as the master node.
Optionally, determining, according to a network connection condition between the second node and the master node, a secondary node corresponding to the master node and a next-level node of the master node from the second node, including:
sequencing the second nodes according to the sequence of the network connection conditions with the main nodes from good to bad;
determining a second committee node for the designated number of second nodes that are first in the ranking;
and determining the node with the best network connection condition with the main node in the second committee nodes as a secondary node corresponding to the main node, and determining the nodes except the secondary node in the second committee nodes as the next-level node of the main node.
Optionally, the method further includes:
when any node in the levels except the lowest level is detected to be failed, determining an additional node with the best network connection condition with the corresponding node of the failed any node in the nodes at the lower level of the failed any node as any node;
and taking the supplementary node as any failed node, and repeatedly executing the step of determining the supplementary node with the best network connection condition with the corresponding node of any failed node in the next-level node of any failed node as any node until the next-level node of any failed main node cannot be found.
Optionally, the method further includes:
when detecting a newly added node to be added into the alliance chain, determining a node with the best network connection condition with the newly added node in the next level node of the main node as a target node;
and taking the target node as a master node, and repeatedly executing the step of determining the node with the best network connection condition with the newly added node in the next-stage nodes of the master node as the target node until the target node cannot be found, and determining the newly added node as the next-stage node of the target node at the lowest stage.
Optionally, the method further includes:
when the main node receives the message to be broadcasted, the message to be broadcasted is sent to a secondary node corresponding to the main node, and the main node and the secondary node respectively send the message to be broadcasted to a next-level node of the main node;
and taking the next-level node as a main node, repeatedly executing the steps of sending the message to be broadcasted to the secondary node corresponding to the main node, and respectively sending the message to be broadcasted to the next-level node of the main node by the main node and the secondary node until the message to be broadcasted is sent to the node at the lowest level.
Optionally, before the step of taking the next-level node as the master node, repeatedly executing the step of sending the message to be broadcasted to the secondary node corresponding to the master node, and sending the message to be broadcasted to the next-level node of the master node by the master node and the secondary node, the method further includes:
and determining that the messages to be broadcasted, which are sent by the main node and received by the next-level node, and the messages to be broadcasted, which are sent by the secondary node of the main node, are consistent.
In a second aspect, an embodiment of the present application provides an apparatus for determining a communication network structure of a federation chain, where the apparatus includes:
the first committee node determining module is used for determining a specified number of first committee nodes from the first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain, wherein the first nodes are all nodes except the specified nodes in the alliance chain;
the master node determining module is used for determining a master node from the election nodes according to the network connection condition among the election nodes, and the election nodes comprise designated nodes and first committee nodes;
the node division module is used for determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node, and dividing all nodes except the main node, the secondary node corresponding to the main node and the next-level node of the main node in the alliance chain into node groups corresponding to the next-level nodes of the main nodes respectively, wherein the second node is all nodes except the main node in the alliance chain;
and the repeated execution module is used for determining the secondary node corresponding to the main node and the next node of the main node from the second nodes according to the network connection condition between the second nodes and the main node, and dividing all the nodes except the main node, the secondary node corresponding to the main node and the next node of the main node in the alliance chain into the node groups corresponding to the next nodes of the main nodes respectively until the sum of the numbers of the secondary nodes corresponding to the main node and the next nodes of the main node is determined to be not more than the designated number.
Optionally, the first committee node determination module is specifically configured to:
the first nodes in the alliance chain are sequenced from good to bad based on the network connection condition of the appointed nodes in the alliance chain;
a first committee node is determined for a specified number of first nodes that are first in the ranking.
Optionally, the network connection condition includes a network connectivity index, and the master node determining module is specifically configured to, when determining the master node from the election nodes according to the network connection condition between the election nodes:
summing network communication indexes between any election node in the election nodes and election nodes except for any election node;
and determining any elected node with the highest corresponding summation result as the master node.
Optionally, the node dividing module is specifically configured to, when determining the secondary node corresponding to the primary node and the next-stage node of the primary node from the second node according to a network connection condition between the second node and the primary node:
sequencing the second nodes according to the sequence of the network connection conditions with the main nodes from good to bad;
determining a second committee node for the designated number of second nodes that are first in the ranking;
and determining the node with the best network connection condition with the main node in the second committee nodes as a secondary node corresponding to the main node, and determining the nodes except the secondary node in the second committee nodes as the next-level node of the main node.
Optionally, the apparatus further comprises: the failure node processing module is used for:
when any node in the levels except the lowest level is detected to be failed, determining an additional node with the best network connection condition with the corresponding node of the failed any node in the nodes at the lower level of the failed any node as any node;
and taking the supplementary node as any failed node, and repeatedly executing the step of determining the supplementary node with the best network connection condition with the corresponding node of any failed node in the next-level node of any failed node as any node until the next-level node of any failed main node cannot be found.
Optionally, the apparatus further comprises: newly-increased node processing module, newly-increased node processing module is used for:
when detecting a newly added node to be added into the alliance chain, determining a node with the best network connection condition with the newly added node in the next level node of the main node as a target node;
and taking the target node as a master node, and repeatedly executing the step of determining the node with the best network connection condition with the newly added node in the next-stage nodes of the master node as the target node until the target node cannot be found, and determining the newly added node as the next-stage node of the target node at the lowest stage.
Optionally, the apparatus further comprises: a message synchronization module to:
when the main node receives the message to be broadcasted, the message to be broadcasted is sent to a secondary node corresponding to the main node, and the main node and the secondary node respectively send the message to be broadcasted to a next-level node of the main node;
and taking the next-level node as a main node, repeatedly executing the steps of sending the message to be broadcasted to a secondary node corresponding to the main node, and respectively sending the message to be broadcasted to the next-level node of the main node by the main node and the secondary node until the message to be broadcasted is sent to the node at the lowest level.
Optionally, the message synchronization module is further configured to:
before the next-level node is used as a main node, the step of sending the message to be broadcasted to the secondary node corresponding to the main node is repeatedly executed, and the main node and the secondary node respectively send the message to be broadcasted to the next-level node of the main node, the condition that the message to be broadcasted sent by the main node and the message to be broadcasted sent by the secondary node of the main node, which are received by the next-level node, are consistent is determined.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
a memory for storing operating instructions;
a processor, configured to execute the method for determining a communication network structure of a federation chain as shown in any implementation manner of the first aspect of the present application by calling an operation instruction.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for determining a communication network structure of a federation chain as shown in any one of the embodiments of the first aspect of the present application.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
according to the device provided by the embodiment of the application, the first committee nodes with the specified number are determined from the first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain; determining a main node from the election nodes according to the network connection condition among the election nodes; determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node; dividing the nodes in the alliance chain into node groups corresponding to the nodes at the next level respectively; and taking each next-level node as a main node of the node group, taking the nodes in the node group as second nodes, and repeatedly executing the step of determining the auxiliary nodes and the next-level nodes of the main nodes until the lowest-level node is determined. The scheme can optimize the communication network structure in the alliance chain, and provides a basis for progressive and orderly synchronous transmission of the messages according to the levels and reduction of network overhead during message synchronization.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a method for determining a communication network structure of a federation chain according to an embodiment of the present application;
fig. 2, fig. 3, fig. 4, and fig. 5 are node relationship diagrams corresponding to each step in a specific implementation of a method for determining a communication network structure of a federation chain according to an embodiment of the present application.
Fig. 6 is a schematic flowchart of message passing between nodes when performing message synchronization based on a communication network structure of a federation chain provided in this embodiment of the present application;
fig. 7, 8, and 9 are node relationship diagrams corresponding to steps when processing a failed master node in a communication network structure of a federation chain according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a determining apparatus of a communication network structure of a federation chain according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative and are only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, the following detailed description of the embodiments of the present application will be made with reference to the accompanying drawings.
The following describes the technical solution of the present application and how to solve the above technical problems in detail by specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 shows a schematic flowchart of a method for determining a communication network structure of a federation chain according to an embodiment of the present application, where as shown in fig. 1, the method mainly includes:
step S110: according to the network connection condition of a designated node in the alliance chain and a first node in the alliance chain, determining a designated number of first committee nodes from the first node, wherein the first node is all nodes except the designated node in the alliance chain.
In the embodiment of the application, a designated node can be designated when a federation chain is initialized, each first node in the federation chain can transmit a certificate and corresponding IP address information to the designated node, and the designated node stores the received information of all the first nodes in a corresponding database so as to complete the registration of the node; at this time, the designated node establishes network communication relationships with all the first nodes and may generate a network connection status relationship table. And performing network test on all the first nodes through the designated nodes, and updating the network connection state relation table and performing whole-network broadcasting according to the network test result.
In the embodiment of the application, the specified number of first committee nodes can be determined from the first nodes according to the tested network connection condition of the first nodes and the specified nodes.
Step S120: and determining a main node from the election nodes according to the network connection condition among the election nodes, wherein the election nodes comprise designated nodes and first committee nodes.
In the embodiment of the application, after the first committee node is determined, the first committee node and the designated node can be used as election nodes, and the election nodes participate in election together, so that the master node is determined from the election nodes.
Step S130: according to the network connection condition between the second node and the main node, determining a secondary node corresponding to the main node and a next-level node of the main node from the second node, and respectively dividing all nodes except the main node, the secondary node corresponding to the main node and the next-level node of the main node in the alliance chain into node groups corresponding to the next-level node of each main node, wherein the second node is all nodes except the main node in the alliance chain.
In the embodiment of the application, after the main node is determined, the main node can perform network test on the second node, update the network connection state relation table and perform whole network broadcasting, and sort the network test results in a descending order, so that the auxiliary node corresponding to the main node and the next-level node of the main node are selected based on the sorting. The sum of the node numbers of the secondary node and the node at the next stage of the primary node may be a specified number.
In this embodiment of the application, the second nodes that are not determined to be at a hierarchical level in the federation chain may be classified into node groups corresponding to the next-level nodes of the master node, and specifically, for each second node, the next-level node with the best network connection condition with the second node may be determined, and then the second node is classified into the node group of the next-level node.
Step S140: and taking the next-level node of the main node as the main node, taking the node in the node group as the second node, repeatedly executing the steps of determining the secondary node corresponding to the main node and the next-level node of the main node from the second node according to the network connection condition between the second node and the main node, and dividing all the nodes except the main node, the secondary node corresponding to the main node and the next-level node of the main node in the alliance chain into node groups corresponding to the next-level nodes of the main nodes respectively until the sum of the node numbers of the secondary node corresponding to the main node and the next-level node of the main node is determined to be not more than the designated number.
In this embodiment of the present application, a node at the next level of the master node may be used as the master node of the hierarchy where the master node is located, and a node in a node group corresponding to the node may be used as the second node, and the operations of selecting the secondary node, dividing the node group for the next level node and the next level node are repeated until the sum of the node numbers of the secondary node and the next level node of the master node is not greater than a specified number, that is, the lowest level is reached.
In the embodiment of the application, recursion can be performed step by step according to the hierarchy, and after the recursion is performed until the node at the lowest level, each node in the federation chain is determined to be allocated to the node group to which the node belongs, the network connection state table is updated, and the member attribution table is generated, namely, the hierarchy to which each node belongs and the node group to which the node belongs.
In the embodiment of the application, the nodes such as the main node, the auxiliary node, the next-level node and the like are basically the same as other nodes, but the level and the role in the network communication architecture are different.
According to the method provided by the embodiment of the application, a specified number of first committee nodes are determined from first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain; determining a main node from the election nodes according to the network connection condition among the election nodes; determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node; dividing the nodes in the alliance chain into node groups corresponding to the nodes at the next level respectively; and taking each next-level node as a main node of the node group, taking the nodes in the node group as second nodes, and repeatedly executing the step of determining the auxiliary nodes and the next-level nodes of the main node until the lowest-level node is determined. The scheme can optimize the communication network structure in the alliance chain, and provides a basis for progressive and orderly synchronous transmission of the messages according to the levels and reduction of network overhead during message synchronization.
In an optional manner of the embodiment of the present application, determining, according to a network connection condition between a designated node in a federation chain and a first node in the federation chain, a designated number of first committee nodes from the first node includes:
sequencing the first nodes in the alliance chain based on the sequence of the network connection conditions with the designated nodes in the alliance chain from good to bad;
a first committee node is determined for a specified number of first nodes that are first in the ranking.
In the embodiment of the application, when the first committee nodes are determined, the network speed can be used as a network test measurement index, and the first nodes are sequenced according to the network speed test result between each first node and the appointed node, so that the appointed number of first committee nodes with better network connection condition are selected.
In an optional manner of the embodiment of the present application, the determining, by a network connection condition, a master node from election nodes according to a network connection condition between the election nodes includes:
summing network communication indexes between any election node in the election nodes and election nodes except any election node;
and determining any elected node with the highest corresponding summation result as the master node.
In the embodiment of the application, the election nodes participate in election at the same time, network communication indexes among the election nodes are measured, the network communication indexes of each election node and the network communication indexes of other election nodes are summed, then the summed result is used as a sequencing basis, and the election nodes are sequenced, so that the election node with the highest summation result is elected as a main node.
In an optional manner of the embodiment of the present application, determining, according to a network connection condition between a second node and a master node, a secondary node corresponding to the master node and a next-level node of the master node from the second node includes:
sequencing the second nodes according to the sequence of the network connection conditions with the main nodes from good to bad;
determining a second committee node for the designated number of second nodes that are first in the ranking;
and determining the node with the best network connection condition with the main node in the second committee nodes as a secondary node corresponding to the main node, and determining the nodes except the secondary node in the second committee nodes as the nodes next to the main node.
In the embodiment of the present application, a specified number of second committee nodes with better network conditions with the master node may be selected from the second nodes, the second node with the best network conditions with the master node is determined as the secondary node corresponding to the master node, and the second committee node with which the secondary node is determined as the next-stage node of the master node.
In an optional manner of the embodiment of the present application, the method further includes:
when any node in the levels except the lowest level is detected to be failed, determining an additional node with the best network connection condition with the corresponding node of the failed any node in the nodes at the lower level of the failed any node as any node;
and taking the supplementary node as any failed node, and repeatedly executing the step of determining the supplementary node with the best network connection condition with the corresponding node of any failed node in the next-level node of any failed node as any node until the next-level node of any failed main node cannot be found.
In the embodiment of the present application, a failure condition may occur in a primary node or a corresponding secondary node of each hierarchy. If the main node in each stage except the lowest stage fails, the secondary node corresponding to the main node determines the node with the best network connection condition with the secondary node from the nodes of the next stage of the failed main node as an additional node, and the additional node is selected as the main node to replace the failed main node. After the supplementary node is supplemented to the primary node of the previous level, the original level of the supplementary node lacks the primary node, at this time, the supplementary node can be used as the failure primary node, the step of determining the node with the best network connection condition with the secondary node from the secondary node corresponding to the primary node as the supplementary node from the next level node of the failure primary node is repeatedly executed, and the supplementary node is selected as the primary node to replace the failure primary node until the next level node of any failure primary node cannot be found.
If the secondary nodes in the levels except the lowest level fail, the primary node corresponding to the secondary node can determine the node with the best network connection condition with the primary node from the nodes of the lower level of the failed secondary node as an additional node, and the additional node is selected as the secondary node to replace the failed secondary node. After the supplementary node is supplemented to the upper-level auxiliary node, the original level of the supplementary node lacks the main node, at this time, the supplementary node can be used as the failure main node, the step of determining the node with the best network connection condition with the auxiliary node from the lower-level nodes of the failure main node from the auxiliary node corresponding to the main node as the supplementary node is repeatedly executed, and the supplementary node is elected as the main node to replace the failure main node until the lower-level node of any failure main node cannot be found.
In an optional manner of the embodiment of the present application, the method further includes:
when detecting a newly added node to be added into the alliance chain, determining a node with the best network connection condition with the newly added node in the next level node of the main node as a target node;
and taking the target node as a master node, and repeatedly executing the step of determining the node with the best network connection condition with the newly added node in the next-stage nodes of the master node as the target node until the target node cannot be found, and determining the newly added node as the next-stage node of the target node at the lowest stage.
In the embodiment of the application, the newly added node can provide a network cluster adding application to the master node of the first level; and after receiving the application, the main node verifies the validity of the node, and continues to execute the subsequent flow if the verification is passed, otherwise, the process is finished directly.
The newly added node applying for joining sends network heartbeat information to all nodes, network testing is carried out on the newly added node and all nodes, and the testing result is sent to the main node after the network testing is finished;
and the master node determines the node with the best network connection condition with the newly added node in the next-level node as a target node according to the network test result, then sequentially iterates, takes the target node as the master node to repeatedly determine the node with the best network connection condition with the newly added node in the next-level node as the target node until the target node cannot be found, and distributes the newly added node to the next-level node of the target node at the lowest level.
The new node is successfully added into the network cluster, the main node can broadcast in the whole network, and the member attribution table is updated.
In actual use, the next-level node sends heartbeat information to the main node to which the next-level node belongs at regular time so as to transmit the state information of the node, when the next-level node fails, the main node in the group transmits the state information of the failed node to the main node at the topmost level, and the main node at the topmost level receives the state information of the failed node, updates a network communication state table and broadcasts the state information to the whole network so as to perform whole network synchronization on the message.
In an optional manner of the embodiment of the present application, the method further includes:
when the main node receives the message to be broadcasted, the message to be broadcasted is sent to a secondary node corresponding to the main node, and the main node and the secondary node respectively send the message to be broadcasted to a next-level node of the main node;
and taking the next-level node as a main node, repeatedly executing the steps of sending the message to be broadcasted to a secondary node corresponding to the main node, and respectively sending the message to be broadcasted to the next-level node of the main node by the main node and the secondary node until the message to be broadcasted is sent to the node at the lowest level.
In this embodiment, the primary node in the first hierarchy may receive the message and transmit the message to the secondary node corresponding to the first hierarchy. The primary node of the first hierarchy then transmits the message to all of the next level nodes, while the secondary node of the first hierarchy also transmits the received message to all of the next level nodes. Each next level node is taken as a main node of a node group to which the level belongs, recursion is carried out level by level until the lowest layer, all nodes in a federation chain synchronously complete block messages in a quick and ordered way through a network propagation structure, the main node periodically keeps state synchronization with other node messages, and each node maintains complete block messages.
In an optional manner of this embodiment, before the step of using the next-level node as the master node, repeatedly performing the step of sending the message to be broadcasted to the secondary node corresponding to the master node, and sending the message to be broadcasted to the next-level node of the master node by the master node and the secondary node, the method further includes:
and determining that the messages to be broadcasted, which are sent by the main node and received by the next-level node, are consistent with the messages to be broadcasted, which are sent by the secondary node of the main node.
In the embodiment of the application, each next-level node can compare the consistency of the message received from the main node with the message received from the auxiliary node, and forward the message after confirming the consistency so as to ensure the accurate transmission of the message.
As a specific example of determining the communication network structure of the alliance chain, the alliance chain network initially designates a node as a first-level leader node (i.e., designated node), all other nodes register with the first-level leader node, after the registration is completed, the first-level leader performs network test on all node members, dynamically optimizes a network propagation structure among the nodes according to the network conditions of the nodes, and realizes the step-by-step propagation synchronization of messages according to network levels.
(1) The node 1 is initially designated as a leader node of one level in the federation chain, and all other peer nodes (i.e. the first node) transmit their own certificates and corresponding IP address information to the leader node: { certificate information of peer node 1, 10.10.10.6, 8080}, and the certificate information of the year node 20, 10.10.10.6, 222,8080}, and the first-level peer node stores the received configuration information of all peer nodes in a database to complete registration, at which time the peer establishes a network communication relationship with all peer nodes.
(2) The first-level leader node 1 generates a network connection state table A by performing network test on all members and transmits the network connection state table A to all nodes, elements in the matrix are test results deduced by taking the network speed as a network test measurement index, the unit is MB/S, the network condition is better when the numerical value is larger, and the method is specifically shown in the matrix A1:
matrix A1:
Figure BDA0002794424770000141
(3) The test results are sorted from big to small, and the leader node 1 at the first level selects 3 nodes with the best network test results as commimitee, which is specifically shown in table 1:
TABLE 1
A a,b For the wire speed from node a to node b A 1,11 A 1,6 A 1,18
Inter-node network speed (MB/S) 9.87 8.12 7.54
Therefore, the first-level leader node 1 selects the second-level commit, which is the node 11, the node 6, and the node 18, respectively, and the node relationships thereof are as shown in fig. 2.
(4) After the second-level commit is selected successfully, the node 6, the node 18, the node 11 and the node 1 reselect the first-level leader, and the node with the best network test result, that is, the node 11 with the maximum network speed accumulated with the network speeds of other nodes is selected as a new first-level leader through testing the node information, and at this time, the node relationship is shown in fig. 3.
(5) The leader node 11 at the first level performs network test on all members, and the network test result is shown as a matrix A2:
the matrix A2:
Figure BDA0002794424770000151
(6) The first-level leader node 11 designates the node 12 with the best network test result as a first-level service node (i.e. a corresponding secondary node) according to the network test result, updates the network communication state table a and transmits the updated network communication state table a to all nodes.
(7) According to the network communication status, the first-level leader node 11 selects another 3 nodes with the best network test results except the first-level service as second-level commimitee, which is specifically shown in table 2:
TABLE 2
Aa, b are the network speeds from node a to node b A11,6 A11,18 A11,1
Inter-node network speed (MB/S) 11.80 8.12 7.54
After the second-level commit is selected, the second-level commit respectively designates the service to which the second-level commit belongs according to the network communication status, and the corresponding relationship is specifically shown in table 3:
TABLE 3
Committee vice
Node
6 Node 3
Node 18 Node 16
Node 1 Node 2
(8) The first-level leader node 11 divides three partitions (i.e., node groups) for the second-level commit according to the test result, and the relationship of each node is shown in fig. 4.
(9) And the secondary committee performs network test on the respective affiliated areas, and the network test result is shown as a matrix A3:
matrix A3:
Figure BDA0002794424770000161
(10) According to the network test result, a three-level one-area commit (node 17, node 4, node 19), a three-level two-area commit (node 7, node 13, node 14), and a three-level three-area commit (node 5, node 15, node 20) are selected, and finally, a network propagation structure diagram 5 among the nodes is formed.
Fig. 6 is a flowchart illustrating a specific example of message synchronization performed based on the communication network structure of the federation chain provided in the embodiment of the present application. The method comprises the following specific steps:
(1) A leader node 1 (i.e., a master node) at a first level receives and updates a message, the node sends the updated message to a service node 12 (i.e., a slave node) at a same level, the node 1 and the service node 12 respectively send messages to a commit node (i.e., a next level node) at a second level, and the commit node at the second level includes: node 6, node 18, node 11;
(2) And the second-level commit node receives the messages sent by the first-level leader and the service, compares the received messages with each other, and updates the received messages:
(1) and sending to the affiliated peer service:
1) The second level commit node 6 updates the received message and synchronizes the message to the second level service node 3;
2) The secondary commit node 18 updates the received messages and synchronizes the messages to the secondary service node 16
3) The second-level commit node 11 updates the received message and synchronizes the message to the second-level service node 2;
(2) simultaneously sending the data to the third-level committee which the data belongs to;
1) The secondary commit node 6 sends the message to the tertiary commit: node 17, node 4, node 19;
2) The secondary commit node 18 sends the message to the tertiary commit: node 7, node 13, node 14;
3) The secondary commit node 11 sends the message to the tertiary commit: node 20, node 5, node 15;
(3) and after the second-level service updates the received message, sending the message to the third-level committee which the service belongs to:
1) The secondary vision node 3 updates the received message and sends the message to the node 17, the node 4 and the node 19;
2) The secondary service node 16 updates the received message and sends the message to the node 7, the node 13 and the node 14;
3) The secondary service node 2 updates the received message and sends the message to the node 20, the node 5 and the node 15;
(3) After the third-level commit node receives the messages of the upper-level commit node and the service node, the received messages are compared to be consistent, the received messages are updated and transmitted to the next-level node:
(1) the node 17 updates the received message and sends the message to the node 10;
(2) the node 4 updates the received message;
(3) node 19 updates the received message;
(4) the node 7 updates the received message and sends the message to the node 9;
(5) the node 13 updates the received message;
(6) the node 14 updates the received message;
(7) the node 20 updates the received message and sends the message to the node 8;
(8) the node 5 updates the received message;
(9) the node 15 updates the received message;
(4) After the four-level node receives the message of the committee node of the upper level, the received message is updated:
(1) the node 10 updates the received message;
(2) the node 9 updates the received message;
(3) the node 8 updates the received message;
(5) And after all the nodes synchronously update the messages, the messages are synchronously updated.
As an example, the processing flow when the master node fails is specifically as follows:
a schematic diagram of the communication network structure of the federation chain in this example is shown in fig. 7.
(1) As shown in fig. 7, the primary service node 12 is notified by most of the secondary committee nodes: and the heartbeat information sent by the first-level leader node is not received, so that the first-level service node 12 initiates a leader election for switching, the first-level service node 12 conducts network test on all second-level commit nodes again, and the member with the best network test result is selected as a first-level new leader node.
(1) When the first-level leader node 11 fails to cause the failure of the first-level leader, the first-level service node 12 initiates a leader switching election;
(2) the first-level place node 12 carries out network test on all the committee nodes (node 6, node 18 and node 1) in the second level, network test results are sequenced from large to small, the member node 18 with the best network test result is selected as a first-level new leader node, and the network test result is shown in table 4;
TABLE 4
A 12,6 A 12,18 A 12,1
Inter-node network speed (MB/S) 8.70 9.76 8.93
Fig. 8 shows a schematic diagram of a communication network structure of the federation chain at this time.
(2) As shown in fig. 8, since the second-level second-region commit node 18 is selected as the first-level leader node, the second-level second-region service node 16 initiates leader switch election, and the node 16 performs network test on all committees in the third-level second-region to select the second-level second-region leader node.
(1) Because the second-level second-region commit node 18 is selected as the first-level leader node, the second-level second-region leader is lost, and the second-level service receives the notification of most third-level second-region commit nodes: the heartbeat information sent by the secondary leader node is not received, so the secondary second-region service node 16 initiates a second-region leader switching election;
(2) the second-level second-zone node 16 performs network test on all committees in the third-level second zone, and selects the node 13 with the best network test result as a second-level second-zone leader node, where fig. 9 shows a schematic diagram of a communication network structure of a alliance chain at this time, and the network test result is shown in table 5 at this time;
TABLE 5
A16,7 A16,13 A16,14
Inter-node network speed (MB/S) 9.22 9.87 9.65
Finally, the network connectivity status table a and the member attribution table may be updated.
Based on the same principle as the method shown in fig. 1, fig. 10 is a schematic structural diagram of a determining apparatus of a communication network structure of a federation chain according to an embodiment of the present application, and as shown in fig. 10, the determining apparatus 20 of the communication network structure of the federation chain may include:
a first committee node determining module 210, configured to determine, according to a network connection situation between a designated node in the federation chain and a first node in the federation chain, a designated number of first committee nodes from the first node, where the first node is all nodes except the designated node in the federation chain;
a master node determining module 220, configured to determine a master node from election nodes according to network connection conditions among the election nodes, where the election nodes include a designated node and a first committee node;
the node dividing module 230 is configured to determine, according to a network connection condition between a second node and a master node, a secondary node corresponding to the master node and a next-level node of the master node from the second node, and divide all nodes except the master node, the secondary node corresponding to the master node, and the next-level node of the master node in the federation chain into node groups corresponding to the next-level nodes of the master nodes, respectively, where the second node is all nodes except the master node in the federation chain;
and a repeated execution module 240, configured to use a next-level node of the master node as a master node, use a node in the node group as a second node, and repeatedly execute the step of determining, from the second node, a secondary node corresponding to the master node and a next-level node of the master node according to a network connection condition between the second node and the master node, and dividing all nodes except the master node, the secondary node corresponding to the master node, and the next-level node of the master node in the federation chain into node groups corresponding to the next-level nodes of the master nodes, respectively, until it is determined that the sum of the numbers of the secondary nodes corresponding to the master node and the next-level nodes of the master node is not greater than a specified number.
According to the device provided by the embodiment of the application, the first committee nodes with the specified number are determined from the first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain; determining a main node from the election nodes according to the network connection condition among the election nodes; determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node; dividing the nodes in the alliance chain into node groups corresponding to the nodes at the next level respectively; and taking each next-level node as a main node of the node group, taking the nodes in the node group as second nodes, and repeatedly executing the step of determining the auxiliary nodes and the next-level nodes of the main node until the lowest-level node is determined. The scheme can optimize the communication network structure in the alliance chain, and provides a basis for level-by-level message propagation, ordered synchronous message propagation and reduction of network overhead during message synchronization.
Optionally, the first committee node determination module is specifically configured to:
sequencing the first nodes in the alliance chain based on the sequence of the network connection conditions with the designated nodes in the alliance chain from good to bad;
a first committee node is determined for a prescribed number of first nodes that are top in the ranking.
Optionally, the network connection condition includes a network connectivity index, and the master node determining module is specifically configured to, when determining the master node from the election nodes according to the network connection condition between the election nodes:
summing network communication indexes between any election node in the election nodes and election nodes except any election node;
and determining any elected node with the highest corresponding summation result as the master node.
Optionally, the node dividing module is specifically configured to, when determining the secondary node corresponding to the primary node and the next-stage node of the primary node from the second node according to a network connection condition between the second node and the primary node:
sequencing the second nodes according to the sequence of the network connection conditions with the main nodes from good to bad;
determining a second committee node from the second nodes with the appointed number at the top in the sequence;
and determining the node with the best network connection condition with the main node in the second committee nodes as a secondary node corresponding to the main node, and determining the nodes except the secondary node in the second committee nodes as the next-level node of the main node.
Optionally, the apparatus further comprises: the failure node processing module is used for:
when any node in the levels except the lowest level is detected to be failed, determining an additional node with the best network connection condition with the corresponding node of the failed any node in the nodes at the lower level of the failed any node as any node;
and taking the supplementary node as any failed node, and repeatedly executing the step of determining the supplementary node with the best network connection condition with the corresponding node of any failed node in the next-level node of any failed node as any node until the next-level node of any failed main node cannot be found.
Optionally, the apparatus further comprises: the newly added node processing module is used for:
when detecting a newly added node to be added into the alliance chain, determining a node with the best network connection condition with the newly added node in the next level node of the main node as a target node;
and taking the target node as a master node, and repeatedly executing the step of determining the node with the best network connection condition with the newly added node in the next-level nodes of the master node as the target node until the target node cannot be found, and determining the newly added node as the next-level node of the target node at the lowest level.
Optionally, the apparatus further comprises: a message synchronization module to:
when the main node receives the message to be broadcasted, the message to be broadcasted is sent to a secondary node corresponding to the main node, and the main node and the secondary node respectively send the message to be broadcasted to a next-level node of the main node;
and taking the next-level node as a main node, repeatedly executing the steps of sending the message to be broadcasted to a secondary node corresponding to the main node, and respectively sending the message to be broadcasted to the next-level node of the main node by the main node and the secondary node until the message to be broadcasted is sent to the node at the lowest level.
Optionally, the message synchronization module is further configured to:
before the next-level node is used as a main node, and the step of sending the message to be broadcasted to a secondary node corresponding to the main node is repeatedly executed, and the main node and the secondary node respectively send the message to be broadcasted to the next-level node of the main node, the message to be broadcasted, which is sent by the main node and sent by the secondary node of the main node, received by the next-level node is determined to be consistent.
It is to be understood that the above modules of the determining apparatus of a communication network structure of a federation chain in the present embodiment have functions of implementing corresponding steps of the determining method of a communication network structure of a federation chain in the embodiment shown in fig. 1. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the apparatus for determining a communication network structure of a federation chain, reference may be specifically made to the corresponding description of the method for determining a communication network structure of a federation chain in the embodiment shown in fig. 1, and details are not described here again.
The embodiment of the application provides an electronic device, which comprises a processor and a memory;
a memory for storing operating instructions;
the processor is configured to execute the method for determining a communication network structure of a federation chain provided in any embodiment of the present application by calling the operation instruction.
As an example, fig. 11 shows a schematic structural diagram of an electronic device to which an embodiment of the present application is applicable, and as shown in fig. 11, the electronic device 2000 includes: a processor 2001 and a memory 2003. Wherein the processor 2001 is coupled to the memory 2003, such as via bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that the transceiver 2004 is not limited to one in practical applications, and the structure of the electronic device 2000 is not limited to the embodiment of the present application.
The processor 2001 is applied to the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 2004 may include a receiver and a transmitter, and the transceiver 2004 is applied to the embodiments of the present application to implement the functions of the electronic device of the embodiments of the present application to communicate with other devices when executed.
The Processor 2001 may be a CPU (Central Processing Unit), general Processor, DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 2001 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
Bus 2002 may include a path that conveys information between the aforementioned components. The bus 2002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 2002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 11, but that does not indicate only one bus or one type of bus.
The Memory 2003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
Optionally, the memory 2003 is used for storing application program code for performing the disclosed aspects, and is controlled in execution by the processor 2001. The processor 2001 is configured to execute the application program code stored in the memory 2003 to implement the method for determining the communication network structure of the federation chain provided in any of the embodiments of the present application.
The electronic device provided by the embodiment of the application is applicable to any embodiment of the method, and is not described herein again.
Compared with the prior art, the electronic equipment provided by the embodiment of the application determines the first committee nodes with the specified number from the first nodes according to the network connection condition of the specified nodes in the alliance chain and the first nodes in the alliance chain; determining a main node from the election nodes according to the network connection condition among the election nodes; determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node; dividing the nodes in the alliance chain into node groups corresponding to the nodes at the next level respectively; and taking each next-level node as a main node of the node group, taking the nodes in the node group as second nodes, and repeatedly executing the step of determining the auxiliary nodes and the next-level nodes of the main nodes until the lowest-level node is determined. The scheme can optimize the communication network structure in the alliance chain, and provides a basis for progressive and orderly synchronous transmission of the messages according to the levels and reduction of network overhead during message synchronization.
The present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method for determining a communication network structure of a federation chain shown in the foregoing method embodiment.
The computer-readable storage medium provided in the embodiments of the present application is applicable to any of the embodiments of the foregoing method, and is not described herein again.
Compared with the prior art, the embodiment of the application provides a computer-readable storage medium, wherein a specified number of first committee nodes are determined from first nodes according to the network connection condition of the specified nodes in a alliance chain and the first nodes in the alliance chain; determining a main node from the election nodes according to the network connection condition among the election nodes; determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node; dividing the nodes in the alliance chain into node groups corresponding to the nodes at the next level respectively; and taking each next-level node as a main node of the node group, taking the nodes in the node group as second nodes, and repeatedly executing the step of determining the auxiliary nodes and the next-level nodes of the main node until the lowest-level node is determined. The scheme can optimize the communication network structure in the alliance chain, and provides a basis for level-by-level message propagation, ordered synchronous message propagation and reduction of network overhead during message synchronization.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (9)

1. A method for determining a communication network structure of a federation chain, comprising:
determining a specified number of first committee nodes from first nodes in a alliance chain according to network connection conditions of the specified nodes and the first nodes in the alliance chain, wherein the first nodes are all nodes except the specified nodes in the alliance chain;
determining a main node from the election nodes according to the network connection condition among the election nodes, wherein the election nodes comprise the designated node and the first committee node;
determining a secondary node corresponding to the main node and a next-level node of the main node from the second node according to the network connection condition between the second node and the main node, and dividing all nodes except the main node, the secondary node corresponding to the main node and the next-level node of the main node in the alliance chain into node groups corresponding to the next-level nodes of the main nodes respectively, wherein the second node is all nodes except the main node in the alliance chain;
taking a next-level node of the master node as the master node, taking a node in the node group as the second node, repeatedly executing the steps of determining a secondary node corresponding to the master node and the next-level node of the master node from the second node according to the network connection condition between the second node and the master node, and dividing all nodes except the master node, the secondary node corresponding to the master node and the next-level node of the master node in the alliance chain into node groups corresponding to the next-level nodes of the master nodes respectively until the sum of the numbers of the secondary nodes corresponding to the master node and the next-level nodes of the master node is determined to be not more than the designated number;
further comprising:
when the main node receives a message to be broadcasted, the message to be broadcasted is sent to a secondary node corresponding to the main node, and the main node and the secondary node respectively send the message to be broadcasted to a next-level node of the main node;
taking the next-level node as the main node, and repeatedly executing the steps of sending the message to be broadcasted to the secondary node corresponding to the main node and sending the message to be broadcasted to the next-level node of the main node by the main node and the secondary node respectively until the message to be broadcasted is sent to the node at the lowest level;
before the step of taking the next-level node as the master node, and repeatedly executing the step of sending the message to be broadcasted to the secondary node corresponding to the master node, and sending the message to be broadcasted to the next-level node of the master node by the master node and the secondary node, respectively, the method further includes:
and determining that the messages to be broadcasted, which are sent by the main node and are received by the next-level node, are consistent with the messages to be broadcasted, which are sent by the secondary node of the main node.
2. The method of claim 1, wherein determining a specified number of first committee nodes from a first node in a federation chain based on network connectivity of the specified node to the first node in the federation chain comprises:
the method comprises the steps that a first node in a alliance chain is sequenced from good to bad based on the network connection condition of a designated node in the alliance chain;
a first committee node is determined for a prescribed number of first nodes that are top in the ranking.
3. The method of claim 1, wherein the network connectivity metrics comprise network connectivity metrics, and wherein determining the master node from the elected nodes based on the network connectivity metrics between the elected nodes comprises:
summing network connectivity indexes between any election node in the election nodes and the election nodes except the any election node;
and determining any election node with the highest corresponding summation result as the master node.
4. The method of claim 1, wherein the determining, from the second nodes, a secondary node corresponding to the primary node and a node next to the primary node according to the network connection between the second nodes and the primary node comprises:
the second nodes are sorted according to the sequence of the network connection conditions with the main nodes from good to bad;
determining a second committee node for the designated number of second nodes that are first in the ranking;
and determining a node with the best network connection condition with the main node in the second committee nodes as a secondary node corresponding to the main node, and determining nodes except the secondary node in the second committee nodes as nodes at the next stage of the main node.
5. The method of claim 1, further comprising:
when detecting that any node in the levels except the lowest level fails, determining an additional node with the best network connection condition with the corresponding node of the failed any node in the nodes at the next level of the failed any node as the any node;
and taking the supplementary node as the failed any node, and repeatedly executing the step of determining the supplementary node with the best network connection condition with the corresponding node of the failed any node in the next-stage node of the failed any node as the any node until the next-stage node of the failed any main node cannot be found.
6. The method of claim 5, further comprising:
when detecting a newly added node to be added into the alliance chain, determining a node with the best network connection condition with the newly added node in the next-stage node of the main node as a target node;
and taking the target node as the master node, and repeatedly executing the step of determining the node with the best network connection condition with the newly added node in the next-level nodes of the master node as the target node until the target node cannot be found, and determining the newly added node as the next-level node of the next-level target node.
7. An apparatus for determining a communication network structure of a federation chain, comprising:
the first committee node determining module is used for determining a specified number of first committee nodes from first nodes according to network connection conditions of the specified nodes in a alliance chain and the first nodes in the alliance chain, wherein the first nodes are all nodes except the specified nodes in the alliance chain;
the master node determining module is used for determining a master node from the election nodes according to the network connection condition among the election nodes, wherein the election nodes comprise the designated node and the first committee node;
a node dividing module, configured to determine, according to a network connection condition between a second node and the master node, a secondary node corresponding to the master node and a next-level node of the master node from the second node, and divide all nodes, except the master node, the secondary node corresponding to the master node, and the next-level node of the master node, in the federation chain into node groups corresponding to the next-level nodes of the master nodes, respectively, where the second node is all nodes, except the master node, in the federation chain;
a repeated execution module, configured to use a next-level node of the master node as the master node, use a node in the node group as the second node, repeatedly execute the step of determining, from the second node, a secondary node corresponding to the master node and a next-level node of the master node according to a network connection condition between the second node and the master node, and respectively divide all nodes except the master node, the secondary node corresponding to the master node, and the next-level node of the master node in the federation chain into node groups corresponding to the next-level nodes of the master nodes, until the sum of the numbers of the secondary nodes corresponding to the master node and the next-level nodes of the master node is determined to be not greater than a specified number;
further comprising:
when the main node receives a message to be broadcasted, the message to be broadcasted is sent to a secondary node corresponding to the main node, and the main node and the secondary node respectively send the message to be broadcasted to a next-level node of the main node;
taking the next-level node as the main node, and repeatedly executing the steps of sending the message to be broadcasted to the secondary node corresponding to the main node and sending the message to be broadcasted to the next-level node of the main node by the main node and the secondary node respectively until the message to be broadcasted is sent to the node at the lowest level;
before the step of taking the next-level node as the master node, and repeatedly executing the step of sending the message to be broadcasted to the secondary node corresponding to the master node, and sending the message to be broadcasted to the next-level node of the master node by the master node and the secondary node, respectively, the method further includes:
and determining that the messages to be broadcasted, which are received by the next-level node and sent by the main node and the secondary node of the main node, are consistent.
8. An electronic device comprising a processor and a memory;
the memory is used for storing operation instructions;
the processor is used for executing the method of any one of claims 1-6 by calling the operation instruction.
9. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method of any one of claims 1-6.
CN202011326370.6A 2020-11-24 2020-11-24 Method and device for determining communication network structure of alliance chain and electronic equipment Active CN112532438B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011326370.6A CN112532438B (en) 2020-11-24 2020-11-24 Method and device for determining communication network structure of alliance chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011326370.6A CN112532438B (en) 2020-11-24 2020-11-24 Method and device for determining communication network structure of alliance chain and electronic equipment

Publications (2)

Publication Number Publication Date
CN112532438A CN112532438A (en) 2021-03-19
CN112532438B true CN112532438B (en) 2022-10-25

Family

ID=74993078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011326370.6A Active CN112532438B (en) 2020-11-24 2020-11-24 Method and device for determining communication network structure of alliance chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN112532438B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109039847A (en) * 2018-08-07 2018-12-18 广州三牛信息科技有限公司 A kind of method and device solving block chain the whole network message consistency problem using DMT
CN109327459A (en) * 2018-11-12 2019-02-12 崔晓晖 A kind of common recognition method of alliance's block chain network
CN109510876A (en) * 2018-12-20 2019-03-22 弗洛格(武汉)信息科技有限公司 A kind of alliance's chain sharding method and corresponding alliance's chain based on PBFT

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252500B (en) * 2008-04-16 2012-08-08 杭州华三通信技术有限公司 Intersect looped network, node and realizing method of random topology intersect looped network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109039847A (en) * 2018-08-07 2018-12-18 广州三牛信息科技有限公司 A kind of method and device solving block chain the whole network message consistency problem using DMT
CN109327459A (en) * 2018-11-12 2019-02-12 崔晓晖 A kind of common recognition method of alliance's block chain network
CN109510876A (en) * 2018-12-20 2019-03-22 弗洛格(武汉)信息科技有限公司 A kind of alliance's chain sharding method and corresponding alliance's chain based on PBFT

Also Published As

Publication number Publication date
CN112532438A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN109451540B (en) Resource allocation method and equipment for network slices
EP2530613A2 (en) Method of distributing files, file distribution system, master server, computer readable, non-transitory medium storing program for distributing files, method of distributing data, and data distribution system
JPH11510348A (en) Route search in communication networks
US20070204046A1 (en) Methods and apparatus for balanced load distribution in wireless switch architecture
CN109150712B (en) Networking method and system for power line carrier and wireless converged communication
CN110557416A (en) multi-node collaborative blocking method and system
CN112532438B (en) Method and device for determining communication network structure of alliance chain and electronic equipment
US20070097951A1 (en) Routing Internet communications using network coordinates
CN112866025B (en) Intelligent contract fragmentation processing method
CN113691464A (en) Satellite-ground cooperative network resource allocation method based on synchronous resource balance optimization
CN109873713B (en) Decentralized service cluster system for location service and fault detection method
CN107104829B (en) Physical equipment matching distribution method and device based on network topology data
CN108495318B (en) Multi-cell PCI intelligent planning method based on MR data
CN112866833A (en) Service recovery method and device, electronic equipment and storage medium
Toda et al. Autonomous and distributed construction of locality aware skip graph
CN116980281A (en) Node selection method, node selection device, first node, storage medium and program product
CN115766742A (en) Block chain consensus method, system, device and computer readable storage medium
US9910752B2 (en) Reliable map-reduce communications in a decentralized, self-organizing communication orbit of a distributed network
CN114422526A (en) Block synchronization method and device, electronic equipment and storage medium
CN109327520B (en) Method and device for establishing connection between terminal and server node
CN111130846B (en) Target object determination method and device and storage medium
CN112367189A (en) Distributed node management method, device and storage medium
CN112256437A (en) Task distribution method and device
CN111556149B (en) Node selection method and device based on Raft consensus algorithm
CN113923166B (en) Load balancing method and distributed cluster system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant