A blockchain consensus efficiency improving method and device
By establishing a node ranking table for blockchain consensus nodes and sorting them according to reputation values, nodes with high reputations are prioritized for transactions and block broadcasting, thus solving the problem of low consensus efficiency in blockchain networks and achieving faster transaction processing and blockchain consensus speed.
Patent Information
- Application Number
- CN202211371445.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-11-03
AI Technical Summary
How to improve the efficiency of transaction broadcasting and block production consensus of consensus nodes in a blockchain network, so as to improve the overall transaction throughput and consensus speed of the blockchain.
By establishing a node ranking table for blockchain consensus nodes, nodes are scored and ranked according to their reputation values. Nodes with high reputations are given priority for transactions or block broadcasts. The node ranking table is updated and sent regularly to ensure the fairness and impartiality of node ranking.
It improves the processing efficiency of consensus nodes in the blockchain network, ensures fast and high-quality processing of transactions and block broadcasts, and enhances the consensus efficiency of the blockchain.
Smart Images

Figure CN115630229B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer software technology, and in particular to a method, apparatus, electronic device, and storage medium for improving blockchain consensus efficiency. Background Technology
[0002] At the physical level, the transaction throughput of a blockchain network depends on the block production and packaging efficiency of nodes within the network. Many factors influence this efficiency. For example, verifying each transaction in the blockchain transaction list relies on the efficiency of broadcasting the transaction content. After block production and packaging, the consensus speed depends on whether the packaging node can broadcast the block quickly enough to other consensus nodes, allowing them to verify the new block. Therefore, improving the efficiency of blockchain consensus by enabling faster broadcasting of transactions or new blocks when selecting consensus nodes for transaction broadcasting or block production is a pressing technical problem. Summary of the Invention
[0003] The purpose of the embodiments in this specification is to address the above-mentioned problems by providing a method, apparatus, electronic device, and storage medium for improving blockchain consensus efficiency.
[0004] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:
[0005] Firstly, a method for improving blockchain consensus efficiency is proposed, including:
[0006] A node ranking table is created based on reputation value to sort multiple consensus nodes in the blockchain.
[0007] The criteria for scoring the reputation value of the current consensus node are determined, and the reputation values of other consensus nodes connected to the current consensus node are scored.
[0008] Update the node ranking table of the current consensus node based on the reputation score;
[0009] The scoring information of the current consensus node is periodically sent to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score.
[0010] Based on the node ranking table, the consensus nodes that participate in the consensus voting are determined.
[0011] Furthermore, the fields of the node ranking table include at least the unique identifier of the consensus node, reputation score, and / or sort number.
[0012] Furthermore, the reputation score is based on factors including node connection response speed, failure rate, historical voting rate, staked token value, and / or the scoring information of other nodes.
[0013] Furthermore, the node ranking table of the current consensus node is updated based on the reputation score, including a higher score for a higher ranking.
[0014] Furthermore, the scoring information of the current consensus node is periodically sent to other consensus nodes, including sending the scoring information of the current consensus node when the current node initiates a connection heartbeat probe with other consensus nodes.
[0015] Furthermore, it also includes: after a preset period, the node clears the node ranking table of the current node so that the current node can rebuild the node ranking table.
[0016] Secondly, a device for improving blockchain consensus efficiency is proposed, including:
[0017] The first module is capable of creating a node ranking table that sorts multiple consensus nodes in the blockchain based on reputation value for the current consensus node.
[0018] The second module is able to determine the basis for scoring the reputation value of the current consensus node, and to score the reputation values of other consensus nodes connected to the current consensus node;
[0019] The third module is capable of scoring based on reputation value and updating the node ranking table of the current consensus node;
[0020] The fourth module is capable of periodically sending the scoring information of the current consensus node to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score.
[0021] The fifth module is able to determine the multiple consensus nodes participating in consensus voting based on the node ranking table.
[0022] Furthermore, it also includes:
[0023] The sixth module can clear the node ranking table of the current node after a preset period, so that the current node can rebuild the node ranking table.
[0024] Thirdly, an electronic device is proposed, characterized in that it comprises:
[0025] Processor; and
[0026] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the blockchain consensus efficiency improvement method described in the first aspect.
[0027] Fourthly, a computer-readable storage medium is proposed, characterized in that the computer-readable storage medium stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the blockchain consensus efficiency improvement method described in the first aspect.
[0028] This manual can achieve at least the following technical effects:
[0029] The present invention sorts consensus nodes connected to a node by setting a sorting list for the nodes and determining different scoring criteria for different nodes. Regardless of how the economic model in the blockchain protocol is designed or how the consensus algorithm is selected, the consensus nodes with higher reputation scores among all interconnected nodes can be prioritized for processing transactions or block consensus, thereby improving the consensus efficiency of the blockchain. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is one of the schematic diagrams illustrating a method for improving blockchain consensus efficiency provided in the embodiments of this specification.
[0032] Figure 2 This is the second schematic diagram of a method for improving blockchain consensus efficiency provided in the embodiments of this specification.
[0033] Figure 3 This is one of the schematic diagrams of a blockchain consensus efficiency improvement device provided in the embodiments of this specification.
[0034] Figure 4 This is the second schematic diagram of a blockchain consensus efficiency improvement device provided in the embodiments of this specification.
[0035] Figure 5 This is a schematic diagram of the structure of an electronic device provided as an embodiment of this specification. Detailed Implementation
[0036] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0037] The following section provides a detailed explanation of a blockchain consensus efficiency improvement scheme presented in this manual, using specific examples.
[0038] Example 1
[0039] This invention focuses on how to improve the efficiency of blockchain consensus by broadcasting transactions or new blocks more quickly when selecting consensus nodes for transaction broadcasting or block production. Generally, the transaction throughput of a blockchain network depends on the efficiency of the network nodes in packaging blocks at the physical level. Many factors influence block production, including the efficiency of broadcasting transaction content, which depends on the efficiency of each transaction in the block's transaction list. After a block is packaged, the consensus speed depends on whether the node that packaged the block has a sufficiently fast enough efficiency to broadcast it to other consensus nodes to achieve consensus on the new block. Therefore, if the blockchain network nodes can sort their consensus node list based on factors such as block propagation efficiency and consensus efficiency, the efficiency of block packaging and verification consensus can be improved to some extent. This principle can be compared to the PageRank principle of web search engines. When using a search engine, the results show that web pages with higher reputation rank higher in search results. A web page's reputation is calculated based on the number of times it is cited by other web pages and the reputation of the citing web pages themselves.
[0040] Therefore, the node ranking technology solution in this invention is used as the ranking basis for the node ranking table. The principle of node ranking is that the higher a node's reputation, the higher it is selected to send transactions / block broadcasts. Taking the PBFT consensus algorithm as an example, this algorithm requires the number of nodes participating in consensus voting to be approximately (2f+1) / (3f+1) of the total number of nodes, which is about 2 / 3. Therefore, as long as about 2 / 3 of the nodes can respond and process quickly, the network can be guaranteed to process transactions quickly and with high quality continuously. Figure 1 The illustration shows a method for improving blockchain consensus efficiency according to an embodiment of the present invention. When a node broadcasts a transaction or a new block, the order in which the nodes to which it is connected are sorted according to a dynamically maintained node reputation ranking table. The method includes:
[0041] S1: Based on reputation value, establish a node ranking table to sort multiple consensus nodes in the blockchain.
[0042] Optionally, the fields of the node ranking table include at least a unique identifier for the consensus node, a reputation score, and / or a sort number. Specifically, improving the consensus efficiency of a blockchain network cannot be achieved by improving the efficiency of a single node; therefore, all consensus nodes participating in the blockchain need to establish such a node ranking table.
[0043] S2: Determine the basis for scoring the reputation value of the current consensus node, and score the reputation values of other consensus nodes connected to the current consensus node.
[0044] Optionally, the reputation score is based on factors including node connection response speed, failure rate, historical voting rate, staking token value, and / or other node scoring information. Specifically, the reputation score criteria need to be selected in conjunction with the specific consensus protocol. For example, when the consensus protocol is BFT, node connection response speed can be used as the scoring criterion; the faster the response speed, the higher the reputation score and the higher the ranking. When the consensus protocol is POW, historical voting rate can be used as the scoring criterion; the higher the historical voting rate, i.e., the more times a node participates in block production consensus voting, the higher the reputation score and the higher the ranking. When the consensus protocol is POS, staking token value can be used as the scoring criterion; the higher the staking token value, the higher the reputation score and the higher the ranking. Node failure rate and reference to other node scoring can also be used; for node failure rate, fewer failures result in a higher reputation score and a higher ranking. The scoring information for other nodes includes a node ranking table and the scoring criteria.
[0045] S3: Update the node ranking table of the current consensus node based on the reputation score.
[0046] Optionally, the node ranking table of the current consensus node is updated based on the reputation score, including a higher score for a higher ranking.
[0047] S4: Periodically send the scoring information of the current consensus node to other consensus nodes. The scoring information includes at least the node ranking table and the reputation score criteria. Specifically, the reason for periodically sending the node ranking table and reputation score criteria of the current consensus node to other consensus nodes is that the node's ranking table and scoring criteria can be provided as a reference to other nodes. If the receiving node and the sending node have the same consensus protocol, the same node performance, or are connected to the same or similar consensus nodes, they can refer to the sending node's node ranking table and scoring criteria. This can improve the efficiency of the node in calculating the node ranking table and save computing resources.
[0048] Optionally, the scoring information of the current consensus node is periodically sent to other consensus nodes, including sending the scoring information of the current consensus node when the current node initiates a connection heartbeat probe with other consensus nodes.
[0049] S5: Based on the node ranking table, determine the multiple consensus nodes that will participate in the consensus vote.
[0050] like Figure 2 As shown, another implementation of the blockchain consensus efficiency improvement method according to an embodiment of the present invention further includes:
[0051] S6: After a preset period, the current node clears its node ranking table so that it can rebuild the ranking table. Specifically, the ranking table lifecycle is set to periodicity. Each node's own ranking table reaches a certain block production cycle. This cycle can be used as a blockchain protocol parameter or as a node-defined configuration. For example, the ranking table is cleared after every n blocks are generated, so that newly added nodes have a fair chance to compete and avoid the possibility of centralized malicious activity caused by a fixed number of nodes producing blocks.
[0052] It should be noted that the solutions of this invention are applicable to peer-to-peer interconnected blockchain networks. Regardless of the design of the blockchain protocol's economic model or the choice of consensus algorithms for blockchain nodes, they can optimize the network layer. Thus, among all interconnected nodes in the network, those with higher reputation values are prioritized for transaction processing, ensuring the quality of the communication network. Therefore, it should be understood that any application scenario that satisfies the solution of this invention by constructing a node ranking table and forming node ranking tables for each node based on the blockchain protocol and different consensus algorithms of different blockchain nodes conforms to the technical features and protection scope of this invention.
[0053] Example 2
[0054] Figure 3This is a schematic diagram of a blockchain consensus efficiency improvement device 300 provided as an embodiment of this specification. Please refer to... Figure 3 A blockchain consensus efficiency improvement device 300 in one embodiment is characterized by comprising:
[0055] The first module 301 is capable of establishing a node ranking table that sorts multiple consensus nodes in the blockchain based on the reputation value of the current consensus node.
[0056] The second module 302 is capable of determining the basis for scoring the reputation value of the current consensus node, and scoring the reputation values of other consensus nodes connected to the current consensus node;
[0057] The third module 303 is capable of updating the node ranking table of the current consensus node based on the reputation score.
[0058] The fourth module 304 is capable of periodically sending the scoring information of the current consensus node to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score.
[0059] The fifth module 305 is able to determine the multiple consensus nodes participating in consensus voting based on the node ranking table.
[0060] like Figure 4 As shown, another implementation of the blockchain consensus efficiency improvement device 300 according to an embodiment of the present invention further includes:
[0061] The sixth module 306 is capable of clearing the node ranking table of the current node after a preset period, so that the current node can rebuild the node ranking table.
[0062] It should be understood that the blockchain consensus efficiency improvement device according to the embodiments of this specification can also perform... Figures 1 to 2 A method for implementing a blockchain consensus efficiency improvement device (or equipment), and for realizing the blockchain consensus efficiency improvement device (or equipment) in... Figures 1 to 2 The functionality of the example shown will not be elaborated upon here.
[0063] Example 3
[0064] Figure 5 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 5At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0065] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0066] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0067] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a shared resource access control mechanism at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0068] A node ranking table is created based on reputation value to sort multiple consensus nodes in the blockchain.
[0069] The criteria for scoring the reputation value of the current consensus node are determined, and the reputation values of other consensus nodes connected to the current consensus node are scored.
[0070] The node ranking table of the current consensus node is updated based on the reputation score.
[0071] The scoring information of the current consensus node is periodically sent to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score.
[0072] Based on the node ranking table, the consensus nodes that participate in the consensus voting are determined.
[0073] The above is as described in this instruction manual. Figures 1 to 2 The blockchain consensus efficiency improvement method disclosed in the illustrated embodiment can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this specification can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0074] Of course, in addition to the software implementation, the electronic devices in the embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0075] Example 4
[0076] This specification also provides an embodiment of a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figures 1 to 2 The method of the illustrated embodiment is specifically used to perform the following method:
[0077] A node ranking table is created based on reputation value to sort multiple consensus nodes in the blockchain.
[0078] The criteria for scoring the reputation value of the current consensus node are determined, and the reputation values of other consensus nodes connected to the current consensus node are scored.
[0079] The node ranking table of the current consensus node is updated based on the reputation score.
[0080] The scoring information of the current consensus node is periodically sent to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score.
[0081] Based on the node ranking table, the consensus nodes that participate in the consensus voting are determined.
[0082] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
[0083] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0084] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0085] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0086] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A method for improving blockchain consensus efficiency, characterized in that, include: A node ranking table is created based on reputation value to sort multiple consensus nodes in the blockchain. The reputation score of the current consensus node is determined based on the following criteria: the reputation scores of other consensus nodes connected to the current consensus node are also scored. The reputation score criteria include node connection response speed, failure rate, historical voting rate, staked token value, and / or other node scoring information. The reputation score criteria need to be selected in conjunction with the consensus protocol. Update the node ranking table of the current consensus node based on the reputation score; The scoring information of the current consensus node is periodically sent to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score. Based on the node ranking table, determine the multiple consensus nodes that will participate in the consensus vote; After a preset period, the node ranking table of the current node is cleared so that the current node can rebuild the node ranking table.
2. The method for improving blockchain consensus efficiency according to claim 1, characterized in that, The nodes ranking table includes at least the following fields: unique identifier of consensus nodes, reputation score, and / or sort number.
3. The method for improving blockchain consensus efficiency according to claim 1, characterized in that, The node ranking table of the current consensus node is updated based on the reputation score, with higher scores ranking higher.
4. The method for improving blockchain consensus efficiency according to claim 1, characterized in that, The scoring information of the current consensus node is periodically sent to other consensus nodes, including initiating a connection heartbeat probe between the current consensus node and other consensus nodes to send the scoring information of the current consensus node.
5. A device for improving blockchain consensus efficiency, characterized in that, include: The first module is capable of creating a node ranking table that sorts multiple consensus nodes in the blockchain based on reputation value for the current consensus node. The second module is capable of determining the reputation score scoring criteria for the current consensus node and scoring the reputation scores of other consensus nodes connected to the current consensus node; the reputation score scoring criteria include node connection response speed, failure rate, historical voting rate, staked token value and / or other node scoring information; the reputation score scoring criteria need to be selected in conjunction with the consensus protocol; The third module is capable of scoring based on reputation value and updating the node ranking table of the current consensus node; The fourth module is capable of periodically sending the scoring information of the current consensus node to other consensus nodes. The scoring information includes at least the node ranking table and the basis for the reputation score. The fifth module is able to determine the multiple consensus nodes participating in consensus voting based on the node ranking table.
6. The blockchain consensus efficiency improvement device according to claim 5, characterized in that, Also includes: The sixth module can clear the node ranking table of the current node after a preset period, so that the current node can rebuild the node ranking table.
7. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the blockchain consensus efficiency improvement method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including multiple applications, cause the electronic device to perform the blockchain consensus efficiency improvement method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Block chain node management method and device and readable storage medium
CN110392115A
Decentralized transaction method and device based on node sorting and related products
CN112184439A