Search

CN-121984981-A - Block chain consensus method and device and electronic equipment

CN121984981ACN 121984981 ACN121984981 ACN 121984981ACN-121984981-A

Abstract

The embodiment of the invention discloses a block chain consensus method, a block chain consensus device and electronic equipment. The method comprises the steps of obtaining relevant factors and relevant nodes of each block chain node, carrying out grouping processing on all block chain nodes according to the relevant factors and the relevant nodes to obtain cloud consensus groups and at least one edge cluster consensus group, constructing an edge consensus tree for each edge cluster consensus group, carrying out primary consensus based on the edge consensus tree, carrying out secondary consensus based on the cloud consensus groups in response to the primary consensus passing, and determining the block chain consensus passing in response to the secondary consensus passing. The embodiment of the disclosure converts the total block chain consensus into cloud and edge collaborative consensus, and performs consensus based on a corresponding edge consensus tree in the edge cluster, so that the communication quantity between block chain nodes performing the consensus and the communication quantity between block chain nodes are obviously reduced, and the block chain consensus efficiency is obviously improved on the premise of ensuring the accuracy of the block chain consensus.

Inventors

  • YANG MENG

Assignees

  • 中国移动通信集团辽宁有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260505
Application Date
20260119

Claims (10)

  1. 1. A method of blockchain consensus, comprising: Acquiring a correlation factor and a correlation node of each blockchain node participating in blockchain consensus; According to the correlation factors and the correlation nodes, grouping all the blockchain nodes to obtain cloud consensus groups and at least one edge cluster consensus group; Constructing an edge consensus tree aiming at each edge cluster consensus group, and carrying out primary consensus based on the edge consensus tree; responding to the first-level consensus passing, and carrying out second-level consensus based on the cloud consensus group; The blockchain consensus passing is determined in response to the secondary consensus passing.
  2. 2. The method of claim 1, wherein the obtaining the correlation factor and correlation node for each blockchain node participating in blockchain consensus comprises: Acquiring historical performance data of each block chain node participating in the block chain consensus, wherein the historical performance data at least comprises the number of times and average completion time of the consensus and the verification accuracy of each other node when each block chain link is used as a main node to perform the consensus verification with all other nodes; and acquiring the correlation factor and the correlation node according to the historical performance data.
  3. 3. The method of claim 1, wherein the grouping all the blockchain nodes according to the correlation factor and the correlation node to obtain a cloud consensus group and an edge cluster consensus group comprises: According to the correlation factors and the correlation nodes, dividing all the blockchain nodes into at least two groups in an equalizing way; for each group, acquiring average consensus success rate of all the blockchain nodes in the group; And determining the group with the highest average consensus success rate as the cloud consensus group, and determining the rest groups as the edge cluster consensus groups.
  4. 4. The method of claim 3, wherein said equally dividing all of said blockchain nodes into at least two groups based on said correlation factor and said correlation node comprises: acquiring the number of target groups, and sequentially selecting a first bit node in each group from all the blockchain nodes according to the correlation factors and the correlation nodes; And carrying out relevance reverse order arrangement on the rest of the block chain nodes, and sequentially and evenly dividing the rest of the block chain nodes into each group.
  5. 5. The method of claim 4, wherein said sequentially selecting the first bit node in each of said packets from all of said blockchain nodes based on said correlation factor and said correlation node comprises: For a first group, selecting the blockchain node with the highest correlation factor from all blockchain link points based on breadth-first traversal as a first bit node of the first group; And from the second group, based on breadth-first traversal, selecting the blockchain node with the highest correlation factor from the blockchain nodes except the first bit node of the previous group and the correlation node corresponding to the first bit node of the previous group as the first bit node of the current group until the first bit node of each group is selected.
  6. 6. The method of claim 1, wherein the edge consensus tree has an n-layer structure, wherein n is an integer greater than or equal to 2, wherein constructing the edge consensus tree for each of the edge cluster consensus groups comprises: acquiring average response time between each block chain node and other nodes in the edge cluster consensus group, and taking the block chain node with the minimum average response time as a root node of a first layer; And from the second layer, based on a greedy algorithm, acquiring the mutual request response time between any two blockchain nodes and the request response time between each blockchain node and a corresponding father node from the blockchain nodes in the edge cluster consensus groups except the root node, and taking the two blockchain nodes with the smallest sum of the mutual request response time and the request response time as the nodes of the current layer until all the blockchain nodes in the edge cluster consensus groups are selected.
  7. 7. The method according to claim 6, further comprising: and responding to the fact that the number of layers with faults in any edge consensus tree reaches a target layer number threshold value, and carrying out edge consensus tree reconstruction processing.
  8. 8. A blockchain consensus device, comprising: The acquisition unit is used for acquiring the correlation factor and the correlation node of each blockchain node participating in blockchain consensus; the grouping processing unit is used for grouping all the blockchain nodes according to the correlation factors and the correlation nodes to obtain cloud consensus groups and at least one edge cluster consensus group; the first-level consensus unit is used for constructing an edge consensus tree aiming at each edge cluster consensus group and carrying out first-level consensus based on the edge consensus tree; the second-level consensus unit is used for responding to the first-level consensus, and carrying out second-level consensus based on the cloud consensus group; And the determining unit is used for responding to the second-level consensus passing and determining the block chain consensus passing.
  9. 9. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
  10. 10. A processor-readable storage medium, characterized in that the processor-readable storage medium stores a computer program for causing the processor to perform the method of any one of claims 1-7.

Description

Block chain consensus method and device and electronic equipment Technical Field The present disclosure relates generally to blockchain technology, and more particularly, to a blockchain consensus method, apparatus, and electronic device. Background Blockchain (blockchain) technology is a decentralized distributed ledger technique that concatenates blocks of data in order and cryptographically encrypts the data so that the data is securely distributed among the participants. Its core features include decentralization, transparency, non-tamper-evident properties and autonomy. Based on the above characteristics, blockchain technology has been widely applied to various fields such as digital government, supply chain management, financial services, voting systems, and the internet of things, etc., to enhance the credibility and efficiency of the system by providing secure data sharing and processing means. Blockchain consensus is one of the cores of blockchains, and is an important means for the blockchain network to agree on a decentralized environment, so that the processing efficiency of the blockchain consensus greatly influences the service experience of the blockchain. However, the current blockchain consensus method often has the disadvantage of low efficiency. Thus, how to efficiently perform blockchain consensus is a need for solving the problem. Disclosure of Invention Embodiments of the present disclosure provide a blockchain consensus method, apparatus, and electronic device, with respect to some of the drawbacks referred to in the background. In a first aspect, an embodiment of the disclosure provides a blockchain consensus method, which includes obtaining a correlation factor and a correlation node of each blockchain node participating in blockchain consensus, performing grouping processing on all blockchain nodes according to the correlation factor and the correlation node to obtain a cloud consensus group and at least one edge cluster consensus group, constructing an edge consensus tree for each edge cluster consensus group, performing primary consensus based on the edge consensus tree, performing secondary consensus based on the cloud consensus group in response to the primary consensus pass, and determining blockchain consensus pass in response to the secondary consensus pass. In a second aspect, the embodiment of the disclosure provides a blockchain consensus device, which comprises an acquisition unit, a grouping processing unit, a first-level consensus unit, a second-level consensus unit and a determining unit, wherein the acquisition unit is used for acquiring a correlation factor and a correlation node of each blockchain node participating in blockchain consensus, the grouping processing unit is used for grouping all blockchain link points according to the correlation factor and the correlation node to obtain a cloud consensus group and at least one edge cluster consensus group, the first-level consensus unit is used for constructing an edge consensus tree for each edge cluster consensus group and performing first-level consensus based on the edge consensus tree, the second-level consensus unit is used for responding to the first-level consensus passing and performing second-level consensus based on the cloud consensus passing, and the determining unit is used for determining the blockchain consensus passing in response to the second-level consensus passing. In a third aspect, an embodiment of the disclosure provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first aspect when executing the program. In a fourth aspect, embodiments of the present disclosure provide a processor-readable storage medium storing a computer program for causing a processor to perform the method of the first aspect. In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect. The embodiment provided by the disclosure has at least the following beneficial technical effects: According to the block chain consensus method, the cloud consensus grouping and at least one edge cluster consensus grouping can be obtained by acquiring the correlation factor and the correlation node of each block chain node participating in the block chain consensus and grouping all block chain link points according to the correlation factor and the correlation node. Then, an edge consensus tree is constructed for each edge cluster consensus group, primary consensus is conducted based on the edge consensus tree, secondary consensus is conducted based on the cloud consensus group in response to the primary consensus passing, and block chain consensus passing is determined in response to the secondary consensus passing. Therefore, the embodiment of the disclosure converts t