CN110704243A - Data recovery method and device, terminal equipment and storage medium - Google Patents
Data recovery method and device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN110704243A CN110704243A CN201910910027.7A CN201910910027A CN110704243A CN 110704243 A CN110704243 A CN 110704243A CN 201910910027 A CN201910910027 A CN 201910910027A CN 110704243 A CN110704243 A CN 110704243A
- Authority
- CN
- China
- Prior art keywords
- terminal
- storage partition
- target data
- storage
- partition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000011084 recovery Methods 0.000 title claims abstract description 57
- 238000005192 partition Methods 0.000 claims abstract description 273
- 238000013500 data storage Methods 0.000 claims abstract description 19
- 238000012795 verification Methods 0.000 claims description 50
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 10
- 238000012790 confirmation Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001680 brushing effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1438—Restarting or rejuvenating
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
Abstract
The application discloses a data recovery method, and belongs to the technical field of terminals. The method is executed by a terminal, and comprises the following steps: when the terminal is in a first working mode, receiving an instruction of restoring target data in the terminal; restarting the terminal and entering a second working mode; and storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to factory settings last time. According to the method and the device, the terminal mounts the second storage partition which is not mounted in the first working mode under the second working mode, so that the terminal can restore the data stored in the second storage partition from the first storage partition when the terminal restores the factory settings in the second working mode for the last time, and the safety of target data storage when a user deletes other data is improved.
Description
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a data recovery method and apparatus, a terminal device, and a storage medium.
Background
With the rapid development of science and technology, people inevitably use terminals to perform entertainment, work and the like in daily life, and as users use the terminals for longer and longer time and more times, the terminals often store a large amount of data of the users.
When the data stored in the terminal is large, the performance of the terminal may be affected, and the user may delete some data to improve the performance of the terminal. At present, most terminals have a factory setting restoring function, and a user can start the factory setting restoring function in the terminal to remove most data in the terminal. For example, after a user starts a factory reset function in a terminal, the terminal may enter a recovery mode (recovery mode), and in the recovery mode, the terminal may perform operations such as deleting data of the terminal or modifying an operating system by itself.
In the factory reset process, the data deleted by the terminal in the reset mode cannot be selected by the user, so that the data of the user is easily lost, and the safety of data storage is reduced.
Disclosure of Invention
The embodiment of the application provides a data recovery method, a data recovery device, terminal equipment and a storage medium, which can protect target data and improve the security of target data storage when a user deletes other data in a terminal. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a data recovery method, where the method is performed by a terminal, and the method includes:
when the terminal is in a first working mode, receiving an instruction for recovering target data in the terminal; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted;
restarting the terminal and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition;
and storing target data in the second storage partition to the first storage partition, wherein the target data is data stored from the first storage partition to the second storage partition when factory reset is carried out on the terminal last time.
On the other hand, an embodiment of the present application provides a data recovery apparatus, where the apparatus is used in a terminal, and the apparatus includes:
a recovery instruction receiving module, configured to receive an instruction to recover target data in the terminal when the terminal is in a first working mode; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted;
a first mode entering module, configured to restart the terminal and enter a second working mode, where the second working mode is a working mode in which the first storage partition and the second storage partition are mounted;
and the first data storage module is used for storing target data in the second storage partition to the first storage partition, wherein the target data is data stored from the first storage partition to the second storage partition when factory restoration setting is carried out on the terminal last time.
In another aspect, an embodiment of the present application provides a terminal device, where the terminal device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or a set of instructions, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the data recovery method described above.
In another aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the data recovery method described above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
when the terminal is in a first working mode, receiving an instruction of restoring target data in the terminal; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted; restarting the terminal, and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition; and storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to factory settings last time. According to the method and the device, the terminal mounts the second storage partition which is not mounted in the first working mode under the second working mode, so that the terminal can restore the data stored in the second storage partition from the first storage partition when the terminal restores the factory settings in the second working mode for the last time, and the safety of target data storage when a user deletes other data is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scenario in which a terminal according to an exemplary embodiment of the present application operates in a recovery mode;
FIG. 2 is a flowchart of a method for data recovery according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart of a method for data recovery according to an exemplary embodiment of the present application;
FIG. 4 is an interface diagram of a setup interface according to an exemplary embodiment of the present application;
FIG. 5 is an interface schematic of a data selection interface according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram of an interface presented after a user clicks a factory reset control according to an exemplary embodiment of the present application;
FIG. 7 is an interface diagram of a setup interface according to an exemplary embodiment of the present application;
FIG. 8 is an interface schematic diagram of a terminal interface according to an exemplary embodiment of the present application, as referenced in FIG. 7;
FIG. 9 is an interface diagram of a setup interface according to an exemplary embodiment of the present application;
FIG. 10 is a flowchart of a method for data recovery according to an exemplary embodiment of the present application;
FIG. 11 is a block diagram of a data recovery apparatus according to an exemplary embodiment of the present application;
fig. 12 is a schematic structural diagram of a terminal according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The scheme provided by the application can be used in a real scene that partial data in the terminal is restored after the terminal is restored to factory settings when people use the terminal in daily life, and for convenience of understanding, a few terms and application scenes related to the embodiment of the application are first briefly introduced below.
Recovery mode (Recovery mode): the backup function of an Android terminal refers to a mode that can modify data or an operating system inside the Android terminal.
Mounting: a process by which computer files and directories on a storage device (such as a hard disk, optical disk, or shared resource) are made available to a file system of a terminal device by an operating system.
And (4) factory setting restoration: the method includes that the terminal is restored to a default state when the terminal leaves a factory, for example, functions of a starting interface, a working mode, an operation shortcut key, a timing prompt and the like of the terminal are restored, and saved parameter settings, user data and the like are cleared. The method has the function of formatting various storage partitions (such as a formatted data (data) partition, a cache (cache) partition and the like) of the terminal.
Brushing the machine: the term "handset" refers to a handset that has some means of changing or replacing some language, picture, ring, software, or operating system that is originally present in the handset. Or, the refreshing is to reinstall the system for the mobile phone.
With the rapid development of science and technology, the use of the terminal greatly facilitates the daily life of people, and people can use the terminal to work, study, entertain and the like. The user can store the generated data in the terminal, for example, the user can store the information such as the photo taken by the user and the phone number of the friend in the terminal, so that the user can conveniently check the information. With the increase of the use times of the terminal, the data which the user may store in the terminal is more and more, and the performance of the terminal may be reduced by a large amount of stored data, so that the terminal is not smooth in operation and the like. Or, the user needs to restore factory settings to the terminal and clear data in the terminal. The user can work the terminal in the recovery mode to complete the clearing of the data in the terminal.
Referring to fig. 1, a schematic view of a scenario that a terminal provided by an exemplary embodiment of the present application operates in a recovery mode is shown. As shown in fig. 1, a terminal 100, a power control 101, and a volume control 102 are included.
Optionally, the terminal 110 is a terminal having a recovery mode. For example, the terminal may be a mobile phone, a tablet computer, an e-book reader, smart glasses, a smart watch, an MP3 player (Moving Picture Experts Group audio Layer III, motion Picture Experts Group audio Layer IV, motion Picture Experts Group audio Layer 4), an MP4 player, a notebook computer, a laptop computer, a desktop computer, and the like. Optionally, the power control 101 and the volume control 102 are physical controls or virtual controls.
The user may turn off or on the terminal 100 by pressing the power control 101 for a long time, and when the terminal 100 is turned off, the user may also press the power control 101 and the volume control 102 at the same time, so that the terminal enters the recovery state shown in fig. 1, and the data of the terminal is deleted in the recovery state. Alternatively, the terminal 100 may enter the recovery state shown in fig. 1 in other ways, which is not limited in this embodiment of the application.
Currently, in the recovery mode shown in fig. 1, the terminal does not support the function of restoring the deleted data. That is, data deleted by the terminal in the recovery mode cannot be restored by the user, and the user cannot select data to be deleted when the terminal deletes data in the recovery mode. When a user wants to retain part of data in the terminal, the terminal is caused to lose internal data and cannot restore the data, and the security of the data stored in the terminal is reduced.
In order to protect the data which the user wants to store and improve the safety of the data storage when the user deletes other data in the terminal, the application provides a solution, which can restore the data which the user wants to store and is deleted before when the terminal is in the recovery mode. Referring to fig. 2, a flowchart of a method for recovering data according to an exemplary embodiment of the present application is shown. The method may be applied to the scenario shown in fig. 1, which is executed by the terminal in the scenario. As shown in fig. 2, the data recovery method may include the following steps:
The first operating mode may be a normal operating mode of the terminal, that is, in a normal use process of the terminal, the terminal receives an instruction to recover target data of the terminal. The first storage partition may be any partition which is divided into disks in the terminal and can be mounted in the normal operation mode, and the second storage partition is a partition which is divided into partitions in the terminal and cannot be mounted in the normal operation mode. That is, the terminal cannot mount the second storage partition in the normal operating mode, and the user cannot view the content of the second storage partition in the normal operating mode, or store data in the second storage partition.
The second working mode may be a recovery mode of the terminal, in which the terminal may mount the first partition and the second storage partition, that is, the second storage partition has a right to be mounted in the recovery mode, and in other modes, the terminal may not mount the second storage partition.
And 203, storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to the factory setting last time.
When the terminal restores factory settings and executes commands such as deletion, modification and management on data in each storage partition except the second storage partition in the terminal, the data in the first storage partition is stored in the second storage partition, and then the data is the target data. After the terminal executes the above steps 201 and 202, the terminal may restore the data stored in the second storage partition from the first storage partition to the first storage partition when the terminal restores the factory settings last time, so that the target data is restored in the restore mode.
In summary, when the terminal is in the first operating mode, an instruction for recovering the target data in the terminal is received; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted; restarting the terminal, and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition; and storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to factory settings last time. According to the method and the device, the terminal mounts the second storage partition which is not mounted in the first working mode under the second working mode, so that the terminal can restore the data stored in the second storage partition from the first storage partition when the terminal restores the factory settings in the second working mode for the last time, and the safety of target data storage when a user deletes other data is improved.
In a possible implementation manner, the scheme shown in fig. 2 is described by taking as an example that before the terminal receives an instruction to restore target data in the terminal, the terminal may first execute a command to restore factory settings, and store the target data from the first storage partition to the second storage partition.
Referring to fig. 3, a flowchart of a method for recovering data according to an exemplary embodiment of the present application is shown. The method may be applied to the scenario shown in fig. 1, which is executed by the terminal in the scenario. As shown in fig. 3, the data recovery method may include the following steps:
step 301, when the terminal is in the first working mode, receiving an instruction for executing factory reset.
The first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted.
Optionally, the description of the first operating mode may refer to the description in step 201, and is not repeated here. The terminal may receive a command to restore factory settings in the first operating mode. For example, a user may trigger a factory reset instruction through a factory reset control in the setting interface, so that the terminal receives the factory reset instruction. Or, in a possible implementation manner, a shortcut button for factory reset may be further disposed in the terminal, and the user may click the shortcut button, or the terminal may receive an instruction for factory reset execution. Referring to fig. 4, an interface diagram of a setting interface according to an exemplary embodiment of the present application is shown. As shown in fig. 4, a factory reset control 401 is included in the setting interface 400, and a user may click the factory reset control 401, so that the terminal receives an instruction to execute factory reset.
Optionally, the first memory partition may be a memory area for storing user data when the terminal is in the first operating mode, for example, the first memory partition is a data partition in the terminal, and may store user data of a user in each application program; or, the first storage partition may also be a cache partition in the terminal, and may also store user data cached in the terminal. Optionally, the second memory partition is a partition in which the terminal cannot be mounted in the first operating mode. The second memory partition may be partitioned and set by a manufacturer of the terminal, for example, before the terminal leaves a factory, the manufacturer of the terminal may partition a memory partition in the terminal as the second memory partition, and the terminal may not be mounted with the partition in the first operation mode.
Step 302, the terminal is restarted and enters a second working mode.
The description of the second operating mode may also refer to the description in step 202, and is not repeated here. Optionally, after the terminal is restarted and enters the second working mode, the terminal may obtain a trigger instruction for entering the second working mode, check whether the trigger instruction is the instruction for restoring the factory setting, mount the second storage partition in the second working mode if the trigger instruction is the instruction for restoring the factory setting, and mount the second storage partition if the trigger instruction is not the instruction for restoring the factory setting.
Step 303, storing the target data in the first storage partition to the second storage partition, and deleting the data in the first storage partition.
In a possible implementation manner, the terminal may first store the target data of the first storage partition in the second storage partition, and then delete the target data and the remaining data in the first storage partition, that is, perform subsequent factory restoration. In a possible implementation manner, when the terminal performs factory reset, the terminal may delete the target data in the first storage partition, and store the target data in the first storage partition to the second storage partition. That is, the second storage partition may correspond to a recycle bin, and the target data deleted by the terminal from the first storage partition may be temporarily stored in the second storage partition. Or, the terminal may also backup the target data in the first storage partition to the second storage partition in advance, that is, before the terminal performs factory reset, the target data is stored in the second storage partition first, and then the data in the first storage partition is erased, so that factory reset is completed. The storage or deletion order of the target data is not limited in the embodiments of the present application.
Optionally, the target data in the first storage partition may be set in the terminal in advance by a manufacturer of the terminal, for example, when a certain terminal leaves a factory, the manufacturer sets data in a system folder "album" in the terminal as the target data in advance, and when a user stores some data in the album, and the terminal restores the factory setting, the terminal may back up the data in the album as the target data, that is, store the data in the album as the target data in the second storage partition from the first storage partition. Optionally, the system folder may also be "note", "phone", etc.
In a possible implementation manner, the terminal may further provide an interface for selecting target data in the first operating mode, please refer to fig. 5, which shows an interface schematic diagram of a data selection interface according to an exemplary embodiment of the present application. As shown in fig. 5, each folder directory 501 and a selection control 502 are included in the terminal interface 500, when the user selects and checks the selection control, the terminal may know that data in the folder directory selected by the user is target data, and when the terminal performs factory reset according to the above steps, the terminal may store the data in the folder directory selected by the user as the target data in the second storage partition from the first storage partition.
Optionally, when the target data is more and the storage space of the second storage partition is insufficient, the terminal may store the target data in an overlay manner. That is, when the target data has already occupied the space of the second storage partition, and the terminal needs to continue to store other target data in the second storage partition, at this time, the terminal may replace the target data stored in the second storage partition first, so as to continue to backup the target data.
In a possible implementation manner, before the terminal backs up the target data in the second storage partition, the terminal may further obtain user identity information logged in the terminal, and store the user identity information in the second storage partition, so that the user is authenticated when subsequently restoring the target data. Optionally, the user identity information 402 of the terminal is logged in the setting interface shown in fig. 4, and when the user clicks the factory resetting control, the terminal may obtain the user identity information.
In a possible implementation manner, the terminal may not log in any user information currently, and before the terminal backs up the target data in the second storage partition, the terminal may further obtain an authentication password input by the user in the terminal, and store the authentication password input by the user in the second storage partition, so that the authentication is performed when the user subsequently restores the target data. Referring to fig. 6, which shows an interface schematic diagram displayed after a user clicks a factory reset control according to an exemplary embodiment of the present application, as shown in fig. 6, a terminal interface 600 includes a password input box 601, a confirmation control 602, and a cancel control 603, the terminal prompts the user to input a verification password by displaying the password input box 601, when the user inputs a password in the password input box 601 and clicks the confirmation control 602, the terminal may perform a subsequent factory reset step, and before backing up target data in a second storage partition, the terminal may acquire the verification password input by the user in fig. 6 and store the verification password in the second storage partition.
Optionally, when the terminal deletes the target data in the first storage partition and stores the target data in the first storage partition in the second storage partition, the terminal may further encrypt the target data stored in the second storage partition, so as to improve the security of the target data storage.
And step 304, restarting the terminal and entering a first working mode.
Optionally, after backing up the target data, the terminal may continue to perform the step of restoring the factory settings, for example, continue to erase other data of the first storage partition, continue to erase data of other first storage partitions, and the like. And after the factory reset is finished, restarting again and entering a first working mode.
305, when the terminal is in a first working mode, receiving an instruction of restoring target data in the terminal; the first operating mode is an operating mode in which the first memory partition is mounted and the second memory partition is not mounted.
Optionally, the user may click a control for restoring the target data in the terminal, so that the terminal receives an instruction for restoring the target data in the terminal. Referring to fig. 7, an interface diagram of a setup interface according to an exemplary embodiment of the present application is shown. As shown in fig. 7, a restore target data control 701 is included in the setting interface 700, and a user may click the restore target data control 701, so that the terminal receives an instruction to execute the restore target data.
Step 306, when receiving the instruction of restoring the target data in the terminal, performing a first verification, where the first verification is used to verify whether the terminal has the authority to restore the target data.
When the terminal receives an instruction of restoring the target data in the terminal, the terminal can verify the authority of restoring the target data executed this time.
In a possible implementation manner, when the user identity information of the terminal logged in when the factory settings of the terminal are restored last time is stored in the second storage partition, the first verification is performed according to the user identity information. Optionally, when the terminal receives an instruction to restore target data in the terminal, the terminal may obtain user information that a setting interface in the terminal logs in currently, perform verification according to the user information and stored user identity information, if the user information and the stored user identity information are the same, the terminal is considered to pass the first verification, and if the user information and the stored user identity information are different, the terminal is considered to fail the first verification.
In a possible implementation manner, when the second storage partition stores the verification password set when the factory settings of the terminal are restored last time, the first verification is performed according to the verification password. Optionally, when the terminal receives an instruction to restore the target data in the terminal, the terminal may display a verification password input box in the terminal. Referring to fig. 8, an interface diagram of a terminal interface related to fig. 7 according to an exemplary embodiment of the present application is shown. When the user clicks the above-mentioned restore target data control in fig. 7, the terminal may present the interface shown in fig. 8, as shown in fig. 8, the terminal interface 800 includes a verification password input box 801, a confirmation control 802, and a cancel control 803. The user can input a password in the verification password input box 801 and click the confirmation control 802, the terminal can perform verification according to the password input by the user and the verification password stored in the second storage partition, if the password input by the user and the verification password are the same, the terminal is considered to pass the first verification, and if the password input by the user and the verification password are different, the terminal is considered to not pass the first verification.
Optionally, when the first verification fails N times, the target data is deleted from the second storage partition. Wherein N is an integer. Optionally, the terminal may set an upper limit of the verification times of the first verification, and if the first verification fails within N times, the terminal may delete the target data stored in the second storage partition, thereby preventing recovery of the target data in the second storage partition in other manners. Alternatively, N may be set in advance by the terminal manufacturer.
And 307, when the first verification is passed, restarting the terminal, and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition.
Optionally, when the first authentication of the terminal is passed, the terminal may enter the second operating mode by restarting.
In a possible implementation manner, the second storage partition stores a first storage time, and the terminal may first determine whether a second storage time, in which the target data is stored in the second partition, is less than the first storage time when entering the second operating mode in this step; and when the second storage time is less than the first storage time, executing the step of storing the target data in the second storage partition to the first storage partition.
For example, in a setting interface of the terminal, a user may set a storage duration of the target data in the second storage partition, please refer to fig. 9, which shows an interface schematic diagram of a setting interface according to an exemplary embodiment of the present application, as shown in fig. 9, a time input box 901, a confirmation control 902, and a cancellation control 903 are included in the setting interface 900, when the user inputs a duration that the target data needs to be stored in the time input box 901, and when the terminal performs factory reset, the terminal may also store the duration in the second storage partition. Therefore, before the terminal enters the second working mode to recover the target data, whether the duration of the target data in the second storage partition exceeds the duration input by the user can be judged, and when the duration of the target data in the second storage partition is smaller than the duration input by the user, the terminal executes the step of storing the target data in the second storage partition into the first storage partition.
Optionally, the storage duration of the target data in the second storage partition may also be set in advance by a manufacturer of the terminal, that is, the second storage partition in the terminal may store a default first storage time, and the acquisition of the first storage time is not limited in the embodiment of the present application.
In a possible implementation manner, when the second storage time is not less than the first storage time, the terminal may further delete the target data from the second storage partition. That is, if the terminal determines that the duration of the target data in the second memory partition exceeds the duration previously input by the user, the terminal may delete the target data from the second memory partition.
And 308, storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to the factory setting last time.
Optionally, when the terminal stores the target data in the second storage partition into the first storage partition, the target data may be copied into a folder located at the last position in the original file directory according to the original file directory, where the original file directory is a file directory of the target data in the first storage partition when the terminal is last factory reset, and each original folder is a folder of a name of each folder included in the original file directory.
For example, when the terminal backs up the target data from the first storage partition to the second storage partition, the terminal may also store the folder directory of the target data in the second storage partition, and after the user recovers the target data, the user may find the target data according to the folder directory in which the original target data is located. For example, the folder directory stored by the terminal in the second memory partition may be: user: application one/recent files/albums. When the terminal stores the target data from the second storage partition to the first storage partition, the target data can be restored and stored according to the file directory. Optionally, when the terminal executes the factory reset, the folder, the latest folder, and the album folder of the first application program are all deleted, and in this step, the folder, the latest folder, and the album folder of the first application program may be re-established, and the target data is stored in the corresponding directory.
Optionally, if the terminal performs encryption processing on the target data when storing the target data in the second storage partition when the factory settings are restored, correspondingly, in this step, the terminal may also decrypt the target data to obtain decrypted target data, and then restore the target data to the first storage partition.
Step 309, restart the terminal again, enter the first working mode.
And the terminal can enter the first working mode again through restarting after restoring the target data in the second working mode, thereby normally using the terminal. The user can also check the target data before the factory setting is restored last time in the terminal through a series of operations.
In summary, when the terminal is in the first operating mode, an instruction for recovering the target data in the terminal is received; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted; restarting the terminal, and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition; and storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to factory settings last time. According to the method and the device, the terminal mounts the second storage partition which is not mounted in the first working mode under the second working mode, so that the terminal can restore the data stored in the second storage partition from the first storage partition when the terminal restores the factory settings in the second working mode for the last time, and the safety of target data storage when a user deletes other data is improved.
The data recovery method shown in fig. 2 and 3 is exemplified by taking an example that the terminal is a mobile phone, the target data is data in a file directory preset by a mobile phone manufacturer, and the second storage partition is also a storage partition which is divided by the mobile phone manufacturer in advance and is used for storing the target data. Referring to fig. 10, a flowchart of a method for recovering data according to an exemplary embodiment of the present application is shown. As shown in fig. 10, the data recovery method may include the following steps:
Wallpaper and backup target data can be set by a manufacturer, such as backup albums, short messages, notes and the like. If the data space of the partition is insufficient, the old data mode can be overwritten by the new data.
And step 1008, restarting the mobile phone after the factory reset is finished, wherein the second storage partition cannot be mounted when the mobile phone is normally started.
At step 1009, the user selects a control to restore the target data.
Step 1011, the mobile phone enters a recovery mode to start recovering the target data, and copies the target data of the second storage partition to a folder under the original directory.
In step 1011, the mobile phone is restarted after the target data is recovered.
In summary, when the terminal is in the first operating mode, an instruction for recovering the target data in the terminal is received; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted; restarting the terminal, and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition; and storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to factory settings last time. According to the method and the device, the terminal mounts the second storage partition which is not mounted in the first working mode under the second working mode, so that the terminal can restore the data stored in the second storage partition from the first storage partition when the terminal restores the factory settings in the second working mode for the last time, and the safety of target data storage when a user deletes other data is improved.
In addition, the second storage partition is divided from the mobile phone to store the target data, so that the function of the mobile phone recycle bin is realized in the recovery mode of the mobile phone, and the second storage partition is not mounted when the mobile phone is normally started for use, so that the target data of the user is effectively protected, and the safety of the target data is improved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 11, a block diagram of a data recovery apparatus according to an exemplary embodiment of the present application is shown. The data recovery apparatus 1100 may be used in a terminal to perform all or part of the steps performed by the terminal in the methods provided by the embodiments shown in fig. 4, fig. 5 or fig. 10. The data recovery apparatus 1100 may include: a recovery instruction receiving module 1101, a first mode entering module 1102 and a first data storage module 1103.
The recovery instruction receiving module 1101 is configured to receive an instruction for recovering target data in the terminal when the terminal is in a first working mode; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted;
the first mode entering module 1102 is configured to restart the terminal and enter a second working mode, where the second working mode is a working mode in which the first storage partition and the second storage partition are mounted;
the first data storage module 1103 is configured to store target data in the second storage partition to the first storage partition, where the target data is data that was stored from the first storage partition to the second storage partition when factory reset was last performed on the terminal.
In summary, when the terminal is in the first operating mode, an instruction for recovering the target data in the terminal is received; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted; restarting the terminal, and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition; and storing the target data in the second storage partition to the first storage partition, wherein the target data is the data stored from the first storage partition to the second storage partition when the terminal is restored to factory settings last time. According to the method and the device, the terminal mounts the second storage partition which is not mounted in the first working mode under the second working mode, so that the terminal can restore the data stored in the second storage partition from the first storage partition when the terminal restores the factory settings in the second working mode for the last time, and the safety of target data storage when a user deletes other data is improved.
Optionally, the apparatus further comprises: a first verification module and a first execution module;
the first verification module is configured to perform first verification when receiving an instruction to recover target data in the terminal before the first mode entry module restarts the terminal and enters a second working mode, where the first verification is used to verify whether the first verification has an authority to recover the target data;
and the first execution module is used for executing the step of restarting the terminal and entering a second working mode when the first verification is passed.
Optionally, the first verification module includes: a first authentication unit or a second authentication unit;
the first verification unit is configured to perform the first verification according to the user identity information when the user identity information that logs in the terminal when the factory settings of the terminal are restored last time is stored in the second storage partition;
and the second verification unit is used for performing the first verification according to the verification password when the verification password set when the factory setting is restored on the terminal last time is stored in the second storage partition.
Optionally, the apparatus further comprises:
and the first data deleting module is used for deleting the target data from the second storage partition when the first verification is not passed for N times.
Optionally, the first data storage module is configured to copy the target data to a folder located at a last position in the original file directory according to the original file directory, where the original file directory is a file directory of the target data in the first storage partition when the terminal is last factory reset, and each original folder is a folder of each folder name included in the original file directory.
Optionally, the apparatus further comprises: setting an instruction receiving module, a second mode entering module and a second data storage module;
the setting instruction receiving module is used for receiving and executing the instruction for restoring the factory setting when the terminal is in a first working mode;
the second mode entering module is used for restarting the terminal and entering the second working mode;
the second data storage module is used for storing the target data in the first storage partition to the second storage partition and deleting the data in the first storage partition.
Optionally, the first storage partition stores a first storage time, and the apparatus further includes:
a determining module, configured to determine whether a second storage time for storing the target data in the second partition is shorter than the first storage time before the first data storage module stores the target data in the second partition in the first storage partition;
and the second execution module is used for executing the step of storing the target data in the second storage partition to the first storage partition when the second storage time is less than the first storage time.
Optionally, the apparatus further comprises:
and the second data deleting module is used for deleting the target data from the first storage partition when the second storage time is not less than the first storage time.
Optionally, the apparatus further comprises:
and the third mode entering module is used for restarting the terminal and entering the first working mode after the first data storage module stores the target data in the second storage partition to the first storage partition.
Referring to fig. 12, which shows a schematic structural diagram of a terminal provided in an exemplary embodiment of the present application, as shown in fig. 12, the terminal includes a processor 1210, a memory 1220, a display component 1230 and a sensor component 1240, wherein the display component 1230 is used for displaying an interface of a program running in a foreground in the terminal, and the sensor component 1240 is used for collecting data of various sensors. The memory 1220 stores at least one instruction, at least one program, a set of codes, or a set of instructions, which are loaded and executed by the processor 1210 to implement some or all of the steps executed by the terminal in the data recovery method according to the above embodiments.
The present invention further provides a computer-readable medium, which stores at least one instruction, at least one program, a code set, or a set of instructions, where the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement all or part of the steps executed by the terminal in the data recovery method according to the above embodiments.
The present application further provides a computer program product, where at least one instruction, at least one program, a code set, or an instruction set is stored in the computer program product, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement all or part of the steps executed by the terminal in the data recovery method according to the above embodiments.
It should be noted that: the image recognition result filtering apparatus provided in the foregoing embodiments is only exemplified by the foregoing embodiments when executing the image recognition result filtering method, and in an actual program, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (12)
1. A data recovery method, characterized in that the method is performed by a terminal, the method comprising:
when the terminal is in a first working mode, receiving an instruction for recovering target data in the terminal; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted;
restarting the terminal and entering a second working mode, wherein the second working mode is a working mode for mounting the first storage partition and the second storage partition;
and storing target data in the second storage partition to the first storage partition, wherein the target data is data stored from the first storage partition to the second storage partition when factory reset is carried out on the terminal last time.
2. The method according to claim 1, wherein before said restarting said terminal and entering into said second operating mode, further comprising:
when an instruction of recovering the target data in the terminal is received, performing first verification, wherein the first verification is used for verifying whether the terminal has the authority of recovering the target data;
and when the first verification is passed, executing the step of restarting the terminal and entering a second working mode.
3. The method according to claim 2, wherein the performing a first verification upon receiving an instruction to recover target data in the terminal comprises:
when the user identity information of logging in the terminal when the factory setting is restored on the terminal last time is stored in the second storage partition, performing the first verification according to the user identity information;
or,
and when the verification password set when the factory setting is restored on the terminal last time is stored in the second storage partition, performing the first verification according to the verification password.
4. The method of claim 2, further comprising:
deleting the target data from the second storage partition when the first verification fails N times.
5. The method of claim 1, wherein storing the target data in the second memory partition to the first memory partition comprises:
copying the target data to a folder located at the last position in the original file directory according to the original file directory, where the original file directory is a file directory of the target data in the first storage partition when the terminal is subjected to factory reset last time, and each original folder is a folder of each folder name included in the original file directory.
6. The method of claim 1, further comprising:
when the terminal is in a first working mode, receiving and executing the instruction for restoring factory settings;
restarting the terminal and entering the second working mode;
and storing the target data in the first storage partition to the second storage partition, and deleting the data in the first storage partition.
7. The method of claim 1, wherein the second memory partition has a first storage time stored therein, and further comprising, prior to said storing the target data in the second memory partition to the first memory partition:
judging whether second storage time of the target data stored in the second partition is shorter than the first storage time;
and when the second storage time is less than the first storage time, executing the step of storing the target data in the second storage partition to the first storage partition.
8. The method of claim 7, further comprising:
and when the second storage time is not less than the first storage time, deleting the target data from the second storage partition.
9. The method according to any one of claims 1 to 8, further comprising, after storing the target data in the second memory partition to the first memory partition:
and restarting the terminal again and entering the first working mode.
10. A data recovery apparatus, wherein the apparatus is used in a terminal, the apparatus comprising:
a recovery instruction receiving module, configured to receive an instruction to recover target data in the terminal when the terminal is in a first working mode; the first working mode is a working mode that the first storage partition is mounted and the second storage partition is not mounted;
a first mode entering module, configured to restart the terminal and enter a second working mode, where the second working mode is a working mode in which the first storage partition and the second storage partition are mounted;
and the first data storage module is used for storing target data in the second storage partition to the first storage partition, wherein the target data is data stored from the first storage partition to the second storage partition when factory restoration setting is carried out on the terminal last time.
11. A terminal device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the data recovery method according to any one of claims 1 to 9.
12. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a data recovery method as claimed in any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910910027.7A CN110704243A (en) | 2019-09-25 | 2019-09-25 | Data recovery method and device, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910910027.7A CN110704243A (en) | 2019-09-25 | 2019-09-25 | Data recovery method and device, terminal equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110704243A true CN110704243A (en) | 2020-01-17 |
Family
ID=69197179
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910910027.7A Pending CN110704243A (en) | 2019-09-25 | 2019-09-25 | Data recovery method and device, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110704243A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111400094A (en) * | 2020-03-13 | 2020-07-10 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for restoring factory settings of server system |
CN113495806A (en) * | 2020-03-20 | 2021-10-12 | 宇龙计算机通信科技(深圳)有限公司 | Method, device, storage medium and terminal for recovering user data |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102915263A (en) * | 2012-10-19 | 2013-02-06 | 北京小米科技有限责任公司 | Data backup method, system and equipment |
CN104932955A (en) * | 2015-05-29 | 2015-09-23 | 深圳市创维电器科技有限公司 | Method for backing up data during factory setting restoring of mobile terminal, and mobile terminal |
CN105183517A (en) * | 2015-09-14 | 2015-12-23 | 广东欧珀移动通信有限公司 | Method and device for mounting external storage equipment in recovery mode and electronic device |
WO2016101424A1 (en) * | 2014-12-24 | 2016-06-30 | 中兴通讯股份有限公司 | Method and apparatus for realizing terminal service information processing |
CN105843710A (en) * | 2016-04-08 | 2016-08-10 | 努比亚技术有限公司 | Data backup and recovery device and method |
CN106095615A (en) * | 2016-06-01 | 2016-11-09 | 乐视控股(北京)有限公司 | Application data restoration method and device |
CN108228388A (en) * | 2018-01-10 | 2018-06-29 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal for restoring setting |
-
2019
- 2019-09-25 CN CN201910910027.7A patent/CN110704243A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102915263A (en) * | 2012-10-19 | 2013-02-06 | 北京小米科技有限责任公司 | Data backup method, system and equipment |
WO2016101424A1 (en) * | 2014-12-24 | 2016-06-30 | 中兴通讯股份有限公司 | Method and apparatus for realizing terminal service information processing |
CN104932955A (en) * | 2015-05-29 | 2015-09-23 | 深圳市创维电器科技有限公司 | Method for backing up data during factory setting restoring of mobile terminal, and mobile terminal |
CN105183517A (en) * | 2015-09-14 | 2015-12-23 | 广东欧珀移动通信有限公司 | Method and device for mounting external storage equipment in recovery mode and electronic device |
CN105843710A (en) * | 2016-04-08 | 2016-08-10 | 努比亚技术有限公司 | Data backup and recovery device and method |
CN106095615A (en) * | 2016-06-01 | 2016-11-09 | 乐视控股(北京)有限公司 | Application data restoration method and device |
CN108228388A (en) * | 2018-01-10 | 2018-06-29 | 青岛海信移动通信技术股份有限公司 | A kind of method and terminal for restoring setting |
Non-Patent Citations (1)
Title |
---|
沈大林: "BIOS设置方法", 《计算机组装与维护案例教程》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111400094A (en) * | 2020-03-13 | 2020-07-10 | 苏州浪潮智能科技有限公司 | Method, device, equipment and medium for restoring factory settings of server system |
CN113495806A (en) * | 2020-03-20 | 2021-10-12 | 宇龙计算机通信科技(深圳)有限公司 | Method, device, storage medium and terminal for recovering user data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9864655B2 (en) | Methods and apparatus for mobile computing device security in testing facilities | |
US9558072B1 (en) | Block-level incremental recovery of a storage volume | |
CN103389928B (en) | A kind of method of computer data backup and recovery | |
CN101641681A (en) | Self-managed processing device | |
CN108241550B (en) | Backup and restoration method for operating system | |
EP3474143B1 (en) | Method and apparatus for incremental recovery of data | |
CN105843710A (en) | Data backup and recovery device and method | |
CN107168818B (en) | Terminal and machine-refreshing failure recovery method | |
CN105320578A (en) | Method and apparatus for backing up and recovering APP | |
CN103176864A (en) | Backup method, backup device and mobile terminal based on Android system | |
CN106599115B (en) | Data protection method, device and terminal | |
CN110704243A (en) | Data recovery method and device, terminal equipment and storage medium | |
CN106776908B (en) | Data cleaning method and device and terminal | |
CN102521289A (en) | File synchronization method, device and system | |
CN104346549A (en) | Information processing method and electronic equipment | |
TW200305807A (en) | Basic input/output system (BIOS) shadowed small-print hard disk drive as robust, always on, backup for hard disk image & software failure | |
CN105867962A (en) | System upgrading method and device | |
CN104572354A (en) | Backup and restoration method for operating system based on restoration service and equipment thereof | |
CN107967193A (en) | Boot starts method and embedded device | |
CN111338889B (en) | Evidence obtaining method, device, equipment and storage medium supporting multiple operating systems | |
CN103049343A (en) | Method and device for restoring operating system blue screen | |
CN112333008B (en) | Cloud host complete machine backup and restoration method, device, equipment and storage medium | |
CN107169053A (en) | log information deriving method and device | |
CN116737466B (en) | Backup processing method, device, system, electronic equipment and readable storage medium | |
CN102142066A (en) | Computing equipment and backup recovery method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200117 |