CN117811999B - Node data processing method and device of block chain network system - Google Patents

Node data processing method and device of block chain network system Download PDF

Info

Publication number
CN117811999B
CN117811999B CN202410223709.1A CN202410223709A CN117811999B CN 117811999 B CN117811999 B CN 117811999B CN 202410223709 A CN202410223709 A CN 202410223709A CN 117811999 B CN117811999 B CN 117811999B
Authority
CN
China
Prior art keywords
node
routing table
nodes
child
ary
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
CN202410223709.1A
Other languages
Chinese (zh)
Other versions
CN117811999A (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.)
Peking University
China Academy of Information and Communications Technology CAICT
Original Assignee
Peking University
China Academy of Information and Communications Technology CAICT
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 Peking University, China Academy of Information and Communications Technology CAICT filed Critical Peking University
Priority to CN202410223709.1A priority Critical patent/CN117811999B/en
Publication of CN117811999A publication Critical patent/CN117811999A/en
Application granted granted Critical
Publication of CN117811999B publication Critical patent/CN117811999B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/48Routing tree calculation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/44Star or tree networks
    • 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/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the disclosure discloses a node data processing method and device of a blockchain network system, wherein the method comprises the following steps: configuring a plurality of network nodes of the blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbone nodes; generating a plurality of k-way balance trees based on a plurality of service nodes and a plurality of backbone nodes, and configuring a first routing table and a second routing table for each node of the k-way balance trees in a medium-order traversing mode; responding to a node joining request received by a first node, and acquiring a first routing table of the first node and a second routing table of the first node; and determining the node joining position of the second node in the k-fork balance tree based on the first routing table of the first node and the second routing table of the first node. The embodiment of the disclosure can improve the throughput and the stability of the blockchain system, and can receive the addition of a new node on the premise of ensuring the balance stability of the k fork balance tree.

Description

Node data processing method and device of block chain network system
Technical Field
The disclosure relates to the technical field of blockchain, in particular to a node data processing method and device of a blockchain network system.
Background
The narrow blockchain is a chain data structure formed by combining data blocks in a sequential connection manner according to a time sequence, and is a distributed ledger which is not tamperable and not falsified and ensured in a cryptographic manner. The generalized blockchain technology is a brand new distributed infrastructure and calculation paradigm for verifying and storing data by utilizing a block chain data structure, generating and updating the data by utilizing a distributed node consensus algorithm, ensuring the safety of data transmission and access by utilizing a cryptography mode, and programming and operating the data by utilizing an intelligent contract consisting of an automatic script code.
In a blockchain system, a client node generally directly forwards a transaction to a consensus node, so that the consensus node needs to maintain a large number of connections, not only consumes additional bandwidth, but also spends additional computing resources for screening and filtering the transaction, and becomes a brake for improving the throughput of the system.
Disclosure of Invention
The embodiment of the disclosure provides a node data processing method and device of a block chain network system, so as to solve the problems.
In a first aspect of an embodiment of the present disclosure, a node data processing method of a blockchain network system is provided, including:
Configuring a plurality of network nodes of a blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbone nodes, wherein each network node is configured into one of the super nodes, the service nodes and the backbone nodes, the super nodes are consensus nodes, the service nodes are non-consensus nodes, the backbone nodes are all full nodes, the service nodes store full data of the blockchain system, and each backbone node is connected with the corresponding super nodes through the corresponding service nodes;
Generating a plurality of k-way balance trees based on a plurality of service nodes and a plurality of backbone nodes, and configuring a first routing table and a second routing table for each node of the k-way balance trees in a medium-order traversing mode, wherein the first routing table of each node stores node information of each node in a first routing direction, the second routing table of each node stores node information of each node in a second routing direction, and k is an integer larger than 1;
Responding to a first node receiving a node joining request, acquiring a first routing table of the first node and a second routing table of the first node, wherein the first node is one node in the k-fork balanced tree, and the node joining request comprises: requesting to join a second node of the blockchain system;
And determining a node joining position of the second node in the k-fork balance tree based on the first routing table of the first node and the second routing table of the first node.
In some embodiments of the disclosure, the determining, based on the first routing table of the first node and the second routing table of the first node, a node joining position of the second node in the k-ary balanced tree includes:
if the number of nodes of the first routing table of the first node is smaller than a first number threshold or the number of nodes of the second routing table of the first node is smaller than a second number threshold, acquiring a first routing table and a second routing table of a father node of the first node;
and determining the node joining position of the second node in the k-fork balance tree based on the first routing table and the second routing table of the father node of the first node.
In some embodiments of the present disclosure, the first routing table and the second routing table of each node in the k-ary balanced tree each store child node information of each routing node;
the determining, based on the first routing table of the first node and the second routing table of the first node, a node joining position of the second node in the k-fork balanced tree, further includes:
If the number of nodes of the first routing table of the first node is equal to the first number threshold, and the number of nodes of the second routing table of the first node is equal to the second number threshold, a first node set is obtained, wherein the nodes in the first node set include: the first routing table of the first node and the second routing table of the first node are provided with nodes with the number of sub-nodes smaller than k;
Calculating delay pairs between the second node and each node in the first node set respectively to obtain a plurality of delay pairs;
Determining a target node from the first set of nodes based on a numerical relationship between the plurality of delay pairs;
And determining the child node of the target node as a node joining position of the second node in the k-fork balanced tree.
In some embodiments of the present disclosure, after the determining, based on the first routing table of the first node and the second routing table of the first node, a node joining position of the second node in the k-ary balanced tree, further includes:
After the second node is added into the k-way balance tree, updating a first routing table and a second routing table of the associated node based on the routing relation between the second node and the associated node in the k-way balance tree, and generating the first routing table and the second routing table of the second node.
In some embodiments of the present disclosure, after the determining, based on the first routing table of the first node and the second routing table of the first node, a node joining position of the second node in the k-ary balanced tree, further includes:
responding to receiving an exit request of a third node, and acquiring child node information of the third node and child node information of nodes in the first routing table of the third node and the second routing table of the third node based on the first routing table of the third node and the second routing table of the third node, wherein the third node is one node in the k-way balance tree;
and if the third node does not have a child node based on the child node information of the third node, and the first routing table of the third node and the node in the second routing table of the third node do not have a child node based on the child node information in the first routing table of the third node and the second routing table of the third node, controlling the third node to leave the k-fork balance tree, and updating the first routing table and the second routing table of the associated node of the third node.
In some embodiments of the present disclosure, after the obtaining, based on the first routing table of the third node and the second routing table of the third node, child node information of the third node, and child node information of a node in the first routing table of the third node and the second routing table of the third node, the method further includes:
If the third node is determined to have at least one child node based on the child node information of the third node, determining a first alternative node of the third node based on the network delay of the at least one child node;
And controlling the third node to leave the k-fork balance tree, controlling the first replacing node to replace the original position of the third node, and updating a first routing table and a second routing table of the third node and the associated node of the first replacing node, wherein the original position of the third node is: the third node is located in the k-ary balanced tree before exiting the k-ary balanced tree.
In some embodiments of the present disclosure, after the obtaining, based on the first routing table of the third node and the second routing table of the third node, child node information of the third node, and child node information of a node in the first routing table of the third node and the second routing table of the third node, the method further includes:
If it is determined that the third node has no child node based on the child node information of the third node, and a second node set is obtained based on the child node information in the first routing table of the third node and the second routing table of the third node, where the nodes in the second node set include: the number of the sub-nodes in the first routing table of the third node and the second routing table of the third node is more than 0 and less than k;
Determining a second alternative node for the third node based on the network delay of each node in the second set of nodes;
and controlling the third node to leave the k-fork balance tree, controlling the second replacing node to replace the original position of the third node, and updating a first routing table and a second routing table of the associated nodes of the third node and the second replacing node.
In some embodiments of the present disclosure, after the determining, based on the first routing table of the first node and the second routing table of the first node, a node joining position of the second node in the k-ary balanced tree, further includes:
In response to detecting that a fourth node leaves the k-ary balanced tree, determining a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree based on the first routing table and the second routing table of the fourth node's associated node;
determining a third alternative node based on a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree, wherein the third alternative node is an alternative node of the fourth node;
And controlling the third replacement node to replace the original position of the fourth node, and updating a first routing table and a second routing table of the fourth node and the associated node of the third replacement node.
In some embodiments of the present disclosure, before the generating a plurality of k-way balanced trees based on the plurality of service nodes and the plurality of backbone nodes, and configuring each node of the k-way balanced trees with a first routing table and a second routing table in a medium-order traversal manner, before the first routing table of each node stores node information of each node in a first routing direction, the method further includes:
the k value is determined based on a preset duty cycle threshold of the messaging of the k-ary balanced tree in the messaging and node maintenance.
In a second aspect of the embodiments of the present disclosure, there is provided a node data processing apparatus of a blockchain network system, including:
the node configuration module is used for configuring a plurality of network nodes of the blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbone nodes, wherein each network node is configured into one of the super nodes, the service nodes and the backbone nodes, the super nodes are consensus nodes, the service nodes are non-consensus nodes, the backbone nodes are all full nodes, the service nodes store the full data of the blockchain system, and each backbone node is connected with the corresponding super nodes through the corresponding service node;
The balance tree generation module is used for generating a plurality of k-way balance trees based on a plurality of service nodes and a plurality of backbone nodes, and configuring a first routing table and a second routing table for each node of the k-way balance trees in a medium-order traversing mode, wherein the first routing table of each node stores node information of each node in a first routing direction, the second routing table of each node stores node information of each node in a second routing direction, and k is an integer larger than 1;
the node management module is configured to obtain a first routing table of a first node and a second routing table of the first node in response to the first node receiving a node joining request, where the first node is one node in the k-ary balanced tree, and the node joining request includes: requesting to join a second node of the blockchain system; the node management module is further configured to determine a node joining position of the second node in the k-ary balanced tree based on the first routing table of the first node and the second routing table of the first node.
In some embodiments of the present disclosure, the node management module is configured to obtain a first routing table and a second routing table of a parent node of the first node if a number of nodes of the first routing table of the first node is less than a first number threshold, or a number of nodes of the second routing table of the first node is less than a second number threshold; the node management module is further configured to determine a node joining position of the second node in the k-ary balanced tree based on the first routing table and the second routing table of the parent node of the first node.
In some embodiments of the present disclosure, the first routing table and the second routing table of each node in the k-ary balanced tree each store child node information of each routing node;
The node management module is configured to obtain a first node set if the number of nodes in a first routing table of the first node is equal to the first number threshold, and the number of nodes in a second routing table of the first node is equal to the second number threshold, where nodes in the first node set include: the first routing table of the first node and the second routing table of the first node are provided with nodes with the number of sub-nodes smaller than k; the node management module is further configured to calculate a delay pair between the second node and each node in the first node set, obtain a plurality of delay pairs, and determine a target node from the first node set based on a numerical relationship between the plurality of delay pairs; the node management module is further configured to determine a child node of the target node as a node joining location of the second node in the k-ary balanced tree.
In some embodiments of the present disclosure, the node management module is configured to update a first routing table and a second routing table of an associated node based on a routing relationship between the second node and the associated node in the k-ary balanced tree after the second node joins the k-ary balanced tree, and generate the first routing table and the second routing table of the second node.
In some embodiments of the present disclosure, the node management module is configured to, in response to receiving an exit request of a third node, obtain child node information of the third node and child node information of nodes in the first routing table of the third node and the second routing table of the third node based on the first routing table of the third node and the second routing table of the third node, where the third node is one node in the k-way balanced tree; the node management module is further configured to, if it is determined that the third node has no child node based on child node information of the third node, and it is determined that the node in the first routing table of the third node and the second routing table of the third node has no child node based on child node information in the first routing table of the third node and the second routing table of the third node, control the third node to leave the k-ary balanced tree, and update the first routing table and the second routing table of the associated node of the third node.
In some embodiments of the disclosure, the node management module is configured to determine a first alternative node for the third node based on a network delay of at least one child node if it is determined that the third node has the at least one child node based on child node information of the third node; the node management module is further configured to control the third node to leave the k-ary balanced tree, control the first substitute node to replace an original position of the third node, and update a first routing table and a second routing table of the third node and an associated node of the first substitute node, where the original position of the third node is: the third node is located in the k-ary balanced tree before exiting the k-ary balanced tree.
In some embodiments of the present disclosure, the node management module is configured to, if it is determined that the third node has no child node based on child node information of the third node, obtain a second node set based on child node information in a first routing table of the third node and a second routing table of the third node, where a node in the second node set includes: the number of the sub-nodes in the first routing table of the third node and the second routing table of the third node is more than 0 and less than k; the node management module is further configured to determine a second alternative node for the third node based on the network delay of each node in the second set of nodes; the node management module is further configured to control the third node to leave the k-way balanced tree, control the second substitute node to replace an original position of the third node, and update a first routing table and a second routing table of associated nodes of the third node and the second substitute node.
In some embodiments of the disclosure, the node management module is configured to determine, in response to detecting that a fourth node leaves the k-ary balanced tree, a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree based on a first routing table and a second routing table of an associated node of the fourth node; the node management module is further configured to determine a third alternative node based on the first routing table and the second routing table of the fourth node before leaving the k-ary balanced tree, where the third alternative node is an alternative node of the fourth node; the node management module is further used for controlling the third replacement node to replace the original position of the fourth node, and updating a first routing table and a second routing table of the fourth node and the associated node of the third replacement node.
In some embodiments of the present disclosure, the balanced tree generation module is further configured to determine a k value based on a preset duty cycle threshold of messaging of the k-ary balanced tree in the messaging and node maintenance.
In a third aspect of the disclosed embodiments, there is provided an electronic device, including:
A memory for storing a computer program product;
A processor for executing the computer program product stored in the memory, and when the computer program product is executed, implementing the method according to the first aspect.
In a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method of the first aspect described above.
The node data processing method and device of the blockchain network system configure network nodes of the blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbones. The super nodes are responsible for completing consensus, the service nodes are non-consensus nodes, and the backbone nodes are all full nodes. Because the service node stores the full quantity of copies, a layer of global transaction filtering pool is formed on the periphery of the super node through the service node, and the phenomenon that a large number of backbone nodes are directly connected to the super node to send transactions is avoided, so that the super node needs to spend a large number of resources to filter garbage transactions and repeated transactions, and the throughput of the system and the stability of the nodes are affected. In addition, a plurality of k-way balanced trees with stable networking, data transmission and robustness are generated by a plurality of service nodes and a plurality of backbone nodes, and two routing tables with different routing directions are set for each node of the k-way balanced tree based on a medium-order traversal mode. When a new node wants to join a k-fork balance tree of a blockchain system, the new node needs to send a node joining request through one node in the k-fork balance tree, and the joining position of the new node in the k-fork balance tree is determined according to two routing tables of the node receiving the request, so that the joining of the new node can be received on the premise of ensuring the balance stability of the k-fork balance tree. The embodiment of the disclosure can be applied to the scene of the alliance chain network, namely, the node data of the alliance chain network system can be processed.
The technical scheme of the present disclosure is described in further detail below through the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The disclosure may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of a method of node data processing in a block chain network system in some embodiments of the present disclosure;
FIG. 2 is a schematic diagram of a supernode, a service node, and a backbone node in some examples of the present disclosure;
FIG. 3 is a schematic diagram of a k-ary balanced tree in some examples of the present disclosure;
FIG. 4 is a block diagram of a node data processing apparatus of a block chain network system in some embodiments of the present disclosure;
Fig. 5 is a block diagram of an electronic device in some embodiments of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
It will be appreciated by those of skill in the art that the terms "first," "second," etc. in embodiments of the present disclosure are used merely to distinguish between different steps, devices or modules, etc., and do not represent any particular technical meaning nor necessarily logical order between them.
It should also be understood that in embodiments of the present disclosure, "plurality" may refer to two or more, and "at least one" may refer to one, two or more.
It should also be appreciated that any component, data, or structure referred to in the presently disclosed embodiments may be generally understood as one or more without explicit limitation or the contrary in the context.
In addition, the term "and/or" in this disclosure is merely an association relationship describing an association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the front and rear association objects are an or relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and that the same or similar features may be referred to each other, and for brevity, will not be described in detail.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Embodiments of the present disclosure may be applicable to electronic devices such as terminal devices, computer systems, servers, etc., which may operate with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with the terminal device, computer system, server, or other electronic device include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments that include any of the foregoing, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server may be implemented in a distributed cloud computing environment in which tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
Fig. 1 is a flow chart of a node data processing method of a block chain network system in some embodiments of the present disclosure. The embodiment of the disclosure can be applied to the scene of the alliance chain network, namely, the node data of the alliance chain network system can be processed. As shown in fig. 1, the node data processing method of the blockchain network system may include the following steps:
S1: the plurality of network nodes of the blockchain system are configured as a plurality of supernodes, a plurality of service nodes, and a plurality of backbone nodes.
Wherein each network node is configured as one of a super node, a service node, and a backbone node. The super nodes are consensus nodes, the service nodes are non-consensus nodes, the backbone nodes are all full nodes, and the service nodes store full data of the block chain system. Each backbone node is connected with a corresponding super node through a corresponding service node.
Fig. 2 is a schematic diagram of a supernode, a service node, and a backbone node in some examples of the present disclosure. As shown in FIG. 2, network nodes in a blockchain system are divided into three major classes, super nodes, service nodes, and backbone nodes. The super nodes are responsible for completing consensus, are sources of transaction transmission destinations and block generation, and are organized in a full-link mode. The service node and the backbone node are non-consensus nodes and full nodes in the network, and are divided into different service domains according to different responsible services, and the function of a full-network transaction entrance is born. The number of backbone nodes is greater than the number of service nodes. Because the service node stores the full quantity of copies, a layer of global transaction filtering pool is formed on the periphery of the super node through the service node, and the phenomenon that a large number of backbone nodes are directly connected to the super node to send transactions is avoided, so that the super node needs to spend a large number of resources to filter garbage transactions and repeated transactions, and the throughput of the system and the stability of the nodes are affected.
S2: based on a plurality of service nodes and a plurality of backbone nodes, a plurality of k-way balance trees are generated, and a first routing table and a second routing table are configured for each node of the k-way balance trees in a medium order traversal mode.
The first routing table of each node stores node information of each node in a first routing direction, the second routing table of each node stores node information of each node in a second routing direction, and k is an integer greater than 1.
Fig. 3 is a schematic diagram of a k-ary balanced tree in some examples of the present disclosure. As shown in fig. 3, each node in the k-ary balanced tree is configured with a Level attribute and a Number attribute. For example, node I is at the second Level in the k-ary balanced tree, then its Level attribute has a value of 2. The Number attribute indicates the Number of the node in the same-layer lateral direction, for example, the node I is in the position of Number 5 in the ring-like network, and the value of the Number attribute is 5.
In addition, each node in the k-ary balanced tree is also configured with a Parent attribute that indicates the Parent node in the vertical k-ary balanced tree structure, and is also the default data source for that node. For example, if the Parent node of the node I in the k-ary balanced tree structure is node C, the value of the Parent attribute is C.
Each node in the k-ary balanced tree is also configured with CHILDLIST attributes that represent the child nodes of that node in the longitudinal k-ary balanced tree structure. For example, node I has no child node, then the value of this attribute is Null; node C has H, I and J child nodes, then its attribute values are H, I and J.
Each node in the k-ary balanced tree is further configured with LeftAdjacent nodes and RightAdjacent nodes, which respectively represent left and right neighbor nodes of the node in the "middle-order traversal", wherein the order of the "middle-order traversal" is that the leftmost child node is traversed first, then the root node is traversed, then the second node from left, the third node from left and so on are traversed. The result of the medium-order traversal in fig. 3 is EBFGAHCIJKDLM. Then the value of the LeftAdjacent attribute of node I is C and the value of the RightAdjacent attribute is K.
Each node in the k-ary balanced tree is also configured with LeftTable (i.e., a first routing table) and RighTtable (i.e., a second routing table). Wherein Lefttable holds left side transverse routing connections numbered smaller than the current node and RightTable holds right side transverse routing connections numbered larger than the current node.
Considering that resources such as bandwidth of the node may have a certain difference under different service domains. The embodiment provides two different kinds of sparse and dense transverse routing so as to adapt to the service domain differences with different node construction forces.
Sparse lateral routing: each node maintains in LeftTable a node of the same level node numbered less than the current node k i (i=0, 1,2, 3.) where k is the number of branches of the current longitudinal balanced tree structure. For example, node H and node F are stored in the left routing table of node I. Each node maintains a node in RightTable of the same-level nodes that is numbered greater than current node k i. For example, in the right routing table of the node I, the node J and the node L are stored.
Dense lateral routing: each node stores the number less than the current node in the same-layer nodes in LeftTableWhere d is the incremental step size, k is the number of branches of the current longitudinal balanced tree structure, and n is an integer greater than 2. For example, nodes H, G and F are stored in the left-hand routing table of node I. Nodes J, K and L are saved in RightTable of node I.
S3: and responding to the first node receiving the node joining request, and acquiring a first routing table of the first node and a second routing table of the first node.
The first node is one node in a k-fork balanced tree, and the node joining request comprises: a second node is requested to join the blockchain system.
The second node may be a new node that wants to apply for joining the blockchain system. The new node wants to access the blockchain system, in particular to join a certain k-ary balanced tree, and needs to know at least one node, e.g. the first node, in the k-ary balanced tree.
The second node sends a node join request to the first node. After receiving the node joining request, the first node obtains LeftTable and RightTable of the first node.
S4: and determining the node joining position of the second node in the k-fork balance tree based on the first routing table of the first node and the second routing table of the first node.
From LeftTable and RightTable of the first node, a node join location in the k-way balanced tree is determined that is suitable for joining the second node.
In this embodiment, the network nodes of the blockchain system are configured as a plurality of supernodes, a plurality of service nodes, and a plurality of backbones. The super nodes are responsible for completing consensus, the service nodes are non-consensus nodes, and the backbone nodes are all full nodes. Because the service node stores the full quantity of copies, a layer of global transaction filtering pool is formed on the periphery of the super node through the service node, and the phenomenon that a large number of backbone nodes are directly connected to the super node to send transactions is avoided, so that the super node needs to spend a large number of resources to filter garbage transactions and repeated transactions, and the throughput of the system and the stability of the nodes are affected. In addition, a plurality of k-way balanced trees with stable networking, data transmission and robustness are generated by a plurality of service nodes and a plurality of backbone nodes, and two routing tables with different routing directions are set for each node of the k-way balanced tree based on a medium-order traversal mode. When a new node wants to join a k-fork balance tree of a blockchain system, the new node needs to send a node joining request through one node in the k-fork balance tree, and the joining position of the new node in the k-fork balance tree is determined according to two routing tables of the node receiving the request, so that the joining of the new node can be received on the premise of ensuring the balance stability of the k-fork balance tree.
In some embodiments of the present disclosure, step S4 may include:
S4-A-1: if the number of nodes of the first routing table of the first node is smaller than a first number threshold or the number of nodes of the second routing table of the first node is smaller than a second number threshold, the first routing table and the second routing table of the father node of the first node are obtained.
Wherein the first number threshold is a maximum number of nodes that may exist within LeftTable of the first node and the second number threshold is a maximum number of nodes that may exist within RightTable of the first node. For example, in fig. 3, for node I, when sparse lateral routing is used, the first number threshold is 2, and the second number threshold is also 2; when dense lateral routing is used, the first number threshold is 3 and the second number threshold is also 3.
When the number of nodes in LeftTable of the first node is less than the first number threshold, or the number of nodes in RightTable of the first node is less than the second number threshold, the number of nodes in LeftTable of the first node is not full, or the number of nodes in RightTable of the first node is not full, the same-level possible free position of the first node in the k-fork balance tree is represented as being used for accessing the new node, at which time a node joining request can be sent to a parent node of the first node, and LeftTable and RightTable of the parent node of the first node are acquired.
S4-A-2: and determining the node joining position of the second node in the k-fork balance tree based on the first routing table and the second routing table of the parent node of the first node.
From LeftTable and RightTable of the parent node of the first node, it is known that there may be free positions at the same level of the first node in the k-ary balanced tree.
In this embodiment, when the first routing table or the second routing table of the first node that receives the node joining request is not full, the node joining request is sent to the parent node of the first node, and the node joining position of the second node in the k-way balance tree is determined through the first routing table and the second routing table of the parent node of the first node.
In some embodiments of the present disclosure, the first routing table and the second routing table of each node in the k-ary balanced tree each store child node information of each routing node, i.e., CHILDLIST attributes above. Accordingly, step S4 may include:
S4-B-1: if the number of nodes of the first routing table of the first node is equal to a first number threshold, and the number of nodes of the second routing table of the first node is equal to a second number threshold, a first node set is obtained. That is, when the number of nodes in LeftTable and RightTable of the first node is full, all the nodes with the number of child nodes smaller than k in LeftTable and RightTable of the first node are acquired to form a first node set.
S4-B-2: and calculating delay pairs between the second node and each node in the first node set respectively to obtain a plurality of delay pairs.
S4-B-3: a target node is determined from the first set of nodes based on a numerical relationship between the plurality of delay pairs. For example, a delay pair with the smallest value is selected, and the node corresponding to the delay pair with the smallest value is determined as the target node.
S4-B-4: and determining the child node of the target node as the node joining position of the second node in the k-fork balance tree.
In this embodiment, when the first routing table and the second routing table of the first node are full, nodes with less than full number of child nodes are obtained from the first routing table and the second routing table of the first node to generate the first node set. According to the delay pair between the node in the first node set and the second node, the node joining position of the second node in the k-fork balance tree can be quickly and reasonably determined.
In addition, step S4 may further include:
S4-C: if the number of nodes of the first routing table of the first node is equal to a first number threshold, the number of nodes of the second routing table of the first node is equal to a second number threshold, and the number of child nodes of the first node is k, sending a node adding request to a neighbor node of the first node, and determining the node adding position of the second node in the k-way balance tree according to the first routing table and the second routing table of the neighbor node of the first node.
In some embodiments of the present disclosure, after step S4, it may further include:
s5: after the second node is added into the k-way balance tree, updating a first routing table and a second routing table of the associated node based on the routing relation between the second node and the associated node in the k-way balance tree, and generating the first routing table and the second routing table of the second node. Wherein the association node of the second node comprises: according to the routing strategy in the k-ary balanced tree, the nodes of the second node should be included in the first routing table and the second routing table. For example, in fig. 3, if the second node is node I, the associated nodes of the second node may include node H, node F, node J, and node L.
In this embodiment, after a new node is added to the k-ary balanced tree, a first routing table and a second routing table of an associated node of the new node are updated, and the first routing table and the second routing table of the new node are generated to ensure the working accuracy of the k-ary balanced tree.
In some embodiments of the present disclosure, after step S4, it may further include:
S6: and responding to the received exit request of the third node, and acquiring the child node information of the third node and the child node information of the nodes in the first routing table of the third node and the second routing table of the third node based on the first routing table of the third node and the second routing table of the third node. Wherein the third node is a node in the k-ary balanced tree.
S7-A: if the third node is determined to have no child node based on the child node information of the third node, and the first routing table of the third node and the node in the second routing table of the third node are determined to have no child node based on the child node information of the first routing table of the third node and the child node information of the second routing table of the third node, the third node is controlled to leave the k-ary balance tree, and the first routing table and the second routing table of the associated node of the third node are updated.
In some examples of the present disclosure, when the third node is a leaf node and none of the nodes LeftTable and RightTable of the third node is a child node, if the balance of the k-ary balanced tree is not affected after the third node leaves the k-ary balanced tree, that is, a situation that a layer height between different leaf nodes of the k-ary balanced tree is greater than or equal to 2 after the third node leaves the k-ary balanced tree does not occur, at this time, the third node can be controlled to leave the k-ary balanced tree, and LeftTable and RightTable of the third node associated node can be updated.
In this embodiment, when a certain leaf node in the k-way balanced tree wants to leave the k-way balanced tree, if the node in the first routing table and the node in the second routing table of the leaf node have no child node, the node can be controlled to leave the k-way balanced tree without affecting the balance of the k-way balanced tree, and the first routing table and the second routing table of the associated node of the leaf node can be updated.
In some embodiments of the present disclosure, after step S6, it may further include:
S7-B-1: if it is determined that the third node has at least one child node based on the child node information of the third node, a first alternative node of the third node is determined based on the network delay of the at least one child node.
S7-B-2: and controlling the third node to leave the k-way balance tree, controlling the first replacing node to replace the original position of the third node, and updating the first routing table and the second routing table of the third node and the associated node of the first replacing node. The original position of the third node is: the third node is located in the k-ary balanced tree before leaving the k-ary balanced tree.
As shown in fig. 3, when node C wants to leave the k-ary balanced tree and node C has at least one of child node H, child node I, and child node J, the network delay of all child nodes of node C is obtained. The child node with the smallest network delay may be determined as the first alternative node of node C, e.g. node I may be determined as the first alternative node of node C. When node C leaves the k-ary balanced tree, control node I replaces the original position of node C, the level of node I becomes 1, and nodes I, H, F, J, and L LeftTable and RightTable are updated.
In this embodiment, when a certain non-leaf node in the k-ary balanced tree wants to leave the k-ary balanced tree, a substitute node is determined according to the network delay of a child node of the non-leaf node, after the non-leaf node leaves the k-ary balanced tree, the substitute node replaces the original position of the non-leaf node, and updates the layer height of the substitute node, the first routing table and the second routing table of the substitute node, and the first routing table and the second routing table of the associated node of the substitute node, so that the balance of the k-ary balanced tree can be ensured.
In some embodiments of the present disclosure, after step S6, it may further include:
S7-C-1: if the third node is determined to have no child node based on the child node information of the third node, and the second node set is acquired based on the child node information in the first routing table of the third node and the second routing table of the third node. Wherein the nodes in the second set of nodes comprise: the first routing table of the third node and the second routing table of the third node have a number of sub-nodes greater than 0 and less than k.
S7-C-2: a second alternative node for the third node is determined based on the network delay for each node in the second set of nodes.
S7-C-3: and controlling the third node to leave the k-way balance tree, controlling the second replacement node to replace the original position of the third node, and updating the first routing table and the second routing table of the associated nodes of the third node and the second replacement node.
As shown in fig. 3, when the node I has no child nodes, and at least one of the nodes F, H, J, and L has child nodes, and the number of child nodes of the at least one node is not full (not shown in the figure), a second node set is generated by the at least one node. An alternative node (e.g., node F) for node I is determined based on the network delay for each node in the second set of nodes. After node I leaves the k-ary balanced tree, the original position of node I is replaced by the substitute node and the level of the substitute node is updated, as well as LeftTable and RightTable for node F, node H, node J, and node L.
In this embodiment, when a certain leaf node in the k-ary balanced tree wants to leave the k-ary balanced tree, and at least one node having child nodes and having an insufficient number of child nodes exists in the first routing table and the second routing table of the leaf node, the second node set is generated by the at least one node. The alternate node of the leaf node is determined based on the network delays of the nodes in the second set of nodes. After the leaf node leaves the k-way balance tree, the original position of the leaf node is replaced by the replacement node, the layer height of the replacement node, the first routing table and the second routing table of the replacement node, and the first routing table and the second routing table of the associated node of the replacement node are updated, and the balance of the k-way balance tree is ensured.
In some embodiments of the present disclosure, after step S4, it may further include:
S8: in response to detecting that the fourth node leaves the k-ary balanced tree, determining a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree based on the first routing table and the second routing table of the fourth node's associated node.
S9: a third alternative node is determined based on the first routing table and the second routing table of the fourth node before exiting the k-ary balanced tree. Wherein the third alternative node is an alternative node to the fourth node.
S10: and controlling the third replacement node to replace the original position of the fourth node, and updating the first routing table and the second routing table of the associated nodes of the fourth node and the third replacement node.
When the fourth node in the k-ary balanced tree suddenly leaves the k-ary balanced tree due to network failure such as downtime or other reasons, leftTable and RightTable of the fourth node are determined according to LeftTable and RightTable of the associated nodes of the fourth node, and a substitute node (i.e., a third substitute node) of the fourth node is determined according to LeftTable and RightTable of the fourth node. For example, in fig. 3 when node I suddenly leaves the k-ary balanced tree, nodes LeftTable and RightTable of node I can be determined from LeftTable and RightTable of node F, node H, node J, and node L. The replacement node for the node I may be determined according to LeftTable and RightTable of the node I in the manner of step S7, the original position of the node I is replaced by the replacement node, the layer height of the replacement node is updated, and LeftTable and RightTable of the node F, the node H, the node J, and the node L.
In this embodiment, when a certain node in the k-way balance tree suddenly leaves the k-way balance tree, the right of the first path and the second path of the suddenly-leaving node are determined according to the first path table and the second path table of the suddenly-leaving node, and then a substitute node is determined according to the right of the first path and the second path table of the suddenly-leaving node, the original position of the suddenly-leaving node is replaced by the substitute node, the layer height of the substitute node and the right of the first path and the second path table of the associated node of the substitute node are updated, and the stability and the balance of the k-way balance tree are ensured.
In some embodiments of the present disclosure, before step S2, it may further include: the k value is determined based on a preset duty cycle threshold for messaging of the k-ary balanced tree in messaging and node maintenance.
The larger the k value, the better the visual consideration, because the lower the height of the balanced tree is at this time for the same number of nodes. But the larger the k value, the more routing links that need to be maintained when a new node join, a node request leave, or a node suddenly leave occurs in the k-ary balanced tree. The present embodiment therefore proposes a calculation method for selecting a bifurcation tree of a vertical balance tree according to a network environment.
There are two main types of operations in the network: the first is messaging, where the complexity and k are related by. The second is maintenance operations when the blockchain network node changes, the complexity of which depends on the number of node cross-links. The calculation mode is given on the premise of dense transverse connection, and the relation between the complexity and the bifurcation number k is/>
Assume that the message sending operation occupies a proportion of(Set point), then the node maintenance operation is in proportion toIn fact/>Is a parameter that reflects the stability of the blockchain network. The average complexity in the entire blockchain network is:
By deriving C (k) and judging the existence of the extreme point, it can be obtained that C (k) has the extreme point and the extreme point is unique, so that the method can be based on substitution The value of k corresponding to the extreme point is obtained.
If sparse lateral routing is employed, the number of node lateral connections at this time isThe overall average complexity is: /(I)
By deriving C (k), it can be found that in the case of sparse transverse routing, the average complexity becomes smaller and smaller with increasing k, in which case the k value is selected depending on the bandwidth resources of the nodes in the traffic domain, and the larger the bandwidth resources, the larger the k value can be selected.
In this embodiment, the bifurcation value of the balanced tree can be reasonably determined by a preset duty ratio threshold value of the message transmission of the midpoint of the balanced tree to be established in the message transmission and the node maintenance.
Fig. 4 is a block diagram of a node data processing apparatus of a block chain network system in some embodiments of the present disclosure. As shown in fig. 4, a node data processing apparatus of a blockchain network system includes:
The node configuration module 100 is configured to configure a plurality of network nodes of the blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbone nodes, wherein each network node is configured as one of the super nodes, the service nodes and the backbone nodes, the super nodes are consensus nodes, the service nodes are non-consensus nodes, the backbone nodes are all full nodes, the service nodes store full data of the blockchain system, and each backbone node is connected with the corresponding super node through the corresponding service node;
The balanced tree generating module 200 is configured to generate a plurality of k-way balanced trees based on a plurality of service nodes and a plurality of backbone nodes, and configure a first routing table and a second routing table for each node of the k-way balanced trees in a middle-order traversal manner, where the first routing table of each node stores node information of each node in a first routing direction, the second routing table of each node stores node information of each node in a second routing direction, and k is an integer greater than 1;
The node management module 300 is configured to obtain, in response to a first node receiving a node joining request, a first routing table of the first node and a second routing table of the first node, where the first node is one node in a k-way balanced tree, and the node joining request includes: requesting to join a second node of the blockchain system; the node management module is further configured to determine a node joining location of the second node in the k-ary balanced tree based on the first routing table of the first node and the second routing table of the first node.
In some embodiments of the present disclosure, the node management module 300 is configured to obtain the first routing table and the second routing table of the parent node of the first node if the number of nodes of the first routing table of the first node is less than the first number threshold, or the number of nodes of the second routing table of the first node is less than the second number threshold; the node management module 300 is further configured to determine a node joining location of the second node in the k-ary balanced tree based on the first routing table and the second routing table of the parent node of the first node.
In some embodiments of the present disclosure, the first routing table and the second routing table of each node in the k-ary balanced tree each store child node information of each routing node;
The node management module 300 is configured to obtain a first node set if the number of nodes in a first routing table of the first node is equal to a first number threshold and the number of nodes in a second routing table of the first node is equal to a second number threshold, where the nodes in the first node set include: the method comprises the steps that a first routing table of a first node and a second routing table of the first node are provided with nodes with the number of sub-nodes smaller than k; the node management module 300 is further configured to calculate delay pairs between the second node and each node in the first node set, obtain a plurality of delay pairs, and determine a target node from the first node set based on a numerical relationship between the plurality of delay pairs; the node management module 300 is further configured to determine a child node of the target node as a node joining location of the second node in the k-way balanced tree.
In some embodiments of the present disclosure, the node management module 300 is configured to update the first routing table and the second routing table of the associated node based on the routing relationship between the second node and the associated node in the k-way balanced tree after the second node joins the k-way balanced tree, and generate the first routing table and the second routing table of the second node.
In some embodiments of the present disclosure, the node management module 300 is configured to, in response to receiving an exit request of a third node, obtain child node information of the third node based on a first routing table of the third node and a second routing table of the third node, and child node information of nodes in the first routing table of the third node and the second routing table of the third node, where the third node is one node in a k-way balanced tree; the node management module 300 is further configured to, if it is determined that the third node has no child node based on child node information of the third node, and it is determined that the node in the first routing table of the third node and the second routing table of the third node has no child node based on child node information in the first routing table of the third node and the second routing table of the third node, control the third node to leave the k-ary balanced tree, and update the first routing table and the second routing table of the associated node of the third node.
In some embodiments of the present disclosure, the node management module 300 is configured to determine, if it is determined that the third node has at least one child node based on child node information of the third node, a first alternative node of the third node based on a network delay of the at least one child node; the node management module 300 is further configured to control the third node to leave the k-way balanced tree, control the first replacement node to replace an original position of the third node, and update a first routing table and a second routing table of the third node and an associated node of the first replacement node, where the original position of the third node is: the third node is located in the k-ary balanced tree before leaving the k-ary balanced tree.
In some embodiments of the present disclosure, the node management module 300 is configured to, if it is determined that the third node has no child node based on child node information of the third node, obtain a second node set based on the first routing table of the third node and child node information in the second routing table of the third node, where a node in the second node set includes: the number of the sub-nodes in the first routing table of the third node and the second routing table of the third node is more than 0 and less than k; the node management module 300 is further configured to determine a second alternative node for the third node based on the network delay of each node in the second set of nodes; the node management module 300 is configured to control the third node to leave the k-way balanced tree, control the second replacement node to replace the original position of the third node, and update the first routing table and the second routing table of the third node and the associated node of the second replacement node.
In some embodiments of the present disclosure, the node management module 300 is configured to determine, in response to detecting that the fourth node leaves the k-ary balanced tree, a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree based on the first routing table and the second routing table of the fourth node's associated node; the node management module 300 is further configured to determine a third alternative node based on the first routing table and the second routing table of the fourth node before leaving the k-ary balanced tree, where the third alternative node is an alternative node of the fourth node; the node management module is also used for controlling the third alternative node to replace the original position of the fourth node and updating the first routing table and the second routing table of the associated nodes of the fourth node and the third alternative node.
In some embodiments of the present disclosure, the balanced tree generation module 200 is further configured to determine the k value based on a preset duty cycle threshold for messaging and node maintenance of the k-ary balanced tree messaging.
It should be noted that, the specific implementation of the node data processing apparatus of the blockchain network system in the embodiment of the disclosure is similar to the specific implementation of the node data processing method of the blockchain network system in the embodiment of the disclosure, and specific reference is made to the description of the node data processing method portion of the blockchain network system, so that redundancy is reduced and redundant description is omitted.
In addition, the embodiment of the disclosure also provides an electronic device, which comprises:
A memory for storing a computer program;
And a processor, configured to execute the computer program stored in the memory, and when the computer program is executed, implement the node data processing method of the blockchain network system according to any of the foregoing embodiments of the present disclosure.
Next, an electronic device according to an embodiment of the present disclosure is described with reference to fig. 5. As shown in fig. 5, the electronic device includes one or more processors and memory.
The processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device to perform the desired functions.
The memory may store one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or nonvolatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program products may be stored on the computer readable storage medium that can be run by a processor to implement the node data processing methods and/or other desired functions of the blockchain network system of the various embodiments of the present disclosure as described above.
In one example, the electronic device may further include: input devices and output devices, which are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
In addition, the input device may include, for example, a keyboard, a mouse, and the like.
The output device may output various information including the determined distance information, direction information, etc., to the outside. The output device may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 5 for simplicity, components such as buses, input/output interfaces, etc. being omitted. In addition, the electronic device may include any other suitable components depending on the particular application.
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps in the node data processing method of a blockchain network system according to the various embodiments of the present disclosure described in the above section of the present description.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium, having stored thereon computer program instructions, which when executed by a processor, cause the processor to perform the steps in the node data processing method of a blockchain network system according to various embodiments of the present disclosure described in the above section of the present description.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present disclosure have been described above in connection with specific embodiments, but it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, so that the same or similar parts between the embodiments are mutually referred to. For system embodiments, the description is relatively simple as it essentially corresponds to method embodiments, and reference should be made to the description of method embodiments for relevant points.
The block diagrams of the devices, apparatuses, devices, systems referred to in this disclosure are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above-described sequence of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the sequence specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present disclosure may also be implemented as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the apparatus, devices and methods of the present disclosure, components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered equivalent to the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (12)

1. A method for processing node data of a blockchain network system, comprising:
Configuring a plurality of network nodes of a blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbone nodes, wherein each network node is configured into one of the super nodes, the service nodes and the backbone nodes, the super nodes are consensus nodes, the service nodes are non-consensus nodes, the backbone nodes are all full nodes, the service nodes store full data of the blockchain system, and each backbone node is connected with the corresponding super nodes through the corresponding service nodes;
Generating a plurality of k-way balance trees based on a plurality of service nodes and a plurality of backbone nodes, and configuring a first routing table and a second routing table for each node of the k-way balance trees in a medium-order traversing mode, wherein the first routing table of each node stores node information of each node in a first routing direction, the second routing table of each node stores node information of each node in a second routing direction, and k is an integer larger than 1;
Responding to a first node receiving a node joining request, acquiring a first routing table of the first node and a second routing table of the first node, wherein the first node is one node in the k-fork balanced tree, and the node joining request comprises: requesting to join a second node of the blockchain system;
And determining a node joining position of the second node in the k-fork balance tree based on the first routing table of the first node and the second routing table of the first node.
2. The method of claim 1, wherein the determining a node joining location of the second node in the k-way balanced tree based on the first routing table of the first node and the second routing table of the first node comprises:
if the number of nodes of the first routing table of the first node is smaller than a first number threshold or the number of nodes of the second routing table of the first node is smaller than a second number threshold, acquiring a first routing table and a second routing table of a father node of the first node;
and determining the node joining position of the second node in the k-fork balance tree based on the first routing table and the second routing table of the father node of the first node.
3. The method of claim 2, wherein the first routing table and the second routing table of each node in the k-ary balanced tree each store child node information of each routing node;
the determining, based on the first routing table of the first node and the second routing table of the first node, a node joining position of the second node in the k-fork balanced tree, further includes:
If the number of nodes of the first routing table of the first node is equal to the first number threshold, and the number of nodes of the second routing table of the first node is equal to the second number threshold, a first node set is obtained, wherein the nodes in the first node set include: the first routing table of the first node and the second routing table of the first node are provided with nodes with the number of sub-nodes smaller than k;
Calculating delay pairs between the second node and each node in the first node set respectively to obtain a plurality of delay pairs;
Determining a target node from the first set of nodes based on a numerical relationship between the plurality of delay pairs;
And determining the child node of the target node as a node joining position of the second node in the k-fork balanced tree.
4. A method according to any of claims 1-3, characterized in that after said determining a node joining position of said second node in said k-ary balanced tree based on said first routing table of said first node and said second routing table of said first node, further comprises:
After the second node is added into the k-way balance tree, updating a first routing table and a second routing table of the associated node based on the routing relation between the second node and the associated node in the k-way balance tree, and generating the first routing table and the second routing table of the second node.
5. The method of claim 3, further comprising, after the determining the node joining location of the second node in the k-ary balanced tree based on the first routing table of the first node and the second routing table of the first node:
responding to receiving an exit request of a third node, and acquiring child node information of the third node and child node information of nodes in the first routing table of the third node and the second routing table of the third node based on the first routing table of the third node and the second routing table of the third node, wherein the third node is one node in the k-way balance tree;
and if the third node does not have a child node based on the child node information of the third node, and the first routing table of the third node and the node in the second routing table of the third node do not have a child node based on the child node information in the first routing table of the third node and the second routing table of the third node, controlling the third node to leave the k-fork balance tree, and updating the first routing table and the second routing table of the associated node of the third node.
6. The method of claim 5, further comprising, after the obtaining the child node information of the third node and the child node information of the nodes in the first routing table of the third node and the second routing table of the third node based on the first routing table of the third node and the second routing table of the third node:
If the third node is determined to have at least one child node based on the child node information of the third node, determining a first alternative node of the third node based on the network delay of the at least one child node;
And controlling the third node to leave the k-fork balance tree, controlling the first replacing node to replace the original position of the third node, and updating a first routing table and a second routing table of the third node and the associated node of the first replacing node, wherein the original position of the third node is: the third node is located in the k-ary balanced tree before exiting the k-ary balanced tree.
7. The method of claim 5, further comprising, after the obtaining the child node information of the third node and the child node information of the nodes in the first routing table of the third node and the second routing table of the third node based on the first routing table of the third node and the second routing table of the third node:
If it is determined that the third node has no child node based on the child node information of the third node, and a second node set is obtained based on the child node information in the first routing table of the third node and the second routing table of the third node, where the nodes in the second node set include: the number of the sub-nodes in the first routing table of the third node and the second routing table of the third node is more than 0 and less than k;
Determining a second alternative node for the third node based on the network delay of each node in the second set of nodes;
and controlling the third node to leave the k-fork balance tree, controlling the second replacing node to replace the original position of the third node, and updating a first routing table and a second routing table of the associated nodes of the third node and the second replacing node.
8. The method of any of claims 5-7, further comprising, after the determining a node joining location of the second node in the k-way balanced tree based on the first routing table of the first node and the second routing table of the first node:
In response to detecting that a fourth node leaves the k-ary balanced tree, determining a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree based on the first routing table and the second routing table of the fourth node's associated node;
determining a third alternative node based on a first routing table and a second routing table of the fourth node before leaving the k-ary balanced tree, wherein the third alternative node is an alternative node of the fourth node;
And controlling the third replacement node to replace the original position of the fourth node, and updating a first routing table and a second routing table of the fourth node and the associated node of the third replacement node.
9. A method according to any of claims 1-3, characterized in that before said generating a plurality of k-ary balanced trees based on a plurality of said service nodes and a plurality of said backbone nodes, and configuring each node of said k-ary balanced trees with a first routing table and a second routing table in a medium-order traversal, wherein the first routing table of each node stores node information of each node in a first routing direction, further comprising:
the k value is determined based on a preset duty cycle threshold of the messaging of the k-ary balanced tree in the messaging and node maintenance.
10. A node data processing apparatus of a blockchain network system, comprising:
the node configuration module is used for configuring a plurality of network nodes of the blockchain system into a plurality of super nodes, a plurality of service nodes and a plurality of backbone nodes, wherein each network node is configured into one of the super nodes, the service nodes and the backbone nodes, the super nodes are consensus nodes, the service nodes are non-consensus nodes, the backbone nodes are all full nodes, the service nodes store the full data of the blockchain system, and each backbone node is connected with the corresponding super nodes through the corresponding service node;
The balance tree generation module is used for generating a plurality of k-way balance trees based on a plurality of service nodes and a plurality of backbone nodes, and configuring a first routing table and a second routing table for each node of the k-way balance trees in a medium-order traversing mode, wherein the first routing table of each node stores node information of each node in a first routing direction, the second routing table of each node stores node information of each node in a second routing direction, and k is an integer larger than 1;
the node management module is configured to obtain a first routing table of a first node and a second routing table of the first node in response to the first node receiving a node joining request, where the first node is one node in the k-ary balanced tree, and the node joining request includes: requesting to join a second node of the blockchain system; the node management module is further configured to determine a node joining position of the second node in the k-ary balanced tree based on the first routing table of the first node and the second routing table of the first node.
11. An electronic device, comprising:
A memory for storing a computer program product;
A processor for executing a computer program product stored in said memory, which, when executed, implements the method of any of the preceding claims 1-9.
12. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of the preceding claims 1-9.
CN202410223709.1A 2024-02-28 2024-02-28 Node data processing method and device of block chain network system Active CN117811999B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410223709.1A CN117811999B (en) 2024-02-28 2024-02-28 Node data processing method and device of block chain network system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410223709.1A CN117811999B (en) 2024-02-28 2024-02-28 Node data processing method and device of block chain network system

Publications (2)

Publication Number Publication Date
CN117811999A CN117811999A (en) 2024-04-02
CN117811999B true CN117811999B (en) 2024-05-14

Family

ID=90432215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410223709.1A Active CN117811999B (en) 2024-02-28 2024-02-28 Node data processing method and device of block chain network system

Country Status (1)

Country Link
CN (1) CN117811999B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100944756B1 (en) * 2009-10-29 2010-03-03 주식회사 이지마루 Data storage structure for forming mass repository
CN109427012A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of transaction and verification method based on block chain
CN113709203A (en) * 2021-04-08 2021-11-26 曾春峰 Efficient communication method and system applied to block chain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971663B (en) * 2019-10-28 2021-03-12 北京大学 Trusted processing method and system for data transaction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100944756B1 (en) * 2009-10-29 2010-03-03 주식회사 이지마루 Data storage structure for forming mass repository
CN109427012A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of transaction and verification method based on block chain
CN109426952A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of block chain framework
CN113709203A (en) * 2021-04-08 2021-11-26 曾春峰 Efficient communication method and system applied to block chain

Also Published As

Publication number Publication date
CN117811999A (en) 2024-04-02

Similar Documents

Publication Publication Date Title
US10764030B2 (en) Reduction in storage usage in distributed databases
US9450895B2 (en) Context-aware dynamic policy selection for messaging behavior
CN111580884B (en) Configuration updating method, device, server and electronic equipment
US9110884B2 (en) Message publishing and subscribing method and apparatus
US20210174357A1 (en) Method for Making Smart Contract Executable in Block Chain Network, and Node
JP2018073400A (en) Micro service based data processing device, method, and program
US10193997B2 (en) Encoded URI references in restful requests to facilitate proxy aggregation
CN112148798A (en) Data processing method and device applied to distributed system
CN112579319A (en) Service calling method and device based on LRU Cache optimization
US9619518B2 (en) Tracking tuples to reduce redundancy in a graph
US20180074797A1 (en) Transform a data object in a meta model based on a generic type
CN117811999B (en) Node data processing method and device of block chain network system
Lieber et al. The potential of diffusive load balancing at large scale
CN111258840A (en) Cluster node management method and device and cluster
CN106502842B (en) Data reconstruction method and system
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium
CN109741180B (en) Block chain continuous transaction sequence number generation method and device and block chain network node
CN114065724A (en) Method, apparatus and computer program product for metadata comparison
CN117118982A (en) Message transmission method, device, medium and equipment based on cloud primary multi-cluster
US20200210231A1 (en) High availability cluster management of computing nodes
CN112988738A (en) Data slicing method and device for block chain
Tun et al. Optimizing resource discovery technique in the P2P grid systems
CN104363286A (en) Workflow template-driven CDN content distribution method and system
US10348826B2 (en) Pattern-based object serving
Olaifa et al. An adaptive multi agent service discovery for peer to peer cloud services

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