CN114679457A - 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
CN114679457A
CN114679457A CN202210327144.2A CN202210327144A CN114679457A CN 114679457 A CN114679457 A CN 114679457A CN 202210327144 A CN202210327144 A CN 202210327144A CN 114679457 A CN114679457 A CN 114679457A
Authority
CN
China
Prior art keywords
node
target
equal
groups
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210327144.2A
Other languages
Chinese (zh)
Other versions
CN114679457B (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

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
    • 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 block chain and a block chain node. The method is performed by a first node and comprises: acquiring grouping information from the block chain, wherein the grouping information is stored in a contract state of the intelligent contract, and the grouping information comprises: grouping identification of M groups and node information of each node contained in the M groups, wherein M is more than or equal to 0; when M is larger than or equal to 1, determining that the first node can establish connection with K groups in the M groups according to the grouping information, wherein K is larger than or equal to 1 and is smaller than or equal to M; determining time delay between the first node and each of the K groups to obtain K first target time delays; determining a target group according to the K first target time 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 grouping of the current contract state. Therefore, all nodes with short distances are aggregated into a group, the time delay during block distribution is reduced, and the efficiency of block distribution is improved.

Description

Node grouping method in block chain and block chain link point
Technical Field
The embodiment of the present specification belongs to the technical field of a block chain, and in particular, relates to a node grouping method in a block chain and a block chain node.
Background
The Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. In the block chain system, data blocks are combined into a chain data structure in a sequential connection mode according to a time sequence, and data cannot be tampered and forged cannot be guaranteed in a cryptographic mode. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
At present, with the rapid development of the block chain technology, the size of the block chain is larger and larger, and the service is more and more complex. In a large-scale blockchain network, as the size of a node increases, the consensus efficiency decreases, the bandwidth required by the node increases, and the cost increases. In a common broadcast protocol of block data on a public link, Gossip protocol is adopted for distribution, but the data distribution mode has high redundancy, low distribution efficiency and high delay.
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 efficiency of block distribution on the blockchain and reduce latency.
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 including: acquiring grouping information from a block chain, wherein the grouping information is stored in a contract state of an intelligent contract, and the grouping information comprises: grouping identifiers of M groups and node information of each node contained in the M groups, wherein M is more than or equal to 0; when M is larger than or equal to 1, determining that the first node can establish connection with K groups in the M groups according to the grouping information, wherein K is larger than or equal to 1 and is smaller than or equal to M; determining time delay between the first node and each of the K packets to obtain K first target time delays; determining a target group according to the K first target time delays; sending a first transaction to the blockchain, the first transaction to invoke the smart contract for adding the first node in the target grouping of the contract state.
A second aspect of the present specification provides a block link point comprising: a communication module configured to obtain grouping information from a block chain, the grouping information being stored in a contract state of an intelligent contract, the grouping information including: grouping identifiers of M groups and node information of each node contained in the M groups, wherein M is more than or equal to 0; the processing module is configured to determine that the block chain link points can be connected with K groups in the M groups according to the grouping information when M is larger than or equal to 1, and K is larger than or equal to 1 and smaller than or equal to M; determining time delay between the block chain link point and each of the K groups to obtain K first target time delays; the processing module is further configured to determine a target group according to the K first target delays; the communication module is further configured to send a first transaction to the blockchain, the first transaction to invoke the smart contract for adding the blockchain node in the target grouping of contract states.
A third aspect of the present specification provides a computer readable storage medium having stored thereon a computer program which, when executed in a computing device, causes the computing device to perform 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 when executing the computer program.
By the method and the node of the block chain provided in one or more embodiments of the present specification, the nodes in the block chain can be grouped by the time delay between the nodes, so that each node with a short distance is aggregated into a group, the time delay during block distribution is reduced, and the efficiency of block distribution is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and it is obvious for a person skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a network diagram of a blockchain network according to an embodiment of the present disclosure;
FIG. 2 is a network diagram of a blockchain network in another embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a method for grouping nodes in a blockchain according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a process in which a first node determines a time delay between the first node and a second node in an embodiment of the present specification;
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 specification;
fig. 6 is a flowchart illustrating another method for grouping nodes in a blockchain according to an embodiment of the present disclosure;
fig. 7 is a flowchart illustrating a method for grouping nodes in a blockchain according to another embodiment of the present disclosure;
FIG. 8 is a flow chart illustrating a method for grouping nodes in a blockchain according to another embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a blockchain node in an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, 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 a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Generally, in a large-scale block chain network, a certain number of nodes are often selected as consensus nodes. In the process of identifying the transaction, the common node is used for identifying the transaction and generating the block, and then the block is distributed to other candidate nodes except the common node in the blockchain network by the common nodes. For example, when the number of candidate nodes in the blockchain network is n, the consensus node needs to send the blocks to the n candidate nodes, which increases the uplink bandwidth pressure of the consensus node, affects the consensus efficiency, and the block distribution efficiency is also low. In addition, since the distances between the different candidate nodes and the common node are different, when the distances between the two candidate nodes and the common node are far away, the duration of the transmission block between the two candidate nodes and the common node is increased, and the delay is high.
In view of the foregoing problems, embodiments of the present specification provide a node grouping method in a block chain, which may group nodes in the block chain based on time delay between the nodes, so as to divide each node with a short distance into the same group. Thus, when distributing blocks subsequently, only one block needs to be distributed into one packet. Therefore, the time length of the transmission block and the requirement of the consensus node distribution block in the block chain on the bandwidth are reduced, the throughput in unit time is improved, and the block distribution efficiency is improved.
For example, fig. 1 is a schematic diagram of an architecture of a blockchain network provided in an embodiment of the present disclosure. As shown in fig. 1, the block chain includes, for example, 4 common nodes and 9 candidate nodes, and has 13 nodes. Each node may be any computing, processing capable device, server, or cluster of devices, etc. The lines between the nodes schematically represent P2P (Peer-to-Peer) connections.
The nodes may have stored thereon the full amount of ledgers, i.e. the status of all blocks and all accounts. Wherein each node in the blockchain can generate the same state in the blockchain by performing the same transaction, and each node in the blockchain can store the same state database. It is to be understood that although fig. 1 illustrates 13 nodes included in the blockchain, embodiments of the present specification are not limited thereto and may include other numbers of nodes. Specifically, the nodes included in the block chain can meet the Byzantine Fault Tolerance (BFT) requirement. The byzantine fault tolerance requirement can be understood as that byzantine nodes can exist in a block chain, and the block chain does not show the byzantine behavior to the outside. Generally, some Byzantine Fault-tolerant algorithms require the number of nodes to be greater than (3f +1), where f is the number of Byzantine nodes, such as the practical Byzantine Fault-tolerant algorithm pbft (practical Byzantine Fault tolerance).
A transaction in the blockchain domain may refer to a unit of task that is performed in the blockchain and 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 the address of the account From which the transaction was initiated (i.e., From which a transfer task To another account was initiated), the To field indicates the address of the account From which the transaction was received (i.e., From which a transfer was received), and the Data field includes the transfer amount. In the case of a transaction calling an intelligent contract in a blockchain, a From field represents an account address for initiating the transaction, a To field represents an account address of the contract called by the transaction, and a Data field includes Data such as a function name in the calling contract and incoming parameters To the function, so as To obtain code of the function From the blockchain and execute the code of the function when the transaction is executed.
The block chain may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed on a blockchain system triggered by a transaction. An intelligent contract may be defined in the form of code. The intelligent contract is called in the Ethernet workshop, and a transaction pointing to the intelligent contract address is initiated, so that each node in the Ethernet workshop network runs the intelligent contract code in a distributed mode. It should be noted that, in addition to the creation of the smart contracts by the users, the smart contracts may also be set by the system in the creation block. Such contracts are generally referred to as system contracts. In general, some block chain data structures, parameters, attributes and methods may be set in the system contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply a system contract). Wherein the system contract is usable to add data structures for data of different services in a blockchain.
In the scenario of contract deployment, for example, Bob sends a transaction containing information to create an intelligent contract (i.e., a deployment contract) into the 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 null to indicate that the transaction is for contract deployment. After the agreement is achieved among the nodes through a consensus mechanism, a contract address '0 x6f8ae93 …' of the contract is determined, each node adds a contract account corresponding to the contract address of the intelligent contract in a state database, allocates a state storage corresponding to the contract account, and stores a contract code in the state storage of the contract, so that the contract creation is successful.
In the scenario of invoking a contract, for example, Bob sends a transaction for invoking a smart contract into the blockchain as shown in fig. 1, where the from field of the transaction is the address of the account of the transaction initiator (i.e., Bob), and "0 x6f8ae93 …" 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 identified in the blockchain, each node in the blockchain can execute the transaction respectively, so that the contract is executed respectively, and the state database is updated based on the execution of the contract.
In addition, after the intelligent contract is deployed on the block chain, a corresponding contract account is generated. This contract account will typically have states that are defined by state variables in the intelligent contract and that generate new values when the intelligent contract is created, executed. Wherein the contract account may be used to store intelligent contract-related state. The code may be executed automatically as soon as an event triggers a term in the intelligent contract (execution condition is met). In a block chain, the relevant state of a contract is stored in a storage tree (storage tree), and the hash value of the root node of the storage tree is stored in the storage _ root, so that all the states of the contract are locked to the contract account through the hash. The storage tree is also an MPT tree structure that stores a key-value mapping of state addresses to state values. The address of a state is stored from the root node to the leaf node of the memory tree, and a value of a state is stored in one leaf node.
With continued reference to fig. 1, the candidate nodes in fig. 1 may be understood as: and the nodes in the block chain except the common node. The 4 consensus nodes in fig. 1 are: 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. Where nodes 21, 22 and 23 may constitute packet a, nodes 31, 32 and 33 may constitute packet b, and nodes 41, 42 and 43 may constitute 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 group may be smaller than the preset time delay, and the time delay between each consensus node and each candidate node in the group associated therewith may also be smaller than the preset time delay. Wherein, the consensus node may be responsible for distributing the blocks acquired by the consensus node to the nodes in the packets associated with the consensus node based on the distribution mechanism of the error correction code.
For example, fig. 2 is a schematic architecture diagram of another block chain network provided in an embodiment of this specification. The main differences between the blockchain network shown in fig. 2 and the blockchain network shown in fig. 1 are: each consensus node in fig. 2 is associated with a group, and the number of nodes in each group has reached an upper limit value, i.e. no new candidate node can be added to each group associated with the consensus node. Meanwhile, new candidate nodes 61, 62, and 63 need to be added to the blockchain network, the delay between each of the candidate nodes 61, 62, and 63 and the candidate node 21 is minimal, and the candidate nodes 61, 62, and 63 may be divided into one packet e. Thus, packet e may be associated with candidate node 21. Among them, the candidate node 21 may be responsible for distributing the block it acquires to the nodes in the packet e based on the distribution mechanism of the error correction code.
Exemplarily, fig. 3 is a flowchart illustrating a method for grouping nodes in a blockchain provided in an embodiment of the present disclosure. Therein, 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 method for grouping nodes in the block chain includes the following steps:
at S302, the first node obtains grouping information from the blockchain, where the grouping information is stored in a contract state of the intelligent contract, and the grouping information includes: the grouping 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 block chain, the first node may obtain node information of the first nodes that establish the block chain through information recorded in the created block in the block chain, such as: IP address and port of the node, etc. Then, the first node may establish a connection with the first nodes that establish the block chain based on a connection manner such as TLS (Transport Layer Security), TCP (Transmission Control Protocol), UDP (User Datagram Protocol), and the like. After the connection is successfully established, the first node may initiate a block synchronization request to the node connected to the first node, so that the first node may acquire each block in the block chain and acquire the grouping information based on the latest block in the block chain. For example, after acquiring the latest block, the first node may execute all transactions in the block, and update its local contract state according to the execution of the transactions, so as to obtain grouping information from the contract state. Illustratively, the grouping information may include grouping identifications of M groups and node information of each node included in the M groups, wherein M ≧ 0. Wherein the grouping information may be stored in a contract state of the intelligent contract.
In S304, when M is larger than or equal to 1, the first node determines that the first node can establish connection with K groups of the M groups according to the grouping information, and K is larger than or equal to 1 and smaller than or equal to M.
In this embodiment, when M is greater than or equal to 1, the first node may obtain an IP address, a port, and the like of each node according to node information of each node in the packet information, and may create a connection with the nodes based on a connection manner such as TSL, TCP, UDP, and the like, thereby determining K packets that may be connected. Wherein a first node is considered to be connectable to a second group when the first node can establish a connection with all nodes within the second group. When the first node cannot establish connection with any node in a group, the network between the first node and the group is in a non-full connection state, and at this time, the first node can be prohibited from being added into the group, so that the data blocks in the group can be guaranteed to be distributed smoothly. At the same time, the first node may stop establishing connections with other nodes within the group. For example, when a first node cannot establish a connection with a node in a group, the first node may actively disconnect from other nodes in the group if the first node has already established connections with other nodes in the group.
At S306, the first node determines the delay between itself and each of the K packets to obtain K first target delays.
In this embodiment, the first node may perform data interaction with nodes in the K groups, and determine the time delay between the first node and each other node according to the time when the first node transmits data and the time when the first node receives data fed back by other nodes. The time delay between the first node and the other nodes may reflect 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, it indicates that the distance between the first node and the other nodes is very close.
For example, taking the first node determining the time delay between the first node and the second node as an example, 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. At S404, the second node may return an ACK (Acknowledgement) message to the first node after acquiring the heartbeat packet, and the first node may record the acquisition time T2 after acquiring the ACK message. At S406, the first node may determine a latency between it and the second node from T1 and T2, where the latency is (T2-T1). For example, the number of times that the first node sends the heartbeat packet may be multiple times, and in this case, the number of times that the second node feeds back the ACK message may also be multiple times. When the number of times that the first node sends the heartbeat packet is multiple times, the first node may determine the time delay between the first node and the second node based on the time between the first node sending the heartbeat packet and acquiring the ACK message each time. For example, if the time for sending the heartbeat packet for the first time is T1.1, the time for obtaining the ACK message for the first time is T1.2, the time for sending the heartbeat packet for the second time is T2.1, the time for obtaining the ACK message for the second time is T2.2, the time for sending the heartbeat packet for the third time is T3.1, and the time for obtaining the ACK message for the third time is T3.2, the time delay between the first node and the second node is ((T1.2-T1.1) +
(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 each group can be determined according to 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 packet a in fig. 1, assuming that the latencies between the first node and the nodes 21, 22 and 23 are t1, t2 and t3, respectively, the first target latency between the first node and the packet a may be: (t1+ t2+ t 3)/3. It is to be understood that, the delay time when the first node determines the first target between the first node and each packet may also be determined in other manners, such as variance, etc., besides the manner of average value, and is not limited herein.
At 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 the K first target delays. For example, the first node may select a packet corresponding to the 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 the 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, J is larger than or equal to 0 and smaller 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 group from information related to each node in the obtained group information. The first node may then compare the number of nodes within each packet to a predetermined first number threshold. When the number of nodes in a packet is greater than or equal to the first number threshold, it indicates that no new nodes can be added in the packet, and therefore the packet can be discarded. Therefore, J groups can be determined from the K groups, 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.
In S504, when J is larger than or equal to 1, the target grouping is determined according to J first target time delays corresponding to the J groups.
In this embodiment, when J ≧ 1, it indicates that there is a packet that the first node can join at this time, and therefore, the target packet can be determined according to J first target delays corresponding to J packets. Illustratively, Q first target time delays can be determined from the J first target time delays according to the determined J first target time delays and a preset first time delay threshold, wherein Q is greater than or equal to 0 and is 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 larger than or equal to 1, determining the target packet as a packet corresponding to the minimum time delay in the Q first target time delays. When the first target delay is greater than or equal to the first delay threshold, the first target delay indicates that the distance between the first node and the corresponding packet is longer, so that the corresponding packet can be removed; and when the first target delay is smaller than the first delay threshold, the first node is indicated to be closer to the corresponding packet, so that the corresponding packet can be reserved. For the case where J ═ 0 and Q ═ 0, see the description below for details.
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 for invoking the smart contract for adding the first node in a target grouping of the contract state.
In this embodiment, after the first node determines the target packet, the first node may send a first transaction to the blockchain. The first transaction may be used to invoke an intelligent contract to add a first node in a targeted grouping of current contract states. After receiving the first transaction, each consensus node (e.g., node 11-node 14 in fig. 1) in the block chain packages the first transaction and other multiple transactions into, for example, a first block to be executed by consensus, and then each consensus node executes the first transaction and other multiple transactions, respectively, generates a first block, and performs consensus on the first block. After the first block is successfully identified, each identifying node may send the first block to the group corresponding to the identifying node, so that each node in the group may obtain the first block.
Specifically, assuming that the target packet corresponding to the first node is the packet a, after the node 12 executes the first transaction, the node information of the first node is added to the packet information of the packet a in the contract state of the smart contract, so that the node 12 can respectively send the first block to the node 21, the node 22, the node 23, and the first node according to the packet information.
After acquiring the first block, the node 21, the node 22, the node 23 and the first node may respectively execute the first transaction and other multiple transactions in the first block, and update the local world state accordingly. Specifically, the first node adds the node information of the first node to the grouping information of the group a in the contract state of the intelligent contract by executing the first transaction in the first block, and then the first node may establish a connection with other nodes according to the node information of each node in the group a. Thereby, the grouping to the first node is completed. At the same time, the first node is divided into a group closest to it.
In some embodiments, N consensus nodes may be included in the blockchain. Wherein, X groups can be hung under each common node, and the value of X can be preset. It is understood that the number of packets that can be dropped under the nodes other than the common node in the blockchain may also be preset.
When the number of the pending packets does not reach the set upper limit of the number, the node indicates that the pending packets can be further pending under the nodes. Therefore, when the first node is grouped, the first node can be grouped by considering the time delay between the first node and the common node of which the number of the packets which are hung down does not reach the set upper limit of the number.
Exemplarily, fig. 6 is a schematic flowchart of another method for grouping nodes in a blockchain provided in an embodiment of this specification. Therein, 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 method for grouping nodes in the block chain includes the following steps:
at S602, the first node obtains grouping information from the blockchain, where the grouping information is stored in a contract state of the intelligent contract, and the grouping information includes: the grouping 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, see the description in S301 before, and are not described herein again.
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 of the M groups according to the grouping information, and K is more than or equal to 1 and less than or equal to M. For S602, see the description in S302, which is not repeated herein.
In S606, the first node determines the time delay between the first node and each of the K packets to obtain K first target time delays, and determines the time delay between the first node and R common nodes when the number of packets that are suspended by R common nodes in N common nodes included in the block chain does not reach the second number threshold, to obtain R second target time delays, where R is greater than or equal to 1 and less than or equal to N.
In this embodiment, the first node may respectively determine, based on the foregoing delay determination manner, a delay between the first node and each of the K packets, and when the number of packets that are hung down by R common nodes in N common nodes included in the block chain does not reach the second number threshold, determine a delay between the first node and the R common nodes, so as to obtain K first target delays and R second target delays. Wherein, R of the R common nodes can be understood as a set of common nodes for which the number of the pending packets does not reach the set upper limit of the number.
In S608, the first node determines that the minimum time delay of the R second target time delays is smaller than the minimum time delay of the K first target time delays, and selects the consensus node corresponding to the minimum time delay of the R second target time delays as the first target node.
In this embodiment, when the minimum delay of the R second target delays is smaller than the minimum delay of the K first target delays, it indicates that the distance between the first node and the common node corresponding to the minimum delay of the R second target delays is the closest, and therefore, the common node corresponding to the minimum delay of the R second target delays may be selected as the first target node, so as to create a new packet under the node. It is to be understood that when the minimum delay of the R second target delays is greater than the minimum delay 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, where the second transaction is used to invoke a smart contract for creating a new packet under the first target node in the contracted state, and adds 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 new packet under the first destination node in the current contract state and to add the first node to the created packet. Thereby, the grouping of the first node is completed.
In some embodiments, when J of the J determined packets is 0, or Q of the Q determined first target delays is 0, or when the smallest delay of the R determined second target delays is greater than the second delay threshold and less than the smallest delay of the K first target delays, it indicates that there is no packet that the first node can join in the preceding block chain, and/or a packet cannot be newly created under the common node. At this time, in order that the first node may be grouped, a new packet may be created for the first node under a node other than the common node. Specifically, as shown in fig. 7, the following steps may be included:
at S702, the first node determines, according to the grouping information, a time delay between the first node and each node in the M groups, so as to obtain S third target time delays.
In this embodiment, the first node may obtain information related to each node in the packet information obtained by the first node, and may determine, based on the aforementioned delay determination 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 each of the nodes in the M packets according to the S third target delays.
In this embodiment, the first node may determine the second target node from each node in the M packets according to the S third target delays. For example, the first node may select a node corresponding to the minimum 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 is used to invoke the smart contract for creating a new packet under the second target node in the contracted state, and the first node is added to the created packet.
In this embodiment, after the first node determines the second target node, the first node may send a third transaction to the blockchain. The third transaction is used to invoke the smart contract for creating a new packet under the second destination node in the current contract state and adding the first node to the created packet. Thereby, the grouping of the first node is completed.
In some embodiments, when M ≧ 1, this indicates that there is a packet in the current blockchain, so the first node can be grouped based on the latency between the first node and the respective packet at that time. And when M is 0, it indicates that there is no packet in the current blockchain, and at this time, the first node may be grouped based on the time delay between the first node and each of the common nodes in the blockchain.
Exemplarily, fig. 8 is a flowchart illustrating another method for grouping nodes in a blockchain provided in an embodiment of the present disclosure. Therein, 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 method for grouping nodes in the block chain includes the following steps:
at S802, the first node obtains grouping information from the blockchain, where the grouping information is stored in a contract state of the intelligent contract, and the grouping information includes: the grouping 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, see the description in S301 before, and are not described herein again.
At S804, when M is equal to 0, the first node determines a time delay between the first node and each of N common nodes in the block chain, so as to obtain N fourth target time delays.
In this embodiment, when M is equal to 0, the first node may respectively establish a connection with N common nodes in the block chain, and determine a time delay between the first node and each common node based on the aforementioned determination time delay manner, so as to obtain N fourth target time delays. The fourth target time delay between the first node and the common node may reflect the distance between the first node and the common node, for example, when the time delay between the first node and the common node is very small, it indicates that the distance between the first node and the common 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 common nodes according to the N fourth target delays. For example, the first node may select the consensus node corresponding to the 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 being used to invoke the smart contract for creating a new packet under a third target node in the contracted state, and adding the first node to the created packet.
In this embodiment, after the first node determines the third target node, the fourth transaction may be sent to the blockchain. The fourth transaction may be used to invoke the smart contract to create a new packet under a third destination node of the current contract state and to add the first node to the created packet. Thereby, the grouping of the first node is completed.
At this point, the grouping of the first node is completed in the above manner. It is to be understood that the first node may be a node that is disconnected from other nodes in the group where the first node is located and cannot be reconnected, or a node that does not complete block recovery in a certain group, besides the node that newly joins the block chain.
After the grouping is complete, the blocks may be distributed based on the grouping situation. For ease of understanding, the block distribution process is described below in conjunction with fig. 1.
Continuing with fig. 1, take node 12 distributing blocks to packet a as an example. The nodes 11, 12, 13 and 14 may generate the block a after reaching a consensus for a certain transaction based on a consensus algorithm (e.g., BFT (Byzantine Fault Tolerance) algorithm). Then, the node 12 may encode the block a by using an error correction code to add redundant bits (also referred to as redundancy) to the block a, 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 each broadcast the data block they each acquired from node 12 in packet a. Thus, the nodes 21, 22, and 23 can all acquire 3 data blocks, and restore the block a from the 3 data blocks. Whereby the node 12 completes the distribution of the block a.
Based on the same concept as the foregoing method embodiment, an embodiment of the present specification further provides a node grouping apparatus in a block chain.
Exemplarily, fig. 9 is a schematic structural diagram of a block link point provided in an embodiment of the present disclosure. Block link node as shown in fig. 9, the block link node 900 includes: a communication module 910 and a processing module 920. 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 intelligent contract, and the grouping information includes: the grouping 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 that the block link point and K of the M groups can establish connection according to the grouping information when M is greater than or equal to 1, where K is greater than or equal to 1 and less than or equal to M; determining time delay between each block chain link point and each block in the K blocks to obtain K first target time delays; and determining the target grouping according to the K first target time delays. The communication module 910 may also be configured to send a first transaction to the blockchain, the first transaction to invoke the intelligent contract for adding a blockchain node in a target grouping of contract states.
In some embodiments, when determining the target packet according to the K first target delays, the processing module 920 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 larger than or equal to 1, determining the target group according to J first target time delays corresponding to the J groups.
In some embodiments, when determining the target packet according to the J first target delays corresponding to the J packets, the processing module 920 is specifically configured to: determining Q first target time delays from the J first target time delays according to the J first target time delays and a first time delay threshold, wherein 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 the packet corresponding to the minimum time delay in the Q first target time 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 groups hung under R common identification nodes in the N common identification nodes does not reach a second number threshold, determining time delay between the block chain node and the R common identification 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 a first target node.
The communication module 910 may be further configured to send a second transaction to the blockchain, the second transaction being used to invoke the smart contract for creating a new packet under the first target node in the contracted state and adding the blockchain node to the created packet.
In some embodiments, the processing module 920 may be further configured to: when J is 0, or Q is 0, or the determined minimum time delay of the R second target time delays is greater than a second time delay threshold and less than the minimum time delay of the K first target time delays, determining the time delay between the link point of the block and each node in the M groups according to the grouping information to obtain S third target time delays; and determining a second target node from each node in the M groups according to the S third target time delays.
The communication module 910 may be further configured to send a third transaction to the blockchain, the third transaction being used to invoke the smart contract for creating a new packet under the second target node in the contracted state and adding the blockchain node to the created packet.
In some embodiments, the processing module 920 may be further configured to: when M is equal to 0, determining time delay between the block chain link point and each of N common-knowledge nodes in the block chain to obtain N fourth target time delays; and determining a third target node from the N common nodes according to the N fourth target time delays.
The communication module 910 may be further configured to send a fourth transaction to the blockchain, the fourth transaction being used to invoke the smart contract for creating a new packet under a third target node in the contracted state and adding the blockchain node to the created packet.
In some embodiments, the communication module 910 is specifically configured to: carrying out block synchronization with at least one common node in the block chain to obtain the latest block in the block chain; based on the latest block in the block chain, the grouping information is obtained.
In some embodiments, the processing module 920 may be further configured to: when the block chain link node cannot establish a connection with a first packet of the M packets, determining that the block chain link node cannot join the first packet.
It should be understood that the above-mentioned apparatus is used for executing the method in the above-mentioned embodiments, and the implementation principle and technical effect of the apparatus are similar to those described in the above-mentioned method, and the working process of the apparatus may refer to the corresponding process in the above-mentioned method, and is not described herein again.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using 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, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, 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 for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a server system. Of course, this application does not exclude that with future developments in computer technology, the computer implementing the functionality of the above described 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, 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 approaches. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or end product executes, it may execute sequentially or in parallel (e.g., parallel processors or multi-threaded environments, or even distributed data processing environments) according to the method shown in the embodiment or 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, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For example, if the terms first, second, etc. are used to denote names, they do not denote any particular order.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, when implementing one or more of the present description, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, etc. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 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), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, 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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
As will be appreciated by one skilled in the art, 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. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the 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 can 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.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points. In the description of the specification, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," 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 specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer 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, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
The above description is merely exemplary of one or more embodiments of the present disclosure and is not intended to limit the scope of one or more embodiments of the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present specification should be included in the scope of the claims.

Claims (16)

1. A method of node grouping in a blockchain, the method being performed by a first node, the method comprising:
obtaining grouping information from a block chain, wherein the grouping information is stored in a contract state of an intelligent contract, and the grouping information comprises: grouping identifiers of M groups and node information of each node contained in the M groups, wherein M is more than or equal to 0;
when M is larger than or equal to 1, determining that the first node can establish connection with K groups in the M groups according to the grouping information, wherein K is larger than or equal to 1 and is smaller than or equal to M;
determining time delay between the first node and each of the K packets to obtain K first target time delays;
determining a target group according to the K first target time delays;
sending a first transaction to the blockchain, the first transaction to invoke the smart contract for adding the first node in the target grouping of the contract state.
2. The method of claim 1, wherein the determining a target packet according to 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, 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 larger than or equal to 1, determining the target group according to J first target time delays corresponding to the J groups.
3. The method of claim 2, wherein the determining the target packet according to J first target delays corresponding to the J packets comprises:
determining Q first target time delays from the J first target time delays according to the J first target time delays and a first time delay threshold, wherein Q is more than or equal to 0 and less than or equal to J, and the Q first target time delays are all less 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 minimum time delay in the Q first target time delays.
4. The method of claim 1, wherein the blockchain includes N consensus nodes;
the method further comprises the following steps:
when the number of the groups hung under R common nodes in the N common nodes does not reach a second number threshold, determining the time delay between the first node and the R common nodes 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 common 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 create a new packet under the first target node in the contract state, and adding the first node in the created packet.
5. The method of any of claims 2 to 4, wherein the method further comprises:
when J is equal to 0, or Q is equal to 0, or the minimum time delay of the determined R second target time delays is greater than a second time delay threshold and less than the minimum time delay of the K first target time delays, determining the time delay between the first node and each node in the M packets according to the packet information, so as to obtain S third target time delays;
determining a second target node from each node in the M groups according to the S third target time delays;
sending a third transaction to the blockchain, the third transaction being used to invoke the smart contract for creating a new packet under the second target node in the contracted state and adding the first node to the created packet.
6. The method of any of claims 1 to 4, wherein the method further comprises:
when M is equal to 0, determining time delay between the first node and each of N common nodes in the block chain to obtain N fourth target time delays;
determining a third target node from the N common nodes according to the N fourth target time delays;
sending a fourth transaction to the blockchain, the fourth transaction being used to invoke the intelligent contract for creating a new packet under the third target node in the contracted state and adding the first node to the created packet.
7. The method according to any one of claims 1 to 4, wherein the obtaining packet information from the blockchain comprises:
performing block synchronization with at least one common node in the block chain to obtain the latest block in the block chain;
and acquiring the grouping information based on the latest block in the block chain.
8. The method of any of claims 1 to 4, wherein the method further comprises:
determining that the first node cannot join a first packet of the M packets when the first node cannot establish a connection with the first packet.
9. A block link point, comprising:
a communication module configured to obtain grouping information from a block chain, the grouping information being stored in a contract state of an intelligent contract, the grouping information including: grouping identifiers of M groups and node information of each node contained in the M groups, wherein M is more than or equal to 0;
the processing module is configured to determine that the block chain link points can be connected with K groups in the M groups according to the grouping information when M is larger than or equal to 1, and K is larger than or equal to 1 and smaller than or equal to M; determining time delay between the block chain link point and each of the K groups to obtain K first target time delays;
the processing module is further configured to determine a target group according to the K first target delays;
the communication module is further configured to send a first transaction to the blockchain, the first transaction to invoke the smart contract for adding the blockchain node in the target grouping of contract states.
10. The blockchain node of claim 9, wherein the processing module, 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 larger than or equal to 1, determining the target group according to J first target time delays corresponding to the J groups.
11. The block-link point according to claim 10, wherein the processing module, when determining the target packet according to J first target latencies corresponding to the J packets, is specifically configured to:
determining Q first target time delays from the J first target time delays according to the J first target time delays and a first time delay threshold, wherein Q is more than or equal to 0 and less than or equal to J, and the Q first target time delays are all less 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 minimum time delay in the Q first target time delays.
12. The block link point of claim 9, wherein the block chain comprises N consensus nodes therein;
the processing module is further configured to determine, when the number of packets hung under R common nodes in the N common nodes does not reach a second number threshold, a time delay between the block link point and the R common nodes to obtain R second target time delays, where R is greater 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 common 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, where the second transaction is used to invoke the intelligent contract to create a new packet under the first target node in the contract state, and add the blockchain node to the created packet.
13. The blockchain node of any one of claims 10 to 12, wherein,
the processing module is further configured to determine, according to the grouping information, a time delay between the block link point and each node in the M groups to obtain S third target time delays, when J is equal to 0, or Q is equal to 0, or a minimum time delay of the determined R second target time delays is greater than a second time delay threshold and is less than a minimum time delay of the K first target time delays; determining a second target node from each node 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, where the third transaction is used to invoke the intelligent contract for creating a new packet under the second target node in the contract state, and add the blockchain node to the created packet.
14. The blockchain node of any one of claims 9 to 12, wherein,
the processing module is further configured to determine a time delay between the block chain link point and each of N common nodes in the block chain to obtain N fourth target time delays when M is 0; determining a third target node from the N common nodes according to the N fourth target time delays;
the communication module is further configured to send a fourth transaction to the blockchain, where the fourth transaction is used to invoke the intelligent contract to create a new packet under the third target node in the contract state, and add the blockchain node to the created packet.
15. A computer-readable storage medium having stored thereon a computer program which, when executed in a computing device, causes the computing device to perform the method of any of claims 1 to 8.
16. A computing device comprising a memory having stored therein a computer program and a processor that, when executed, implements the method of any of claims 1 to 8.
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 true CN114679457A (en) 2022-06-28
CN114679457B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174573A (en) * 2022-06-30 2022-10-11 蚂蚁区块链科技(上海)有限公司 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
CN115174572A (en) * 2022-06-30 2022-10-11 蚂蚁区块链科技(上海)有限公司 Data multicast method in block chain and block chain link point
CN117812092A (en) * 2024-02-28 2024-04-02 中国信息通信研究院 Predicate-based block compression transmission method and apparatus, device and medium

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

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174573A (en) * 2022-06-30 2022-10-11 蚂蚁区块链科技(上海)有限公司 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
CN115174572A (en) * 2022-06-30 2022-10-11 蚂蚁区块链科技(上海)有限公司 Data multicast method in block chain and block chain link point
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
CN117812092A (en) * 2024-02-28 2024-04-02 中国信息通信研究院 Predicate-based block compression transmission method and apparatus, device and medium

Also Published As

Publication number Publication date
CN114679457B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
CN114679457A (en) Node grouping method in block chain and block chain link point
TW201837748A (en) Consensus method and device based on block chain
US10860375B1 (en) Singleton coordination in an actor-based system
WO2024001024A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
WO2023160085A1 (en) Method for executing transaction, blockchain, master node, and slave node
CN109145053B (en) Data processing method and device, client and server
TW202008763A (en) Data processing method and apparatus, and client
WO2023231337A1 (en) Method for executing transaction in blockchain, and master node and slave node of blockchain
US11647103B1 (en) Compression-as-a-service for data transmissions
CN114281893A (en) Processing method, device and equipment for block chain transaction
CN113067897A (en) Cross-chain interaction method and device
CN114936092A (en) Method for executing transaction in block chain and main node of block chain
CN113206893B (en) Method for block synchronization and node joining block chain network
WO2024001032A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
CN114785800A (en) Cross-link communication method and device
CN113259462B (en) Block chain message distribution method and device
CN116366666A (en) Chain state updating method and block link point in block chain system
EP3779691B1 (en) Data processing method and apparatus
CN114731297A (en) Message-limited ad-hoc network group for computing device peer matching
CN115174572B (en) Data multicasting method in blockchain, blockchain node and storage medium
CN114785853B (en) Method, apparatus, storage medium and computing device for cross-chain communication in a blockchain system
CN115174573B (en) Data broadcasting method in block chain system, node and block chain system
CN112579343A (en) Block link point data recovery method and device
CN115174574A (en) Data broadcasting method in block chain system, node and block chain system
CN115098595A (en) Node grouping method in blockchain system and blockchain node

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