IP Library › Granted Patent US 12,561,295
Granted Patent B2
US 12,561,295 · App. 18/245,476 · Granted Feb 24, 2026

Database repairing method and electronic device

Inventors: Mingpeng Xiao (Shenzhen, CN); Kai Wang (Xi'an, CN)
Assignee: Huawei Technologies Co., Ltd.
G06F16/215G06F11/1448G06F2201/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,561,295
App. No.
18/245,476
Granted
Feb 24, 2026
Kind
B2
Abstract

Database repairing methods and electronic devices are disclosed. In an implementation, a method includes, in response to determining that a first database file is corrupted, obtaining data of at least one field in the first database file, wherein the at least one field is predefined by an application, and generating a first data table in a second database file based on the data of the at least one field, wherein the second database file is obtained through repairing.

Claims (28)

1 . A database repairing method, comprising:

in response to determining that a first database file and a second data table in a backup file of the first database file are corrupted, backing up the first database file to obtain a backup file of the first database file;

obtaining data of at least one field in the first database file from a master table, wherein the master table stores a structured query language (SQL) statement for generating a first data table which is a repaired version of the second data table, and wherein the at least one field is predefined by an application;

in response to determining that a second data table in the backup file that stores the data of the at least one field is not corrupted, obtaining the data of the at least one field from the second data table;

in response to determining that the second data table in the backup file is corrupted, obtaining the data of the at least one field from a master table associated with the first database file, the master table storing statements and data used to generate the first database file, and reconstructing a key data table by re-executing the statements for the key data table;

creating, in response to the first database file being corrupted, a second database file having a same file name and a same structure as the first database file; and

generating the first data table to obtain a in the second database file based on the data of the at least one field, wherein the second database file comprises the first data table and is a repaired version of the first database file and replaces the first data file, and wherein the first database file and the second database file are stored in a database.

2 . The method according to claim 1 , wherein the SQL statement comprises one or more of an update statement, an insertion statement, a deletion statement, or a query statement.

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

deleting the first database file.

4 . The method according to claim 1 , wherein the database is a structured query language lite (SQLite) database.

5 . The method according to claim 1 , wherein a computer program for implementing the method is provided by the application.

6 . The method according to claim 1 , wherein a computer program for implementing the method is provided by an electronic device on which the application is installed.

7 . An electronic device comprising:

at least one processor; and

a memory coupled to the at least one processor and storing programming instructions for execution by the at least one processor to cause the electronic device to perform operations comprising:

in response to determining that a first database file and a second data table in a backup file of the first database file are corrupted, backing up the first database file to obtain a backup file of the first database file;

obtaining data of at least one field in the first database file from a master table, wherein the master table stores a structured query language (SQL) statement for generating a first data table which is a repaired version of the second data table, and wherein the at least one field is predefined by an application;

in response to determining that a second data table in the backup file that stores the data of the at least one field is not corrupted, obtaining the data of the at least one field from the second data table;

in response to determining that the second data table in the backup file is corrupted, obtaining the data of the at least one field from a master table associated with the first database file, the master table storing statements and data used to generate the first database file, and reconstructing a key data table by re-executing the statements for the key data table;

creating, in response to the first database file being corrupted, a second database file having a same file name and a same structure as the first database file; and

generating the first data table to obtain a in the second database file based on the data of the at least one field, wherein the second database file comprises the first data table and is a repaired version of the first database file and replaces the first data file, and wherein the first database file and the second database file are stored in a database.

8 . The electronic device according to claim 7 , wherein the SQL statement comprises one or more of an update statement, an insertion statement, a deletion statement, or a query statement.

9 . The electronic device according to claim 7 , wherein the method further comprises:

deleting the first database file.

10 . The electronic device according to claim 7 , wherein the database is a structured query language lite (SQLite) database.

11 . The electronic device according to claim 7 , wherein a computer program for implementing the method is provided by the application.

12 . The electronic device according to claim 7 , wherein a computer program for implementing the method is provided by an electronic device on which the application is installed.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 16, 2023
From: XIAO, MINGPENG; WANG, KAI
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 065234/0491 →
Priority Claims (1)
CN 202010974792.8 · Sep 16, 2020 · national
Continuity (1)
Related Publication 20230342345A1 · Oct 26, 2023
References Cited (18)
US 5870762A · Lee · 1999 [cited by examiner]
US 6567826B1 · Fischer · 2003 [cited by examiner]
US 6970890B1 · Bruce · 2005 [cited by examiner]
US 20120144383A1 · Mishra · 2012 [cited by examiner]
US 20130173547A1 · Cline · 2013 [cited by examiner]
US 20140201163A1 · Tipton · 2014 [cited by examiner]
US 20180285205A1 · Mehta · 2018 [cited by examiner]
US 20180285206A1 · Mehta · 2018 [cited by examiner]
US 20180285382A1 · Mehta · 2018 [cited by examiner]
US 20180285430A1 · Mehta · 2018 [cited by examiner]
CN 101038591A · 2007 [cited by applicant]
CN 107193871A · 2017 [cited by examiner]
CN 107402843A · 2017 [cited by applicant]
CN 109828865A · 2019 [cited by applicant]
Liu, “Research and Application of SQLite Recovering Technology Based on WAL,” Thesis for the degree of Master, Hangzhou Dianzi University, Mar. 2017, 78 pages (with English abstract). [cited by applicant]
Liu, “Handling SQL Server Page Corruption Failures,” Cybersecurity and Informatization, Issue 6, Jun. 30, 2020, 6 pages (with English abstract). [cited by applicant]
Extended European Search Report in European AppIn No. 21868395.1, dated Jan. 15, 2024, 8 pages. [cited by applicant]
International Search Report and Written Opinion in International AppIn. No. PCT/CN2021/113838, mailed on Nov. 18, 2021, 17 pages (with English translation). [cited by applicant]