Electronic Device Database Recovery with Dual Cache Integrity Checks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database (DB) corruption in electronic devices, such as Android devices, can render access to important metadata impossible, leading to loss of user data like contacts, messages, and notes.
Innovation Solution
An electronic device with a processor and both non-volatile and volatile memory is configured to determine DB corruption, perform integrity checks after initializing DB and OS caches, and execute recovery tasks on the DB file when integrity checks are successful.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the DB is initialized when corruption is detected, then system stability is improved, but user data is lost
Solution Approach 1:
The patent performs preliminary integrity checks on the DB cache and OS cache before allowing DB initialization. By detecting corruption early through checksum verification and metadata validation, the system can prevent initialization of corrupted databases, thereby preserving user data while maintaining system stability through controlled recovery procedures
Solution Approach 2:
The patent introduces an intermediary recovery mechanism that acts between corruption detection and DB initialization. This intermediary layer performs integrity verification and, when corruption is detected, initiates recovery procedures using backup metadata and journal files before initialization occurs, thus preventing data loss while ensuring system reliability
2Measurement precision
If integrity checks are performed after initializing DB cache, then data accuracy is improved, but processing time increases
Solution Approach 1:
The patent performs integrity checks as a preliminary action immediately after DB cache initialization but before any actual database operations. This timing ensures data accuracy is verified upfront, and the checks are optimized to complete quickly by only verifying critical metadata and checksums rather than full data validation
Solution Approach 2:
The patent implements partial integrity checking by focusing verification efforts on critical DB metadata, headers, and checksum fields rather than performing exhaustive checks on all data records. This partial action approach maintains data accuracy for essential structural elements while minimizing processing time overhead
3Measurement precision
If integrity checks are performed after initializing OS cache, then data accuracy is improved, but processing time increases
Solution Approach 1:
The patent performs integrity checks on OS cache as a preliminary action before proceeding with database operations. By verifying OS cache integrity at this stage, the system ensures data accuracy from the operating system level, and the checks are designed to be efficient by leveraging OS-level optimization and only validating critical cache structures
Solution Approach 2:
The patent implements partial integrity verification for OS cache by focusing on critical cache metadata and structure validation rather than exhaustive checking of all cached data. This approach maintains data accuracy for essential OS-level database operations while minimizing the processing time impact
Data Source
AI summary
An electronic device for recovering a database (DB) and a method of operating the electronic device are provided. The electronic device includes a non-volatile first memory configured to store a DB, a volatile second memory, and a processor operably connected to the first memory and the second memory. The processor may determine whether the DB is corrupted, may perform first integrity check of the DB after initializing a DB cache in which at least a portion of the DB is loaded to a user space of the second memory when it is determined that the DB is corrupted, may perform second integrity check of the DB after initializing an operating system (OS) cache in which at least a portion of the DB is loaded to a kernel space of the second memory when the first integrity check of the DB fails, and may perform a task on a DB file when the first integrity check or the second integrity check of the DB is successful.


