CN111083052A - Fragmentation method and device based on ordered balanced binary tree - Google Patents

Fragmentation method and device based on ordered balanced binary tree Download PDF

Info

Publication number
CN111083052A
CN111083052A CN201911316122.0A CN201911316122A CN111083052A CN 111083052 A CN111083052 A CN 111083052A CN 201911316122 A CN201911316122 A CN 201911316122A CN 111083052 A CN111083052 A CN 111083052A
Authority
CN
China
Prior art keywords
target
node
binary tree
tree
balanced binary
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.)
Granted
Application number
CN201911316122.0A
Other languages
Chinese (zh)
Other versions
CN111083052B (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.)
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Shanghai Youyang New Media Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Youyang New Media Information Technology Co ltd filed Critical Shanghai Youyang New Media Information Technology Co ltd
Priority to CN201911316122.0A priority Critical patent/CN111083052B/en
Publication of CN111083052A publication Critical patent/CN111083052A/en
Application granted granted Critical
Publication of CN111083052B publication Critical patent/CN111083052B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/122Shortest path evaluation by minimising distances, e.g. by selecting a route with minimum of number of hops
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/48Routing tree calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The invention discloses a fragmentation method based on an ordered balanced binary tree, which comprises the following steps: when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network; if not, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree; and determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node. The fragmentation method enables all nodes in the target block chain to form the target balanced binary tree, all the fragments can process transactions in parallel, and the fragmentation technology can improve the concurrency of transaction processing and confirmation, so that the throughput of the target block chain can be improved.

Description

Fragmentation method and device based on ordered balanced binary tree
Technical Field
The invention relates to the technical field of block chains, in particular to a fragmentation method and a fragmentation device based on an ordered balanced binary tree.
Background
In the process of achieving consensus in the blockchain system, voting is performed by corresponding nodes in the blockchain system, and the time of voting depends on the number of the nodes in the blockchain.
As the number of nodes in the blockchain system increases, the time required for achieving global consensus also increases, which causes a great challenge to the throughput of the whole blockchain system.
Disclosure of Invention
In view of the above, the present invention provides a fragmentation method and device based on an ordered balanced binary tree, which are used to solve the problem that in the prior art, as the number of nodes in a blockchain system increases, the time required for achieving global consensus also increases continuously, resulting in great challenges on the throughput of the whole blockchain system, and the specific scheme is as follows:
a fragmentation method based on an ordered balanced binary tree comprises the following steps:
when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network;
if not, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree;
and determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node.
The above method, optionally, further includes:
if the target node is the head node of the target network, constructing the target block chain according to the target node;
initializing the target block chain.
The above method, optionally, further includes:
judging whether the binary tree balanced with the target is unbalanced;
and if so, determining a minimum imbalance sub-tree in the target balanced binary tree, and adjusting the target balanced binary tree according to the minimum imbalance sub-tree.
Optionally, in the above method, determining a target subtree node of the target balanced binary tree according to the response, and adding the target node to the target subtree node includes:
determining the network distance between the target node and each subtree in the target balanced binary tree according to the response;
and selecting the shortest network distance from the network distances, wherein the subtree node corresponding to the shortest network distance is the target subtree node.
The above method, optionally, further includes:
when detecting that any node leaves the target block chain, judging whether the any node is a leaf node;
if yes, directly leaving, or;
if not, selecting the node with the highest height from the left sub-tree and the right sub-tree corresponding to the arbitrary node in sequence to replace the arbitrary node, or;
and if the heights of the left subtree and the right subtree corresponding to the arbitrary node are equal, selecting the left subtree corresponding to the arbitrary node by default.
The above method, optionally, further includes:
when the nodes of both trading parties in the target block chain trade, acquiring the positions of the nodes of both trading parties in the target balanced binary tree;
determining the minimum public father node of the nodes of the two transaction parties according to the position;
and after consensus is completed according to the minimum public father node, broadcasting the generated target block by the root node of the partition corresponding to the trading bilateral node.
The above method, optionally, further includes:
and distributing a weighting factor for each node in the target block chain.
A slicing device based on ordered balanced binary tree includes:
the first judgment module is used for judging whether a target node is a first node of a target network or not when a request of the target node for joining the target network is received;
a sending and receiving module, configured to send the request to each node in a target block chain of the target network if the node in the target block chain is not in the target network, and receive a response of each node to the request, where each node in the target block chain forms a target balanced binary tree;
and the determining and adding module is used for determining a target subtree node of the target balanced binary tree according to the response and adding the target node into the target subtree node.
The above apparatus, optionally, further comprises:
the second judgment module is used for judging whether the binary tree is unbalanced with the target balance;
and if so, determining a minimum imbalance sub-tree in the target balanced binary tree, and adjusting the target balanced binary tree according to the minimum imbalance sub-tree.
The above apparatus, optionally, the determining and joining module includes:
a first determining unit, configured to determine, according to the response, a network distance between the target node and each sub-tree in the target balanced binary tree;
and the second determining unit is used for selecting the shortest network distance from the network distances, and the subtree node corresponding to the shortest network distance is the target subtree node.
Compared with the prior art, the invention has the following advantages:
the invention discloses a fragmentation method based on an ordered balanced binary tree, which comprises the following steps: when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network; if not, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree; and determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node. The fragmentation method enables all nodes in the target block chain to form the target balanced binary tree, all the fragments can process transactions in parallel, and the fragmentation technology can improve the concurrency of transaction processing and confirmation, so that the throughput of the target block chain can be improved.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a fragmentation method based on an ordered balanced binary tree according to an embodiment of the present application;
fig. 2 is another flowchart of a fragmentation method based on an ordered balanced binary tree disclosed in the embodiment of the present application;
fig. 3 is another flowchart of a fragmentation method based on an ordered balanced binary tree according to an embodiment of the present application;
fig. 4 is a schematic diagram of an adjusting method of a balanced binary tree disclosed in the embodiment of the present application;
fig. 5 is a structural block diagram of a slicing apparatus based on an ordered balanced binary tree according to an embodiment of the present application.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The invention discloses a fragmentation method based on an ordered balanced binary tree, which is applied to the field of a block chain, wherein along with the increase of the number of nodes in the block chain, the time required for achieving consensus is also increased continuously, so that the throughput of a block chain system is influenced. The verifier only needs to verify one part of the network transaction, the workload is distributed on each sub-slice, and the slicing technology can improve the concurrency of transaction processing and confirmation, so that the throughput of the whole system is improved. The execution flow of the slicing method is shown in fig. 1, and includes the steps of:
s101, when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network;
in this embodiment of the present invention, the target node is a node currently requesting to join a target network, and whether the target node is a head node of the target network is determined by an identifier fed back by the target network, where the identifier may be an electrical signal, a number, or another identifier, for example, when the target network feeds back a high level, the target node is determined to be the head node of the target network, and when the target network feeds back a low level, the target node is determined not to be the head node of the target network, where a specific form of the identifier is not limited in this embodiment of the present invention.
S102, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree;
in this embodiment of the present invention, when the target node is not the first node of the target network, a target block chain corresponding to the target network is obtained, where each node in the target block chain exists in a target balanced binary tree, and each node exists in a form of a root node, a subtree node, or a leaf node in the target balanced binary tree, where any subtree node may be used as an independent partition. Each node receives the request and then responds to the request, wherein the response may be a reply message.
S103, determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node.
In the embodiment of the present invention, initially, the height difference of the target balanced binary tree needs to be set to 1, and the network distance between the target node and each node is determined according to the time for receiving the response. That is, the faster the reply message of a node is received, the closer the network distance to the node is, the shortest network distance is selected from the network distances, the subtree node corresponding to the shortest network distance is the target subtree node, and the target node is added to the target subtree node.
The invention discloses a fragmentation method based on an ordered balanced binary tree, which comprises the following steps: when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network; if not, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree; and determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node. The fragmentation method enables all nodes in the target block chain to form the target balanced binary tree, all the fragments can process transactions in parallel, and the fragmentation technology can improve the concurrency of transaction processing and confirmation, so that the throughput of the target block chain can be improved.
S104, initializing the target network.
In this embodiment of the present invention, when the target node is a head node of the target network, the target network needs to be initialized, including:
s11, creating a primary account, and initiating a transaction by the primary account;
and S12, creating a creating block. Starting a target block chain, a first block needs to be created, namely an ancestry block, and some basic settings need to be configured in the ancestry block:
and the independent block chain network id is used when other nodes are connected, and the nodes of different id networks cannot be connected with each other.
The mining difficulty degree determines the block-out efficiency according to the mining difficulty degree, the mining difficulty degree can be configured according to business requirements, the business requirements determine the data output efficiency, and the mining difficulty degree can be configured according to the data output efficiency required in business
Balance of primary account, initialization phase, balance of primary account
The generation of each block requires an upper limit on the resources consumed. The generation of each tile requires the consumption of a certain number of tokens.
S13, initializing the target block chain, making a local directory stored by the related data of the block chain, binding the initial account with the miners, and starting to dig the mine.
In this embodiment of the present invention, when the target node is added to the target balanced binary tree, it needs to determine whether the target balanced binary tree is unbalanced, and a flowchart of a determination process is as follows:
s201, judging whether the height of a left sub-tree and a right sub-tree in a path from the target node in the target balanced binary tree to a root node in the target balanced binary tree is greater than 2 sub-trees or not;
s202, determining a minimum unbalanced sub-tree in the target balanced binary tree;
in the embodiment of the present invention, if the minimum unbalanced sub-tree exists, the minimum unbalanced sub-tree is a sub-tree that uses the target node as a starting point, the minimum unbalanced sub-tree is searched upwards in the target balanced binary tree, and a sub-tree that uses a node whose absolute value of a first balancing factor exceeds 1 as a root is used as the minimum unbalanced sub-tree, where the balancing factor is a difference between a height of a left sub-tree and a height of a right sub-tree, values of the balancing factors are only 0, 1, -1, and correspond to the left and right sub-trees, respectively, which are equal in height, the left.
S203, adjusting the target balanced binary tree according to the minimum unbalanced subtree.
In the embodiment of the present invention, when the left sub-tree is high, the method includes:
a) LL type
In an LL-type unbalanced binary tree, the smallest unbalanced subtree is found first, then the root node of the subtree is rotated to the right, and after the tree height of the subtree on the right is increased by 1, and the tree height of the subtree on the left is decreased by 1, and the difference of the original tree heights is, then the balance factor of the root can be reduced to 0. After the rotation, the left child of the original root node is taken as a new root node.
Rotating the unbalanced binary tree to the right, centered on the root node, is shown in fig. 3-1. The rotating steps are as follows
i. Using 2 as a root node
ii. Right child with 3 as 2
iii, the right child of 2 is taken as the left child of 3 (maintain the order of the tree, just here NULL already)
b) LR type
For LR, the spinning is performed in two steps, as shown in FIG. 3-2. The rotation is followed by "the right child of the left child of the original root node is taken as the new root node".
The first rotates to the left centered on the root of the higher subtree, i.e. 1. The method comprises the following specific steps.
i. The left sub-tree of 2 is taken as the right sub-tree of 1 (maintain the ordering of the tree, only NULL here)
ii. Left subtree with 1 as 2
iii left subtree with 2 as 3
The second is to rotate to the right, centered on the root of the original tree, i.e. 3. After the rotation, the balance factor of 1,2,3 becomes 0.
When the right subtree is high, the method comprises the following steps:
a) RR type
A schematic view of the rotation is shown in fig. 3-3, with the following steps. After rotation, the new root node is the right child of the original root node.
i. Using 2 as a root node
ii. Left child with 1 as 2
iii, the left child of 2 is taken as the right child of 1 (maintain the order of the tree, just NULL here)
b) RL type
Similar to the LR type, we need to make two rotations, which are schematically shown in fig. 3-4, and the rotation is followed by "the left child of the right child of the original root node is taken as the new root node".
First, the right child of the root node, i.e., 3, is rotated to the right. The method comprises the following specific steps
i. Right child with 2 as 1
ii. Right child with 3 as 2
iii, the right child of 2 is taken as the left child of 3 (maintain the order of the tree, just here NULL already)
Second, the primitive root node, i.e., 1, is used as the center, rotating to the left. The method comprises the following specific steps
i. Using 2 as a root node
ii. Left child with 1 as 2
iii, the left child of 2 is taken as the right child of 1 (maintain the order of the tree, just NULL here)
In the embodiment of the present invention, a node may be added to the target block chain, and a node in the target block chain may also leave the target block chain, when it is detected that any node in the target block chain leaves the target block chain, it is determined whether the any node is a leaf node, if so, the node directly leaves, if not, a node with the highest height is selected from left and right subtrees corresponding to the any node in sequence to replace the any node, and if the heights of the left and right subtrees corresponding to the any node are equal, a left subtree corresponding to the any node is selected by default.
In the embodiment of the present invention, the target block chain is suitable for performing a transaction between nodes, and a transaction process is shown in fig. 4 and includes the steps of:
s301, when nodes of both trading parties in the target block chain carry out trading, acquiring positions of the nodes of both trading parties in the target balanced binary tree;
in the embodiment of the present invention, when nodes of both trading parties in the target block chain perform a trade, the nodes of both trading parties may be located in the same partition or in different partitions, and the position may be a root node, a sub-tree node, or a leaf node.
S302, determining a minimum public father node of the nodes of both parties of the transaction according to the position;
in the embodiment of the invention, the minimum public father node is that the left sub-tree and the right sub-tree of the node respectively comprise two nodes, and the two nodes are respectively positioned in different sub-trees, so that the sub-tree node to which the node belongs is determined according to the nodes of both transaction sides, and the minimum public father node is searched upwards layer by layer according to the sub-tree nodes.
And S303, completing consensus according to the minimum public father node, and broadcasting the generated target block by the root node of the partition corresponding to the trading bilateral node after the consensus is completed.
In the embodiment of the present invention, a partition where the minimum common parent node is located is determined, and consensus is completed in the partition, which is implemented by a POW consensus mechanism in the embodiment of the present invention, and a workload certification process of a POW includes:
and S21, generating a merkle root hash. That is, any node in the target block chain generates a transaction, and generates a Merkle root hash with all other transactions to be packed by a Merkle tree algorithm, and the process of generating the Merkle root hash is as follows:
at the lowest level of the target block chain, as with the hash list, the data is divided into small data blocks with corresponding hashes and their correspondences. But going up, instead of directly operating the root hash, two adjacent hashes are combined into a string, and then the hash of the string is operated, so that every two hashes are married to obtain a 'sub-hash'. If the total number of the hash at the bottom layer is singular, a single hash must be generated at last, and the situation is that the hash operation is directly carried out on the hash, so that the sub-hash can be obtained. Therefore, pushing up is still the same way, a smaller number of new first-level hashes can be obtained, and finally an inverted tree must be formed, and a Merkle root hash is left at the position of the tree root.
And S22, assembling a block head. The block head is used as an input parameter for calculating the workload certification output, so that the Merkle root hash calculated in the first step and other components of the block head are assembled into the block head
S23 output of calculation workload certification
Output of workload certification-SHA 256(SHA256 (block header))
if (output of workload proof < target value), prove workload completion
if (output of workload certification > is the target value), the random number is changed, the logic of i is recursed, and the comparison with the target value is continued. The target value may be defined empirically or in specific situations, and a value of the target value is not limited in the embodiment of the present invention.
S24, the node that completes the workload certification can submit the block to the target block chain and inform other nodes in the target network, and when more than half of the other nodes authenticate that the block is the block with the fastest generation efficiency, the block is authenticated as a formal block.
Furthermore, as the height of the node is higher, the consensus process that the node needs to participate in is more, and the excitation obtained by the node participating in the consensus needs to be weighted by a weighting factor positively correlated with the height of the node, that is, the excitation obtained by the node is the normal excitation (1+ the height of the node is 0.1).
In the embodiment of the invention, the network fragmentation technology can improve the concurrency of transaction processing and transaction confirmation, thereby improving the throughput of the whole block chain network. Based on the ordered balanced binary tree, the nodes with similar network distances can be ensured to be positioned in the same partition as much as possible, and the cost brought by the network is reduced, so that the efficiency of the consensus mechanism can be further improved; on the other hand, the characteristic that the balanced binary tree is automatically adjusted to be balanced can ensure that the balanced structure of the binary tree is stabilized at a certain level, thereby reducing the influence of the change of the number of nodes on the performance of the blockchain network and reducing the cost of manually maintaining the blockchain network.
Based on the above fragmentation method based on the ordered balanced binary tree, an embodiment of the present invention further provides a fragmentation device based on the ordered balanced binary tree, where a structural block diagram of the fragmentation device is shown in fig. 5, and the fragmentation device includes:
a first judgment module 401, a sending and receiving module 402 and a determining and joining module 403.
Wherein the content of the first and second substances,
the first determining module 401 is configured to determine, when a request for a target node to join a target network is received, whether the target node is a first node of the target network;
the sending and receiving module 402 is configured to send the request to each node in a target block chain of the target network if the target block chain is not the target block chain, and receive a response of each node to the request, where each node in the target block chain forms a target balanced binary tree;
the determining and adding module 403 is configured to determine a target subtree node of the target balanced binary tree according to the response, and add the target node to the target subtree node.
The invention discloses a slicing device based on an ordered balanced binary tree, which comprises: when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network; if not, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree; and determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node. The above-mentioned slicing device makes up every node in the said target block chain into the said target balanced binary tree, every slicing can process the trade in parallel, slicing technology can improve the concurrency of trade processing and confirming, and then can improve the throughput of the said target block chain.
In this embodiment of the present invention, the slicing apparatus further includes:
a second decision block 404 and a determination and adjustment block 405.
Wherein the content of the first and second substances,
the second judging module 404 is configured to judge whether the binary tree balanced with the target is unbalanced;
the determining and adjusting module 405 is configured to determine a minimum imbalance sub-tree in the target binary balanced tree and adjust the target binary balanced tree according to the minimum imbalance sub-tree if yes.
In this embodiment of the present invention, the determining and joining module 405 includes:
a first determination unit 406 and a second determination unit 407.
Wherein the content of the first and second substances,
the first determining unit 406 is configured to determine, according to the response, network distances between the target node and each sub-tree in the target balanced binary tree;
the second determining unit 407 is configured to select a shortest network distance from the network distances, where a sub-tree node corresponding to the shortest network distance is the target sub-tree node.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The fragmentation method and device based on the ordered balanced binary tree provided by the invention are introduced in detail, specific examples are applied in the text to explain the principle and the implementation mode of the invention, and the description of the above embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A fragmentation method based on an ordered balanced binary tree is characterized by comprising the following steps:
when a request of a target node for joining a target network is received, judging whether the target node is a first node of the target network;
if not, sending the request to each node in a target block chain of the target network, and receiving the response of each node to the request, wherein each node in the target block chain forms a target balanced binary tree;
and determining a target subtree node of the target balanced binary tree according to the response, and adding the target node into the target subtree node.
2. The method of claim 1, further comprising:
if the target node is the head node of the target network, constructing the target block chain according to the target node;
initializing the target block chain.
3. The method of claim 1, further comprising:
judging whether the binary tree balanced with the target is unbalanced;
and if so, determining a minimum imbalance sub-tree in the target balanced binary tree, and adjusting the target balanced binary tree according to the minimum imbalance sub-tree.
4. The method of claim 1, wherein determining a target sub-tree node of the target balanced binary tree based on the response, and wherein adding the target node to the target sub-tree node comprises:
determining the network distance between the target node and each subtree in the target balanced binary tree according to the response;
and selecting the shortest network distance from the network distances, wherein the subtree node corresponding to the shortest network distance is the target subtree node.
5. The method of claim 1, further comprising:
when detecting that any node leaves the target block chain, judging whether the any node is a leaf node;
if yes, directly leaving, or;
if not, selecting the node with the highest height from the left sub-tree and the right sub-tree corresponding to the arbitrary node in sequence to replace the arbitrary node, or;
and if the heights of the left subtree and the right subtree corresponding to the arbitrary node are equal, selecting the left subtree corresponding to the arbitrary node by default.
6. The method of claim 1, further comprising:
when the nodes of both trading parties in the target block chain trade, acquiring the positions of the nodes of both trading parties in the target balanced binary tree;
determining the minimum public father node of the nodes of the two transaction parties according to the position;
and after consensus is completed according to the minimum public father node, broadcasting the generated target block by the root node of the partition corresponding to the trading bilateral node.
7. The method of claim 1, further comprising:
and distributing a weighting factor for each node in the target block chain.
8. A slicing device based on ordered balanced binary tree is characterized by comprising:
the first judgment module is used for judging whether a target node is a first node of a target network or not when a request of the target node for joining the target network is received;
a sending and receiving module, configured to send the request to each node in a target block chain of the target network if the node in the target block chain is not in the target network, and receive a response of each node to the request, where each node in the target block chain forms a target balanced binary tree;
and the determining and adding module is used for determining a target subtree node of the target balanced binary tree according to the response and adding the target node into the target subtree node.
9. The apparatus of claim 8, further comprising:
the second judgment module is used for judging whether the binary tree is unbalanced with the target balance;
and if so, determining a minimum imbalance sub-tree in the target balanced binary tree, and adjusting the target balanced binary tree according to the minimum imbalance sub-tree.
10. The apparatus of claim 8, wherein the determine and join module comprises:
a first determining unit, configured to determine, according to the response, a network distance between the target node and each sub-tree in the target balanced binary tree;
and the second determining unit is used for selecting the shortest network distance from the network distances, and the subtree node corresponding to the shortest network distance is the target subtree node.
CN201911316122.0A 2019-12-19 2019-12-19 Fragmentation method and device based on ordered balanced binary tree Active CN111083052B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911316122.0A CN111083052B (en) 2019-12-19 2019-12-19 Fragmentation method and device based on ordered balanced binary tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911316122.0A CN111083052B (en) 2019-12-19 2019-12-19 Fragmentation method and device based on ordered balanced binary tree

Publications (2)

Publication Number Publication Date
CN111083052A true CN111083052A (en) 2020-04-28
CN111083052B CN111083052B (en) 2022-01-28

Family

ID=70315598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911316122.0A Active CN111083052B (en) 2019-12-19 2019-12-19 Fragmentation method and device based on ordered balanced binary tree

Country Status (1)

Country Link
CN (1) CN111083052B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111769946A (en) * 2020-05-08 2020-10-13 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN111835572A (en) * 2020-07-23 2020-10-27 上海优扬新媒信息技术有限公司 Communication method and device of block chain network
WO2023109627A1 (en) * 2021-12-17 2023-06-22 深圳先进技术研究院 Distributed system sharding method and apparatus, electronic device, and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276374A (en) * 2007-03-30 2008-10-01 索尼株式会社 Content management apparatus, image display apparatus, image pickup apparatus and processing method
CN101582826A (en) * 2009-06-25 2009-11-18 北京洲洋伟业信息技术有限公司 Data transmission method based on dynamic binary tree child-nephew two-channel in internet classroom
WO2018019364A1 (en) * 2016-07-26 2018-02-01 NEC Laboratories Europe GmbH Method for controlling access to a shared resource
CN108847925A (en) * 2018-06-20 2018-11-20 深圳大学 A kind of fragment block chain generation method based on tree
CN108846133A (en) * 2018-07-04 2018-11-20 东北大学 Block chain storage organization based on B-M tree, B-M tree establish algorithm and lookup algorithm
CN109146447A (en) * 2018-07-09 2019-01-04 矩阵元技术(深圳)有限公司 The transparent sharding method of block chain, apparatus and system
CN109445763A (en) * 2018-10-25 2019-03-08 长沙新弘软件有限公司 A kind of non-equilibrium binary tree building method calculated based on two points of boundary values
CN109544334A (en) * 2018-10-22 2019-03-29 绿州蔚来(深圳)控股有限公司 A kind of network scalability block chain implementation method
CN109559120A (en) * 2018-12-03 2019-04-02 国网电子商务有限公司 Block chain common recognition method, system, storage medium and electronic equipment based on weight
US20190116047A1 (en) * 2015-06-02 2019-04-18 ALTR Solutions, Inc. Using a tree structure to segment and distribute records across one or more decentralized, acylic graphs of cryptographic hash pointers
CN110011788A (en) * 2019-04-10 2019-07-12 深圳市网心科技有限公司 A kind of data processing method based on block chain, system and relevant device
CN110505305A (en) * 2019-08-27 2019-11-26 深圳市网心科技有限公司 A kind of block chain sharding method, device and block catenary system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276374A (en) * 2007-03-30 2008-10-01 索尼株式会社 Content management apparatus, image display apparatus, image pickup apparatus and processing method
CN101582826A (en) * 2009-06-25 2009-11-18 北京洲洋伟业信息技术有限公司 Data transmission method based on dynamic binary tree child-nephew two-channel in internet classroom
US20190116047A1 (en) * 2015-06-02 2019-04-18 ALTR Solutions, Inc. Using a tree structure to segment and distribute records across one or more decentralized, acylic graphs of cryptographic hash pointers
WO2018019364A1 (en) * 2016-07-26 2018-02-01 NEC Laboratories Europe GmbH Method for controlling access to a shared resource
CN108847925A (en) * 2018-06-20 2018-11-20 深圳大学 A kind of fragment block chain generation method based on tree
CN108846133A (en) * 2018-07-04 2018-11-20 东北大学 Block chain storage organization based on B-M tree, B-M tree establish algorithm and lookup algorithm
CN109146447A (en) * 2018-07-09 2019-01-04 矩阵元技术(深圳)有限公司 The transparent sharding method of block chain, apparatus and system
CN109544334A (en) * 2018-10-22 2019-03-29 绿州蔚来(深圳)控股有限公司 A kind of network scalability block chain implementation method
CN109445763A (en) * 2018-10-25 2019-03-08 长沙新弘软件有限公司 A kind of non-equilibrium binary tree building method calculated based on two points of boundary values
CN109559120A (en) * 2018-12-03 2019-04-02 国网电子商务有限公司 Block chain common recognition method, system, storage medium and electronic equipment based on weight
CN110011788A (en) * 2019-04-10 2019-07-12 深圳市网心科技有限公司 A kind of data processing method based on block chain, system and relevant device
CN110505305A (en) * 2019-08-27 2019-11-26 深圳市网心科技有限公司 A kind of block chain sharding method, device and block catenary system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHIN MORISHIMA等: ""Accelerating Blockchain Search of Full Nodes Using GPUs"", 《IEEE》 *
朝歌1122: ""区块链- Merkle树"", 《HTTPS://BLOG.CSDN.NET/QQ_40452317/ARTICLE/DETAILS/90482721》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111769946A (en) * 2020-05-08 2020-10-13 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN111769946B (en) * 2020-05-08 2022-08-19 贵阳信息技术研究院(中科院软件所贵阳分部) Large-scale node capacity expansion method for alliance chain
CN111835572A (en) * 2020-07-23 2020-10-27 上海优扬新媒信息技术有限公司 Communication method and device of block chain network
CN111835572B (en) * 2020-07-23 2023-01-13 度小满科技(北京)有限公司 Communication method and device of block chain network
WO2023109627A1 (en) * 2021-12-17 2023-06-22 深圳先进技术研究院 Distributed system sharding method and apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
CN111083052B (en) 2022-01-28

Similar Documents

Publication Publication Date Title
CN111083052B (en) Fragmentation method and device based on ordered balanced binary tree
CN109146447B (en) Transparent block chain slicing method, device and system
CN110602148B (en) Method and device for generating state tree of block and verifying data on chain
CN109472572B (en) Contract system based on block chain main chain and parallel multiple sub-chains
CN109033422B (en) Method and device for generating block chain and block chain
US20190081793A1 (en) Parallel-chain architecture for blockchain systems
CN112041871A (en) Block chain network partitioning
CN114401150A (en) Method for adding node in block chain network and block chain system
JP5391207B2 (en) Application description system and method for manageable and efficient expansion deployment
CN109493052B (en) Cross-chain contract system based on main chain and parallel multiple sub-chains
CN112101942B (en) Transaction request processing method, system, device and equipment based on block chain
CN109358971B (en) Rapid and load-balancing service function chain deployment method in dynamic network environment
CN109981279B (en) Block chain system, communication method, device, equipment and medium
CN112217683B (en) Cross-heterogeneous chain data reachability processing method, system, medium, equipment and terminal
CN110771127A (en) Method and system for consistent distributed memory pools in blockchain networks
CN105827410A (en) Block chain transmission method and system with trusted node/satellite node construction
US10761869B2 (en) Cloud platform construction method and cloud platform storing image files in storage backend cluster according to image file type
CN110809042A (en) Intelligent contract fragmentation storage method based on de bruijn sequence generation technology
CN111640018B (en) Block chain transaction existence verification method and device
US9106629B2 (en) Distributed algorithm for changing a shared value
CN105141681A (en) RPKI file synchronizing method and device
CN112417001A (en) Data processing method based on block chain network and related equipment
CN111835572A (en) Communication method and device of block chain network
CN103297542A (en) Operating system bus and balancing method supporting online expansion and retraction of components
CN110730241B (en) Global scale oriented blockchain infrastructure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 401121 b7-7-2, Yuxing Plaza, No.5 Huangyang Road, Yubei District, Chongqing

Applicant after: Chongqing duxiaoman Youyang Technology Co.,Ltd.

Address before: 201800 room j1328, 3 / F, building 8, 55 Huiyuan Road, Jiading District, Shanghai

Applicant before: SHANGHAI YOUYANG NEW MEDIA INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211221

Address after: 100193 Room 606, 6 / F, building 4, West District, courtyard 10, northwest Wangdong Road, Haidian District, Beijing

Applicant after: Du Xiaoman Technology (Beijing) Co.,Ltd.

Address before: 401121 b7-7-2, Yuxing Plaza, No.5 Huangyang Road, Yubei District, Chongqing

Applicant before: Chongqing duxiaoman Youyang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant