CN115296824B - Hierarchical transmission method of block chain network based on multi-scale node management and storage medium - Google Patents

Hierarchical transmission method of block chain network based on multi-scale node management and storage medium Download PDF

Info

Publication number
CN115296824B
CN115296824B CN202211219789.0A CN202211219789A CN115296824B CN 115296824 B CN115296824 B CN 115296824B CN 202211219789 A CN202211219789 A CN 202211219789A CN 115296824 B CN115296824 B CN 115296824B
Authority
CN
China
Prior art keywords
node
scale
data
nodes
interval
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
CN202211219789.0A
Other languages
Chinese (zh)
Other versions
CN115296824A (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.)
Anhui Zhongke Lattice Technology Co ltd
Anhui Zhongkezhilian Information Technology Co ltd
Hefei Institutes of Physical Science of CAS
Original Assignee
Anhui Zhongke Lattice Technology Co ltd
Anhui Zhongkezhilian Information Technology Co ltd
Hefei Institutes of Physical Science of CAS
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 Anhui Zhongke Lattice Technology Co ltd, Anhui Zhongkezhilian Information Technology Co ltd, Hefei Institutes of Physical Science of CAS filed Critical Anhui Zhongke Lattice Technology Co ltd
Priority to CN202211219789.0A priority Critical patent/CN115296824B/en
Publication of CN115296824A publication Critical patent/CN115296824A/en
Application granted granted Critical
Publication of CN115296824B publication Critical patent/CN115296824B/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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general

Landscapes

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

Abstract

The invention relates to a block chain network hierarchical transmission method based on multi-scale node management and a storage medium. And updating the adjacent nodes in each interval through the network transmission speed among the nodes, namely, replacing the old nodes with the nodes with higher transmission speed as the adjacent nodes of the nodes, and keeping the highest data transmission speed between the nodes and the adjacent nodes all the time. Based on the multi-scale node management model, when the transmission levels are different, the data sending node forwards the data to the adjacent node under the corresponding scale level; the invention reduces the transmission level, reduces the transmission delay, improves the network utilization rate and improves the maximum throughput.

Description

Block chain network hierarchical transmission method based on multi-scale node management and storage medium
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain network hierarchical transmission method based on multi-scale node management and a storage medium.
Background
Due to the characteristics of decentralization, tamper resistance, traceability and the like, the block chain technology is applied to information systems in some industry fields and is integrated with information technologies such as the internet of things, big data, artificial intelligence and the like, the problems in the aspects of social credit, cost, efficiency and the like can be solved, the authenticity and credibility of data are guaranteed, the application value of the information systems is improved, and the block chain technology has a huge application prospect in various industry fields. However, the development and application of the blockchain technology are in a key stage of coexistence of challenges and opportunities, and some challenges are faced in aspects of data pressure of node storage blocks, transmission time of data in a blockchain network, consensus efficiency and the like; in a block chain system, all nodes are constructed into a P2P network, and the stability and performance of the operation of a block chain are directly affected by the network transmission efficiency, transmission reliability, security, network utilization rate and other factors between nodes. With the increasing application demand and the increasing transaction amount, a faster and more efficient network transmission method is required between nodes in the block chain P2P network.
In a bitcoin block chain, a node transmits a new block to its neighbor node in three ways: the BIP130 mode broadcasts only the complete block header data; the BIP152 high bandwidth mode uses compact block protocol to transmit full block data immediately; the INV mechanism only broadcasts the block hash, the node firstly sends INV information to the adjacent node and then only sends complete data to the adjacent node responding to GETDATA information, thus improving the transmission efficiency of the complete data, but increasing the times of network transmission; in an ether bay, when a miner constructs a new block, the miner sends two different types of messages to its neighbors: newblockackmsg (containing complete block data) and newblockackhashmsg (containing only block hashes), similar to bitcoin blockchains, the number of network transmissions of the second message type of etherhouse will also increase.
The following problems exist with respect to the block chain technique currently:
1) The efficiency of the blockchain network transmission is not high. Data is sent from one node and transmitted to each node in the whole P2P network, and needs to be forwarded for multiple times, so that the time length of data transmission to the whole network is increased, certain network delay exists in data transmission, and the network transmission efficiency is not high.
2) The utilization of the blockchain network is low. After each node in the P2P network receives data, the data is forwarded to other nodes, and each node may receive the same data sent by different nodes for multiple times, so that redundant data transmission causes waste of network resources and low network utilization rate.
3) The performance of the blockchain network becomes one of the important factors affecting the blockchain throughput. In a P2P network of a block chain system, there are many general nodes and the nodes are distributed in various places around the world; in addition, the network state of each node is uncontrollable, the network bandwidth of the node cannot be required, even the node cannot be required to be in a stable network, the node can be offline at any time, and a new node can be added at any time. Therefore, the rate of the synchronization data added by the new node is low, and much time is consumed for acquiring the own neighbor node.
Disclosure of Invention
The invention provides a hierarchical transmission method and a storage medium for a block chain network based on multi-scale node management, which can at least solve one of the technical problems.
In order to achieve the purpose, the invention adopts the following technical scheme:
a hierarchical transmission method of block chain network based on multi-scale node management comprises the following steps,
s1, setting Scale division strength n according to the Scale of the whole block chain network, namely, dividing nodes in the network into n intervals when the Scale level Scale-level = 1; when the number of the nodes contained in each interval is less than or equal to the dividing strength n, the new scale is not continuously divided;
s2, initializing a neighbor node list; when a new node is added into the network, judging the interval where the node is positioned when the Scale level Scale-level =1 according to the ID value of the new node, and randomly selecting a node from brother intervals of the interval to be added into a neighbor node list of the new node; repeating the method, selecting corresponding nodes under other scales, and adding the nodes into an adjacent node list; the brother intervals of the nodes are all sub-intervals of the interval of the previous scale of the interval to which the nodes belong;
s3, data sending;
and S4, receiving and forwarding the data.
Further, the step S1 includes the following steps of scale division:
(1) Arranging all nodes in the network from small to large according to the ID values, and determining the division strength n;
(2) Setting a Scale level Scale-level =1, and equally dividing a node set in the network into n intervals according to the division strength, namely an interval 11, an interval 12 \8230, an interval 8230, an interval 1n;
(3) When the number of the nodes contained in each interval is less than or equal to the dividing strength n, the new scale is not continuously divided; at this time, scale-level = k, n at Scale level k-1 is set k-1 The intervals are respectively divided into n intervals; if the number of the ID bits of the nodes is m, the maximum value of the system scale is calculated to be
Figure 515401DEST_PATH_IMAGE001
Further, the initializing the neighbor node list in step S2 includes the following steps,
the local nodes have unique belonged intervals under different scales, the father interval of the node is the interval of the previous scale of the interval to which the node belongs, the subinterval of the node is the interval of the next scale of the interval to which the node belongs, and the brother intervals of the node are all the subintervals of the interval of the previous scale of the interval to which the node belongs; each node selects a node as a neighbor node in all brother intervals under different scales, each node has n neighbor nodes under each scale, and if the ID digit of the node is m, the node has n neighbor nodes together
Figure 723660DEST_PATH_IMAGE002
A neighboring node;
when the node a establishes connection with another node c in the P2P network, the node a determines the section of the node c under different scale levels according to the ID value of the node c, when an adjacent node b exists in the section, the node c is used as a backup node, and in a certain heartbeat period, the node a compares the network response speeds with the node b and the node c, if the network response speed with the node c is greater than the network response speed with the node b, the node c replaces the node b to be the adjacent node of the node a in the section, otherwise, the node b is kept unchanged as the adjacent node of the node a in the section.
Further, the data transmission in the step S3 includes the following steps,
when a data sending node sends transaction and block data in a block chain system, firstly, the data is packed into a standard data format according to a block chain related protocol, and meanwhile, a transmission level data item is added, at the moment, the data is sent for the first time, so that the transmission level value is 1; and determining that the scale grade is also 1 according to the transmission grade value 1, selecting all the adjacent nodes of the data sending node under the scale grade, and sending the data with the transmission grade to the adjacent nodes of the node.
Further, the data receiving and forwarding in S4 includes the following steps of firstly verifying the received data, verifying the validity of the transaction and block data, and simultaneously verifying the transmission level data item, where the minimum value is 1 and the maximum value does not exceed the maximum scale level; then, the signature of the transmission level is verified, and the validity of the signature is judged; after the received data passes verification, judging data forwarding, namely adding 1 to a transmission level value in the received data to serve as a scale level selected by a data forwarding adjacent node, and judging whether the scale level exceeds the maximum scale level of the block chain system or not; and judging whether the adjacent nodes exist under the scale level, if not, not forwarding the data, and if so, forwarding the data to the adjacent nodes.
Further, the data receiving and forwarding in S4 further includes that after the data forwarding, the next group of nodes receiving the data repeat the above data receiving and forwarding process until most of the nodes in the P2P network of the blockchain system receive the data.
Further, after receiving and forwarding the data in S4, the method further includes adding a new node/exiting a node:
the network state of each node is uncontrollable, the network bandwidth of the node cannot be required, even the node cannot be required to be in a stable network, the node can be offline at any time, and a new node can be added at any time;
when a new node is added, firstly calculating an ID value corresponding to the node, then distributing the interval into a corresponding interval through the interval divided by the chain nodes of the initial block, and then finishing the updating of the nodes of the whole block chain through updating the adjacent nodes;
when a node goes offline or exits due to some factor, and the system updates the adjacency point, new adjacency points are allocated to the nodes taking the exiting node as the adjacency point again.
In another aspect, the present invention also discloses a computer readable storage medium storing a computer program, which when executed by a processor causes the processor to perform the steps of the method as described above.
According to the technical scheme, the block chain network hierarchical transmission method based on multi-scale node management provides a multi-scale node management model, the method selects the division strength according to the scale of the block chain network, divides the network node set into a plurality of scales, divides the nodes into a plurality of uniform intervals according to the size of an ID value under each scale, selects one node as a neighboring node of a transmission node in different intervals under different scales, and adopts a neighboring node updating mode based on the transmission speed. And updating the adjacent nodes in each interval through the network transmission speed among the nodes, namely, replacing the old nodes with the nodes with higher transmission speed as the adjacent nodes of the nodes, and keeping the highest data transmission speed between the nodes and the adjacent nodes all the time. Based on the multi-scale node management model, when the transmission levels are different, the data sending node forwards the data to the adjacent node under the corresponding scale level; the invention reduces the transmission level, reduces the transmission time delay, improves the network utilization rate and improves the maximum throughput.
Drawings
FIG. 1 is a schematic structural diagram of a multi-scale node management model of the present invention;
FIG. 2 is a diagram of neighboring node structures at different scales;
fig. 3 is a schematic diagram of a transmission architecture based on a multi-scale node management model.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
As shown in fig. 1, the hierarchical transmission method for a blockchain network based on multi-scale node management according to the present embodiment includes the following steps,
s1, setting a scale division strength n according to the scale of the whole block chain network. I.e. when the Scale level Scale-level =1, the nodes in the network are equally divided into n intervals. And when the number of the nodes contained in each interval is less than or equal to the dividing strength n, the new scale is not continuously divided.
And S2, initializing a neighbor node list. When a new node is added into the network, judging the interval where the node is positioned when the Scale level Scale-level =1 according to the ID value of the new node, and randomly selecting a node from brother intervals of the interval to be added into a neighbor node list of the new node; and repeating the method, and selecting corresponding nodes under other scales, and adding the nodes into the adjacent node list.
And S3, data transmission. When the data sending node sends transaction, block and other data in a block chain system, firstly, the data are packaged into a standard data format according to a block chain related protocol, and meanwhile, a transmission level data item is added, at the moment, the data are sent for the first time, so that the transmission level value is 1; and determining that the scale grade is also 1 according to the transmission grade value 1, selecting all the adjacent nodes of the data sending node under the scale grade, and sending the data with the transmission grade to the adjacent nodes of the node.
And S4, receiving and forwarding the data. Verification of the received data is first performed. Verifying the validity of data such as transaction, blocks and the like, and simultaneously verifying transmission level data items, wherein the minimum value of the transmission level data items is 1, and the maximum value of the transmission level data items does not exceed the maximum scale level; and then, the signature at the transmission level is verified, and the validity of the signature is judged. After the received data passes verification, judging data forwarding, namely adding 1 to a transmission level value in the received data to serve as a scale level selected by a data forwarding adjacent node, and judging whether the scale level exceeds the maximum scale level of the block chain system or not; and judging whether the adjacent nodes exist under the scale level, if not, not forwarding the data, and if so, forwarding the data to the adjacent nodes.
The following are specifically described:
a node management model is set, the functions of the node management model are mainly divided into 6 main parts which are respectively as follows: setting the scale division strength, initializing the neighbor nodes, updating the neighbor nodes, sending data, receiving and forwarding the data, and adding new nodes or exiting the existing nodes possibly generated at any time.
Scale division: in the block chain system, the ID value corresponding to the node can be obtained according to the hash operation, the ID value of each node obtained through calculation is unique due to the characteristics of the hash operation, and the number of digits of the ID value of the node is determined. The concept of node scale is proposed in the system, and all nodes in the network are managed based on a multi-scale model. The dividing steps are as follows:
(1) Arranging all nodes in the network from small to large according to the ID values, and determining the division strength n;
(2) Setting Scale-level =1, dividing a node set in the network into n intervals according to the dividing strength, namely interval 11, interval 12 \8230, interval 1n;
(3) Setting Scale-level =2, and dividing n intervals under the Scale level 1 into n intervals respectively, such as interval 11 further divided into interval 21 \8230andinterval 2n;
(4) When being divided intoAnd when the number of the nodes contained in each interval is less than or equal to the dividing strength n, not continuously dividing the new scale. At this time, scale-level = k, n at Scale level k-1 is set k-1 The intervals are respectively divided into n intervals; if the number of the ID bits of the nodes is m, the maximum value of the system scale can be calculated
Figure 600349DEST_PATH_IMAGE003
Initialization of neighbor nodes: the local nodes have unique belonged intervals under different scales, the father interval of the node is the interval of the previous scale of the interval to which the node belongs, the subinterval of the node is the interval of the next scale of the interval to which the node belongs, and the brother intervals of the node are all the subintervals of the interval of the previous scale of the interval to which the node belongs. And selecting one node as a neighbor node of each node in all brother intervals under different scales, wherein each node has n neighbor nodes under each scale.
Updating the neighbor nodes: when the node a establishes connection with another node c in the P2P network, the node a determines the section of the node c under different scale levels according to the ID value of the node c, when an adjacent node b exists in the section, the node c is used as a backup node, and in a certain heartbeat period, the node a compares the network response speed with the node b and the node c, if the network response speed with the node c is greater than the network response speed with the node b, the node c replaces the node b to become the adjacent node of the node a in the section. Otherwise, keeping the node b as the neighbor node of the node a in the interval unchanged.
And (3) sending data: when a data sending node sends transaction, block and other data in a block chain system, firstly, the data are packed into a standard data format according to a block chain related protocol, and meanwhile, a transmission level data item is added, at the moment, the data are sent for the first time, so that the transmission level value is 1; and determining that the scale grade is also 1 according to the transmission grade value 1, selecting all the adjacent nodes of the data sending node under the scale grade, and sending the data with the transmission grade to the adjacent nodes of the node.
Data receiving and forwarding: after receiving the data, the node mainly verifies and forwards the data. The detailed steps are as follows:
(1) And (6) verifying the data. Verifying the validity of data such as transaction, blocks and the like, and simultaneously verifying transmission level data items, wherein the minimum value of the transmission level data items is 1, and the maximum value of the transmission level data items does not exceed the maximum scale level; and then, the signature of the transmission level is verified, and the validity of the signature is judged.
(2) And (6) forwarding the data. After the received data passes verification, judging data forwarding, namely adding 1 to a transmission level value in the received data to serve as a scale level selected by a data forwarding adjacent node, and judging whether the scale level exceeds the maximum scale level of the block chain system or not; and judging whether the adjacent nodes exist under the scale level, if not, not forwarding the data, and if so, forwarding the data to the adjacent nodes.
After data forwarding, the next group of nodes receiving the data repeat the above data receiving and forwarding process until most of the nodes in the block chain system P2P network receive the data.
New node joining/node exiting: the network state of each node is uncontrollable, the network bandwidth of the node cannot be required, even the node cannot be required to be in a stable network, the node can be offline at any time, and a new node can be added at any time. When a new node is added, the ID value corresponding to the node is calculated firstly, then the divided interval is distributed to the corresponding interval through the link point of the initial block, and then the updating of the node of the whole block chain is completed through updating the adjacent node. When a node is offline or exits due to a certain factor and the adjacency point is updated in the system, new adjacency points are distributed to the nodes taking the exiting node as the adjacency points again.
The node management model is the foundation and core of a P2P network in a blockchain system, and different blockchain systems have different node management methods. In order to improve the transmission efficiency and the security of the P2P network of the blockchain system, a multi-scale node management model is designed, and the overall structure of the model is shown in fig. 1.
In the model, the range of the node ID value is uniformly divided into a plurality of different intervals, and the smaller the scale grade is, the smaller the number of the intervals is. As in fig. 1, the scale level of scale 1 is the smallest, and the number of intervals is n; when the scale is 2, each interval of the scale 1 is subdivided into n intervals, namely n ^2 intervals; when the scale is 3, each interval of the scale 2 is subdivided into n intervals, namely n ^3 intervals; when the scale level is the maximum of the scale k, n ^ k intervals exist. It can be seen that the number of intervals exponentially increases as the scale level becomes larger.
The node belonging interval is the interval where the node ID value is located, and each node has a unique belonging interval under different scales, for example, in the figure, the node 0 belongs to the interval 11 when the scale level is 1, and belongs to the interval 21 when the scale level is 2. The parent interval of the node is an interval of a previous scale of the interval to which the node belongs, for example, when the scale level of the node 0 is 2, the parent interval is an interval 11. The subinterval of the node is the subinterval of the next scale of the interval to which the node belongs, and for example, the subinterval to which the node 0 belongs when the scale level is 1 in the graph is the interval 21. The sibling intervals of the node are all sub-intervals of the interval of the previous scale of the interval to which the node belongs, such as the sibling intervals of 21, \ 8230 \ 8230;, 2n in the graph when the scale level of the node 0 is 2.
To better define the relevant parameters, m is defined as the number of bits of the node ID value, and is determined for any one of the running blockchain systems. Defining n as the number of intervals when the scale grade is minimum (namely 1); defining k as the size of scale grade, the minimum scale grade is 1, and the maximum scale grade is greater than or equal to
Figure 235861DEST_PATH_IMAGE004
The smallest integer of (c). Defining j as interval number under different scales, the minimum value is 1, and the maximum value is
Figure 299632DEST_PATH_IMAGE005
. Each interval contains the maximum number of nodes
Figure 560849DEST_PATH_IMAGE006
Within each interval, the minimum value of the node ID is
Figure 42777DEST_PATH_IMAGE007
Node ID maximum of
Figure 98457DEST_PATH_IMAGE008
Each node added into the block chain P2P network needs to store a neighbor node list for communication with other nodes, but the number of nodes in the P2P network is large, so that all nodes cannot be stored, and a single node can select some neighbor nodes for storage.
In the model, a single node selects a node as a neighbor node in all sibling intervals under each scale. The structure of the adjacent nodes of the nodes under different scales is shown in figure 2. Taking a node with a node ID of 0 as an example, taking one node from each interval from the interval 11 to the interval 1n as a neighboring node when the scale level is scale 1; similarly, when the scale level is scale 2, taking out a node from each interval from the interval 21 to the interval 2n as a neighboring node; until the scale level is the scale k, taking out a node from each interval from the interval k1 to the interval kn as a neighboring node.
Under each scale, the node has n adjacent nodes, and the node I has kn adjacent nodes.
By adopting a multi-scale node management model, the nodes in the P2P network can be efficiently managed. Meanwhile, the network transmission based on the model can reduce the transmission level and improve the transmission efficiency of the network, wherein the transmission level represents the number of transmission layers through which data are transmitted from the sending node to the receiving node. The transmission architecture based on the multi-scale node management model is shown in fig. 3. When a node initiates data transmission (such as transaction or block data), the data transmission level value is 1, so that the determined scale level is also 1, all the adjacent nodes when the scale level of the transmitting node is 1 are selected, a transmission level data item (in this case, 1) is added, and the data are transmitted to the adjacent nodes.
And the node receiving the data adds 1 to the transmission level value according to the additional transmission level value to determine a scale level (namely 2), selects all the adjacent nodes of the node under the scale level, adds a transmission level data item (in this case 2), and forwards the data to the adjacent nodes.
And repeating the data continuously by analogy until the scale grade in the received data reaches the maximum value, and finishing the data broadcasting.
In summary, the embodiment of the present invention provides a multi-scale node management model. Under different scale levels, the range of the node ID value is evenly divided into a plurality of different intervals, one node is selected as a neighboring node in each interval, and a neighboring node updating mode based on the transmission speed is adopted. And updating the adjacent nodes in each interval through the network transmission speed between the nodes, namely replacing the old nodes with the nodes with higher transmission speed as the adjacent nodes of the nodes, and keeping the highest data transmission speed between the nodes. A hierarchical transmission model of a block chain network is provided. Based on the multi-scale node management model, when the transmission levels are different, the data sending node forwards the data to the adjacent node under the corresponding scale level;
specifically, the embodiments of the present invention have the following advantages:
1. reduction of transmission level
Under the condition of certain network bandwidth and transmission data volume, the transmission time length is related to the transmission level value, and the transmission efficiency is higher when the transmission level value is smaller and the transmission time length is smaller; the larger the output level value is, the more the data forwarding times are, the longer the time required for data transmission to the whole network is, and the maximum transmission level value of the multi-scale node management model is equal to the maximum scale value of the P2P network in the blockchain system plus one, that is:
Figure 662906DEST_PATH_IMAGE009
(1)
wherein m is the number of bits of the node ID value in the blockchain system, and m is determined for any one running blockchain system; n is the number of intervals when the scale level is the minimum (i.e. 1), and since the number of adjacent nodes in each interval is 1, the value of n is equal to the number of adjacent nodes broadcast when the node forwards data each time. Wherein the larger m is, the larger the maximum transmission level value is; the larger n, the smaller the maximum transmission level value.
In the ethernet structured P2P network, the maximum transmission level value is:
Figure 462235DEST_PATH_IMAGE010
(2)
wherein m is the same number of bits of the node ID value and is 256, the number of EtherFang K barrels is also 256,
Figure 798670DEST_PATH_IMAGE011
if the maximum node number stored in the ether house K bucket is 16, the maximum transmission level value of the ether house is 252 according to the calculation result of the formula (2).
In the ether house, the number of adjacent nodes for forwarding data broadcast by the node each time is as follows:
Figure 290831DEST_PATH_IMAGE012
(3)
according to the calculation result of the formula (3), the number of the adjacent nodes of the node forwarding the data broadcast at each time is at most 64. If the number of adjacent nodes of the data broadcast forwarded by the node each time in the model is consistent with that of the Ethengfang and is also 64, when the model is adopted, the maximum transmission level value is calculated to be 43 according to the calculation result of the formula (1).
2. Reduction of transmission delay
When data is transmitted by using the model, the transmission level of each transmission and the signature data of a data sending node need to be added, and the size of the signature data is large
Figure 345506DEST_PATH_IMAGE013
At 4+32 bytes, it can be seen that the increased data amount is very small, and the data amount thereof is a fixed size and does not increase with the increase of the transmission level value. Therefore, the increased data amount is negligibleAnd the transmission efficiency analysis result is not influenced.
Taking Ether block data transmission as an example, the network transmission rate between nodes
Figure 682946DEST_PATH_IMAGE014
The average value was 20Mbps, m was 256,
Figure 139466DEST_PATH_IMAGE015
at 16, the Etherhouse transmission level value was 252 and the model transmission level value was 43 based on the transmission level value analysis. Then the transmission delay of the ether house is:
Figure 536950DEST_PATH_IMAGE016
(4)
the transmission delay of the model is as follows:
Figure 75991DEST_PATH_IMAGE017
(5)
wherein,
Figure 217122DEST_PATH_IMAGE018
is the size of the amount of data transferred. The block size of Ethern blocks having a height of 14581702 is 189,646bytes [ 2 ], [31 ]]The transmission delay of the Ethengfang P2P network is 18.2 seconds, and the transmission delay of the model is 3.1 seconds; when block data with the size of about 1MB is transmitted, the transmission delay of the Etheng P2P network is 100.8 seconds, and the transmission delay adopting the model is 17.2 seconds.
3. Network utilization enhancement
In a P2P network of a block chain system, since there is a repeat transmission during data forwarding, a node often receives data forwarded by multiple neighboring nodes. Under the condition of certain bandwidth among nodes and certain transmitted data volume, the main factor influencing the network utilization rate is the data transmission repetition rate, and the lower the transmission repetition rate is, the higher the network utilization rate is.
According to the formula (3), the node forwards the data each timeNumber of broadcasted neighboring nodes
Figure 528149DEST_PATH_IMAGE019
And at most 64. Under an ideal environment, a node sends a piece of data and directly broadcasts the data to all adjacent nodes in the network, other nodes in the network only receive the data once, and the transmission times are as follows:
Figure 362113DEST_PATH_IMAGE020
(6)
the transmission repetition rate is defined as the ratio of the actual number of transmissions to the number of transmissions in an ideal state, and the analysis of the number of transmissions is shown in table 1.
TABLE 1 Transmission times and repetition Rate analysis
Figure 125801DEST_PATH_IMAGE021
The transmission repetition rate for the MsP2P network is around 2.0 and the transmission repetition rate for the DevP2P network is around 64.
4. The maximum throughput is improved
The throughput of the blockchain is one of the main indicators of the performance of the blockchain, and there are many factors that affect the size of the blockchain, and the intrinsic factors include: a consensus mechanism, a data structure, an encryption algorithm, transaction verification, a P2P network, etc.; the external influence factors include the CPU performance of the node, the memory size, the hard disk capacity, the network bandwidth and other resources.
The impact of the blockchain network on blockchain throughput includes network structure, bandwidth, etc. Maximum throughput of block chain system under the condition of network bandwidth determination
Figure 70623DEST_PATH_IMAGE022
Comprises the following steps:
Figure 236156DEST_PATH_IMAGE023
(7)
bandwidth of network between nodes
Figure 241021DEST_PATH_IMAGE024
At 20Mbps, average size of transaction
Figure 489075DEST_PATH_IMAGE025
At 250 bytes, the maximum throughput of the Msp2P network is calculated according to equation (7)
Figure 972009DEST_PATH_IMAGE026
Comprises the following steps:
Figure 257628DEST_PATH_IMAGE027
(8)
while maximum throughput of DevP2P network
Figure 433395DEST_PATH_IMAGE028
Comprises the following steps:
Figure 906096DEST_PATH_IMAGE029
(9)
the maximum throughput of the MsP2P network is 5243tps, while the maximum throughput of the DevP2P network is 163tps.
In yet another aspect, the present invention also discloses a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of any of the methods described above.
In yet another aspect, the present invention also discloses a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of any of the methods described above.
In a further embodiment provided by the present application, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of any of the methods of the embodiments described above.
It is understood that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, the example and the beneficial effects of the related contents can refer to the corresponding parts in the method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (5)

1. A hierarchical transmission method of block chain network based on multi-scale node management is characterized by comprising the following steps,
s1, setting Scale division strength n according to the Scale of the whole block chain network, namely, when the Scale level Scale-level =1, dividing nodes in the network into n intervals; when the number of the nodes contained in each interval is less than or equal to the dividing strength n, the new scale is not continuously divided;
s2, initializing a neighbor node list; when a new node is added into the network, judging the node is positioned in an interval with Scale-level =1 according to the ID value of the new node, and randomly selecting a node from brother intervals of the interval to be added into a neighbor node list of the new node; repeating the method, selecting corresponding nodes under other scales, and adding the nodes into an adjacent node list; the brother intervals of the nodes are all sub-intervals of the interval of the previous scale of the interval to which the nodes belong;
s3, data sending;
s4, receiving and forwarding data;
wherein the initializing the neighbor node list in the step S2 comprises the following steps,
the local nodes have unique belonged intervals under different scales, the father interval of the node is the interval of the previous scale of the interval to which the node belongs, the subinterval of the node is the interval of the next scale of the interval to which the node belongs, and the brother intervals of the node are all the subintervals of the interval of the previous scale of the interval to which the node belongs; each node selects a node as its adjacent node in all brother intervals under different scales, each node has n adjacent nodes under each scale, if the node ID digit is m, then all nodes have a common node
Figure 161016DEST_PATH_IMAGE001
A neighboring node;
when the node a establishes connection with another node c in the P2P network, the node a determines the section of the node c under different scale levels according to the ID value of the node c, when an adjacent node b exists in the section, the node c is used as a backup node, in a heartbeat cycle, the node a compares the network response speeds with the node b and the node c, if the network response speed with the node c is higher than the network response speed with the node b, the node c replaces the node b to become the adjacent node of the node a in the section, otherwise, the node b is kept unchanged as the adjacent node of the node a in the section;
when the data sending node sends transaction and block data in the block chain system, firstly, the data is packed into a standard data format according to a block chain related protocol, and meanwhile, a transmission level data item is added, at this time, the data is sent for the first time, so that the transmission level value is 1; determining that the scale grade is also 1 according to the transmission grade value 1, selecting all adjacent nodes of the data sending node under the scale grade, and sending the data with the transmission grade to the adjacent nodes of the node;
the data receiving and forwarding in the S4 comprises the following steps of firstly verifying the received data, verifying the validity of transaction and block data, and simultaneously verifying a transmission level data item, wherein the minimum value of the transmission level data item is 1, and the maximum value of the transmission level data item does not exceed the maximum scale grade; then, the signature of the transmission level is verified, and the validity of the signature is judged; after the received data passes verification, judging data forwarding, namely adding 1 to a transmission level value in the received data to serve as a scale level selected by a data forwarding adjacent node, and judging whether the scale level exceeds the maximum scale level of the block chain system or not; and judging whether the adjacent nodes exist under the scale level, if not, not forwarding the data, and if so, forwarding the data to the adjacent nodes.
2. The hierarchical transmission method for a blockchain network based on multi-scale node management as claimed in claim 1, wherein: the step S1 comprises the following steps of scale division:
s11, sequentially arranging all nodes in the network from small to large according to ID values, and determining a division strength n;
s12, setting a Scale level Scale-level =1, and equally dividing a node set in the network into n intervals according to the dividing strength, namely an interval 11, an interval 12, an interval 8230, and an interval 1n;
s13, setting Scale-level =2, and equally dividing n intervals under the Scale level 1 into n intervals respectively;
s14, when the number of the nodes contained in each interval is less than or equal to the dividing strength n, no new scale is continuously divided; at this time, the Scale level Scale-level = k, and n is set to be at the Scale level k-1 k-1 Each interval is divided into n intervals; if the number of the ID bits of the nodes is m, the maximum value of the system scale is calculated to be
Figure 556225DEST_PATH_IMAGE002
3. The hierarchical transmission method for a blockchain network based on multi-scale node management as claimed in claim 2, wherein: and after the data receiving and forwarding in S4 further includes data forwarding, repeating the above data receiving and forwarding process for the next group of nodes receiving data until most of the nodes in the P2P network of the blockchain system receive the data.
4. The hierarchical transmission method for a blockchain network based on multi-scale node management as claimed in claim 3, wherein: after the data receiving and forwarding in S4, new node joining/node exiting is also included:
the network state of each node is uncontrollable, the network bandwidth of the node cannot be required, even the node cannot be required to be in a stable network, the node can be offline at any time, and a new node can be added at any time;
when a new node is added, firstly calculating an ID value corresponding to the node, then distributing the interval into the corresponding interval through the interval divided by the link points of the initial block, and then finishing the updating of the nodes of the whole block chain by updating the adjacent nodes;
when a node is offline or exits due to a certain factor and the adjacency point is updated in the system, new adjacency points are distributed to the nodes taking the exiting node as the adjacency points again.
5. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 4.
CN202211219789.0A 2022-10-08 2022-10-08 Hierarchical transmission method of block chain network based on multi-scale node management and storage medium Active CN115296824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211219789.0A CN115296824B (en) 2022-10-08 2022-10-08 Hierarchical transmission method of block chain network based on multi-scale node management and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211219789.0A CN115296824B (en) 2022-10-08 2022-10-08 Hierarchical transmission method of block chain network based on multi-scale node management and storage medium

Publications (2)

Publication Number Publication Date
CN115296824A CN115296824A (en) 2022-11-04
CN115296824B true CN115296824B (en) 2022-12-16

Family

ID=83834149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211219789.0A Active CN115296824B (en) 2022-10-08 2022-10-08 Hierarchical transmission method of block chain network based on multi-scale node management and storage medium

Country Status (1)

Country Link
CN (1) CN115296824B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107528886A (en) * 2017-07-25 2017-12-29 中国科学院计算技术研究所 Block chain the whole network method for splitting and system
CN108920723A (en) * 2018-08-01 2018-11-30 江苏恒宝智能系统技术有限公司 A kind of nodal hierarchy partition management method
CN109873808A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 Communication means and device, storage medium and electronic equipment between block chain node
CN110754070A (en) * 2017-06-20 2020-02-04 区块链控股有限公司 Fast propagation of recent transactions over blockchain networks
KR20200048246A (en) * 2018-10-29 2020-05-08 에스케이텔레콤 주식회사 Method for managing distributed ledger based on block chain
CN111770017A (en) * 2020-06-22 2020-10-13 国网冀北电力有限公司电力科学研究院 Power distribution Internet of things cluster management system and method based on trusted block chain
CN111984733A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data transmission method and device based on block chain and storage medium
CN114465933A (en) * 2022-04-13 2022-05-10 中国科学院合肥物质科学研究院 Block chain network transmission method and transmission medium based on KAD (Kad Gemini) model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210091926A1 (en) * 2019-09-25 2021-03-25 The Mitre Corporation Assessing permissioned blockchains

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110754070A (en) * 2017-06-20 2020-02-04 区块链控股有限公司 Fast propagation of recent transactions over blockchain networks
CN107528886A (en) * 2017-07-25 2017-12-29 中国科学院计算技术研究所 Block chain the whole network method for splitting and system
CN108920723A (en) * 2018-08-01 2018-11-30 江苏恒宝智能系统技术有限公司 A kind of nodal hierarchy partition management method
KR20200048246A (en) * 2018-10-29 2020-05-08 에스케이텔레콤 주식회사 Method for managing distributed ledger based on block chain
CN109873808A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 Communication means and device, storage medium and electronic equipment between block chain node
CN111770017A (en) * 2020-06-22 2020-10-13 国网冀北电力有限公司电力科学研究院 Power distribution Internet of things cluster management system and method based on trusted block chain
CN111984733A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data transmission method and device based on block chain and storage medium
CN114465933A (en) * 2022-04-13 2022-05-10 中国科学院合肥物质科学研究院 Block chain network transmission method and transmission medium based on KAD (Kad Gemini) model

Also Published As

Publication number Publication date
CN115296824A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
CN110602148B (en) Method and device for generating state tree of block and verifying data on chain
US11018980B2 (en) Data-interoperability-oriented trusted processing method and system
CN111080445B (en) Credible certificate storing method and system based on graph structure
US8301736B2 (en) Method for selecting and configuring network supernodes
CN107666516A (en) A kind of method for ensureing kafka company-data uniformity based on message temperature
CN110276602B (en) Block chain hierarchical consensus method and system for Internet of things and electronic equipment
CN114760135B (en) Optimization method of block chain fault-tolerant consensus scheme
CN109617702B (en) Message signing method, block chain node and device with storage function
CN114465933B (en) Block chain network transmission method and transmission medium based on KAD (Kad-based binary) model
Cherupally et al. Lightweight and Scalable DAG based distributed ledger for verifying IoT data integrity
CN115296824B (en) Hierarchical transmission method of block chain network based on multi-scale node management and storage medium
CN110956463B (en) Credible certificate storing method and system based on extensible distributed query system
CN109496407B (en) Message transmission method, device and storage medium in block chain system
Allen et al. Uttering: Social micro-blogging without the internet
CN110166565A (en) Block chain divides domain triggering method and system
CN116668135A (en) Block chain consensus method, system and device participated in by mobile edge equipment
Xiong et al. ORIC: A Self-Adjusting Blockchain Protocol with High Throughput
CN114064706A (en) Data storage method and device and server
Peng et al. Komorebi: A DAG-based Asynchronous BFT Consensus via Sharding
Zheng et al. DHBN: An Efficient Broadcast Protocol for Blockchain Networks in Highly Dynamic Heterogeneous Environment
Bhatnagar et al. Improving the Scalability of Blockchain Powered IoT Networks Using Improved Fuzzy Stellar Consensus Protocol
CN115550194B (en) Block chain network transmission method based on class furthest sampling and storage medium
US20240004842A1 (en) Rebalance method for blockchain-based decentralized file system
CN115102956B (en) Block chain transaction throughput and instantaneity improving method based on multi-chain mode
CN116033520B (en) Wireless networking method and wireless ad hoc network 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