CN114679457B - Node grouping method in block chain and block chain link point - Google Patents

Node grouping method in block chain and block chain link point Download PDF

Info

Publication number
CN114679457B
CN114679457B CN202210327144.2A CN202210327144A CN114679457B CN 114679457 B CN114679457 B CN 114679457B CN 202210327144 A CN202210327144 A CN 202210327144A CN 114679457 B CN114679457 B CN 114679457B
Authority
CN
China
Prior art keywords
node
target
blockchain
packet
delays
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
CN202210327144.2A
Other languages
Chinese (zh)
Other versions
CN114679457A (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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210327144.2A priority Critical patent/CN114679457B/en
Publication of CN114679457A publication Critical patent/CN114679457A/en
Application granted granted Critical
Publication of CN114679457B publication Critical patent/CN114679457B/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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Abstract

The embodiment of the specification provides a node grouping method in a blockchain and a blockchain node. The method is performed by a first node, comprising: obtaining grouping information from the blockchain, wherein the grouping information is stored in a contract state of the intelligent contract, and the grouping information comprises the following components: the group identification of M groups and the node information of each node contained in the M groups, wherein M is more than or equal to 0; when M is more than or equal to 1, determining that the first node can establish connection with K groups in M groups according to the group information, wherein K is more than or equal to 1 and less than or equal to M; determining time delay between the first node and each packet in the K packets to obtain K first target time delays; determining a target group according to the K first target delays; a first transaction is sent to the blockchain, the first transaction for invoking the smart contract for adding the first node in the target group of current contract states. Therefore, the nodes with relatively close distances are aggregated into a group, the delay in block distribution is reduced, and the block distribution efficiency is improved.

Description

Node grouping method in block chain and block chain link point
Technical Field
The embodiment of the specification belongs to the technical field of block chains, and particularly relates to a node grouping method in a block chain and a block chain node.
Background
Blockchain (Blockchain) is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. In the block chain system, the data blocks are combined into a chain data structure in a sequential connection mode according to the time sequence, and the data cannot be tampered and counterfeited in a cryptographic mode. Because the blockchain has the characteristics of decentralization, non-tamperability of information, autonomy and the like, the blockchain is also receiving more and more attention and application.
Currently, with the rapid development of blockchain technology, the blockchain is larger and larger in scale, and the service is more and more complex. In a large-scale blockchain network, as the scale of nodes increases, the efficiency of consensus is attenuated, the bandwidth required by the nodes is increased, and the cost is increased. The broadcast protocol of the general block data on the public chain can adopt the Gossip protocol for distribution, but the redundancy of the data distribution mode is particularly high, the distribution efficiency is low, and the time delay is higher.
Disclosure of Invention
Embodiments of the present disclosure are directed to a node grouping method in a blockchain, a blockchain node, a computer readable storage medium, and a computing device, which improve the efficiency of block distribution on the blockchain and reduce the delay.
To achieve the above object, a first aspect of the present specification provides a node grouping method in a blockchain, the method being performed by a first node, the method comprising: obtaining grouping information from a blockchain, wherein the grouping information is stored in a contract state of an intelligent contract, and the grouping information comprises the following components: the packet identification of M packets and the node information of each node contained in the M packets, wherein M is more than or equal to 0; when M is more than or equal to 1, determining that the first node can establish connection with K groups in the M groups according to the group information, wherein K is more than or equal to 1 and less than or equal to M; determining time delay between the first node and each packet in the K packets to obtain K first target time delays; determining a target packet according to the K first target delays; a first transaction is sent to the blockchain, the first transaction for invoking the smart contract for adding the first node in the target group of contract states.
A second aspect of the present specification provides a blockchain node comprising: a communication module configured to obtain grouping information from a blockchain, the grouping information being stored in a contract state of an intelligent contract, the grouping information including: the packet identification of M packets and the node information of each node contained in the M packets, wherein M is more than or equal to 0; the processing module is configured to determine that the blockchain node can establish connection with K groups in the M groups according to the grouping information when M is more than or equal to 1, wherein K is more than or equal to 1 and less than or equal to M; determining time delay between the blockchain node and each packet in the K packets to obtain K first target time delays; the processing module is further configured to determine a target packet according to the K first target delays; the communication module is further configured to send a first transaction to the blockchain, the first transaction for invoking the smart contract for adding the blockchain node in the target group of contract states.
A third aspect of the present description provides a computer-readable storage medium, on which a computer program is stored which, when executed in a computing device, performs the method of the first aspect described above.
A fourth aspect of the present specification provides a computing device comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the method of the first aspect described above when executing the computer program.
Through the method and the blockchain nodes provided in one or more embodiments of the present disclosure, nodes in the blockchain may be grouped by the time delay between the nodes, so that each node with a relatively close distance is grouped into a group, the time delay during the block distribution is reduced, and the efficiency of the block distribution is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a network schematic diagram of a block chain network in one embodiment of the present disclosure;
FIG. 2 is a network schematic diagram of a block chain network in another embodiment of the present disclosure;
FIG. 3 is a flow chart of a method of grouping nodes in a blockchain in an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a process of determining a time delay between a first node and a second node according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating a process of determining, by a first node, a target packet according to K first target delays in an embodiment of the present disclosure;
FIG. 6 is a flow diagram of another method of grouping nodes in a blockchain in an embodiment of the present disclosure;
FIG. 7 is a flow chart of a method of grouping nodes in a blockchain in accordance with an embodiment of the present disclosure;
FIG. 8 is a flow chart of a method of grouping nodes in a blockchain in accordance with an embodiment of the present disclosure;
FIG. 9 is a block chain node architecture diagram according to one embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
Generally, in a large-scale blockchain network, a certain number of nodes are often selected as consensus nodes. In the process of consensus transaction, consensus nodes are used for consensus transaction and generating blocks, and then the blocks are distributed to other candidate nodes except the consensus nodes in the blockchain network by the consensus nodes. For example, when the number of candidate nodes in the blockchain network is n, the consensus node needs to send blocks to n candidate nodes respectively, which increases the uplink bandwidth pressure of the consensus node, affects the consensus efficiency, and has lower block distribution efficiency. In addition, because the distances between different candidate nodes and the consensus node are different, when the distances between the candidate nodes and the consensus node are far, the time length of the transmission block between the candidate nodes and the consensus node is also increased, and the time delay is higher.
In view of the above, the embodiments of the present disclosure provide a node grouping method in a blockchain, which may group nodes in the blockchain based on a time delay between the nodes, so as to divide the nodes that are closer to each other into the same group. Thus, in the case of distributing blocks later, only one block needs to be distributed into one group. Therefore, the time length of the transmission block and the bandwidth requirement of the common node distribution block in the block chain are reduced, the throughput in unit time is improved, and the block distribution efficiency is improved.
Exemplary, fig. 1 is a schematic architecture diagram of a blockchain network provided in the embodiments of the present disclosure. As shown in fig. 1, the blockchain includes, for example, 4 consensus nodes and 9 candidate nodes, for example, 13 nodes in total. Each node may be any means, server or cluster of devices, etc. having computing, processing capabilities. The connections between nodes are schematically represented as P2P (Peer to Peer) connections.
The nodes may store a full amount of ledgers, i.e., the state of all blocks and all accounts. Wherein each node in the blockchain may generate the same state in the blockchain by performing the same transaction, each node in the blockchain may store the same state database. It will be appreciated that while 13 nodes are shown in FIG. 1 as being included in a blockchain, embodiments of the present description are not so limited, but may include other numbers of nodes. Specifically, the nodes included in the blockchain may meet the bayer fault tolerance (Byzantine Fault Tolerance, BFT) requirements. The bayer fault tolerance requirement is understood to be that the bin node may exist inside the blockchain, and the blockchain does not show the bin behavior. In general, some bayer fault-tolerant algorithms require a number of nodes greater than (3f+1), where f is the number of bayer nodes, e.g., the practical bayer fault-tolerant algorithm PBFT (Practical Byzantine Fault Tolerance).
Transactions in the blockchain domain may refer to task units that execute in the blockchain and are recorded in the blockchain. The transaction typically includes a send field (From), a receive field (To), and a Data field (Data). Where the transaction is a transfer transaction, the From field indicates an account address From which the transaction was initiated (i.e., a transfer task To another account was initiated), the To field indicates an account address From which the transaction was received (i.e., a transfer was received), and the Data field includes the transfer amount. In the case of a transaction calling a smart contract in a blockchain, the From field represents the account address From which the transaction originated, the To field represents the account address of the contract that the transaction called, and the Data field includes Data, such as the name of the function in the calling contract, and the incoming parameters To the function, for retrieving the code of the function From the blockchain and executing the code of the function when the transaction is executed.
The functionality of the smart contract may be provided in the blockchain. Intelligent contracts on blockchains are contracts on blockchain systems that can be executed by transaction triggers. The smart contracts may be defined in the form of codes. Invoking the smart contract in the ethernet network initiates a transaction directed to the smart contract address such that each node in the ethernet network runs the smart contract code in a distributed manner. It should be noted that, in addition to the smart contracts that can be created by the user, the smart contracts can also be set by the system in the creation block. Such contracts are commonly referred to as system contracts. In general, some blockchain data structures, parameters, attributes, and methods may be set in a system contract. In addition, an account with system administrator rights may create a system level contract, or modify a system level contract (simply referred to as a system contract). Wherein the system contracts can be used to add data structures for data of different services in the blockchain.
In the scenario of deploying contracts, for example, bob sends a transaction containing information to create an intelligent contract (i.e., deploying a contract) into a blockchain as shown in fig. 1, the data field of the transaction includes the code (e.g., bytecode or machine code) of the contract to be created, and the to field of the transaction is empty to indicate that the transaction is for deploying the contract. After agreement is reached between nodes through a consensus mechanism, determining a contract address '0 x6f8ae93 …' of the contract, adding a contract account corresponding to the contract address of the intelligent contract in a state database by each node, distributing a state storage corresponding to the contract account, and storing a contract code in the state storage of the contract, so that the contract is successfully created.
In the scenario of invoking a contract, for example, bob sends a transaction for invoking a smart contract into a blockchain as shown in fig. 1, the from field of the transaction is the address of the account of the transaction initiator (i.e., bob), the "0x6f8ae93 …" in the to field represents the address of the invoked smart contract, and the data field of the transaction includes the method and parameters for invoking the smart contract. After the transaction is consensus in the blockchain, each node in the blockchain may execute the transaction separately, thereby executing the contract separately, updating the status database based on execution of the contract.
In addition, after the intelligent contracts are deployed on the blockchain, a corresponding contract account is generated. This contract account will typically have states defined by state variables in the smart contract that produce new values when the smart contract is created and executed. Wherein the contract account may be used to store a state associated with the smart contract. The code may be automatically executed once some event triggers a term in the smart contract (execution condition is met). In the blockchain, the relevant states of the contract are stored in a storage tree (storage trie), and the hash value of the root node of the storage tree is stored in the storage_root, so that all states of the contract are locked under the contract account through the hash. The memory tree is also an MPT tree structure, storing key-value mappings of state addresses to state values. A state address is stored from the root node to the leaf node of the storage tree, and a state value is stored in a leaf node.
With continued reference to fig. 1, the candidate nodes in fig. 1 may be understood as: nodes in the blockchain other than the consensus node. The 4 consensus nodes in fig. 1 are respectively: nodes 11, 12, 13 and 14; the 9 candidate nodes are respectively: nodes 21, 22 and 23, nodes 31, 32 and 33, and nodes 41, 42 and 43. Wherein nodes 21, 22 and 23 may form a packet a, nodes 31, 32 and 33 may form a packet b, and nodes 41, 42 and 43 may form a packet c. Packet a is associated with node 12; packet b is associated with node 13; packet c is associated with node 13. For example, the time delay between each candidate node in each packet may be less than a predetermined time delay, and the time delay between each consensus node and each candidate node in the packet associated therewith may also be less than a predetermined time delay. Wherein the consensus node may be responsible for distributing its acquired blocks to nodes in its associated packets based on a distribution mechanism of error correction codes.
Fig. 2 is a schematic diagram illustrating an architecture of another blockchain network provided in embodiments of the present disclosure. The blockchain network shown in fig. 2 differs from the blockchain network shown in fig. 1 mainly in that: each consensus node in fig. 2 is associated with a packet, and the number of nodes in each packet has reached an upper limit, i.e. no new candidate node can be added to each packet associated with the consensus node at this time. Meanwhile, new candidate nodes 61, 62 and 63 need to be added to the blockchain network, the time delay between each candidate node 61, 62 and 63 and the candidate node 21 is minimum, and the candidate nodes 61, 62 and 63 can be divided into a group e. Thus, packet e may be associated with candidate node 21. Wherein the candidate node 21 may be responsible for distributing its acquired blocks to the nodes in the packet e based on a distribution mechanism of error correction codes.
Fig. 3 is a schematic flow chart of a node grouping method in a blockchain according to an embodiment of the present disclosure. Wherein the method shown in fig. 3 may be performed by a first node in the blockchain, which may be, but is not limited to, a node newly added to the blockchain. As shown in fig. 3, the node grouping method in the blockchain includes the following steps:
In S302, the first node obtains grouping information from the blockchain, where the grouping information is stored in a contract state of the smart contract, and the grouping information includes: the group identification of M groups and the node information of each node contained in the M groups, wherein M is more than or equal to 0.
In this embodiment, when the first node joins the blockchain, the first node may obtain node information of the first few nodes that build the blockchain, such as: IP address and port of the node, etc. The first node may then establish a connection with the first few nodes that establish a blockchain based on the connection of TLS (Transport Layer Security, transport layer security protocol), TCP (Transmission Control Protocol ), UDP (User Datagram Protocol, user datagram protocol), etc. After the connection is successfully established, the first node may initiate a block synchronization request to the node connected thereto, so that the first node may acquire each block in the blockchain and acquire grouping information based on the latest block in the blockchain. For example, after the first node obtains the latest block, all transactions in the block may be executed, and the local contract state is updated according to the execution of the transactions, so as to obtain the grouping information from the contract state. Illustratively, the packet information may include packet identifiers of M packets and node information of each node included in the M packets, where M is greater than or equal to 0. Wherein the grouping information may be stored in a contract state of the smart contract.
In S304, when M is more than or equal to 1, the first node determines that the first node can establish connection with K groups in M groups according to the group information, wherein K is more than or equal to 1 and less than or equal to M.
In this embodiment, when M is greater than or equal to 1, the first node may obtain, according to node information of each node in the packet information, an IP address, a port, and the like of each node, and may create connection with the nodes based on a connection manner such as TSL, TCP, UDP, so as to determine K packets that may be connected. Wherein a first node is considered to be connectable to a first packet when the first node can establish connections with all nodes within the first packet. When the first node cannot establish connection with any node in a group, the network between the first node and the group is indicated to be in a non-full communication state, and the first node can be forbidden to join in the group at this time, so that smooth distribution of the data blocks in the group can be ensured. At the same time, the first node may cease to establish connections with other nodes in the group. For example, when a first node cannot establish a connection with a node in a group, if the first node has established a connection with other nodes in the group, the first node may actively disconnect from other nodes in the group.
At S306, the first node determines a delay between the first node and each of the K packets to obtain K first target delays.
In this embodiment, the first node may perform data interaction with the nodes in the K packets, and determine the time delay between the first node and each other node according to the time of sending data and the time of receiving data fed back by other nodes. The time delay between the first node and the other nodes can reflect factors such as the distance between the first node and the other nodes, the hardware condition of the other nodes, and the like, for example, when the time delay between the first node and the other nodes is very small, the distance between the first node and the other nodes is very close.
Illustratively, taking the example that the first node determines the time delay between it and the second node, as shown in fig. 4, at S402, the first node may send a heartbeat packet to the second node and record the sending time T1. In S404, after the second node acquires the heartbeat packet, an ACK (Acknowledgement) message may be returned to the first node, and after the first node acquires the ACK message, the acquisition time T2 may be recorded. At S406, the first node may determine a time delay between itself and the second node from T1 and T2, where the time delay is (T2-T1). For example, the number of times the first node transmits the heartbeat packet may be multiple times, and at this time, the number of times the ACK message fed back by the second node may also be multiple times. When the first node transmits the heartbeat packet a plurality of times, the first node may determine a time delay between the first node and the second node based on a time between each time it transmits the heartbeat packet and acquires the ACK message. For example, if the time for first sending the heartbeat packet is T1.1, the time for first obtaining the ACK message is T1.2, the time for second sending the heartbeat packet is T2.1, the time for second obtaining the ACK message is T2.2, the time for third sending the heartbeat packet is T3.1, and the time for third obtaining the ACK message is T3.2, the time delay between the first node and the second node is ((T1.2-T1.1) + is
(T2.2-T2.1)+(T3.2-T3.1))/3。
After the first node determines the time delay between the first node and each node in the K groups, the time delay between the first node and the group can be determined by the time delay corresponding to each node in one group, so that K first target time delays are obtained. For example, for 3 nodes included in the packet a in fig. 1, assuming that the delays between the first node and the nodes 21, 22 and 23 are t1, t2 and t3, respectively, the first target delay between the first node and the packet a may be: (t1+t2+t3)/3. It will be appreciated that the first node may determine the first target time delay between itself and each packet by other means than average, such as variance, etc., and is not limited herein.
In S308, the first node determines a target packet according to the K first target delays.
In this embodiment, the first node may determine the target packet according to K first target delays. For example, the first node may select a packet corresponding to a smallest one of the first target delays as the target packet.
As a possible implementation manner, as shown in fig. 5, determining the target packet according to K first target delays may include the following steps:
In S502, J groups are determined from the K groups according to the number of nodes contained in each group in the K groups and a first number threshold, wherein J is greater than or equal to 0 and less than or equal to K, and the number of nodes contained in each group in the J groups is smaller than the first number threshold.
In this embodiment, the first node may determine the number of nodes in each packet from information related to each node in the packet information acquired by the first node. The first node may then compare the number of nodes within each packet to a first number threshold set in advance. When the number of nodes in a certain packet is greater than or equal to a first number threshold, it indicates that a new node cannot be added in the packet, so that the packet can be rejected. From the K groups, J groups can be determined, J is more than or equal to 0 and less than or equal to K, and the number of nodes contained in each group in the J groups is less than a first number threshold.
In S504, when J is greater than or equal to 1, determining a target packet according to J first target delays corresponding to the J packets.
In this embodiment, when J is greater than or equal to 1, it indicates that there are packets that the first node can join at this time, so that the target packet can be determined according to J first target delays corresponding to the J packets. For example, Q first target delays may be determined from the J first target delays according to the determined J first target delays and a preset first delay threshold, where Q is greater than or equal to 0 and less than or equal to J, and all of the Q first target delays are less than the first delay threshold; and when Q is more than or equal to 1, determining the target packet as the packet corresponding to the smallest one of the Q first target delays. When the first target time delay is greater than or equal to a first time delay threshold, the distance between the first node and the corresponding packet is far, so that the corresponding packet can be removed; and when the first target delay is less than the first delay threshold, it indicates that the distance between the first node and the corresponding packet is relatively close, so that the corresponding packet can be reserved. For the case of j=0 and q=0, details are described below.
After the target packet is determined, S310 may be performed.
At S310, the first node sends a first transaction to the blockchain, the first transaction to invoke the smart contract for adding the first node in a target group of contract states.
In this embodiment, after determining the target packet, the first node may send the first transaction to the blockchain. The first transaction may be used to invoke a smart contract to add a first node in a target group of current contract states. After receiving the first transaction, each consensus node (e.g., node 11-node 14 in fig. 1) in the blockchain packages the first transaction and other multiple transactions into, for example, a first block to be executed through consensus, and then each consensus node executes the first transaction and other multiple transactions, respectively, generates the first block, and performs consensus on the first block. After the consensus of the first block is successful, each consensus node may send the first block to a packet corresponding to the consensus node, so that each node in the packet may acquire the first block.
Specifically, assuming that the target packet corresponding to the first node is packet a, the node 12 adds node information of the first node to packet information of packet a in a contract state of the smart contract after performing the first transaction, so that the node 12 may transmit the first block to the node 21, the node 22, the node 23, and the first node, respectively, according to the packet information.
The nodes 21, 22, 23 and the first node may perform a first transaction and other transactions in the first block, respectively, after acquiring the first block, and update the local world state accordingly. Specifically, the first node adds node information of the first node to packet information of the packet a in a contract state of the smart contract by performing a first transaction in the first block, and then the first node may establish a connection with other nodes according to node information of each node in the packet a. Thus, the grouping of the first node is completed. Meanwhile, the first node is divided into one group closest thereto.
In some embodiments, N consensus nodes may be included in the blockchain. Wherein, X groups can be hung under each consensus node, and the value of X can be preset. It is understood that the number of packets that can be underhung under nodes other than the consensus node in the blockchain may also be preset.
Wherein, when there are nodes whose number of packets hanging down does not reach the set upper limit of number in the N consensus nodes, it is indicated that the packets can also be hanging down under these nodes. Therefore, when grouping the first node, it is also possible to consider a time delay between the first node and the consensus node whose number of the underhung packets does not reach the set upper number limit, and group the first node in combination with the time delay.
Fig. 6 is a flow chart illustrating another method for grouping nodes in a blockchain according to embodiments of the present disclosure. Wherein the method shown in fig. 6 may be performed by a first node in the blockchain, which may be, but is not limited to, a node newly added to the blockchain. As shown in fig. 6, the node grouping method in the blockchain includes the steps of:
at S602, the first node obtains grouping information from the blockchain, where the grouping information is stored in a contract state of the smart contract, and the grouping information includes: the group identification of M groups and the node information of each node contained in the M groups, wherein M is more than or equal to 0. For S601, the description in S301 is detailed, and will not be repeated here.
In S604, when M is more than or equal to 1 and less than N, the first node determines that the first node can establish connection with K groups in the M groups according to the group information, wherein K is more than or equal to 1 and less than or equal to M. For S602, the description in S302 is detailed and will not be repeated here.
At S606, the first node determines a time delay between the first node and each of the K packets to obtain K first target time delays, and determines a time delay between the first node and R consensus nodes when a number of packets hanging under R consensus nodes in the N consensus nodes included in the blockchain does not reach a second number threshold to obtain R second target time delays, where R is 1 and R is less than or equal to N.
In this embodiment, the first node may determine the time delay between the first node and each packet of the K packets based on the foregoing time delay determining manner, and determine the time delay between the first node and R consensus nodes when the number of packets suspended under R consensus nodes of the N consensus nodes included in the blockchain does not reach the second number threshold, so as to obtain K first target time delays and R second target time delays. Wherein R of the R consensus nodes may be understood as a set of consensus nodes for which the number of underhung packets does not reach the set upper number limit.
In S608, the first node determines that the minimum delay in the R second target delays is smaller than the minimum delay in the K first target delays, and selects a consensus node corresponding to the minimum delay in the R second target delays as the first target node.
In this embodiment, when the minimum delay in the R second target delays is smaller than the minimum delay in the K first target delays, it indicates that the distance between the first node and the common node corresponding to the minimum delay in the R second target delays is closest, so that at this time, the common node corresponding to the minimum delay in the R second target delays may be selected as the first target node to create a packet under the node. It will be appreciated that when the smallest of the R second target delays is greater than the smallest of the K first target delays, the first nodes may be grouped in the manner described in fig. 3.
At S610, the first node sends a second transaction to the blockchain, the second transaction for invoking the smart contract for creating a packet under the first target node of the contract state and adding the first node to the created packet.
In this embodiment, after the first node determines the first target node, the first node may send a second transaction to the blockchain. The second transaction may be used to invoke the smart contract to create a packet under the first target node of the current contract state and add the first node to the created packet. Thus, the grouping of the first node is completed.
In some embodiments, when j=0 in the determined J packets, or q=0 in the determined Q first target delays, or the minimum delay in the determined R second target delays is greater than the second delay threshold and less than the minimum delay in the K first target delays, it indicates that there is no packet in the current blockchain that the first node can join, and/or that no packet can be newly created under the consensus node. At this time, in order that the first node may be grouped, a new group may be created for the first node under nodes other than the consensus node. Specifically, as shown in fig. 7, the following steps may be included:
In S702, the first node determines, according to the packet information, a time delay between the first node and each node in the M packets, so as to obtain S third target time delays.
In this embodiment, the first node may determine, based on the foregoing delay determining manner, a delay between the first node and each node in the M packets, so as to obtain S third target delays. Wherein S may be a positive integer.
At S704, the first node determines a second target node from among the nodes within the M packets according to the S third target delays.
In this embodiment, the first node may determine the second target node from the nodes in the M packets according to the S third target delays. For example, the first node may select a node corresponding to a smallest delay among the S third target delays as the second target node.
At S706, the first node sends a third transaction to the blockchain, the third transaction for invoking the smart contract for creating a packet under the second target node of the contract state and adding the first node to the created packet.
In this embodiment, after the first node determines the second target node, a third transaction may be sent to the blockchain. The third transaction is for invoking the smart contract for creating a packet under the second target node of the current contract state and adding the first node to the created packet. Thus, the grouping of the first node is completed.
In some embodiments, when M.gtoreq.1, it indicates that there is a packet in the current blockchain, so the first node may be grouped at this time based on the time delay between the first node and each packet. And when m=0, it indicates that no packet exists in the current blockchain, at which point the first node may be grouped based on the time delay between the first node and each consensus node in the blockchain.
Fig. 8 is a flow chart illustrating another method for grouping nodes in a blockchain according to embodiments of the present disclosure. Wherein the method shown in fig. 8 may be performed by a first node in the blockchain, which may be, but is not limited to, a node newly added to the blockchain. As shown in fig. 8, the node grouping method in the blockchain includes the steps of:
at S802, the first node acquires grouping information from the blockchain, where the grouping information is stored in a contract state of the smart contract, and the grouping information includes: the group identification of M groups and the node information of each node contained in the M groups, wherein M is more than or equal to 0. For S801, the description in S301 is detailed, and is not repeated here.
At S804, when m=0, the first node determines a delay between the first node and each of N consensus nodes in the blockchain to obtain N fourth target delays.
In this embodiment, when m=0, the first node may respectively establish connection with N consensus nodes in the blockchain, and determine the time delay between the first node and each consensus node based on the foregoing manner of determining the time delay, so as to obtain N fourth target time delays. The fourth target delay between the first node and the consensus node may reflect the distance between the first node and the consensus node, for example, when the delay between the first node and the consensus node is very small, indicating that the distance between the first node and the consensus node is very close.
At S806, the first node determines a third target node from the N consensus nodes according to the N fourth target delays.
In this embodiment, the first node may determine the third target node from the N consensus nodes according to the N fourth target delays. For example, the first node may select a consensus node corresponding to a smallest one of the fourth target delays as the third target node.
At S808, the first node sends a fourth transaction to the blockchain, the fourth transaction for invoking the smart contract for creating a packet under the third target node of the contract state and adding the first node to the created packet.
In this embodiment, after the first node determines the third target node, a fourth transaction may be sent to the blockchain. The fourth transaction may be used to invoke the smart contract to create a packet under the third target node of the current contract state and add the first node to the created packet. Thus, the grouping of the first node is completed.
The grouping of the first node is completed in the above manner. It can be appreciated that the first node may be a node that is disconnected from other nodes in the packet where the first node is located, and cannot be reconnected, or may be a node that does not complete the restoration of a block in a certain packet, in addition to a node that newly joins a blockchain.
After the grouping is completed, the tiles may be distributed based on the grouping situation. For ease of understanding, the block distribution process is described below in connection with fig. 1.
Continuing with fig. 1, node 12 distributes blocks to group a as an example. Nodes 11, 12, 13 and 14 may generate block a after consensus is reached for a transaction based on a consensus algorithm, such as the BFT (Byzantine Fault Tolerance, bayer fault tolerance) algorithm. Next, the node 12 may encode the block a by using an error correction code to add redundancy bits (also referred to as redundancy) to the block a, and divide the block a into 3 data blocks, and transmit the 3 data blocks to the nodes 21, 22, and 23, respectively. Nodes 21, 22 and 23 may broadcast their respective data blocks acquired from node 12 in packet a. Thus, nodes 21, 22 and 23 can each obtain 3 data blocks and restore block a from the 3 data blocks. The node 12 thus completes the distribution of block a.
The embodiment of the present specification also provides a node grouping device in a blockchain based on the same concept as the embodiment of the method.
Fig. 9 is a schematic structural diagram of a blockchain node provided in the embodiments of the present disclosure. Blockchain node as shown in fig. 9, the blockchain node 900 includes: a communication module 910 and a processing module 920. Wherein the communication module 910 may be configured to obtain grouping information from the blockchain, where the grouping information is stored in a contract state of the smart contract, where the grouping information includes: the group identification of M groups and the node information of each node contained in the M groups, wherein M is more than or equal to 0. The processing module 920 may be configured to determine, from the grouping information, that the blockchain node is capable of establishing a connection with K groups of the M groups when M is greater than or equal to 1, where 1 is greater than or equal to K is less than or equal to M; determining time delay between the block chain node and each packet in the K packets to obtain K first target time delays; and determining the target packet according to the K first target delays. The communication module 910 may also be configured to send a first transaction to the blockchain for invoking the smart contract for adding blockchain nodes in the target group of contract states.
In some embodiments, the processing module 920, when determining the target packet according to the K first target delays, is specifically configured to: determining J groups from the K groups according to the number of nodes contained in each group in the K groups and a first number threshold, wherein J is more than or equal to 0 and less than or equal to K, and the number of nodes contained in each group in the J groups is less than the first number threshold; and when J is more than or equal to 1, determining target groups according to J first target time delays corresponding to the J groups.
In some embodiments, the processing module 920, when determining the target packet according to J first target delays corresponding to the J packets, is specifically configured to: according to J first target time delays and a first time delay threshold, Q first target time delays are determined from the J first target time delays, Q is more than or equal to 0 and less than or equal to J, and the Q first target time delays are all smaller than the first time delay threshold; and when Q is more than or equal to 1, determining the target packet as a packet corresponding to the smallest one of the Q first target delays.
In some embodiments, N consensus nodes are included in the blockchain. Wherein the processing module 920 may be further configured to: when the number of the packets hung under R consensus nodes in the N consensus nodes does not reach a second number threshold, determining time delay between the block chain node and the R consensus nodes to obtain R second target time delay, wherein R is more than or equal to 1 and less than or equal to N; and determining that the minimum time delay in the R second target time delays is smaller than the minimum time delay in the K first target time delays, and selecting a common node corresponding to the minimum time delay in the R second target time delays as the first target node.
The communication module 910 may also be configured to send a second transaction to the blockchain for invoking the smart contract for creating a packet under the first target node of the contract state and adding the blockchain node in the created packet.
In some embodiments, the processing module 920 may be further configured to: when j=0, or q=0, or the determined minimum delay in the R second target delays is greater than the second delay threshold and less than the minimum delay in the K first target delays, determining, according to the packet information, a delay between the blockchain node and each node in the M packets to obtain S third target delays; and determining a second target node from all nodes in the M groups according to the S third target delays.
The communication module 910 may also be configured to send a third transaction to the blockchain for invoking the smart contract for creating a packet under the second target node of the contract state and adding the blockchain node in the created packet.
In some embodiments, the processing module 920 may be further configured to: when m=0, determining time delays between the blockchain node and each of N consensus nodes in the blockchain to obtain N fourth target time delays; and determining a third target node from the N consensus nodes according to the N fourth target delays.
The communication module 910 may also be configured to send a fourth transaction to the blockchain for invoking the smart contract for creating a packet under the third target node of the contract state and adding the blockchain node in the created packet.
In some embodiments, the communication module 910 is specifically configured to: performing block synchronization with at least one consensus node in the block chain to obtain the latest block in the block chain; grouping information is obtained based on the latest block in the blockchain.
In some embodiments, the processing module 920 may be further configured to: when the blockchain node is unable to establish a connection with a first group of the M groups, it is determined that the blockchain node is unable to join the first group.
It should be understood that, the foregoing apparatus is used to perform the method in the foregoing embodiment, and corresponding program modules in the apparatus implement principles and technical effects similar to those described in the foregoing method, and reference may be made to corresponding processes in the foregoing method for the working process of the apparatus, which are not repeated herein.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as 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), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
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 (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation device is a server system. Of course, the application does not exclude that as future computer technology advances, the computer implementing the functions of the above-described embodiments may be, for example, a personal computer, a laptop computer, a car-mounted human-computer interaction device, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Although one or more embodiments of the present description provide method operational steps as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in an actual device or end product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment) as illustrated by the embodiments or by the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. For example, if first, second, etc. words are used to indicate a name, but not any particular order.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when one or more of the present description is implemented, the functions of each module may be implemented in the same piece or pieces of software and/or hardware, or a module that implements the same function may be implemented by a plurality of sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
One skilled in the relevant art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product 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.
One or more embodiments of the present specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The foregoing is merely an example of one or more embodiments of the present specification and is not intended to limit the one or more embodiments of the present specification. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the present specification, should be included in the scope of the claims.

Claims (18)

1. A method of grouping nodes in a blockchain, the method performed by a first node, the method comprising: obtaining grouping information from a blockchain, wherein the grouping information is stored in a contract state of an intelligent contract, and the grouping information comprises the following components: the packet identification of M packets and the node information of each node contained in the M packets, wherein M is more than or equal to 0; when M is more than or equal to 1, determining that the first node can establish connection with K groups in the M groups according to the group information, wherein K is more than or equal to 1 and less than or equal to M;
determining time delay between the first node and each packet in the K packets to obtain K first target time delays; determining a target packet according to the K first target delays;
a first transaction is sent to the blockchain, the first transaction for invoking the smart contract for adding the first node in the target group of contract states.
2. The method of claim 1, wherein the determining a target packet from the K first target delays comprises:
determining J groups from the K groups according to the number of nodes contained in each group in the K groups and a first number threshold value, wherein J is more than or equal to 0 and less than or equal to K, and the number of nodes contained in each group in the J groups is less than the first number threshold value;
and when J is more than or equal to 1, determining the target packets according to J first target delays corresponding to the J packets.
3. The method of claim 2, wherein the determining the target packet according to J first target delays corresponding to the J packets comprises:
according to the J first target time delays and a first time delay threshold, Q first target time delays are determined from the J first target time delays, Q is more than or equal to 0 and less than or equal to J, and the Q first target time delays are all smaller than the first time delay threshold;
and when Q is more than or equal to 1, determining the target packet as a packet corresponding to the smallest one of the Q first target time delays.
4. The method of claim 1, wherein the blockchain includes N consensus nodes therein; the method further comprises the steps of:
When the number of the packets hung under R consensus nodes in the N consensus nodes does not reach a second number threshold, determining time delay between the first node and the R consensus nodes to obtain R second target time delay, wherein R is more than or equal to 1 and less than or equal to N; determining that the minimum time delay in the R second target time delays is smaller than the minimum time delay in the K first target time delays, and selecting a consensus node corresponding to the minimum time delay in the R second target time delays as a first target node;
and sending a second transaction to the blockchain, wherein the second transaction is used for calling the intelligent contract to be used for newly establishing a packet under the first target node of the contract state and adding the first node in the newly established packet.
5. The method of claim 4, wherein the method further comprises:
when the minimum time delay in the determined R second target time delays is larger than a second time delay threshold and smaller than the minimum time delay in the K first target time delays, determining time delays between the first node and each node in the M groups according to the group information so as to obtain S third target time delays;
determining a second target node from the nodes in the M groups according to the S third target delays; and sending a third transaction to the blockchain, wherein the third transaction is used for calling the intelligent contract to be used for newly establishing a packet under the second target node of the contract state and adding the first node in the newly established packet.
6. A method according to claim 2 or 3, wherein the method further comprises:
when j=0, determining, according to the packet information, time delays between the first node and each node in the M packets, so as to obtain S third target time delays;
determining a second target node from the nodes in the M groups according to the S third target delays; and sending a third transaction to the blockchain, wherein the third transaction is used for calling the intelligent contract to be used for newly establishing a packet under the second target node of the contract state and adding the first node in the newly established packet.
7. The method of any one of claims 1 to 5, wherein the method further comprises:
when m=0, determining a time delay between the first node and each of N consensus nodes in the blockchain to obtain N fourth target time delays;
determining a third target node from the N consensus nodes according to the N fourth target delays;
and sending a fourth transaction to the blockchain, wherein the fourth transaction is used for calling the intelligent contract to be used for newly establishing a packet under the third target node of the contract state and adding the first node in the newly established packet.
8. The method of any of claims 1 to 5, wherein the obtaining grouping information from a blockchain comprises: performing block synchronization with at least one consensus node in the blockchain to obtain the latest block in the blockchain; and acquiring the grouping information based on the latest block in the block chain.
9. The method of any one of claims 1 to 5, wherein the method further comprises:
and when the first node cannot establish connection with the first packet in the M packets, determining that the first node cannot join the first packet.
10. A blockchain node comprising:
a communication module configured to obtain grouping information from a blockchain, the grouping information being stored in a contract state of an intelligent contract, the grouping information including: the packet identification of M packets and the node information of each node contained in the M packets, wherein M is more than or equal to 0;
the processing module is configured to determine that the blockchain node can establish connection with K groups in the M groups according to the grouping information when M is more than or equal to 1, wherein K is more than or equal to 1 and less than or equal to M; determining time delay between the blockchain node and each packet in the K packets to obtain K first target time delays;
The processing module is further configured to determine a target packet according to the K first target delays;
the communication module is further configured to send a first transaction to the blockchain, the first transaction for invoking the smart contract for adding the blockchain node in the target group of contract states.
11. The blockchain node of claim 10, wherein the processing module, when determining a target packet from the K first target delays, is specifically configured to:
determining J groups from the K groups according to the number of nodes contained in each group in the K groups and a first number threshold value, wherein J is more than or equal to 0 and less than or equal to K, and the number of nodes contained in each group in the J groups is less than the first number threshold value;
and when J is more than or equal to 1, determining the target packets according to J first target delays corresponding to the J packets.
12. The blockchain node of claim 11, wherein the processing module, when determining the target packet according to J first target delays corresponding to the J packets, is specifically configured to:
according to the J first target time delays and a first time delay threshold, Q first target time delays are determined from the J first target time delays, Q is more than or equal to 0 and less than or equal to J, and the Q first target time delays are all smaller than the first time delay threshold;
And when Q is more than or equal to 1, determining the target packet as a packet corresponding to the smallest one of the Q first target time delays.
13. The blockchain node of claim 10, wherein the blockchain includes N consensus nodes therein; the processing module is further configured to determine time delays between the blockchain node and the R consensus nodes when the number of packets hung under the R consensus nodes in the N consensus nodes does not reach a second number threshold value, so as to obtain R second target time delays, wherein R is more than or equal to 1 and less than or equal to N; determining that the minimum time delay in the R second target time delays is smaller than the minimum time delay in the K first target time delays, and selecting a consensus node corresponding to the minimum time delay in the R second target time delays as a first target node;
the communication module is further configured to send a second transaction to the blockchain, the second transaction being for invoking the smart contract for creating a packet under the first target node of the contract state and adding the blockchain node in the created packet.
14. The blockchain node of claim 13, wherein,
the processing module is further configured to determine, according to the grouping information, a time delay between the blockchain node and each node in the M groups to obtain S third target time delays when a minimum time delay of the determined R second target time delays is greater than a second time delay threshold and less than a minimum time delay of the K first target time delays; determining a second target node from all nodes in the M groups according to the S third target time delays;
The communication module is further configured to send a third transaction to the blockchain, the third transaction being for invoking the smart contract for creating a packet under the second target node of the contract state and adding the blockchain node in the created packet.
15. The blockchain node of claim 11 or 12, wherein,
the processing module is further configured to determine, according to the grouping information, time delays between the blockchain node and each node in the M groupings to obtain S third target time delays when j=0; determining a second target node from all nodes in the M groups according to the S third target time delays;
the communication module is further configured to send a third transaction to the blockchain, the third transaction being for invoking the smart contract for creating a packet under the second target node of the contract state and adding the blockchain node in the created packet.
16. The blockchain node of any of claims 10 to 14, wherein,
the processing module is further configured to determine, when m=0, a time delay between the blockchain node and each of N consensus nodes in the blockchain to obtain N fourth target time delays; and determining a third target node from the N consensus nodes according to the N fourth target delays;
The communication module is further configured to send a fourth transaction to the blockchain, the fourth transaction being for invoking the smart contract for creating a packet under the third target node of the contract state and adding the blockchain node in the created packet.
17. A computer readable storage medium having stored thereon a computer program which, when executed in a computing device, performs the method of any of claims 1 to 9.
18. A computing device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, implements the method of any of claims 1 to 9.
CN202210327144.2A 2022-03-30 2022-03-30 Node grouping method in block chain and block chain link point Active CN114679457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210327144.2A CN114679457B (en) 2022-03-30 2022-03-30 Node grouping method in block chain and block chain link point

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210327144.2A CN114679457B (en) 2022-03-30 2022-03-30 Node grouping method in block chain and block chain link point

Publications (2)

Publication Number Publication Date
CN114679457A CN114679457A (en) 2022-06-28
CN114679457B true CN114679457B (en) 2023-11-21

Family

ID=82076218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210327144.2A Active CN114679457B (en) 2022-03-30 2022-03-30 Node grouping method in block chain and block chain link point

Country Status (1)

Country Link
CN (1) CN114679457B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174572B (en) * 2022-06-30 2024-01-05 蚂蚁区块链科技(上海)有限公司 Data multicasting method in blockchain, blockchain node and storage medium
CN115174573B (en) * 2022-06-30 2024-02-02 蚂蚁区块链科技(上海)有限公司 Data broadcasting method in block chain system, node and block chain system
CN115174574A (en) * 2022-06-30 2022-10-11 蚂蚁区块链科技(上海)有限公司 Data broadcasting method in block chain system, node and block chain system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111669434A (en) * 2020-05-18 2020-09-15 支付宝实验室(新加坡)有限公司 Method, system, device and equipment for establishing communication group
CN112598525A (en) * 2021-02-26 2021-04-02 北京全息智信科技有限公司 Intelligent contract clustering parallel block chain implementation method and device
KR20210061245A (en) * 2019-11-19 2021-05-27 한양대학교 산학협력단 Method for parallel block processing method in blockchain, blockcahin node device and program using the same
WO2021134470A1 (en) * 2019-12-31 2021-07-08 西门子股份公司 Blockchain system, data processing method, computing device and medium
CN113919846A (en) * 2021-12-15 2022-01-11 腾讯科技(深圳)有限公司 Block link point dynamic grouping method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210061245A (en) * 2019-11-19 2021-05-27 한양대학교 산학협력단 Method for parallel block processing method in blockchain, blockcahin node device and program using the same
WO2021134470A1 (en) * 2019-12-31 2021-07-08 西门子股份公司 Blockchain system, data processing method, computing device and medium
CN111669434A (en) * 2020-05-18 2020-09-15 支付宝实验室(新加坡)有限公司 Method, system, device and equipment for establishing communication group
CN112598525A (en) * 2021-02-26 2021-04-02 北京全息智信科技有限公司 Intelligent contract clustering parallel block chain implementation method and device
CN113919846A (en) * 2021-12-15 2022-01-11 腾讯科技(深圳)有限公司 Block link point dynamic grouping method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114679457A (en) 2022-06-28

Similar Documents

Publication Publication Date Title
CN114679457B (en) Node grouping method in block chain and block chain link point
TWI696083B (en) A consensus method and device based on blockchain
US11563805B2 (en) Method, apparatus, client terminal, and server for data processing
TW202008763A (en) Data processing method and apparatus, and client
WO2024001024A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
CN116032756A (en) Method for updating configuration information of application program based on block chain and block chain link point
WO2024001032A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
CN116366666A (en) Chain state updating method and block link point in block chain system
CN116996208A (en) Block editing method and block link point in block chain system
CN114785800A (en) Cross-link communication method and device
CN114640610B (en) Cloud-protogenesis-based service management method and device and storage medium
CN114422526B (en) Block synchronization method and device, electronic equipment and storage medium
CN113259462B (en) Block chain message distribution method and device
TWI714017B (en) Data processing method, device and server
CN114785853B (en) Method, apparatus, storage medium and computing device for cross-chain communication in a blockchain system
CN113126884B (en) Data migration method, data migration device, electronic equipment and computer storage medium
CN115174573B (en) Data broadcasting method in block chain system, node and block chain system
CN115174572B (en) Data multicasting method in blockchain, blockchain node and storage medium
CN116346878A (en) Method for accessing block chain system, service node and business system
CN114697344B (en) Method for determining consensus node in blockchain system, node, storage medium and computing device
CN116319943A (en) Cross-chain interaction method and block chain link point
CN116366706A (en) Cross-chain interaction method and block chain link point
CN114612238A (en) Method and device for returning block chain transaction execution result
CN116842100A (en) Block chain-based data management method and device and block chain node
CN116647566A (en) Access management method and device based on block chain

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