Method for balancing cross-domain broadcast network load of blockchain, computer device, and non-transitory computer-readable storage medium
AssigneeHangzhou Qulian Technology Co., Ltd.
InventorsWei Li, Weiwei Qiu, Maifang Hu, Fanglei Huang, Shuai Zhang
Life of this patent
Estimating the term…
Abstract
A method for balancing a cross-domain broadcast network load of a blockchain includes is provided. By evenly distributing the load of cross-domain broadcasting to multiple cross-domain nodes, a utilization rate of a blockchain system can be increased, and ability of processing transactions in the blockchain can be improved. A computer device and a non-transitory computer-readable storage medium are further provided.
Claims15
A method for balancing a cross-domain broadcast network load of a blockchain, comprising:
- receiving information of network domains where all hosts in the blockchain are located, and generating a first network topology involved in cross-domain forwarding according to the information of the network domains, wherein nodes in the first network topology are the hosts in the blockchain, and a connection line between two of the nodes indicates that two corresponding ones of the hosts exist in the same network domain;
- serving one of the hosts sending a broadcast message as a master node, splitting each of the nodes in the first network topology except the master node into an ingress node of a corresponding node and an egress node of the corresponding node, and connecting a connection line from the ingress node of the corresponding node to the egress node of the corresponding node;
- splitting a connection line between two of the nodes in the first network topology into two directed connection lines, wherein each direction is from the egress node of one of the two of the nodes to the ingress node of the other of the two of the nodes, and capacity is N−1;
- when a connection line exists between the master node in the first network and one of other nodes, the connection line is transformed into a connection line with capacity N−1 from the master node to the ingress node of the one of the other nodes;
- and adding a virtual node, and adding a connection line with capacity 1 between the egress node of each of the nodes to the virtual node to form a second network topology;
- performing, according to capacity C of a connection between two corresponding ones of the nodes, augmenting path searches with capacity 1 for N−1 times from the master node to the virtual node in the second network topology to obtain a search path, wherein N is a number of the nodes in the first network topology;
- and the virtual node in the search path is removed, and the ingress node of the corresponding node and the egress node of the corresponding node are merged to obtain a routing path of the broadcast message from the master node to a target node;
- and
- sending, when the master node needs to send a message to the target node located in another domain, the message to the target node according to the routing path for processing.
A computer device, including a memory and a processor, the memory storing computer programs, wherein the processor is configured to execute the computer programs to implement:
- receiving information of network domains where all hosts in the blockchain are located, and generating a first network topology involved in cross-domain forwarding according to the information of the network domains, wherein nodes in the first network topology are the hosts in the blockchain, and a connection line between two of the nodes indicates that two corresponding ones of the hosts exist in the same network domain;
- serving one of the hosts sending a broadcast message as a master node, splitting each of the nodes in the first network topology except the master node into an ingress node of a corresponding node and an egress node of the corresponding node, and connecting a connection line from the ingress node of the corresponding node to the egress node of the corresponding node;
- splitting a connection line between two of the nodes in the first network topology into two directed connection lines, wherein each direction is from the egress node of one of the two of the nodes to the ingress node of the other of the two of the nodes, and capacity is N−1;
- when a connection line exists between the master node in the first network and one of other nodes, the connection line is transformed into a connection line with capacity N−1 from the master node to the ingress node of the one of the other nodes;
- and adding a virtual node, and adding a connection line with capacity 1 between the egress node of each of the nodes to the virtual node to form a second network topology;
- performing, according to capacity C of a connection between two corresponding ones of the nodes, augmenting path searches with capacity 1 for N−1 times from the master node to the virtual node in the second network topology to obtain a search path, wherein N is a number of the nodes in the first network topology;
- and the virtual node in the search path is removed, and the ingress node of the corresponding node and the egress node of the corresponding node are merged to obtain a routing path of the broadcast message from the master node to a target node;
- and
- sending, when the master node needs to send a message to the target node located in another domain, the message to the target node according to the routing path for processing.
A non-transitory computer-readable storage medium, including computer programs stored thereon, wherein the computer programs are executed by a processor to implement:
- receiving information of network domains where all hosts in the blockchain are located, and generating a first network topology involved in cross-domain forwarding according to the information of the network domains, wherein nodes in the first network topology are the hosts in the blockchain, and a connection line between two of the nodes indicates that two corresponding ones of the hosts exist in the same network domain;
- serving one of the hosts sending a broadcast message as a master node, splitting each of the nodes in the first network topology except the master node into an ingress node of a corresponding node and an egress node of the corresponding node, and connecting a connection line from the ingress node of the corresponding node to the egress node of the corresponding node;
- splitting a connection line between two of the nodes in the first network topology into two directed connection lines, wherein each direction is from the egress node of one of the two of the nodes to the ingress node of the other of the two of the nodes, and capacity is N−1;
- when a connection line exists between the master node in the first network and one of other nodes, the connection line is transformed into a connection line with capacity N−1 from the master node to the ingress node of the one of the other nodes;
- and adding a virtual node, and adding a connection line with capacity 1 between the egress node of each of the nodes to the virtual node to form a second network topology;
- performing, according to capacity C of a connection between two corresponding ones of the nodes, augmenting path searches with capacity 1 for N−1 times from the master node to the virtual node in the second network topology to obtain a search path, wherein N is a number of the nodes in the first network topology;
- and the virtual node in the search path is removed, and the ingress node of the corresponding node and the egress node of the corresponding node are merged to obtain a routing path of the broadcast message from the master node to a target node;
- and
- sending, when the master node needs to send a message to the target node located in another domain, the message to the target node according to the routing path for processing.
Dependencies are inferred from the claim text.