WO2023231343A1 - 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备 - Google Patents

一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备 Download PDF

Info

Publication number
WO2023231343A1
WO2023231343A1 PCT/CN2022/135407 CN2022135407W WO2023231343A1 WO 2023231343 A1 WO2023231343 A1 WO 2023231343A1 CN 2022135407 W CN2022135407 W CN 2022135407W WO 2023231343 A1 WO2023231343 A1 WO 2023231343A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
nodes
distribution
data
subset
Prior art date
Application number
PCT/CN2022/135407
Other languages
English (en)
French (fr)
Inventor
曾超
孙赫
焦梦洪
徐文博
邓福喜
Original Assignee
蚂蚁区块链科技(上海)有限公司
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 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023231343A1 publication Critical patent/WO2023231343A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups

Definitions

  • the embodiments of the present disclosure belong to the field of computer technology, and in particular relate to a method of running a consortium chain network, a consortium chain network, and a node device used in the consortium chain network.
  • the alliance chain can be only for members of a specific group and limited third parties, and multiple service agencies can form an alliance.
  • Authorized nodes are allowed to join the alliance chain network.
  • the server (or server cluster) of each service organization can be a node in the alliance chain network. Nodes on the chain can view information according to their permissions. As the business scale supported by the alliance chain becomes larger and larger, the number of data nodes that need to be accessed in the alliance chain is also increasing.
  • the purpose of this disclosure is to provide a method for operating a consortium chain network, a consortium chain network, and a node device for the consortium chain network.
  • a method of operating a consortium chain network including a plurality of data nodes configured to store block data in a chain and configured not to store block data and transmit Multiple distribution nodes of data
  • the method includes: dividing the plurality of data nodes into a first subset and a second subset, and configuring the data nodes of the first subset to participate in a consensus process to generate and store areas block, the data nodes of the second subset are configured not to participate in the consensus process and obtain and store the generated blocks from the data nodes of the first subset, and the distribution node is configured to obtain and store the generated blocks from the data nodes of the first subset connected thereto.
  • the data node receives the generated block and transmits the block to a second subset of data nodes connected to it.
  • a consortium chain network including: a plurality of data nodes configured to store block data in a chain; and a plurality of distribution nodes configured to Block data is not stored and data is transmitted, wherein the plurality of data nodes are divided into a first subset and a second subset, and the data nodes of the first subset are configured to participate in a consensus process to generate and store blocks, The data nodes of the second subset are configured not to participate in the consensus process and to obtain and store the generated blocks from the data nodes of the first subset, and the distribution nodes are configured to obtain and store generated blocks from the data nodes of the first subset to which they are connected. The generated blocks are received and transmitted to a second subset of data nodes connected thereto.
  • a consortium chain network including multiple consensus nodes, multiple distribution nodes and multiple synchronization nodes, wherein the consensus nodes are configured to participate in the consensus process to generate and chain storage blocks and is connected to one or more distribution nodes among the plurality of distribution nodes; the distribution node is configured to be connected to one or more synchronization nodes among the plurality of synchronization nodes and to listen to the connected one or more synchronization nodes.
  • a consensus node that generates a block in response to a consensus node to which it is connected, obtains said block from the consensus node to which it is connected and transmits said block to one or more synchronization nodes to which it is connected; and
  • the synchronization node is configured not to participate in the consensus process and to receive the block from the distribution node to which it is connected and store the block in a chain, wherein a first one among the plurality of consensus nodes is randomly selected periodically. node, a second node is periodically and randomly selected from the plurality of synchronization nodes, and the first node and the second node are configured to function interchangeably.
  • a node device for a consortium chain network including one or more processors and one or more memories, the one or more memories being configured to store a series of computer programmable Execute instructions, wherein the series of computer-executable instructions, when executed by the one or more processors, cause the one or more processors to: in response to a consensus node configured to participate in the consensus process: listen The node manages the event of contract update to obtain the updated node list, and regularly establishes a connection with one or more distribution nodes in the alliance chain network configured to transmit data based on the node list; participates in the consensus process to generate a parallel chain Store blocks; and transmit the generated blocks to distribution nodes connected to it.
  • a node device for a consortium chain network including one or more processors and one or more memories, the one or more memories being configured to store a series of computer programmable Execute instructions, wherein the series of computer-executable instructions, when executed by the one or more processors, cause the one or more processors to perform: with one of the consortium chain networks configured to participate in establish a connection with a consensus node that processes and stores blocks, and establishes a connection with one or more synchronization nodes in the alliance chain network that are configured not to participate in the consensus process and store blocks; and respond to the consensus it is connected to A node generates blocks, obtains said blocks from the consensus nodes to which it is connected, and transmits said blocks to one or more synchronization nodes to which it is connected.
  • Figure 1 is a schematic diagram of an example alliance chain network
  • Figure 2 is a schematic diagram of the topology structure of the example alliance chain network of Figure 1;
  • FIG. 3 is a schematic diagram of a consortium chain network according to an embodiment of the present disclosure.
  • Figure 4 is a schematic diagram of node connections in a consortium chain network according to an embodiment of the present disclosure
  • FIGS. 5 to 9 are schematic diagrams of methods for operating a consortium chain network according to embodiments of the present disclosure.
  • Figure 10 is a schematic structural diagram of at least part of a node device used in a consortium chain network according to an embodiment of the present disclosure
  • FIG. 11 is an exemplary block diagram applicable to a general hardware system according to embodiments of the present disclosure.
  • FIG 1 is a schematic diagram of an example alliance chain network.
  • This example alliance chain network has multiple participants (participants A, B, C), and each participant can have one or more alliance chain nodes (node 0 to node 5).
  • Each alliance chain node can receive transactions from the customers served by the participant, and each node in the alliance chain network performs distributed execution and certificate storage.
  • the network topology of the alliance chain can be a full-mesh network structure, as shown in Figure 2. In the fully connected mode, each chain node communicates directly with other chain nodes.
  • the consensus algorithm used by the alliance chain can be the Practical Byzantine Fault Tolerance (PBFT) algorithm.
  • PBFT Practical Byzantine Fault Tolerance
  • a link node in the alliance chain, such as node 0, can be determined as the master node through election.
  • the master node In the PBFT consensus algorithm, the master node is responsible for initiating consensus proposals and broadcasting the transaction set (Pre-Prepare message) within a consensus cycle to other chain nodes (chain nodes participating in the consensus during the consensus phase). Specifically, the master node generates a status tree, a transaction tree, and a receipt tree based on the transaction content and execution results of each transaction stored in this node, and records the root hash corresponding to the root node of these three trees into the block header; then, After the master node packages this set of transactions and generates a new block, it broadcasts the block (or block header) to other chain nodes.
  • the master node After the master node packages this set of transactions and generates a new block, it broadcasts the block (or block header) to other chain nodes.
  • Chain nodes such as Node 1 to Node 5
  • After receiving the Pre-Prepare message verify the root hash in the block header by executing a set of transactions in the Pre-Prepare message. After the consensus proposal is verified, a Prepare message is sent to other nodes. Within the predetermined time range, if Prepare messages from more than 2F different chain nodes are received (where F is the number of fault-tolerant nodes in the PBFT consensus algorithm), it means that the Prepare phase has been completed and the Commit phase will be entered.
  • Each chain node broadcasts a Commit message to other nodes. After receiving 2F+1 Commit messages (including its own), it means that the consensus within the current consensus cycle has been reached, and each chain node can append the block containing this set of transactions. Go to the end of the original blockchain (also called chain storage, on-chain), and update the world state based on the execution results of this set of transactions.
  • the transaction described in this article refers to a piece of data that is created by the user through the client of the blockchain and needs to be finally published to the distributed database of the blockchain.
  • a transaction is a data structure agreed in the blockchain protocol. To store a piece of data in the blockchain, it needs to be encapsulated into a transaction.
  • Transactions in the blockchain can be divided into narrow transactions and broad transactions.
  • a transaction in a narrow sense refers to a value transfer issued by a user to the blockchain; for example, in the traditional Bitcoin blockchain network, a transaction can be a transfer initiated by the user in the blockchain.
  • a broad transaction refers to a piece of business data with business intentions released by users to the blockchain; for example, the operator can build a consortium chain based on actual business needs and rely on the consortium chain to deploy other types that have nothing to do with value transfer.
  • Online businesses such as house rental business, vehicle dispatching business, insurance claims business, credit services, medical services, etc.
  • the transaction can be a business with business intention published by the user in the alliance chain Message or business request.
  • transaction data and message data in the consensus phase (such as Pre-Prepare messages, Prepare messages and Commit messages in the above process) all use application layer multicast.
  • the business scale supported by the alliance chain network becomes larger and larger, the number of nodes on the chain also increases, and the bandwidth consumed by each node on the chain for application layer multicast also increases.
  • the entire consensus process will take longer and longer.
  • the on-chain nodes in the consortium chain network are configured into three types: consensus nodes that participate in the consensus process and generate and store block data; Distribution nodes that do not store block data, and synchronization nodes that do not participate in the consensus process but store block data, are shown in Figure 3.
  • consensus nodes that participate in the consensus process and generate and store block data
  • data nodes used to store block data in the alliance chain network.
  • Each data node is capable and qualified to participate in the consensus. Nodes in the process, and each data node can be configured to participate in the consensus process or not.
  • consensus nodes are a part of the nodes selected from the data nodes in the alliance chain network. They are responsible for executing the consensus algorithm and generating blocks to improve the efficiency of the consensus process. In order to allow each data node to equally participate in the consensus process, consensus nodes and synchronization nodes will be randomly selected for exchange on a regular basis.
  • the distribution node is specifically responsible for data distribution, or data transmission. Among them, the communication between the consensus node and the synchronization node, the consensus node and the consensus node, and the communication between the synchronization node and the synchronization node all need to be completed through the distribution node.
  • the distribution node is also an on-chain node in the alliance chain network, and both it and the data nodes are managed based on the node management contract of the alliance chain network. Use on-chain contracts to manage each node, making the identities of data nodes and distribution nodes verifiable.
  • the distribution node is not a data node, does not store blocks, and cannot be selected as a consensus node.
  • the distribution node is responsible for distributing the consensus result of the consensus node, that is, the block, to the synchronization node, and forwarding the transactions received by the synchronization node to the consensus node.
  • a full-mesh mode can be established between distribution nodes to be responsible for mutual communication between consensus nodes or synchronization nodes.
  • FIG. 4 shows a schematic diagram of node connections in a consortium chain network according to an embodiment of the present disclosure.
  • a new node type namely a distribution node
  • a distribution node is introduced into the consortium chain network to form a distribution layer for data transmission; and by selecting from data nodes
  • Some nodes participating in the consensus process form the consensus layer for generating blocks, and the other part of the nodes form the synchronization layer for synchronizing consensus result storage blocks, making the entire alliance chain network form a fixed-height (three-layer height) variable multi-source multicast Tree, using efficient block distribution to achieve low-latency communication, greatly improves the consensus efficiency and scalability of the alliance chain.
  • Each circle or ring in Figure 3 represents a "layer" in the consensus layer, distribution layer, and synchronization layer respectively.
  • Each sector divided by a dotted line indicates that connections are established between nodes in adjacent layers within the sector.
  • the line segments in Figure 4 (and subsequent Figures 5 to 9) represent communication connections between nodes, and the arrows at the ends of the line segments represent the transmission direction of block data.
  • the alliance chain network includes multiple data nodes configured to store block data in a chain, and multiple distribution nodes configured not to store block data but to transmit data.
  • the plurality of data nodes are divided into a first subset and a second subset.
  • the data nodes of the first subset are configured to participate in the consensus process to generate and store blocks.
  • the data nodes of the second subset are configured not to participate in the consensus. process and obtain and store the generated blocks from the first subset of data nodes.
  • the distribution node is configured to receive generated blocks from a first subset of data nodes connected thereto and to transmit the blocks to a second subset of data nodes connected thereto.
  • the data nodes of the first subset are called consensus nodes, which are represented as black filled dots located in the consensus layer in the attached figure; the data nodes of the second subset are called synchronization nodes, which are represented in the attached figure as being located in the synchronization layer. Layer of dotted pattern filled with dots. Distribution nodes are represented in the figure as slash-pattern filled dots located on the distribution layer.
  • Each on-chain node in the alliance chain network is managed based on the node management contract of the alliance chain network.
  • the smart contract for node management is used to manage the joining and deletion of nodes on the chain from the alliance chain network.
  • it may provide the function of smart contracts.
  • Smart contracts on the blockchain are contracts that can be triggered and executed by transactions on the blockchain system. Smart contracts can be defined in the form of code. Smart contracts allow users to create and invoke some complex logic in the alliance chain network.
  • the Turing-complete virtual machine of the node receiving the transaction can execute the transaction and generate a corresponding contract instance.
  • the data field of the transaction stores the contract code, and the to field of the transaction is an empty account.
  • the contract is successfully created, and subsequent users can call this contract.
  • a contract account corresponding to the smart contract appears on the chain and has a specific address.
  • the contract code and account storage will be saved in the contract account.
  • the behavior of a smart contract is controlled by the contract code, and the account storage of the smart contract saves the state of the contract.
  • smart contracts enable virtual accounts containing contract code and account storage (Storage) to be generated on the blockchain.
  • a user can send a transaction containing information about calling a smart contract to the alliance chain network, and the corresponding node can execute the transaction and generate a corresponding contract instance.
  • the from field of the transaction is the address of the account that initiated the call to the smart contract
  • the to field is the address of the called smart contract
  • the data field stores the method and parameters for calling the smart contract.
  • the value of balance may change.
  • a node on a chain can view the current value of balance.
  • Smart contracts can be executed independently on each node in the blockchain network in a prescribed manner.
  • each transaction involved in the block can be stored.
  • the status of the account can be stored.
  • the format of the receipt e.g., how many messages each receipt includes, how many topics each message includes
  • content e.g., the meaning of each topic in each message
  • a specific message in the receipt about the execution of a specific smart contract can include multiple topics to record the address of the smart contract, the account that called the smart contract, and which function/functions in the smart contract were called. Execution, and the results of the smart contract execution, etc.
  • smart contracts for node management can be created in the alliance chain network by writing smart contracts, turning them into bytecode, and deploying them to the alliance chain process. If a new node wants to join the alliance chain network, it needs to call the smart contract for node management, that is, initiate a transaction pointing to the smart contract address. The operation of the smart contract allows the new node to be added to the node list of the alliance chain network.
  • the node list records the node ID of each node on the chain (the identification information of the node on the chain, for example, it can be the hash value of the node's public key), and role information (for example, whether it is a consensus node, a synchronization node, or a distribution node) , network information (for example, for a node that can connect to the public network, the network information can be the public network IP address of the node), etc.
  • any information change on the node on the chain also needs to be modified by calling the smart contract.
  • Each execution result of the smart contract is saved on the blockchain, and each node on the chain can obtain this data (for example, all nodes can access these data locally).
  • nodes on the chain to verify the legitimacy of any other node on the chain based on block data, that is, whether the node is a member of the alliance chain network, and ensures the reliability and consistency of the information.
  • Each distribution node establishes a communication connection with each other distribution node.
  • the distribution node can have a public network IP, and multiple distribution nodes can communicate with each other fully.
  • each distribution node obtains the IDs and network information of all other distribution nodes from the node list and establishes communication connections respectively. After that, each distribution node listens to the event of node management contract update on the chain and obtains the updated node list. If there is a change in the information of the distribution node, a communication connection is established based on the change information.
  • each distribution node also establishes description information of its own node with the structure dnode_info to describe its own distribution node's service capabilities (bandwidth, CPU capabilities, etc.), network affinity (whether it is the same operator network, etc.), etc.
  • dnode_info can have a data structure such as the following:
  • nid is the ID of the distribution node and is the identification information of the node.
  • it can be the hash value of the public key of the node
  • local_bw is the local bandwidth of the distribution node
  • isp_type is the network service provider type of the distribution node.
  • cpu_score is the CPU capability score of the distribution node.
  • the nodes in the distribution layer also share node description information dnode_info, for example, by broadcasting between distribution nodes.
  • Each distribution node can build a node list dn_dnode_info of this fully connected distribution layer.
  • the distribution layer node list dn_dnode_info can be used for load scheduling between distribution nodes. For example, you can refer to the isp_type of each distribution node to prioritize the load scheduling to distribution nodes provided by the same operator.
  • Key-value pairs are stored in the map collection, where the string string is used as the key and is the distribution node ID; dnode_info is used as the value and is the node information of the distribution node.
  • the number of consensus nodes is less than or equal to the number of distribution nodes.
  • Each consensus node is connected to one or more distribution nodes among multiple distribution nodes.
  • each distribution node is only connected to one consensus node. This ensures that each distribution node has and has only one data source. Since the data nodes on the chain may not have public network IPs, for example, they may be computer equipment in the intranet of an organization. The distribution nodes connected to the public network may not be able to access the data nodes, so the data nodes need to actively connect to the distribution nodes. . Similarly, the consensus node can obtain the node list on the chain based on contract management through block data, thereby obtaining the information of the distribution node, so as to actively connect to the distribution node.
  • the time when a data node actively connects to a distribution node can be when a new data node joins the alliance chain network, or when a node on the chain goes offline and comes back online.
  • the consensus node can send a connection request to a distribution node. Since each distribution node can only connect to one consensus node, the distribution node decides whether to accept the connection request based on whether it is already connected to a consensus node: in response to the connect to a consensus node, reject the connection request of the consensus node; and in response to not being connected to the consensus node, accept the connection request to establish a connection with the consensus node.
  • the consensus node since the distribution node cannot actively connect to the consensus node, in order to ensure that each distribution node has a data source, that is, it is connected to a consensus node, the consensus node needs to periodically try to connect to a distribution node. For example, the consensus node randomly selects one of the distribution nodes periodically and sends a connection request to it. In addition, the consensus node can try to connect to the distribution node according to its own load capacity. For example, if the number of distribution nodes connected to a consensus node has reached or is close to the upper limit of its own load capacity, it can try to connect to other distribution nodes from time to time. Therefore, in order to ensure that each distribution node has a data source, the number of consensus nodes and the number of distribution nodes should be configured to meet the load capacity conditions of the consensus node.
  • Each consensus node establishes a routing table dn_route_table that describes the distribution nodes connected to it.
  • the routing table dn_route_table can have the following structure:
  • nid is the ID of the distribution node connected to the consensus node
  • srtt is the smooth round trip time, which indicates the network delay of data transmission between the consensus node and the distribution node
  • bandwidth is the bandwidth of the distribution node
  • state is The status of the distribution node, such as offline, online, overloaded, underloaded, normal, etc.
  • the number of distribution nodes is less than or equal to the number of synchronization nodes.
  • Each distribution node is connected to one or more synchronization nodes, but each synchronization node is only connected to one distribution node.
  • the consensus node needs to actively connect to the distribution node.
  • the synchronization node can obtain the node list on the chain based on contract management through block data, thereby obtaining the information of the distribution node, so as to actively connect to the distribution node.
  • a synchronization node may send a connection request to a distribution node, and the distribution node may accept the connection request to establish a connection with the synchronization node based on its bandwidth and load capabilities, such as in response to its load condition, such as in response to its load.
  • the connection of the synchronization node can be scheduled to other distribution nodes to achieve load balancing. For example, in the example shown in Figure 3, if the load capacity of a distribution node is 3 synchronization nodes, then if a synchronization node initiates a connection request to the distribution node in sector S8 or S6, it may be accepted and the connection may be established; If a connection request is initiated to a distribution node within sectors S2, S3, or S7, the request will be rejected.
  • the distribution node After the distribution node rejects the connection request of the synchronization node, it can notify the initiator of the connection request, that is, the synchronization node, of the ID of the distribution node as the connection target based on the node list and the load condition of each distribution node, so as to schedule the synchronization node. to other distribution nodes.
  • a distribution node in sector S2 receives a connection request from a synchronization node, it can find an underloaded distribution node based on the node list and the routing table shared by each distribution node (which records the load of the distribution node), for example distribution node in sector S6, and notifies the synchronization node of the node ID of the distribution node, so that the synchronization node initiates a connection request to the distribution node in sector S6.
  • load scheduling between distribution nodes may not be triggered by a connection request from a synchronization node, for example, it may be performed periodically or in response to a request from an overloaded distribution node.
  • the distribution nodes in sectors S2, S3 or S7 may find that the distribution node in sector S6 has no connected synchronization node and is under low load by periodically querying the routing table shared by each distribution node. status; therefore, the distribution node in sector S2, S3 or S7 can send the node ID of the distribution node in sector S6 to at least one of its loaded synchronization nodes to notify the at least one synchronization node to connect the distribution node in sector S6 nodes to achieve load balancing among distribution nodes.
  • Each distribution node establishes a routing table sn_route_table that describes the synchronization nodes connected to it.
  • the routing table sn_route_table can have the following structure:
  • nid is the ID of the synchronization node connected to the distribution node
  • srtt is the smooth round-trip time, which indicates the network delay of data transmission between the distribution node and the synchronization node
  • bandwidth is the bandwidth of the synchronization node
  • state is The status of synchronized nodes, such as offline, online, overloaded, underloaded, normal, etc.
  • each distribution node can establish the following routing table describing the distribution of synchronized nodes, so that each distribution node is based on each distribution node.
  • the routing table of the distribution node can obtain the load status of each distribution node for autonomous scheduling and load balancing.
  • each consensus node establishes a routing table dn_route_table to the distribution node after connecting to one or more distribution nodes; each distribution node also establishes a routing table sn_route_table to the synchronization node.
  • two-layer routing is formed, as shown in Figure 4. Under this two-layer routing, all block synchronization is sent from the consensus node to the synchronization node. Starting from the consensus node, the block is first sent to the distribution node through a layer of routing, and then the distribution node passes through a layer of routing. Blocks are sent to synchronization nodes, thus forming a multi-source multicast tree structure for the distribution of block data.
  • consensus nodes and synchronization nodes will be randomly selected for exchange on a regular basis. Therefore, the data source of the multi-source multicast tree is variable.
  • a consensus node that will be transformed is regularly and randomly selected, and among the synchronization nodes, a synchronization node that is about to transform is regularly and randomly selected. The roles and functions of these two nodes are interchanged, so that all data nodes can be equal. participate in the consensus process. Among them, randomly selecting a consensus node or synchronization node to be transformed can be performed by executing a smart contract.
  • the smart contract is called and executed regularly, so that the execution results are stored on the chain as block data, and all nodes on the chain can obtain this information.
  • a consensus node to be transformed is randomly selected from multiple consensus nodes in the consensus layer, such as node 1.
  • Node 1 is currently connected to distribution nodes 2 and 3 in the distribution layer and serves as the data source for nodes 2 and 3.
  • Node 5 is currently connected to distribution node 4 in the distribution layer as the destination for node 4 to distribute blocks.
  • the change in the role of the consensus node will cause the distribution layer node it supports to have no data source. Therefore, the newly added consensus node must become the data source of the distribution layer node supported by the original consensus node.
  • node 5 first connects to the distribution nodes connected to the original consensus node, node 1, namely nodes 2 and 3, establishes new connections L2 and L3 with nodes 2 and 3 respectively; and disconnects from the original distribution node, namely nodes 2 and 3. Connection L1 of node 4.
  • Node 5 becomes the data source for distributing nodes 2 and 3 through the newly created connections L2 and L3.
  • the original consensus node, Node 1 is switched to a synchronization node to receive the blocks generated by the consensus node from the distribution node, and Node 1 selects a distribution node from the distribution layer and establishes a connection with the distribution node.
  • the distribution node selected by node 1 may be the distribution node originally connected to node 5, that is, node 4, or it may not be.
  • node 1 selects node 2 and establishes connection L6 with it.
  • node 1 as a synchronization node sends a connection request to its selected distribution node, node 2, and node 2 can decide whether to accept the request according to its load condition. If accepted, the connection will be established; if not accepted, the synchronization node will be scheduled to other distribution nodes based on the node list of the alliance chain network and the load of each distribution node.
  • each node in the entire alliance chain network re-forms a new multi-source multicast tree for distributing block data.
  • node 5 as a consensus node becomes the data source for distributing block data of nodes 2 and 3 respectively by connecting L2 and L3.
  • Node 1 as a synchronization node becomes a destination of distributing block data of node 2 by connecting L6. land.
  • the alliance chain network can also conduct other forms of communication in addition to the above-mentioned block data distribution.
  • transactions received by each synchronization node need to be forwarded to the consensus node through the distribution node; communication between consensus nodes, such as the broadcast of transactions, the broadcast of each message in the consensus process, etc., all need to be carried out through the distribution node; synchronization Communication between nodes, for example, when a new synchronization node joins and needs to synchronize data from other synchronization nodes, it also needs to be carried out through the distribution node.
  • Distribution nodes enable any two data nodes on the chain to communicate with each other.
  • the nodes in the consortium chain network are divided into a consensus layer formed by consensus nodes that participate in the consensus process and generate block data, a consensus layer that distributes block data, and a consensus layer that distributes block data.
  • the distribution layer formed by nodes, and the synchronization layer formed by synchronization nodes that synchronize block data each consensus node is connected to one or more distribution nodes, and each distribution node is connected to one or more synchronization nodes, so that a block distribution is formed
  • a three-level multi-source multicast tree structure makes each consensus node become the data source of a single-source multicast tree.
  • the distribution of blocks on the chain starts from each consensus node and is distributed along each single-source multicast tree structure. Fixed a distribution layer to ensure the low-latency characteristics of distribution. As the number of nodes on the chain increases, the number of nodes in the distribution layer can be appropriately increased to ensure that the overall performance of the chain is not reduced and the scalability of the chain is improved while the distribution delay is stable. In a specific example, if each on-chain node in the alliance chain network can support 20 load nodes, then if 40 consensus nodes are configured, it can support 800 distribution nodes and further support 16,000 synchronization nodes. node.
  • FIG 10 is a schematic structural diagram of at least part of a node device 700 for a consortium chain network according to an embodiment of the present disclosure.
  • Node device 700 includes one or more processors 710, one or more memories 720, and other components typically found in a computer or the like (not shown).
  • Each of the one or more memories 720 may store content that may be accessed by the one or more processors 710 , including instructions 721 that may be executed by the one or more processors 710 and that may be executed by the one or more processors 710 .
  • Instructions 721 may be any set of instructions to be executed directly by one or more processors 710, such as machine code, or indirectly, such as a script.
  • the terms “instructions,” “applications,” “processes,” “steps,” and “programs” in this disclosure may be used interchangeably in this disclosure.
  • Instructions 721 may be stored in object code format for direct processing by one or more processors 710, or in any other computer language, including a script or collection of independent source code modules that are interpreted on demand or compiled ahead of time. The functionality, methods, and routines of instructions 721 are explained in greater detail elsewhere in this disclosure.
  • One or more memories 720 may be any transitory or non-transitory computer-readable storage medium capable of storing content accessible by one or more processors 710, such as a hard drive, memory card, ROM, RAM, DVD, CD, USB memory, writable memory, read-only memory, etc.
  • One or more of the memory 720 may include a distributed storage system, in which instructions 721 and/or data 722 may be stored on multiple different storage devices that may be physically located at the same or different geographic locations.
  • One or more of the one or more memories 720 may be connected to the one or more first devices 710 via a network, and/or may be directly connected to or incorporated into any of the one or more processors 710 .
  • One or more processors 710 may retrieve, store, or modify data 722 in accordance with instructions 721 .
  • data 722 may also be stored in a computer register (not shown), as a table with many different fields and records, or as an XML document in a relational database.
  • Data 722 may be formatted in any format readable by a computing device, such as, but not limited to, binary values, ASCII, or Unicode. Additionally, data 722 may include any information sufficient to identify the relevant information, such as numbers, descriptive text, proprietary code, pointers, references to data stored in other memory, such as at other network locations, or used by functions to calculate correlations. Data information.
  • the one or more processors 710 may be any conventional processor, such as a commercially available central processing unit (CPU), graphics processing unit (GPU), or the like. Alternatively, one or more processors 710 may also be dedicated components, such as application specific integrated circuits (ASICs) or other hardware-based processors. Although not required, one or more processors 710 may include specialized hardware components to perform certain computing processes faster or more efficiently.
  • CPU central processing unit
  • GPU graphics processing unit
  • ASICs application specific integrated circuits
  • processors 710 may include specialized hardware components to perform certain computing processes faster or more efficiently.
  • processors 710 and one or more memories 720 are schematically shown within the same box in Figure 10, the node device 700 may actually include multiple processors that may reside within the same physical enclosure or in different Multiple processors or memories within one physical enclosure.
  • reference to a processor, computer, computing device, or memory should be understood to include reference to a collection of processors, computers, computing devices, or memories that may or may not operate in parallel.
  • FIG. 11 is an exemplary block diagram of a general hardware system 800 applicable in accordance with one or more exemplary embodiments of the present disclosure.
  • System 800 will now be described with reference to Figure 11, which is an example of a hardware device that may be applied to aspects of the present disclosure.
  • the node device 700 in the above embodiments may include all or part of the system 800.
  • System 800 may be any machine configured to perform processing and/or computation, which may be, but is not limited to, a workstation, a server, a desktop computer, a laptop computer, a tablet computer, a personal data assistant, a smartphone, a vehicle-mounted computer, or any thereof. combination.
  • System 800 may include elements that may be coupled to or in communication with bus 802 via one or more interfaces.
  • system 800 may include bus 802, as well as one or more processors 804, one or more input devices 806, and one or more output devices 808.
  • the one or more processors 804 may be any type of processor and may include, but are not limited to, one or more general purpose processors and/or one or more special purpose processors (eg, special processing chips). Each operation and/or step in the method described above can be implemented by one or more processors 804 executing instructions.
  • Input device 806 may be any type of device that can input information to a computing device and may include, but is not limited to, a mouse, a keyboard, a touch screen, a microphone, and/or a remote control.
  • Output device 808 may be any type of device that can present information and may include, but is not limited to, a display, speakers, video/audio output terminal, vibrator, and/or printer.
  • the System 800 may also include or be connected to non-transitory storage device 810 .
  • the non-transitory storage device 810 may be any storage device that is non-transitory and can implement data storage, and may include, but is not limited to, a disk drive, an optical storage device, a solid state memory, a floppy disk, a hard disk, a magnetic tape or any other magnetic media, an optical disk or any Other optical media, ROM (read only memory), RAM (random access memory), cache memory, and/or any other memory chip/chipset, and/or from which the computer can read data, instructions and/or code any other media.
  • Non-transitory storage device 810 may be detached from the interface.
  • the non-transitory storage device 810 may have data/instructions/code for implementing the methods, operations, steps and processes described above.
  • System 800 may also include a communications device 812.
  • Communication device 812 may be any type of device or system capable of communicating with external devices and/or with a network, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication device, and/or a chipset, such as a Bluetooth device, 802.11 devices, WiFi devices, WiMax devices, cellular communications devices, satellite communications devices, and/or the like.
  • Bus 802 may include, but is not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
  • bus 802 may also include a controller area network (CAN) bus or other architecture designed for use on a vehicle.
  • ISA Industry Standard Architecture
  • MCA Micro Channel Architecture
  • EISA Enhanced ISA
  • VESA Video Electronics Standards Association
  • PCI Peripheral Component Interconnect
  • bus 802 may also include a controller area network (CAN) bus or other architecture designed for use on a vehicle.
  • CAN controller area network
  • System 800 may also include working memory 814 , which may be any type of working memory that may store instructions and/or data useful for the operation of processor 804 , which may include, but is not limited to, random access memory and/or read-only storage devices. .
  • Software elements may be located in working memory 814, including, but not limited to, operating system 816, one or more applications 818, drivers, and/or other data and code. Instructions for performing the methods, operations, and steps described above may be included in one or more applications 818.
  • the executable code or source code of the instructions of the software elements may be stored in a non-transitory computer-readable storage medium, such as the storage device 810 described above, and may be read into the working memory 814 through compilation and/or installation.
  • the executable code or source code of the instructions for the software element may also be downloaded from a remote location.
  • system 800 can be distributed over a network. For example, some processing may be performed using one processor, while other processing may be performed by another processor remote from the one processor. Other components of system 800 may be similarly distributed. As such, system 800 may be interpreted as a distributed computing system that performs processing at multiple locations.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers.
  • controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
  • the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
  • the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. .
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • one or more embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present disclosure may employ a computer program embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • One or more embodiments of the present disclosure may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明涉及运行联盟链网络的方法,所述联盟链网络包括被配置为链式存储区块数据的多个数据节点以及被配置为不存储区块数据并且传输数据的多个分发节点,所述方法包括:将所述多个数据节点划分为第一子集和第二子集,并将第一子集的数据节点配置为参与共识过程以生成并存储区块,将第二子集的数据节点配置为不参与共识过程并且从第一子集的数据节点获取并存储所生成的区块,将所述分发节点配置为从与其连接的第一子集的数据节点接收所生成的区块,并将所述区块传输到与其连接的第二子集的数据节点。

Description

一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备
本申请要求于2022年06月01日提交中国专利局、申请号为202210615860.0、发明名称为“一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开实施例属于计算机技术领域,尤其涉及运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备。
背景技术
随着区块链技术的发展,基于联盟链网络的业务处理模式较为常见。联盟链可以是只针对特定群体的成员和有限的第三方,多个服务机构可以组成一个联盟。允许授权的节点加入联盟链网络,每个服务机构的服务器(或服务器集群)可以为联盟链网络中的一个节点,链上节点可根据权限查看信息。随着联盟链支撑的业务规模越来越大,联盟链中需要接入的数据节点的数量也越来越多。
发明内容
本公开的目的在于提供运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备。
根据本公开的第一方面,提供了一种运行联盟链网络的方法,所述联盟链网络包括被配置为链式存储区块数据的多个数据节点以及被配置为不存储区块数据并且传输数据的多个分发节点,所述方法包括:将所述多个数据节点划分为第一子集和第二子集,并将第一子集的数据节点配置为参与共识过程以生成并存储区块,将第二子集的数据节点配置为不参与共识过程并且从第一子集的数据节点获取并存储所生成的区块,将所述分发节点配置为从与其连接的第一子集的数据节点接收所生成的区块,并将所述区块传输到与其连接的第二子集的数据节点。
根据本公开的第二方面,提供了一种联盟链网络,包括:多个数据节点,所述数据节点被配置为链式存储区块数据;以及多个分发节点,所述分发节点被配置为不存储区块数据并且传输数据,其中,所述多个数据节点被划分为第一子集和第二子集,第一子集的数据节点被配置为参与共识过程以生成并存储区块,第二子集的数据节点被配置为不参与共识过程并且从第一子集的数据节点获取并存储所生成的区块,所述分发节点被配置为从与其连接的第一子集的数据节点接收所生成的区块,并将所述区块传输到与其连接的第二子集的数据节点。
根据本公开的第三方面,提供了一种联盟链网络,包括多个共识节点、多个分发节点和多个同步节点,其中,所述共识节点被配置为参与共识过程以生成并链式存储区块以及与所述多个分发节点中的一个或多个分发节点相连接;所述分发节点被配置为与所述多个同步节点中的一个或多个同步节点相连接并监听其所连接的共识节点,以及响应于其所连接的共识节点生成区块,从其所连接的共识节点获取所述区块并将所述区块传输给其所连接的一个或多个同步节点;以及所述同步节点被配置为不参与共识过程并且从其所连接的分发节点接收所述区块并链式存储所述区块,其中,所述多个共识节点中被定期地随机选择出一个第一节点,所述多个同步节点中被定期地随机选择出一个第二节点,并且所述第一节点和所述第二节点被配置为功能互换。
根据本公开的第四方面,提供了一种用于联盟链网络的节点设备,包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器被配置为存储一系列计算机可执行指令,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,使所述一个或多个处理器执行:响应于被配置为参与共识过程的共识节点:监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表定期地与所述联盟链网络中的被配置为传输数据的一个或多个分发节点建立连接;参与共识过程以生成并链式存储区块;以及将所生成的区块传输给与其连接的分发节点。
根据本公开的第五方面,提供了一种用于联盟链网络的节点设备,包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器被配置为存储一系列计算机可执行指令,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,使所述一个或多个处理器执行:与所述联盟链网络中的一个被配置为参与共识过程并存储区块的共识节点建立连接,并且与所述联盟链网络中的一个或多个被配置为不参与共识过程并存储区块的同步节点建立连接;以及响应于其所连接的共识节点生成区块,从其所连接的共识节点获取所述区块,并将所述区块传输给其所连接的一个或多个同步节点。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是示例联盟链网络的示意图;
图2是图1的示例联盟链网络的拓扑结构的示意图;
图3是根据本公开实施例的联盟链网络的示意图;
图4是根据本公开实施例的联盟链网络中的节点连接的示意图;
图5至图9是根据本公开实施例的运行联盟链网络的方法的示意图;
图10是根据本公开实施例的用于联盟链网络的节点设备的至少部分的结构示意图;
图11是可应用于根据本公开实施例的通用硬件系统的示例性框图。
具体实施方式
为了使本技术领域的人员更好地理解本公开中的技术方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。
图1是示例联盟链网络的示意图。该示例联盟链网络有多个参与方(参与方A、B、C),每个参与方可以有一个或多个联盟链节点(节点0至节点5)。每个联盟链节点可以从该参与方所服务的客户接收交易,并由联盟链网络中的各节点进行分布式执行与存证。联盟链的网络拓扑结构可以为全连接(full-mesh)网络结构,如图2所示。在全连接模式下,每个链节点都与其他的链节点直接通信连接。联盟链采用的共识算法可以是实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)算法。联盟链中的一个链节点,例如节点0,可以通过选举被确定为主节点。主节点在PBFT共识算法中,负责发起共识提议,并将一个共识周期内的交易集合(Pre-Prepare消息)广播给其他的链节点(在共识阶段为参与共识的链节点)。具体地,主节点根据本节点存储的各条交易的交易内容和执行结果生成状态树、交易树和收据树,将这三棵树的根节点对应的根哈希记入区块头中;然后,主节点将这一组交易打包并生成新的区块后,将该区块(或区块头)广播至其他链节点。其他的链节点,例如节点1至节点5,接收到Pre-Prepare消息之后,通过执行Pre-Prepare消息中的一组交易,对区块头中的根哈希进行验证。在对共识提议的验证通过后,向其它节点发送Prepare消息。在预定时间范围内,如果收到超过2F个不同链节点的Prepare消息(其中F为PBFT共识算法中的容错节点个数),就代表Prepare阶段已经完成,则进入Commit阶段。每个链节点向其它节点广播Commit消息,当收到2F+1个Commit消息后(包括自己的),代表当前共识周期内的共识已经达成,各链节点可以将包含这组交易的区块追加到原有的区块链的末尾(也称链式存储、上链),并根据这组交易的执行结果对世界状态进行更新。
需要说明的是,本文所述的交易(transaction),是指用户通过区块链的客户端创建,并需要最终发布至区块链的分布式数据库中的一笔数据。交易是区块链协议中所约定的一种数据结构,一笔数据要存入区块链,就需要被封装成交易。区块链中的交易,存在狭义的交易以及广义的交易之分。狭义的交易是指用户向区块链发布的一笔价值转移;例如,在传统的比特币区块链网络中,交易可以是用户在区块链中发起的一笔转账。而广义的交易是指用户向区块链发布的一笔具有业务意图的业务数据;例如, 运营方可以基于实际的业务需求搭建一个联盟链,依托于联盟链部署一些与价值转移无关的其它类型的在线业务(比如,租房业务、车辆调度业务、保险理赔业务、信用服务、医疗服务等),而在这类联盟链中,交易可以是用户在联盟链中发布的一笔具有业务意图的业务消息或者业务请求。
在采用PBFT共识算法的联盟链网络中,交易数据和共识阶段的消息数据(例如上述过程中的Pre-Prepare消息、Prepare消息和Commit消息)均采用应用层组播的方式。随着联盟链网络支撑的业务规模越来越大,其链上节点的数量也越来越多,每个链上节点进行应用层组播需要消耗的带宽也随之增长。此外,随着链上节点的数量越来越多,整个共识过程的耗时也会越来越长。
根据本公开实施例的运行联盟链网络的方法和联盟链网络,将联盟链网络中的链上节点配置为三种:参与共识过程并生成和存储区块数据的共识节点、用于数据分发但不存储区块数据的分发节点、以及不参与共识过程但存储区块数据的同步节点,如图3所示。需要说明的是,在本文中,为简便起见,将联盟链网络中的用于链式存储区块数据的链上节点称为“数据节点”,每个数据节点均为有能力和资格参与共识过程的节点,并且每个数据节点均可以被配置为参与共识过程或者不参与共识过程。将数据节点中参与共识过程、并在共识通过之后生成区块的节点称为“共识节点”;而将不参与共识过程、只是将共识节点的共识结果同步过来存储的数据节点称为“同步节点”。因此,共识节点是从联盟链网络中的数据节点中选出的一部分节点,负责执行共识算法,生成区块,以提升共识过程的效率。为了使得各数据节点平等地参与共识过程,会定期地随机选出共识节点和同步节点进行交换。
分发节点专门负责数据分发,或称数据传输。其中,共识节点与同步节点之间、共识节点与共识节点之间、以及同步节点与同步节点之间的通信均需经由分发节点来完成。分发节点也是联盟链网络中的链上节点,其和数据节点均基于联盟链网络的节点管理合约来管理。利用链上合约来进行各节点的管理,使得数据节点和分发节点的身份均是可验证的。但分发节点不是数据节点,不存储区块,也不能被选中称为共识节点。分发节点负责把共识节点的共识结果即区块分发给同步节点,以及把同步节点接收到的交易转发给共识节点。此外,分发节点之间可以建立全连接(full-mesh)模式,以负责共识节点之间或同步节点之间的相互通信。
图4所示为根据本公开实施例的联盟链网络中的节点连接的示意图。根据本公开实施例的运行联盟链网络的方法和联盟链网络,通过在联盟链网络中引入新的节点类型,即分发节点,构成用于数据传输的分发层;并通过从数据节点中选出一部分参与共识过程构成用于生成区块的共识层,另一部分节点构成同步共识结果存储区块的同步层,使得整个联盟链网络形成了一个固定高度(三层高度)的可变多源组播树,用高效的区块分发实现了低延迟通信,大幅提升了联盟链的共识效率和可扩展性。
下面参照图3和图4详细描述根据本公开实施例的运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备。图3中每个圆形或环形分别表示共识层、分发层、同步层中的“层”,每个用虚线分割出的扇形表示在扇形内相邻层的节点之间是建立连接的。图4(以及后续图5至图9)中线段表示节点之间的通信连接,线段端部的箭头表示区块数据的传输方向。
联盟链网络包括被配置为链式存储区块数据的多个数据节点、和被配置为不存储区块数据并且传输数据的多个分发节点。多个数据节点被划分为第一子集和第二子集,第一子集的数据节点被配置为参与共识过程以生成并存储区块,第二子集的数据节点被配置为不参与共识过程并且从第一子集的数据节点获取并存储所生成的区块。分发节点被配置为从与其连接的第一子集的数据节点接收所生成的区块,并将区块传输到与其连接的第二子集的数据节点。第一子集的数据节点被称为共识节点,在附图中表示为位于共识层的黑色填充的圆点;第二子集的数据节点被称为同步节点,在附图中表示为位于同步层的点状图案填充的圆点。分发节点在附图中表示为位于分发层的斜杠图案填充的圆点。
联盟链网络中的每个链上节点,即多个数据节点和多个分发节点中的每个节点,均基于联盟链网络的节点管理合约来管理。例如,基于用于节点管理的智能合约来管理链上节点的加入该联盟链网络、以及从该联盟链网络中删除。不论是公有链、私有链还是联盟链,都可能提供智能合约的功能。区块链上的智能合约是在区块链系统上可以被交易触发执行的合约。智能合约可以通过代码的形式定义。智能合约使得用户可以在联盟链网络中创建并调用一些复杂的逻辑。
例如,用户将一个包含创建智能合约信息的交易发送到联盟链网络后,接收该交易的节点的图灵完备的虚拟机可以执行这个交易并生成对应的合约实例。交易的data字段保存的是合约代码,交易的to字段为一个空的账户。节点间通过共识机制达成一致后,这个合约成功创建,后续用户可以调用这个合约。合约创建后,链上出现一个与该智能合约对应的合约账户,并拥有一个特定的地址,合约代码和账户存储将保存在该合约账户中。智能合约的行为由合约代码控制,而智能合约的账户存储则保存了合约的状态。换句话说,智能合约使得区块链上产生包含合约代码和账户存储(Storage)的虚拟账户。例如,用户可以将一个包含调用智能合约信息的交易发送到联盟链网络,相应的节点可以执行这个交易并生成对应的合约实例。交易的from字段是发起调用智能合约的账户的地址,to字段为被调用的智能合约的地址,data字段保存的是调用智能合约的方法和参数。调用智能合约后,balance的值可能改变。后续,某个链上节点可以查看balance的当前值。智能合约可以通过规定的方式在区块链网络中的每个节点独立地执行,所有执行记录和数据都保存在区块链上,所以当这样的交易完成后,区块链上就保存了无法篡改、不会丢失的交易凭证。例如,在每个区块链节点处生成的每个区块中,可以存储有该区块所涉及的各个交易、记录各个交易的结果等信息的相应的收据、以及区块链网络维护的各个账户的状态。收据的格式(例如每个收据包括几条消息、每条消息包括几个主题)和内容(例如每条消息中每个主题的含义)可以由区块链网络的各参与方共同定义。例如,关于一个特定的智能合约的执行的收据中的一条特定的消息,可以包括多个主题以分别记录该智能合约的地址、调用该智能合约的账户、该智能合约中的哪个/哪些函数被执行、以及该智能合约执行的结果等。
如此,可以经过编写智能合约、变成字节码、部署到联盟链过程,从而在联盟链网络中创建用于节点管理的智能合约。如果一个新节点要加入到该联盟链网络中,则需要调用用于节点管理的智能合约,即发起一笔指向该智能合约地址的交易。该智能合约的运行可以使得该新节点可以被加入到该联盟链网络的节点列表中。节点列表中记录有各个链上节点的节点ID(为该链上节点的标识信息,例如可以是节点的公钥的哈希值)、角色信息(例如是共识节点或同步节点,还是分发节点)、网络信息(例如对于可以连接公网的节点,网络信息可以是该节点的公网IP地址)等。此外,任何链上节点的信息变更,也需要调用该智能合约来修改。每次该智能合约的执行结果都保存在区块链上,每个链上节点均可获得这些数据(例如全量节点在本地即可访问这些数据)。在本公开实施例中,不仅联盟链网络中用于存储数据的数据节点,而且仅用于传输数据的分发节点也是通过节点管理合约来管理的。这就使得链上节点都可以根据区块数据来验证任何其他链上节点的合法性,即该节点是否是该联盟链网络的成员,并且保证了信息的可靠性和一致性。
每个分发节点与其他各分发节点分别建立通信连接。分发节点可以具有公网IP,多个分发节点之间可以进行全连通通信。联盟链网络建立时,每个分发节点从节点列表中获取所有其他分发节点的ID和网络信息,分别建立通信连接。之后,每个分发节点监听链上节点管理合约更新的事件,获取更新的节点列表。如果有分发节点的信息变更,则根据变更信息建立通信连接。
此外,每个分发节点还建立结构为dnode_info的自身节点的描述信息,以描述自身分发节点的服务能力(带宽、CPU能力等)、网络亲和性(是否相同的运营商网络等)等。dnode_info可以具有例如如下的数据结构:
Struct dnode_info{
String nid;
uint32_t local_bw;
char isp_type;
uint32_t cpu_score;
}
其中,nid为该分发节点的ID,为该节点的标识信息,例如可以是该节点的公钥的哈希值;local_bw为该分发节点的本地带宽;isp_type为该分发节点的网络服务商类型,例如电信、联通、移动、或其他 运营商等;cpu_score为该分发节点的CPU能力分。
分发层的节点之间还共享节点描述信息dnode_info,例如通过在各分发节点之间广播来进行共享,每个分发节点可以构建这个全连接的分发层的节点列表dn_dnode_info。分发层节点列表dn_dnode_info可以用于分发节点之间的负载调度,例如可以参考各分发节点的isp_type,优先将负载调度到由相同运营商提供服务的分发节点下。
std::map<string,dnode_info>dn_dnode_info;
在该map集合中存储键值对,其中string字符串用作键,为分发节点ID;dnode_info用作值,为该分发节点的节点信息。
共识节点的个数小于或等于分发节点的个数,每个共识节点与多个分发节点中的一个或多个分发节点相连接,而相应地,每个分发节点只与一个共识节点相连接,从而保证每个分发节点有且只有一个数据源。由于链上的数据节点可能是不具有公网IP的,例如可能是某个机构内网中的计算机设备,连接到公网的分发节点可能无法访问数据节点,因此需要数据节点主动去连接分发节点。同样地,共识节点可以通过区块数据获得基于合约管理的链上节点列表,从而得到分发节点的信息,以便主动连接分发节点。数据节点主动连接分发节点的时机可以是新的数据节点加入该联盟链网络,也可以是链上的节点掉线后重新上线。例如,共识节点可以向某个分发节点发送连接请求,由于每个分发节点只能连接一个共识节点,因此,该分发节点根据自己是否已经连接有共识节点来决定是否接收该连接请求:响应于已与共识节点相连接,拒绝该共识节点的连接请求;以及响应于未与共识节点相连接,接受连接请求以与该共识节点建立连接。此外,由于分发节点不能主动连接共识节点,但为了保证每个分发节点都有数据源,即都连接有共识节点,需要共识节点定期地去尝试连接某个分发节点。例如,共识节点定期地从各分发节点中随机选择一个并向其发送连接请求。此外,共识节点可以根据自己的负载能力来尝试连接分发节点。例如,如果一个共识节点连接的分发节点的个数已经达到或接近了自己负载能力的上限,则其可以不定期去尝试连接其他的分发节点。因此,为了保证每个分发节点都有数据源,对共识节点的个数和分发节点的个数的配置应保证能够满足共识节点的负载能力条件。
每个共识节点建立描述与其连接的分发节点的路由表dn_route_table。路由表dn_route_table可以具有如下的结构:
struct route_item{
string nid;
uint32_t srtt;
uint32_t bandwidth;
uint16_t state;
}
std::list<route_item>dn_route_table;
其中,nid为与该共识节点连接的分发节点的ID,srtt为平滑往返时间,其指示该共识节点与该分发节点之间传输数据的网络延时,bandwidth为该分发节点的带宽,state为该分发节点的状态,例如掉线、在线、超载、低载、正常等。
分发节点的个数小于或等于同步节点的个数,每个分发节点与一个或多个同步节点相连接,但每个同步节点只与一个分发节点相连接。由于上述同样的原因,需要共识节点主动去连接分发节点。同步节点可以通过区块数据获得基于合约管理的链上节点列表,从而得到分发节点的信息,以便主动连接分发节点。例如,同步节点可以向某个分发节点发送连接请求,分发节点基于其带宽和负载能力,例如响应于其负载情况满足条件,可以接受该连接请求以与该同步节点建立连接;例如响应于其负载情况不满足条件,可以把该同步节点的连接调度到其他分发节点上,从而实现负载均衡。例如在图3所示的示例中,如果一个分发节点的负载能力为3个同步节点,则如果一个同步节点向扇形S8或S6内的分发节点发起 连接请求,则可能会被接受并建立连接;如果向扇形S2、S3或S7内的分发节点发起连接请求,则会被拒绝请求。分发节点拒绝同步节点的连接请求后,可以基于节点列表和各分发节点的负载情况,向连接请求的发起方,即该同步节点,通知作为连接目标的分发节点的ID,以将该同步节点调度到其他的分发节点上。例如,如果扇形S2内的分发节点接收到同步节点的连接请求,则其可以根据节点列表和各分发节点共享的路由表(其中记载有分发节点的负载情况),找到低载的分发节点,例如扇形S6内的分发节点,并将该分发节点的节点ID通知给该同步节点,以便同步节点向扇形S6内的分发节点发起连接请求。
此外,分发节点之间的负载调度也可以不由同步节点的连接请求而触发,例如可以定期进行、或是应过载分发节点的请求而进行。例如,在图3所示的示例中,扇形S2、S3或S7内的分发节点可能通过定期查询各分发节点共享的路由表而发现扇形S6内的分发节点没有连接的同步节点,其处于低载状态;因此,扇形S2、S3或S7内的分发节点可以向其负载的同步节点中的至少一个发送扇形S6内的分发节点的节点ID,以通知该至少一个同步节点去连接扇形S6内的分发节点,从而实现分发节点之间的负载均衡。
每个分发节点建立描述与其连接的同步节点的路由表sn_route_table。路由表sn_route_table可以具有如下的结构:
struct route_item{
string nid;
uint32_t srtt;
uint32_t bandwidth;
uint16_t state;
}
std::list<route_item>sn_route_table;
其中,nid为与该分发节点连接的同步节点的ID,srtt为平滑往返时间,其指示该分发节点与该同步节点之间传输数据的网络延时,bandwidth为该同步节点的带宽,state为该同步节点的状态,例如掉线、在线、超载、低载、正常等。
在所有分发节点之间共享各自的路由表,例如通过在各分发节点之间广播来进行共享,从而每个分发节点都可以建立如下的描述同步节点分布的路由表,使得每个分发节点基于各分发节点的路由表可以获得各分发节点的负载情况,以便进行自主调度,实现负载均衡。
std::map<string,std::list<route_item>>dn_sn_route_table;
在该map集合中存储键值对(key-value),其中string字符串用作键,为分发节点ID;std::list<route_item>清单列表用作值,为该分发节点上所连接的同步节点路由表sn_route_table。
如上所述,每个共识节点在连接了一个或多个分发节点之后,建立了到分发节点的路由表dn_route_table;每个分发节点也建立了到同步节点的路由表sn_route_table。基于这两个路由表,构成了两层路由,如图4所示。在该两层路由下,所有的区块同步都是从共识节点发送给同步节点的,从共识节点出发经过一层路由先把区块发送给分发节点,再由分发节点出发经过一层路由将区块发送给同步节点,从而为区块数据的分发形成了多源组播树的结构。
此外,如上所述,为了使得各数据节点平等地参与共识过程,会定期地随机选出共识节点和同步节点进行交换,因此,该多源组播树的数据源是可变的。共识节点中被定期地随机选择出一个将要变换的共识节点,同步节点中被定期地随机选择出一个将要变换的同步节点,将这两个节点的角色功能互换,从而可以实现各数据节点平等地参与共识过程。其中,随机选择一个将要变换的共识节点或同步节点,均可以通过执行智能合约来进行。例如可以编写并部署具有在多个链上节点中随机选择一个的功能的合约代码来在联盟链网络中创建该智能合约。定期地调用并执行该智能合约,使得执行结果作为区块数据 上链存储,链上节点均可以获得该信息。
下面结合图5至图9来说明将要变换的共识节点和将要变换的同步节点的角色功能互换的过程。如图5所示,从共识层的多个共识节点中随机选择出一个将要变换的共识节点,例如节点1。节点1目前与分发层中的分发节点2和3相连接,作为节点2和3的数据源。从同步层的多个同步节点中随机选择出一个将要变换的同步节点,例如节点5。节点5目前与分发层中的分发节点4相连接,作为节点4分发区块的目的地。共识节点角色的变化会导致其支撑的分发层节点没有数据源,所以,新加入的共识节点要成为原共识节点所支撑的分发层节点的数据源。
如图6所示,节点5先连接到原共识节点即节点1所连接的分发节点即节点2和3,分别与节点2和3建立新的连接L2和L3;并断开与原分发节点即节点4的连接L1。如图7所示,原共识节点即节点1断开与节点2和3的原有连接L4和L5,并且原同步节点即节点5切换为共识节点,开始参与共识过程以生成并存储区块。节点5通过新建的连接L2和L3来成为分发节点2和3的数据源。
如图8所示,原共识节点即节点1被切换为同步节点,以从分发节点接收共识节点生成的区块,并且节点1从分发层中选择一个分发节点,建立与该分发节点的连接,以生成该分发节点传输区块数据的一个目的地。节点1所选择的该分发节点,可以是节点5原先连接的分发节点即节点4,也可以不是。在图8所示的示例中,节点1选择节点2并与其建立连接L6。如上所述,作为同步节点的节点1对其所选择的分发节点即节点2发送连接请求,节点2可以根据其负载情况来决定是否接受该请求。如果接受则建立连接,如果不接受则基于联盟链网络的节点列表和各分发节点的负载情况将该同步节点调度到其他分发节点。
如图9所示,节点1和节点5角色功能互换后,整个联盟链网络中的各节点重新形成用于分发区块数据的新的多源组播树。变换之后,作为共识节点的节点5通过连接L2和L3分别成为分发节点2和3的区块数据的数据源,作为同步节点的节点1通过连接L6成为分发节点2的分发区块数据的一个目的地。
此外,在共识节点和同步节点均分别连接到分发节点之后,例如建立如图4所示的连接结构之后,联盟链网络除了进行上述的区块数据分发之外,还可以进行其他形式的通信。例如,每个同步节点接收到的交易,需要经由分发节点转发到共识节点;共识节点之间的通信,例如交易的广播、共识过程中各消息的广播等,均需要经由分发节点来进行;同步节点之间的通信,例如有新的同步节点加入时需要从其他的同步节点同步数据,也需要经由分发节点来进行。分发节点使得链上的任意两个数据节点之间可以相互通信。
根据本公开实施例的运行联盟链网络的方法和联盟链网络,将联盟链网络中的节点分为由参与共识过程并生成区块数据的共识节点形成的共识层、由分发区块数据的分发节点形成的分发层、和由同步区块数据的同步节点形成的同步层,每个共识节点连接一个或多个分发节点并且每个分发节点连接一个或多个同步节点,使得形成对区块分发的三层高度的多源组播树结构。多源组播树结构使每个共识节点成为了一个单源组播树的数据源,链上区块的分发从每个共识节点开始,沿着每个单源组播树结构分发。固定一个分发层,保障了分发的低延迟特性。随着链上节点数量的增加,可以通过适度增加分发层节点的个数,在分发时延稳定的情况下,保障链的整体性能不降低,提升链的扩展性。在一个具体的示例中,如果联盟链网络中的每个链上节点能够支撑的负载节点个数为20个,则如果配置40个共识节点,可以支撑800个分发节点,并进一步支撑16000个同步节点。如果该联盟链网络上平均每个交易大小为1KB,要支撑1000TPS,则区块同步占用的节点带宽为:1000TPS*1KB*8bit*20=160Mbps。而如果采用常规的方案,例如全连接模式下进行应用层广播,则16000个节点的区块同步将占用远超160Mbps的节点带宽。
图10是根据本公开实施例的用于联盟链网络的节点设备700的至少部分的结构示意图。节点设备700包括一个或多个处理器710、一个或多个存储器720、以及通常存在于计算机等装置中的其他组件(未示出)。一个或多个存储器720中的每一个可以存储可由一个或多个处理器710访问的内容,包括可以由一个或多个处理器710执行的指令721、以及可以由一个或多个处理器710来检索、操纵或存储的数 据722。
指令721可以是将由一个或多个处理器710直接地执行的任何指令集,诸如机器代码,或者间接地执行的任何指令集,诸如脚本。本公开中的术语“指令”、“应用”、“过程”、“步骤”和“程序”在本公开中可以互换使用。指令721可以存储为目标代码格式以便由一个或多个处理器710直接处理,或者存储为任何其他计算机语言,包括按需解释或提前编译的独立源代码模块的脚本或集合。本公开其他部分更加详细地解释了指令721的功能、方法和例程。
一个或多个存储器720可以是能够存储可由一个或多个处理器710访问的内容的任何临时性或非临时性计算机可读存储介质,诸如硬盘驱动器、存储卡、ROM、RAM、DVD、CD、USB存储器、能写存储器和只读存储器等。一个或多个存储器720中的一个或多个可以包括分布式存储系统,其中指令721和/或数据722可以存储在可以物理地位于相同或不同的地理位置处的多个不同的存储装置上。一个或多个存储器720中的一个或多个可以经由网络连接至一个或多个第一装置710,和/或可以直接地连接至或并入一个或多个处理器710中的任何一个中。
一个或多个处理器710可以根据指令721来检索、存储或修改数据722。虽然本公开所描述的主题不受任何特定数据结构限制,但是数据722还可能存储在计算机寄存器(未示出)中,作为具有许多不同的字段和记录的表格或XML文档存储在关系型数据库中。数据722可以被格式化为任何计算装置可读格式,诸如但不限于二进制值、ASCII或统一代码。此外,数据722可以包括足以识别相关信息的任何信息,诸如编号、描述性文本、专有代码、指针、对存储在诸如其他网络位置处等其他存储器中的数据的引用或者被函数用于计算相关数据的信息。
一个或多个处理器710可以是任何常规处理器,诸如市场上可购得的中央处理单元(CPU)、图形处理单元(GPU)等。可替换地,一个或多个处理器710还可以是专用组件,诸如专用集成电路(ASIC)或其他基于硬件的处理器。虽然不是必需的,但是一个或多个处理器710可以包括专门的硬件组件来更快或更有效地执行特定的计算过程。
虽然图10中示意性地将一个或多个处理器710以及一个或多个存储器720示出在同一个框内,但是节点设备700可以实际上包括可能存在于同一个物理壳体内或不同的多个物理壳体内的多个处理器或存储器。因此,引用处理器、计算机、计算装置或存储器应被理解成包括引用可能并行操作或可能非并行操作的处理器、计算机、计算装置或存储器的集合。
图11是可应用于根据本公开一个或多个示例性实施例的通用硬件系统800的示例性框图。现在将参考图11描述系统800,其是可以应用于本公开的各方面的硬件设备的示例。上述各实施例中的节点设备700可以包括系统800的全部或部分。系统800可以是被配置为执行处理和/或计算的任何机器,可以是但不限于工作站、服务器、台式计算机、膝上型计算机、平板计算机、个人数据助理、智能电话、车载电脑、或其任何组合。
系统800可以包括可能经由一个或多个接口与总线802连接或与总线802通信的元件。例如,系统800可以包括总线802,以及一个或多个处理器804,一个或多个输入设备806和一个或多个输出设备808。一个或多个处理器804可以是任何类型的处理器,可以包括但不限于一个或多个通用处理器和/或一个或多个专用处理器(例如特殊处理芯片)。上文所述的方法中的各个操作和/或步骤均可以通过一个或多个处理器804执行指令来实现。
输入设备806可以是可以向计算设备输入信息的任何类型的设备,可以包括但不限于鼠标、键盘、触摸屏、麦克风和/或遥控器。输出设备808可以是可以呈现信息的任何类型的设备,可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。
系统800还可以包括非暂时性存储设备810或者与非暂时性存储设备810连接。非暂时性存储设备810可以是非暂时性的并且可以实现数据存储的任何存储设备,可以包括但不限于磁盘驱动器、光学存储设备、固态存储器、软盘、硬盘、磁带或任何其他磁介质、光盘或任何其他光学介质、ROM(只读存储器)、RAM(随机存取存储器)、高速缓冲存储器、和/或任何其他存储器芯片/芯片组、和/或计算机 可从其读取数据、指令和/或代码的任何其他介质。非暂时性存储设备810可以从接口拆卸。非暂时性存储设备810可以具有用于实现上述方法、操作、步骤和过程的数据/指令/代码。
系统800还可以包括通信设备812。通信设备812可以是能够与外部设备和/或与网络通信的任何类型的设备或系统,可以包括但不限于调制解调器、网卡、红外通信设备、无线通信设备、和/或芯片组,例如蓝牙设备、802.11设备、WiFi设备、WiMax设备、蜂窝通信设备、卫星通信设备、和/或类似物。
总线802可以包括但不限于工业标准体系结构(ISA)总线、微通道架构(MCA)总线、增强型ISA(EISA)总线、视频电子标准协会(VESA)本地总线、和外围部件互连(PCI)总线。特别地,对于车载设备,总线802还可以包括控制器区域网络(CAN)总线或设计用于在车辆上应用的其他架构。
系统800还可以包括工作存储器814,其可以是可以存储对处理器804的工作有用的指令和/或数据的任何类型的工作存储器,可以包括但不限于随机存取存储器和/或只读存储设备。
软件元素可以位于工作存储器814中,包括但不限于操作系统816、一个或多个应用程序818、驱动程序、和/或其他数据和代码。用于执行上述方法、操作和步骤的指令可以包括在一个或多个应用程序818中。软件元素的指令的可执行代码或源代码可以存储在非暂时性计算机可读存储介质中,例如上述存储设备810,并且可以通过编译和/或安装被读入工作存储器814中。还可以从远程位置下载软件元素的指令的可执行代码或源代码。
还应该理解,可以根据具体要求进行变化。例如,也可以使用定制硬件,和/或可以用硬件、软件、固件、中间件、微代码、硬件描述语言或其任何组合来实现特定元件。此外,可以采用与诸如网络输入/输出设备之类的其他计算设备的连接。例如,根据本公开实施例的方法或设备中的一些或全部可以通过使用根据本公开的逻辑和算法的、用汇编语言或硬件编程语言(诸如VERILOG,VHDL,C++)的编程硬件(例如,包括现场可编程门阵列(FPGA)和/或可编程逻辑阵列(PLA)的可编程逻辑电路)来实现。
还应该理解,系统800的组件可以分布在网络上。例如,可以使用一个处理器执行一些处理,而可以由远离该一个处理器的另一个处理器执行其他处理。系统800的其他组件也可以类似地分布。这样,系统800可以被解释为在多个位置执行处理的分布式计算系统。
尽管到目前为止已经参考附图描述了本公开的各方面,但是上述方法,系统和设备仅仅是示例性示例,并且本公开的范围不受这些方面的限制,而是仅由以下方面限定:所附权利要求及其等同物。可以省略各种元件,或者可以用等效元件代替。另外,可以以与本公开中描述的顺序不同的顺序执行这些步骤。此外,可以以各种方式组合各种元件。同样重要的是,随着技术的发展,所描述的许多元素可以由在本公开之后出现的等同元素代替。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit  Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本公开一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本公开一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
本公开是参照根据本公开实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本公开一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本公开一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本公开一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本公开一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本公开一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本公开中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本公开的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本公开中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本公开中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本公开一个或多个实施例的实施例而已,并不用于限制本本公开一个或多个实施例。对于本领域技术人员来说,本公开一个或多个实施例可以有各种更改和变化。凡在本公开的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。

Claims (52)

  1. 一种运行联盟链网络的方法,所述联盟链网络包括被配置为链式存储区块数据的多个数据节点以及被配置为不存储区块数据并且传输数据的多个分发节点,所述方法包括:
    将所述多个数据节点划分为第一子集和第二子集,并将第一子集的数据节点配置为参与共识过程以生成并存储区块,将第二子集的数据节点配置为不参与共识过程并且从第一子集的数据节点获取并存储所生成的区块,
    将所述分发节点配置为从与其连接的第一子集的数据节点接收所生成的区块,并将所述区块传输到与其连接的第二子集的数据节点。
  2. 根据权利要求1所述的方法,还包括:
    通过执行智能合约从第一子集的数据节点中定期地随机选择出一个第一数据节点,通过执行智能合约从第二子集的数据节点中定期地随机选择出一个第二数据节点,并且将所述第一数据节点和所述第二数据节点配置为功能互换。
  3. 根据权利要求2所述的方法,其中,在所述功能互换之前,所述第一数据节点与所述多个分发节点中的第一分发节点相连接并且所述第二数据节点与所述多个分发节点中的第二分发节点相连接,所述方法还包括:
    将所述第二数据节点连接到所述第一分发节点并使得所述第二数据节点断开与第二分发节点的连接;
    使得所述第一数据节点断开与所述第一分发节点的连接,并且将所述第二数据节点切换配置为参与共识过程以生成并存储区块;以及
    将所述第一数据节点切换配置为从第一子集的数据节点获取并存储所生成的区块,并使得所述第一数据节点建立与所述多个分发节点中的一个分发节点的连接,从而使得所述第一数据节点和所述第二数据节点的功能互换。
  4. 根据权利要求1所述的方法,还包括将所述多个数据节点和所述多个分发节点中的各节点配置为基于所述联盟链网络的节点管理合约来管理。
  5. 根据权利要求1所述的方法,还包括将所述分发节点配置为与其他各分发节点分别具有通信连接。
  6. 根据权利要求4所述的方法,还包括将所述分发节点配置为监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表建立与其他各分发节点的通信连接。
  7. 根据权利要求1所述的方法,还包括将所述多个分发节点配置为将第二子集的数据节点接收的交易传输到第一子集的数据节点。
  8. 根据权利要求5所述的方法,还包括:
    将第一子集的数据节点配置为通过所述多个分发节点中的一个或多个分发节点相互通信;和/或
    将第二子集的数据节点配置为通过所述多个分发节点中的一个或多个分发节点相互通信。
  9. 根据权利要求1所述的方法,其中,第一子集的数据节点的个数小于或等于分发节点的个数,并且分发节点的个数小于或等于第二子集的数据节点的个数。
  10. 根据权利要求1所述的方法,还包括将第一子集中的每个数据节点配置为与所述多个分发节点中的一个或多个分发节点相连接并且将所述多个分发节点中的每个分发节点配置为只与第一子集中的一个数据节点相连接,以及将第二子集中的每个数据节点配置为只与所述多个分发节点中的一个分发节点相连接并且将所述多个分发节点中的每个分发节点配置为与第二子集中的一个或多个数据节点相连接。
  11. 根据权利要求4所述的方法,还包括将数据节点配置为监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表连接分发节点。
  12. 根据权利要求10所述的方法,还包括将第一子集中的数据节点配置为定期地向所述多个分发节点中的一个或多个分发节点发送连接请求,并将所述一个或多个分发节点中的每个分发节点配置为:
    响应于已与第一子集的数据节点相连接,拒绝所述连接请求;以及
    响应于未与第一子集的数据节点相连接,接受所述连接请求以建立连接。
  13. 根据权利要求12所述的方法,还包括将第一子集中的数据节点配置为建立描述与其连接的分发节点的路由表。
  14. 根据权利要求10所述的方法,还包括将第二子集中的每个数据节点配置为向所述多个分发节点中的一个分发节点发送连接请求,并将所述一个分发节点配置为:
    响应于其负载情况满足条件,接受所述连接请求以建立连接;以及
    响应于其负载情况不满足条件,基于节点列表和各分发节点的负载情况,向所述连接请求的发起方通知作为连接目标的分发节点的ID。
  15. 根据权利要求14所述的方法,还包括将分发节点配置为建立描述与其连接的第二子集的数据节点的路由表,以及所述多个分发节点之间共享各自的路由表,从而使得每个分发节点基于各分发节点的路由表获得各分发节点的负载情况。
  16. 一种联盟链网络,包括:
    多个数据节点,所述数据节点被配置为链式存储区块数据;以及
    多个分发节点,所述分发节点被配置为不存储区块数据并且传输数据,其中,
    所述多个数据节点被划分为第一子集和第二子集,第一子集的数据节点被配置为参与共识过程以生成并存储区块,第二子集的数据节点被配置为不参与共识过程并且从第一子集的数据节点获取并存储所生成的区块,
    所述分发节点被配置为从与其连接的第一子集的数据节点接收所生成的区块,并将所述区块传输到与其连接的第二子集的数据节点。
  17. 根据权利要求16所述的联盟链网络,其中,所述多个数据节点还被配置为:第一子集的数据节点中被定期地随机选择出一个第一数据节点,第二子集的数据节点中被定期地随机选择出一个第二数据节点,并且所述第一数据节点和所述第二数据节点被配置为功能互换,其中,通过执行智能合约来进行所述随机选择。
  18. 根据权利要求17所述的联盟链网络,其中,在所述功能互换之前,所述第一数据节点与所述多个分发节点中的第一分发节点相连接并且所述第二数据节点与所述多个分发节点中的第二分发节点相连接,所述功能互换包括:
    所述第二数据节点连接到所述第一分发节点并断开与第二分发节点的连接;
    所述第一数据节点断开与所述第一分发节点的连接,并且所述第二数据节点被切换配置为参与共识过程以生成并存储区块;以及
    所述第一数据节点被切换配置为从第一子集的数据节点获取并存储所生成的区块,并建立与所述多个分发节点中的一个分发节点的连接。
  19. 根据权利要求16所述的联盟链网络,其中,所述多个数据节点和所述多个分发节点中的每个节点均被配置为基于所述联盟链网络的节点管理合约来管理。
  20. 根据权利要求16所述的联盟链网络,其中,所述分发节点被配置为与其他各分发节点分别具有通信连接。
  21. 根据权利要求19所述的联盟链网络,其中,所述分发节点被配置为监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表建立与其他各分发节点的通信连接。
  22. 根据权利要求16所述的联盟链网络,其中,所述多个分发节点还被配置为将第二子集的数据节 点接收的交易传输到第一子集的数据节点。
  23. 根据权利要求20所述的联盟链网络,其中,第一子集的数据节点还被配置为通过所述多个分发节点中的一个或多个分发节点相互通信;和/或第二子集的数据节点还被配置为通过所述多个分发节点中的一个或多个分发节点相互通信。
  24. 根据权利要求16所述的联盟链网络,其中,第一子集的数据节点的个数小于或等于分发节点的个数,并且分发节点的个数小于或等于第二子集的数据节点的个数。
  25. 根据权利要求16所述的联盟链网络,其中,第一子集中的每个数据节点还被配置为与所述多个分发节点中的一个或多个分发节点相连接并且所述多个分发节点中的每个分发节点被配置为只与第一子集中的一个数据节点相连接,第二子集中的每个数据节点还被配置为只与所述多个分发节点中的一个分发节点相连接并且所述多个分发节点中的每个分发节点被配置为与第二子集中的一个或多个数据节点相连接。
  26. 根据权利要求19所述的联盟链网络,其中,所述多个数据节点中的每个数据节点被配置为监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表连接分发节点。
  27. 根据权利要求25所述的联盟链网络,其中,第一子集中的数据节点还被配置为定期地向所述多个分发节点中的一个或多个分发节点发送连接请求,所述一个或多个分发节点中的每个分发节点:
    响应于已与第一子集的数据节点相连接,拒绝所述连接请求;以及
    响应于未与第一子集的数据节点相连接,接受所述连接请求以建立连接。
  28. 根据权利要求27所述的联盟链网络,其中,第一子集中的每个数据节点还被配置为建立描述与其连接的分发节点的路由表。
  29. 根据权利要求25所述的联盟链网络,其中,第二子集中的每个数据节点还被配置为向所述多个分发节点中的一个分发节点发送连接请求,所述一个分发节点:
    响应于其负载情况满足条件,接受所述连接请求以建立连接;以及
    响应于其负载情况不满足条件,基于节点列表和各分发节点的负载情况,向所述连接请求的发起方通知作为连接目标的分发节点的ID。
  30. 根据权利要求29所述的联盟链网络,其中,所述多个分发节点中的每个分发节点被配置为建立描述与其连接的第二子集的数据节点的路由表,以及所述多个分发节点之间共享各自的路由表,从而使得每个分发节点基于各分发节点的路由表获得各分发节点的负载情况。
  31. 一种联盟链网络,包括多个共识节点、多个分发节点和多个同步节点,其中,
    所述共识节点被配置为参与共识过程以生成并链式存储区块以及与所述多个分发节点中的一个或多个分发节点相连接;
    所述分发节点被配置为与所述多个同步节点中的一个或多个同步节点相连接并监听其所连接的共识节点,以及响应于其所连接的共识节点生成区块,从其所连接的共识节点获取所述区块并将所述区块传输给其所连接的一个或多个同步节点;以及
    所述同步节点被配置为不参与共识过程并且从其所连接的分发节点接收所述区块并链式存储所述区块,其中,
    所述多个共识节点中被定期地随机选择出一个第一节点,所述多个同步节点中被定期地随机选择出一个第二节点,并且所述第一节点和所述第二节点被配置为功能互换。
  32. 根据权利要求31所述的联盟链网络,其中,通过执行智能合约来进行所述随机选择。
  33. 根据权利要求31所述的联盟链网络,其中,在所述功能互换之前,所述第一节点与所述多个分发节点中的第一分发节点相连接并且所述第二节点与所述多个分发节点中的第二分发节点相连接,所述功能互换包括:
    所述第二节点连接到所述第一分发节点并断开与第二分发节点的连接;
    所述第一节点断开与所述第一分发节点的连接,并且所述第二节点被切换配置为参与共识过程以生成并存储区块;以及
    所述第一节点被切换配置为不参与共识过程并且从其所连接的分发节点接收并存储区块,并建立与所述多个分发节点中的一个分发节点的连接。
  34. 根据权利要求31所述的联盟链网络,其中,所述分发节点被配置为与其他各分发节点分别具有通信连接。
  35. 根据权利要求34所述的联盟链网络,其中,所述分发节点被配置为将同步节点接收的交易传输给当前分发节点所连接的共识节点和其他分发节点。
  36. 根据权利要求34所述的联盟链网络,其中,所述多个共识节点和所述多个同步节点中的任两个节点之间的通信通过所述多个分发节点中的一个或多个分发节点进行。
  37. 根据权利要求31所述的联盟链网络,其中,所述多个共识节点和所述多个同步节点中的每个节点被配置为监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表连接分发节点。
  38. 根据权利要求31所述的联盟链网络,其中,所述共识节点还被配置为定期地向所述多个分发节点中的一个或多个分发节点发送连接请求,所述一个或多个分发节点中的每个分发节点:
    响应于已与共识节点相连接,拒绝所述连接请求;以及
    响应于未与共识节点相连接,接受所述连接请求以建立连接。
  39. 根据权利要求31所述的联盟链网络,其中,所述同步节点还被配置为向所述多个分发节点中的一个分发节点发送连接请求,所述一个分发节点:
    响应于其负载情况满足条件,接受所述连接请求以建立连接;以及
    响应于其负载情况不满足条件,基于所述联盟链网络的节点列表和各分发节点的负载情况,向所述连接请求的发起方通知作为连接目标的分发节点的ID。
  40. 根据权利要求39所述的联盟链网络,其中,所述分发节点被配置为建立描述与其连接的同步节点的路由表,以及所述多个分发节点之间共享各自的路由表,从而使得每个分发节点基于各分发节点的路由表获得各分发节点的负载情况。
  41. 一种用于联盟链网络的节点设备,包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器被配置为存储一系列计算机可执行指令,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,使所述一个或多个处理器执行:响应于被配置为参与共识过程的共识节点:
    监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表定期地与所述联盟链网络中的被配置为传输数据的一个或多个分发节点建立连接;
    参与共识过程以生成并链式存储区块;以及
    将所生成的区块传输给与其连接的分发节点。
  42. 根据权利要求41所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:响应于被配置为共识节点:
    监听节点选择合约更新的事件以获取定期地随机选择的将要变换的共识节点ID;
    响应于将要变换的共识节点ID指向所述节点设备,断开与分发节点之间的连接;以及
    切换为不参与共识过程的同步节点,并基于节点列表与一个分发节点建立连接。
  43. 根据权利要求41所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:响应于被配置为共识节点:
    接收并记录分发节点转发的交易。
  44. 根据权利要求41所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:响应于被配置为不参与共识过程的同步节点:
    监听节点管理合约更新的事件以获取更新的节点列表,并基于节点列表与一个分发节点建立连接;以及
    从其连接的分发节点接收并链式存储区块。
  45. 根据权利要求41所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:响应于被配置为同步节点:
    监听节点选择合约更新的事件以获取定期地随机选择的将要变换的同步节点ID;以及
    响应于将要变换的同步节点ID指向所述节点设备,获取将要变换的共识节点ID所对应的共识节点所连接的分发节点的信息;
    连接到将要变换的共识节点ID所对应的共识节点所连接的分发节点并断开原本连接的分发节点;以及
    切换为参与共识过程的共识节点。
  46. 根据权利要求42或44所述的节点设备,其中,基于节点列表与一个分发节点建立连接包括:
    基于节点列表任意选择一个分发节点并发送连接请求;
    响应于连接请求被接受,与所述分发节点建立连接;以及
    响应于连接请求被拒绝,从所述分发节点接收作为连接目标的另一个分发节点的ID,并向所述另一个分发节点发送连接请求。
  47. 一种用于联盟链网络的节点设备,包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器被配置为存储一系列计算机可执行指令,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,使所述一个或多个处理器执行:
    与所述联盟链网络中的一个被配置为参与共识过程并存储区块的共识节点建立连接,并且与所述联盟链网络中的一个或多个被配置为不参与共识过程并存储区块的同步节点建立连接;以及
    响应于其所连接的共识节点生成区块,从其所连接的共识节点获取所述区块,并将所述区块传输给其所连接的一个或多个同步节点。
  48. 根据权利要求47所述的节点设备,其中,所述节点设备与所述联盟链网络中其他的被配置为传输数据的分发节点分别具有通信连接。
  49. 根据权利要求48所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:
    将同步节点接收的交易传输给所述节点设备所连接的共识节点和其他分发节点。
  50. 根据权利要求47所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:
    响应于接收到来自共识节点的连接请求并且已与共识节点相连接,拒绝所述连接请求;以及
    响应于接收到来自共识节点的连接请求并且未与共识节点相连接,接受所述连接请求以与所述共识节点建立连接。
  51. 根据权利要求47所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:
    响应于接收到来自同步节点的连接请求并且所述节点设备的负载情况满足条件,接受所述连接请求以建立连接;以及
    响应于接收到来自同步节点的连接请求并且所述节点设备的负载情况不满足条件,基于所述联盟链 网络的节点列表和各分发节点的负载情况,向所述连接请求的发起方通知作为连接目标的分发节点的ID。
  52. 根据权利要求51所述的节点设备,其中,所述一系列计算机可执行指令在由所述一个或多个处理器执行时,还使所述一个或多个处理器执行:
    建立描述与其连接的同步节点的路由表并与其他分发节点共享路由表,从而使得基于各分发节点的路由表来获得各分发节点的负载情况。
PCT/CN2022/135407 2022-06-01 2022-11-30 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备 WO2023231343A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210615860.0 2022-06-01
CN202210615860.0A CN115037756A (zh) 2022-06-01 2022-06-01 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备

Publications (1)

Publication Number Publication Date
WO2023231343A1 true WO2023231343A1 (zh) 2023-12-07

Family

ID=83123743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135407 WO2023231343A1 (zh) 2022-06-01 2022-11-30 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备

Country Status (2)

Country Link
CN (1) CN115037756A (zh)
WO (1) WO2023231343A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037756A (zh) * 2022-06-01 2022-09-09 蚂蚁区块链科技(上海)有限公司 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107018125A (zh) * 2017-02-17 2017-08-04 阿里巴巴集团控股有限公司 一种区块链系统、数据存储方法及装置
CN114157671A (zh) * 2021-11-26 2022-03-08 支付宝(杭州)信息技术有限公司 将区块链网络承载的信息向多个客户端节点分发的方法
CN114218612A (zh) * 2021-12-14 2022-03-22 河北省科学院应用数学研究所 一种适用于联盟链高频交易场景的共识方法
CN115037756A (zh) * 2022-06-01 2022-09-09 蚂蚁区块链科技(上海)有限公司 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040585B (zh) * 2017-02-22 2020-06-19 创新先进技术有限公司 一种业务校验的方法及装置
CN109981750B (zh) * 2019-03-06 2021-09-17 北京百度网讯科技有限公司 业务流程系统、业务数据处理方法和装置
EP3970343A4 (en) * 2019-05-15 2022-12-28 Nokia Technologies OY SCHEME FOR CREATING MULTIPLE PARALLEL BLOCKS FOR BLOCKCHAIN
CN111159295A (zh) * 2019-12-28 2020-05-15 深圳市网心科技有限公司 区块链系统、数据存储方法、数据存储装置和设备及介质
CN111277645B (zh) * 2020-01-16 2023-02-10 深圳市迅雷网络技术有限公司 主备节点热切换方法、区块链系统、区块链节点及介质
CN112685505B (zh) * 2021-01-07 2022-06-24 腾讯科技(深圳)有限公司 一种交易数据处理方法、装置、计算机设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107018125A (zh) * 2017-02-17 2017-08-04 阿里巴巴集团控股有限公司 一种区块链系统、数据存储方法及装置
CN114157671A (zh) * 2021-11-26 2022-03-08 支付宝(杭州)信息技术有限公司 将区块链网络承载的信息向多个客户端节点分发的方法
CN114218612A (zh) * 2021-12-14 2022-03-22 河北省科学院应用数学研究所 一种适用于联盟链高频交易场景的共识方法
CN115037756A (zh) * 2022-06-01 2022-09-09 蚂蚁区块链科技(上海)有限公司 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备

Also Published As

Publication number Publication date
CN115037756A (zh) 2022-09-09

Similar Documents

Publication Publication Date Title
US10516577B2 (en) Graceful scaling in software driven networks
US10367852B2 (en) Multiplexed demand signaled distributed messaging
CN103442049B (zh) 一种面向构件的混合型云操作系统体系结构及其通信方法
US8725680B2 (en) Media content location awareness and decision making
CN101711387B (zh) 移动设备的功能的对等共享
US20150215405A1 (en) Methods of managing and storing distributed files based on information-centric network
CN101421967B (zh) 同步家庭网络装置的内容的方法和设备
WO2021088641A1 (zh) 数据发送方法、处理方法、接收方法及其设备、存储介质
EP2838243B1 (en) Capability aggregation and exposure method and system
JP2022534179A (ja) データ伝送方法、装置、コンピュータプログラム、及びコンピュータ装置
WO2023231343A1 (zh) 一种运行联盟链网络的方法、联盟链网络和用于联盟链网络的节点设备
US10284381B1 (en) Low latency data distribution in a computing service environment
US10855538B2 (en) Single management connection automatic device stack configuration system
WO2024001022A1 (zh) 跨子网调用
US10013232B2 (en) Wireless speaker connection management
CN115883669A (zh) 一种数据分发方法、系统、设备和介质
CN114157671B (zh) 将区块链网络承载的信息向多个客户端节点分发的方法
TW202027482A (zh) 基於聯盟鏈網路的業務處理方法及系統
WO2023231344A1 (zh) 一种运行联盟链网络的方法
CN114363335B (zh) 跨链交互方法及装置
CN114205233B (zh) 一种面向数据管控的智能合约自适应配置与执行的系统
CN114363254A (zh) 租户隔离方法、装置及电子设备
JP6087343B2 (ja) パーソナルネットワークの合併方法及び装置、並びにパーソナルネットワークの分割方法及び装置
CN113810313B (zh) 分布式会话报文的处理方法及处理装置
US11943316B1 (en) Database connection multiplexing for prepared statements

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22944644

Country of ref document: EP

Kind code of ref document: A1