# US 10,503,430 B2 · Method and device for clearing data and electronic device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,503,430 B2
- Document ID: US10503430B2
- Status: Granted
- Kind: B2
- Application number: 15/902,089
- Filed: 2018-02-22
- Published: 2018-11-29
- Granted: 2019-12-10
- Earliest claimed: 2017-05-25
- Assignees: Cheetah Mobile Inc.
- Applicants: Cheetah Mobile Inc.
- Inventors: Guanxiang Wang; Bohui Zhang
- Web page: https://patentgrep.com/patent/US10503430B2

## CPC

- G06F 3/0652: {Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0673: {Single storage device}
- G06F 9/468: {Specific access rights for resources, e.g. using capability register}
- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 16/9574: {of access to content, e.g. by caching}
- G06F 21/6209: {to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself}
- G06F 2212/1044: Space efficiency improvement
- G06F 2212/161: Portable computer, e.g. notebook
- G06F 2221/2143: Clearing memory, e.g. to prevent the data from being stolen
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and a device for clearing data, and an electronic device are disclosed in embodiments of the present disclosure. The method includes: launching a target application; acquiring a clearing instruction; judging whether the operation system is of a preset version or of a higher version than the preset version; judging whether an auxiliary permission is available; if the operation system is of a lower version than the preset version, or if the operation system is of the preset version or the higher version and the auxiliary permission is unavailable, triggering the target application to clear data stored in the electronic device; and if the operation system is of the preset version or of the higher version and the auxiliary permission is available, invoking a system clearing interface of the electronic device, simulating a click on the system clearing interface, so as to trigger and start a system clearing progress.

## Claims

### Claim 1

A method for clearing data, applied to an electronic device having an operation system comprising:
launching a target application;
acquiring a clearing instruction triggered by a user;
judging whether the operation system is of a preset version or of a higher version than the preset version;
judging whether an auxiliary permission is available to the user;
if the operation system is of a lower version than the preset version, or if the operation system is of the preset version or the higher version and the auxiliary permission is unavailable to the user, triggering the target application to clear data stored in the electronic device; and
if the operation system is of the preset version or of the higher version and the auxiliary permission is available to the user, invoking a system clearing interface of the electronic device, simulating a click on the system clearing interface input by the user, so as to trigger and start a system clearing progress; wherein the data stored in the electronic device is cleared by the system clearing progress;
wherein, before invoking a system clearing interface of the electronic device, the method further comprises:
when an application Ai recorded in a white list is comprised in the electronic device, amending a package name of the application Ai in a storage path of the electronic device from Pi to Pi′, wherein the application Ai is anyone recoded in the white list, and Pi is different from Pi′; and
after clearing the data stored in the electronic device by the system clearing progress, the method further comprises:
acquiring a message indicating a completion of clearing the data stored in the electronic device by the system clearing progress; and
amending the package name of the application Ai in the storage path from Pi′ to Pi.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the target application clearing data stored in the electronic device comprises:
clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application.

### Claim 3 (depends on 2)

The method according to claim 2, wherein, when the operation system is of the lower version, clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application comprises:
deleting a cached file corresponding to respective application not in the white list from an operation system root directory and a Data root directory by the target application.

### Claim 4 (depends on 2)

The method according to claim 2, wherein, when the operation system of the electronic device is of the preset version or of the higher version and the auxiliary permission is unavailable to the user, clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application comprises:
deleting a cached file corresponding to respective application not in the white list from an operation system root directory of the electronic device by the target application.

### Claim 5 (depends on 1)

The method according to claim 1, wherein clearing the data stored in the electronic device by the system clearing progress comprises:
deleting a cached file corresponding to respective application from an operation system root directory and a Data root directory of the electronic device by the system clearing progress.

### Claim 6

An electronic device, comprising: a processor, a memory, a display, a communication interface and a bus;
wherein the processor, the memory, the display and the communication interface are coupled and communicate with each other via the bus;
the memory is configured to store computer executable program codes, the executable program codes comprises instructions; and when the instructions are executed by the processor, the instructions is configured to cause the electronic device to execute following acts:
launching a target application;
acquiring a clearing instruction triggered by a user;
judging whether the operation system is of a preset version or of a higher version than the preset version;
judging whether an auxiliary permission is available to the user;
if the operation system is of a lower version than the preset version, or if the operation system is of the preset version or the higher version and the auxiliary permission is unavailable to the user, triggering the target application to clear data stored in the electronic device; and
if the operation system is of the preset version or of the higher version and the auxiliary permission is available to the user, invoking a system clearing interface of the electronic device, simulating a click on the system clearing interface input by the user, so as to trigger and start a system clearing progress; wherein the data stored in the electronic device is cleared by the system clearing progress;
wherein, before invoking a system clearing interface of the electronic device, the method further comprises:
when an application Ai recorded in a white list is comprised in the electronic device, amending a package name of the application Ai in a storage path of the electronic device from Pi to Pi′, wherein the application Ai is anyone recoded in the white list, and Pi is different from Pi′; and
after clearing the data stored in the electronic device by the system clearing progress, the method further comprises:
acquiring a message indicating a completion of clearing the data stored in the electronic device by the system clearing progress; and
amending the package name of the application Ai in the storage path from Pi′ to Pi.

### Claim 7 (depends on 6)

The electronic device according to claim 6, wherein the target application clearing data stored in the electronic device comprises:
clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application.

### Claim 8 (depends on 7)

The electronic device according to claim 7, wherein, when the operation system is of the lower version, clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application comprises:
deleting a cached file corresponding to respective application not in the white list from an operation system root directory and a Data root directory by the target application.

### Claim 9 (depends on 7)

The electronic device according to claim 7, wherein, when the operation system of the electronic device is of the preset version or of the higher version and the auxiliary permission is unavailable to the user, clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application comprises:
deleting a cached file corresponding to respective application not in the white list from an operation system root directory of the electronic device by the target application.

### Claim 10 (depends on 6)

The electronic device according to claim 6, wherein clearing the data stored in the electronic device by the system clearing progress comprises:
deleting a cached file corresponding to respective application from an operation system root directory and a Data root directory of the electronic device by the system clearing progress.

### Claim 11

A non-transitory computer readable storage medium, having computer programs stored therein, when the computer programs are executed by a processor of an electronic device, the device may perform a method for clearing data, wherein the method for clearing data comprises:
launching a target application;
acquiring a clearing instruction triggered by a user;
judging whether the operation system is of a preset version or of a higher version than the preset version;
judging whether an auxiliary permission is available to the user;
if the operation system is of a lower version than the preset version, or if the operation system is of the preset version or the higher version and the auxiliary permission is unavailable to the user, triggering the target application to clear data stored in the electronic device; and
if the operation system is of the preset version or of the higher version and the auxiliary permission is available to the user, invoking a system clearing interface of the electronic device, simulating a click on the system clearing interface input by the user, so as to trigger and start a system clearing progress; wherein the data stored in the electronic device is cleared by the system clearing progress;
wherein, before invoking a system clearing interface of the electronic device, the method further comprises:
when an application Ai recorded in a white list is comprised in the electronic device, amending a package name of the application Ai in a storage path of the electronic device from Pi to Pi′, wherein the application Ai is anyone recoded in the white list and Pi is different from Pi′; and
after clearing the data stored in the electronic device by the system clearing progress, the method further comprises:
acquiring a message indicating a completion of clearing the data stored in the electronic device by the system clearing progress; and
amending the package name of the application Ai in the storage path from Pi′ to Pi.

### Claim 12 (depends on 11)

The storage medium according to claim 11, wherein the target application clearing data stored in the electronic device comprises:
clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application.

### Claim 13 (depends on 12)

The storage medium according to claim 12, wherein, when the operation system is of the lower version, clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application comprises:
deleting a cached file corresponding to respective application not in the white list from an operation system root directory and a Data root directory by the target application.

### Claim 14 (depends on 12)

The storage medium according to claim 12, wherein, when the operation system of the electronic device is of the preset version or of the higher version and the auxiliary permission is unavailable to the user, clearing cached data corresponding to one or more applications not in a white list of the electronic device by the target application comprises:
deleting a cached file corresponding to respective application not in the white list from an operation system root directory of the electronic device by the target application.

### Claim 15 (depends on 11)

The storage medium according to claim 11, wherein clearing the data stored in the electronic device by the system clearing progress comprises:
deleting a cached file corresponding to respective application from an operation system root directory and a Data root directory of the electronic device by the system clearing progress.
