IP Library › Granted Patent US 12,730,724
Granted Patent B2
US 12,730,724 · App. 18/897,115 · Granted Sep 8, 2026

Metadata tree snapshot method and apparatus, metadata tree query method and apparatus, and electronic device

Inventors: Biao Cao (Shenzhen, CN); Jiwei Xiong (Shenzhen, CN); Yiduo Wang (Shenzhen, CN); Qiushi Chen (Shenzhen, CN); Yan Xing (Shenzhen, CN)
Assignee: Baidu International Technology (Shenzhen) Co., Ltd.
G06F11/1451G06F16/2343G06F16/24535G06F2201/80
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,730,724
App. No.
18/897,115
Granted
Sep 8, 2026
Kind
B2
Abstract

The present disclosure provides a metadata tree snapshot method and apparatus, a metadata tree query method and apparatus, and an electronic device, and relates to the field of data processing technology, and in particular to the field of cloud computing and cloud database technology. The specific realization scheme is as follows: acquiring a basic metadata tree and a first incremental metadata tree, where the basic metadata tree is created based on first snapshot data, the basic metadata tree is locked after being created, the first snapshot data is created at a previous snapshot time instant, and the first incremental metadata tree is created based on a metadata change operation after the basic metadata tree is created; locking the first incremental metadata tree in response to reaching a current snapshot time instant; and creating second snapshot data based on the basic metadata tree and the locked first incremental metadata tree.

Claims (61)

1 . A metadata tree snapshot method, comprising:

acquiring a basic metadata tree and a first incremental metadata tree, wherein the basic metadata tree is created based on first snapshot data, the basic metadata tree is locked after being created, the first snapshot data is created at a previous snapshot time instant, and the first incremental metadata tree is created based on a metadata change operation after the basic metadata tree is created;

locking the first incremental metadata tree in response to reaching a current snapshot time instant; and

creating second snapshot data based on the basic metadata tree and the locked first incremental metadata tree;

wherein after the locking the first incremental metadata tree, the method further comprises:

creating a second incremental metadata tree based on a metadata change operation after the current snapshot time instant and before completion of the creating the second snapshot data.

2 . The method according to claim 1 , further comprising:

determining, in response to receiving a first metadata query request, a first metadata query result based on the basic metadata tree, the first incremental metadata tree and the second incremental metadata tree during a process of creating the second snapshot data.

3 . The method according to claim 2 , wherein nodes of the first incremental metadata tree and nodes of the second incremental metadata tree both store operation types of metadata change operations, and the determining the first metadata query result based on the basic metadata tree, the first incremental metadata tree and the second incremental metadata tree comprises:

performing a metadata query on the basic metadata tree to obtain a first subquery result;

performing a metadata query on the first incremental metadata tree to obtain a second subquery result;

performing a metadata query on the second incremental metadata tree to obtain a third subquery result; and

merging the first subquery result, the second subquery result and the third subquery result based on operation types stored in nodes comprised in the second subquery result and operation types stored in nodes comprised in the third subquery result to obtain a first metadata query result.

4 . The method according to claim 1 , wherein after completion of the creating of the second snapshot data, the method further comprises:

generating a new basic metadata tree based on the second snapshot data, and taking the second incremental metadata tree as a new first incremental metadata tree.

5 . The method according to claim 1 , further comprising:

determining, in response to receiving a second metadata query request, a second metadata query result based on the basic metadata tree and the first incremental metadata tree before the creating of the second snapshot data or after completion of the creating of the second snapshot data.

6 . The method according to claim 5 , wherein a node of the first incremental metadata tree stores an operation type of a metadata change operation, and the determining the second metadata query result based on the basic metadata tree and the first incremental metadata tree comprises:

performing a metadata query on the basic metadata tree to obtain a fourth subquery result;

performing a metadata query on the first incremental metadata tree to obtain a fifth subquery result; and

merging the fourth subquery result and the fifth subquery result based on an operation type stored in a node comprised in the fifth subquery result to obtain the second metadata query result.

7 . The method according to claim 1 , wherein the creating the second snapshot data based on the basic metadata tree and the locked first incremental metadata tree comprises:

constructing a merged metadata tree based on the basic metadata tree and the locked first incremental metadata tree; and

creating the second snapshot data based on the merged metadata tree.

8 . The method according to claim 1 , wherein the basic metadata tree comprises any one of the following:

a directory tree in a distributed file system; or

a metadata tree composed of metadata corresponding to data shards in a distributed database.

9 . A metadata tree query method, comprising:

acquiring a basic metadata tree, a first incremental metadata tree and a second incremental metadata tree, wherein the basic metadata tree is created based on first snapshot data, the basic metadata tree is locked after being created, the first snapshot data is created at a previous snapshot time instant, and the first incremental metadata tree is created based on a metadata change operation after the basic metadata tree is created, and is locked during a process of creating snapshot data, the second incremental metadata tree is created based on a metadata change operation during the process of creating snapshot data; and

during the process of creating snapshot data, determining a first metadata query result based on the basic metadata tree, the first incremental metadata tree and the second incremental metadata tree in response to receiving a first metadata query request.

10 . The method according to claim 9 , wherein nodes of the first incremental metadata tree and nodes of the second incremental metadata tree both store operation types of metadata change operations, and the determining the first metadata query result based on the basic metadata tree, the first incremental metadata tree and the second incremental metadata tree comprises:

performing a metadata query on the basic metadata tree to obtain a first subquery result;

performing a metadata query on the first incremental metadata tree to obtain a second subquery result;

performing a metadata query on the second incremental metadata tree to obtain a third subquery result; and

merging the first subquery result, the second subquery result and the third subquery result based on operation types stored in nodes comprised in the second subquery result and operation types stored in nodes comprised in the third subquery result to obtain the first metadata query result.

11 . A metadata tree snapshot apparatus, comprising:

at least one processor; and

a memory communicatively connected to the at least one processor; wherein the memory stores an instruction executable by the at least one processor, and the instruction is executed by the at least one processor to enable the at least one processor to:

acquire a basic metadata tree and a first incremental metadata tree, wherein the basic metadata tree is created based on first snapshot data, the basic metadata tree is locked after being created, the first snapshot data is created at a previous snapshot time instant, and the first incremental metadata tree is created based on a metadata change operation after the basic metadata tree is created;

lock the first incremental metadata tree in response to reaching a current snapshot time instant;

create second snapshot data based on the basic metadata tree and the locked first incremental metadata tree; and

after locking the first incremental metadata tree, create a second incremental metadata tree based on a metadata change operation after the current snapshot time instant and before completion of the creating the second snapshot data.

12 . The apparatus according to claim 11 , wherein the at least one processor is further enabled to:

determine, in response to receiving a first metadata query request, a first metadata query result based on the basic metadata tree, the first incremental metadata tree and the second incremental metadata tree during a process of creating the second snapshot data.

13 . The apparatus according to claim 12 , wherein nodes of the first incremental metadata tree and nodes of the second incremental metadata tree both store operation types of metadata change operations, and when determining the first metadata query result based on the basic metadata tree, the first incremental metadata tree and the second incremental metadata tree, the at least one processor is specifically enabled to:

perform a metadata query on the basic metadata tree to obtain a first subquery result;

perform a metadata query on the first incremental metadata tree to obtain a second subquery result;

perform a metadata query on the second incremental metadata tree to obtain a third subquery result; and

merge the first subquery result, the second subquery result and the third subquery result based on operation types stored in nodes comprised in the second subquery result and operation types stored in nodes comprised in the third subquery result to obtain a first metadata query result.

14 . The apparatus according to claim 11 , wherein the at least one processor is further enabled to:

generate a new basic metadata tree based on the second snapshot data and take the second incremental metadata tree as a new first incremental metadata tree, after completion of the creating of the second snapshot data.

15 . A metadata tree query apparatus, comprising:

at least one processor; and

a memory communicatively connected to the at least one processor; wherein

the memory stores an instruction executable by the at least one processor, and the instruction is executed by the at least one processor to enable the at least one processor to perform the method according to claim 1 .

16 . The apparatus according to claim 15 , wherein a node of the first incremental metadata tree store an operation type of a metadata change operation, and the at least one processor is further enabled to:

perform a metadata query on the basic metadata tree to obtain a fourth subquery result;

perform a metadata query on the first incremental metadata tree to obtain a fifth subquery result; and

merge the fourth subquery result and the fifth subquery result based on an operation type stored in a node comprised in the fifth subquery result to obtain the second metadata query result.

17 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to perform the method according to claim 1 .

18 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to perform the method according to claim 9 .

Assignments (3)
EMPLOYMENT CONTRACT Recorded Jan 29, 2025
From: WANG, YIDUO
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 070047/0707 →
NUNC PRO TUNC ASSIGNMENT Recorded Jan 29, 2025
From: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
To: BAIDU INTERNATIONAL TECHNOLOGY (SHENZHEN) CO., LTD.
Reel/Frame 070047/0986 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 29, 2025
From: CAO, BIAO; XIONG, JIWEI; CHEN, QIUSHI; XING, YAN
To: BAIDU INTERNATIONAL TECHNOLOGY (SHENZHEN) CO., LTD.
Reel/Frame 070048/0522 →
Priority Claims (1)
CN 202311344294.5 · Oct 16, 2023 · national
Continuity (1)
Related Publication 20250094288A1 · Mar 20, 2025
References Cited (26)
US 9824095B1 · Taylor · 2017 [cited by examiner]
US 20090106255A1 · Lacapra · 2009 [cited by examiner]
US 20150269194A1 · King · 2015 [cited by examiner]
US 20160070480A1 · Babu · 2016 [cited by examiner]
US 20160210302A1 · Xia · 2016 [cited by examiner]
US 20160335278A1 · Tabaaloute · 2016 [cited by examiner]
US 20170192710A1 · Pundir · 2017 [cited by examiner]
US 20170212680A1 · Waghulde · 2017 [cited by examiner]
US 20170235848A1 · Van Dusen · 2017 [cited by examiner]
US 20170371889A1 · Golander · 2017 [cited by examiner]
US 20180336222A1 · Bourgeois · 2018 [cited by examiner]
US 20200125450A1 · Aron · 2020 [cited by examiner]
US 20200226035A1 · Li · 2020 [cited by examiner]
US 20200349138A1 · Qiu · 2020 [cited by examiner]
US 20200409977A1 · Yang · 2020 [cited by examiner]
US 20220027187A1 · Wang et al. · 2022 [cited by applicant]
US 20220155962A1 · Mundra · 2022 [cited by examiner]
US 20230273897A1 · Van Dyck · 2023 [cited by examiner]
US 20230325352A1 · Liu · 2023 [cited by examiner]
US 20250086120A1 · Raff · 2025 [cited by examiner]
US 20250103490A1 · Seibel · 2025 [cited by examiner]
CN 108572888A · 2018 [cited by applicant]
CN 110515774A · 2019 [cited by applicant]
CN 113868273A · 2021 [cited by applicant]
CN 116401207A · 2023 [cited by applicant]
First Office Action in CN Patent Application No. 202311344294.5 dated Feb. 10, 2026. [cited by applicant]