[go: up one dir, main page]

CN112865959A - Consensus method of distributed node equipment, node equipment and distributed network - Google Patents

Consensus method of distributed node equipment, node equipment and distributed network Download PDF

Info

Publication number
CN112865959A
CN112865959A CN202011630328.3A CN202011630328A CN112865959A CN 112865959 A CN112865959 A CN 112865959A CN 202011630328 A CN202011630328 A CN 202011630328A CN 112865959 A CN112865959 A CN 112865959A
Authority
CN
China
Prior art keywords
information
node device
number value
transaction information
slave node
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
CN202011630328.3A
Other languages
Chinese (zh)
Other versions
CN112865959B (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.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian 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 Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202011630328.3A priority Critical patent/CN112865959B/en
Priority to PCT/CN2021/073329 priority patent/WO2022141700A1/en
Publication of CN112865959A publication Critical patent/CN112865959A/en
Application granted granted Critical
Publication of CN112865959B publication Critical patent/CN112865959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请适用于分布式网络技术领域,提供了一种分布式节点设备的共识方法、节点设备、分布式网络及介质,其中,共识方法包括:在可信执行环境中对客户端发送的交易信息进行编号,并向各个从节点设备广播该交易信息以及该交易信息的编号值;在接收到第一预设数目个从节点设备返回的针对该编号值的确认信息时提交该交易信息;确认信息为从节点设备在确定该交易信息的编号值未被其他交易信息占用时生成;在可信执行环境中基于第一预设数目个确认信息生成针对该编号值的共识信息,并向各个从节点设备广播该共识信息;共识信息用于在被从节点设备确认有效后指示从节点设备提交交易信息,通信复杂度较低,且可以避免共识过程中节点作恶情况的发生。

Figure 202011630328

This application is applicable to the technical field of distributed networks, and provides a consensus method for distributed node devices, node devices, distributed networks and media, wherein the consensus method includes: transaction information sent to a client in a trusted execution environment Carry out numbering, and broadcast the transaction information and the numbered value of the transaction information to each slave node device; submit the transaction information when receiving the confirmation information for the numbered value returned by the first preset number of slave node devices; confirmation information It is generated when the slave node device determines that the serial number value of the transaction information is not occupied by other transaction information; in the trusted execution environment, based on the first preset number of confirmation information, consensus information for the serial number value is generated and sent to each slave node. The device broadcasts the consensus information; the consensus information is used to instruct the slave node device to submit transaction information after it is confirmed as valid by the slave node device. The communication complexity is low, and the occurrence of malicious nodes in the consensus process can be avoided.

Figure 202011630328

Description

分布式节点设备的共识方法、节点设备及分布式网络Consensus method for distributed node device, node device and distributed network

技术领域technical field

本申请属于分布式网络技术领域,尤其涉及一种分布式节点设备的共识方法、节点设备、分布式网络及计算机可读存储介质。The present application belongs to the technical field of distributed networks, and in particular, relates to a consensus method for distributed node devices, node devices, distributed networks, and computer-readable storage media.

背景技术Background technique

共识算法是分布式网络中各个节点设备之间保持一致性的基础。随着分布式网络技术的快速发展,现有技术针对不同的分布式网络提出了不同的共识算法。例如,针对包含故障节点的分布式网络提出故障容错(Crash Fault Tolerance,CFT)共识算法,针对包含故障节点以及作恶节点的分布式网络提出拜占庭容错(Byzantine Fault Tolerance)共识算法。The consensus algorithm is the basis for maintaining consistency among various node devices in a distributed network. With the rapid development of distributed network technology, the prior art proposes different consensus algorithms for different distributed networks. For example, a Crash Fault Tolerance (CFT) consensus algorithm is proposed for a distributed network containing faulty nodes, and a Byzantine Fault Tolerance (Byzantine Fault Tolerance) consensus algorithm is proposed for a distributed network containing faulty nodes and malicious nodes.

不同共识算法对应的节点设备之间的共识过程以及通信复杂度均不同。例如,节点设备基于BFT共识算法进行共识时,每个节点设备均需要与其他各个节点设备均进行通信;而节点设备基于CFT共识算法进行共识时,每个从节点设备只需要与主节点设备进行通信即可,可见,节点设备基于BFT共识算法进行共识时的通信复杂度远高于节点设备基于CFT共识算法进行共识时的通信复杂度,然而,虽然节点设备基于CFT共识算法进行共识时的通信复杂度较低,但节点设备基于CFT共识算法进行共识时无法解决节点作恶问题。The consensus process and communication complexity between node devices corresponding to different consensus algorithms are different. For example, when node devices perform consensus based on the BFT consensus algorithm, each node device needs to communicate with other node devices; and when node devices perform consensus based on the CFT consensus algorithm, each slave node device only needs to communicate with the master node device. Communication is enough. It can be seen that the communication complexity of node devices based on BFT consensus algorithm is much higher than that of node devices based on CFT consensus algorithm. However, although the communication complexity of node devices based on CFT consensus algorithm is consensus The complexity is low, but the node device cannot solve the problem of node evil when consensus is based on the CFT consensus algorithm.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请实施例提供了一种分布式节点设备的共识方法、节点设备、分布式网络及计算机可读存储介质,以解决现有的分布式节点设备的共识方法无法解决节点作恶问题或者通信复杂度较高的技术问题。In view of this, the embodiments of the present application provide a consensus method for distributed node devices, a node device, a distributed network, and a computer-readable storage medium, so as to solve the problem that the existing consensus methods of distributed node devices cannot solve the problem of malicious nodes Or technical problems with high communication complexity.

第一方面,本申请实施例提供一种分布式节点设备的共识方法,应用于分布式网络中的主节点设备,所述共识方法包括:In a first aspect, an embodiment of the present application provides a consensus method for distributed node devices, which is applied to master node devices in a distributed network. The consensus method includes:

在可信执行环境中对客户端发送的交易信息进行编号,并向各个从节点设备广播所述交易信息以及所述交易信息的编号值;Number the transaction information sent by the client in the trusted execution environment, and broadcast the transaction information and the number value of the transaction information to each slave node device;

在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息;所述确认信息为所述从节点设备在确定所述交易信息的编号值未被其他交易信息占用时返回的;Submit the transaction information when receiving a first preset number of confirmation information for the serial number value returned by the slave node device; the confirmation information is the serial number value of the transaction information determined by the slave node device Returned when it is not occupied by other transaction information;

在所述可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息;所述共识信息在被所述从节点设备确认有效后指示所述从节点设备提交所述交易信息。In the trusted execution environment, consensus information for the number value is generated based on the first preset number of the confirmation information, and the consensus information is broadcast to each of the slave node devices; the consensus information is in After being confirmed as valid by the slave node device, the slave node device is instructed to submit the transaction information.

可选的,所述在可信执行环境中对客户端发送的交易信息进行编号之后,所述共识方法还包括:Optionally, after the transaction information sent by the client is numbered in the trusted execution environment, the consensus method further includes:

在所述可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名;generating first secret information corresponding to the serial number value and an electronic signature of the first secret information in the trusted execution environment;

在所述可信执行环境中基于所述第一秘密信息生成所述编号值对应的各个节点设备的共享密钥;generating a shared key of each node device corresponding to the serial number value based on the first secret information in the trusted execution environment;

在所述可信执行环境中加密各个所述从节点设备的所述共享密钥得到各个所述从节点设备的所述共享密钥的密文;Encrypting the shared key of each of the slave node devices in the trusted execution environment to obtain the ciphertext of the shared key of each of the slave node devices;

向各个所述从节点设备广播所述第一秘密信息的电子签名以及各个所述从节点设备的所述共享密钥的密文。Broadcasting the electronic signature of the first secret information and the ciphertext of the shared key of each of the slave node devices to each of the slave node devices.

可选的,所述在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息,包括:Optionally, the submitting the transaction information when receiving the first preset number of confirmation information for the serial number value returned by the slave node device includes:

在接收到第一预设数目个所述从节点设备返回的其自身的共享密钥时提交所述交易信息。The transaction information is submitted when a first preset number of its own shared keys returned from the slave node devices are received.

可选的,所述在所述可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息,包括:Optionally, generating consensus information for the serial number value based on the first preset number of the confirmation information in the trusted execution environment, and broadcasting the consensus information to each of the slave node devices ,include:

在所述可信执行环境中基于所述第一预设数目个所述从节点设备的共享密钥生成所述编号值对应的第二秘密信息;generating, in the trusted execution environment, the second secret information corresponding to the serial number value based on the shared keys of the first preset number of the slave node devices;

向各个所述从节点设备广播所述第二秘密信息。The second secret information is broadcast to each of the slave node devices.

可选的,所述在所述可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名,包括:Optionally, generating the first secret information corresponding to the serial number value and the electronic signature of the first secret information in the trusted execution environment includes:

若所述编号值对应的交易信息未被提交,则在所述可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名。If the transaction information corresponding to the serial number value has not been submitted, first secret information corresponding to the serial number value and an electronic signature of the first secret information are generated in the trusted execution environment.

第二方面,本申请实施例提供另一种分布式节点设备的共识方法,应用于分布式网络中的从节点设备,所述共识方法包括:In a second aspect, the embodiments of the present application provide another consensus method for distributed node devices, which is applied to slave node devices in a distributed network. The consensus method includes:

在接收到主节点设备广播的交易信息以及所述交易信息的编号值时,若确定所述交易信息的编号值未被其他交易信息占用,则向所述主节点设备发送针对所述编号值的确认信息;When receiving the transaction information broadcasted by the master node device and the serial number value of the transaction information, if it is determined that the serial number value of the transaction information is not occupied by other transaction information, the master node device sends a message for the serial number value to the master node device. confirmation information;

在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息。When receiving the consensus information for the number value broadcast by the master node device, if it is confirmed that the consensus information is valid, the transaction information is submitted.

可选的,所述共识方法还包括:Optionally, the consensus method further includes:

在接收到所述主节点设备广播的所述编号值对应的第一秘密信息的电子签名以及所述从节点设备自身的共享密钥的密文时,在自身的可信执行环境中解密自身的所述共享密钥的密文,得到自身的所述共享密钥;When receiving the electronic signature of the first secret information corresponding to the number value broadcasted by the master node device and the ciphertext of the shared key of the slave node device itself, decrypt its own trusted execution environment in its own trusted execution environment. The ciphertext of the shared key, to obtain the shared key of itself;

在所述可信执行环境中存储自身的所述共享密钥以及所述第一秘密信息的电子签名。The shared key of itself and the electronic signature of the first secret information are stored in the trusted execution environment.

可选的,所述向所述主节点设备发送针对所述编号值的确认信息,包括:。Optionally, the sending confirmation information for the serial number value to the master node device includes:

向所述主节点设备发送自身的所述共享密钥。Send the shared key of itself to the master node device.

可选的,所述在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息,包括:Optionally, when receiving consensus information for the serial number value broadcast by the master node device, if it is confirmed that the consensus information is valid, submitting the transaction information, including:

在接收到所述主节点设备广播的所述编号值对应的第二秘密信息时,在所述可信执行环境中采用所述第一秘密信息的电子签名对所述第二秘密信息的有效性进行验证,并在确认所述第二秘密信息有效后提交所述交易信息。When receiving the second secret information corresponding to the number value broadcasted by the master node device, adopt the validity of the electronic signature of the first secret information to the second secret information in the trusted execution environment Verification is performed, and the transaction information is submitted after confirming that the second secret information is valid.

可选的,所述第一秘密信息的电子签名为所述第一秘密信息的哈希值;相应地,所述在所述可信执行环境中采用所述第一秘密信息的电子签名对所述第二秘密信息的有效性进行验证,并在确认所述第二秘密信息有效后提交所述交易信息,包括:Optionally, the electronic signature of the first secret information is a hash value of the first secret information; correspondingly, the electronic signature of the first secret information is used in the trusted execution environment to perform a verify the validity of the second secret information, and submit the transaction information after confirming that the second secret information is valid, including:

在所述可信执行环境中生成所述第二秘密信息的哈希值;generating a hash value of the second secret information in the trusted execution environment;

若所述第二秘密信息的哈希值与所述第一秘密信息的哈希值相同,则提交所述交易信息。If the hash value of the second secret information is the same as the hash value of the first secret information, the transaction information is submitted.

第三方面,本申请实施例提供又一种分布式节点设备的共识方法,应用于分布式网络,所述共识方法包括:In a third aspect, the embodiments of the present application provide another consensus method for distributed node devices, which is applied to a distributed network. The consensus method includes:

主节点设备在其可信执行环境中对客户端发送的交易信息进行编号,并向各个从节点设备广播所述交易信息以及所述交易信息的编号值;The master node device numbers the transaction information sent by the client in its trusted execution environment, and broadcasts the transaction information and the number value of the transaction information to each slave node device;

所述从节点设备在接收到所述主节点设备广播的所述交易信息以及所述交易信息的编号值时,若确定所述交易信息的编号值未被其他交易信息占用,则向所述主节点设备发送针对所述编号值的确认信息;When the slave node device receives the transaction information and the serial number value of the transaction information broadcast by the master node device, if it is determined that the serial number value of the transaction information is not occupied by other transaction information, it will report to the master node device. The node device sends confirmation information for the number value;

所述主节点设备在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息;The master node device submits the transaction information when receiving a first preset number of confirmation messages for the serial number value returned by the slave node devices;

所述主节点设备在其可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息;The master node device generates consensus information for the number value based on the first preset number of the confirmation information in its trusted execution environment, and broadcasts the consensus information to each of the slave node devices;

所述从节点设备在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息。When the slave node device receives the consensus information for the serial number value broadcast by the master node device, if it is confirmed that the consensus information is valid, it submits the transaction information.

可选的,所述主节点设备在其可信执行环境中对客户端发送的交易信息进行编号之后,所述共识方法还包括:Optionally, after the master node device numbers the transaction information sent by the client in its trusted execution environment, the consensus method further includes:

所述主节点设备在其可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名;The master node device generates, in its trusted execution environment, the first secret information corresponding to the serial number value and an electronic signature of the first secret information;

所述主节点设备在其可信执行环境中基于所述第一秘密信息生成所述编号值对应的各个节点设备的共享密钥;The master node device generates, in its trusted execution environment, the shared key of each node device corresponding to the serial number value based on the first secret information;

所述主节点设备在其可信执行环境中加密各个所述从节点设备的所述共享密钥得到各个所述从节点设备的所述共享密钥的密文;The master node device encrypts the shared key of each of the slave node devices in its trusted execution environment to obtain the ciphertext of the shared key of each of the slave node devices;

所述主节点设备向各个所述从节点设备广播所述第一秘密信息的电子签名以及各个所述从节点设备的所述共享密钥的密文;The master node device broadcasts the electronic signature of the first secret information and the ciphertext of the shared key of each of the slave node devices to each of the slave node devices;

所述从节点设备在接收到所述主节点设备广播的所述编号值对应的第一秘密信息的电子签名以及各个所述从节点设备的共享密钥的密文时,在其可信执行环境中解密自身的所述共享密钥的密文,得到自身的所述共享密钥;When the slave node device receives the electronic signature of the first secret information corresponding to the serial number value broadcasted by the master node device and the ciphertext of the shared key of each of the slave node devices, in its trusted execution environment Decrypt the ciphertext of the shared key of itself in the middle to obtain the shared key of itself;

所述从节点设备在自身的可信执行环境中存储自身的所述共享密钥以及所述第一秘密信息的电子签名。The slave node device stores its own shared key and the electronic signature of the first secret information in its own trusted execution environment.

可选的,所述从节点设备向所述主节点设备发送针对所述编号值的确认信息,包括:Optionally, the slave node device sends confirmation information for the serial number value to the master node device, including:

所述从节点设备向所述主节点设备发送所述从节点设备自身的所述共享密钥;sending, by the slave node device, the shared key of the slave node device itself to the master node device;

相应地,所述主节点设备在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息,包括:Correspondingly, the master node device submits the transaction information when receiving the first preset number of confirmation messages for the serial number value returned by the slave node devices, including:

所述主节点设备在接收到第一预设数目个所述从节点设备返回的所述从节点设备自身的共享密钥时提交所述交易信息。The master node device submits the transaction information when receiving a first preset number of the slave node devices' own shared keys returned by the slave node devices.

可选的,所述主节点设备在其可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息,包括:Optionally, the master node device generates consensus information for the serial number value based on the first preset number of the confirmation information in its trusted execution environment, and broadcasts the consensus information to each of the slave node devices. Consensus information, including:

所述主节点设备在其可信执行环境中基于所述第一预设数目个所述从节点设备的共享密钥生成所述编号值对应的第二秘密信息,并向各个所述从节点设备广播所述第二秘密信息;The master node device generates second secret information corresponding to the serial number value based on the shared keys of the first preset number of slave node devices in its trusted execution environment, and sends the second secret information to each of the slave node devices. broadcasting the second secret information;

相应地,所述从节点设备在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息,包括:Correspondingly, when the slave node device receives the consensus information for the number value broadcasted by the master node device, if it confirms that the consensus information is valid, then submits the transaction information, including:

所述从节点设备在接收到所述主节点设备广播的所述编号值对应的第二秘密信息时,在所述从节点设备的可信执行环境中采用所述第一秘密信息的电子签名对所述第二秘密信息的有效性进行验证,并在确认所述第二秘密信息有效后提交所述交易信息。When the slave node device receives the second secret information corresponding to the serial number value broadcast by the master node device, it adopts the electronic signature pair of the first secret information in the trusted execution environment of the slave node device. The validity of the second secret information is verified, and the transaction information is submitted after confirming that the second secret information is valid.

第四方面,本申请实施例提供一种节点设备,包括:In a fourth aspect, an embodiment of the present application provides a node device, including:

编号值确定单元,用于在可信执行环境中对客户端发送的交易信息进行编号,并向各个从节点设备广播所述交易信息以及所述交易信息的编号值;a number value determination unit, configured to number the transaction information sent by the client in a trusted execution environment, and broadcast the transaction information and the number value of the transaction information to each slave node device;

第一交易处理单元,用于在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息;所述确认信息为所述从节点设备在确定所述交易信息的编号值未被其他交易信息占用时返回的;A first transaction processing unit, configured to submit the transaction information when receiving a first preset number of confirmation information returned by the slave node device for the serial number value; the confirmation information is that the slave node device is in Returned when it is determined that the serial number value of the transaction information is not occupied by other transaction information;

共识信息生成单元,用于在所述可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息;所述共识信息在被所述从节点设备确认有效后指示所述从节点设备提交所述交易信息;和/或A consensus information generating unit, configured to generate consensus information for the number value based on the first preset number of the confirmation information in the trusted execution environment, and broadcast the consensus to each of the slave node devices information; the consensus information instructs the slave node device to submit the transaction information after being confirmed to be valid by the slave node device; and/or

确认信息发送单元,用于在接收到主节点设备广播的交易信息以及所述交易信息的编号值时,若确定所述交易信息的编号值未被其他交易信息占用,则向所述主节点设备发送针对所述编号值的确认信息;The confirmation information sending unit is used to, when receiving the transaction information broadcasted by the master node device and the serial number value of the transaction information, if it is determined that the serial number value of the transaction information is not occupied by other transaction information, send the transaction information to the master node device. sending a confirmation message for the numbered value;

第二交易处理单元,用于在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息。The second transaction processing unit is configured to submit the transaction information if it is confirmed that the consensus information is valid when the consensus information for the serial number value broadcasted by the master node device is received.

第五方面,本申请实施例提供一种节点设备,所述节点设备包括处理器、存储器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如第一方面、第一方面的任意可选方式、第二方面或第二方面的任意可选方式所述的共识方法。In a fifth aspect, an embodiment of the present application provides a node device, where the node device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, where the processor executes the The computer program implements the consensus method described in the first aspect, any optional manner of the first aspect, the second aspect, or any optional manner of the second aspect.

第六方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面、第一方面的任意可选方式、第二方面或第二方面的任意可选方式所述的共识方法。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements any of the first aspect and the first aspect. The consensus method described in the optional manner, the second aspect, or any optional manner of the second aspect.

第七方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在节点设备上运行时,使得节点设备执行上述第一方面、第一方面的任意可选方式、第二方面或第二方面的任意可选方式所述的共识方法。In a seventh aspect, an embodiment of the present application provides a computer program product that, when the computer program product runs on a node device, enables the node device to execute the first aspect, any optional manner of the first aspect, the second aspect, or the second aspect The consensus method described in any optional manner of the aspect.

第八方面,本申请实施例提供一种分布式网络,包括多个节点设备,节点设备用于执行上述第一方面、第一方面的任意可选方式、第二方面或第二方面的任意可选方式所述的共识方法。In an eighth aspect, an embodiment of the present application provides a distributed network, including multiple node devices, where the node devices are configured to perform the first aspect, any optional manner of the first aspect, the second aspect, or any optional method of the second aspect. The consensus method described in the selection method.

实施本申请实施例提供的一种分布式节点设备的共识方法、节点设备、分布式网络、计算机可读存储介质及计算机程序产品具有以下有益效果:Implementing the consensus method, node device, distributed network, computer-readable storage medium, and computer program product of a distributed node device provided by the embodiments of the present application have the following beneficial effects:

本申请实施例提供的分布式节点设备的共识方法,由于主节点设备是在可信执行环境中对客户端发送的交易信息进行编号,且主节点设备向从节点设备广播交易信息以及交易信息的编号值发送给后,从节点设备会对交易信息的编号值进行检测,在确认该交易信息的编号值未被其他交易信息占用时才会向主节点设备返回针对该交易信息的编号值的确认信息;且主节点设备在向从节点设备广播针对交易信息的编号值的共识信息后,从节点设备会对该共识信息的有效性进行验证,在确认该共识信息有效后才会提交该交易信息,从而避免了共识过程中节点作恶情况的发生。另外,在节点设备的共识过程中,各个从节点设备只需与主节点设备进行通信,相对于节点设备基于现有的BFT共识算法进行共识而言,降低了节点设备共识过程中的通信复杂度。In the consensus method for distributed node devices provided by the embodiments of the present application, since the master node device numbers the transaction information sent by the client in a trusted execution environment, and the master node device broadcasts the transaction information and the transaction information to the slave node devices After the serial number value is sent to, the slave node device will detect the serial number value of the transaction information, and will only return the confirmation of the serial number value of the transaction information to the master node device when it is confirmed that the serial number value of the transaction information is not occupied by other transaction information. information; and after the master node device broadcasts the consensus information for the number value of the transaction information to the slave node device, the slave node device will verify the validity of the consensus information, and will submit the transaction information only after confirming that the consensus information is valid. , so as to avoid the occurrence of malicious nodes in the consensus process. In addition, in the consensus process of node devices, each slave node device only needs to communicate with the master node device, which reduces the communication complexity in the node device consensus process compared to the node device consensus based on the existing BFT consensus algorithm. .

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only for the present application. In some embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1为本申请实施例提供的一种分布式网络的结构示意图;1 is a schematic structural diagram of a distributed network according to an embodiment of the present application;

图2为本申请实施例提供的一种分布式节点设备的共识方法的示意性流程图;FIG. 2 is a schematic flowchart of a consensus method for distributed node devices according to an embodiment of the present application;

图3为本申请另一实施例提供的一种分布式节点设备的共识方法的示意性流程图;FIG. 3 is a schematic flowchart of a consensus method for distributed node devices according to another embodiment of the present application;

图4为本申请实施例提供的一种节点设备的结构示意图;FIG. 4 is a schematic structural diagram of a node device according to an embodiment of the present application;

图5为本申请另一实施例提供的一种节点设备的结构示意图。FIG. 5 is a schematic structural diagram of a node device according to another embodiment of the present application.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其他实施例中也可以实现本申请。在其他情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items. In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and should not be construed as indicating or implying relative importance.

还应当理解,在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。It should also be understood that references to "one embodiment" or "some embodiments" and the like described in the specification of this application mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the application . Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," etc. in various places in this specification are not necessarily all referring to the same embodiment, but rather Means "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise.

请参阅图1,图1为本申请实施例提供的一种分布式网络的结构示意图。如图1所示,该分布式网络可以包括多个分布式的节点设备11,每个节点设备11均可以与分布式网络中任意一个其他节点设备11进行点对点(peer to peer,P2P)通信。Please refer to FIG. 1. FIG. 1 is a schematic structural diagram of a distributed network according to an embodiment of the present application. As shown in FIG. 1 , the distributed network may include a plurality of distributed node devices 11 , and each node device 11 can perform peer-to-peer (P2P) communication with any other node device 11 in the distributed network.

在具体应用中,上述分布式网络可以为区块链,也可以为其他类型的分布式网络,此处不对分布式网络的具体类型做特别限定。In a specific application, the above-mentioned distributed network may be a blockchain, or may be other types of distributed networks, and the specific type of the distributed network is not particularly limited here.

节点设备11可以为具有计算及存储功能的电子设备。节点设备11可以与对应的客户端进行通信,例如,节点设备11可以接收对应的客户端发送的交易信息,并对该交易信息进行共识。作为示例而非限定,当节点设备11为某个应用程序的服务器时,对应的客户端可以为该应用程序的客户端。The node device 11 may be an electronic device with computing and storage functions. The node device 11 may communicate with the corresponding client, for example, the node device 11 may receive transaction information sent by the corresponding client, and perform consensus on the transaction information. As an example and not a limitation, when the node device 11 is a server of a certain application, the corresponding client may be the client of the application.

本申请实施例中,每个节点设备11的中央处理器(central processing unit,CPU)中都配置有可信执行环境(Trusted Execution Environment,TEE)。可信执行环境是基于CPU的一种指令集扩展,它可以在CPU中划分出一块与外部完全隔离的安全区域作为一个安全的执行环境,任何程序或数据均可以运行或存储在该安全区域中。可信执行环境可以保证运行或存储在安全区域中的程序及数据的机密性和完整性,进而保证运行或存储在安全区域中的程序或数据不会被泄露出去。CPU中除了可信执行环境之外的部分为非可信空间,非可信空间无法干预可信执行环境中程序的运行过程,且在可信执行环境中生成的数据也无法在非可信空间中被篡改,即基于可信执行环境的分布式节点设备的共识过程只会出现节点崩溃问题,而不会出现节点作恶问题(即拜占庭错误)。In the embodiment of the present application, a central processing unit (central processing unit, CPU) of each node device 11 is configured with a trusted execution environment (Trusted Execution Environment, TEE). Trusted execution environment is an instruction set extension based on CPU. It can divide a secure area in the CPU that is completely isolated from the outside as a secure execution environment. Any program or data can be run or stored in this secure area. . The trusted execution environment can ensure the confidentiality and integrity of the programs and data running or stored in the secure area, thereby ensuring that the programs or data running or stored in the secure area will not be leaked. The part of the CPU other than the trusted execution environment is an untrusted space. The untrusted space cannot interfere with the running process of the program in the trusted execution environment, and the data generated in the trusted execution environment cannot be stored in the untrusted space. In other words, the consensus process of the distributed node device based on the trusted execution environment will only have the problem of node collapse, but not the problem of node evil (ie, Byzantine error).

作为示例而非限定,可信执行环境可以是基于英特尔(Intel)芯片的软件保护扩展(software guard extension,SGX)。SGX通过在Intel架构上增加新的指令集和内存访问机制,允许应用程序实现一个被称为enclave的容器,同时会在相应应用程序的地址空间中划分出一块被保护的专属区域,为enclave容器中的程序和数据提供机密性和完整性的保护,这样,即使节点设备的操作系统被攻破也不会影响enclave容器中的程序和数据。By way of example and not limitation, the trusted execution environment may be a software guard extension (SGX) based on an Intel (Intel) chip. By adding a new instruction set and memory access mechanism to the Intel architecture, SGX allows applications to implement a container called enclave, and at the same time, a protected exclusive area is divided in the address space of the corresponding application, which is the enclave container. The programs and data in the enclave container provide confidentiality and integrity protection, so that even if the operating system of the node device is compromised, the programs and data in the enclave container will not be affected.

分布式网络中的各个节点设备11是通过共识操作来保证彼此之间数据的一致性的。本申请实施例中,分布式网络中的各个节点设备11在进行共识操作时,会先投票选择选出一个节点设备11作为主节点设备(即领导者)。在整个共识过程中,只要主节点变更事件未被触发,则该节点设备11将会一直作为主节点设备;当主节点变更事件被触发时,各个节点设备11会重新投票选择出另一个节点设备11作为主节点设备,即主节点设备可以是分布式网络中的任一节点设备11,分布式网络中的每个节点设备11均有可能被选为主节点设备。Each node device 11 in the distributed network ensures the consistency of data among each other through consensus operation. In the embodiment of the present application, each node device 11 in the distributed network will first vote to select one node device 11 as the master node device (ie, the leader) when performing a consensus operation. During the entire consensus process, as long as the master node change event is not triggered, the node device 11 will always act as the master node device; when the master node change event is triggered, each node device 11 will re-vote to select another node device 11 As the master node device, that is, the master node device may be any node device 11 in the distributed network, and each node device 11 in the distributed network may be selected as the master node device.

分布式网络中的各个节点设备11在进行共识操作时,分布式网络中除了主节点设备之外的其他节点设备11均为从节点设备(即跟随者),且分布式网络在任一时刻仅允许有一个主节点设备。When each node device 11 in the distributed network performs a consensus operation, other node devices 11 in the distributed network except the master node device are all slave node devices (ie followers), and the distributed network only allows There is one master node device.

本申请实施例可以将节点设备11的共识过程分为一个一个的任期,主节点设备每变更一次,则进入一个新的任期。为了对不同的任期进行区分,本申请实施例可以通过主节点任期值来标识任期,即每个任期都有对应的主节点任期值,不同任期对应的主节点任期值不同。In this embodiment of the present application, the consensus process of the node device 11 may be divided into one term of office, and each time the master node device changes, it enters a new term. In order to distinguish different tenures, the embodiment of the present application may identify the tenure by the master node tenure value, that is, each tenure has a corresponding master node tenure value, and the master node tenure values corresponding to different tenures are different.

在本申请的一个实施例中,节点设备11可以基于增量为第一数值的任期值递增策略确定每个任期的主节点任期值。其中,主节点任期值的初始值(即第一个任期的主节点任期值)以及第一数值均可以根据实际需求确定。In an embodiment of the present application, the node device 11 may determine the term value of the master node for each term based on a term value increment policy incremented by a first value. The initial value of the term of office of the master node (that is, the term value of the master node for the first term) and the first value can be determined according to actual needs.

例如,假如第一个任期的主节点任期值为1,第一数值为1,则第二个任期对应的主节点任期值为2,第三个任期对应的主节点任期值为3,第n个任期对应的主节点任期值为n。For example, if the first term has a term of 1 and the first term is 1, then the term of the second term corresponds to a term of 2, the term of the third term corresponds to 3, and the nth term corresponds to a term of 2. The term value of the master node corresponding to each term is n.

以下对本申请实施例提供的分布式节点设备的共识方法进行详细说明:The consensus method of the distributed node device provided by the embodiment of the present application is described in detail below:

请参阅图2,图2为本申请实施例提供的一种分布式节点设备的共识方法的示意性流程图,该分布式节点设备的共识方法的执行主体可以为图1所示的分布式网络。图2以一个从节点设备为例,对分布式节点设备的共识过程中主节点设备与从节点设备之间的交互过程进行说明。如图2所示,分布式节点设备的共识方法可以包括S21~S25,详述如下:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of a consensus method for distributed node devices provided by an embodiment of the present application. The execution body of the consensus method for distributed node devices may be the distributed network shown in FIG. 1. . FIG. 2 takes a slave node device as an example to illustrate the interaction process between the master node device and the slave node device in the consensus process of the distributed node device. As shown in Figure 2, the consensus method of the distributed node device may include S21 to S25, which are detailed as follows:

S21:主节点设备在其可信执行环境中对客户端发送的交易信息进行编号,并向各个从节点设备广播所述交易信息以及所述交易信息的编号值。S21: The master node device numbers the transaction information sent by the client in its trusted execution environment, and broadcasts the transaction information and the number value of the transaction information to each slave node device.

本实施例中,当主节点设备接收到客户端发送的交易信息时,可以在其可信执行环境中对该交易信息进行编号,确定该交易信息的编号值。In this embodiment, when the master node device receives the transaction information sent by the client, it can number the transaction information in its trusted execution environment to determine the number value of the transaction information.

在具体应用中,客户端发送的交易信息可以为一个或多个。In a specific application, the transaction information sent by the client may be one or more.

在本申请的一个实施例中,交易信息的编号值可以由当前任期对应的主节点任期值以及该交易信息在当前任期内的序号构成。当前任期指主节点设备接收到该交易信息时所在的任期。In an embodiment of the present application, the serial number value of the transaction information may be composed of the term value of the master node corresponding to the current term and the sequence number of the transaction information in the current term. The current term refers to the term in which the master node device receives the transaction information.

在本实施例的一种实现方式中,主节点设备可以基于增量为第二数值的序号递增策略确定每个交易信息在当前任期内的序号。其中,第二数值可以根据实际需求设置,例如,第二数值可以为1。In an implementation manner of this embodiment, the master node device may determine the sequence number of each transaction information in the current term based on a sequence number incrementing strategy in which the increment is a second value. The second value may be set according to actual requirements, for example, the second value may be 1.

在本申请的一个实施例中,主节点设备向从节点设备广播交易信息以及所述交易信息的编号值时,可以将交易信息与该交易信息的编号值进行关联,并向各个从节点设备广播具有关联关系的交易信息以及交易信息的编号值。In an embodiment of the present application, when the master node device broadcasts transaction information and the serial number value of the transaction information to the slave node devices, the transaction information can be associated with the serial number value of the transaction information, and broadcast to each slave node device. Transaction information with an associated relationship and the serial number value of the transaction information.

S22:所述从节点设备在接收到所述主节点设备广播的所述交易信息以及所述交易信息的编号值时,若确定所述交易信息的编号值未被其他交易信息占用,则向所述主节点设备发送针对所述编号值的确认信息。S22: When the slave node device receives the transaction information and the serial number value of the transaction information broadcasted by the master node device, if it is determined that the serial number value of the transaction information is not occupied by other transaction information, it sends the transaction information to the The master node device sends confirmation information for the number value.

本实施例中,为了防止多条不同的交易信息采用同一个编号值,进而影响节点设备对交易信息的共识结果,各个从节点设备接收到主节点设备广播的交易信息以及该交易信息的编号值后,可以检测每个交易信息的编号值是否已被其他交易信息占用。In this embodiment, in order to prevent multiple pieces of different transaction information from using the same number value, thereby affecting the consensus result of the node device on the transaction information, each slave node device receives the transaction information broadcast by the master node device and the number value of the transaction information. After that, it can be detected whether the serial number value of each transaction information has been occupied by other transaction information.

具体地,从节点设备可以将每个交易信息的编号值与从节点设备接收到的各个其他交易信息的编号值进行比较。Specifically, the slave node device may compare the serial number value of each transaction information with the serial number value of each other transaction information received from the slave node device.

在本申请的一个实施例中,从节点设备若确定其他交易信息的编号值中不存在与该交易信息的编号值相同的编号值,则说明该交易信息的编号值未被其他交易信息占用,此时从节点设备可以向主节点设备发送针对该交易信息的编号值的确认信息。其中,针对交易信息的编号值的确认信息用于表示从节点设备已确认该交易信息的编号值未被其他交易信息占用。In an embodiment of the present application, if the slave node device determines that the serial number value of other transaction information does not have the same serial number value as the serial number value of the transaction information, it means that the serial number value of the transaction information is not occupied by other transaction information, At this time, the slave node device may send confirmation information for the serial number value of the transaction information to the master node device. The confirmation information for the serial number value of the transaction information is used to indicate that the slave node device has confirmed that the serial number value of the transaction information is not occupied by other transaction information.

在本申请的另一个实施例中,从节点设备若确定其他交易信息的编号值中存在与该交易信息的编号值相同的编号值,则说明该交易信息的编号值已被其他交易信息占用,此时从节点设备可以触发主节点变更事件。主节点变更事件被触发后,各个节点设备进入主节点选举环节,由于主节点选举环节的具体过程为现有技术,因此此处不对其进行详细描述。In another embodiment of the present application, if the slave node device determines that the serial number value of other transaction information has the same serial number value as the serial number value of the transaction information, it means that the serial number value of the transaction information has been occupied by other transaction information, At this point, the slave node device can trigger the master node change event. After the master node change event is triggered, each node device enters the master node election link. Since the specific process of the master node election link is the prior art, it will not be described in detail here.

S23:所述主节点设备在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息。S23: The master node device submits the transaction information when receiving a first preset number of confirmation messages for the serial number value returned by the slave node devices.

通常,主节点设备获得一半以上的节点设备(包括其自身)针对某个交易信息的编号值的确认信息时,即认为该交易信息的编号值已被所有节点设备确认,基于此,第一预设数目不小于n/2,其中,n为分布式网络包括的节点设备的总数量。示例性的,例如,若n=5,则第一预设数目可以为3;若n=4,则第一预设数目也可以为3;若n=3,则第一预设数目可以为2。Usually, when the master node device obtains the confirmation information of the serial number value of a certain transaction information from more than half of the node devices (including itself), it is considered that the serial number value of the transaction information has been confirmed by all the node devices. Let the number not be less than n/2, where n is the total number of node devices included in the distributed network. Exemplarily, for example, if n=5, the first preset number may be 3; if n=4, the first preset number may also be 3; if n=3, the first preset number may be 2.

在本申请的一个实施例中,节点设备提交交易信息具体可以为:节点设备执行该交易信息对应的交易操作。In an embodiment of the present application, the node device submitting the transaction information may specifically be: the node device executes a transaction operation corresponding to the transaction information.

本申请实施例中,主节点设备在接收到第一预设数目个从节点设备返回的针对某个交易信息的编号值的确认信息后,还可以向发送该交易信息的客户端发送该交易信息以及该交易信息的编号值,以便客户端确定其发送的该交易信息是否已被各个节点设备共识。In this embodiment of the present application, after receiving the first preset number of confirmation messages for the serial number value of a certain transaction information returned by the slave node devices, the master node device may also send the transaction information to the client that sends the transaction information and the serial number value of the transaction information, so that the client can determine whether the transaction information sent by it has been agreed by various node devices.

S24:所述主节点设备在其可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息。S24: The master node device generates consensus information for the number value based on the first preset number of the confirmation information in its trusted execution environment, and broadcasts the consensus information to each of the slave node devices .

本申请实施例中,为了保证各个节点设备的操作或者数据的一致性,主节点设备在提交交易信息后,还在其可信执行环境中基于接收到的第一预设数目个针对该交易信息的编号值的确认信息以及主节点设备自身生成的针对该编号值的确认信息,生成针对该编号值的共识信息。In this embodiment of the present application, in order to ensure the consistency of operations or data of each node device, after submitting the transaction information, the master node device also targets the transaction information in its trusted execution environment based on the first preset number received. The confirmation information for the number value and the confirmation information for the number value generated by the master node device itself, generate consensus information for the number value.

其中,针对某个交易信息的编号值的共识信息用于表示该交易信息的编号值已被大部分节点设备确认。Among them, the consensus information for the serial number value of a certain transaction information is used to indicate that the serial number value of the transaction information has been confirmed by most of the node devices.

主节点设备生成针对某个交易信息的编号值的共识信息后,向各个从节点设备广播针对该交易信息的编号值的共识信息。After the master node device generates consensus information on the serial number value of a certain transaction information, it broadcasts the consensus information on the serial number value of the transaction information to each slave node device.

S25:所述从节点设备在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息。S25: When the slave node device receives the consensus information for the serial number value broadcast by the master node device, if it is confirmed that the consensus information is valid, the transaction information is submitted.

本申请实施例中,从节点设备接收到主节点设备广播的针对某个交易信息的编号值的共识信息后,需要验证该共识信息是否有效,即验证该共识信息是否确实能够表示该交易信息的编号值已被大部分节点设备确认。In the embodiment of the present application, after receiving the consensus information for the serial number value of a certain transaction information broadcast by the master node device, the slave node device needs to verify whether the consensus information is valid, that is, verify whether the consensus information can indeed represent the transaction information. The number value has been confirmed by most node devices.

在本申请的一个实施例中,从节点设备可以通过检测针对某个交易信息的编号值的共识信息中是否包括第二预设数目个节点设备针对该编号值的确认信息来检测该共识信息是否有效。其中,第二预设数目为第一预设数目与1之和。In an embodiment of the present application, the slave node device may detect whether the consensus information for a certain transaction information number value includes confirmation information for the number value by a second preset number of node devices in the consensus information. efficient. The second preset number is the sum of the first preset number and 1.

具体地,从节点设备若确认针对某个交易信息的编号值的共识信息中包括第二预设数目个节点设备针对该编号值的确认信息,则确认该共识信息有效;从节点设备若确认针对某个交易信息的编号值的共识信息中未包括第二预设数目个节点设备针对该编号值的确认信息,则确认该共识信息无效。Specifically, if the slave node device confirms that the consensus information for the number value of a certain transaction information includes the confirmation information of the second preset number of node devices for the number value, the consensus information is confirmed to be valid; if the slave node device confirms that the number value is valid for If the consensus information of the serial number value of a certain transaction information does not include the confirmation information of the second preset number of node devices for the serial number value, the consensus information is confirmed to be invalid.

在本申请的一个实施例中,从节点设备若确认针对某个交易信息的编号值的共识信息有效,则提交该交易信息。其中,从节点设备提交交易信息可以为:从节点设备执行该交易信息对应的交易操作。In an embodiment of the present application, if the slave node device confirms that the consensus information for the serial number value of a certain transaction information is valid, it submits the transaction information. Wherein, submitting the transaction information from the node device may be: executing the transaction operation corresponding to the transaction information from the node device.

在本申请的另一个实施例中,从节点设备若确认针对某个交易信息的编号值的共识信息无效,则触发主节点变更事件。In another embodiment of the present application, if the slave node device confirms that the consensus information for the serial number value of a certain transaction information is invalid, the master node change event is triggered.

在具体应用中,从节点设备在确认针对某个交易信息的编号值的共识信息有效后,还可以向发送该交易信息的客户端发送该交易信息以及该交易信息的编号值,以便客户端确定其发送的该交易信息是否已被各个节点设备共识。In a specific application, after confirming that the consensus information for the serial number value of a certain transaction information is valid, the slave node device can also send the transaction information and the serial number value of the transaction information to the client that sent the transaction information, so that the client can determine Whether the transaction information sent by it has been agreed by each node device.

具体地,针对客户端发送的某个交易信息,客户端若接收到第二预设数目个不同节点设备发送的该交易信息的编号值,且该第二预设数目个编号值相同,则客户端确定该交易信息已被各个节点设备共识。Specifically, for a certain transaction information sent by the client, if the client receives the serial number values of the transaction information sent by a second preset number of different node devices, and the second preset number of serial numbers are the same, the client The terminal determines that the transaction information has been agreed by each node device.

以上可以看出,本申请实施例提供的分布式节点设备的共识方法,由于主节点设备是在可信执行环境中对客户端发送的交易信息进行编号,且主节点设备向从节点设备广播交易信息以及交易信息的编号值发送给后,从节点设备会对交易信息的编号值进行检测,在确认该交易信息的编号值未被其他交易信息占用时才会向主节点设备返回针对该交易信息的编号值的确认信息;且主节点设备在向从节点设备广播针对交易信息的编号值的共识信息后,从节点设备会对该共识信息的有效性进行验证,在确认该共识信息有效后才会提交该交易信息,从而避免了共识过程中节点作恶情况的发生。另外,在节点设备的共识过程中,各个从节点设备只需与主节点设备进行通信,相对于节点设备基于现有的BFT共识算法进行共识而言,降低了节点设备共识过程中的通信复杂度。It can be seen from the above that, in the consensus method for distributed node devices provided by the embodiments of this application, since the master node device numbers the transaction information sent by the client in a trusted execution environment, and the master node device broadcasts transactions to the slave node devices After the information and the serial number value of the transaction information are sent to, the slave node device will detect the serial number value of the transaction information, and will only return the transaction information to the master node device when it confirms that the serial number value of the transaction information is not occupied by other transaction information. The confirmation information of the number value of the transaction information; and after the master node device broadcasts the consensus information for the number value of the transaction information to the slave node device, the slave node device will verify the validity of the consensus information, and only after confirming that the consensus information is valid. The transaction information will be submitted, thus avoiding the occurrence of malicious nodes during the consensus process. In addition, in the consensus process of node devices, each slave node device only needs to communicate with the master node device, which reduces the communication complexity in the node device consensus process compared to the node device consensus based on the existing BFT consensus algorithm. .

请参阅图3,图3为本申请另一实施例提供的一种分布式节点设备的共识方法的示意性流程图。相对于图2对应的实施例,本实施例中的分布式节点设备的共识方法在S21之后,还可以包括S31~S36,详述如下:Please refer to FIG. 3 , which is a schematic flowchart of a consensus method for distributed node devices according to another embodiment of the present application. Compared with the embodiment corresponding to FIG. 2 , the consensus method of the distributed node device in this embodiment may further include S31 to S36 after S21 , and the details are as follows:

S31:所述主节点设备在其可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名。S31: The master node device generates, in its trusted execution environment, first secret information corresponding to the serial number value and an electronic signature of the first secret information.

本实施例中,针对每个交易信息,主节点设备可以在其可信执行环境中随机生成一个与该交易信息的编号值对应的第一秘密信息。In this embodiment, for each transaction information, the master node device may randomly generate a first secret information corresponding to the serial number value of the transaction information in its trusted execution environment.

具体地,在本申请的一个实施例中,主节点设备可以调用可信执行环境提供的随机数生成函数TEE.Random()为每个交易信息生成一个随机数,并将该随机数确定为与该交易信息的编号值对应的第一秘密信息。Specifically, in an embodiment of the present application, the master node device may call the random number generation function TEE.Random() provided by the trusted execution environment to generate a random number for each transaction information, and determine the random number to be the same as the The first secret information corresponding to the serial number value of the transaction information.

第一秘密信息的电子签名用于对第一秘密信息进行校验。The electronic signature of the first secret information is used to verify the first secret information.

在本申请的一个实施例中,第一秘密信息的电子签名可以为第一秘密信息的哈希值。基于此,主节点设备在得到交易信息的编号值对应的第一秘密信息后,计算该第一秘密信息的哈希值,该第一秘密信息的哈希值即为该第一秘密信息的电子签名。In an embodiment of the present application, the electronic signature of the first secret information may be a hash value of the first secret information. Based on this, after obtaining the first secret information corresponding to the serial number value of the transaction information, the master node device calculates the hash value of the first secret information, and the hash value of the first secret information is the electronic value of the first secret information. sign.

在本申请的另一实施例中,S31具体可以包括以下步骤:In another embodiment of the present application, S31 may specifically include the following steps:

所述主节点设备若确认所述编号值对应的交易信息未被提交,则在其可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名。If the master node device confirms that the transaction information corresponding to the serial number value has not been submitted, it generates first secret information corresponding to the serial number value and an electronic signature of the first secret information in its trusted execution environment.

本实施例中,为了避免节点设备重复对同一个交易信息进行多次共识操作,各个节点设备可以对其已提交的交易信息的编号值进行记录。基于此,主节点设备在为每个交易信息进行编号后,可以将该交易信息的编号值与主节点设备已提交的各个交易信息的编号值进行比较。主节点设备在检测到已提交的交易信息的编号值中不存在与该交易信息的编号值相同的编号值时,确认该交易信息未被提交,此时主节点设备才在其可信执行环境中生成该交易信息的编号值对应的第一秘密信息以及该第一秘密信息的电子签名。In this embodiment, in order to prevent the node devices from repeatedly performing multiple consensus operations on the same transaction information, each node device may record the serial number value of the submitted transaction information. Based on this, after the master node device numbers each transaction information, the serial number value of the transaction information can be compared with the serial number value of each transaction information submitted by the master node device. When the master node device detects that the number value of the submitted transaction information does not have the same number value as the number value of the transaction information, it confirms that the transaction information has not been submitted. At this time, the master node device is in its trusted execution environment. generate the first secret information corresponding to the serial number value of the transaction information and the electronic signature of the first secret information.

S32:所述主节点设备在其可信执行环境中基于所述第一秘密信息生成所述编号值对应的各个节点设备的共享密钥。S32: The master node device generates a shared key of each node device corresponding to the serial number value based on the first secret information in its trusted execution environment.

本实施例中,主节点设备生成交易信息的编号值对应的第一秘密信息后,可以在其可信执行环境中基于预设秘密共享算法将该第一秘密信息拆分为n份共享密钥,其中,n为分布式网络包括的节点设备的总数量,即拆分得到的每份共享密钥分别对应一个节点设备。In this embodiment, after generating the first secret information corresponding to the serial number value of the transaction information, the master node device can split the first secret information into n shares of shared keys based on a preset secret sharing algorithm in its trusted execution environment , where n is the total number of node devices included in the distributed network, that is, each shared key obtained by splitting corresponds to one node device.

需要说明的是,由于第一秘密信息的密钥拆分操作是在主节点设备的可信执行环境中执行的,因此,主节点设备自身并不知晓该n份共享密钥。只有从节点设备将其共享密钥告知主节点设备后,主节点设备才会拥有该从节点设备的共享密钥。It should be noted that, since the key splitting operation of the first secret information is performed in the trusted execution environment of the master node device, the master node device itself does not know the n shares of the shared key. Only after the slave node device informs the master node device of its shared key, the master node device will have the shared key of the slave node device.

本申请实施例中,主节点设备拥有第二预设数目个节点设备(包括其自身)的共享密钥后,即可基于该第二预设数目个共享密钥还原出第一秘密信息。In the embodiment of the present application, after the master node device has the shared keys of the second preset number of node devices (including itself), the first secret information can be restored based on the second preset number of shared keys.

在具体应用中,预设秘密共享算法可以是现有的任一秘密共享算法。In a specific application, the preset secret sharing algorithm may be any existing secret sharing algorithm.

S33:所述主节点设备在其可信执行环境中加密各个所述从节点设备的所述共享密钥得到各个所述从节点设备的所述共享密钥的密文。S33: The master node device encrypts the shared key of each of the slave node devices in its trusted execution environment to obtain the ciphertext of the shared key of each of the slave node devices.

本实施例中,为了提高从节点设备的共享密钥的安全性,保证每个从节点设备的共享密钥不被其他从节点设备获知,主节点设备向从节点设备广播从节点设备的共享密钥时,可以在其可信执行环境中对各个从节点设备的共享密钥进行加密,得到各个从节点设备的共享密钥的密文。In this embodiment, in order to improve the security of the shared key of the slave node device and ensure that the shared key of each slave node device is not known by other slave node devices, the master node device broadcasts the shared key of the slave node device to the slave node devices. When the key is obtained, the shared key of each slave node device can be encrypted in its trusted execution environment to obtain the ciphertext of the shared key of each slave node device.

在本申请的一个实施例中,主节点设备可以采用每个从节点设备所拥有的非对称密钥中的公钥分别对每个从节点设备的共享密钥进行加密。这样,从节点设备接收到共享密钥的密文后,只能通过其拥有的非对称密钥中的私钥解密出其自身的共享密钥,而无法解密出其他从节点设备的共享密钥,从而可以保证各个从节点设备只知晓其自身的共享密钥。In an embodiment of the present application, the master node device may use the public key in the asymmetric key possessed by each slave node device to encrypt the shared key of each slave node device respectively. In this way, after the slave node device receives the ciphertext of the shared key, it can only decrypt its own shared key through the private key in the asymmetric key it owns, but cannot decrypt the shared keys of other slave node devices. , thereby ensuring that each slave node device only knows its own shared key.

S34:所述主节点设备向各个所述从节点设备广播所述第一秘密信息的电子签名以及各个所述从节点设备的所述共享密钥的密文。S34: The master node device broadcasts the electronic signature of the first secret information and the ciphertext of the shared key of each of the slave node devices to each of the slave node devices.

本实施例中,主节点设备得到交易信息的编号值对应的各个从节点设备的共享密钥的密文后,向各个从节点设备广播第一秘密信息的电子签名以及各个从节点设备的共享密钥的密文。In this embodiment, after obtaining the ciphertext of the shared key of each slave node device corresponding to the serial number value of the transaction information, the master node device broadcasts the electronic signature of the first secret information and the shared secret key of each slave node device to each slave node device The ciphertext of the key.

S35:所述从节点设备在接收到所述主节点设备广播的所述编号值对应的第一秘密信息的电子签名以及各个所述从节点设备的所述共享密钥的密文时,在其可信执行环境中解密自身的所述共享密钥的密文,得到自身的所述共享密钥。S35: When the slave node device receives the electronic signature of the first secret information corresponding to the serial number value broadcast by the master node device and the ciphertext of the shared key of each slave node device, Decrypt the ciphertext of the shared key of itself in the trusted execution environment to obtain the shared key of itself.

从节点设备接收到主节点设备广播的某个交易信息的编号值对应的第一秘密信息的电子签名以及该编号值对应的各个从节点设备的共享密钥的密文后,从节点设备可以在其可信执行环境中采用其拥有的非对称密钥的私钥解密其自身的共享密钥的密文,得到其自身的共享密钥。After the slave node device receives the electronic signature of the first secret information corresponding to the serial number value of a certain transaction information broadcast by the master node device and the ciphertext of the shared key of each slave node device corresponding to the serial number value, the slave node device can In the trusted execution environment, the private key of the asymmetric key owned by it is used to decrypt the ciphertext of its own shared key to obtain its own shared key.

需要说明的是,在本申请另一个实施例中,若某个从节点设备无法正确解密出其自身的共享密钥,则该从节点设备可以触发主节点变更事件。It should be noted that, in another embodiment of the present application, if a slave node device cannot correctly decrypt its own shared key, the slave node device can trigger a master node change event.

S36:所述从节点设备在自身的可信执行环境中存储自身的所述共享密钥以及所述第一秘密信息的电子签名。S36: The slave node device stores its own shared key and the electronic signature of the first secret information in its own trusted execution environment.

本实施例中,从节点设备得到其自身的共享密钥后,可以将交易信息的编号值对应的第一秘密信息以及其自身的共享密钥存储在其可信执行环境中。In this embodiment, after obtaining its own shared key from the node device, the first secret information corresponding to the serial number value of the transaction information and its own shared key can be stored in its trusted execution environment.

基于图3对应的实施例,在一种实现方式中,S22具体可以包括以下步骤:Based on the embodiment corresponding to FIG. 3 , in an implementation manner, S22 may specifically include the following steps:

所述从节点设备向所述主节点设备发送所述从节点设备自身的所述共享密钥。The slave node device sends the shared key of the slave node device itself to the master node device.

相应地,S23具体可以包括以下步骤:Correspondingly, S23 may specifically include the following steps:

所述主节点设备在接收到第一预设数目个所述从节点设备返回的所述从节点设备自身的共享密钥时提交所述交易信息。The master node device submits the transaction information when receiving a first preset number of the slave node devices' own shared keys returned by the slave node devices.

本实施中,从节点设备在确定某个交易信息的编号值未被其他交易信息占用时向主节点设备发送自身的与该编号值对应的共享密钥。In this implementation, when the slave node device determines that the serial number value of a certain transaction information is not occupied by other transaction information, the slave node device sends its own shared key corresponding to the serial number value to the master node device.

主节点设备接收到第一预设数目个从节点设备返回的针对该交易信息的编号值的共享密钥后,确认该交易信息的编号值已被大部分节点设备确认,此时主节点设备可以提交该交易信息。After the master node device receives the first preset number of shared keys for the serial number value of the transaction information returned by the slave node devices, it confirms that the serial number value of the transaction information has been confirmed by most of the node devices. At this time, the master node device can Submit the transaction information.

在另一种实现方式中,S24具体可以包括以下步骤:In another implementation manner, S24 may specifically include the following steps:

所述主节点设备在其可信执行环境中基于所述第一预设数目个所述从节点设备的共享密钥生成所述编号值对应的第二秘密信息,并向各个所述从节点设备广播所述第二秘密信息。The master node device generates second secret information corresponding to the serial number value based on the shared keys of the first preset number of slave node devices in its trusted execution environment, and sends the second secret information to each of the slave node devices. The second secret information is broadcast.

相应地,S25具体可以包括以下步骤:Correspondingly, S25 may specifically include the following steps:

所述从节点设备在接收到所述主节点设备广播的所述编号值对应的第二秘密信息时,在所述从节点设备的可信执行环境中采用所述第一秘密信息的电子签名对所述第二秘密信息的有效性进行验证,并在确认所述第二秘密信息有效后提交所述交易信息。When the slave node device receives the second secret information corresponding to the serial number value broadcast by the master node device, it adopts the electronic signature pair of the first secret information in the trusted execution environment of the slave node device. The validity of the second secret information is verified, and the transaction information is submitted after confirming that the second secret information is valid.

本实施例中,主节点设备接收到第一预设数目个从节点设备返回的针对该交易信息的编号值的共享密钥后,可以在其可信执行环境中基于该第一预设数目个共享密钥以及主节点设备自身的共享密钥,生成该交易信息的编号值对应的第二秘密信息。In this embodiment, after receiving the first preset number of shared keys for the serial number value of the transaction information returned by the slave node device, the master node device may use the first preset number of shared keys in its trusted execution environment The shared key and the shared key of the master node device itself generate second secret information corresponding to the serial number value of the transaction information.

在具体应用中,主节点设备可以基于预设秘密共享算法将该第一预设数目个共享密钥与其自身的共享密钥聚合为第二秘密信息。In a specific application, the master node device may aggregate the first preset number of shared keys and its own shared keys into the second secret information based on a preset secret sharing algorithm.

主节点设备得到该交易信息的编号值对应的第二秘密信息后,向各个从节点设备广播该第二秘密信息。从节点设备接收到主节点设备广播的某个交易信息的编号值对应的第二秘密信息后,可以在其可信执行环境中采用该交易信息的编号值对应的第一秘密信息的电子签名对该第二秘密信息的有效性进行验证。从节点设备在确认该交易信息的编号值对应的第二秘密信息有效时,说明该第二秘密信息确实为主节点设备基于第二预设数目个节点设备的共享密钥生成的,即主节点设备确实接收到了第一预设数目个从节点设备发送的针对该交易信息的编号值的共享密钥。其中,第二预设数目为第一预设数目与1之和。After obtaining the second secret information corresponding to the serial number value of the transaction information, the master node device broadcasts the second secret information to each slave node device. After receiving the second secret information corresponding to the serial number value of a certain transaction information broadcast by the master node device, the slave node device can use the electronic signature pair of the first secret information corresponding to the serial number value of the transaction information in its trusted execution environment. The validity of the second secret information is verified. When the slave node device confirms that the second secret information corresponding to the serial number value of the transaction information is valid, it indicates that the second secret information is indeed generated by the master node device based on the shared keys of the second preset number of node devices, that is, the master node. The device has indeed received the first preset number of shared keys for the serial number value of the transaction information sent from the node device. The second preset number is the sum of the first preset number and 1.

在具体应用中,当第一秘密信息的电子签名为第一秘密信息的哈希值时,S25具体可以包括以下步骤:In a specific application, when the electronic signature of the first secret information is the hash value of the first secret information, S25 may specifically include the following steps:

从节点设备在其可信执行环境中生成所述第二秘密信息的哈希值;generating a hash value of the second secret information from the node device in its trusted execution environment;

从节点设备若确认所述第二秘密信息的哈希值与所述第一秘密信息的哈希值相同,则提交所述交易信息。If the slave node device confirms that the hash value of the second secret information is the same as the hash value of the first secret information, it submits the transaction information.

本实施例中,从节点设备在确定某个交易信息的编号值对应的第二秘密信息的哈希值与针对该编号值的第一秘密信息的编号值相同,则说明针对该编号值的第二秘密信息与针对该编号值的第一秘密信息相同,即说明该交易信息的编号值对应的第二秘密信息是有效的。In this embodiment, when the slave node device determines that the hash value of the second secret information corresponding to the serial number value of a certain transaction information is the same as the serial number value of the first secret information corresponding to the serial number value, it means that the first secret information corresponding to the serial number value is the same. The second secret information is the same as the first secret information for the serial number value, that is, it indicates that the second secret information corresponding to the serial number value of the transaction information is valid.

在具体应用中,主节点设备生成某个交易信息的编号值对应的第二秘密信息后,可以向发送该交易信息的客户端返回该交易信息、该交易信息的编号值以及该交易信息的编号值对应的第二秘密信息。In a specific application, after generating the second secret information corresponding to the serial number value of a certain transaction information, the master node device can return the transaction information, the serial number value of the transaction information and the serial number of the transaction information to the client that sent the transaction information The value corresponds to the second secret information.

从节点设备在确认该交易信息的编号值对应的第二秘密信息有效后,也可以向发送该交易信息的客户端返回该交易信息、该交易信息的编号值以及该交易信息的编号值对应的第二秘密信息。After confirming that the second secret information corresponding to the serial number value of the transaction information is valid, the slave node device can also return the transaction information, the serial number value of the transaction information, and the serial number value of the transaction information to the client that sent the transaction information. Second Secret Information.

基于此,针对某个交易信息,当客户端接收到的来自第二预设数目个不同节点设备的该交易信息的编号值以及该交易信息的编号值对应的第二秘密信息均相同时,可以认为该交易信息已被各个节点设备共识。Based on this, for a certain transaction information, when the serial number value of the transaction information received by the client from a second preset number of different node devices and the second secret information corresponding to the serial number value of the transaction information are the same, it can be It is considered that the transaction information has been agreed by each node device.

以上可以看出,本实施例提供的分布式节点设备的共识算法,由于将交易信息的编号值对应的第一秘密信息拆分为多个共享密钥,并通过该多个共享密钥来分别表示各个从节点设备针对该交易信息的编号值的确认信息,因此,当主节点设备接收到第一预设数目个从节点设备返回的针对该编号值的共享密钥时便可基于该第一预设数目个共享密钥与其自身的共享密钥对该编号值的第一秘密信息进行恢复。基于此,从节点设备可以直接通过该编号值对应的第一秘密信息的电子签名验证主节点设备恢复出的针对该编号值的第二秘密信息的有效性,不仅可以避免节点设备共识过程中出现节点作恶问题,而且可以提高各节点之间的共识效率。It can be seen from the above that the consensus algorithm of the distributed node device provided in this embodiment splits the first secret information corresponding to the serial number value of the transaction information into multiple shared keys, and uses the multiple shared keys to separate Represents the confirmation information of each slave node device for the serial number value of the transaction information. Therefore, when the master node device receives the first preset number of slave node devices to return the shared key for the serial number value, it can be based on the first preset number. Set a number of shared keys and their own shared keys to restore the first secret information of the number value. Based on this, the slave node device can directly verify the validity of the second secret information for the number value recovered by the master node device through the electronic signature of the first secret information corresponding to the number value, which can not only avoid the occurrence of node device consensus process Nodes do evil, and it can improve the consensus efficiency between nodes.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

基于上述实施例所提供的分布式节点设备的共识方法,本发明实施例进一步给出实现上述方法实施例的节点设备的实施例。Based on the consensus method for distributed node devices provided by the foregoing embodiments, the embodiments of the present invention further provide embodiments of node devices that implement the foregoing method embodiments.

请参阅图4,图4为本申请实施例提供的一种节点设备的结构示意图。本申请实施例中,节点设备包括的各单元用于执行图2至图3对应的实施例中的各步骤。具体请参阅图2至图3以及图2至图3对应的实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分。如图4所示,节点设备40可以包括:编号值确定单元41、第一交易处理单元42及共识信息生成单元43;和/或确认信息发送单元44及第二交易处理单元45。其中:Please refer to FIG. 4 , which is a schematic structural diagram of a node device according to an embodiment of the present application. In the embodiment of the present application, each unit included in the node device is used to execute each step in the embodiment corresponding to FIG. 2 to FIG. 3 . For details, please refer to FIG. 2 to FIG. 3 and the related descriptions in the corresponding embodiments of FIG. 2 to FIG. 3 . For convenience of explanation, only the parts related to this embodiment are shown. As shown in FIG. 4 , the node device 40 may include: a number value determination unit 41 , a first transaction processing unit 42 and a consensus information generating unit 43 ; and/or a confirmation information sending unit 44 and a second transaction processing unit 45 . in:

编号值确定单元41用于主节点设备在其可信执行环境中对客户端发送的交易信息进行编号,并向各个从节点设备广播所述交易信息以及所述交易信息的编号值。The number value determination unit 41 is used for the master node device to number the transaction information sent by the client in its trusted execution environment, and to broadcast the transaction information and the number value of the transaction information to each slave node device.

第一交易处理单元42用于所述主节点设备在接收到第一预设数目个所述从节点设备返回的针对所述编号值的确认信息时提交所述交易信息。The first transaction processing unit 42 is used for the master node device to submit the transaction information when receiving confirmation information for the serial number value returned by a first preset number of the slave node devices.

共识信息生成单元43用于所述主节点设备在其可信执行环境中基于所述第一预设数目个所述确认信息生成针对所述编号值的共识信息,并向各个所述从节点设备广播所述共识信息。The consensus information generating unit 43 is used for the master node device to generate consensus information for the serial number value based on the first preset number of the confirmation information in its trusted execution environment, and report it to each of the slave node devices. Broadcast the consensus information.

确认信息发送单元44用于所述从节点设备在接收到所述主节点设备广播的所述交易信息以及所述交易信息的编号值时,若确定所述交易信息的编号值未被其他交易信息占用,则向所述主节点设备发送针对所述编号值的确认信息。The confirmation information sending unit 44 is used for the slave node device, when receiving the transaction information and the serial number value of the transaction information broadcast by the master node device, if it is determined that the serial number value of the transaction information is not matched by other transaction information. If it is occupied, then send confirmation information for the number value to the master node device.

第二交易处理单元45用于所述从节点设备在接收到所述主节点设备广播的针对所述编号值的共识信息时,若确认所述共识信息有效,则提交所述交易信息。The second transaction processing unit 45 is configured to, when the slave node device receives the consensus information for the serial number value broadcast by the master node device, submit the transaction information if it is confirmed that the consensus information is valid.

可选的,节点设备40还包括秘密信息生成单元、共享密钥生成单元、加解密单元、共享密钥分发单元以及第一存储单元。其中:Optionally, the node device 40 further includes a secret information generation unit, a shared key generation unit, an encryption/decryption unit, a shared key distribution unit, and a first storage unit. in:

秘密信息生成单元用于所述主节点设备在其可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名。The secret information generating unit is used for the master node device to generate the first secret information corresponding to the serial number value and the electronic signature of the first secret information in its trusted execution environment.

共享密钥生成单元用于所述主节点设备在其可信执行环境中基于所述第一秘密信息生成所述编号值对应的各个节点设备的共享密钥。The shared key generation unit is used for the master node device to generate the shared key of each node device corresponding to the serial number value based on the first secret information in its trusted execution environment.

加解密单元用于所述主节点设备在其可信执行环境中加密各个所述从节点设备的所述共享密钥得到各个所述从节点设备的所述共享密钥的密文。The encryption and decryption unit is used for the master node device to encrypt the shared key of each of the slave node devices in its trusted execution environment to obtain the ciphertext of the shared key of each of the slave node devices.

共享密钥分发单元用于所述主节点设备向各个所述从节点设备广播所述第一秘密信息的电子签名以及各个所述从节点设备的所述共享密钥的密文。The shared key distribution unit is used for the master node device to broadcast the electronic signature of the first secret information and the ciphertext of the shared key of each of the slave node devices to each of the slave node devices.

所述加解密单元还用于所述从节点设备在接收到所述主节点设备广播的所述编号值对应的第一秘密信息的电子签名以及各个所述从节点设备的所述共享密钥的密文时,在其可信执行环境中解密自身的所述共享密钥的密文,得到自身的所述共享密钥。The encryption and decryption unit is also used for the electronic signature of the first secret information corresponding to the number value broadcast by the slave node device and the shared key of each of the slave node devices when the slave node device receives the electronic signature. When the ciphertext is decrypted in its trusted execution environment, the ciphertext of its own shared key is obtained to obtain its own shared key.

第一存储单元用于所述从节点设备在自身的可信执行环境中存储自身的所述共享密钥以及所述第一秘密信息的电子签名。The first storage unit is used for the slave node device to store its own shared key and the electronic signature of the first secret information in its own trusted execution environment.

可选的,秘密信息生成单元具体用于:所述主节点设备若确认所述编号值对应的交易信息未被提交,则在其可信执行环境中生成所述编号值对应的第一秘密信息以及所述第一秘密信息的电子签名。Optionally, the secret information generating unit is specifically configured to: if the master node device confirms that the transaction information corresponding to the serial number value has not been submitted, generate the first secret information corresponding to the serial number value in its trusted execution environment. and an electronic signature of the first secret message.

可选的,确认信息发送单元44具体用于:所述从节点设备向所述主节点设备发送所述从节点设备自身的所述共享密钥。Optionally, the confirmation information sending unit 44 is specifically configured to: the slave node device sends the shared key of the slave node device itself to the master node device.

相应的,第一交易处理单元42具体用于:所述主节点设备在接收到第一预设数目个所述从节点设备返回的所述从节点设备自身的共享密钥时提交所述交易信息。Correspondingly, the first transaction processing unit 42 is specifically configured to: the master node device submits the transaction information when receiving the shared key of the slave node device itself returned by the first preset number of the slave node devices .

可选的,共识信息生成单元43具体用于:所述主节点设备在其可信执行环境中基于所述第一预设数目个所述从节点设备的共享密钥生成所述编号值对应的第二秘密信息,并向各个所述从节点设备广播所述第二秘密信息。Optionally, the consensus information generating unit 43 is specifically configured to: the master node device in its trusted execution environment generates a corresponding number value based on the shared keys of the first preset number of slave node devices. second secret information, and broadcast the second secret information to each of the slave node devices.

相应的,第二交易处理单元45具体用于:所述从节点设备在接收到所述主节点设备广播的所述编号值对应的第二秘密信息时,在所述从节点设备的可信执行环境中采用所述第一秘密信息的电子签名对所述第二秘密信息的有效性进行验证,并在确认所述第二秘密信息有效后提交所述交易信息。Correspondingly, the second transaction processing unit 45 is specifically configured to: when the slave node device receives the second secret information corresponding to the serial number value broadcast by the master node device, perform trusted execution of the slave node device The environment uses the electronic signature of the first secret information to verify the validity of the second secret information, and submits the transaction information after confirming that the second secret information is valid.

可选的,第二交易处理单元45具体用于:Optionally, the second transaction processing unit 45 is specifically used for:

从节点设备在其可信执行环境中生成所述第二秘密信息的哈希值;generating a hash value of the second secret information from the node device in its trusted execution environment;

从节点设备若确认所述第二秘密信息的哈希值与所述第一秘密信息的哈希值相同,则提交所述交易信息。If the slave node device confirms that the hash value of the second secret information is the same as the hash value of the first secret information, it submits the transaction information.

需要说明的是,上述模块之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参照方法实施例部分,此处不再赘述。It should be noted that the information exchange, execution process and other contents between the above modules are based on the same concept as the method embodiments of the present application. For specific functions and technical effects, please refer to the method embodiments section for details. Repeat.

图5为本申请另一实施例提供的一种节点设备的结构示意图。如图5所示,该实施例提供的节点设备5包括:处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机程序52,例如分布式节点设备的共识方法对应的程序。处理器50执行所述计算机程序52时实现上述各个分布式节点设备的共识方法实施例中的步骤,例如图2所示的S21~S25。或者,所述处理器50执行所述计算机程序52时实现上述各节点设备实施例中各模块/单元的功能,例如图4所示单元41~45的功能。FIG. 5 is a schematic structural diagram of a node device according to another embodiment of the present application. As shown in FIG. 5 , the node device 5 provided in this embodiment includes: a processor 50 , a memory 51 , and a computer program 52 stored in the memory 51 and running on the processor 50 , such as a distributed node device The corresponding procedure of the consensus method. When the processor 50 executes the computer program 52 , the steps in the above-mentioned embodiments of the consensus method for each distributed node device are implemented, for example, S21 to S25 shown in FIG. 2 . Alternatively, when the processor 50 executes the computer program 52, the functions of the modules/units in the above node device embodiments, for example, the functions of the units 41 to 45 shown in FIG. 4 are implemented.

示例性的,所述计算机程序52可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器51中,并由处理器50执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序52在所述节点设备5中的执行过程。例如,所述计算机程序52可以被分割成编号值确定单元、第一交易处理单元及共识信息生成单元;和/或确认信息发送单元及第二交易处理单元,各单元具体功能请参阅图2对应地实施例中的相关描述,此处不赘述。Exemplarily, the computer program 52 can be divided into one or more modules/units, and the one or more modules/units are stored in the memory 51 and executed by the processor 50 to complete the present application. . The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 52 in the node device 5 . For example, the computer program 52 can be divided into a number value determination unit, a first transaction processing unit, and a consensus information generating unit; and/or a confirmation information sending unit and a second transaction processing unit. Please refer to FIG. 2 for specific functions of each unit. The relevant descriptions in the above embodiments are not repeated here.

所述节点设备可包括但不仅限于,处理器50、存储器51。本领域技术人员可以理解,图5仅仅是节点设备5的示例,并不构成对节点设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述节点设备还可以包括输入输出设备、网络接入设备、总线等。The node device may include, but is not limited to, the processor 50 and the memory 51 . Those skilled in the art can understand that FIG. 5 is only an example of the node device 5, and does not constitute a limitation on the node device 5. It may include more or less components than the one shown, or combine some components, or different components For example, the node device may further include an input and output device, a network access device, a bus, and the like.

所称处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

所述存储器51可以是所述节点设备5的内部存储单元,例如节点设备5的硬盘或内存。所述存储器51也可以是所述节点设备5的外部存储设备,例如所述节点设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述节点设备5的内部存储单元也包括外部存储设备。所述存储器51用于存储所述计算机程序以及所述节点设备所需的其他程序和数据。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。The memory 51 may be an internal storage unit of the node device 5 , such as a hard disk or a memory of the node device 5 . The memory 51 may also be an external storage device of the node device 5, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the node device 5 card, flash card (Flash Card) and so on. Further, the memory 51 may also include both an internal storage unit of the node device 5 and an external storage device. The memory 51 is used to store the computer program and other programs and data required by the node device. The memory 51 can also be used to temporarily store data that has been output or will be output.

本申请实施例还提供了一种计算机可读存储介质。计算机可读存储介质中存储有计算机程序,计算机程序被处理器执行时可实现上述分布式节点设备的共识方法。Embodiments of the present application also provide a computer-readable storage medium. A computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the above consensus method of the distributed node device can be implemented.

本申请实施例提供了一种计算机程序产品,当计算机程序产品在节点设备上运行时,使得节点设备执行时实现可实现上述分布式节点设备的共识方法。The embodiments of the present application provide a computer program product, when the computer program product runs on a node device, the node device implements the consensus method that can implement the above-mentioned distributed node device.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述节点设备的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. The module is completed, that is, the internal structure of the node device is divided into different functional units or modules, so as to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参照其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it can still be used for the above-mentioned implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be included in the within the scope of protection of this application.

Claims (14)

1. A consensus method of distributed node equipment is applied to main node equipment in a distributed network, and is characterized in that the consensus method comprises the following steps:
numbering transaction information sent by a client in a trusted execution environment, and broadcasting the transaction information and the number value of the transaction information to each slave node device;
submitting the transaction information when receiving confirmation information which is returned by a first preset number of slave node devices and aims at the number value; the confirmation information is returned by the slave node equipment when the number value of the transaction information is determined not to be occupied by other transaction information;
generating consensus information for the number values based on the first preset number of the acknowledgement information in the trusted execution environment and broadcasting the consensus information to the respective slave node devices; the consensus information instructs the slave node device to submit the transaction information after being validated by the slave node device.
2. The consensus method of claim 1, wherein after numbering transaction information sent by a client in a trusted execution environment, the consensus method further comprises:
generating first secret information corresponding to the number value and an electronic signature of the first secret information in the trusted execution environment;
generating a shared key of each node device corresponding to the number value based on the first secret information in the trusted execution environment;
encrypting the shared key of each slave node device in the trusted execution environment to obtain a ciphertext of the shared key of each slave node device;
broadcasting an electronic signature of the first secret information and a ciphertext of the shared key of each of the slave node devices to each of the slave node devices.
3. The consensus method of claim 2, wherein said submitting said transaction information upon receiving a first preset number of acknowledgements from said slave node devices for said number value comprises:
submitting the transaction information upon receiving a first preset number of its own shared keys returned by the slave node devices.
4. The consensus method of claim 3, wherein said generating consensus information for the number value based on the first preset number of the acknowledgement information in the trusted execution environment and broadcasting the consensus information to the respective slave node devices comprises:
generating second secret information corresponding to the number value based on the shared keys of the slave node devices with the first preset number in the trusted execution environment;
broadcasting the second secret information to the respective slave node devices.
5. A consensus method of distributed node equipment is applied to slave node equipment in a distributed network, and is characterized in that the consensus method comprises the following steps:
when transaction information broadcasted by main node equipment and the number value of the transaction information are received, if the number value of the transaction information is determined not to be occupied by other transaction information, sending confirmation information aiming at the number value to the main node equipment;
and when the consensus information aiming at the number value and broadcasted by the main node equipment is received, if the consensus information is confirmed to be effective, submitting the transaction information.
6. The consensus method of claim 5, further comprising:
when receiving the electronic signature of the first secret information corresponding to the serial number value broadcasted by the master node device and the ciphertext of the shared key of the slave node device, decrypting the ciphertext of the shared key of the slave node device in a trusted execution environment of the slave node device to obtain the shared key of the slave node device;
storing the shared key of itself and an electronic signature of the first secret information in the trusted execution environment.
7. The consensus method of claim 6, wherein the submitting the transaction information upon receiving the consensus information broadcast by the master node device for the number value if the consensus information is confirmed to be valid comprises:
and when second secret information corresponding to the number value broadcasted by the main node equipment is received, verifying the validity of the second secret information by adopting the electronic signature of the first secret information in the trusted execution environment, and submitting the transaction information after confirming that the second secret information is valid.
8. The consensus method of claim 7, wherein the electronic signature of the first secret information is a hash value of the first secret information; correspondingly, the verifying the validity of the second secret information by using the electronic signature of the first secret information in the trusted execution environment, and submitting the transaction information after confirming that the second secret information is valid includes:
generating a hash value of the second secret information in the trusted execution environment;
and if the hash value of the second secret information is the same as the hash value of the first secret information, submitting the transaction information.
9. A consensus method of distributed node equipment is applied to a distributed network, and is characterized in that the consensus method comprises the following steps:
the method comprises the steps that a main node device numbers transaction information sent by a client in a trusted execution environment of the main node device, and broadcasts the transaction information and the number value of the transaction information to each slave node device;
when the slave node equipment receives the transaction information broadcasted by the master node equipment and the number value of the transaction information, if the number value of the transaction information is determined not to be occupied by other transaction information, the slave node equipment sends confirmation information aiming at the number value to the master node equipment;
the master node equipment submits the transaction information when receiving confirmation information which is returned by a first preset number of slave node equipment and aims at the serial number value;
the master node device generates consensus information aiming at the number value based on the first preset number of pieces of confirmation information in a trusted execution environment of the master node device, and broadcasts the consensus information to each slave node device;
and when the slave node equipment receives the consensus information aiming at the number value broadcast by the master node equipment, if the consensus information is confirmed to be valid, submitting the transaction information.
10. The consensus method of claim 9, wherein after the master node device numbers transaction information sent by a client in its trusted execution environment, the consensus method further comprises:
the main node equipment generates first secret information corresponding to the serial number value and an electronic signature of the first secret information in a trusted execution environment of the main node equipment;
the master node device generates a shared key of each node device corresponding to the serial number value in a trusted execution environment of the master node device based on the first secret information;
the master node device encrypts the shared key of each slave node device in a trusted execution environment of the master node device to obtain a ciphertext of the shared key of each slave node device;
the master node device broadcasts the electronic signature of the first secret information and the ciphertext of the shared key of each slave node device to each slave node device;
when the slave node device receives the electronic signature of the first secret information corresponding to the serial number value broadcast by the master node device and the ciphertext of the shared key of each slave node device, decrypting the ciphertext of the shared key of the slave node device in a trusted execution environment of the slave node device to obtain the shared key of the slave node device;
the slave node device stores the shared key of itself and an electronic signature of the first secret information in its trusted execution environment.
11. The consensus method of claim 10, wherein the slave node device transmitting acknowledgement information for the number value to the master node device comprises:
the slave node device sends the shared key of the slave node device to the master node device;
correspondingly, when receiving the confirmation information for the number value returned by the slave node devices of the first preset number, the submitting the transaction information by the master node device includes:
and submitting the transaction information by the master node equipment when receiving the self shared key of the slave node equipment returned by the slave node equipment with a first preset number.
12. A node apparatus, comprising:
the system comprises a number value determining unit, a transaction processing unit and a plurality of slave node devices, wherein the number value determining unit is used for numbering transaction information sent by a client in a trusted execution environment and broadcasting the transaction information and the number value of the transaction information to each slave node device;
the first transaction processing unit is used for submitting the transaction information when receiving confirmation information which is returned by a first preset number of slave node devices and aims at the serial number value; the confirmation information is returned by the slave node equipment when the number value of the transaction information is determined not to be occupied by other transaction information;
a common identification information generating unit configured to generate common identification information for the number value based on the first preset number of pieces of the acknowledgement information in the trusted execution environment, and broadcast the common identification information to each of the slave node devices; the consensus information instructs the slave node device to submit the transaction information after being validated by the slave node device; and/or
The system comprises a confirmation information sending unit, a confirmation information sending unit and a processing unit, wherein the confirmation information sending unit is used for sending confirmation information aiming at a number value to the main node equipment if the number value of the transaction information is determined not to be occupied by other transaction information when the transaction information broadcasted by the main node equipment and the number value of the transaction information are received;
and the second transaction processing unit is used for submitting the transaction information if the consensus information aiming at the number value broadcasted by the main node equipment is confirmed to be valid when the consensus information is received.
13. A node device, characterized in that the node device comprises a processor, a memory and a computer program stored in the memory and executable on the processor, the processor implementing the consensus method as claimed in any one of claims 1 to 4 or as claimed in any one of claims 5 to 8 when executing the computer program.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the consensus method as claimed in one of the claims 1 to 4 or in one of the claims 5 to 8.
CN202011630328.3A 2020-12-30 2020-12-30 Consensus method of distributed node equipment, node equipment and distributed network Active CN112865959B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011630328.3A CN112865959B (en) 2020-12-30 2020-12-30 Consensus method of distributed node equipment, node equipment and distributed network
PCT/CN2021/073329 WO2022141700A1 (en) 2020-12-30 2021-01-22 Consensus method for distributed node device, node device and distributed network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011630328.3A CN112865959B (en) 2020-12-30 2020-12-30 Consensus method of distributed node equipment, node equipment and distributed network

Publications (2)

Publication Number Publication Date
CN112865959A true CN112865959A (en) 2021-05-28
CN112865959B CN112865959B (en) 2022-05-31

Family

ID=75999805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011630328.3A Active CN112865959B (en) 2020-12-30 2020-12-30 Consensus method of distributed node equipment, node equipment and distributed network

Country Status (2)

Country Link
CN (1) CN112865959B (en)
WO (1) WO2022141700A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923093A (en) * 2021-10-29 2022-01-11 博雅正链(北京)科技有限公司 Novel Byzantine fault-tolerant consensus method based on trusted execution environment
CN115048337A (en) * 2022-08-15 2022-09-13 南方科技大学 Byzantine fault-tolerant consensus method based on TEE and related equipment
CN115134145A (en) * 2022-06-28 2022-09-30 蚂蚁区块链科技(上海)有限公司 Consensus method, device and node in block chain system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002143B (en) * 2022-08-01 2023-01-20 北京奥星贝斯科技有限公司 Node election method and device, storage medium and electronic equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220130A (en) * 2017-05-12 2017-09-29 北京众享比特科技有限公司 A kind of information common recognition method realized at the node of block chain, apparatus and system
CN108111604A (en) * 2017-12-21 2018-06-01 广州广电运通金融电子股份有限公司 Block chain common recognition methods, devices and systems, identification information treating method and apparatus
CN109064328A (en) * 2018-07-09 2018-12-21 夸克链科技(深圳)有限公司 A kind of construction and its common recognition algorithm of novel block chain
US20190097790A1 (en) * 2017-09-22 2019-03-28 NEC Laboratories Europe GmbH Scalable byzantine fault-tolerant protocol with partial tee support
CN109727029A (en) * 2018-12-18 2019-05-07 杭州茂财网络技术有限公司 A kind of alliance's chain common recognition method and system
CN109995536A (en) * 2019-03-15 2019-07-09 广州杰赛科技股份有限公司 A kind of block chain common recognition method, apparatus and readable storage medium storing program for executing
CN110291756A (en) * 2018-11-07 2019-09-27 阿里巴巴集团控股有限公司 Recover encrypted transaction information in Blockchain Confidential Transactions
US20190354977A1 (en) * 2017-04-28 2019-11-21 Alibaba Group Holding Limited Consensus verification method and device
CN110636113A (en) * 2019-08-23 2019-12-31 上海电力大学 Blockchain Byzantine fault-tolerant consensus method, system, device and storage medium
US20200120157A1 (en) * 2019-09-05 2020-04-16 Alibaba Group Holding Limited System and method for adding node in blockchain network
CN111191292A (en) * 2019-12-16 2020-05-22 平安壹钱包电子商务有限公司 Accounting method, apparatus, system, and computer-readable storage medium
CN111612455A (en) * 2020-04-21 2020-09-01 国网江苏省电力有限公司电力科学研究院 A Byzantine Fault Tolerant Consortium Chain Consensus Method for Protection of Electricity Information and Its System and Storage Medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3337119B1 (en) * 2016-12-13 2019-09-11 Nxp B.V. Updating and distributing secret keys in a distributed network

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190354977A1 (en) * 2017-04-28 2019-11-21 Alibaba Group Holding Limited Consensus verification method and device
CN107220130A (en) * 2017-05-12 2017-09-29 北京众享比特科技有限公司 A kind of information common recognition method realized at the node of block chain, apparatus and system
US20190097790A1 (en) * 2017-09-22 2019-03-28 NEC Laboratories Europe GmbH Scalable byzantine fault-tolerant protocol with partial tee support
CN108111604A (en) * 2017-12-21 2018-06-01 广州广电运通金融电子股份有限公司 Block chain common recognition methods, devices and systems, identification information treating method and apparatus
CN109064328A (en) * 2018-07-09 2018-12-21 夸克链科技(深圳)有限公司 A kind of construction and its common recognition algorithm of novel block chain
CN110291756A (en) * 2018-11-07 2019-09-27 阿里巴巴集团控股有限公司 Recover encrypted transaction information in Blockchain Confidential Transactions
CN109727029A (en) * 2018-12-18 2019-05-07 杭州茂财网络技术有限公司 A kind of alliance's chain common recognition method and system
CN109995536A (en) * 2019-03-15 2019-07-09 广州杰赛科技股份有限公司 A kind of block chain common recognition method, apparatus and readable storage medium storing program for executing
CN110636113A (en) * 2019-08-23 2019-12-31 上海电力大学 Blockchain Byzantine fault-tolerant consensus method, system, device and storage medium
US20200120157A1 (en) * 2019-09-05 2020-04-16 Alibaba Group Holding Limited System and method for adding node in blockchain network
CN111191292A (en) * 2019-12-16 2020-05-22 平安壹钱包电子商务有限公司 Accounting method, apparatus, system, and computer-readable storage medium
CN111612455A (en) * 2020-04-21 2020-09-01 国网江苏省电力有限公司电力科学研究院 A Byzantine Fault Tolerant Consortium Chain Consensus Method for Protection of Electricity Information and Its System and Storage Medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923093A (en) * 2021-10-29 2022-01-11 博雅正链(北京)科技有限公司 Novel Byzantine fault-tolerant consensus method based on trusted execution environment
CN113923093B (en) * 2021-10-29 2024-02-06 博雅正链(北京)科技有限公司 Novel Bayesian-preemption fault-tolerant consensus method based on trusted execution environment
CN115134145A (en) * 2022-06-28 2022-09-30 蚂蚁区块链科技(上海)有限公司 Consensus method, device and node in block chain system
CN115134145B (en) * 2022-06-28 2023-10-20 蚂蚁区块链科技(上海)有限公司 Consensus method, apparatus, computing device and computer readable storage medium in blockchain system
CN115048337A (en) * 2022-08-15 2022-09-13 南方科技大学 Byzantine fault-tolerant consensus method based on TEE and related equipment
CN115048337B (en) * 2022-08-15 2022-11-08 南方科技大学 Byzantine fault-tolerant consensus method based on TEE and related equipment

Also Published As

Publication number Publication date
WO2022141700A1 (en) 2022-07-07
CN112865959B (en) 2022-05-31

Similar Documents

Publication Publication Date Title
US11323271B2 (en) Retrieving public data for blockchain networks using highly available trusted execution environments
CN110998581B (en) Program execution and data authentication scheme using multi-key pair signatures
CN110914851B (en) Improving integrity of communications between a blockchain network and external data sources
CN110999255B (en) Method and device for retrieving access data of block chain network
CN109714168B (en) Trusted remote attestation method, device and system
JP6547079B1 (en) Registration / authorization method, device and system
CN112651037B (en) Out-of-chain data access method and system for block chain system
CN112926051B (en) Multi-party secure computing method and device
WO2022095244A1 (en) Cross-chain transaction method, system and apparatus, device, and storage medium
WO2019119929A1 (en) Block chain consensus method, apparatus and system, and identification information processing method and apparatus
CN115567324B (en) Data encryption transmission method, system, computer equipment and storage medium
CN112865959A (en) Consensus method of distributed node equipment, node equipment and distributed network
CN113987554B (en) Method, device and system for obtaining data authorization
CN112311718A (en) Method, apparatus, device and storage medium for detecting hardware
WO2026045825A1 (en) Quantum-resistant security enhancement method for openid connect
WO2026045840A1 (en) Quantum-resistant security enhancement method for cryptographic device secure channel protocol
US11570008B2 (en) Pseudonym credential configuration method and apparatus
CN118573369A (en) Threshold multi-center attribute base encryption method for high Bayesian and busy-court fault tolerance threshold
CN107332833A (en) Method of calibration and device
CN115118428A (en) Method and device for controlling cryptographic parameters in trusted blockchain and trusted blockchain system
CN114205086B (en) Digital certificate processing method and device based on blockchain
CN116599771B (en) Data hierarchical protection transmission method and device, storage medium and terminal
CN116248250A (en) Model parameter transmission method, device and readable storage medium
CN118300902A (en) Identity authentication method and device, computer program product and electronic equipment
CN117675244A (en) Task key distribution method and device based on cluster environment

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
CB03 Change of inventor or designer information

Inventor after: Qiu Weiwei

Inventor after: Li Wei

Inventor after: Zhang Kejie

Inventor after: Huang Fanglei

Inventor after: Hu Maifang

Inventor after: Wang Guangren

Inventor before: Qiu Weiwei

Inventor before: Li Wei

Inventor before: Zhang Kejie

Inventor before: Huang Fanglei

Inventor before: Hu Maifang

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310051 Zhejiang Province, Hangzhou City, Binjiang District, Xixing Street, Yue Ming Road 199, Building 2, Room 1701

Patentee after: Hangzhou Qulian Technology Co., Ltd.

Country or region after: China

Address before: Room 2001, building a, building 2, 399 Danfeng Road, Binjiang District, Hangzhou, Zhejiang 310000

Patentee before: HANGZHOU HYPERCHAIN TECHNOLOGIES Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address