+

CN112991068B - Share authorization proof DPoS consensus method, device, electronic device and storage medium - Google Patents

Share authorization proof DPoS consensus method, device, electronic device and storage medium Download PDF

Info

Publication number
CN112991068B
CN112991068B CN202110550794.9A CN202110550794A CN112991068B CN 112991068 B CN112991068 B CN 112991068B CN 202110550794 A CN202110550794 A CN 202110550794A CN 112991068 B CN112991068 B CN 112991068B
Authority
CN
China
Prior art keywords
state
node
nodes
credit
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110550794.9A
Other languages
Chinese (zh)
Other versions
CN112991068A (en
Inventor
石奕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhongke Yunqi Enterprise Service Co.,Ltd.
Original Assignee
Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuo Erzhi Lian Wuhan Research Institute Co Ltd filed Critical Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Priority to CN202110550794.9A priority Critical patent/CN112991068B/en
Publication of CN112991068A publication Critical patent/CN112991068A/en
Application granted granted Critical
Publication of CN112991068B publication Critical patent/CN112991068B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a share authorization certification (DPoS) consensus method, a device, electronic equipment and a storage medium, which are applied to a block chain network, wherein the block chain network comprises nodes in a normal state, a good state, an abnormal state or a malicious state, and the method comprises the following steps: acquiring a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the initial credit value characterizes a degree of trust of the first node in the second state; obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; and determining the second node with the credit value smaller than a preset threshold value, and deleting the second node.

Description

股份授权证明DPoS共识方法、装置、电子设备和存储介质Share authorization proof DPoS consensus method, device, electronic device and storage medium

技术领域technical field

本发明涉及区块链技术领域,尤其涉及一种股份授权证明(DPoS)共识方法、装置、电子设备和存储介质。The present invention relates to the field of blockchain technology, and in particular, to a consensus method, device, electronic device and storage medium for Proof of Share Authorization (DPoS).

背景技术Background technique

目前区块链的共识方法主要包括:工作量证明 (Proof of Work,PoW)、权益证明(Proof of Stake,PoS)、股份授权证明 (Delegate Proof of Stake,DPos)。其中,PoW共识方法较为成熟,通过分布式节点的算力竞争来保证数据的一整性和数据的安全性,但其强大的算力造成了资源浪费,主要是电力资源,并且10分钟的交易确认时间不适合小额交易的商业应用。PoS共识方法由系统中具有最高权益而非最高算力的节点获得记账权,其权益体现为节点对特定货币的所有权。PoS一定程度解决了PoW算力浪费的问题,并能缩短达成共识的时间,但其信用基础不够牢靠,并且存在垄断的风险。DPoS是一种“民主集中式”的记账方式,由系统中节点投票选出代表,代表进行记账。DPoS能解决PoW浪费能源问题,也能弥补PoS中拥有记账权益的参与者未必希望参与记账的缺点,但不能及时有效精确的诊断出恶意节点,并剔除代理节点集中的恶意节点,给网络造成安全隐患。而针对上述问题,目前尚无有效解决方案。At present, the consensus methods of blockchain mainly include: Proof of Work (PoW), Proof of Stake (PoS), and Delegate Proof of Stake (DPos). Among them, the PoW consensus method is relatively mature. It ensures data integrity and data security through the competition of distributed nodes' computing power. However, its powerful computing power causes waste of resources, mainly electricity resources, and 10-minute transactions. Confirmation time is not suitable for commercial applications of small transactions. In the PoS consensus method, the node with the highest equity rather than the highest computing power in the system obtains the right of bookkeeping, and its equity is reflected in the node's ownership of a specific currency. PoS solves the problem of wasting PoW computing power to a certain extent, and can shorten the time to reach consensus, but its credit foundation is not reliable enough, and there is a risk of monopoly. DPoS is a "democratic centralized" accounting method, in which the nodes in the system vote to elect representatives, and the representatives conduct accounting. DPoS can solve the problem of wasting energy in PoW, and it can also make up for the disadvantage that participants with bookkeeping rights in PoS may not want to participate in bookkeeping. cause a safety hazard. However, there is currently no effective solution to the above problems.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例期望提供一种股份授权证明(DPoS)共识方法、装置、电子设备和存储介质。In view of this, the embodiments of the present invention are expected to provide a consensus method, apparatus, electronic device, and storage medium for Proof of Share Authority (DPoS).

本发明实施例的技术实施例是这样实现的:The technical embodiments of the embodiments of the present invention are implemented as follows:

本发明实施例提供一种股份授权证明(DPoS)共识方法,应用于区块链网络中,所述区块链网络包括呈现正常状态、良好状态、异常状态或恶意状态的节点,所述方法包括:An embodiment of the present invention provides a Proof of Share Authorization (DPoS) consensus method, which is applied to a blockchain network, where the blockchain network includes nodes in a normal state, a good state, an abnormal state or a malicious state, and the method includes :

获得所述区块链网络中的第一节点以及所述区块链网络中发生新的交易产生的新区块;所述第一节点为所述节点中的任一节点;Obtain the first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any one of the nodes;

在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值;所述第一状态为所述正常状态、所述良好状态、所述异常状态中的任意状态;所述第二状态为所述正常状态、所述良好状态、所述异常状态或所述恶意状态中除所述第一状态以外的任一状态;所述初始信用值表征所述第一节点在所述第二状态的信任程度;In the case that the new block satisfies the preset condition, the first state of the first node is converted to the second state, and the initial credit value of the first node in the second state is obtained; the first The state is any of the normal state, the good state, and the abnormal state; the second state is the normal state, the good state, the abnormal state, or the malicious state, except for the Any state other than the first state; the initial credit value represents the trust level of the first node in the second state;

获得所述新区块的投票结果,根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值;所述其他节点为所述节点中除所述第一节点以外的节点;Obtain the voting result of the new block, perform credit rewards and punishments on other nodes according to the voting result and the initial credit value, and determine the credit value of the other nodes; the other nodes are the nodes except the first one. nodes other than nodes;

确定所述信用值小于预设阈值的第二节点,删除所述第二节点;所述第二节点为所述其他节点的节点。Determine the second node whose credit value is less than a preset threshold, and delete the second node; the second node is a node of the other nodes.

在上述方案中,所述在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值,包括:In the above solution, when the new block satisfies the preset condition, the first state of the first node is converted to the second state, and the initial state of the first node in the second state is obtained. Credit value, including:

在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述第一节点由所述正常状态转换为所述良好状态,获得所述第一节点在所述良好状态的初始信用值;所述有效区块表征所述新的交易没有产生冲突。In the case that the new block satisfies that the new block is a valid block, and the number of valid blocks is greater than a first preset threshold, the first node is converted from the normal state to the good state state, the initial credit value of the first node in the good state is obtained; the valid block indicates that the new transaction does not cause conflict.

在上述方案中,所述在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值,包括:In the above solution, when the new block satisfies the preset condition, the first state of the first node is converted to the second state, and the initial state of the first node in the second state is obtained. Credit value, including:

在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述第一节点由所述正常状态转换为所述异常状态且将所述第一节点由所述良好状态转换为所述异常状态,获得所述第一节点在所述异常状态的初始信用值;所述无效区块表征所述新的交易产生冲突。When the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is less than or equal to a second preset threshold, the first node is converted from the normal state to the Abnormal state, and the first node is converted from the good state to the abnormal state, and the initial credit value of the first node in the abnormal state is obtained; the invalid block indicates that the new transaction produces a conflict .

在上述方案中,所述在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值,包括:In the above solution, when the new block satisfies the preset condition, the first state of the first node is converted to the second state, and the initial state of the first node in the second state is obtained. Credit value, including:

在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述第一节点由所述异常状态转换为所述恶意状态,获得所述第一节点在所述恶意状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In the case that the new block satisfies that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold, the first node is converted from the abnormal state to the malicious state state, obtain the initial credit value of the first node in the malicious state; the invalid block indicates that the new transaction conflicts.

在上述方案中,根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值,包括:In the above solution, credit rewards and punishments are performed on other nodes according to the voting result and the initial credit value, and the credit value of the other nodes is determined, including:

根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;Perform credit penalty on other nodes according to the voting result and the initial credit value, and obtain the credit penalty value of the other nodes;

获得所述其他节点的信用奖励值;Obtain the credit reward value of the other nodes;

根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值。According to the credit penalty value and the credit reward value, the credit value of the other node is determined.

本发明实施例提供一种股份授权证明(DPoS)共识装置,应用于区块链网络中,所述区块链网络包括呈现正常状态、良好状态、异常状态或恶意状态的节点,所述装置包括:获得单元、转换单元和确定单元,其中:An embodiment of the present invention provides a Proof of Share Authority (DPoS) consensus device, which is applied in a blockchain network, where the blockchain network includes nodes in a normal state, a good state, an abnormal state or a malicious state, and the device includes : obtain unit, conversion unit and determination unit, where:

所述获得单元,用于获得所述区块链网络中的第一节点以及所述区块链网络中发生新的交易产生的新区块;所述第一节点为所述节点中的任一节点;The obtaining unit is used to obtain a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any node among the nodes ;

所述转换单元,用于在所述获得单元获得的所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值;所述第一状态为所述正常状态、所述良好状态、所述异常状态中的任意状态;所述第二状态为所述正常状态、所述良好状态、所述异常状态或所述恶意状态中除所述第一状态以外的任一状态;所述初始信用值表征所述第一节点在所述第二状态的信任程度;The conversion unit is configured to convert the first state of the first node to the second state under the condition that the new block obtained by the obtaining unit satisfies a preset condition, and obtain the location of the first node in the The initial credit value of the second state; the first state is any state in the normal state, the good state, and the abnormal state; the second state is the normal state, the good state, any state other than the first state in the abnormal state or the malicious state; the initial credit value represents the trust level of the first node in the second state;

所述确定单元,用于获得所述新区块的投票结果,根据所述投票结果和所述转换单元获得的所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值;所述其他节点为所述节点中除所述第一节点以外的节点;确定所述信用值小于预设阈值的第二节点,删除所述第二节点;所述第二节点为所述其他节点的节点。The determining unit is configured to obtain the voting result of the new block, perform credit rewards and punishments on other nodes according to the voting result and the initial credit value obtained by the conversion unit, and determine the credit value of the other nodes; The other nodes are the nodes other than the first node in the nodes; determine the second node whose credit value is less than the preset threshold, delete the second node; the second node is the second node of the other nodes node.

在上述方案中,所述转换单元,还用于在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述第一节点由所述正常状态转换为所述良好状态,获得所述第一节点在所述良好状态的初始信用值;所述有效区块表征所述新的交易没有产生冲突。In the above solution, the conversion unit is further configured to convert the new block into The first node transitions from the normal state to the good state, and obtains the initial credit value of the first node in the good state; the valid block indicates that the new transaction does not cause a conflict.

在上述方案中,所述转换单元,还用于在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述第一节点由所述正常状态转换为所述异常状态且将所述第一节点由所述良好状态转换为所述异常状态,获得所述第一节点在所述异常状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In the above solution, the conversion unit is further configured to convert all the blocks in the case that the new block satisfies that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold. converting the first node from the normal state to the abnormal state and converting the first node from the good state to the abnormal state, and obtaining the initial credit value of the first node in the abnormal state; The invalid block indicates that the new transaction collided.

在上述方案中,所述转换单元,还用于在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述第一节点由所述异常状态转换为所述恶意状态,获得所述第一节点在所述恶意状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In the above solution, the conversion unit is further configured to convert the The first node is converted from the abnormal state to the malicious state, and obtains the initial credit value of the first node in the malicious state; the invalid block indicates that the new transaction conflicts.

在上述方案中,所述确定单元,还用于根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;获得所述其他节点的信用奖励值;根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值。In the above solution, the determining unit is further configured to perform credit punishment on other nodes according to the voting result and the initial credit value, and obtain the credit punishment value of the other node; obtain the credit reward value of the other node ; According to the credit penalty value and the credit reward value, determine the credit value of the other nodes.

本发明实施例提供一种电子设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述所述方法的任一步骤。An embodiment of the present invention provides an electronic device, including: a processor and a memory for storing a computer program that can be executed on the processor, wherein the processor is configured to execute the method described above when the computer program is executed. any step.

本发明实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述所述方法的任一步骤。An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements any step of the foregoing method.

本发明实施例提供的股份授权证明(DPoS)共识方法、装置、电子设备和存储介质,其中,通过获得所述区块链网络中的第一节点以及所述区块链网络中发生新的交易产生的新区块;所述第一节点为所述节点中的任一节点;在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值;所述第一状态为所述正常状态、所述良好状态、所述异常状态中的任意状态;所述第二状态为所述正常状态、所述良好状态、所述异常状态或所述恶意状态中除所述第一状态以外的任一状态;所述初始信用值表征所述第一节点在所述第二状态的信任程度;获得所述新区块的投票结果,根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值;所述其他节点为所述节点中除所述第一节点以外的节点;确定所述信用值小于预设阈值的第二节点,删除所述第二节点;所述第二节点为所述其他节点的节点,能及时有效精确的诊断出恶意节点,并剔除代理节点集中的恶意节点,避免给网络造成安全隐患。The share authorization proof (DPoS) consensus method, device, electronic device, and storage medium provided by the embodiments of the present invention, wherein, by obtaining the first node in the blockchain network and a new transaction occurs in the blockchain network The new block generated; the first node is any node in the nodes; in the case that the new block satisfies the preset condition, convert the first state of the first node to the second state, and obtain The initial credit value of the first node in the second state; the first state is any state in the normal state, the good state, and the abnormal state; the second state is the normal state any state other than the first state in the state, the good state, the abnormal state or the malicious state; the initial credit value represents the trust level of the first node in the second state; Obtain the voting result of the new block, perform credit rewards and punishments on other nodes according to the voting result and the initial credit value, and determine the credit value of the other nodes; the other nodes are the nodes except the first one. Nodes other than the node; determine the second node whose credit value is less than the preset threshold, delete the second node; the second node is the node of the other nodes, which can timely, effectively and accurately diagnose malicious nodes, and delete the second node. Eliminate malicious nodes in the set of proxy nodes to avoid potential security risks to the network.

附图说明Description of drawings

图1为本发明实施例DPoS共识方法实现流程示意图;FIG. 1 is a schematic diagram of an implementation process of a DPoS consensus method according to an embodiment of the present invention;

图2为本发明实施例DPoS共识方法中节点状态转换示意图;FIG. 2 is a schematic diagram of node state transition in a DPoS consensus method according to an embodiment of the present invention;

图3为本发明实施例DPoS共识装置的组成结构示意图;FIG. 3 is a schematic structural diagram of a DPoS consensus device according to an embodiment of the present invention;

图4为本发明实施例中电子设备的一种硬件实体结构示意图。FIG. 4 is a schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,所描述的实施例不应视为对本发明的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. All other embodiments obtained under the premise of creative work fall within the protection scope of the present invention.

在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解, “一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict.

在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本发明实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, the term "first\second\third" is only used to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that "first\second\third" Where permitted, the specific order or sequence may be interchanged to enable the embodiments of the invention described herein to be practiced in sequences other than those illustrated or described herein.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本发明实施例的目的,不是旨在限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used herein are for the purpose of describing the embodiments of the present invention only, and are not intended to limit the present invention.

对本发明实施例进行进一步详细说明之前,对本发明实施例中涉及的名词和术语进行说明,本发明实施例中涉及的名词和术语适用于如下的解释。Before further describing the embodiments of the present invention in detail, the terms and terms involved in the embodiments of the present invention are described. The terms and terms involved in the embodiments of the present invention are applicable to the following explanations.

1)签名,即数字签名,只有信息的发送者才能产生的、别人无法伪造的一段数字串,同时也是对信息的发送者发送信息真实性的有效证明;数字签名通常定义两种互补的运算,一个用于签名,另一个用于验证,是非对称密钥加密技术与数字摘要技术的应用。1) Signature, that is, digital signature, a digital string that can only be generated by the sender of the information and cannot be forged by others, and is also an effective proof of the authenticity of the information sent by the sender of the information; digital signatures usually define two complementary operations, One is used for signature and the other is used for verification, which is the application of asymmetric key encryption technology and digital digest technology.

2)响应于,用于表示所执行的操作所依赖的条件或者状态,当满足所依赖的条件或状态时,所执行的一个或多个操作可以是实时的,也可以具有设定的延迟;在没有特别说明的情况下,所执行的多个操作不存在执行先后顺序的限制。2) In response, it is used to represent the condition or state on which the executed operation depends, and when the dependent condition or state is satisfied, one or more of the executed operations may be real-time or may have a set delay; Unless otherwise specified, there is no restriction on the order of execution of multiple operations to be executed.

3)交易(Transaction),等同于计算机术语“事务”,交易包括了需要提交到区块链网络执行的操作,并非单指商业语境中的交易,鉴于在区块链技术中约定俗成地使用了“交易”这一术语,本发明实施例遵循了这一习惯。3) Transaction (Transaction), which is equivalent to the computer term "transaction". Transaction includes operations that need to be submitted to the blockchain network for execution, not just transactions in a business context. In view of the conventional use of blockchain technology The term "transaction", the embodiment of the present invention follows this convention.

例如,部署(Deploy)交易用于向区块链网络中的节点安装指定的智能合约并准备好被调用;调用(Invoke)交易用于通过调用智能合约在区块链中追加交易的记录,并对区块链的状态数据库进行操作,包括更新操作(包括增加、删除和修改状态数据库中的键值对)和查询操作(即查询状态数据库中的键值对)。For example, the Deploy transaction is used to install the specified smart contract to the nodes in the blockchain network and is ready to be invoked; the Invoke transaction is used to append the record of the transaction in the blockchain by invoking the smart contract, and Perform operations on the state database of the blockchain, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (that is, querying key-value pairs in the state database).

4)区块链(Blockchain),是由区块(Block)形成的加密的、链式的交易的存储结构。4) Blockchain is the storage structure of encrypted and chained transactions formed by blocks.

5)区块链网络(Blockchain Network),通过共识的方式将新区块纳入区块链的一系列的节点的集合。5) Blockchain Network, a collection of nodes that incorporate new blocks into the blockchain through consensus.

6)账本(Ledger),是区块链(也称为账本数据)和与区块链同步的状态数据库的统称。其中,区块链是以文件系统中的文件的形式来记录交易;状态数据库是以不同类型的键(Key)值(Value)对的形式来记录区块链中的交易,用于支持对区块链中交易的快速查询。6) Ledger is a general term for blockchain (also known as ledger data) and a state database synchronized with the blockchain. Among them, the blockchain records transactions in the form of files in the file system; the state database records transactions in the blockchain in the form of different types of key (Key) value (Value) pairs to support Quick lookup of transactions in the blockchain.

7)智能合约(Smart Contracts),也称为链码(Chaincode)或应用代码,部署在区块链网络的节点中的程序,节点执行接收的交易中所调用的智能合约,来对状态数据库的键值对数据进行更新或查询的操作。7) Smart Contracts, also known as Chaincode or application code, are programs deployed in the nodes of the blockchain network, and the nodes execute the smart contracts called in the received transactions to update the state database. Key-value operations to update or query data.

8)共识(Consensus),是区块链网络中的一个过程,用于在涉及的多个节点之间对区块中的交易达成一致,达成一致的区块将被追加到区块链的尾部,实现共识的机制包括工作量证明(PoW,Proof of Work)、权益证明(PoS,Proof of Stake)、股份授权证明(DPoS,Delegated Proof-of-Stake)、消逝时间量证明(PoET,Proof of Elapsed Time)等。8) Consensus is a process in the blockchain network, which is used to reach agreement on the transactions in the block among the multiple nodes involved, and the agreed block will be appended to the end of the blockchain , the mechanisms for achieving consensus include Proof of Work (PoW, Proof of Work), Proof of Stake (PoS, Proof of Stake), Proof of Delegated Proof-of-Stake (DPoS, Delegated Proof-of-Stake), Proof of Elapsed Time (PoET, Proof of Elapsed Time), etc.

基于上述对本发明实施例中涉及的名词和术语的解释,下面说明本实施例提出一种股份授权证明(DPoS)共识方法,应用于区块链网络中,所述区块链网络包括呈现正常状态、良好状态、异常状态或恶意状态的节点,图1为本发明实施例DPoS共识方法实现流程示意图,如图1所示,该方法包括:Based on the above explanations of the terms and terms involved in the embodiments of the present invention, the following describes a consensus method for Proof of Share Authorization (DPoS) proposed in this embodiment, which is applied to a blockchain network, where the blockchain network includes a normal state. , a node in a good state, an abnormal state, or a malicious state. Figure 1 is a schematic diagram of the implementation process of the DPoS consensus method according to an embodiment of the present invention. As shown in Figure 1, the method includes:

步骤S101:获得所述区块链网络中的第一节点以及所述区块链网络中发生新的交易产生的新区块;所述第一节点为所述节点中的任一节点。Step S101: Obtain a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any node among the nodes.

需要说明的是,所述区块链网络中节点的个数为多个,每个节点的状态都存在正常状态、良好状态、异常状态或恶意状态;所述正常状态可以表征节点的初始状态,该节点没有产生无效交易,也可以理解为该节点没有产生无效区块,信用值一般为170-190;所述正常状态可以表征节点的初始状态,该节点没有产生无效交易,也可以理解为该节点没有产生无效区块,信用值一般为170-190;所述良好状态可以表征节点产生有效交易,也可以理解为该节点有产生有效区块,信用值一般为150-170;所述异常状态可以表征节点有产生无效交易,也可以理解为该节点有产生无效区块,且无效区块的个数小于等于预设阈值,信用值一般为150-170;所述恶意状态可以表征节点有产生无效交易,也可以理解为该节点有产生无效区块,且无效区块的个数大于预设阈值,信用值一般为小于150;在实际应用中,所述正常状态可以记为NS,所述良好状态可以记为GS,所述异常状态可以记为AS,所述恶意状态可以记为ES。所述第一节点为多个节点中的任意一个。获得所述区块链网络中的第一节点可以为获得所述区块链网络中的任一节点。It should be noted that the number of nodes in the blockchain network is multiple, and the state of each node has a normal state, a good state, an abnormal state or a malicious state; the normal state can represent the initial state of the node, The node does not generate invalid transactions, and it can also be understood that the node does not generate invalid blocks, and the credit value is generally 170-190; the normal state can represent the initial state of the node, and the node does not generate invalid transactions, which can also be understood as the The node does not generate invalid blocks, and the credit value is generally 170-190; the good state can represent that the node has generated valid transactions, or it can be understood that the node has generated valid blocks, and the credit value is generally 150-170; the abnormal state It can indicate that the node has generated invalid transactions, or it can be understood that the node has generated invalid blocks, and the number of invalid blocks is less than or equal to the preset threshold, and the credit value is generally 150-170; the malicious state can indicate that the node has generated Invalid transaction, it can also be understood that the node has generated invalid blocks, and the number of invalid blocks is greater than the preset threshold, and the credit value is generally less than 150; in practical applications, the normal state can be recorded as NS, the The good state may be denoted as GS, the abnormal state may be denoted as AS, and the malicious state may be denoted as ES. The first node is any one of multiple nodes. Obtaining the first node in the blockchain network may be obtaining any node in the blockchain network.

获得所述区块链网络中发生新的交易产生的新区块可以理解为所述区块链网络中发生新的交易,全网节点竞争记账,竞争成功的节点将交易的全部信息记录在区块链网络中发生新的交易产生的新区块中。Obtaining a new block generated by a new transaction in the blockchain network can be understood as a new transaction in the blockchain network, and nodes in the entire network compete for bookkeeping, and the nodes that succeed in the competition record all the transaction information in the area. New blocks generated by new transactions in the blockchain network.

步骤S102:在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值;所述第一状态为所述正常状态、所述良好状态、所述异常状态中的任意状态;所述第二状态为所述正常状态、所述良好状态、所述异常状态或所述恶意状态中除所述第一状态以外的任一状态;所述初始信用值表征所述第一节点在所述第二状态的信任程度。Step S102: in the case that the new block satisfies the preset condition, convert the first state of the first node to the second state, and obtain the initial credit value of the first node in the second state; The first state is any of the normal state, the good state, and the abnormal state; the second state is the normal state, the good state, the abnormal state, or the malicious state Any state other than the first state; the initial credit value represents the trust level of the first node in the second state.

需要说明的是,所述预设条件表征新区块是否为有效区块,以及产生新区块的次数。在实际应用中,产生一次新区块就有一个新区块,产生多次新区块就有多个新区块,即产生新区块的次数与新区块的个数对应。作为一种示例,所述预设条件可以包括第一预设条件、第二预设条件、第三预设条件;It should be noted that the preset conditions represent whether the new block is a valid block and the number of times that the new block is generated. In practical applications, once a new block is generated, there will be one new block, and if a new block is generated multiple times, there will be multiple new blocks, that is, the number of new blocks generated corresponds to the number of new blocks. As an example, the preset condition may include a first preset condition, a second preset condition, and a third preset condition;

所述第一预设条件可以为所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值;其中,所述第一预设阈值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第一预设阈值可以为10次;对应的,在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值可以为在所述新区块满足第一预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值。具体的可以为在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述第一节点由所述正常状态转换为所述良好状态,获得所述第一节点在所述良好状态的初始信用值;也就是说,在所述新区块满足第一预设条件的情况下,可以将区块链网络中正常状态的节点转换为良好状态的节点。获得所述第一节点在所述良好状态的初始信用值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第一节点在所述良好状态的初始信用值可以为190。The first preset condition may be that the new block is a valid block, and the number of the valid blocks is greater than a first preset threshold; wherein, the first preset threshold may be determined according to the actual situation, This is not limited. As an example, the first preset threshold may be 10 times; correspondingly, in the case that the new block satisfies the preset condition, the first state of the first node is converted to the second state to obtain The initial credit value of the first node in the second state may be that when the new block satisfies the first preset condition, the first state of the first node is converted to the second state, and the obtained value is obtained. the initial credit value of the first node in the second state. Specifically, when the new block satisfies that the new block is a valid block, and the number of the valid blocks is greater than a first preset threshold, the first node is converted from the normal state For the good state, the initial credit value of the first node in the good state is obtained; that is, in the case that the new block satisfies the first preset condition, the normal state of the blockchain network can be The node is converted to a node in good state. Obtaining the initial credit value of the first node in the good state may be determined according to the actual situation, which is not limited herein. As an example, the initial credit value of the first node in the good state may be 190.

第二预设条件可以为所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值,其中,所述第二预设阈值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第二预设阈值可以为3次;对应的,在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值可以为在所述新区块满足第二预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值。具体的可以为在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述第一节点由所述正常状态转换为所述异常状态以及将所述第一节点由所述良好状态转换为所述异常状态,获得所述第一节点在所述异常状态的初始信用值;也就是说,在所述新区块满足第二预设条件的情况下,可以将区块链网络中正常状态的节点转换为异常状态的节点以及将良好状态的节点转换为异常状态的节点。获得所述第一节点在所述异常状态的初始信用值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第一节点在所述异常状态的初始信用值可以为150。The second preset condition may be that the new block is an invalid block, and the number of the invalid blocks is less than or equal to a second preset threshold, wherein the second preset threshold may be determined according to the actual situation. This is not limited. As an example, the second preset threshold may be three times; correspondingly, in the case that the new block satisfies the preset condition, the first state of the first node is converted to the second state to obtain The initial credit value of the first node in the second state may be that when the new block satisfies the second preset condition, the first state of the first node is converted to the second state, and the obtained value is obtained. the initial credit value of the first node in the second state. Specifically, when the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is less than or equal to a second preset threshold, the first node is changed from the normal state to the normal state. Converting to the abnormal state and converting the first node from the good state to the abnormal state, obtaining the initial credit value of the first node in the abnormal state; that is, in the new block Under the condition that the second preset condition is satisfied, a node in a normal state in the blockchain network can be converted into a node in an abnormal state, and a node in a good state can be converted into a node in an abnormal state. Obtaining the initial credit value of the first node in the abnormal state may be determined according to the actual situation, which is not limited herein. As an example, the initial credit value of the first node in the abnormal state may be 150.

第三预设条件可以为所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值,其中,所述第二预设阈值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第二预设阈值可以为3次;对应的,在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值可以为在所述新区块满足第三预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值。具体的可以为在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述第一节点由所述异常状态转换为所述恶意状态,获得所述第一节点在所述恶意状态的初始信用值;也就是说,在所述新区块满足第三预设条件的情况下,可以将区块链网络中异常状态的节点转换为恶意状态的节点。获得所述第一节点在所述恶意状态的初始信用值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第一节点在所述恶意状态的初始信用值可以为145。The third preset condition may be that the new block is an invalid block, and the number of the invalid blocks is greater than a second preset threshold, wherein the second preset threshold may be determined according to the actual situation, here Not limited. As an example, the second preset threshold may be three times; correspondingly, in the case that the new block satisfies the preset condition, the first state of the first node is converted to the second state to obtain The initial credit value of the first node in the second state may be that when the new block satisfies the third preset condition, the first state of the first node is converted to the second state, and the obtained value is obtained. the initial credit value of the first node in the second state. Specifically, when the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is greater than a second preset threshold, the first node is converted from the abnormal state For the malicious state, obtain the initial credit value of the first node in the malicious state; that is, in the case that the new block satisfies the third preset condition, the abnormal state in the blockchain network can be The node transitions to a malicious state node. Obtaining the initial credit value of the first node in the malicious state may be determined according to the actual situation, which is not limited herein. As an example, the initial credit value of the first node in the malicious state may be 145.

步骤S103:获得所述新区块的投票结果,根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值;所述其他节点为所述节点中除所述第一节点以外的节点。Step S103: Obtain the voting result of the new block, perform credit rewards and punishments on other nodes according to the voting result and the initial credit value, and determine the credit value of the other nodes; Nodes other than the first node described above.

这里,获得所述新区块的投票结果可以为获得对所述新区块对应的正常状态的节点、良好状态的节点、异常状态的节点的投票结果;其中,所述投票结果包括赞成票和反对票。Here, obtaining the voting result of the new block may be obtaining the voting result of the node in normal state, the node in good state, and the node in abnormal state corresponding to the new block; wherein, the voting result includes an affirmative vote and a negative vote .

根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值可以为根据所述投票结果和所述初始信用值对其他节点进行信用惩罚和信用奖励,确定所述其他节点的信用值。Perform credit reward and punishment on other nodes according to the voting result and the initial credit value, and determine the credit value of the other node may be performing credit punishment and credit reward on other nodes according to the voting result and the initial credit value, and determine the credit value of the other node.

作为一种示例,根据所述投票结果和所述初始信用值对其他节点进行信用惩罚和信用奖励,确定所述其他节点的信用值可以为根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;获得所述其他节点的信用奖励值;根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值。As an example, performing credit penalties and credit rewards on other nodes according to the voting result and the initial credit value, and determining the credit value of the other nodes may be based on the voting result and the initial credit value. Perform credit punishment to obtain the credit punishment value of the other node; obtain the credit reward value of the other node; determine the credit value of the other node according to the credit punishment value and the credit reward value.

为了方便理解,这里示例说明,所述第一节点为第i个节点,所述其他节点为第i+1个节点,所述投票结果记为

Figure 100252DEST_PATH_IMAGE001
,所述初始信用值记为
Figure 585592DEST_PATH_IMAGE002
,所述其他节点的信用惩罚值记为
Figure 752743DEST_PATH_IMAGE003
,则
Figure 665336DEST_PATH_IMAGE001
可以通过以下式(1)表示,
Figure 491340DEST_PATH_IMAGE003
可以通过以下式(2)表示:For ease of understanding, here is an example, the first node is the i-th node, the other nodes are the i+1-th node, and the voting result is recorded as
Figure 100252DEST_PATH_IMAGE001
, the initial credit value is denoted as
Figure 585592DEST_PATH_IMAGE002
, the credit penalty value of the other nodes is recorded as
Figure 752743DEST_PATH_IMAGE003
,but
Figure 665336DEST_PATH_IMAGE001
It can be represented by the following formula (1),
Figure 491340DEST_PATH_IMAGE003
It can be represented by the following formula (2):

Figure 780370DEST_PATH_IMAGE004
(1)
Figure 780370DEST_PATH_IMAGE004
(1)

Figure 539379DEST_PATH_IMAGE005
(2)
Figure 539379DEST_PATH_IMAGE005
(2)

在式(2)中,t为上次投票开始到下次投票的时间间隔; U表示信用值降低的速度,是一个常量,可以根据实际情况进行确定,在此不做限定。作为一种示例,U可以为2;T表示一个时间常量,当t<T时,即两次投票时间间隔小于T时,节点的信用值不发生变化,相反,信用值将会降低,节点投票成功后会重置时间t,即令t=0,以鼓励节点参与投票;

Figure 903100DEST_PATH_IMAGE001
表示在投票过程中对有恶意投票行为节点的一种惩罚。In Equation (2), t is the time interval from the start of the last vote to the next vote; U represents the speed at which the credit value decreases, which is a constant and can be determined according to the actual situation, which is not limited here. As an example, U can be 2; T represents a time constant, when t < T, that is, when the time interval between two votings is less than T, the node's credit value does not change, on the contrary, the credit value will decrease, and the node votes After success, the time t will be reset, that is, t=0, to encourage nodes to participate in voting;
Figure 903100DEST_PATH_IMAGE001
Indicates a punishment for nodes with malicious voting behavior during the voting process.

所述其他节点的信用奖励可以记为

Figure 747559DEST_PATH_IMAGE006
,则
Figure 574701DEST_PATH_IMAGE006
可以通过以下式(3)表示:The credit rewards of the other nodes can be recorded as
Figure 747559DEST_PATH_IMAGE006
,but
Figure 574701DEST_PATH_IMAGE006
It can be represented by the following formula (3):

Figure 719375DEST_PATH_IMAGE007
(3)
Figure 719375DEST_PATH_IMAGE007
(3)

式(3)中,

Figure 973770DEST_PATH_IMAGE008
为第i个节点的信用奖励,可以根据实际情况进行确定,在此不做限定。作为一种示例,
Figure 302595DEST_PATH_IMAGE008
可以为0。In formula (3),
Figure 973770DEST_PATH_IMAGE008
is the credit reward of the i-th node, which can be determined according to the actual situation, and is not limited here. As an example,
Figure 302595DEST_PATH_IMAGE008
Can be 0.

根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值可以为将所述信用惩罚值和所述信用奖励值进行预设运算,确定所述其他节点的信用值。其中,所述预设运算可以根据实际情况进行确定,在此不做限定。作为一种示例,所述预设运算可以为加法运算。为了方便理解,这里示例说明,假设所述其他节点的信用值记为

Figure 667849DEST_PATH_IMAGE009
,所述信用惩罚值记为
Figure 135870DEST_PATH_IMAGE003
,所述信用奖励值记为
Figure 561166DEST_PATH_IMAGE006
,则
Figure 645797DEST_PATH_IMAGE009
可以通过以下式(4)表示:According to the credit penalty value and the credit reward value, determining the credit value of the other node may be performing a preset operation on the credit penalty value and the credit reward value to determine the credit value of the other node. Wherein, the preset operation may be determined according to the actual situation, which is not limited herein. As an example, the preset operation may be an addition operation. For the convenience of understanding, here is an example, assuming that the credit value of the other node is recorded as
Figure 667849DEST_PATH_IMAGE009
, the credit penalty value is recorded as
Figure 135870DEST_PATH_IMAGE003
, the credit reward value is recorded as
Figure 561166DEST_PATH_IMAGE006
,but
Figure 645797DEST_PATH_IMAGE009
It can be represented by the following formula (4):

Figure 80321DEST_PATH_IMAGE010
(4)
Figure 80321DEST_PATH_IMAGE010
(4)

步骤S104:确定所述信用值小于预设阈值的第二节点,删除所述第二节点;所述第二节点为所述其他节点的节点。Step S104: Determine a second node whose credit value is less than a preset threshold, and delete the second node; the second node is a node of the other nodes.

这里,所述预设阈值根据实际情况进行确定,在此不做限定。所述预设阈值可以为恶意状态的节点对应的信用值。为了方便理解,这里示例说明,假设恶意状态的节点对应的信用值为低于150,即恶意状态的节点对应的信用值小于150,则所述预设阈值可以为150。Here, the preset threshold is determined according to the actual situation, which is not limited here. The preset threshold may be a credit value corresponding to a node in a malicious state. For ease of understanding, here is an example, assuming that the credit value corresponding to the node in the malicious state is lower than 150, that is, the credit value corresponding to the node in the malicious state is less than 150, the preset threshold may be 150.

确定所述信用值小于预设阈值的第二节点,删除所述第二节点可以理解为根据所述其他节点的信用值选出所述信用值小于预设阈值对应的节点,作为第二节点,删除所述第二节点;其中,所述第二节点可以理解为恶意状态的节点。Determining the second node whose credit value is less than the preset threshold value, and deleting the second node can be understood as selecting the node corresponding to the credit value less than the preset threshold value according to the credit value of the other nodes as the second node, Delete the second node; wherein, the second node can be understood as a node in a malicious state.

本发明实施例提供的DPoS共识方法,通过获得所述区块链网络中的第一节点以及所述区块链网络中发生新的交易产生的新区块;所述第一节点为所述节点中的任一节点;在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值;所述第一状态为所述正常状态、所述良好状态、所述异常状态中的任意状态;所述第二状态为所述正常状态、所述良好状态、所述异常状态或所述恶意状态中除所述第一状态以外的任一状态;所述初始信用值表征所述第一节点在所述第二状态的信任程度;获得所述新区块的投票结果,根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值;所述其他节点为所述节点中除所述第一节点以外的节点;确定所述信用值小于预设阈值的第二节点,删除所述第二节点;所述第二节点为所述其他节点的节点,能及时有效精确的诊断出恶意节点,并剔除代理节点集中的恶意节点,避免给网络造成安全隐患。The DPoS consensus method provided by the embodiment of the present invention obtains a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is one of the nodes in the blockchain network. If the new block satisfies the preset condition, convert the first state of the first node to the second state, and obtain the initial credit value of the first node in the second state ; the first state is any of the normal state, the good state, the abnormal state; the second state is the normal state, the good state, the abnormal state or the malicious state any state in the state except the first state; the initial credit value represents the trust degree of the first node in the second state; obtain the voting result of the new block, according to the voting result and The initial credit value is used to reward and punish other nodes, and the credit values of the other nodes are determined; the other nodes are nodes other than the first node in the nodes; The second node is to delete the second node; the second node is a node of the other nodes, which can diagnose malicious nodes effectively and accurately in a timely manner, and eliminate malicious nodes in the set of proxy nodes, so as to avoid potential security risks to the network.

在本发明的一种可选实施例中,所述在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值,包括:在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述第一节点由所述正常状态转换为所述良好状态,获得所述第一节点在所述良好状态的初始信用值;所述有效区块表征所述新的交易没有产生冲突。In an optional embodiment of the present invention, when the new block satisfies a preset condition, the first state of the first node is converted to the second state, and the first node is obtained in The initial credit value of the second state includes: in the case that the new block satisfies that the new block is a valid block, and the number of the valid blocks is greater than the first preset threshold A node transitions from the normal state to the good state, and obtains the initial credit value of the first node in the good state; the valid block indicates that the new transaction does not conflict.

需要说明的是,所述有效区块可以理解为交易没有冲突,即交易成功,记录数据。It should be noted that, the valid block can be understood as that there is no conflict in the transaction, that is, the transaction is successful and data is recorded.

所述第一预设阈值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第一预设阈值可以为10次;The first preset threshold may be determined according to the actual situation, which is not limited herein. As an example, the first preset threshold may be 10 times;

在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述第一节点由所述正常状态转换为所述良好状态,获得所述第一节点在所述良好状态的初始信用值可以理解为在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述区块链网络中正常状态的节点均转换为良好状态的节点,获得所述区块链网络中良好状态的节点的初始信用值。所述良好状态的节点的初始信用值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述良好状态的节点的初始信用值可以为190。In the case that the new block satisfies that the new block is a valid block, and the number of valid blocks is greater than a first preset threshold, the first node is converted from the normal state to the good state state, obtaining the initial credit value of the first node in the good state can be understood as satisfying that the new block is a valid block in the new block, and the number of valid blocks is greater than the first preset threshold In the case of , the nodes in the normal state in the blockchain network are all converted into nodes in the good state, and the initial credit value of the nodes in the good state in the blockchain network is obtained. The initial credit value of the node in the good state can be determined according to the actual situation, which is not limited here. As an example, the initial credit value of the node in good state may be 190.

在实际应用中,产生一次新区块就有一个新区块,产生多次新区块就有多个新区块,即产生新区块的次数与新区块的个数对应。In practical applications, once a new block is generated, there will be one new block, and if a new block is generated multiple times, there will be multiple new blocks, that is, the number of new blocks generated corresponds to the number of new blocks.

在本发明的一种可选实施例中,所述在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值,包括:在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述第一节点由所述正常状态转换为所述异常状态且将所述第一节点由所述良好状态转换为所述异常状态,获得所述第一节点在所述异常状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In an optional embodiment of the present invention, when the new block satisfies a preset condition, the first state of the first node is converted to the second state, and the first node is obtained in The initial credit value of the second state includes: when the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is less than or equal to a second preset threshold, changing the The first node is converted from the normal state to the abnormal state and the first node is converted from the good state to the abnormal state, and the initial credit value of the first node in the abnormal state is obtained; The invalid block indicates that the new transaction collided.

需要说明的是,所述无效区块可以理解为交易冲突了。所述第二预设阈值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第二预设阈值可以为3次。It should be noted that the invalid block can be understood as a transaction conflict. The second preset threshold may be determined according to the actual situation, which is not limited herein. As an example, the second preset threshold may be three times.

在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述第一节点由所述正常状态转换为所述异常状态且将所述第一节点由所述良好状态转换为所述异常状态,获得所述第一节点在所述异常状态的初始信用值可以理解为在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述区块链网络中正常状态的节点均转换为异常状态的节点且将所述区块链网络中良好状态的节点均转换为异常状态的节点,获得所述区块链网络中异常状态的节点的初始信用值。所述异常状态的节点的初始信用值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述异常状态的节点的初始信用值可以为150。When the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is less than or equal to a second preset threshold, the first node is converted from the normal state to the Abnormal state and the first node is converted from the good state to the abnormal state, and obtaining the initial credit value of the first node in the abnormal state can be understood as satisfying the new block in the new block as Invalid blocks, and if the number of invalid blocks is less than or equal to the second preset threshold, convert the normal state nodes in the blockchain network into abnormal state nodes and convert the blockchain network The nodes in the good state in the network are all converted into nodes in the abnormal state, and the initial credit value of the node in the abnormal state in the blockchain network is obtained. The initial credit value of the node in the abnormal state can be determined according to the actual situation, which is not limited here. As an example, the initial credit value of the node in the abnormal state may be 150.

在实际应用中,产生一次新区块就有一个新区块,产生多次新区块就有多个新区块,即产生新区块的次数与新区块的个数对应。In practical applications, once a new block is generated, there will be one new block, and if a new block is generated multiple times, there will be multiple new blocks, that is, the number of new blocks generated corresponds to the number of new blocks.

在本发明的一种可选实施例中,所述在所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值,包括:在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述第一节点由所述异常状态转换为所述恶意状态,获得所述第一节点在所述恶意状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In an optional embodiment of the present invention, when the new block satisfies a preset condition, the first state of the first node is converted to the second state, and the first node is obtained in The initial credit value of the second state includes: in the case that the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is greater than a second preset threshold, assigning the first A node is converted from the abnormal state to the malicious state, and obtains the initial credit value of the first node in the malicious state; the invalid block indicates that the new transaction conflicts.

需要说明的是,所述无效区块表征所述新的交易产生冲突,即所述无效区块可以理解为新的交易冲突了。所述第二预设阈值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述第二预设阈值可以为3次。It should be noted that the invalid block indicates that the new transaction conflicts, that is, the invalid block can be understood as a new transaction conflict. The second preset threshold may be determined according to the actual situation, which is not limited herein. As an example, the second preset threshold may be three times.

在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述第一节点由所述异常状态转换为所述恶意状态,获得所述第一节点在所述恶意状态的初始信用值可以理解为在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述区块链网络中异常状态的节点均转换为恶意状态的节点,获得所述区块链网络中恶意状态的节点的初始信用值。所述恶意状态的节点的初始信用值可以根据实际情况进行确定,在此不做限定。作为一种示例,所述恶意状态的节点的初始信用值可以为145。In the case that the new block satisfies that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold, the first node is converted from the abnormal state to the malicious state state, obtaining the initial credit value of the first node in the malicious state can be understood as satisfying that the new block is an invalid block in the new block, and the number of the invalid blocks is greater than the second preset threshold In the case of the abnormal state in the blockchain network, all nodes in the abnormal state are converted into nodes in the malicious state, and the initial credit value of the node in the malicious state in the blockchain network is obtained. The initial credit value of the node in the malicious state can be determined according to the actual situation, which is not limited here. As an example, the initial credit value of the node in the malicious state may be 145.

在实际应用中,产生一次新区块就有一个新区块,产生多次新区块就有多个新区块,即产生新区块的次数与新区块的个数对应。In practical applications, once a new block is generated, there will be one new block, and if a new block is generated multiple times, there will be multiple new blocks, that is, the number of new blocks generated corresponds to the number of new blocks.

在本发明的一种可选实施例中,根据所述投票结果和所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值,包括:根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;获得所述其他节点的信用奖励值;根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值。In an optional embodiment of the present invention, performing credit rewards and punishments on other nodes according to the voting result and the initial credit value, and determining the credit value of the other nodes includes: according to the voting result and the initial credit value The credit value performs credit punishment on other nodes, and obtains the credit punishment value of the other nodes; obtains the credit reward value of the other nodes; determines the credit value of the other nodes according to the credit punishment value and the credit reward value. .

本发明实施例中,根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值可以为根据所述投票结果和所述初始信用值通过第一预设公式对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;其中,所述第一预设公式可以根据实际情况进行确定,在此不做限定。所述第一预设公式表征是否对正常状态的节点或良好状态的节点投反对票的情况进行信用惩罚,作为一种示例,所述预设公式可以参照上述公式(1)和公式(2)。In this embodiment of the present invention, other nodes are subjected to credit punishment according to the voting result and the initial credit value, and obtaining the credit punishment value of the other nodes may be based on the voting result and the initial credit value through a first A formula is set to perform credit penalty on other nodes, and the credit penalty value of the other nodes is obtained; wherein, the first preset formula can be determined according to the actual situation, which is not limited here. The first preset formula represents whether to impose a credit penalty on a node in a normal state or a node in a good state to cast a negative vote. As an example, the preset formula can refer to the above formula (1) and formula (2) .

获得所述其他节点的信用奖励值可以为基于第二预设公式获得所述其他节点的信用奖励值;其中,所述第二预设公式可以根据实际情况进行确定,在此不做限定。所述第二预设公式表征是否对异常状态的节点投反对票的情况进行信用奖励,作为一种示例,第二预设公式可以参照上述公式(3)。Obtaining the credit reward value of the other node may be obtaining the credit reward value of the other node based on a second preset formula; wherein, the second preset formula may be determined according to the actual situation, which is not limited herein. The second preset formula represents whether to perform a credit reward for a situation where a node in an abnormal state casts a negative vote. As an example, the second preset formula can refer to the above formula (3).

根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值可以为将所述信用惩罚值和所述信用奖励值按第三预设公式,确定所述其他节点的信用值;其中,所述第三预设公式可以根据实际情况进行确定,在此不做限定。所述第三预设公式表征此刻所述其他节点的信用值,作为一种示例,第三预设公式可以参照上述公式(4)。Determining the credit value of the other node according to the credit penalty value and the credit reward value may be determining the credit value of the other node by using the credit penalty value and the credit reward value according to a third preset formula ; wherein, the third preset formula can be determined according to the actual situation, which is not limited here. The third preset formula represents the credit value of the other node at the moment. As an example, the third preset formula can refer to the above formula (4).

本发明实施例提供的DPoS共识方法,通过根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;获得所述其他节点的信用奖励值;根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值,以解决区块链DPoS共识方法中恶意节点占领账权产生的安全隐患,以及散户节点投票积极性不高的问题。In the DPoS consensus method provided by the embodiment of the present invention, by performing credit punishment on other nodes according to the voting result and the initial credit value, the credit punishment value of the other node is obtained; the credit reward value of the other node is obtained; according to The credit penalty value and the credit reward value are used to determine the credit values of the other nodes, so as to solve the security risks caused by malicious nodes occupying account rights in the blockchain DPoS consensus method, as well as the low voting enthusiasm of retail nodes.

为了方便理解,这里示例出一种实际应用场景,在实际应用中,一种DPoS共识方法可以为一种基于信用奖惩的DPoS共识算法,为了精确的诊断并剔除代理节点集中的恶意节点,细化节点状态,在正常状态和异常状态之外,引入良好状态和恶意状态。同时,为了加强恶意节点剔除的及时性,节点投票过程中除了支持票以外,还可以基于投票节点自身判断投反对票,利用投票行为影响节点状态变更,以准确及时的剔除恶意代理节点。In order to facilitate understanding, a practical application scenario is illustrated here. In practical applications, a DPoS consensus method can be a DPoS consensus algorithm based on credit rewards and punishments. In order to accurately diagnose and eliminate malicious nodes in the proxy node set, refine The node state, in addition to the normal state and abnormal state, introduces a good state and a malicious state. At the same time, in order to enhance the timeliness of malicious node removal, in addition to supporting votes, nodes can also vote against votes based on their own judgments in the voting process, and use voting behavior to affect node status changes, so as to accurately and timely remove malicious proxy nodes.

第一步,定义节点的四种状态。The first step is to define the four states of the node.

每个节点均具备四种状态,该四种状态分别如下:正常状态,可以记为NS ,可以理解为所有节点的初始状态,同时,也可以理解为表示代理节点没有生产无效区块,且信用值的范围为170-190;良好状态,可以记为GS,可以理解为代理节点持续产生有效区块且超过累计次数阈值,且信用值的范围为190-200;异常状态,可以记为AS,可以理解为代理节点产生无效区块但未超过累计值,且信用值的范围为150-170;恶意状态,可以记为ES,可以理解为代理节点多次生产无效区块,且信用值的范围为低于150。Each node has four states, and the four states are as follows: normal state, which can be recorded as NS, which can be understood as the initial state of all nodes. At the same time, it can also be understood as indicating that the proxy node does not produce invalid blocks, and the credit The value range is 170-190; the good state can be recorded as GS, which can be understood as the proxy node continues to generate valid blocks and exceeds the cumulative number of times threshold, and the credit value range is 190-200; abnormal state can be recorded as AS, It can be understood that the proxy node generates invalid blocks but does not exceed the accumulated value, and the range of credit value is 150-170; the malicious state can be recorded as ES, which can be understood as the proxy node produces invalid blocks many times, and the range of credit value for less than 150.

第二步,节点状态转换,细化节点状态之后,将每个节点根据给定的预设条件判断节点行为并进行状态转换。所述预设条件至少包括第一预设条件、第二预设条件、第三预设条件。The second step is node state transition. After refining the node state, each node judges the node behavior according to a given preset condition and performs state transition. The preset conditions include at least a first preset condition, a second preset condition, and a third preset condition.

节点状态转换根据状态转换条件进行:Node state transitions are performed according to state transition conditions:

第一预设条件:连续产生多次有效区块,且有效区块的个数超过累计值N1。The first preset condition: multiple valid blocks are continuously generated, and the number of valid blocks exceeds the accumulated value N1.

第二预设条件:产生无效区块,且所述无效区块的个数小于等于累计值N2。The second preset condition: invalid blocks are generated, and the number of the invalid blocks is less than or equal to the accumulated value N2.

第三预设条件:多次产生无效区块,且所述无效区块的个数大于累计值N2。The third preset condition: invalid blocks are generated multiple times, and the number of the invalid blocks is greater than the accumulated value N2.

N1和 N2根据实际情况进行确定,在此不做限定。因此,正常状态节点在第一预设条件成立时,转换为良好状态节点;正常状态节点和良好状态节点在条件第二预设条件成立时,转换为异常状态节点;异常状态节点在第三预设条件成立时,转换为恶意状态节点;异常状态节点将在一段时间内不允许参与投票和代理节点选举。N1 and N2 are determined according to the actual situation, and are not limited here. Therefore, the normal state node is converted to a good state node when the first preset condition is satisfied; the normal state node and the good state node are converted to an abnormal state node when the second preset condition is satisfied; the abnormal state node is in the third preset state. When the conditions are established, it will be converted into a malicious state node; abnormal state nodes will not be allowed to participate in voting and proxy node elections for a period of time.

为了方便理解,这里示例出本发明实施例DPoS共识方法中节点状态转换示意图,图2为本发明实施例DPoS共识方法中节点状态转换示意图,如图2所示,所述正常状态可以记为NS,所述良好状态可以记为GS,所述异常状态可以记为AS,所述恶意状态可以记为ES。所述正常状态的节点在第一预设条件成立的情况下,由正常状态的节点转换为良好状态的节点;所述正常状态的节点在第二预设条件成立的情况下,由正常状态的节点转换为异常状态的节点,以及所述良好状态的节点在第二预设条件成立的情况下,由良好状态的节点转换为异常状态的节点;所述异常状态的节点在第三预设条件成立的情况下,由良好状态的节点转换为异常状态的节点。For ease of understanding, a schematic diagram of node state transition in the DPoS consensus method according to an embodiment of the present invention is illustrated here. FIG. 2 is a schematic diagram of node state transition in the DPoS consensus method according to an embodiment of the present invention. As shown in FIG. 2 , the normal state may be denoted as NS , the good state may be denoted as GS, the abnormal state may be denoted as AS, and the malicious state may be denoted as ES. The node in the normal state is converted from the node in the normal state to the node in the good state when the first preset condition is satisfied; the node in the normal state is converted from the node in the normal state when the second preset condition is satisfied. The node is converted into a node in an abnormal state, and the node in a good state is converted from a node in a good state to a node in an abnormal state when the second preset condition is satisfied; the node in the abnormal state is in a third preset condition. When established, the node in a good state is converted to a node in an abnormal state.

第三步,信用奖惩模型:基于信用奖惩的投票过程涉及3个基本因素:反对票、信用惩罚和信用奖励。The third step, credit reward and punishment model: The voting process based on credit reward and punishment involves three basic factors: negative votes, credit penalties and credit rewards.

信用值初始化:获得每个节点的信用初始值。Credit value initialization: Get the credit initial value of each node.

信用惩罚:每个节点的信用值会根据其投票而进行相应的计算。Credit penalty: The credit value of each node will be calculated according to its vote.

根据第i个节点的信用值进行惩罚计算出第i+1个节点的信用惩罚值,该过程可以参照上述公式(1)和公式(2)。The credit penalty value of the i+1th node is calculated according to the credit value of the i-th node, and the process can refer to the above formula (1) and formula (2).

信用奖励:为了提高信用奖励的准确度,在每一轮投票结果后判断被投反对票的AS节点是否成为代理节点,如果未成为,则给该AS投反对票的节点获得信用奖励,反之,则信用值不变,尽快地将AS节点从代理节点集中剔除。Credit reward: In order to improve the accuracy of the credit reward, after each round of voting results, it is determined whether the AS node that has been voted against has become a proxy node. If not, the node that voted against the AS will receive a credit reward. Then the credit value remains unchanged, and the AS node is removed from the set of proxy nodes as soon as possible.

根据第i个节点的投票计算出第i+1节点的信用奖励值,该过程可以参照上述公式(3)。The credit reward value of the i+1th node is calculated according to the vote of the ith node, and the process can refer to the above formula (3).

对每个节点的信用惩罚和信用奖励进行相加,综合为此刻第i+1节点的信用值,该过程可以参照上述公式(4)。The credit penalty and credit reward of each node are added together to form the credit value of the i+1th node at this moment. This process can refer to the above formula (4).

然后,对代理节点的信用值进行判断,将信用值低于150恶意状态的节点剔除掉。Then, the credit value of the proxy node is judged, and the nodes whose credit value is lower than 150 malicious state are eliminated.

第四步,代理节点选举产生。In the fourth step, the proxy node is elected.

对具有被选举权的节点进行投票,并算出各个节点的信用值,最终信用值最多的前N个节点被选出来,成为代理节点,代理节点集的更换需定期的进行投票选举以及节点信用值的更新。The nodes with the right to be elected are voted, and the credit value of each node is calculated. Finally, the top N nodes with the most credit values are selected and become proxy nodes. The replacement of the proxy node set requires regular voting and node credit value. renew.

第五步,代理节点生产区块。In the fifth step, the proxy node produces blocks.

生成区块中所有交易数据的Merkle树,将其放入区块主体中,同时在区块头中保存Merkle树的根值,采用SHA256算法计算上一区块区块头数据的哈希值,即为新区块的父哈希值,把当前时间保存在时间戳字段中,将区块广播给全网的代理节点集。Generate a Merkle tree of all transaction data in the block, put it into the block body, save the root value of the Merkle tree in the block header, and use the SHA256 algorithm to calculate the hash value of the block header data of the previous block, which is The parent hash value of the new block, saves the current time in the timestamp field, and broadcasts the block to the set of proxy nodes in the entire network.

第六步,验证。The sixth step is to verify.

代理节点集收到广播的新区块后,对区块中的数据和区块信息进行验证,重点验证区块头中的属性:包括序号、时间戳、Merkle根值、上一个区块哈希值和新区块哈希值。主要验证收到的区块中的具体内容是否有效,具体判断依据为区块中的数据得到全网三分之二的代理节点认可。全部验证通过后,区块被判定为有效。After the agent node set receives the broadcasted new block, it verifies the data and block information in the block, focusing on verifying the attributes in the block header: including serial number, timestamp, Merkle root value, last block hash value and The new block hash. It mainly verifies whether the specific content in the received block is valid, and the specific judgment is based on the fact that the data in the block is recognized by two-thirds of the proxy nodes in the entire network. After all verifications are passed, the block is judged to be valid.

第七步,上链。The seventh step is to wind the chain.

代理节点将通过验证的区块添加到区块链上,形成一条到最新区块的电子证书信息数据链条。当主链存在多个分叉链时,根据共识算法的判别标准,挑选合适的一条作为主链。The proxy node adds the verified block to the blockchain to form an electronic certificate information data chain to the latest block. When there are multiple forked chains in the main chain, the appropriate one is selected as the main chain according to the criteria of the consensus algorithm.

本发明实施例提供的股份授权证明DPoS共识方法,以解决区块链DPoS共识方法中恶意节点占领账权产生的安全隐患,以及散户节点投票积极性不高的问题。The share authorization proof DPoS consensus method provided by the embodiment of the present invention solves the security risks caused by malicious nodes occupying account rights in the blockchain DPoS consensus method, and the problem of low voting enthusiasm of retail nodes.

本实施例提出一种股份授权证明DPoS共识装置,应用于区块链网络中,所述区块链网络包括呈现正常状态、良好状态、异常状态或恶意状态的节点,图3为本发明实施例DPoS共识装置的组成结构示意图,如图3所示,所述装置200包括:获得单元201、转换单元202和确定单元203,其中:This embodiment proposes a DPoS consensus device for certificate of share authorization, which is applied to a blockchain network, where the blockchain network includes nodes in a normal state, a good state, an abnormal state or a malicious state. FIG. 3 is an embodiment of the present invention. A schematic diagram of the composition and structure of the DPoS consensus device, as shown in FIG. 3 , the device 200 includes: an obtaining unit 201, a converting unit 202 and a determining unit 203, wherein:

所述获得单元201,用于获得所述区块链网络中的第一节点以及所述区块链网络中发生新的交易产生的新区块;所述第一节点为所述节点中的任一节点;The obtaining unit 201 is configured to obtain a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any one of the nodes node;

所述转换单元202,用于在所述获得单元获得的所述新区块满足预设条件的情况下,将所述第一节点的第一状态转换为第二状态,获得所述第一节点在所述第二状态的初始信用值;所述第一状态为所述正常状态、所述良好状态、所述异常状态中的任意状态;所述第二状态为所述正常状态、所述良好状态、所述异常状态或所述恶意状态中除所述第一状态以外的任一状态;所述初始信用值表征所述第一节点在所述第二状态的信任程度;The conversion unit 202 is configured to convert the first state of the first node to a second state when the new block obtained by the obtaining unit satisfies a preset condition, and obtain the first node in The initial credit value of the second state; the first state is any of the normal state, the good state, and the abnormal state; the second state is the normal state and the good state , any state other than the first state in the abnormal state or the malicious state; the initial credit value represents the trust level of the first node in the second state;

所述确定单元203,用于获得所述新区块的投票结果,根据所述投票结果和所述转换单元获得的所述初始信用值对其他节点进行信用奖惩,确定所述其他节点的信用值;所述其他节点为所述节点中除所述第一节点以外的节点;确定所述信用值小于预设阈值的第二节点,删除所述第二节点;所述第二节点为所述其他节点的节点。The determining unit 203 is configured to obtain the voting result of the new block, perform credit rewards and punishments on other nodes according to the voting result and the initial credit value obtained by the conversion unit, and determine the credit value of the other nodes; The other node is a node other than the first node among the nodes; the second node whose credit value is less than a preset threshold is determined, and the second node is deleted; the second node is the other node node.

在其他的实施例中,所述转换单元202,还用于在所述新区块满足所述新区块为有效区块,且所述有效区块的个数大于第一预设阈值的情况下,将所述第一节点由所述正常状态转换为所述良好状态,获得所述第一节点在所述良好状态的初始信用值;所述有效区块表征所述新的交易没有产生冲突。In other embodiments, the conversion unit 202 is further configured to: when the new block satisfies that the new block is a valid block and the number of the valid blocks is greater than a first preset threshold, The first node is converted from the normal state to the good state, and the initial credit value of the first node in the good state is obtained; the valid block indicates that the new transaction has no conflict.

在其他的实施例中,所述转换单元202,还用于在所述新区块满足所述新区块为无效区块,且所述无效区块的个数小于等于第二预设阈值的情况下,将所述第一节点由所述正常状态转换为所述异常状态且将所述第一节点由所述良好状态转换为所述异常状态,获得所述第一节点在所述异常状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In other embodiments, the conversion unit 202 is further configured to satisfy the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold , converting the first node from the normal state to the abnormal state and converting the first node from the good state to the abnormal state to obtain the initial state of the first node in the abnormal state Credit value; the invalid block indicates that the new transaction collided.

在其他的实施例中,所述转换单元202,还用于在所述新区块满足所述新区块为无效区块,且所述无效区块的个数大于第二预设阈值的情况下,将所述第一节点由所述异常状态转换为所述恶意状态,获得所述第一节点在所述恶意状态的初始信用值;所述无效区块表征所述新的交易产生冲突。In other embodiments, the conversion unit 202 is further configured to: when the new block satisfies that the new block is an invalid block, and the number of the invalid blocks is greater than a second preset threshold, The first node is converted from the abnormal state to the malicious state, and the initial credit value of the first node in the malicious state is obtained; the invalid block indicates that the new transaction conflicts.

在其他的实施例中,所述确定单元203,还用于根据所述投票结果和所述初始信用值对其他节点进行信用惩罚,获得所述其他节点的信用惩罚值;获得所述其他节点的信用奖励值;根据所述信用惩罚值和所述信用奖励值,确定所述其他节点的信用值。In other embodiments, the determining unit 203 is further configured to perform a credit penalty on other nodes according to the voting result and the initial credit value, and obtain the credit penalty value of the other node; obtain the credit penalty value of the other node; Credit reward value; according to the credit penalty value and the credit reward value, determine the credit value of the other nodes.

以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本发明装置实施例中未披露的技术细节,请参照本发明方法实施例的描述而理解。The descriptions of the above apparatus embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the apparatus embodiments of the present invention, please refer to the description of the method embodiments of the present invention to understand.

需要说明的是,本发明实施例中,如果以软件功能模块的形式实现上述的股份授权证明DPoS共识方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术实施例本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台控制服务器(可以是个人计算机、服务器、或者网络服务器等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。It should be noted that, in the embodiment of the present invention, if the above-mentioned DPoS consensus method for share authorization certificate is implemented in the form of a software functional module, and sold or used as an independent product, it can also be stored in a computer-readable storage medium. . Based on this understanding, the technical embodiments of the embodiments of the present invention essentially or the parts that make contributions to the prior art may be embodied in the form of software products, and the computer software products are stored in a storage medium, including a number of instructions for So that a control server (which may be a personal computer, a server, or a network server, etc.) executes all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: a U disk, a removable hard disk, a read only memory (Read Only Memory, ROM), a magnetic disk, or an optical disk and other mediums that can store program codes. As such, embodiments of the present invention are not limited to any particular combination of hardware and software.

对应地,本发明实施例提供一种电子设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述实施例提供的股份授权证明DPoS共识方法中的步骤。Correspondingly, an embodiment of the present invention provides an electronic device, including: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is configured to execute the above implementation when running the computer program The steps in the DPoS consensus method provided by the example of the Proof of Stake Delegation.

对应地,本发明实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例提供的股份授权证明DPoS共识方法中的步骤。Correspondingly, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in the DPoS consensus method provided by the above-mentioned embodiment.

这里需要指出的是:以上存储介质和服务器实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本发明存储介质和服务器实施例中未披露的技术细节,请参照本发明方法实施例的描述而理解。It should be pointed out here that the descriptions of the above embodiments of the storage medium and the server are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the embodiments of the storage medium and server of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

需要说明的是,图4为本发明实施例中电子设备的一种硬件实体结构示意图,如图4所示,该电子设备300的硬件实体包括:处理器301和存储器303,可选地,所述电子设备300还可以包括通信接口302。It should be noted that FIG. 4 is a schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present invention. As shown in FIG. 4 , the hardware entity of the electronic device 300 includes: a processor 301 and a memory 303 . The electronic device 300 may also include a communication interface 302 .

可以理解,存储器303可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器303旨在包括但不限于这些和任意其它适合类型的存储器。It is understood that the memory 303 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory may be Read Only Memory (ROM, Read Only Memory), Programmable Read Only Memory (PROM, Programmable Read-Only Memory), Erasable Programmable Read-Only Memory (EPROM, Erasable Programmable Read-Only Memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD-ROM, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface memory can be disk memory or tape memory. Volatile memory may be random access memory (RAM, Random Access Memory), which acts as an external cache memory. By way of illustration, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, SynchronousDynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory) . The memory 303 described in the embodiments of the present invention is intended to include, but not limited to, these and any other suitable types of memory.

上述本发明实施例揭示的方法可以应用于处理器301中,或者由处理器301实现。处理器301可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器301中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器301可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器301可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器303,处理器301读取存储器303中的信息,结合其硬件完成前述方法的步骤。The methods disclosed in the above embodiments of the present invention may be applied to the processor 301 or implemented by the processor 301 . The processor 301 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor 301 or an instruction in the form of software. The above-mentioned processor 301 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The processor 301 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, and the storage medium is located in the memory 303, and the processor 301 reads the information in the memory 303, and completes the steps of the foregoing method in combination with its hardware.

在示例性实施例中,电子设备可以被一个或多个应用专用集成电路(ASIC,Application Specific Integrated Circuit)、DSP、可编程逻辑器件(PLD,ProgrammableLogic Device)、复杂可编程逻辑器件(CPLD,Complex Programmable Logic Device)、现场可编程门阵列(FPGA,Field-Programmable Gate Array)、通用处理器、控制器、微控制器(MCU,Micro Controller Unit)、微处理器(Microprocessor)、或其他电子元件实现,用于执行前述方法。In an exemplary embodiment, the electronic device may be implemented by one or more of Application Specific Integrated Circuit (ASIC, Application Specific Integrated Circuit), DSP, Programmable Logic Device (PLD, Programmable Logic Device), Complex Programmable Logic Device (CPLD, Complex) Programmable Logic Device), Field-Programmable Gate Array (FPGA, Field-Programmable Gate Array), general-purpose processor, controller, microcontroller (MCU, Micro Controller Unit), microprocessor (Microprocessor), or other electronic components to achieve , used to perform the aforementioned method.

在本发明所提供的几个实施例中,应该理解到,所揭露的方法和装置,可以通过其他的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个观测量,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其他形式的。In the several embodiments provided by the present invention, it should be understood that the disclosed method and apparatus may be implemented in other manners. The apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or Can be integrated into another observable, or some features can be ignored, or not enforced. In addition, the communication connection between the components shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, and may be electrical, mechanical or other forms.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, the execution includes: The steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk and other media that can store program codes.

或者,本发明实施例上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术实施例本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units in the embodiments of the present invention are implemented in the form of software functional units and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on this understanding, the technical embodiments of the embodiments of the present invention essentially or the parts that make contributions to the prior art may be embodied in the form of software products, and the computer software products are stored in a storage medium, including a number of instructions for So that an electronic device (which may be a personal computer, a server, or a network device, etc.) executes all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.

本发明是实例中记载的股份授权证明DPoS共识方法、电子设备、电子设备和存储介质只以本发明所述实施例为例,但不仅限于此,只要涉及到该股份授权证明DPoS共识方法、电子设备、电子设备和存储介质均在本发明的保护范围。The present invention is the share authorization certificate DPoS consensus method, electronic equipment, electronic equipment and storage medium recorded in the example, only the embodiment of the present invention is used as an example, but it is not limited to this, as long as the share authorization certificate DPoS consensus method, electronic equipment and storage medium are involved. Devices, electronic devices and storage media are all within the protection scope of the present invention.

应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, rather than the embodiments of the present invention. implementation constitutes any limitation. The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

本发明所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined under the condition of no conflict to obtain new method embodiments.

本发明所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided by the present invention can be combined arbitrarily without conflict to obtain a new product embodiment.

本发明所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided by the present invention may be combined arbitrarily under the condition of no conflict to obtain new method embodiments or device embodiments.

以上所述,仅为本发明的实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above are only the embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art who is familiar with the technical scope disclosed by the present invention can easily think of changes or substitutions. Included within the scope of protection of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (10)

1. A share authorization attestation (DPoS) consensus method is applied to a block chain network, wherein the block chain network comprises nodes in a normal state, a good state, an abnormal state or a malicious state, and the method comprises the following steps:
acquiring a first node in the blockchain network and a new block generated by a new transaction in the blockchain network; the first node is any one of the nodes;
under the condition that the new block meets a preset condition, converting the first state of the first node into a second state, and obtaining an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
obtaining a voting result of the new block, performing credit reward and punishment on other nodes according to the voting result and the initial credit value, and determining credit values of the other nodes; the other nodes are nodes except the first node in the nodes; the voting results comprise anti-votes;
determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node;
wherein, the converting the first state of the first node into the second state when the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state includes:
when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold value, converting the first node from the normal state to the abnormal state and converting the first node from the good state to the abnormal state, and obtaining an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
2. The method according to claim 1, wherein said converting the first state of the first node into the second state in case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state comprises:
when the new block meets the condition that the new block is an effective block and the number of the effective blocks is greater than a first preset threshold value, converting the normal state of the first node into the good state, and obtaining an initial credit value of the first node in the good state; the valid block characterizes the new transaction as not creating a conflict.
3. The method according to claim 1, wherein said converting the first state of the first node into the second state in case that the new block satisfies a preset condition, and obtaining the initial credit value of the first node in the second state comprises:
when the new block meets the condition that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold value, converting the abnormal state of the first node into the malicious state, and obtaining an initial credit value of the first node in the malicious state; the invalid block characterizes the new transaction as conflicting.
4. The method of any one of claims 1-3, wherein performing credit penalties on other nodes according to the voting results and the initial credit values, and determining the credit values of the other nodes comprises:
performing credit punishment on other nodes according to the voting result and the initial credit value to obtain credit punishment values of the other nodes;
obtaining credit reward values for the other nodes;
and determining the credit value of the other node according to the credit punishment value and the credit reward value.
5. A device for certification of authority (DPoS) consensus of shares, applied to a blockchain network including nodes exhibiting a normal state, a good state, an abnormal state, or a malicious state, the device comprising: an obtaining unit, a converting unit and a determining unit, wherein:
the obtaining unit is configured to obtain a first node in the blockchain network and a new block generated by a new transaction occurring in the blockchain network; the first node is any one of the nodes;
the conversion unit is configured to convert the first state of the first node into a second state when the new block obtained by the obtaining unit meets a preset condition, and obtain an initial credit value of the first node in the second state; the first state is any one of the normal state, the good state and the abnormal state; the second state is any one state except the first state among the normal state, the good state, the abnormal state or the malicious state; the initial credit value characterizes a degree of trust of the first node in the second state;
the determining unit is configured to obtain a voting result of the new block, perform credit reward and punishment on other nodes according to the voting result and the initial credit value obtained by the converting unit, and determine credit values of the other nodes; the other nodes are nodes except the first node in the nodes; the voting results comprise anti-votes; determining a second node with the credit value smaller than a preset threshold value, and deleting the second node; the second node is a node of the other node;
the conversion unit is further configured to, when the new block satisfies that the new block is an invalid block and the number of the invalid blocks is less than or equal to a second preset threshold, convert the first node from the normal state to the abnormal state and convert the first node from the good state to the abnormal state, and obtain an initial credit value of the first node in the abnormal state; the invalid block characterizes the new transaction as conflicting.
6. The apparatus of claim 5, wherein the converting unit is further configured to convert the first node from the normal state to the good state to obtain an initial credit value of the first node in the good state if the new block satisfies that the new block is a valid block and the number of valid blocks is greater than a first preset threshold; the valid block characterizes the new transaction as not creating a conflict.
7. The apparatus according to claim 5, wherein the converting unit is further configured to, if the new block satisfies that the new block is an invalid block and the number of the invalid blocks is greater than a second preset threshold, convert the first node from the abnormal state to the malicious state, and obtain an initial credit value of the first node in the malicious state; the invalid block characterizes the new transaction as conflicting.
8. The apparatus according to any one of claims 5 to 7, wherein the determining unit is further configured to perform credit penalty on the other node according to the voting result and the initial credit value, and obtain a credit penalty value of the other node; obtaining credit reward values for the other nodes; and determining the credit value of the other node according to the credit punishment value and the credit reward value.
9. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 4 when running the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202110550794.9A 2021-05-20 2021-05-20 Share authorization proof DPoS consensus method, device, electronic device and storage medium Active CN112991068B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110550794.9A CN112991068B (en) 2021-05-20 2021-05-20 Share authorization proof DPoS consensus method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110550794.9A CN112991068B (en) 2021-05-20 2021-05-20 Share authorization proof DPoS consensus method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112991068A CN112991068A (en) 2021-06-18
CN112991068B true CN112991068B (en) 2021-08-20

Family

ID=76337154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110550794.9A Active CN112991068B (en) 2021-05-20 2021-05-20 Share authorization proof DPoS consensus method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112991068B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114219650B (en) * 2022-02-21 2022-05-20 浙江数秦科技有限公司 Block chain consensus method with low transaction delay

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109964446A (en) * 2018-06-08 2019-07-02 北京大学深圳研究生院 A voting-based consensus method
US10373129B1 (en) * 2018-03-05 2019-08-06 Winklevoss Ip, Llc System, method and program product for generating and utilizing stable value digital assets
CN110138597A (en) * 2019-04-17 2019-08-16 上海大学 Based on the block chain DPOS of credit score and node clustering common recognition mechanism improved method
CN111813790A (en) * 2020-06-16 2020-10-23 上海申铁信息工程有限公司 Block chain consensus method and device based on Raft algorithm
CN112333170A (en) * 2020-10-28 2021-02-05 浙江树人学院(浙江树人大学) Protection method for block interception attack in block chain based on ore excavation behavior

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10304143B2 (en) * 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
KR102171568B1 (en) * 2019-01-07 2020-10-29 한양대학교 에리카산학협력단 A voter terminal, an authentication server, a voting server, and Electronic voting system
CN109872152B (en) * 2019-01-11 2022-07-15 平安科技(深圳)有限公司 Block chain consensus method based on share authorization certification mechanism and related equipment
CN111080289B (en) * 2019-10-25 2023-06-27 湖北大学 PoW and PoS-based improved block chain consensus mechanism
CN111131181B (en) * 2019-12-05 2022-02-08 重庆邮电大学 Reputation mechanism and DPBFT algorithm-based block chain dynamic DPoS consensus method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10373129B1 (en) * 2018-03-05 2019-08-06 Winklevoss Ip, Llc System, method and program product for generating and utilizing stable value digital assets
CN109964446A (en) * 2018-06-08 2019-07-02 北京大学深圳研究生院 A voting-based consensus method
CN110138597A (en) * 2019-04-17 2019-08-16 上海大学 Based on the block chain DPOS of credit score and node clustering common recognition mechanism improved method
CN111813790A (en) * 2020-06-16 2020-10-23 上海申铁信息工程有限公司 Block chain consensus method and device based on Raft algorithm
CN112333170A (en) * 2020-10-28 2021-02-05 浙江树人学院(浙江树人大学) Protection method for block interception attack in block chain based on ore excavation behavior

Also Published As

Publication number Publication date
CN112991068A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN108833398B (en) A method, device and equipment for updating a blockchain smart contract
JP7592634B2 (en) Method and apparatus for recording work history and proving reputation in a blockchain network
JP7608364B2 (en) Method and apparatus for registering and authenticating miner identities in a blockchain network
WO2020143183A1 (en) Blockchain consensus method based on delegated proof of stake, and related device
EP3779760B1 (en) Blockchain-based data processing method and apparatus, and electronic device
CN108764870A (en) Blockchain-based transaction processing method, device, and electronic equipment
TW201909613A (en) Method, device and electronic device for processing consensus request in blockchain consensus network
CN109003175A (en) A kind of account checking method and system based on block chain
WO2020038105A1 (en) Blockchain-based data storage method and apparatus
CN110597908B (en) Credit recording method, equipment and storage medium based on blockchain
CN113656780B (en) Cross-chain access control method and device
CN110597841B (en) Application comment information processing method and device based on block chain network
WO2021218334A1 (en) Method, system, and apparatus for managing expired digital certificate, and storage medium
CN113612618B (en) Alliance chain consensus method and device
CN116361292B (en) Cross-chain resource mapping and management method and system
CN112101939B (en) Node management method and system based on blockchain
CN113420323A (en) Data sharing method and terminal equipment
CN112991068B (en) Share authorization proof DPoS consensus method, device, electronic device and storage medium
CN110689343A (en) Transaction verification method and device based on directed acyclic graph
CN111010424A (en) Block chain-based network voting method, equipment and medium
CN114138722A (en) Operation log system realized based on ResponseBodyAdvice
CN113256149A (en) Block chain node reputation adjusting method and device, electronic equipment and storage medium
CN118890194A (en) Distributed identity authentication method and system based on blockchain
CN118012945A (en) Heterogeneous blockchain data collaborative access and storage method and system
CN111478785B (en) Consensus method in block chain network, node and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20250509

Address after: Room 1521, 15th Floor, Building 2, No. 165 Fushi Road, Shijingshan District, Beijing 100000

Patentee after: Beijing Zhongke Yunqi Enterprise Service Co.,Ltd.

Country or region after: China

Address before: 432200 7th floor, D1 District, Hankou North International Trade Center, No. 88, Hankou North Avenue, panlongcheng Economic Development Zone, Huangpi District, Wuhan City, Hubei Province

Patentee before: Zhuo Erzhi Lian (Wuhan) Research Institute Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载