+

CN107566124A - Common recognition method for building up, block catenary system and storage medium based on lottery mechanism - Google Patents

Common recognition method for building up, block catenary system and storage medium based on lottery mechanism Download PDF

Info

Publication number
CN107566124A
CN107566124A CN201710737728.6A CN201710737728A CN107566124A CN 107566124 A CN107566124 A CN 107566124A CN 201710737728 A CN201710737728 A CN 201710737728A CN 107566124 A CN107566124 A CN 107566124A
Authority
CN
China
Prior art keywords
block
candidate
node
hash value
cryptographic hash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710737728.6A
Other languages
Chinese (zh)
Other versions
CN107566124B (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.)
Shenzhen Yicheng Automatic Driving Technology Co Ltd
Original Assignee
Shenzhen Yicheng Automatic Driving Technology 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 Shenzhen Yicheng Automatic Driving Technology Co Ltd filed Critical Shenzhen Yicheng Automatic Driving Technology Co Ltd
Priority to CN201710737728.6A priority Critical patent/CN107566124B/en
Publication of CN107566124A publication Critical patent/CN107566124A/en
Application granted granted Critical
Publication of CN107566124B publication Critical patent/CN107566124B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种基于抽签机制的共识建立方法、区块链系统和存储介质,所述方法包括:确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包,所述数据包至少包含准备与末位区块连接的待接入区块的交易数据;基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值;获取其他节点广播的第二候选哈希值,根据第一预设规则在第一候选哈希值和第二候选哈希值中选择目标哈希值,该目标哈希值的节点为待接入区块的记账节点。本发明可保证区块链中各节点完全平等地竞争记账权,可鼓励更多人参与到区块链中,有利于区块链的应用和推广。

The invention discloses a consensus establishment method based on a lottery mechanism, a block chain system and a storage medium. The method includes: determining the bookkeeping node of the last block in the block chain, and determining the bookkeeping node based on the last block , to obtain a data packet, the data packet contains at least the transaction data of the block to be connected to the last block; based on the obtained data packet and the self-stored node data of the node, a hash operation is performed to obtain the first A candidate hash value; obtain a second candidate hash value broadcast by other nodes, select a target hash value from the first candidate hash value and the second candidate hash value according to a first preset rule, and the target hash value The node of is the accounting node to be connected to the block. The invention can ensure that each node in the block chain competes for bookkeeping rights completely and equally, can encourage more people to participate in the block chain, and is beneficial to the application and promotion of the block chain.

Description

基于抽签机制的共识建立方法、区块链系统及存储介质Consensus establishment method, blockchain system and storage medium based on lottery mechanism

技术领域technical field

本发明涉及区块链技术领域,尤其涉及一种基于抽签机制的共识建立方法、区块链系统及存储介质。The invention relates to the technical field of block chains, in particular to a consensus establishment method based on a lottery mechanism, a block chain system and a storage medium.

背景技术Background technique

区块链是由节点参与的分布式数据库系统,也可以将其理解为账簿系统,是由区块链网络中的所有节点各自独立竞争完成的。共识机制是区块链技术的核心,它使得区块链这样一个去中心化的账簿系统变成可能,共识机制与去中心化两个核心因素是区块链内生能力得以扩展的关键。The blockchain is a distributed database system in which nodes participate. It can also be understood as an account book system, which is completed independently by all nodes in the blockchain network. The consensus mechanism is the core of the blockchain technology, which makes a decentralized ledger system such as the blockchain possible. The two core factors of the consensus mechanism and decentralization are the key to the expansion of the endogenous capabilities of the blockchain.

在中心化的结构体系中,系统的共识由中心决定,各参与方只需要服从这个中心即可,因此共识的建立是极为高效的,而在去中心化的结构体系中,由于系统的各个参与方地位平等,当出现分歧的时候如何达成共识就成了问题。In a centralized structural system, the consensus of the system is determined by the center, and all participants only need to obey this center, so the establishment of consensus is extremely efficient. In a decentralized structural system, due to the various participants in the system If both parties are equal in status, how to reach a consensus when differences arise becomes a problem.

目前通常采用的区块链共识机制包括工作量证明、权益证明等方式。其中,权益证明的核心实现如下:记账节点在产生新的区块时,将自己的地址附在区块中,以证明其占有的权益比例,记账节点同时也需要用该地址对应的私钥对部分区块信息签名,以证明其确实拥有该地址的资产。这一共识机制倾向于在系统中占有权益大的节点,易导致腐败,不利于吸纳更多群体使用区块链。Currently commonly used blockchain consensus mechanisms include proof-of-work and proof-of-stake. Among them, the core implementation of proof of equity is as follows: when the bookkeeping node generates a new block, it attaches its own address to the block to prove the proportion of equity it occupies. The bookkeeping node also needs to use the private address corresponding to the address The key signs part of the block information to prove that it really owns the asset at the address. This consensus mechanism tends to occupy nodes with large rights and interests in the system, which can easily lead to corruption and is not conducive to attracting more groups to use the blockchain.

发明内容Contents of the invention

本发明的主要目的在于提供一种基于抽签机制的共识建立方法,旨在解决权益证明共识机制倾向于在系统中占有权益大的节点,易导致腐败,不利于吸纳更多群体使用区块链的技术问题。The main purpose of the present invention is to provide a consensus establishment method based on the lottery mechanism, which aims to solve the problem that the proof-of-stake consensus mechanism tends to occupy nodes with large rights and interests in the system, which is easy to cause corruption and is not conducive to attracting more groups to use the blockchain. technical problem.

为实现上述目的,本发明提供一种基于抽签机制的共识建立方法,所述方法包括:In order to achieve the above object, the present invention provides a consensus establishment method based on a lottery mechanism, the method comprising:

确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包,所述数据包至少包含准备与末位区块连接的待接入区块的交易数据;Determine the bookkeeping node of the last block in the blockchain, and obtain a data packet based on the bookkeeping node of the last block, the data packet at least includes the transaction data of the block to be connected to the last block ;

基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值;Based on the obtained data packet and the self-stored node data of the node, perform a hash operation to obtain the first candidate hash value;

获取其他节点广播的第二候选哈希值,根据第一预设规则在所述第一候选哈希值和第二候选哈希值中选择目标哈希值,该目标哈希值的节点为所述待接入区块的记账节点。Obtain the second candidate hash value broadcast by other nodes, select a target hash value among the first candidate hash value and the second candidate hash value according to the first preset rule, and the node of the target hash value is all Describe the accounting nodes to be connected to the block.

在其中一个实施例中,所述根据预设规则在第一候选哈希值和第二候选哈希值中选择目标哈希值的步骤包括:In one of the embodiments, the step of selecting the target hash value from the first candidate hash value and the second candidate hash value according to preset rules includes:

在所述第一候选哈希值和第二候选哈希值中确定最小的候选哈希值,该最小候选哈希值为目标哈希值。A minimum candidate hash value is determined among the first candidate hash value and the second candidate hash value, and the minimum candidate hash value is a target hash value.

在其中一个实施例中,所述基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值的步骤包括:In one of the embodiments, the step of performing a hash operation to obtain the first candidate hash value based on the obtained data packet and the self-stored node data of the node includes:

获取所述数据包中待接入区块的交易数据,基于该交易数据和末位区块的特征值进行哈希运算,得到第一哈希值;Obtaining the transaction data of the block to be accessed in the data packet, and performing a hash operation based on the transaction data and the characteristic value of the last block to obtain a first hash value;

基于自存的私钥对所述第一哈希值进行签名,将签名后的所述第一哈希值进行哈希运算,得到第一候选哈希值。The first hash value is signed based on the self-stored private key, and a hash operation is performed on the signed first hash value to obtain a first candidate hash value.

在其中一个实施例中,所述获取数据包的步骤之后包括:In one of the embodiments, after the step of obtaining the data packet, it includes:

根据区块链中的历史交易数据,验证所述数据包中待接入区块的交易数据是否全部有效;According to the historical transaction data in the block chain, verify whether all the transaction data in the block to be accessed in the data packet are valid;

若该数据包中所述待接入区块的交易数据全部有效,则执行基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值这一步骤。If all the transaction data of the block to be accessed in the data packet are valid, perform a hash operation based on the obtained data packet and the node data stored by the node to obtain the first candidate hash value .

在其中一个实施例中,所述获取其他节点广播的第二候选哈希值的步骤之后包括:In one of the embodiments, after the step of acquiring the second candidate hash value broadcast by other nodes includes:

基于所述第一候选哈希值和第二候选哈希值,根据第二预设规则判断所述第一候选哈希值是否满足广播条件;Based on the first candidate hash value and the second candidate hash value, determine whether the first candidate hash value satisfies a broadcast condition according to a second preset rule;

若所述第一候选哈希值满足广播条件,则将所述第一候选哈希值向所述区块链所在的区块链网络广播。If the first candidate hash value satisfies the broadcast condition, broadcast the first candidate hash value to the blockchain network where the blockchain is located.

在其中一个实施例中,所述根据第二预设规则判断所述第一候选哈希值是否满足广播条件的步骤包括:In one of the embodiments, the step of judging whether the first candidate hash value satisfies the broadcast condition according to the second preset rule includes:

解析第二预设规则,当解析结果为候选哈希值中的最小候选哈希值为目标哈希值时,若所述第一候选哈希值小于所述第二候选哈希值,则所述第一候选哈希值满足广播条件。Analyzing the second preset rule, when the parsing result is that the minimum candidate hash value among the candidate hash values is the target hash value, if the first candidate hash value is smaller than the second candidate hash value, then the The first candidate hash value satisfies the broadcast condition.

在其中一个实施例中,所述确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包的步骤之前包括:In one of the embodiments, before the step of determining the bookkeeping node of the last block in the blockchain, based on the bookkeeping node of the last block, the step of obtaining the data packet includes:

所述末位区块的记账节点确定准备与末位区块连接的待接入区块的交易数据;The accounting node of the last block determines the transaction data of the block to be connected to the last block;

所述末位区块的记账节点基于所述待接入区块的交易数据,生成数据包,将该数据包向区块链所在的区块链网络广播。The accounting node of the last block generates a data packet based on the transaction data of the block to be accessed, and broadcasts the data packet to the blockchain network where the blockchain is located.

在其中一个实施例中,所述末位区块的记账节点基于所述待接入区块的交易数据,生成数据包,将该数据包向区块链所在的区块链网络广播的步骤包括:In one of the embodiments, the accounting node of the last block generates a data packet based on the transaction data of the block to be accessed, and broadcasts the data packet to the block chain network where the block chain is located include:

所述末位区块的记账节点基于所述交易数据和末位区块的特征值,进行哈希运算得到第二哈希值;The accounting node of the last block performs a hash operation to obtain a second hash value based on the transaction data and the characteristic value of the last block;

所述末位区块的记账节点基于所述交易数据、特征值和第二哈希值生成数据包,并将该数据包向所述区块链所在的区块链网络广播。The accounting node of the last block generates a data packet based on the transaction data, the characteristic value and the second hash value, and broadcasts the data packet to the blockchain network where the blockchain is located.

此外,为实现上述目的,本发明还提供一种区块链系统,所述区块链系统包括多个节点,所述节点包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的基于抽签机制的共识建立程序,所述基于抽签机制的共识建立程序被所述处理器执行时实现如上述基于抽签机制的共识建立方法的步骤。In addition, in order to achieve the above object, the present invention also provides a block chain system, the block chain system includes a plurality of nodes, and the nodes include: a memory, a processor, and a A consensus establishment program based on the lottery mechanism running on the processor, when the consensus establishment program based on the lottery mechanism is executed by the processor, the steps of the aforementioned consensus establishment method based on the lottery mechanism are implemented.

此外,为实现上述目的,本发明还提供一种存储介质,所述存储介质上存储有基于抽签机制的共识建立程序,所述基于抽签机制的共识建立程序被处理器执行时实现如上述基于抽签机制的共识建立方法的步骤。In addition, in order to achieve the above object, the present invention also provides a storage medium, on which a consensus establishment program based on a lottery mechanism is stored, and when the consensus establishment program based on a lottery mechanism is executed by a processor, the aforementioned The steps of the consensus establishment method of the mechanism.

本发明实施例基于末位区块的记账节点确定待接入区块的交易数据,组成数据包,因为末位区块的记账节点是确定的,所以所述待接入区块的交易数据具有一定的唯一性和确定性,进而使得待接入区块唯一确定,便于该待接入区块的顺利创建;由区块链网络中各节点基于各自节点数据和所述数据包进行哈希运算得到候选哈希值(第一候选哈希值和第二候选哈希值),因为哈希算法不可逆的特点,可以保证候选哈希值完全单向不可预测,即使数据包基于末位区块的记账节点而确定,该末位区块的记账节点也无法因此调整自己的节点数据以作弊方式使得自己的候选哈希值成为目标哈希值,因而排除了末位区块的记账节点作恶的可能,同时,候选哈希值完全单向不可预测,可进一步增强候选哈希值的随机性,即保证待接入区块的记账节点是随机产生的,使得区块链中各节点在竞争记账权时不因算力或权益等其他因素而处于弱势地位,保证区块链中各节点完全平等地竞争记账权,可鼓励更多人参与到区块链中,有利于区块链的推广和应用;因哈希运算的不可逆,哈希值的不可预测,使得记账节点的选择类似于一种抽签机制,故本方案主体名称为基于抽签机制的共识建立方法;在所述候选哈希值中确定唯一的目标哈希值,进而确定广播该唯一目标候选哈希值的节点为待接入区块的记账节点,进而达成区块链共识。In the embodiment of the present invention, based on the accounting node of the last block, the transaction data of the block to be accessed is determined to form a data packet. Since the accounting node of the last block is determined, the transaction data of the block to be accessed The data has a certain uniqueness and certainty, which makes the block to be accessed uniquely determined, which facilitates the smooth creation of the block to be accessed; each node in the blockchain network performs hashing based on its own node data and the data packet. Candidate hash values (the first candidate hash value and the second candidate hash value) are obtained by the Greek operation. Because the hash algorithm is irreversible, it can ensure that the candidate hash values are completely unpredictable in one direction, even if the data packet is based on the last bit area It is determined by the bookkeeping node of the last block, and the bookkeeping node of the last block cannot therefore adjust its own node data to make its candidate hash value become the target hash value by cheating, thus excluding the bookkeeping node of the last block. At the same time, the candidate hash value is completely unpredictable in one direction, which can further enhance the randomness of the candidate hash value, that is, to ensure that the accounting nodes to be connected to the block are randomly generated, so that in the blockchain Each node will not be in a disadvantaged position due to other factors such as computing power or rights and interests when competing for bookkeeping rights, ensuring that all nodes in the blockchain compete for bookkeeping rights completely and equally, which can encourage more people to participate in the blockchain, which is beneficial The promotion and application of the blockchain; due to the irreversibility of the hash operation and the unpredictability of the hash value, the selection of the accounting node is similar to a lottery mechanism, so the name of the main body of this scheme is the consensus establishment method based on the lottery mechanism; The unique target hash value is determined among the candidate hash values, and then the node that broadcasts the unique target candidate hash value is determined to be the accounting node of the block to be accessed, thereby reaching a blockchain consensus.

附图说明Description of drawings

图1是本发明实施例的区块链系统示意图;Fig. 1 is a block chain system schematic diagram of the embodiment of the present invention;

图2是本发明实施例的节点终端结构示意图;FIG. 2 is a schematic structural diagram of a node terminal according to an embodiment of the present invention;

图3为本发明基于抽签机制的共识建立方法第一实施例的流程示意图;FIG. 3 is a schematic flow diagram of the first embodiment of the consensus establishment method based on the lottery mechanism of the present invention;

图4为本发明基于抽签机制的共识建立方法第三实施例的流程示意图;FIG. 4 is a schematic flow diagram of the third embodiment of the consensus establishment method based on the lottery mechanism of the present invention;

图5为本发明基于抽签机制的共识建立方法第五实施例的流程示意图;FIG. 5 is a schematic flow diagram of the fifth embodiment of the consensus establishment method based on the lottery mechanism of the present invention;

图6为本发明实施例将图5中的步骤S51细化后的流程示意图;FIG. 6 is a schematic flow diagram of step S51 in FIG. 5 in an embodiment of the present invention;

图7为本发明基于抽签机制的共识建立方法第六实施例的场景示意图;FIG. 7 is a schematic diagram of the scene of the sixth embodiment of the consensus establishment method based on the lottery mechanism in the present invention;

图8为本发明基于抽签机制的共识建立方法第六实施例的流程示意图;FIG. 8 is a schematic flowchart of the sixth embodiment of the consensus establishment method based on the lottery mechanism of the present invention;

图9为本发明基于抽签机制的共识建立方法第七实施例的流程示意图。FIG. 9 is a schematic flowchart of a seventh embodiment of the consensus establishment method based on the lottery mechanism in the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式detailed description

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身没有特定的意义。因此,“模块”、“部件”或“单元”可以混合地使用。In the following description, use of suffixes such as 'module', 'part' or 'unit' for denoting elements is only for facilitating description of the present invention and has no specific meaning by itself. Therefore, 'module', 'part' or 'unit' may be used in combination.

如图1所示,图1是本发明实施例的区块链系统示意图。As shown in FIG. 1, FIG. 1 is a schematic diagram of a blockchain system according to an embodiment of the present invention.

所述区块链系统包含多个节点,在创建新区块时,某个或某些节点执行特定程序或特定功能,本发明实施例将其记为记账节点,区块链系统中的其他节点为普通节点,每个已创建的区块都有其确定的记账节点。记账节点和普通节点并不是固定的、特定的某些节点,而是会根据区块链的共识算法变化。The blockchain system includes a plurality of nodes. When creating a new block, one or some nodes execute a specific program or specific function, which is recorded as an accounting node in the embodiment of the present invention. Other nodes in the blockchain system For ordinary nodes, each created block has its own definite bookkeeping node. Bookkeeping nodes and ordinary nodes are not fixed and specific nodes, but will change according to the consensus algorithm of the blockchain.

所述记账节点,用于:The bookkeeping node is used for:

确定准备与末位区块连接的待接入区块的交易数据;Determine the transaction data of the block to be connected to the last block;

基于所述待接入区块的交易数据,生成数据包,将该数据包向区块链所在的区块链网络广播。Based on the transaction data of the block to be accessed, a data packet is generated, and the data packet is broadcast to the blockchain network where the blockchain is located.

所述记账节点或普通节点,用于:The bookkeeping node or ordinary node is used for:

确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包,所述数据包至少包含准备与末位区块连接的待接入区块的交易数据;Determine the bookkeeping node of the last block in the blockchain, and obtain a data packet based on the bookkeeping node of the last block, the data packet at least includes the transaction data of the block to be connected to the last block ;

基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值;Based on the obtained data packet and the self-stored node data of the node, perform a hash operation to obtain the first candidate hash value;

获取其他节点广播的第二候选哈希值,根据第一预设规则在所述第一候选哈希值和第二候选哈希值中选择目标哈希值,该目标哈希值的节点为所述待接入区块的记账节点。Obtain the second candidate hash value broadcast by other nodes, select a target hash value among the first candidate hash value and the second candidate hash value according to the first preset rule, and the node of the target hash value is all Describe the accounting nodes to be connected to the block.

所述节点终端可以是服务器、PC,也可以是智能手机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面3)播放器、便携计算机等具有显示功能的可移动式终端设备。Described node terminal can be server, PC, also can be smart mobile phone, panel computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III, moving picture expert compression standard audio level 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression standard audio layer 3) Players, portable computers and other mobile terminal devices with display functions.

如图2所示,所述节点可以包括:处理器1001,例如CPU,通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 2 , the node may include: a processor 1001 , such as a CPU, a communication bus 1002 , a user interface 1003 , a network interface 1004 , and a memory 1005 . Wherein, the communication bus 1002 is used to realize connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .

本领域技术人员可以理解,图1中示出的系统组成部件、图2中示出的节点终端结构,并不构成对系统或节点终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the system components shown in Figure 1 and the node terminal structure shown in Figure 2 do not constitute a limitation on the system or node terminals, and may include more or less components than those shown in the illustration , or combinations of certain components, or different arrangements of components.

如图2所示,本实施例中,该节点终端包括处理器1001,通信总线1002,用户接口1003,网络接口1004,存储器1005。作为一种计算机存储介质的存储器1005中包括基于抽签机制的共识建立程序。As shown in FIG. 2 , in this embodiment, the node terminal includes a processor 1001 , a communication bus 1002 , a user interface 1003 , a network interface 1004 , and a memory 1005 . The memory 1005 as a computer storage medium includes a consensus establishment program based on a lottery mechanism.

在图2所示的终端中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信。In the terminal shown in FIG. 2 , the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client (client) and perform data communication with the client.

而处理器1001可以用于调用存储器1005中存储的基于抽签机制的共识建立程序,并执行以下操作:The processor 1001 can be used to call the consensus establishment program based on the lottery mechanism stored in the memory 1005, and perform the following operations:

确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包,所述数据包至少包含准备与末位区块连接的待接入区块的交易数据;Determine the bookkeeping node of the last block in the blockchain, and obtain a data packet based on the bookkeeping node of the last block, the data packet at least includes the transaction data of the block to be connected to the last block ;

基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值;Based on the obtained data packet and the self-stored node data of the node, perform a hash operation to obtain the first candidate hash value;

获取其他节点广播的第二候选哈希值,根据第一预设规则在所述第一候选哈希值和第二候选哈希值中选择目标哈希值,该目标哈希值的节点为所述待接入区块的记账节点。Obtain the second candidate hash value broadcast by other nodes, select a target hash value among the first candidate hash value and the second candidate hash value according to the first preset rule, and the node of the target hash value is all Describe the accounting nodes to be connected to the block.

所述根据预设规则在第一候选哈希值和第二候选哈希值中选择目标哈希值的步骤包括:The step of selecting a target hash value from the first candidate hash value and the second candidate hash value according to preset rules includes:

在所述第一候选哈希值和第二候选哈希值中确定最小的候选哈希值,该最小候选哈希值为目标哈希值。A minimum candidate hash value is determined among the first candidate hash value and the second candidate hash value, and the minimum candidate hash value is a target hash value.

所述基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值的步骤包括:The step of performing a hash operation to obtain the first candidate hash value based on the obtained data packet and the self-stored node data of the node includes:

获取所述数据包中待接入区块的交易数据,基于该交易数据和末位区块的特征值进行哈希运算,得到第一哈希值;Obtaining the transaction data of the block to be accessed in the data packet, and performing a hash operation based on the transaction data and the characteristic value of the last block to obtain a first hash value;

基于自存的私钥对所述第一哈希值进行签名,将签名后的所述第一哈希值进行哈希运算,得到第一候选哈希值。The first hash value is signed based on the self-stored private key, and a hash operation is performed on the signed first hash value to obtain a first candidate hash value.

所述获取数据包的步骤之后还包括:After the step of obtaining the data packet, it also includes:

根据区块链中的历史交易数据,验证所述数据包中待接入区块的交易数据是否全部有效;According to the historical transaction data in the block chain, verify whether all the transaction data in the block to be accessed in the data packet are valid;

若该数据包中所述待接入区块的交易数据全部有效,则执行所述基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值这一步骤。If all the transaction data of the block to be accessed in the data packet are valid, then execute the hash operation based on the obtained data packet and the self-stored node data of the node to obtain the first candidate hash value. one step.

所述获取其他节点广播的第二候选哈希值的步骤之后还包括:After the step of obtaining the second candidate hash value broadcast by other nodes, it also includes:

基于所述第一候选哈希值和第二候选哈希值,根据第二预设规则判断所述第一候选哈希值是否满足广播条件;Based on the first candidate hash value and the second candidate hash value, determine whether the first candidate hash value satisfies a broadcast condition according to a second preset rule;

若所述第一候选哈希值满足广播条件,则将所述第一候选哈希值向所述区块链所在的区块链网络广播。If the first candidate hash value satisfies the broadcast condition, broadcast the first candidate hash value to the blockchain network where the blockchain is located.

所述根据第二预设规则判断所述第一候选哈希值是否满足广播条件的步骤包括:The step of judging whether the first candidate hash value satisfies the broadcast condition according to the second preset rule includes:

解析第二预设规则,当解析结果为候选哈希值中的最小候选哈希值为目标哈希值时,若所述第一候选哈希值小于所述第二候选哈希值,则所述第一候选哈希值满足广播条件。Analyzing the second preset rule, when the parsing result is that the minimum candidate hash value among the candidate hash values is the target hash value, if the first candidate hash value is smaller than the second candidate hash value, then the The first candidate hash value satisfies the broadcast condition.

所述确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包的步骤之前包括:Described to determine the bookkeeping node of the last block in the blockchain, based on the bookkeeping node of the last block, the step of obtaining the data packet includes:

所述末位区块的记账节点确定准备与末位区块连接的待接入区块的交易数据;The accounting node of the last block determines the transaction data of the block to be connected to the last block;

所述末位区块的记账节点基于所述待接入区块的交易数据,生成数据包,将该数据包向区块链所在的区块链网络广播。The accounting node of the last block generates a data packet based on the transaction data of the block to be accessed, and broadcasts the data packet to the blockchain network where the blockchain is located.

所述末位区块的记账节点基于所述待接入区块的交易数据,生成数据包,将该数据包向区块链所在的区块链网络广播的步骤包括:The accounting node of the last block generates a data packet based on the transaction data of the block to be accessed, and the step of broadcasting the data packet to the blockchain network where the blockchain is located includes:

所述末位区块的记账节点基于所述交易数据和末位区块的特征值,进行哈希运算得到第二哈希值;The accounting node of the last block performs a hash operation to obtain a second hash value based on the transaction data and the characteristic value of the last block;

所述末位区块的记账节点基于所述交易数据、特征值和第二哈希值生成数据包,并将该数据包向所述区块链所在的区块链网络广播。The accounting node of the last block generates a data packet based on the transaction data, the characteristic value and the second hash value, and broadcasts the data packet to the blockchain network where the blockchain is located.

参照图3,在本发明基于抽签机制的共识建立方法第一实施例中,所述基于抽签机制的共识建立方法包括:Referring to Fig. 3, in the first embodiment of the consensus establishment method based on the lottery mechanism of the present invention, the consensus establishment method based on the lottery mechanism includes:

步骤S10,确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包,所述数据包至少包含准备与末位区块连接的待接入区块的交易数据;Step S10, determine the bookkeeping node of the last block in the blockchain, and obtain a data packet based on the bookkeeping node of the last block, the data packet at least includes a block to be connected to the last block transaction data;

为便于理解本发明方案,以下首先对区块链相关特点进行简单介绍。In order to facilitate the understanding of the solution of the present invention, the following briefly introduces the relevant characteristics of the blockchain.

广义来讲,区块链技术是利用块链式数据结构来验证与存储数据、利用分布式节点共识算法来生成和更新数据、利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算范式。Broadly speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses automated scripts to A new distributed infrastructure and computing paradigm for programming and manipulating data through smart contracts composed of code.

狭义来讲,区块链是一串使用密码学方法相关联产生的数据区块,是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构。每一个数据块中包含交易信息,区块链中的每一笔交易都通过密码学方法与相邻两个区块串联,因此可追溯到任何一笔交易的历史,因此可实现信息有效性的验证和生成下一个区块。In a narrow sense, a blockchain is a series of data blocks associated with each other using cryptographic methods. It is a chained data structure that combines data blocks in a sequential manner in chronological order. Each data block contains transaction information, and each transaction in the blockchain is connected in series with two adjacent blocks through cryptographic methods, so it can be traced back to the history of any transaction, so the validity of information can be achieved. Validate and generate the next block.

区块链网络是由众多节点共同组成的一个端到端网络,每台设备都可作为一个节点,节点间基于一套共识机制,通过竞争计算共同维护整个区块链。节点可获得完整的区块链副本(狭义上的区块链,相当于数据库),这种节点一般为中继节点,也可仅获取部分区块链副本,如仅保存区块头信息,通过P2P(点对点)的方式按图索骥的找到中继节点,从而搜索到所需信息。The blockchain network is an end-to-end network composed of many nodes. Each device can be used as a node. Based on a set of consensus mechanisms, the nodes jointly maintain the entire blockchain through competitive calculations. Nodes can obtain a complete copy of the blockchain (blockchain in a narrow sense, which is equivalent to a database). This kind of node is generally a relay node, or only a partial copy of the blockchain can be obtained. For example, only the block header information is saved, through P2P (Point-to-point) way to find the relay node according to the map, so as to search for the required information.

区块链中的所有数据信息是公开的,区块链上所有交易对所有节点可见。区块链的每一个区块有各自的记账节点。All data information in the blockchain is public, and all transactions on the blockchain are visible to all nodes. Each block of the blockchain has its own accounting node.

本实施例中的区块链为狭义上的区块链,即按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构。末位区块指区块链最新产生的一个区块,从区块链的链式结构上说,末位区块指区块链的最后一个区块。本实施例中的待接入区块指即将创建但尚未创建的新区块。The blockchain in this embodiment is a blockchain in a narrow sense, that is, a chained data structure in which data blocks are sequentially connected in a chronological order. The last block refers to the latest block generated by the blockchain. From the chain structure of the blockchain, the last block refers to the last block of the blockchain. The block to be accessed in this embodiment refers to a new block that is about to be created but has not yet been created.

现有技术中的记账节点指创建区块的节点,该节点可以为单个,也可为多个(多个的情形为小组形式)。但本实施例中,末位区块的记账节点并非指确定末位区块交易数据的节点,而是指确定待接入区块交易数据的、与末位区块有名义上的记账关系的节点,末位区块确定,末位区块的记账节点也是确定的。确定区块链中末位区块的记账节点,包括不限于下述方式:可以通过查询该末位区块上的签名信息来确定,例如,若该末位区块上有某节点的私钥签名,则该节点为末位区块的记账节点。The accounting node in the prior art refers to the node that creates the block, and the node can be single or multiple (in the case of multiple, it is in the form of a group). However, in this embodiment, the accounting node of the last block does not refer to the node that determines the transaction data of the last block, but refers to the node that determines the transaction data of the block to be accessed and has a nominal bookkeeping node with the last block. The node of the relationship, the last block is determined, and the accounting node of the last block is also determined. Determine the accounting node of the last block in the blockchain, including but not limited to the following methods: it can be determined by querying the signature information on the last block, for example, if there is a node’s private key signature, the node is the accounting node of the last block.

本实施例中的数据包,至少包含末位区块的记账节点确定的、准备与末位区块连接的待接入区块的交易数据,数据包包括但不限于以下几种组成方式:所述数据包可以仅包含待接入区块的交易数据;可以是将待接入区块的交易数据进行哈希运算得到的哈希值与所述待接入区块的交易数据的集合;也可以是将待接入区块的交易数据与其他数据,如末位区块的特征值、扰动因子进行哈希运算得到的哈希值与所述待接入区块的交易数据的集合,其中末位区块的特征值可以指将末位区块的交易数据进行哈希运算得到的哈希值。The data packet in this embodiment at least includes the transaction data of the block to be connected to the last block determined by the accounting node of the last block, and the data packet includes but is not limited to the following composition methods: The data packet may only contain the transaction data of the block to be accessed; it may be a set of a hash value obtained by hashing the transaction data of the block to be accessed and the transaction data of the block to be accessed; It can also be a set of the transaction data of the block to be connected and other data, such as the characteristic value of the last block and the disturbance factor, which are obtained by hashing, and the transaction data of the block to be connected, The characteristic value of the last block may refer to a hash value obtained by hashing the transaction data of the last block.

本实施例中,由区块链网络中的各节点基于末位区块的记账节点,获取数据包,末位区块的记账节点还可以获取所述数据包,参与待接入区块记账节点的竞选(此时,末位区块的记账节点可直接对所述数据包进行下一步操作),也可以将其排除在竞选之外。普通节点直接接收末位区块的记账节点广播的所述数据包。In this embodiment, each node in the blockchain network obtains a data packet based on the accounting node of the last block, and the accounting node of the last block can also obtain the data packet and participate in the block to be accessed. The election of the bookkeeping node (at this time, the bookkeeping node of the last block can directly perform the next operation on the data packet), or it can be excluded from the election. The common node directly receives the data packet broadcast by the accounting node of the last block.

步骤S11,基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值;Step S11, based on the obtained data packet and the self-stored node data of the node, perform a hash operation to obtain a first candidate hash value;

本实施例中,节点数据为确定的、节点无法在短时间内变更的,在一个程度上独属于节点的数据,可以为节点私钥,或者其他节点标识信息。In this embodiment, the node data is certain, the node cannot be changed in a short time, and the data that belongs to the node to a certain extent can be the node private key or other node identification information.

区块链各节点接收到所述数据包后(若末位区块的记账节点参与竞选,末位区块的记账节点直接对存储在本地的数据包进行后续操作),可根据所述数据包包含的数据内容确定下一步操作,若所述数据包仅包含待接入区块的交易数据,则可直接对该待接入区块的交易数据进行一定操作,若所述数据包除了包括待接入区块的交易数据外还包括其他值,则可将所述数据包中的所有或者部分内容进行一定操作后,与自存的节点数据进行哈希运算。After each node of the block chain receives the data packet (if the bookkeeping node of the last block participates in the election, the bookkeeping node of the last block directly performs follow-up operations on the data packet stored locally), according to the The data content contained in the data packet determines the next operation. If the data packet only contains the transaction data of the block to be accessed, certain operations can be directly performed on the transaction data of the block to be accessed. If the data packet includes Including other values in addition to the transaction data of the block to be accessed, all or part of the content in the data packet can be subjected to a certain operation, and hash operation can be performed with the self-stored node data.

基于所述数据包和自存的节点数据,进行哈希运算,可以是直接将所述数据包包含的所有内容和各自的节点数据进行哈希运算,也可以是将节点数据或所述数据包进行相关处理后再进行哈希运算。Based on the data packet and the self-stored node data, the hash operation can be directly performed on all the content contained in the data packet and the respective node data, or the node data or the data packet After relevant processing, hash operation is performed.

所述相关处理可以包括但不限于:The related processing may include but not limited to:

若所述数据包仅包含待接入区块的交易数据,则可将该交易数据进行哈希运算得到哈希值,将该哈希值与节点数据再次进行哈希运算得到第一候选哈希值(下文称HASH1);或者将该交易数据进行哈希运算得到哈希值,将该哈希值+该交易数据+节点数据再次进行哈希运算得到HASH1。If the data packet only contains the transaction data of the block to be accessed, the transaction data can be hashed to obtain a hash value, and the hash value and node data can be hashed again to obtain the first candidate hash value (hereinafter referred to as HASH1); or perform a hash operation on the transaction data to obtain a hash value, and perform a hash operation on the hash value + the transaction data + node data again to obtain HASH1.

若所述数据包包含待接入区块的交易数据和该交易数据的哈希值,则可只选择其中的交易数据,将该哈希值与节点数据再次进行哈希运算得到HASH1;或者可将该交易数据和该交易数据的哈希值进行哈希运算后得到次哈希值,将该次哈希值+节点数据进行哈希运算,得到HASH1。If the data packet contains the transaction data of the block to be accessed and the hash value of the transaction data, only the transaction data can be selected, and the hash value and the node data are hashed again to obtain HASH1; or The transaction data and the hash value of the transaction data are hashed to obtain a secondary hash value, and the secondary hash value + node data are hashed to obtain HASH1.

若所述数据包不仅包含待接入区块的交易数据和该交易数据的哈希值,还包括其他数据,如末位区块的特征值,则可将其中某些数据进行哈希运算后,再将哈希结果与节点数据进行哈希运算得到HASH1。If the data packet contains not only the transaction data of the block to be accessed and the hash value of the transaction data, but also other data, such as the characteristic value of the last block, some of the data can be hashed , and then perform a hash operation on the hash result and the node data to obtain HASH1.

也可将节点数据和所述数据包进行某些运算后,对运算结果进行哈希运算,得到HASH1。譬如,若节点数据为私钥,可使用私钥对所述数据包进行签名后,再将签名后的信息进行哈希运算。It is also possible to perform some operations on the node data and the data packet, and then perform hash operations on the operation results to obtain HASH1. For example, if the node data is a private key, the private key can be used to sign the data packet, and then the signed information can be hashed.

本实施例中的第一候选哈希值(即HASH1)指区块链网络中的节点为竞争记账权所产生的哈希值。The first candidate hash value (ie HASH1) in this embodiment refers to the hash value generated by the nodes in the blockchain network for competing for bookkeeping rights.

步骤S12,获取其他节点广播的第二候选哈希值,根据第一预设规则在所述第一候选哈希值和第二候选哈希值中选择目标哈希值,该目标哈希值的节点为所述待接入区块的记账节点。Step S12, obtain the second candidate hash value broadcast by other nodes, select the target hash value among the first candidate hash value and the second candidate hash value according to the first preset rule, the target hash value The node is the accounting node of the block to be accessed.

本实施例中的第二候选哈希值(下文称HASH2)指,相对于本节点的其他节点产生的哈希值。如区块链网络中有A、B、C、D四节点,站在A的角度,A自己产生的候选哈希值为第一候选哈希值(HASH1),B、C、D产生的候选哈希值为第二候选哈希值(HASH2),但如果站在B的角度,B自己产生的候选哈希值为HASH1,A、C、D产生的候选哈希值为HASH2。候选哈希值指区块链网络中各节点为了竞争记账权而生成的哈希值。本实施例中的第一、第二仅为区分本节点和其他节点产生的候选哈希值。HASH2可以有多个。The second candidate hash value (hereinafter referred to as HASH2) in this embodiment refers to the hash value generated by other nodes relative to the current node. For example, there are four nodes A, B, C, and D in the blockchain network. From the perspective of A, the candidate hash value generated by A itself is the first candidate hash value (HASH1), and the candidate hash value generated by B, C, and D The hash value is the second candidate hash value (HASH2), but from the perspective of B, the candidate hash value generated by B itself is HASH1, and the candidate hash values generated by A, C, and D are HASH2. Candidate hash value refers to the hash value generated by each node in the blockchain network in order to compete for bookkeeping rights. The first and second in this embodiment are only for distinguishing the candidate hash values generated by this node and other nodes. HASH2 can have multiple.

本实施例中的第一预设规则是用于确定目标哈希值的规则,可以存储在区块链的特定地址上,当需要选举记账节点时可直接调用该第一预设规则。The first preset rule in this embodiment is a rule for determining the target hash value, which can be stored in a specific address of the blockchain, and can be directly invoked when an accounting node needs to be elected.

根据该第一预设规则应当可以在多个所述候选哈希值中选择出唯一的一个哈希值(即目标哈希值),可为候选哈希值中的最大值,也可为根据特定算法确定的大小序号,如将所有候选哈希值进行大小排序,根据特定算法确定第N个候选哈希值为目标哈希值。该目标哈希值的节点指广播该目标哈希值的节点。According to the first preset rule, it should be possible to select a unique hash value (i.e. the target hash value) among the plurality of candidate hash values, which may be the maximum value among the candidate hash values, or may be based on The size sequence number determined by a specific algorithm, such as sorting all candidate hash values by size, and determining the Nth candidate hash value as the target hash value according to a specific algorithm. The node of the target hash value refers to the node broadcasting the target hash value.

区块链中各节点均可获得已广播的候选哈希值,所以在确定目标哈希值时,区块链中各节点可根据第一预设规则,在所有候选哈希值中选出目标哈希值。Each node in the blockchain can obtain the broadcast candidate hash value, so when determining the target hash value, each node in the blockchain can select the target from all candidate hash values according to the first preset rule hash value.

可选地,步骤S12中根据预设规则在第一候选哈希值和第二候选哈希值中选择目标哈希值这一步骤包括:Optionally, the step of selecting a target hash value from the first candidate hash value and the second candidate hash value according to preset rules in step S12 includes:

步骤S13,在所述第一候选哈希值和第二候选哈希值中确定最小的候选哈希值,该最小候选哈希值为目标哈希值。Step S13, determining the minimum candidate hash value among the first candidate hash value and the second candidate hash value, the minimum candidate hash value being a target hash value.

本实施例中,第一预设规则规定最小的候选哈希值为目标哈希值。In this embodiment, the first preset rule stipulates that the minimum candidate hash value is the target hash value.

区块链中各节点将接收的所有第二候选哈希值(HASH2不止一个)和各自节点产生的第一候选哈希值(HASH1)进行大小比较(也包括HASH2间的比较),选出其中最小的哈希值,即目标哈希值。Each node in the blockchain compares all the second candidate hash values (more than one HASH2) received with the first candidate hash value (HASH1) generated by the respective nodes (including the comparison between HASH2), and selects one of them The smallest hash value, which is the target hash value.

本实施例将最小候选哈希值确定为目标哈希值,因为大小判断容易实现,所以计算量不大,本实施例较易实现,同时,本实施例明确了目标哈希值的确定规则,进一步确定待接入区块的记账节点。In this embodiment, the minimum candidate hash value is determined as the target hash value, because the size judgment is easy to implement, so the amount of calculation is not large, and this embodiment is easier to implement. At the same time, this embodiment clarifies the determination rules of the target hash value. Further determine the accounting node to be connected to the block.

在本实施例中,基于末位区块的记账节点确定待接入区块的交易数据,组成数据包,因为末位区块的记账节点是确定的,所以所述待接入区块的交易数据具有一定的唯一性和确定性,进而使得待接入区块唯一确定,便于该待接入区块的顺利创建;In this embodiment, based on the accounting node of the last block, the transaction data of the block to be accessed is determined to form a data packet. Since the accounting node of the last block is determined, the block to be accessed The transaction data has a certain uniqueness and certainty, which makes the block to be connected uniquely determined, which facilitates the smooth creation of the block to be connected;

由区块链网络中各节点基于各自节点数据和所述数据包进行哈希运算得到候选哈希值(第一候选哈希值和第二候选哈希值),因为哈希算法不可逆的特点,可以保证候选哈希值完全单向不可预测,即使数据包基于末位区块的记账节点而确定,该末位区块的记账节点也无法因此调整自己的节点数据以作弊方式使得自己的候选哈希值成为目标哈希值,因而排除了末位区块的记账节点作恶的可能,同时,候选哈希值完全单向不可预测,可进一步增强候选哈希值的随机性,即保证待接入区块的记账节点是随机产生的,使得区块链中各节点在竞争记账权时不因算力或权益等其他因素而处于弱势地位,保证区块链中各节点完全平等地竞争记账权,可鼓励更多人参与到区块链中,有利于区块链的推广和应用;因哈希运算的不可逆,哈希值的不可预测,使得记账节点的选择类似于一种抽签机制,故本方案主体名称为基于抽签机制的共识建立方法;The candidate hash values (the first candidate hash value and the second candidate hash value) are obtained by each node in the blockchain network based on the respective node data and the data packet. Because of the irreversible characteristics of the hash algorithm, It can guarantee that the candidate hash value is completely unpredictable in one direction. Even if the data packet is determined based on the accounting node of the last block, the accounting node of the last block cannot adjust its own node data to make its own The candidate hash value becomes the target hash value, thus eliminating the possibility of the accounting node of the last block doing evil. At the same time, the candidate hash value is completely unpredictable in one direction, which can further enhance the randomness of the candidate hash value, that is, guarantee The bookkeeping nodes to be connected to the block are randomly generated, so that each node in the blockchain will not be in a weak position due to other factors such as computing power or rights and interests when competing for bookkeeping rights, ensuring that all nodes in the blockchain are completely equal Competing for bookkeeping rights can encourage more people to participate in the blockchain, which is conducive to the promotion and application of the blockchain; due to the irreversibility of the hash operation and the unpredictable hash value, the selection of bookkeeping nodes is similar to a A lottery mechanism, so the name of the main body of this scheme is the consensus establishment method based on the lottery mechanism;

在所述选哈希值中确定唯一候选哈希值,进而确定广播该唯一候选哈希值的节点为待接入区块的记账节点,进而达成区块链共识。The unique candidate hash value is determined among the selected hash values, and then the node broadcasting the unique candidate hash value is determined as the accounting node of the block to be accessed, thereby reaching a block chain consensus.

本发明实施例基于抽签机制的共识建立方法第二实施例中,基于该方法的第一实施例,步骤S11包括:In the second embodiment of the consensus establishment method based on the lottery mechanism in the embodiment of the present invention, based on the first embodiment of the method, step S11 includes:

步骤S20,获取所述数据包中待接入区块的交易数据,基于该交易数据和末位区块的特征值进行哈希运算,得到第一哈希值;Step S20, obtaining the transaction data of the block to be accessed in the data packet, and performing a hash operation based on the transaction data and the characteristic value of the last block to obtain a first hash value;

步骤S21,基于自存的私钥对所述第一哈希值进行签名,将签名后的所述第一哈希值进行哈希运算,得到第一候选哈希值。Step S21: Sign the first hash value based on the self-stored private key, and perform a hash operation on the signed first hash value to obtain a first candidate hash value.

为了确定待接入区块的唯一性,其交易数据需由某特定节点确定,本实施例中,当前区块的交易数据均由上一区块的记账节点确定,即待接入区块的交易数据由末位区块的记账节点确定,末位区块的记账节点确定了待接入区块的交易数据后,将至少包含该待接入区块的交易数据的数据包向区块链网络广播。In order to determine the uniqueness of the block to be connected, its transaction data needs to be determined by a specific node. In this embodiment, the transaction data of the current block is determined by the accounting node of the previous block, that is, the block to be connected The transaction data of the last block is determined by the bookkeeping node of the last block. After the bookkeeping node of the last block determines the transaction data of the block to be connected, it sends the data packet containing at least the transaction data of the block to be connected to Blockchain webcast.

本实施例中,末位区块的特征值指将末位区块所包含的所有内容进行哈希运算所获得的哈希值或将末位区块交易数据的集合进行哈希运算所获得的哈希值。In this embodiment, the feature value of the last block refers to the hash value obtained by hashing all the content contained in the last block or the hash value obtained by hashing the transaction data set of the last block hash value.

基于该待接入区块的交易数据和末位区块的特征值进行哈希运算,可以指直接将该待接入区块的交易数据和末位区块的特征值进行哈希运算,也可指将该待接入区块的交易数据和末位区块的特征值进行前期处理再进行哈希运算,前期处理可指将该待接入区块的交易数据进行一次哈希运算。Performing a hash operation based on the transaction data of the block to be connected and the characteristic value of the last block may refer to directly performing a hash operation on the transaction data of the block to be connected and the characteristic value of the last block, or It may refer to performing pre-processing on the transaction data of the block to be connected and the characteristic value of the last block before performing a hash operation, and the pre-processing may refer to performing a hash operation on the transaction data of the block to be connected to.

区块链网络中各节点均可获得区块链副本,所以,末位区块的特征值可自行获取。因为第一哈希值是基于接入区块的交易数据和末位区块的特征值进行哈希运算获得,所以,区块链网络中所有节点产生的第一哈希值相等。Each node in the blockchain network can obtain a copy of the blockchain, so the characteristic value of the last block can be obtained by itself. Because the first hash value is obtained by performing hash operations based on the transaction data of the access block and the characteristic value of the last block, the first hash values generated by all nodes in the blockchain network are equal.

获得第一哈希值后,区块链网络中各节点使用自己的私钥对第一哈希值进行签名,再将签名后的第一哈希值进行哈希运算,得到HASH1。After obtaining the first hash value, each node in the blockchain network uses its own private key to sign the first hash value, and then performs hash operation on the signed first hash value to obtain HASH1.

本实施例中,通过各节点基于数据包中待接入区块的交易数据生成第一哈希值,再基于私钥对所述第一哈希值的签名结果,生成用于竞选的候选哈希值,因为哈希运算的不可逆性,两次哈希运算可进一步增强哈希值的不可预测性,可防止末位区块的记账节点作恶,也可保证候选哈希值的随机生成,竞选记账节点可完全随机,各节点公平竞选,机会平等,吸引更多人使用区块链,推动区块链的发展。In this embodiment, each node generates a first hash value based on the transaction data of the block to be accessed in the data packet, and then generates a candidate hash value for election based on the signature result of the first hash value by the private key. Hash value, because of the irreversibility of the hash operation, two hash operations can further enhance the unpredictability of the hash value, which can prevent the accounting nodes of the last block from doing evil, and can also ensure the random generation of candidate hash values. The election bookkeeping nodes can be completely random, and each node can run fairly and have equal opportunities to attract more people to use the blockchain and promote the development of the blockchain.

参照图4,在本发明基于抽签机制的共识建立方法第三实施例中,基于该方法的第一实施例或第二实施例,步骤S10之后还包括:Referring to FIG. 4, in the third embodiment of the consensus establishment method based on the lottery mechanism of the present invention, based on the first embodiment or the second embodiment of the method, after step S10, it also includes:

步骤S30,查询区块链中的历史交易数据;Step S30, query the historical transaction data in the block chain;

步骤S31,根据区块链中的历史交易数据,验证所述数据包中待接入区块的交易数据是否全部有效;Step S31, according to the historical transaction data in the block chain, verify whether all the transaction data in the block to be accessed in the data packet are valid;

步骤S32,若该数据包中所述待接入区块的交易数据全部有效,则执行所述基于获取的所述数据包和本节点自存的节点数据,进行哈希运算得到第一候选哈希值的步骤;Step S32, if all the transaction data of the blocks to be accessed in the data packet are valid, execute the hash operation based on the obtained data packet and the node data stored by the node to obtain the first candidate hash Hash steps;

步骤S33,若该数据包中所述待接入区块的交易数据中存在无效交易数据,则所述数据包无效,重新确定末位区块的记账节点。Step S33, if there is invalid transaction data in the transaction data of the block to be accessed in the data packet, the data packet is invalid, and the accounting node of the last block is re-determined.

解析所述数据包,首先验证其中的待接入区块的交易数据是否全部有效,因为每一个区块中包含交易信息,区块链中的每一笔交易都通过密码学方法与相邻两个区块串联,因此可追溯到任何一笔交易的历史,所以各参与节点可通过自存的完整的区块链或部分区块链中存储的历史交易数据,验证所述数据中的待接入区块的交易数据是否全部有效。To analyze the data packet, first verify whether the transaction data of the blocks to be accessed are all valid, because each block contains transaction information, and each transaction in the block chain is cryptographically linked to two adjacent blocks. Therefore, it can be traced back to the history of any transaction, so each participating node can verify the pending transactions in the data through the historical transaction data stored in the self-stored complete blockchain or part of the blockchain. Whether all the transaction data entered into the block is valid.

若所述交易数据全部有效,则基于所述数据包和自存的节点数据进行哈希运算,可以直接将所述数据包中所有内容和自存的节点数据进行哈希运算,也可将所述数据包中部分内容和自存的节点数据进行哈希运算,也可将所述数据包和自存的节点数据进行前期处理再进行哈希运算,例如,获取所述数据包中的待接入区块的交易数据,将所述数据包中待接入区块的交易数据进行哈希运算后得到哈希值,各节点使用私钥将该哈希值签名后,将签名结果进行哈希运算。If all the transaction data is valid, hash operation is performed based on the data packet and the self-stored node data, and the hash operation can be directly performed on all the content in the data packet and the self-stored node data, or the Part of the content in the data packet and the self-stored node data can be hashed, or the data packet and the self-stored node data can be pre-processed and then hashed, for example, to obtain the pending data in the data packet The transaction data into the block, the transaction data in the data packet to be connected to the block is hashed to obtain the hash value, each node uses the private key to sign the hash value, and the signature result is hashed operation.

若所述数据包中待接入区块的交易数据中,存在无效交易数据,则因为所述待接入区块的交易数据是基于末位区块的记账节点获得的,出现无效交易,则说明存在末位区块的记账节点为恶节点的可能,为减少恶节点作恶,对末位区块的记账节点进行一定惩罚。惩罚措施可以罚款,也可以剥夺记账权,需重新确定末位区块的记账节点。If there is invalid transaction data in the transaction data of the block to be accessed in the data packet, because the transaction data of the block to be accessed is obtained based on the accounting node of the last block, an invalid transaction occurs, It shows that there is a possibility that the bookkeeping node of the last block is an evil node. In order to reduce the evil of the evil node, a certain penalty is imposed on the bookkeeping node of the last block. Punishment measures can be fined or deprived of bookkeeping rights, and the bookkeeping nodes of the last block need to be re-determined.

本实施例验证该数据包中待接入区块的交易数据是否全部有效,若该数据包中所述待接入区块的交易数据全部有效,则对该数据包进行数字签名,再将该签名后的数据包进行哈希运算,得到第一候选哈希值,参与竞选;若该数据包中存在无效交易数据,则因为该数据包中的交易数据由末位区块的记账节点确定,所以,存在该末位区块的记账节点为恶节点的可能,所以该末位区块的记账节点确定的数据包无效,重新确定末位区块的记账节点,因而通过验证所述交易数据的有效性,排除恶节点作恶的可能性,还可增大恶节点的作恶成本,以降低节点作恶可能,维护区块链的正常运行;同时,基于所述数据包和各节点自存的独特的节点数据进行哈希运算,可保证获得唯一的第一候选哈希值,可保证后续唯一的目标哈希值的确定,进而成功确定待接入区块的记账节点。This embodiment verifies whether all the transaction data of the blocks to be accessed in the data packet are valid. If all the transaction data of the blocks to be accessed in the data packet are valid, the data packet is digitally signed, and then the The signed data packet is hashed to obtain the first candidate hash value and participate in the election; if there is invalid transaction data in the data packet, it is because the transaction data in the data packet is determined by the accounting node of the last block , therefore, there is a possibility that the bookkeeping node of the last block is an evil node, so the data packet determined by the bookkeeping node of the last block is invalid, and the bookkeeping node of the last block is re-determined. The validity of the above transaction data can eliminate the possibility of evil nodes doing evil, and can also increase the cost of evil nodes to reduce the possibility of nodes doing evil and maintain the normal operation of the blockchain; at the same time, based on the data packets and the nodes themselves The stored unique node data can be hashed to ensure that the only first candidate hash value can be obtained, and the subsequent unique target hash value can be determined, and then the accounting node to be connected to the block can be successfully determined.

在本发明基于抽签机制的共识建立方法第四实施例中,基于该方法的第一实施例或者第二实施例或者第三实施例,步骤S12中获取其他节点广播的第二候选哈希值的步骤之后还包括:In the fourth embodiment of the consensus establishment method based on the lottery mechanism of the present invention, based on the first embodiment or the second embodiment or the third embodiment of the method, in step S12, obtain the second candidate hash value broadcast by other nodes After the steps also include:

步骤S40,基于所述第一候选哈希值和第二候选哈希值,根据第二预设规则判断所述第一候选哈希值是否满足广播条件;Step S40, based on the first candidate hash value and the second candidate hash value, judge whether the first candidate hash value satisfies the broadcast condition according to a second preset rule;

本实施例中的第二预设规则指确定目标哈希值的规则。所述第二预设规则可以存储在区块链的特定地址上,当需要确定记账节点时可直接调用该第二预设规则。该第二预设规则可以但不限于为:选择候选哈希值中最大的候选哈希值;选择最小的候选哈希值;根据一定算法获取的唯一候选哈希值。The second preset rule in this embodiment refers to a rule for determining the target hash value. The second preset rule can be stored in a specific address of the block chain, and the second preset rule can be directly invoked when the accounting node needs to be determined. The second preset rule may be, but not limited to: select the largest candidate hash value among the candidate hash values; select the smallest candidate hash value; obtain the unique candidate hash value according to a certain algorithm.

本实施例中的广播条件需根据第二预设规则确定。例如:第二预设规则为获取候选哈希值中最大的候选哈希值,则广播条件可以为:第一候选哈希值大于第二候选哈希值。The broadcast condition in this embodiment needs to be determined according to the second preset rule. For example, if the second preset rule is to obtain the largest candidate hash value among the candidate hash values, the broadcast condition may be: the first candidate hash value is greater than the second candidate hash value.

具体地,步骤S40中根据第二预设规则判断所述第一候选哈希值是否满足广播条件这一步骤包括:Specifically, the step of judging whether the first candidate hash value satisfies the broadcast condition according to the second preset rule in step S40 includes:

步骤S41,解析第二预设规则,当解析结果为候选哈希值中的最小候选哈希值为目标哈希值时,若所述第一候选哈希值小于所述第二候选哈希值,则所述第一候选哈希值满足广播条件。Step S41, analyzing the second preset rule, when the analysis result is that the minimum candidate hash value among the candidate hash values is the target hash value, if the first candidate hash value is smaller than the second candidate hash value , then the first candidate hash value satisfies the broadcast condition.

解析第二预设规则,本实施例中,第二预设规则为:候选哈希值中最小的候选哈希值为目标哈希值,则广播条件为第一候选哈希值小于第二候选哈希值。因为,预设规则规定最小的候选哈希值为目标哈希值,所以,当第一候选哈希值大于第二候选哈希值时,该第一候选哈希值的节点不可能成功竞争到记账权,所以,该第一候选哈希值没有必要广播。(数据量减少,节省计算资源)若第一候选哈希值小于第二候选哈希值,则该第一候选哈希值的节点还有可能竞争到记账权,此时需要广播该第一候选哈希值。Analyze the second preset rule. In this embodiment, the second preset rule is: the smallest candidate hash value among the candidate hash values is the target hash value, and the broadcast condition is that the first candidate hash value is less than the second candidate hash value hash value. Because the default rule stipulates that the minimum candidate hash value is the target hash value, when the first candidate hash value is greater than the second candidate hash value, the node with the first candidate hash value cannot successfully compete to Bookkeeping rights, so the first candidate hash value does not need to be broadcast. (The amount of data is reduced, saving computing resources) If the first candidate hash value is smaller than the second candidate hash value, the node of the first candidate hash value may also compete for the accounting right, and at this time the first candidate hash value needs to be broadcast Candidate hash value.

本实施例中,由预设规则确定广播条件为第一候选哈希值小于第二候选哈希值,使得在区块链中各节点处可首先进行一轮比较,当第一候选哈希值小于第二候选哈希值,因为第一候选哈希值的节点仍旧有竞争成功的可能,所以可将该第一候选哈希值广播,该第一候选哈希值满足广播条件,可将确定目标哈希值的计算量分担给区块链中各节点,提升竞选效率。In this embodiment, the preset rule determines that the broadcast condition is that the first candidate hash value is smaller than the second candidate hash value, so that a round of comparison can be performed at each node in the blockchain first, and when the first candidate hash value is smaller than the second candidate hash value, because the node of the first candidate hash value still has the possibility of winning the competition, so the first candidate hash value can be broadcast, the first candidate hash value meets the broadcast condition, and the determination can be made The calculation of the target hash value is distributed to each node in the blockchain to improve the efficiency of the election.

步骤S42,若所述第一候选哈希值满足广播条件,则将所述第一候选哈希值向所述区块链所在的区块链网络广播。Step S42, if the first candidate hash value satisfies the broadcast condition, then broadcast the first candidate hash value to the blockchain network where the blockchain is located.

若所述第一候选哈希值满足广播条件,表明所述第一候选哈希值有可能竞争成为待接入区块的记账节点,则需要将所述第一候选哈希值向区块链所在的区块链网络广播,以参与记账节点的竞选。若所述第一候选哈希值不满足广播条件,则无需将第一候选哈希值向所述区块链所在的区块链网络广播If the first candidate hash value satisfies the broadcast condition, indicating that the first candidate hash value may compete to become the accounting node of the block to be accessed, the first candidate hash value needs to be sent to the block The blockchain network where the chain is located broadcasts to participate in the election of bookkeeping nodes. If the first candidate hash value does not meet the broadcast condition, there is no need to broadcast the first candidate hash value to the blockchain network where the blockchain is located

本实施例通过设定广播条件,在区块链各节点处就进行第一轮筛选,将竞选待接入区块记账节点有希望的节点的候选哈希值广播,可降低计算量,提升竞选效率,尽快选定待接入区块的记账节点。In this embodiment, by setting the broadcast conditions, the first round of screening is performed at each node of the blockchain, and the candidate hash values of nodes that are promising nodes to be entered into the block accounting node are broadcast, which can reduce the amount of calculation and improve Election efficiency, select the accounting nodes to be connected to the block as soon as possible.

参照图5,在本发明基于抽签机制的共识建立方法第五实施例中,基于该方法的第一实施例或者第二实施例或者第三实施例或者第四实施例,步骤S10之前包括:Referring to FIG. 5, in the fifth embodiment of the consensus establishment method based on the lottery mechanism of the present invention, based on the first embodiment or the second embodiment or the third embodiment or the fourth embodiment of the method, before step S10 includes:

步骤S50,末位区块的记账节点确定准备与末位区块连接的待接入区块的交易数据;Step S50, the accounting node of the last block determines the transaction data of the block to be connected to the last block;

步骤S51,末位区块的记账节点基于所述待接入区块的交易数据,生成数据包,将该数据包向区块链所在的区块链网络广播。Step S51, the accounting node of the last block generates a data packet based on the transaction data of the block to be accessed, and broadcasts the data packet to the blockchain network where the block chain is located.

本实施例由末位区块的记账节点确定待接入区块的交易数据及各交易的连接顺序,并基于所述待接入区块的交易数据生成数据包。本实施例中,基于所述待接入区块的交易数据生成数据包,所述数据包应该至少包含待接入区块的交易数据,数据包包括但不限于以下几种组成方式:所述数据包可以仅包含待接入区块的交易数据;可以是将待接入区块的交易数据进行哈希运算得到的哈希值与所述待接入区块的交易数据的集合;也可以是将待接入区块的交易数据与其他数据,如末位区块的特征值或扰动因子进行哈希运算得到的哈希值与所述待接入区块的交易数据的集合,其中末位区块的特征值可以指将末位区块的交易数据进行哈希运算得到的哈希值。In this embodiment, the accounting node of the last block determines the transaction data of the block to be connected and the connection sequence of each transaction, and generates a data packet based on the transaction data of the block to be connected. In this embodiment, a data packet is generated based on the transaction data of the block to be accessed. The data packet should at least contain the transaction data of the block to be accessed. The data packet includes but is not limited to the following composition methods: The data packet may only contain the transaction data of the block to be accessed; it may be a set of the hash value obtained by hashing the transaction data of the block to be accessed and the transaction data of the block to be accessed; or It is a set of the hash value obtained by hashing the transaction data of the block to be connected and other data, such as the characteristic value or disturbance factor of the last block and the transaction data of the block to be connected, where the last The feature value of a bit block may refer to a hash value obtained by hashing the transaction data of the last bit block.

生成所述数据包后,需要向区块链网络广播,以便其他节点获取。After the data packet is generated, it needs to be broadcast to the blockchain network so that other nodes can obtain it.

本实施例通过由末位区块的记账节点确定待接入区块的交易数据及各交易的连接顺序,确保了待接入区块的交易数据的唯一性,使得待接入区块顺利生成;基于待接入区块的交易数据生成数据包,向区块链网络广播,可发起待接入区块记账节点的竞选,以便顺利选出待接入区块的记账节点。In this embodiment, the transaction data of the block to be connected and the connection order of each transaction are determined by the accounting node of the last block, so as to ensure the uniqueness of the transaction data of the block to be connected, so that the block to be connected can be processed smoothly. Generate; generate a data packet based on the transaction data of the block to be connected, broadcast to the blockchain network, and initiate the election of the bookkeeping node of the block to be connected, so as to successfully select the bookkeeping node of the block to be connected.

具体地,参照图6,步骤S51包括:Specifically, referring to FIG. 6, step S51 includes:

步骤S52,末位区块的记账节点基于所述交易数据和末位区块的特征值,进行哈希运算得到第二哈希值;Step S52, the accounting node of the last block performs a hash operation to obtain a second hash value based on the transaction data and the characteristic value of the last block;

步骤S53,末位区块的记账节点基于所述交易数据、特征值和第二哈希值生成数据包,并将该数据包向所述区块链所在的区块链网络广播。Step S53, the accounting node of the last block generates a data packet based on the transaction data, the characteristic value and the second hash value, and broadcasts the data packet to the blockchain network where the blockchain is located.

本实施例确定数据包的一种组成方式,即:数据包包括待接入区块的交易数据、末位区块的特征值和第二哈希值。其中,第二哈希值指将前述待接入区块的交易数据和末位区块的特征值进行哈希运算获得的哈希值。In this embodiment, a composition mode of the data packet is determined, that is, the data packet includes the transaction data of the block to be accessed, the characteristic value of the last block, and the second hash value. Wherein, the second hash value refers to a hash value obtained by hashing the transaction data of the aforementioned block to be accessed and the feature value of the last block.

本实施例通过将基于末位区块的记账节点获得的待接入区块的交易数据和末位区块的特征值进行哈希运算,并该哈希运算值和所述末位区块的特征值、交易数据组合成数据包广播。使得区块链中各节点可基于包含了一次哈希运算的哈希值进行二次哈希运算,因为哈希运算的不可逆性,两次哈希运算可进一步增强哈希值的不可预测性,可防止末位区块的记账节点作恶;同时,本实施例将末位区块的特征值作为数据包的内容,可建立末位区块与待接入区块的联系,进而保证待接入区块与区块链的联系,将待接入区块的交易数据作为数据包的一部分,可保证待接入区块的顺利生成。In this embodiment, the transaction data of the block to be accessed obtained by the accounting node based on the last block and the characteristic value of the last block are hashed, and the hash operation value and the last block The eigenvalues and transaction data are combined into a data packet broadcast. Each node in the blockchain can perform a second hash operation based on the hash value that includes one hash operation. Because of the irreversibility of the hash operation, two hash operations can further enhance the unpredictability of the hash value. It can prevent the accounting node of the last block from doing evil; at the same time, this embodiment uses the characteristic value of the last block as the content of the data packet, and can establish the connection between the last block and the block to be connected, thereby ensuring the The connection between the input block and the blockchain, and the transaction data of the block to be accessed as part of the data package can ensure the smooth generation of the block to be accessed.

进一步的,为便于理解本方案,提出基于抽签机制的共识建立方法的第六实施例。如图7为第六实施例的场景示意图,如图8为第六实施例的流程示意图。Further, in order to facilitate the understanding of this solution, a sixth embodiment of the consensus establishment method based on the lottery mechanism is proposed. FIG. 7 is a schematic diagram of a scene of the sixth embodiment, and FIG. 8 is a schematic flowchart of the sixth embodiment.

区块链网络中,只要节点在线都可以提交自己记录的交易数据,也可以提交扰动因子或者什么都不干。图6中,A、B、C、D均为区块链网络中在线的节点,A、B均有交易数据输入,D输入扰动因子,C没有输入。图6仅示出部分节点(A\B\C\D),还包括其他未示出的节点。In the blockchain network, as long as the node is online, it can submit the transaction data recorded by itself, or submit the disturbance factor or do nothing. In Figure 6, A, B, C, and D are all online nodes in the blockchain network. Both A and B have transaction data input, D has an input disturbance factor, and C has no input. Fig. 6 only shows some nodes (A\B\C\D), and also includes other nodes not shown.

图6所示的第N区块为末位区块,后面的第N+1区块为待接入区块,中间的A、B、C、D的数据输入为待接入区块的交易数据。The Nth block shown in Figure 6 is the last block, the following N+1th block is the block to be connected, and the data input of A, B, C, and D in the middle is the transaction of the block to be connected data.

首先确定第N区块的记账节点,由第N区块的记账节点确定待接入区块的交易数据(如图6中的A、B、C、D数据输入),并将第N区块的特征值即第N区块的哈希值加上待接入区块的交易数据进行哈希运算,得到第一哈希结果,由第N区块的记账节点签名后,将所述第一哈希结果和待接入区块的交易数据向A、B、C、D节点所在的区块链网络广播。First determine the bookkeeping node of the Nth block, and the transaction data of the block to be accessed is determined by the bookkeeping node of the Nth block (as shown in A, B, C, D data input in Figure 6), and the Nth block The characteristic value of the block is the hash value of the Nth block plus the transaction data to be connected to the block for hash operation, and the first hash result is obtained. After being signed by the bookkeeping node of the Nth block, the all The first hash result and the transaction data of the block to be accessed are broadcast to the blockchain network where the A, B, C, and D nodes are located.

区块链网络中各节点接收到第N区块的记账节点广播的哈希值和待接入区块的交易数据后,验证待接入区块的交易数据是否全部有效,若全部有效,则各个节点使用自己的私钥对所述第一哈希结果进行签名,并将签名结果再次进行哈希运算,各节点均得到一个第二哈希结果(记为2HASH)。After each node in the blockchain network receives the hash value broadcast by the accounting node of the Nth block and the transaction data of the block to be connected, it verifies whether all the transaction data of the block to be connected are valid, if all are valid, Then each node signs the first hash result with its own private key, and performs a hash operation on the signature result again, and each node obtains a second hash result (denoted as 2HASH).

各节点基于所述2HASH进行抽签选举,其实现过程如下:Each node conducts lottery election based on the 2HASH, and the implementation process is as follows:

1.任意节点(比如A)首先广播自己计算2HASH-A;1. Any node (such as A) first broadcasts itself to calculate 2HASH-A;

2.其它节点(比如B)计算自己的结果2HASH-B,与2HASH-A进行比较;2. Other nodes (such as B) calculate their own result 2HASH-B and compare it with 2HASH-A;

3.如果2HASH-B<2HASH-A,则广播2HASH-B,否则不广播意味(B节点)抽签选举失败;3. If 2HASH-B<2HASH-A, then broadcast 2HASH-B, otherwise no broadcast means (B node) lottery election failure;

4.其它节点与B节点类似判断,最终选举出N+1块记账节点。4. Other nodes make similar judgments as Node B, and finally select N+1 accounting nodes.

进一步的,参照图9,为便于理解本方案,提出基于抽签机制的共识建立方法的第七实施例。Further, referring to FIG. 9 , in order to facilitate understanding of this solution, a seventh embodiment of a method for establishing a consensus based on a lottery mechanism is proposed.

步骤S50,末位区块的记账节点确定准备与末位区块连接的待接入区块的交易数据;Step S50, the accounting node of the last block determines the transaction data of the block to be connected to the last block;

步骤S52,末位区块的记账节点基于所述交易数据和末位区块的特征值,进行哈希运算得到第二哈希值;Step S52, the accounting node of the last block performs a hash operation to obtain a second hash value based on the transaction data and the characteristic value of the last block;

步骤S53,末位区块的记账节点基于所述交易数据、特征值和第二哈希值生成数据包,并将该数据包向所述区块链所在的区块链网络广播;Step S53, the accounting node of the last block generates a data packet based on the transaction data, the characteristic value and the second hash value, and broadcasts the data packet to the blockchain network where the blockchain is located;

步骤S10,确定区块链中末位区块的记账节点,基于末位区块的记账节点,获取数据包,所述数据包至少包含准备与末位区块连接的待接入区块的交易数据;Step S10, determine the bookkeeping node of the last block in the blockchain, and obtain a data packet based on the bookkeeping node of the last block, the data packet at least includes a block to be connected to the last block transaction data;

步骤S30,查询区块链中的历史交易数据;Step S30, query the historical transaction data in the block chain;

步骤S31,根据区块链中的历史交易数据,验证所述数据包中待接入区块的交易数据是否全部有效;Step S31, according to the historical transaction data in the block chain, verify whether all the transaction data in the block to be accessed in the data packet are valid;

步骤S32,若该数据包中所述待接入区块的交易数据全部有效,则执行步骤S20;Step S32, if all the transaction data of the blocks to be accessed in the data packet are valid, execute step S20;

步骤S33,若该数据包中所述待接入区块的交易数据中存在无效交易数据,则所述数据包无效,重新确定末位区块的记账节点;Step S33, if there is invalid transaction data in the transaction data of the block to be accessed in the data packet, the data packet is invalid, and the accounting node of the last block is re-determined;

步骤S20,获取所述数据包中待接入区块的交易数据,基于该交易数据和末位区块的特征值进行哈希运算,得到第一哈希值;Step S20, obtaining the transaction data of the block to be accessed in the data packet, and performing a hash operation based on the transaction data and the characteristic value of the last block to obtain a first hash value;

步骤S21,基于自存的私钥对所述第一哈希值进行签名,将签名后的所述第一哈希值进行哈希运算,得到第一候选哈希值;Step S21, signing the first hash value based on the self-stored private key, and performing a hash operation on the signed first hash value to obtain a first candidate hash value;

步骤S121,获取其他节点广播的第二候选哈希值,Step S121, obtaining the second candidate hash value broadcast by other nodes,

步骤S41,基于所述第一候选哈希值和第二候选哈希值,解析第二预设规则,当解析结果为候选哈希值中的最小候选哈希值为目标哈希值时,若所述第一候选哈希值小于所述第二候选哈希值,则所述第一候选哈希值满足广播条件;Step S41, analyzing the second preset rule based on the first candidate hash value and the second candidate hash value, when the result of the analysis is the target hash value of the minimum candidate hash value among the candidate hash values, if If the first candidate hash value is smaller than the second candidate hash value, the first candidate hash value satisfies the broadcast condition;

步骤S42,若所述第一候选哈希值满足广播条件,则将所述第一候选哈希值向所述区块链所在的区块链网络广播;Step S42, if the first candidate hash value satisfies the broadcast condition, then broadcast the first candidate hash value to the blockchain network where the blockchain is located;

步骤S13,在所述第一候选哈希值和第二候选哈希值中确定最小的候选哈希值,该最小候选哈希值为目标哈希值;Step S13, determining the smallest candidate hash value among the first candidate hash value and the second candidate hash value, the smallest candidate hash value being a target hash value;

步骤S123,该目标哈希值的节点为所述待接入区块的记账节点。Step S123, the node of the target hash value is the accounting node of the block to be accessed.

此外,本发明实施例还提出一种存储介质,所述存储介质上存储有基于抽签机制的共识建立程序,所述基于抽签机制的共识建立程序被处理器执行时实现如上述实施例所述的步骤。因本发明存储介质的具体实施例同上述身份认证方法的各个实施例基本相同,在此不做赘述。In addition, the embodiment of the present invention also proposes a storage medium, on which a consensus establishment program based on a lottery mechanism is stored, and when the consensus establishment program based on a lottery mechanism is executed by a processor, the above-mentioned embodiment can be implemented. step. Since the specific embodiments of the storage medium of the present invention are basically the same as the embodiments of the above-mentioned identity authentication method, details are not described here.

需要说明的是,本发明所有实施例所述的技术特征中的某些特征之间可相互组合。It should be noted that some of the technical features described in all the embodiments of the present invention can be combined with each other.

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

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to make a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present invention.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in other related technical fields , are all included in the scope of patent protection of the present invention in the same way.

Claims (10)

  1. A kind of 1. common recognition method for building up based on lottery mechanism, it is characterised in that including:
    The accounting nodes of last position block in block chain are determined, based on the accounting nodes of last position block, obtain packet, the data Bag comprises at least the transaction data for the block to be accessed for preparing to be connected with last position block;
    The packet and this node based on acquisition carry out Hash operation and obtain first candidate's Hash from the node data deposited Value;
    Second candidate's cryptographic Hash of other node broadcasts is obtained, according to the first preset rules in the first candidate cryptographic Hash and Selection target cryptographic Hash in two candidate's cryptographic Hash, the node of the target cryptographic Hash are the accounting nodes of the block to be accessed.
  2. 2. the common recognition method for building up based on lottery mechanism as claimed in claim 1, it is characterised in that described according to preset rules Include in first candidate's cryptographic Hash and second candidate's cryptographic Hash the step of selection target cryptographic Hash:
    Candidate's cryptographic Hash of minimum, minimum candidate's Hash are determined in the first candidate cryptographic Hash and second candidate's cryptographic Hash It is worth for target cryptographic Hash.
  3. 3. the common recognition method for building up based on lottery mechanism as claimed in claim 1, it is characterised in that the institute based on acquisition Packet and this node are stated from the node data deposited, carrying out the step of Hash operation obtains first candidate's cryptographic Hash includes:
    The transaction data of block to be accessed in the packet is obtained, is carried out based on the characteristic value of the transaction data and last position block Hash operation, obtain the first cryptographic Hash;
    First cryptographic Hash is signed based on the private key deposited certainly, first cryptographic Hash after signature is subjected to Hash fortune Calculate, obtain first candidate's cryptographic Hash.
  4. 4. the common recognition method for building up based on lottery mechanism as claimed in claim 1, it is characterised in that the acquisition packet Also include after step:
    Whether according to the historical trading data in block chain, verifying the transaction data of block to be accessed in the packet all has Effect;
    If the transaction data of block to be accessed is all effective described in the packet, the data based on acquisition are performed Bag and this node carry out the step for Hash operation obtains first candidate's cryptographic Hash from the node data deposited.
  5. 5. the common recognition method for building up based on lottery mechanism as claimed in claim 1, it is characterised in that described other nodes of acquisition Also include after the step of second candidate's cryptographic Hash of broadcast:
    Based on the first candidate cryptographic Hash and second candidate's cryptographic Hash, judge that first candidate breathes out according to the second preset rules Whether uncommon value meets broadcast conditional;
    If the first candidate cryptographic Hash meets broadcast conditional, by where the first candidate cryptographic Hash to the block chain Block chain network is broadcasted.
  6. 6. the common recognition method for building up based on lottery mechanism as claimed in claim 5, it is characterised in that described default according to second The step of whether first candidate's cryptographic Hash meets broadcast conditional described in rule judgment includes:
    The second preset rules are parsed, when analysis result is that minimum candidate's cryptographic Hash in candidate's cryptographic Hash is target cryptographic Hash, If the first candidate cryptographic Hash is less than the second candidate cryptographic Hash, the first candidate cryptographic Hash meets broadcast conditional.
  7. 7. the common recognition method for building up based on lottery mechanism as claimed in claim 1, it is characterised in that in the determination block chain The accounting nodes of last position block, based on the accounting nodes of last position block, include before the step of obtaining packet:
    The accounting nodes of the last position block determine the transaction data for the block to be accessed that preparation is connected with last position block;
    The transaction data of the accounting nodes of last position block based on the block to be accessed, packet is generated, by the packet Broadcasted to the block chain network where block chain.
  8. 8. the common recognition method for building up based on lottery mechanism as claimed in claim 7, it is characterised in that the note of the last position block Transaction data of the account node based on the block to be accessed, packet is generated, by the packet to the block chain where block chain The step of Web broadcast, includes:
    Characteristic value of the accounting nodes of the last position block based on the transaction data and last position block, carry out Hash operation and obtain Second cryptographic Hash;
    The accounting nodes of the last position block are based on the transaction data, characteristic value and the second cryptographic Hash generation packet, and will The packet is broadcasted to the block chain network where the block chain.
  9. 9. a kind of block catenary system, it is characterised in that the block catenary system includes multiple nodes, and the node includes:Storage Device, processor and it is stored in the common recognition based on lottery mechanism that can be run on the memory and on the processor and establishes journey Sequence, the common recognition based on lottery mechanism are established program and realized during the computing device such as any one of claim 1 to 8 The step of described method.
  10. 10. a kind of storage medium, it is characterised in that the common recognition based on lottery mechanism is stored with the storage medium and establishes journey Sequence, the common recognition based on lottery mechanism are established and realized when program is executed by processor as any one of claim 1 to 8 The common recognition method for building up based on lottery mechanism the step of.
CN201710737728.6A 2017-08-24 2017-08-24 Hash operation-based consensus establishing method, block chain system and storage medium Active CN107566124B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710737728.6A CN107566124B (en) 2017-08-24 2017-08-24 Hash operation-based consensus establishing method, block chain system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710737728.6A CN107566124B (en) 2017-08-24 2017-08-24 Hash operation-based consensus establishing method, block chain system and storage medium

Publications (2)

Publication Number Publication Date
CN107566124A true CN107566124A (en) 2018-01-09
CN107566124B CN107566124B (en) 2020-06-19

Family

ID=60976700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710737728.6A Active CN107566124B (en) 2017-08-24 2017-08-24 Hash operation-based consensus establishing method, block chain system and storage medium

Country Status (1)

Country Link
CN (1) CN107566124B (en)

Cited By (46)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108269090A (en) * 2018-01-19 2018-07-10 中国科学院软件研究所 Based on the common recognition method and apparatus for block catenary system drawn lots at random without negotiation
CN108335208A (en) * 2018-02-28 2018-07-27 北京京东尚科信息技术有限公司 Method and apparatus for handling information
CN108512652A (en) * 2018-04-02 2018-09-07 陆雷钦 Decentralization common recognition method, system and block catenary system based on time-proven
CN108509615A (en) * 2018-03-30 2018-09-07 深圳市元征科技股份有限公司 Common recognition method for building up, device and readable storage medium storing program for executing based on lottery mechanism
CN108596621A (en) * 2018-04-28 2018-09-28 深圳市优学链科技有限公司 Block chain accounting nodes generation method, device, computer equipment and storage medium
CN108616363A (en) * 2018-05-11 2018-10-02 北京奇虎科技有限公司 A kind of book keeping operation power confirmation method, device and computer storage media
CN108615151A (en) * 2018-04-24 2018-10-02 深圳市元征科技股份有限公司 Data processing method, block chain server and node device
CN108712486A (en) * 2018-05-11 2018-10-26 北京奇虎科技有限公司 Proof of work method and device
CN108737375A (en) * 2018-04-13 2018-11-02 中山大学 A kind of block chain common recognition method and system
CN108804706A (en) * 2018-06-20 2018-11-13 南方科技大学 Block chain data processing method, device, equipment and storage medium
CN108881287A (en) * 2018-07-18 2018-11-23 电子科技大学 A kind of Internet of things node identity identifying method based on block chain
CN108961017A (en) * 2018-06-21 2018-12-07 中科新松有限公司 A kind of block chain common recognition mechanism and the block catenary system based on the common recognition mechanism
CN108984662A (en) * 2018-06-28 2018-12-11 杭州复杂美科技有限公司 A kind of block chain method of data synchronization
CN108985772A (en) * 2018-07-02 2018-12-11 上海达家迎信息科技有限公司 A kind of verification method, device, equipment and the storage medium of block chain
CN109067516A (en) * 2018-07-20 2018-12-21 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN109102287A (en) * 2018-08-13 2018-12-28 中国联合网络通信集团有限公司 Block chain bookkeeping methods, device, equipment and storage medium
CN109246084A (en) * 2018-08-13 2019-01-18 中国联合网络通信集团有限公司 New block generation method, device, electronic equipment and storage medium
CN109360091A (en) * 2018-08-30 2019-02-19 阿里巴巴集团控股有限公司 A kind of arbitrary object choosing method and device based on block chain
CN109391684A (en) * 2018-09-25 2019-02-26 莆田市烛火信息技术有限公司 A kind of block chain accounting nodes selection method and system being associated with related chain
CN109472594A (en) * 2018-10-11 2019-03-15 平安科技(深圳)有限公司 Car data sharing method, device, equipment and storage medium based on block chain
CN109525648A (en) * 2018-10-26 2019-03-26 全链通有限公司 Block chain common recognition mechanism, equipment and computer readable storage medium
CN109684519A (en) * 2018-12-12 2019-04-26 杭州基尔区块链科技有限公司 A kind of decentralization chip research and development transaction data storage method and system based on block chain
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
CN110223436A (en) * 2019-06-13 2019-09-10 北京艾摩瑞策科技有限公司 A kind of lottery ticket of application block chain is extra-large method and apparatus at random
CN110223438A (en) * 2019-06-13 2019-09-10 北京艾摩瑞策科技有限公司 A kind of lottery ticket of application block chain is extra-large method and its equipment at random
CN110233722A (en) * 2019-06-17 2019-09-13 北京艾摩瑞策科技有限公司 Go out block method and device on block chain
CN110383279A (en) * 2018-12-29 2019-10-25 阿里巴巴集团控股有限公司 System and method for detecting Replay Attack
CN110545170A (en) * 2019-09-16 2019-12-06 福建中科中欣智能科技有限公司 Block chain consensus method, device and equipment based on password drawing
CN110647582A (en) * 2019-09-17 2020-01-03 腾讯科技(深圳)有限公司 Method and device for block chain network consensus checking, storage medium and computer equipment
CN110880968A (en) * 2018-09-05 2020-03-13 元一科技控股有限公司 Block transmission and recording method and device and computer storage medium
CN110941613A (en) * 2019-11-19 2020-03-31 北京工业大学 Blockchain consensus method, apparatus and electronic device
CN110958317A (en) * 2019-11-29 2020-04-03 腾讯科技(深圳)有限公司 Data processing method and equipment
CN111008835A (en) * 2018-10-08 2020-04-14 上海派链信息科技有限公司 Method, apparatus, computer-readable storage medium and computer program product for determining transaction verification node of blockchain
CN111104678A (en) * 2018-10-25 2020-05-05 北京国盾量子信息技术有限公司 Block chain consensus method and device
CN111177263A (en) * 2019-12-27 2020-05-19 中思博安科技(北京)有限公司 Block chain consensus method and node
CN111178885A (en) * 2019-12-18 2020-05-19 达闼科技成都有限公司 Data processing method and device based on block chain, data processing equipment and system
CN111292187A (en) * 2020-01-20 2020-06-16 深圳市万向信息科技有限公司 Block chain bookkeeping person qualification competition selection method
CN111314436A (en) * 2020-01-20 2020-06-19 柏建华 Hierarchical block chain system and implementation method
CN111327436A (en) * 2018-12-13 2020-06-23 北京果仁宝软件技术有限责任公司 Method, device and system for predicting block link-out block node of block
CN111431696A (en) * 2020-03-26 2020-07-17 深圳市欧欣泰科技有限公司 Identity-based block chain sealing mechanism
CN111597264A (en) * 2020-05-15 2020-08-28 中国联合网络通信集团有限公司 Block chain accounting method and device
CN111786772A (en) * 2019-12-10 2020-10-16 深圳启元信息服务有限公司 Non-deterministic selection method and system based on block chain determination and storage medium
CN111815845A (en) * 2020-07-08 2020-10-23 中钞信用卡产业发展有限公司杭州区块链技术研究院 Shaking method, device, system, equipment and medium based on heterogeneous block chain
CN112262422A (en) * 2018-04-13 2021-01-22 比特飞翔区块链株式会社 Block chain network and determination method therefor
CN112491935A (en) * 2019-08-20 2021-03-12 厦门本能管家科技有限公司 Water wave type broadcasting method and system for block chain
CN115687507A (en) * 2021-07-27 2023-02-03 深圳中经量子科技有限公司 Consensus computing method, system and storage medium suitable for block chain operating system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106385319A (en) * 2016-09-29 2017-02-08 江苏通付盾科技有限公司 Verification method for information in block chain network and verification system thereof
CN106411503A (en) * 2016-11-28 2017-02-15 中国银行股份有限公司 Accounting method, accounting system, voting node and accounting node under block chain voting and accounting mode
CN106790431A (en) * 2016-12-05 2017-05-31 同济大学 Cloud manufacturing service Transaction Information record system and method based on block chain
CN106789908A (en) * 2016-11-23 2017-05-31 江苏通付盾科技有限公司 Block common recognition method for building up and system in block chain
CN106850536A (en) * 2016-11-30 2017-06-13 北京瑞卓喜投科技发展有限公司 Block chain common recognition method and system
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN107078910A (en) * 2016-12-23 2017-08-18 深圳前海达闼云端智能科技有限公司 Method, device, node, signature device and system for generating blockchain blocks

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106385319A (en) * 2016-09-29 2017-02-08 江苏通付盾科技有限公司 Verification method for information in block chain network and verification system thereof
CN106789908A (en) * 2016-11-23 2017-05-31 江苏通付盾科技有限公司 Block common recognition method for building up and system in block chain
CN106411503A (en) * 2016-11-28 2017-02-15 中国银行股份有限公司 Accounting method, accounting system, voting node and accounting node under block chain voting and accounting mode
CN106850536A (en) * 2016-11-30 2017-06-13 北京瑞卓喜投科技发展有限公司 Block chain common recognition method and system
CN106790431A (en) * 2016-12-05 2017-05-31 同济大学 Cloud manufacturing service Transaction Information record system and method based on block chain
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN107078910A (en) * 2016-12-23 2017-08-18 深圳前海达闼云端智能科技有限公司 Method, device, node, signature device and system for generating blockchain blocks

Cited By (73)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108269090A (en) * 2018-01-19 2018-07-10 中国科学院软件研究所 Based on the common recognition method and apparatus for block catenary system drawn lots at random without negotiation
CN108269090B (en) * 2018-01-19 2021-04-20 中国科学院软件研究所 Consensus method and device for block chain system based on non-negotiation random drawing
CN108335208A (en) * 2018-02-28 2018-07-27 北京京东尚科信息技术有限公司 Method and apparatus for handling information
CN108335208B (en) * 2018-02-28 2022-11-08 北京京东尚科信息技术有限公司 Method and apparatus for processing information
CN108509615A (en) * 2018-03-30 2018-09-07 深圳市元征科技股份有限公司 Common recognition method for building up, device and readable storage medium storing program for executing based on lottery mechanism
CN108512652A (en) * 2018-04-02 2018-09-07 陆雷钦 Decentralization common recognition method, system and block catenary system based on time-proven
CN108737375B (en) * 2018-04-13 2021-01-19 中山大学 A blockchain consensus method and system
CN108737375A (en) * 2018-04-13 2018-11-02 中山大学 A kind of block chain common recognition method and system
CN112262422A (en) * 2018-04-13 2021-01-22 比特飞翔区块链株式会社 Block chain network and determination method therefor
CN108615151A (en) * 2018-04-24 2018-10-02 深圳市元征科技股份有限公司 Data processing method, block chain server and node device
CN108596621A (en) * 2018-04-28 2018-09-28 深圳市优学链科技有限公司 Block chain accounting nodes generation method, device, computer equipment and storage medium
CN108596621B (en) * 2018-04-28 2020-10-27 三亚京牛数字科技有限公司 Block chain accounting node generation method and device, computer equipment and storage medium
CN108616363B (en) * 2018-05-11 2021-08-06 北京奇虎科技有限公司 A kind of accounting right confirmation method, device and computer storage medium
CN108712486A (en) * 2018-05-11 2018-10-26 北京奇虎科技有限公司 Proof of work method and device
CN108616363A (en) * 2018-05-11 2018-10-02 北京奇虎科技有限公司 A kind of book keeping operation power confirmation method, device and computer storage media
CN108804706A (en) * 2018-06-20 2018-11-13 南方科技大学 Block chain data processing method, device, equipment and storage medium
CN108804706B (en) * 2018-06-20 2020-09-18 南方科技大学 A block chain data processing method, device, equipment and storage medium
CN108961017A (en) * 2018-06-21 2018-12-07 中科新松有限公司 A kind of block chain common recognition mechanism and the block catenary system based on the common recognition mechanism
CN108984662A (en) * 2018-06-28 2018-12-11 杭州复杂美科技有限公司 A kind of block chain method of data synchronization
CN108985772A (en) * 2018-07-02 2018-12-11 上海达家迎信息科技有限公司 A kind of verification method, device, equipment and the storage medium of block chain
CN108881287A (en) * 2018-07-18 2018-11-23 电子科技大学 A kind of Internet of things node identity identifying method based on block chain
CN109067516A (en) * 2018-07-20 2018-12-21 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN109246084A (en) * 2018-08-13 2019-01-18 中国联合网络通信集团有限公司 New block generation method, device, electronic equipment and storage medium
CN109246084B (en) * 2018-08-13 2021-07-27 中国联合网络通信集团有限公司 New block generation method, device, electronic device and storage medium
CN109102287B (en) * 2018-08-13 2021-09-07 中国联合网络通信集团有限公司 Blockchain accounting method, device, equipment and storage medium
CN109102287A (en) * 2018-08-13 2018-12-28 中国联合网络通信集团有限公司 Block chain bookkeeping methods, device, equipment and storage medium
CN109360091A (en) * 2018-08-30 2019-02-19 阿里巴巴集团控股有限公司 A kind of arbitrary object choosing method and device based on block chain
CN109360091B (en) * 2018-08-30 2020-09-01 阿里巴巴集团控股有限公司 Random object selection method and device based on block chain
WO2020042775A1 (en) * 2018-08-30 2020-03-05 阿里巴巴集团控股有限公司 Blockchain-based random object selection method and device
CN110880968A (en) * 2018-09-05 2020-03-13 元一科技控股有限公司 Block transmission and recording method and device and computer storage medium
CN109391684A (en) * 2018-09-25 2019-02-26 莆田市烛火信息技术有限公司 A kind of block chain accounting nodes selection method and system being associated with related chain
CN109391684B (en) * 2018-09-25 2021-04-23 莆田市烛火信息技术有限公司 A method and system for selecting a blockchain accounting node associated with a related chain
CN111008835A (en) * 2018-10-08 2020-04-14 上海派链信息科技有限公司 Method, apparatus, computer-readable storage medium and computer program product for determining transaction verification node of blockchain
CN111008835B (en) * 2018-10-08 2024-05-28 上海派链信息科技有限公司 Method, apparatus, computer readable storage medium and computer program product for determining a transaction verification node of a blockchain
CN109472594A (en) * 2018-10-11 2019-03-15 平安科技(深圳)有限公司 Car data sharing method, device, equipment and storage medium based on block chain
CN109472594B (en) * 2018-10-11 2023-11-28 平安科技(深圳)有限公司 Block chain-based automobile data sharing method, device, equipment and storage medium
CN111104678A (en) * 2018-10-25 2020-05-05 北京国盾量子信息技术有限公司 Block chain consensus method and device
CN111104678B (en) * 2018-10-25 2022-03-18 北京国盾量子信息技术有限公司 Block chain consensus method and device
CN109525648A (en) * 2018-10-26 2019-03-26 全链通有限公司 Block chain common recognition mechanism, equipment and computer readable storage medium
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
CN109684519B (en) * 2018-12-12 2020-04-03 杭州基尔区块链科技有限公司 Decentralized chip research and development transaction data storage method and system based on block chain
CN109684519A (en) * 2018-12-12 2019-04-26 杭州基尔区块链科技有限公司 A kind of decentralization chip research and development transaction data storage method and system based on block chain
CN111327436B (en) * 2018-12-13 2023-04-07 北京果仁宝软件技术有限责任公司 Method, device and system for predicting block link-out block node of block
CN111327436A (en) * 2018-12-13 2020-06-23 北京果仁宝软件技术有限责任公司 Method, device and system for predicting block link-out block node of block
CN110383279A (en) * 2018-12-29 2019-10-25 阿里巴巴集团控股有限公司 System and method for detecting Replay Attack
CN110383279B (en) * 2018-12-29 2024-03-15 创新先进技术有限公司 System and method for detecting replay attacks
CN110223436B (en) * 2019-06-13 2020-12-25 北京瑞策科技有限公司 Lottery random number issuing method and device applying block chain
CN110223438A (en) * 2019-06-13 2019-09-10 北京艾摩瑞策科技有限公司 A kind of lottery ticket of application block chain is extra-large method and its equipment at random
CN110223436A (en) * 2019-06-13 2019-09-10 北京艾摩瑞策科技有限公司 A kind of lottery ticket of application block chain is extra-large method and apparatus at random
CN110233722A (en) * 2019-06-17 2019-09-13 北京艾摩瑞策科技有限公司 Go out block method and device on block chain
CN112491935A (en) * 2019-08-20 2021-03-12 厦门本能管家科技有限公司 Water wave type broadcasting method and system for block chain
CN110545170A (en) * 2019-09-16 2019-12-06 福建中科中欣智能科技有限公司 Block chain consensus method, device and equipment based on password drawing
CN110647582A (en) * 2019-09-17 2020-01-03 腾讯科技(深圳)有限公司 Method and device for block chain network consensus checking, storage medium and computer equipment
CN110647582B (en) * 2019-09-17 2024-01-02 腾讯科技(深圳)有限公司 Method, device, storage medium and computer equipment for block chain network consensus verification
CN110941613A (en) * 2019-11-19 2020-03-31 北京工业大学 Blockchain consensus method, apparatus and electronic device
CN110941613B (en) * 2019-11-19 2023-07-18 北京工业大学 Block chain consensus method, device and electronic equipment
CN110958317B (en) * 2019-11-29 2022-08-09 腾讯科技(深圳)有限公司 Data processing method and equipment
CN110958317A (en) * 2019-11-29 2020-04-03 腾讯科技(深圳)有限公司 Data processing method and equipment
CN111786772A (en) * 2019-12-10 2020-10-16 深圳启元信息服务有限公司 Non-deterministic selection method and system based on block chain determination and storage medium
CN111786772B (en) * 2019-12-10 2024-05-07 北京铭泰恒通信息技术有限公司 Non-deterministic selection method, system and storage medium based on determination of blockchain
CN111178885A (en) * 2019-12-18 2020-05-19 达闼科技成都有限公司 Data processing method and device based on block chain, data processing equipment and system
CN111178885B (en) * 2019-12-18 2023-08-04 达闼机器人股份有限公司 Block chain-based data processing method, device, data processing equipment and system
CN111177263A (en) * 2019-12-27 2020-05-19 中思博安科技(北京)有限公司 Block chain consensus method and node
CN111314436A (en) * 2020-01-20 2020-06-19 柏建华 Hierarchical block chain system and implementation method
CN111292187B (en) * 2020-01-20 2023-08-22 深圳市万向信息科技有限公司 Blockchain billing personnel qualification competitive choice method
CN111292187A (en) * 2020-01-20 2020-06-16 深圳市万向信息科技有限公司 Block chain bookkeeping person qualification competition selection method
CN111431696A (en) * 2020-03-26 2020-07-17 深圳市欧欣泰科技有限公司 Identity-based block chain sealing mechanism
CN111431696B (en) * 2020-03-26 2023-10-17 深圳市欧欣泰科技有限公司 Block chain seal mechanism based on identity
CN111597264B (en) * 2020-05-15 2023-06-23 中国联合网络通信集团有限公司 A blockchain bookkeeping method and device
CN111597264A (en) * 2020-05-15 2020-08-28 中国联合网络通信集团有限公司 Block chain accounting method and device
CN111815845B (en) * 2020-07-08 2022-03-15 中钞信用卡产业发展有限公司杭州区块链技术研究院 Shaking method, device, system, equipment and medium based on heterogeneous block chain
CN111815845A (en) * 2020-07-08 2020-10-23 中钞信用卡产业发展有限公司杭州区块链技术研究院 Shaking method, device, system, equipment and medium based on heterogeneous block chain
CN115687507A (en) * 2021-07-27 2023-02-03 深圳中经量子科技有限公司 Consensus computing method, system and storage medium suitable for block chain operating system

Also Published As

Publication number Publication date
CN107566124B (en) 2020-06-19

Similar Documents

Publication Publication Date Title
CN107566124B (en) Hash operation-based consensus establishing method, block chain system and storage medium
US11687562B2 (en) Apparatus and method for adaptively managing sharded blockchain network based on deep Q network
CN108876365B (en) Intelligent contract for generating block release mechanism
US20200059369A1 (en) Determining consensus by parallel proof of voting in consortium blockchain
CN110300172A (en) A kind of the common recognition method and relevant device of block chain data
US11157899B1 (en) System and method for bootstrapping a separate proof of work chain
CN108769163B (en) Consortium chain consensus reaching method, device and computer-readable storage medium
CN113037824B (en) A construction method of high-performance blockchain for cloud computing
CN108243250B (en) A method for fast selection of shards based on distributed network
US11354629B1 (en) Controlling initiation of a blockchain election using a burn quota
CN111683121B (en) Cloud data tracing source block chain consensus mechanism improvement method based on DPoS
US11062280B1 (en) Network consensus-based data processing
CN109005220A (en) The service implementation method and access gateway of internet of things of internet-of-things terminal
US11290280B1 (en) Cryptocurrency mining using a single-leader election algorithm
CN113282418A (en) Model aggregation processing method and device
CN110990790B (en) Data processing method and equipment
Guo et al. Calculation and selection scheme of node reputation values for notary mechanism in cross-chain
KR102610530B1 (en) A neural consensus node apparatus for using a non-random consensus proof-based blockchain network as a random consensus proof-based blockchain network, and its operation method
KR102610531B1 (en) A neural consensus proof based block chain network platform system constructed by using a non-random consensus proof-based blockchain network
Xu et al. Research on transaction allocation strategy in blockchain state sharding
US11515999B1 (en) Systems and methods for selectively processing blockchain data
CN111222885B (en) Data processing request endorsement method and device, computer equipment and storage medium
CN114372588B (en) A method for selecting a consensus node and related device
KR102628770B1 (en) A Neural consensus-based blockchain network system that performs random consensus proof using non-random consensus proof-based blockchain network
CN112583798B (en) Method, device and related product for screening common identification nodes from block chain system

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Consensus building method, blockchain system and storage medium based on hash operation

Effective date of registration: 20210520

Granted publication date: 20200619

Pledgee: Shenzhen Longgang sub branch of Agricultural Bank of China Ltd.

Pledgor: SHENZHEN ECHIEV AUTONOMOUS DRIVING TECHNOLOGY Co.,Ltd.

Registration number: Y2021980003808

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20220607

Granted publication date: 20200619

Pledgee: Shenzhen Longgang sub branch of Agricultural Bank of China Ltd.

Pledgor: SHENZHEN ECHIEV AUTONOMOUS DRIVING TECHNOLOGY Co.,Ltd.

Registration number: Y2021980003808

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Consensus building method, blockchain system and storage medium based on hash operation

Granted publication date: 20200619

Pledgee: Bank of Guangzhou Co.,Ltd. Shenzhen Huaqiang Sub Branch

Pledgor: SHENZHEN ECHIEV AUTONOMOUS DRIVING TECHNOLOGY Co.,Ltd.

Registration number: Y2025980031323

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