A consensus node incentive method, device, electronic device and storage medium

By obtaining the packaging and voting information of the consensus node, calculating the evaluation results and allocating rewards, the stability of the consensus node in the alliance chain is solved, and the continuous and stable service and service level improvement of the consensus node is achieved.

CN115426352BActive Publication Date: 2025-01-10HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210821803.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-12
Publication Date
2025-01-10
Estimated Expiration
2042-07-12

AI Technical Summary

Technical Problem

How to maintain the continuous and stable service of consensus nodes in the alliance chain, the existing technology is difficult to effectively encourage consensus nodes to operate stably for a long time.

Method used

By obtaining the packaging information and voting information of the consensus node within the preset time period, calculating the evaluation results, and allocating rewards based on the evaluation results, using gradient reward rules and deduction coefficient mechanisms to ensure the service stability and quality of the consensus node.

Benefits of technology

The continuity and stability of consensus node services are achieved, the service level of consensus nodes is improved, and the overall performance and reliability of the alliance chain are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115426352B_ABST
    Figure CN115426352B_ABST
Patent Text Reader

Abstract

The present application relates to a consensus node incentive method, device, electronic device and storage medium, and belongs to the field of blockchain technology. Among them, a consensus node incentive method includes: within a preset time period, respectively obtaining the packaging information of any of the M consensus nodes that package the block, and when the packaging information indicates normal block generation, obtaining the voting information for the consensus node; M is greater than or equal to 4; according to the packaging information and the voting information, obtaining the evaluation results of each of the consensus nodes within the preset time period; according to the evaluation results of each of the consensus nodes, allocating rewards to each of the consensus nodes. This method allocates rewards to consensus nodes based on the evaluation results obtained from the packaging information and voting information, which can maintain the continuity and stability of consensus node services and promote consensus nodes to develop to a better service level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a consensus node incentive method, device, electronic device and storage medium. Background Art

[0002] The consortium chain is only for members of a specific group and limited third parties. It specifies multiple pre-selected consensus nodes as bookkeepers. Each block is generated by one of the consensus nodes. Other access nodes can participate in transactions, but do not ask about the bookkeeping process. Other third parties can perform limited queries through the open API of the blockchain. In order to obtain better performance, the consortium chain has certain requirements for the configuration of consensus nodes and the network environment.

[0003] For alliance chains, how to ensure that consensus nodes can provide continuous and stable services has always been a direction that the industry continues to explore. Summary of the invention

[0004] In order to solve the technical problem of how to maintain continuous and stable service of consensus nodes, the present application provides a consensus node incentive method, device, electronic device and storage medium.

[0005] In a first aspect, the present application provides a consensus node incentive method, the method comprising:

[0006] Within a preset time period, respectively obtain the packaging information of any of the M consensus nodes that package the block, and when the packaging information indicates that the block is produced normally, obtain the voting information for the consensus node; M is greater than or equal to 4;

[0007] According to the packaging information and the voting information, obtaining the evaluation results of each of the consensus nodes within a preset time period;

[0008] Allocate rewards to each of the consensus nodes according to the evaluation results of each of the consensus nodes;

[0009] Optionally, obtaining evaluation results of each of the consensus nodes within a preset time period according to the packaging information and the voting information includes:

[0010] Extracting the voting source indicated by the voting information, and determining the number of votes for each of the consensus nodes according to the voting source;

[0011] Determine the packaging quantity of each consensus node according to the packaging information indicating normal block generation;

[0012] The number of votes of each consensus node and the number of packages of each consensus node are used as evaluation data of each consensus node within a preset time period; and the evaluation results of each consensus node are determined according to the evaluation data;

[0013] Optionally, in determining the evaluation result of each of the consensus nodes according to the evaluation data, determining the evaluation result of any of the consensus nodes includes:

[0014] Determine the highest number of votes and the highest number of packages in each of the consensus nodes within a preset time period from the evaluation data;

[0015] Obtaining a first weight of the voting quantity, and obtaining a second weight of the packaging quantity;

[0016] The voting evaluation score of the consensus node is obtained according to the number of votes, the highest number of votes and the first weight, and the packaging evaluation score of the consensus node is obtained according to the packaging number, the highest packaging number and the second weight; the voting evaluation score and the packaging evaluation score are summed to obtain an effective serviceability score, and the effective serviceability score is used as the evaluation result of the consensus node; the voting evaluation score is proportional to the number of votes and the first weight, and inversely proportional to the highest number of votes; the packaging evaluation score is proportional to the packaging number and the second weight, and inversely proportional to the highest packaging number;

[0017] Optionally, allocating rewards to each of the consensus nodes according to the evaluation results of each of the consensus nodes includes:

[0018] Obtaining reward rules; the reward rules include gradient reward rules, and the gradient reward rules are a mapping relationship between effective service scores and gradient coefficients;

[0019] Determining a gradient coefficient of each of the consensus nodes according to the mapping relationship and the effective serviceability score of each of the consensus nodes;

[0020] Allocate rewards to each of the consensus nodes according to the basic rewards of each of the consensus nodes within a preset time period and the gradient coefficient of each of the consensus nodes;

[0021] Optionally, after determining the gradient coefficient of each of the consensus nodes, the method further includes:

[0022] Obtain a node qualification list; the node qualification list includes each of the consensus nodes; each of the consensus nodes in the node qualification list is packaged in rotation;

[0023] When the gradient coefficient of the consensus node is less than a preset value, the consensus node is removed from the node qualification list; the preset value is less than or equal to one;

[0024] Obtain a list of standby nodes, and determine a target node from the list of standby nodes;

[0025] Add the target node to the node qualification list to package the block in the next preset time;

[0026] Optionally, after determining the gradient coefficient of each of the consensus nodes, the method further comprises: when the gradient coefficient of any of the consensus nodes is less than one, determining a deduction coefficient of the consensus node, the sum of the deduction coefficient and the gradient coefficient being one;

[0027] Determine the total deduction amount of the consensus node according to the basic reward of the consensus node within the preset time period and the deduction coefficient;

[0028] Distribute the total deduction amount evenly to other consensus nodes among the M consensus nodes that meet preset conditions; the preset conditions include being able to obtain the full amount of the basic reward;

[0029] Optionally, before obtaining voting information for the consensus node, the method further includes: determining that a block that is normally produced is a valid block, so that other consensus nodes among the M consensus nodes vote for the consensus node that packages the valid block; the valid block is a non-empty block.

[0030] In a second aspect, the present application provides a consensus node incentive device, the device comprising:

[0031] An acquisition module is used to obtain the packaging information of any of the M consensus nodes that package the block within a preset time period, and when the packaging information indicates that the block is produced normally, obtain the voting information for the consensus node; M is greater than or equal to 4;

[0032] A calculation module, used to obtain the evaluation results of each of the consensus nodes within a preset time period according to the packaging information and the voting information;

[0033] An incentive module is used to allocate rewards to each of the consensus nodes according to the evaluation results of each of the consensus nodes.

[0034] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0035] Memory, used to store computer programs;

[0036] The processor is used to implement the steps of the consensus node incentive method described in any one of the embodiments of the first aspect when executing the program stored in the memory.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the consensus node incentive method as described in any one of the embodiments of the first aspect.

[0038] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0039] The method provided in the embodiment of the present application obtains the packaging information of any of the M consensus nodes that package the block within a preset time period, and when the packaging information indicates normal block generation, obtains the voting information for the consensus node; M is greater than or equal to 4; based on the packaging information and the voting information, obtains the evaluation results of each of the consensus nodes within the preset time period; and based on the evaluation results of each of the consensus nodes, allocates rewards to each of the consensus nodes. This method allocates rewards to consensus nodes based on the evaluation results obtained from the packaging information and the voting information, which can maintain the continuity and stability of the consensus node service and promote the consensus node to develop to a better service level. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 A system architecture diagram of a consensus node incentive method provided for one embodiment of the present application;

[0043] Figure 2 A flowchart of a consensus node incentive method provided for an embodiment of the present application;

[0044] Figure 3 A schematic diagram of consensus node rotation packaging provided for an embodiment of the present application;

[0045] Figure 4 A schematic diagram of the structure of a consensus node incentive device provided in one embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0048] The first embodiment of the present application provides a consensus node incentive method, which can be applied to Figure 1 The system architecture shown can be a consortium chain, which includes at least four consensus nodes 101. The consensus nodes package blocks according to preset rules. After each packaging, the consensus node that packages the blocks generates packaging information. When the consensus node cannot package the blocks in time and synchronize them to other nodes due to network connection stability or too small bandwidth, the packaging timeout will be triggered. The packaging information indicates that the packaging is abnormal. When the packaging information indicates that the block is generated normally, other consensus nodes vote for the consensus node that packages the blocks. The consortium chain platform obtains the evaluation results of each consensus node based on the packaging information and voting information within the preset time, and allocates rewards to each consensus node based on the evaluation results. Among them, the allocated rewards are positively correlated with the evaluation results. By differentially allocating rewards, the continuity and stability of the consensus node service can be maintained, and the consensus node can be promoted to develop to a better service level.

[0049] Next, the consensus node incentive method is explained in detail. Figure 2 , methods include:

[0050] Step 201, within a preset time period, respectively obtain the packaging information of any consensus node among the M consensus nodes that package the block, and when the packaging information indicates that the block is normally produced, obtain the voting information for the consensus node; M is greater than or equal to 4.

[0051] Step 202: Obtain the evaluation results of each consensus node within a preset time period based on the packaging information and voting information.

[0052] Step 203: Allocate rewards to each consensus node according to the evaluation results of each consensus node.

[0053] In this embodiment, based on the evaluation results obtained from the packaging information and voting information, the consensus nodes are rewarded differently, which can maintain the continuity and stability of the consensus node services and promote the consensus nodes to develop to a better service level. Among them, the allocated rewards are positively correlated with the evaluation results. In addition, due to the decentralization of the blockchain, there is no interference in the evaluation process, all statistical data sources are on the chain, transparent and traceable, and through the block-level evaluation system, it has the advantages of consensus guarantee, clarity, high degree of executability, simplicity and convenience.

[0054] In this embodiment, each consensus node in the alliance chain platform can adopt a rotating packaging method to package blocks in turn, such as Figure 3 , take the example of the alliance chain including four consensus nodes, which are node A, node B, node C and node D. Node A packs block 01 and reports the network and block status through heartbeat: normal block, normal operation. Then it is the turn of node B to pack. Node B packs block 02 and reports the network and block status through heartbeat: normal block, normal operation. Then it is the turn of node C to pack. When node C packs, the packing fails due to network or computer resource problems. The heartbeat reports the network and block status: abnormal block, abnormal operation. At this time, node D repacks block 03. After node D normally produces blocks, it is the turn of node A to pack blocks, and the cycle continues.

[0055] It should be noted that the number of consensus nodes M in the alliance chain platform needs to satisfy M≥3F+1, where F is the number of Byzantine nodes, so M≥4. In this embodiment, M=4 is used as an example only and does not represent a limit on the number of M. In fact, M can also be any value greater than 4.

[0056] In one embodiment, based on the packaging information and the voting information, an evaluation result of each consensus node within a preset time period is obtained, including: extracting the voting source indicated by the voting information, determining the number of votes of each consensus node according to the voting source, determining the packaging number of each consensus node according to the packaging information indicating normal block generation, using the number of votes of each consensus node and the packaging number of each consensus node as evaluation data of each consensus node within the preset time period, and determining the evaluation result of each consensus node according to the evaluation data.

[0057] In this embodiment, after each packaging, when the packaging information indicates normal block generation, the voting information for this packaging of the consensus node can be obtained, and the voting source indicated by the voting information can be extracted to determine the number of votes for each consensus node within the preset time period, and then combined with the number of packaging of each consensus node, the evaluation results of each consensus node can be determined.

[0058] When determining the evaluation results, weight values ​​can be assigned to the packaging quantity and the voting quantity respectively to determine the evaluation results of the consensus node.

[0059] In one embodiment, in determining the evaluation results of each consensus node according to the evaluation data, determining the evaluation result of any consensus node includes:

[0060] From the evaluation data, determine the highest number of votes and the highest number of packages in each consensus node within the preset time;

[0061] Obtaining a first weight of the number of votes, and obtaining a second weight of the number of packages;

[0062] The voting evaluation score of the consensus node is obtained according to the number of votes, the highest number of votes and the first weight, and the packaging evaluation score of the consensus node is obtained according to the packaging number, the highest packaging number and the second weight; the voting evaluation score and the packaging evaluation score are summed to obtain the effective service score, and the effective service score is used as the evaluation result of the consensus node; the voting evaluation score is proportional to the number of votes and the first weight, and inversely proportional to the highest number of votes; the packaging evaluation score is proportional to the packaging number and the second weight, and inversely proportional to the highest packaging number.

[0063] In this embodiment, the alliance chain in the above embodiment includes nodes A, B, C, and D as an example. Assuming that the highest value of the voting score and the packaging score is a full score of 1, it is necessary to first determine the highest number of votes and the highest number of packages in nodes A, B, C, and D from the evaluation data within the preset time period. The voting score of the node corresponding to the highest number of votes is 1, and the packaging score of the node corresponding to the highest number of packages is 1. The other nodes convert the voting score according to the ratio of their own number of votes to the highest number of votes, and convert the packaging score according to the ratio of their own number of packages to the highest number of packages. The voting score is multiplied by the first weight to obtain the voting evaluation score, and the packaging score is multiplied by the second weight to obtain the packaging evaluation score. The sum of the two is obtained to obtain the scoring result (i.e., the evaluation result) of the consensus node within the preset time period, and the evaluation result of each consensus node is obtained by the same method.

[0064] In one embodiment, rewards are allocated to each consensus node based on the evaluation results of each consensus node, including: obtaining reward rules, the reward rules include gradient reward rules, the gradient reward rules are a mapping relationship between an effective service score and a gradient coefficient, the gradient coefficient of each consensus node is determined based on the mapping relationship and the effective service score of each consensus node, and rewards are allocated to each consensus node based on the basic rewards of each consensus node within a preset time and the gradient coefficient of each consensus node.

[0065] In this embodiment, the reward rules can be changed by regular voting of the alliance, which can be gradient reward rules. The gradient reward rules are the mapping relationship between the effective service score and the gradient coefficient. For example, the consensus nodes that meet certain conditions within the preset time can get the full reward, and those that do not meet the conditions can get different gradient coefficients according to the completion status. The reward of the consensus node within the preset time is determined according to the gradient coefficient. Setting gradient rewards can motivate consensus nodes with better completion to continue to maintain a high level of service, and poor consensus nodes can adjust themselves to improve their service level in the next period to strive for better rewards, thereby improving the service stability of the entire alliance chain, promoting the consensus nodes to develop to a better service level, and generating a virtuous circle.

[0066] Of course, the consensus node qualifications of the consensus nodes with poor performance can also be revoked. In one embodiment, after determining the gradient coefficient of each consensus node, the method also includes: obtaining a node qualification list, the node qualification list includes each consensus node, and each consensus node in the node qualification list is packaged in rotation. When the gradient coefficient of the consensus node is less than a preset value, the consensus node is removed from the node qualification list, the preset value is less than or equal to one, and a backup node list is obtained. The target node is determined from the backup node list, and the target node is added to the node qualification list to package the block in the next preset time.

[0067] In this embodiment, when the gradient coefficient of a consensus node is less than a preset value, it is removed from the node qualification list of the consensus node. In the next round of rotation packaging, the consensus node with poor performance in the current period will no longer be qualified for packaging in the next period, which can further improve the service stability of the alliance chain. Of course, in order to ensure that the number of consensus nodes in the alliance chain remains unchanged, a target node is determined from the spare nodes, and the target node is added to the node qualification list to ensure the number of consensus nodes that can be served at the same time.

[0068] It should be noted that the current period refers to the incentive period of the time period included in the preset duration, and the next period refers to the incentive period of the time period corresponding to the next preset duration after the completion of the current period's reward distribution.

[0069] In one embodiment, after determining the gradient coefficient of each consensus node, the method further includes: when the gradient coefficient of any consensus node is less than one, determining the deduction coefficient of the consensus node, the sum of the deduction coefficient and the gradient coefficient is one, determining the total deduction amount of the consensus node according to the basic reward and deduction coefficient of the consensus node within a preset time period, and evenly distributing the total deduction amount to other consensus nodes among the M consensus nodes.

[0070] In this embodiment, in order to further incentivize consensus nodes to maintain a high service level, the deducted portion of the consensus nodes that cannot get the full basic reward will be evenly distributed to other consensus nodes that meet the preset conditions, where the preset conditions include being able to get the full basic reward.

[0071] In this embodiment, only the consensus nodes that can get all the basic rewards are allocated the deductions of other nodes that cannot get all the basic rewards, which can motivate each consensus node to maintain a high service level as much as possible. That is, the consensus nodes that get the full amount of basic rewards can also be allocated the deductions of the consensus nodes that cannot complete the full amount of basic rewards, which can greatly motivate them to maintain or even continue to improve their service level, which is conducive to the positive and healthy development of the alliance chain.

[0072] It should be noted that the basic reward refers to the reward that a consensus node that meets certain conditions can get, without considering additional allocations and deductions. For example, if the total reward is X and the number of consensus nodes is 4, when these 4 consensus nodes all meet certain conditions, the basic reward for each consensus node is X / 4, where the certain condition here can be that the effective service score is greater than a basic value, and the basic value can be set as needed, or if all consensus nodes have the same score, it is also considered that the consensus nodes meet certain conditions.

[0073] In one embodiment, before obtaining voting information for the consensus node, the method further includes: determining that a block that is normally produced is a valid block, so that other consensus nodes among the M consensus nodes vote for the consensus node that packages the valid block, and the valid block is a non-empty block.

[0074] In this embodiment, when the packaged block is a valid block, other consensus nodes will vote for the consensus node that packages the valid block to ensure the fairness of the voting.

[0075] In one embodiment, in order to provide gradient rewards to nodes, their services and capabilities must first be evaluated. The most important criterion for node evaluation is to analyze whether it can normally fulfill its obligation to package blocks and provide good alliance network services, which is defined here as "effective serviceability". Effective serviceability means: by counting the number of voting source nodes and packaging nodes in valid blocks (non-empty blocks) within a certain period and calculating the scores with weights respectively, to judge the service stability of each node (whether it can provide consensus, packaging and other capabilities in a sustainable and stable manner).

[0076] The effective service monitoring methods are as follows:

[0077] The platform uses the consensus algorithm to rotate the master node in the consensus process, and increases the monitoring and statistics of the node voting status and packaging during the block generation process, so as to better monitor the actual operation of each node. At the same time, due to the network connection stability or bandwidth problems of some nodes, it will not be possible to package the blocks in time and synchronize them to other nodes. At this time, the packaging timeout will be triggered, and the master node for packaging the block will be switched. The current node will lose the packaging right of the current block. Based on this, by counting the actual voting volume and packaging volume of the nodes in the daily valid blocks, the effective service of the node on that day can be estimated; by analogy, the effective service of the node in monthly, quarterly and other dimensions can also be counted.

[0078] Based on the above definition, how to quantify its "effective serviceability" indicator and how to divide different assessment levels, the alliance chain platform's solution is as follows:

[0079] like Figure 3 By monitoring the heartbeat information and on-chain block details of each node, the number of voting source nodes and packaging nodes in the valid block can be counted, and the effective service score of each node can be obtained by weight calculation.

[0080] Specific calculation strategy: specify a time period, count the number of voting source nodes and packaging nodes in the valid block, set the weights to 60% and 40% respectively; and assume that the highest value of each data is a full score of 1, and the remaining node data is converted into scores in proportion, all retaining 4 decimal places (later 5 decimal places, the alliance can vote and finalize according to the situation). The evaluation indicators and weight ratios can be changed by regular voting by the alliance. The effective service scoring logic within a certain period (preset duration) t is as follows:

[0081] Score service,t =Score vote,t +Score proposal,t ;

[0082] Node voting score vote,t ) = the number of valid votes of the node within the specified period / the highest number of votes of all nodes * 60%; Node packaging score (Score proposal,t ) = the node's packaging volume within the specified period / the highest packaging volume of all nodes * 40%.

[0083] Therefore, it can be concluded that:

[0084] Effectiveness score for the month (t = mouth): Score service,mouth =Sum(Score service,day ) / actual number of days in the month;

[0085] Effectiveness score for the day (t = day): Score service,day =Scorevote,day +Score proposal,day ;

[0086] According to actual business needs, the application party can set the preset time t to grade the effective service score according to different dimensions such as daily, weekly or monthly, and give different reward policies for different gradient scores.

[0087] Examples of node effective service gradient reward rules are as follows:

[0088] Assume that the alliance chain consists of 4 nodes, namely A / B / C / D, and the total reward for each period is X. Then when everyone's effective service score is consistent or greater than a certain threshold, the reward distribution for each node is X / 4.

[0089] Node effective service score for the month service,mouth ≥0.9999 (the value 0.9999 here is only for example and can be customized in specific applications), the node business effective service gradient coefficient is 100%, then the reward for this node is X / 4.

[0090] 0.999≤Score service,mouth <0.9999, the node's effective serviceability gradient coefficient is Y% (here Y% can be set to 66%, which can also be customized according to actual business), then the reward for this node is (X / 4)*Y%, and the remaining (1-Y%) can be evenly distributed to all nodes that meet the first condition.

[0091] 0.99≤Score service,mouth <0.999, the node's effective serviceability gradient coefficient is Z% (here Z% can be set to 34%, which can also be customized according to actual business), then the reward for this node is (X / 4)*Z%, and the remaining (1-Z%) can be evenly distributed to all nodes that meet the first condition.

[0092] Score service,mouth For nodes with a serviceability gradient coefficient of <0.99, the node effective serviceability gradient coefficient is 0%, and the node does not participate in receiving rewards. The rewards that the node deserves can be evenly distributed to all nodes that meet a certain threshold condition. In addition, the node with poor effective serviceability will be disqualified in the next period, and alternative nodes can be supplemented in turn.

[0093] Regarding the effective service score (Score service,mouth ) is 0.9999, 0.999 and 0.99. Assuming that the total number of valid blocks on each node chain is 20,000 per day, and node A has network fluctuations and sometimes cannot be packaged but votes normally every time, the score of A is as follows:

[0094] When A misses one block, his score is 0.99998=20000 / 20000*0.6+19999 / 20000*0.4, and the corresponding gradient coefficient is 100%;

[0095] When A misses 10 blocks, his score is 0.9998=20000 / 20000*0.6+19990 / 20000*0.4, and the corresponding gradient coefficient is 66%;

[0096] When A misses 100 blocks, his score is 0.998 = 20000 / 20000*0.6 + 19900 / 20000*0.4, and the corresponding gradient coefficient is 34%;

[0097] When A misses 1000 blocks, his score is 0.98=20000 / 20000*0.6+19000 / 20000*0.4, and the corresponding gradient coefficient is 0%.

[0098] In summary, based on the above reward rules, nodes with good and excellent services can not only obtain their own average rewards, but also receive compensation from poorly performing nodes. Nodes with poor performance will also be subject to certain deduction penalties, which will promote the development of nodes towards better service levels, the survival of the fittest, and the entire alliance can also provide a better network environment, which can promote the healthy and long-term development of the alliance chain ecosystem.

[0099] Among them, the most important ability of the alliance chain consensus node is to provide a stable package consensus service for the network. The evaluation system of the network environment and processing capacity in the consensus packaging stage in this embodiment will directly reflect the comprehensive ability of the node itself, and the relevant data can be publicly queried on the block, which is fair and convincing. The entire evaluation process is decentralized and interference-free. All statistical data sources are on the chain, transparent and traceable. The block-level evaluation system and consensus guarantee are clear at a glance, highly executable, simple and convenient.

[0100] It should be noted that the node mentioned in this embodiment refers to a consensus node with packaging authority.

[0101] It should be noted that the specific score values, the values ​​of Y and Z, and the specific values ​​of the corresponding gradient coefficients in the above examples are all examples and can be customized according to actual business needs. The embodiments of the present application are not limited thereto. In addition, the number of votes for each consensus node in the examples in this embodiment is 20,000, which does not mean that the number of votes for different consensus nodes must be the same. Instead, there are also cases where individual nodes cannot vote in the voting link after a certain packaging. This embodiment only assumes that node A sometimes cannot be packaged but can vote normally every time.

[0102] Based on the same technical concept, the second embodiment of the present application provides a consensus node incentive device, such as Figure 4 , the device comprises:

[0103] The acquisition module 401 is used to respectively acquire the packaging information of any of the M consensus nodes that package the block within a preset time period, and when the packaging information indicates that the block is produced normally, acquire the voting information for the consensus node; M is greater than or equal to 4;

[0104] A calculation module 402 is used to obtain the evaluation results of each of the consensus nodes within a preset time period according to the packaging information and the voting information;

[0105] The incentive module 403 is used to allocate rewards to each of the consensus nodes according to the evaluation results of each of the consensus nodes.

[0106] In this embodiment, the acquisition module 401 obtains the packaging information of the consensus node within the preset time period, and when the packaging information indicates normal block generation, obtains the voting information for the consensus node. The calculation module obtains the evaluation results of each consensus node within the preset time period according to the packaging information and the voting information, and the incentive module 403 allocates rewards to each consensus node according to the evaluation results. Among them, the allocated rewards are positively correlated with the evaluation results. By differentially allocating rewards to consensus nodes, the continuity and stability of consensus node services can be maintained, and the consensus nodes can be promoted to develop to a better service level.

[0107] like Figure 5 As shown, the third embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0108] Memory 113, used for storing computer programs;

[0109] In one embodiment, the processor 111 is configured to execute a program stored in the memory 113 to implement the consensus node incentive method provided by any one of the aforementioned method embodiments, including:

[0110] Within a preset time period, respectively obtain the packaging information of any of the M consensus nodes that package the block, and when the packaging information indicates that the block is produced normally, obtain the voting information for the consensus node; M is greater than or equal to 4;

[0111] According to the packaging information and the voting information, obtaining the evaluation results of each of the consensus nodes within a preset time period;

[0112] According to the evaluation results of each consensus node, rewards are allocated to each consensus node.

[0113] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0114] The communication interface is used for communication between the above terminal and other devices.

[0115] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0116] The above-mentioned 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, discrete hardware components.

[0117] The fourth embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the consensus node incentive method provided in any of the aforementioned method embodiments are implemented.

[0118] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0119] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0120] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In the description, the use of suffixes such as "module", "component" or "unit" used to represent elements is only to facilitate the description of the present invention and has no specific meaning in itself. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0121] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A consensus node incentive method, characterized in that: The method comprises: Within a preset time, respectively obtain the packaging information of any of the M consensus nodes that package the block, and when the packaging information indicates that the block is produced normally, obtain the voting information for the consensus node; M is greater than or equal to 4; According to the packaging information and the voting information, obtaining the evaluation results of each of the consensus nodes within a preset time period; Allocate rewards to each of the consensus nodes according to the evaluation results of each of the consensus nodes; Wherein, according to the packaging information and the voting information, the evaluation results of each of the consensus nodes within a preset time period are obtained, including: Extracting the voting source indicated by the voting information, and determining the number of votes for each of the consensus nodes according to the voting source; Determine the packaging quantity of each consensus node according to the packaging information indicating normal block generation; The number of votes of each consensus node and the number of packages of each consensus node are used as evaluation data of each consensus node within a preset time period; and the evaluation results of each consensus node are determined according to the evaluation data; Wherein, in determining the evaluation result of each of the consensus nodes according to the evaluation data, determining the evaluation result of any of the consensus nodes includes: Determine the highest number of votes and the highest number of packages in each of the consensus nodes within a preset time period from the evaluation data; Obtaining a first weight of the voting quantity, and obtaining a second weight of the packaging quantity; The voting evaluation score of the consensus node is obtained according to the number of votes, the highest number of votes and the first weight, and the packaging evaluation score of the consensus node is obtained according to the packaging number, the highest packaging number and the second weight; the voting evaluation score and the packaging evaluation score are summed to obtain an effective serviceability score, and the effective serviceability score is used as the evaluation result of the consensus node; the voting evaluation score is proportional to the number of votes and the first weight, and inversely proportional to the highest number of votes; the packaging evaluation score is proportional to the packaging number and the second weight, and inversely proportional to the highest packaging number.

2. The method according to claim 1, characterized in that According to the evaluation results of each of the consensus nodes, rewards are allocated to each of the consensus nodes, including: Obtaining reward rules; the reward rules include gradient reward rules, and the gradient reward rules are a mapping relationship between effective service scores and gradient coefficients; Determining a gradient coefficient of each of the consensus nodes according to the mapping relationship and the effective serviceability score of each of the consensus nodes; Rewards are allocated to each of the consensus nodes according to the basic rewards of each of the consensus nodes within a preset time period and the gradient coefficient of each of the consensus nodes.

3. The method according to claim 2, characterized in that After determining the gradient coefficient of each of the consensus nodes, the method further includes: Obtain a node qualification list; the node qualification list includes each of the consensus nodes; each of the consensus nodes in the node qualification list is packaged in rotation; When the gradient coefficient of the consensus node is less than a preset value, the consensus node is removed from the node qualification list; the preset value is less than or equal to one; Obtain a list of standby nodes, and determine a target node from the list of standby nodes; The target node is added to the node qualification list to package the block in the next preset time.

4. The method according to claim 2, characterized in that: After determining the gradient coefficient of each of the consensus nodes, the method further includes: when the gradient coefficient of any of the consensus nodes is less than one, determining a deduction coefficient of the consensus node, the sum of the deduction coefficient and the gradient coefficient being one; Determine the total deduction amount of the consensus node according to the basic reward of the consensus node within the preset time period and the deduction coefficient; The total deduction amount is evenly distributed to other consensus nodes among the M consensus nodes that meet preset conditions; the preset conditions include being able to obtain the full amount of the basic reward.

5. The method according to claim 1, characterized in that Before obtaining voting information for the consensus node, the method further includes: determining that a block that is normally produced is a valid block, so that other consensus nodes among the M consensus nodes vote for the consensus node that packages the valid block; the valid block is a non-empty block.

6. A consensus node incentive device, characterized in that: The device comprises: An acquisition module is used to obtain the packaging information of any of the M consensus nodes that package the block within a preset time period, and when the packaging information indicates that the block is produced normally, obtain the voting information for the consensus node; M is greater than or equal to 4; A calculation module, used to obtain the evaluation results of each of the consensus nodes within a preset time period according to the packaging information and the voting information; wherein, obtaining the evaluation results of each of the consensus nodes within a preset time period according to the packaging information and the voting information includes: extracting the voting source indicated by the voting information, and determining the number of votes of each of the consensus nodes according to the voting source; determining the number of packages of each of the consensus nodes according to the packaging information indicating normal block generation; using the number of votes of each of the consensus nodes and the number of packages of each of the consensus nodes as the evaluation data of each of the consensus nodes within the preset time period; determining the evaluation results of each of the consensus nodes according to the evaluation data; wherein, in determining the evaluation results of each of the consensus nodes according to the evaluation data, determining the evaluation result of any of the consensus nodes includes: From the evaluation data, determine the highest number of votes and the highest number of packages in each of the consensus nodes within a preset time period; obtain a first weight for the number of votes, and obtain a second weight for the number of packages; obtain the voting evaluation score of the consensus node according to the number of votes, the highest number of votes and the first weight, and obtain the package evaluation score of the consensus node according to the package number, the highest package number and the second weight; sum the voting evaluation score and the package evaluation score to obtain an effective service score, and use the effective service score as the evaluation result of the consensus node; the voting evaluation score is proportional to the number of votes and the first weight, and inversely proportional to the highest number of votes; the package evaluation score is proportional to the package number and the second weight, and inversely proportional to the highest package number; An incentive module is used to allocate rewards to each of the consensus nodes according to the evaluation results of each of the consensus nodes.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor is used to implement the steps of the consensus node incentive method described in any one of claims 1 to 5 when executing a program stored in a memory.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the consensus node incentive method as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • A block chain consensus method based on credit evaluation

    CN109819022A

  • Blockchain consensus node state monitoring method and device

    CN111786818A