IP Library Granted Patent US 12,284,295
Granted Patent B2
US 12,284,295 · App. 17/773,558 · Granted Apr 22, 2025

Consensus method for blockchain, consensus node, electronic device, and storage medium

Inventor: Shuang Zhang (Beijing, CN)
Assignee: Jingdong Technology Information Technology Co., Ltd.
H04L9/50H04L9/3236
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,284,295
App. No.
17/773,558
Granted
Apr 22, 2025
Kind
B2
Abstract

The present application provides a consensus method for a blockchain, a consensus node, an electronic device, and a storage medium. The method includes: receiving a transaction request sent by an object, calculating a first hash value of executing the at least one transaction task by a consensus node, determining a second hash value according to the first hash value and the at least one transaction task, receiving third hash values broadcasted by other consensus nodes, and generating and adding to the blockchain a block containing the first hash value in response to the second hash value being the same as at least half of the third hash values.

Claims (54)

1. A consensus method for a blockchain, applied to a system comprising a plurality of consensus nodes, each of the plurality of consensus nodes being a server, the method comprising:

receiving, by a consensus node in the plurality of consensus nodes, a transaction request sent by a terminal device, wherein the transaction request carries at least one transaction task;

calculating, by the consensus node, a first hash value of executing the at least one transaction task;

determining, by the consensus node, a second hash value according to the first hash value and the at least one transaction task;

broadcasting, by the consensus node, the transaction request;

receiving, by other consensus nodes in the plurality of consensus nodes, the transaction request broadcasted by the consensus node;

determining a third hash value, by each of the other consensus nodes, according to a result of executing the at least one transaction task and the at least one transaction task;

broadcasting, by each of the other consensus nodes, the determined third hash value;

receiving, by the consensus node, third hash values broadcasted by the other consensus nodes;

acquiring, by the consensus node, a total number of the third hash values, and acquiring, by the consensus node, a same number of third hash values that are the same as the second hash value; and

judging, by the consensus node, whether the total number is less than or equal to twice of the same number; and

performing, by the consensus node, generating and adding a block containing the first hash value if the total number is less than or equal to twice of the same number.

2. The method according to claim 1 , wherein after receiving, by the consensus node, the third hash values broadcasted by the other consensus nodes, the method further comprises:

generating and feeding back feedback, by the consensus node, information of consensus failure to the terminal device in response to less than half of the third hash values being the same as the second hash value.

3. The method according to claim 2 , wherein after the receiving, by the consensus node, the third hash values broadcasted by the other consensus nodes, the method further comprises:

rolling back, by the consensus node, the at least one transaction task in response to less than half of the third hash values being the same as the second hash value.

4. The method according to claim 1 , wherein after the receiving, by the consensus node, the third hash values broadcasted by the other consensus nodes, the method further comprises:

rolling back, by the consensus node, the at least one transaction task in response to less than half of the third hash values being the same as the second hash value.

5. The method according to claim 1 , wherein the block is used to record the result of executing the at least one transaction task.

6. A consensus node, wherein the consensus node comprises:

at least one processor; and

a memory communicatively connected with the at least one processor; wherein,

the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is configured to:

receive a transaction request sent by a terminal device and broadcast the transaction request, wherein the transaction request carries at least one transaction task;

calculate a first hash value of executing the at least one transaction task by the consensus node;

determine a second hash value according to the first hash value and the at least one transaction task;

receive third hash values broadcasted by other consensus nodes, wherein each of the other consensus nodes is a server, each of the third hash values is determined by each of the other consensus nodes according to a result of executing the at least one transaction task in the transaction request broadcasted by the consensus node by the each of the other consensus nodes and the at least one transaction task;

acquire a total number of the third hash values, and acquire a same number of third hash values that are the same as the second hash value; and

judge whether the total number is less than or equal to twice of the same number; and

perform generating and adding a block containing the first hash value if the total number is less than or equal to twice of the same number.

7. The consensus node according to claim 6 , wherein the at least one processor is further configured to:

generate feedback information of consensus failure in response to less than half of the third hash values being the same as the second hash value; and

feed back the feedback information to the terminal device.

8. The consensus node according to claim 7 , wherein the at least one processor is further configured to:

roll back the at least one transaction task in response to less than half of the third hash values being the same as the second hash value.

9. The consensus node according to claim 6 , wherein the at least one processor is further configured to:

roll back the at least one transaction task in response to less than half of the third hash values being the same as the second hash value.

10. The consensus node according to claim 6 , wherein the block is used to record the result of executing the at least one transaction task.

11. A non transitory computer-readable storage medium having an instruction stored therein, wherein when the instruction is run on a computer, the computer is caused to:

receive a transaction request sent by a terminal device and broadcast the transaction request, wherein the transaction request carries at least one transaction task;

calculate a first hash value of executing the at least one transaction task by the consensus node;

determine a second hash value according to the first hash value and the at least one transaction task;

receive third hash values broadcasted by other consensus nodes, wherein each of the other consensus nodes is a server, each of the third hash values is determined by each of the other consensus nodes according to a result of executing the at least one transaction task in the transaction request broadcasted by the consensus node by the each of the other consensus nodes and the at least one transaction task;

acquire a total number of the third hash values, and acquire a same number of third hash values that are the same as the second hash value; and

judge whether the total number is less than or equal to twice of the same number; and

perform generating and adding a block containing the first hash value if the total number is less than or equal to twice of the same number.

12. The non-transitory computer-readable storage medium according to claim 11 , wherein when the instruction is run on the computer, the computer is further caused to:

generate feedback information of consensus failure in response to less than half of the third hash values being the same as the second hash value; and

feed back the feedback information to the terminal device.

13. The non-transitory computer-readable storage medium according to claim 12 , wherein when the instruction is run on the computer, the computer is further caused to:

roll back the at least one transaction task in response to less than half of the third hash values being the same as the second hash value.

14. The non-transitory computer-readable storage medium according to claim 12 , wherein the block is used to record the result of executing the at least one transaction task.

15. The non-transitory computer-readable storage medium according to claim 11 , wherein when the instruction is run on the computer, the computer is further caused to:

roll back the at least one transaction task in response to less than half of the third hash values being the same as the second hash value.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 2, 2022
From: ZHANG, SHUANG
To: JINGDONG TECHNOLOGY INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 059780/0849 →
Priority Claims (1)
CN 201911041448.7 · Oct 30, 2019 · national
Continuity (1)
Related Publication 20220407726A1 · Dec 22, 2022
References Cited (29)
US 11316659B2 · van de Ruit · 2022 [cited by examiner]
US 11438181B1 · Yamada · 2022 [cited by examiner]
US 20180248880A1 · Sardesai et al. · 2018 [cited by applicant]
US 20190182028A1 · Arquero et al. · 2019 [cited by applicant]
US 20210117410A1 · Sekniqi · 2021 [cited by examiner]
US 20210192512A1 · Che · 2021 [cited by examiner]
CN 107493162A · 2017 [cited by applicant]
CN 108985732A · 2018 [cited by applicant]
CN 108989052A · 2018 [cited by applicant]
CN 109409122A · 2019 [cited by applicant]
CN 109995536A · 2019 [cited by applicant]
CN 110009759A · 2019 [cited by applicant]
CN 110032880A · 2019 [cited by applicant]
CN 110084601A · 2019 [cited by applicant]
CN 110222537A · 2019 [cited by applicant]
CN 110233737A · 2019 [cited by applicant]
CN 110825755A · 2020 [cited by applicant]
WO WO2019028442A1 · 2019 [cited by applicant]
WO WO2019038839A1 · 2019 [cited by applicant]
First Examination Opinion Notice dated May 28, 2020 for Chinese application No. 201911041448.7. [cited by applicant]
Tuyet Duong et al., “2-hop Blockchain: Combining Proof-of-Work and Proof-of-Stake Securely,” Apr. 15, 2017, pp. 1-43. [cited by applicant]
Yuan Yong et al., “Blockchain Consensus Algorithms: The State of the Art and Future Trends,” ACTA Automatica Sinica, vol. 44, No. 11, Nov. 2018, pp. 2011-2022. [cited by applicant]
Second Examination Opinion Notice dated Aug. 12, 2020 for Chinese application No. 201911041448.7. [cited by applicant]
Third Examination Opinion Notice dated Nov. 17, 2020 for Chinese application No. 201911041448.7. [cited by applicant]
International Search Report dated Jul. 24, 2020 for PCT application No. PCT/CN2020/077538. [cited by applicant]
Han Xuan et al., “Security Problems on Blockchain: The State of the Art and Future Trends,” ACTA Automatica Sinica, vol. 45, No. 1, Jan. 2019, pp. 206-225. [cited by applicant]
Notice of Allowance dated Feb. 20, 2021 for Chinese application No. 21911041448.7. [cited by applicant]
Extended European Search Report dated Oct. 4, 2023 regarding European Application No. 20881893.0. [cited by applicant]
Andreas M Antonopoulos: “Mastering Bitcoin”, Jul. 21, 2017, ISBN: 978-1-4919-5438-6, Retrieved from the Internet: URL:https://www.oreilly.com/library/view/mastering-bitcoin-2nd/9781491954379/. [cited by applicant]