IP Library Granted Patent US 10,795,778
Granted Patent B2
US 10,795,778 · App. 16/430,077 · Granted Oct 6, 2020

Shared data recovery method and apparatus, computer device, and storage medium

Inventors: Rui Guo (Shenzhen, CN); Maocai Li (Shenzhen, CN); Jianjun Zhang (Shenzhen, CN); Haitao Tu (Shenzhen, CN); Qi Zhao (Shenzhen, CN); Zongyou Wang (Shenzhen, CN); Jun Liang (Shenzhen, CN); Dawei Zhu (Shenzhen, CN); Lisheng Chen (Shenzhen, CN); Binhua Liu (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06F11/1464G06F11/1469G06F16/1824H04L9/0643H04L9/0894H04L9/3239H04L2209/38
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 10,795,778
App. No.
16/430,077
Granted
Oct 6, 2020
Kind
B2
Abstract

This application relates to a shared data recovery method performed at a first node of a data sharing system. The first node obtains a first eigenvalue of a first node after receiving a recovery request carrying a first block height; broadcasts the first eigenvalue to at least one second node and recovery indication information to the at least one second node. After determining, based on the first eigenvalue and a plurality of second eigenvalues, that data in shared data stored by all nodes of the data sharing system is consistent, the first node recovers data within a range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information, thereby ensuring consistency and security of data included in a block, and reducing pressure on a node of the data sharing system to store the shared data.

Claims (62)

1. A shared data recovery method performed at a first node, the first node being any node of a data sharing system, and the method comprising:

obtaining a first eigenvalue of the first node after receiving a recovery request carrying a first block height, the first eigenvalue being used to uniquely indicate data within a range of the first block height in shared data stored by the first node;

broadcasting the first eigenvalue to at least one second node of the data sharing system, the second node being a node other than the first node;

broadcasting recovery indication information to the at least one second node after receiving a plurality of second eigenvalues broadcast by the at least one second node, each second eigenvalue being used to uniquely indicate data within the range of the first block height in shared data stored by the second node;

determining, based on the first eigenvalue and the plurality of second eigenvalues, that data within the range of the first block height in the shared data stored by all nodes of the data sharing system is consistent; and

recovering the data within the range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information.

2. The method according to claim 1 , wherein the obtaining a first eigenvalue of the first node comprises:

extracting the first block height from the recovery request;

determining, in the shared data based on the first block height, to-be-recovered data within the range of the first block height; and

calculating an eigenvalue of the data within the range of the first block height based on a hash algorithm, to obtain the first eigenvalue of the first node.

3. The method according to claim 1 , wherein the determining, based on the first eigenvalue and the plurality of second eigenvalues, that data within the range of the first block height in shared data stored by all nodes of the data sharing system is consistent further comprises:

determining, when a quantity of equal eigenvalues comprised in the first eigenvalue and the plurality of second eigenvalues reaches the preset quantity, that the data within the range of the first block height in the shared data stored by all the nodes of the data sharing system is consistent, and broadcasting the recovery indication information to the at least one second node.

4. The method according to claim 1 , wherein after the recovering the data within the range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information, the method further comprises:

maintaining a current block eigenvalue of a block corresponding to the first block height.

5. The method according to claim 1 , wherein the method further comprises:

determining, when detecting that remaining storage space of the first node is smaller than preset storage space, a second block height based on a daily shared information amount of the data sharing system and the remaining storage space; and broadcasting, to the at least one second node of the data sharing system, a recovery request carrying the second block height.

6. The method according to claim 1 , wherein the method further comprises:

determining a second block height within each preset period based on a daily shared information amount of the data sharing system; and broadcasting, to the at least one second node of the data sharing system, a recovery request carrying the second block height.

7. The method according to claim 1 , wherein the method further comprises:

determining a second block height based on a daily shared information amount of the data sharing system when detecting that a data amount of currently stored shared data is greater than a preset data amount; and broadcasting, to the at least one second node of the data sharing system, a recovery request carrying the second block height.

8. The method according to claim 1 , wherein the method further comprises:

determining, in mirror data of the shared data, mirror data within the range of the first block height if receiving a plurality of pieces of recovery indication information broadcast by the at least one second node;

obtaining a second eigenvalue of the mirror data within the range of the first block height; and

recovering the mirror data within the range of the first block height from the mirror data of the shared data, and storing the second eigenvalue into remaining mirror data.

9. A first node of a data sharing system, the first node comprising: one or more processors, memory, and a plurality of machine readable instructions stored in the memory, wherein the plurality of machine readable instructions, when executed by the one or more processors, cause the first node to perform a plurality of operations including:

obtaining a first eigenvalue of the first node after receiving a recovery request carrying a first block height, the first eigenvalue being used to uniquely indicate data within a range of the first block height in shared data stored by the first node;

broadcasting the first eigenvalue to at least one second node of the data sharing system, the second node being a node other than the first node;

broadcasting recovery indication information to the at least one second node after receiving a plurality of second eigenvalues broadcast by the at least one second node, each second eigenvalue being used to uniquely indicate data within the range of the first block height in shared data stored by the second node;

determining, based on the first eigenvalue and the plurality of second eigenvalues, that data within the range of the first block height in the shared data stored by all nodes of the data sharing system is consistent; and

recovering the data within the range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information.

10. The first node according to claim 9 , wherein the obtaining a first eigenvalue of the first node comprises:

extracting the first block height from the recovery request;

determining, in the shared data based on the first block height, to-be-recovered data within the range of the first block height; and

calculating an eigenvalue of the data within the range of the first block height based on a hash algorithm, to obtain the first eigenvalue of the first node.

11. The first node according to claim 9 , wherein the determining, based on the first eigenvalue and the plurality of second eigenvalues, that data within the range of the first block height in shared data stored by all nodes of the data sharing system is consistent further comprises:

determining, when a quantity of equal eigenvalues comprised in the first eigenvalue and the plurality of second eigenvalues reaches the preset quantity, that the data within the range of the first block height in the shared data stored by all the nodes of the data sharing system is consistent, and broadcasting the recovery indication information to the at least one second node.

12. The first node according to claim 9 , wherein the plurality of operations further comprise:

after recovering the data within the range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information, maintaining a current block eigenvalue of a block corresponding to the first block height.

13. The first node according to claim 9 , wherein the plurality of operations further comprise:

determining, when detecting that remaining storage space of the first node is smaller than preset storage space, a second block height based on a daily shared information amount of the data sharing system and the remaining storage space; and broadcasting, to the at least one second node of the data sharing system, a recovery request carrying the second block height.

14. The first node according to claim 9 , wherein the plurality of operations further comprise:

determining a second block height within each preset period based on a daily shared information amount of the data sharing system; and broadcasting, to the at least one second node of the data sharing system, a recovery request carrying the second block height.

15. The first node according to claim 9 , wherein the plurality of operations further comprise:

determining a second block height based on a daily shared information amount of the data sharing system when detecting that a data amount of currently stored shared data is greater than a preset data amount; and broadcasting, to the at least one second node of the data sharing system, a recovery request carrying the second block height.

16. The first node according to claim 9 , wherein the plurality of operations further comprise:

determining, in mirror data of the shared data, mirror data within the range of the first block height if receiving a plurality of pieces of recovery indication information broadcast by the at least one second node;

obtaining a second eigenvalue of the mirror data within the range of the first block height; and

recovering the mirror data within the range of the first block height from the mirror data of the shared data, and storing the second eigenvalue into remaining mirror data.

17. A non-transitory computer readable storage medium storing a plurality of machine readable instructions in connection with a first node of a data sharing system having one or more processors, wherein the plurality of machine readable instructions, when executed by the one or more processors, cause the first node to perform a plurality of operations including:

obtaining a first eigenvalue of the first node after receiving a recovery request carrying a first block height, the first eigenvalue being used to uniquely indicate data within a range of the first block height in shared data stored by the first node;

broadcasting the first eigenvalue to at least one second node of the data sharing system, the second node being a node other than the first node;

broadcasting recovery indication information to the at least one second node after receiving a plurality of second eigenvalues broadcast by the at least one second node, each second eigenvalue being used to uniquely indicate data within the range of the first block height in shared data stored by the second node;

determining, based on the first eigenvalue and the plurality of second eigenvalues, that data within the range of the first block height in the shared data stored by all nodes of the data sharing system is consistent; and

recovering the data within the range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information.

18. The non-transitory computer readable storage medium according to claim 17 , wherein the obtaining a first eigenvalue of the first node comprises:

extracting the first block height from the recovery request;

determining, in the shared data based on the first block height, to-be-recovered data within the range of the first block height; and

calculating an eigenvalue of the data within the range of the first block height based on a hash algorithm, to obtain the first eigenvalue of the first node.

19. The non-transitory computer readable storage medium according to claim 17 , wherein the determining, based on the first eigenvalue and the plurality of second eigenvalues, that data within the range of the first block height in shared data stored by all nodes of the data sharing system is consistent further comprises:

determining, when a quantity of equal eigenvalues comprised in the first eigenvalue and the plurality of second eigenvalues reaches the preset quantity, that the data within the range of the first block height in the shared data stored by all the nodes of the data sharing system is consistent, and broadcasting the recovery indication information to the at least one second node.

20. The non-transitory computer readable storage medium according to claim 17 , wherein the plurality of operations further comprise:

after recovering the data within the range of the first block height in the shared data after receiving a preset quantity of a plurality of pieces of recovery indication information, maintaining a current block eigenvalue of a block corresponding to the first block height.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 18, 2019
From: GUO, RUI; LI, MAOCAI; ZHANG, JIANJUN; TU, HAITAO; WANG, ZONGYOU; LIANG, JUN; ZHU, DAWEI; CHEN, LISHENG; LIU, BINHUA
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 051041/0651 →
Priority Claims (1)
CN 2017 1 0055111 · Jan 24, 2017 · national
Continuity (2)
Continuation PCTCN2018073884 · Jan 23, 2018
Related Publication 20190286532A1 · Sep 19, 2019