WO2020010584A1 - 一种终端恢复出厂设置时的数据恢复方法及终端 - Google Patents

一种终端恢复出厂设置时的数据恢复方法及终端 Download PDF

Info

Publication number
WO2020010584A1
WO2020010584A1 PCT/CN2018/095487 CN2018095487W WO2020010584A1 WO 2020010584 A1 WO2020010584 A1 WO 2020010584A1 CN 2018095487 W CN2018095487 W CN 2018095487W WO 2020010584 A1 WO2020010584 A1 WO 2020010584A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
terminal
storage space
restored
recovered
Prior art date
Application number
PCT/CN2018/095487
Other languages
English (en)
French (fr)
Inventor
徐世坤
于飞
陈中领
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to US17/256,858 priority Critical patent/US20210149578A1/en
Priority to CN201880075248.0A priority patent/CN111373380A/zh
Priority to BR112020026449-0A priority patent/BR112020026449A2/pt
Priority to PCT/CN2018/095487 priority patent/WO2020010584A1/zh
Publication of WO2020010584A1 publication Critical patent/WO2020010584A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/068Hybrid storage device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup

Definitions

  • This application relates to the field of terminals, and in particular, to a data recovery method and a terminal when the terminal restores factory settings.
  • Terminals such as mobile phones are generally provided with a function of restoring factory settings (recovery, also known as one-click recovery or resetting the mobile phone).
  • This function specifically refers to restoring the phone to the state it was in when the phone was shipped from the factory. After restoring the factory settings, all existing phone settings, stored and installed applications, and data in the application will be cleared and returned to the original settings at the factory. status.
  • the present application provides a data recovery method and a terminal when the terminal is restored to the factory settings, which can quickly and safely restore the data that the user wishes to keep in the mobile phone after restoring the factory settings, and improve the data stability and security in the terminal.
  • the present application provides a data recovery method when a terminal restores factory settings, including: in response to a user's first input of turning on the factory reset function, the terminal displays at least one candidate data; the terminal receives the user from the candidate data Select the second input of the data to be restored; the terminal backs up the selected data to be restored to the target storage space, which is a storage space that will not be formatted when restoring the factory settings; then, perform the operation of restoring the factory settings on the terminal After that, the data to be restored may be restored from the target storage space to an initial storage path of the data to be restored, where the initial storage path is a storage directory where the data to be restored is located before restoring factory settings.
  • the terminal can retain the data to be restored that the user does not want to be cleared while restoring the factory settings.
  • the above-mentioned backup and recovery process of the data to be restored is completed by using the storage resources in the terminal. Therefore, during the entire process of restoring the factory settings, the terminal can ensure the security of the data to be restored without resorting to external storage devices. And stability.
  • the candidate data includes at least one of a contact, a short message, a picture, a video, a call history, music, and an application.
  • the method before the terminal backs up the data to be restored to the target storage space, the method further includes: if the size of the data to be restored is less than the size of the first remaining space, the terminal determines that the target storage space is RAM Unoccupied storage space, the first remaining space is unoccupied storage space in the terminal's RAM; or, if the size of the data to be recovered is less than the size of the second remaining space, the terminal determines that the target storage space is ROM Unoccupied storage space, the second remaining space is unoccupied storage space in the ROM of the terminal; or, if the size of the data to be recovered is larger than the size of the first remaining space and larger than the size of the second remaining space, And is smaller than the sum of the first remaining space size and the second remaining space size, the terminal determines that the target storage space includes unoccupied space in ROM and unoccupied storage space in the RAM. That is, the target storage space used by the terminal to back up the data to be restored when restoring the factory settings is dynamically determined according to the size of the data to be restored
  • the method further includes: the terminal marks the data to be recovered.
  • the terminal may record the initial storage path of the data to be restored in a preset backup list. In this way, the terminal can learn which data is selected by the user and needs to be backed up to be restored by reading the backup list.
  • the terminal backing up the data to be restored to the target storage space includes: the terminal acquires the data to be restored according to an initial storage path recorded in the backup list, and copies the data to be restored to the target storage.
  • the method further includes: the terminal compares the size of the data to be recovered with the unoccupied storage in the target storage space. The size of the space; if the size of the data to be recovered is greater than the size of the unoccupied storage space in the target storage space, the terminal prompts the user to cancel some of the data to be recovered.
  • the method before the terminal backs up the data to be restored to the target storage space, the method further includes: the terminal determines that the size of the data to be restored is not greater than the size of the unoccupied storage space in the target storage space.
  • the method before the terminal backs up the data to be restored to the target storage space, the method further includes: the terminal creates a new partition in the ROM of the terminal according to the size of the data to be restored, and the new partition is used as the target storage. Space; wherein the terminal backs up the data to be restored to the target storage space, including: the terminal backs up the data to be restored from the original storage space to the new partition.
  • the new partition includes unoccupied storage space in the data partition in the ROM. Then, before the terminal creates a new partition in the ROM of the terminal according to the size of the data to be restored, the method further includes: the terminal deletes data in the data partition except the data to be restored.
  • the terminal stores the correspondence between the data to be restored in the target storage space and the data to be restored under the initial storage path; wherein the terminal restores the data to be restored from the target storage space
  • the initial storage path to the data to be recovered includes: the terminal recovering the data to be recovered from the target storage space to the original storage path of the data to be recovered according to the correspondence relationship.
  • the method further includes: the terminal displaying the foregoing list of data to be restored; the terminal obtaining a third input of the user, the third input being used to extract from the list of data to be restored Selecting the data to be restored; where the terminal restores the data to be restored from the target storage space to an initial storage path of the data to be restored includes: the terminal restores the data selected by the third input to the data selected by the third input Under the initial storage path, thereby improving the friendliness of human-computer interaction when the phone is restored to factory settings.
  • the present application provides a terminal, including an acquisition unit, a display unit, a backup unit, an execution unit, and a recovery unit, wherein the display unit is configured to: display at least one Candidate data; the obtaining unit is configured to receive a second input of the data selected by the user from the candidate data to be restored; the backup unit is configured to: back up the to-be-restored data to a target storage space when the target storage space is restored to factory settings Storage space that will not be formatted; the execution unit is used to: perform the operation of restoring factory settings; the recovery unit is used to: restore the data to be restored from the target storage space to the initial storage path of the data to be restored, the initial The storage path is the storage directory where the data to be restored is located before the factory settings are restored.
  • the display unit is configured to: display at least one Candidate data
  • the obtaining unit is configured to receive a second input of the data selected by the user from the candidate data to be restored
  • the backup unit is configured to: back up the to-be-restore
  • the backup unit is further configured to: if the size of the data to be restored is smaller than the size of the first remaining space, determine that the target storage space is an unoccupied storage space in the RAM, and The remaining space is the unoccupied storage space in the RAM of the terminal; or if the size of the data to be recovered is less than the size of the second remaining space, it is determined that the target storage space is the unoccupied storage space in the ROM, and the second remaining The space is the unoccupied storage space in the ROM of the terminal; or if the size of the data to be recovered is larger than the size of the first remaining space and larger than the size of the second remaining space, and smaller than the first remaining space and the second remaining space The sum of the sizes determines that the target storage space includes unoccupied space in the ROM and unoccupied storage space in the RAM.
  • the execution unit is further configured to: mark the data to be restored. For example, the initial storage path of the data to be restored is recorded in a preset backup list
  • the foregoing backup unit is specifically configured to: obtain the data to be restored according to an initial storage path recorded in the backup list, and copy the data to be restored to the target storage space.
  • the execution unit is further configured to: compare the size of the data to be restored with the size of the unoccupied storage space in the target storage space; if the size of the data to be restored is larger than the target storage space The amount of unoccupied storage space, the user is prompted to cancel some of the data to be recovered.
  • the execution unit is further configured to: create a new partition in the ROM of the terminal according to the size of the data to be restored, and use the new partition as the target storage space;
  • the backup unit is specifically configured to: The data to be recovered is backed up from the original storage space to the new partition.
  • the new partition includes unoccupied storage space in the data partition in the ROM, and the execution unit is further configured to delete data in the data partition other than the data to be recovered.
  • the terminal stores a correspondence relationship between the data to be restored in the target storage space and the data to be restored under the initial storage path; the above-mentioned restoration unit is specifically configured to: The data to be restored is restored from the target storage space to an initial storage path of the data to be restored.
  • the display unit is further configured to display the list of data to be restored;
  • the acquisition unit is further configured to obtain a third input of the user, and the third input is used to select a third input from the list of data to be restored.
  • the recovery unit is specifically configured to recover the data selected by the third input to an initial storage path of the data selected by the third input.
  • the present application provides a terminal including: a touch screen, one or more processors, a memory, and one or more programs; wherein the processor is coupled to the memory, and the one or more programs are stored in the memory
  • the processor executes one or more programs stored in the memory, so that the terminal executes any one of the data recovery methods when the terminal is restored to factory settings.
  • the present application provides a computer storage medium including computer instructions, and when the computer instructions are run on a terminal, the terminal executes the data recovery method when the terminal restores factory settings according to any one of the foregoing.
  • the present application provides a computer program product that, when the computer program product runs on a computer, causes the computer to execute the data recovery method when the terminal restores factory settings according to any one of the above.
  • the terminals described in the second and third aspects provided above, the computer storage medium described in the fourth aspect, and the computer program product described in the fifth aspect are all used to execute the corresponding ones provided above.
  • Method therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, which will not be repeated here.
  • FIG. 1 is a first schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an internal memory in a terminal according to an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an operating system in a terminal according to an embodiment of the present application.
  • FIG. 4 is a flowchart of a data recovery method when a terminal restores factory settings according to an embodiment of the present application
  • FIG. 5 is a first schematic scenario scenario of a data recovery method when a terminal restores factory settings according to an embodiment of the present application
  • FIG. 6 is a second schematic scenario diagram of a data recovery method when a terminal restores factory settings according to an embodiment of the present application
  • FIG. 7 is a third scenario scenario of a data recovery method when a terminal restores factory settings according to an embodiment of the present application.
  • FIG. 8 is a scenario diagram 4 of a data recovery method when a terminal restores factory settings according to an embodiment of the present application
  • FIG. 9 is a scenario diagram V of a data recovery method when a terminal restores factory settings according to an embodiment of the present application.
  • FIG. 10 is a sixth schematic scenario diagram of a data recovery method when a terminal restores factory settings according to an embodiment of the present application.
  • 11 is a scenario diagram VII of a data recovery method when a terminal restores factory settings according to an embodiment of the present application
  • FIG. 12 is a schematic diagram VIII of a data recovery method when a terminal restores factory settings according to an embodiment of the present application
  • FIG. 13 is a second schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 14 is a third schematic structural diagram of a terminal according to an embodiment of the present application.
  • the terminal may be a mobile phone, a tablet, a desktop, a laptop, a laptop, an Ultra-mobile Personal Computer (UMPC), a handheld computer, a netbook, or a Personal Digital Assistant (Personal Digital Assistant, PDA), wearable electronic devices, virtual reality devices, and the like, the specific form of the terminal is not particularly limited in the embodiments of the present application.
  • UMPC Ultra-mobile Personal Computer
  • PDA Personal Digital Assistant
  • FIG. 1 is a structural block diagram of a terminal 100 according to an embodiment of the present invention.
  • the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a radio frequency module 150, a communication module 160, and an audio module.
  • a processor 110 an external memory interface 120, an internal memory 121, a USB interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a radio frequency module 150, a communication module 160, and an audio module.
  • speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display 194, and SIM card interface 195 may be included in the terminal 100.
  • the sensor module can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor. 180L, bone conduction sensor, etc.
  • the touch sensor 180K, the microphone 170C, the antenna 1, the antenna 2, the radio frequency module 150, and the communication module 160 can be used as input devices of the terminal 100 to receive information input by a user or other devices.
  • the speaker 170A, the receiver 170B, the display screen 194, and the like described above can be used as output devices of the terminal 100 to output information input by the user or information provided to the user and various menus of the terminal 100.
  • the structure illustrated in the embodiment of the present invention does not limit the terminal 100. It can include more or fewer parts than shown, or some parts can be combined, or some parts can be split, or different parts can be arranged.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image, signal processor, ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • different processing units can be independent devices or integrated in the same processor.
  • the controller may be a decision maker who directs the various components of the terminal 100 to coordinate work according to the instructions. It is the nerve center and command center of the terminal 100.
  • the controller generates operation control signals according to the instruction operation code and timing signals, and completes the control of fetching and executing the instructions.
  • the processor 110 may further include a memory for storing instructions and data.
  • the memory in the processor is a cache memory. You can save instructions or data that the processor has just used or recycled. If the processor needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses, reducing processor waiting time, thus improving system efficiency.
  • the processor 110 may include an interface.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit (inter-integrated circuit, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transceiver (universal asynchronous receiver / transmitter (UART) interface, mobile industry processor interface (MIPI), general-purpose input / output (GPIO) interface, subscriber identity module (SIM) interface, And / or a universal serial bus (universal serial bus, USB) interface.
  • I2C integrated circuit
  • I2S integrated circuit
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input / output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a two-way synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor may include multiple sets of I2C buses.
  • the processor can be coupled to touch sensors, chargers, flashes, cameras, etc. through different I2C bus interfaces.
  • the processor may couple the touch sensor through the I2C interface, so that the processor and the touch sensor communicate through the I2C bus interface to implement the touch function of the terminal 100.
  • the I2S interface can be used for audio communication.
  • the processor may include multiple sets of I2S buses.
  • the processor can be coupled with the audio module through the I2S bus to achieve communication between the processor and the audio module.
  • the audio module can pass audio signals to the communication module through the I2S interface, so as to implement the function of receiving calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing, and encoding analog signals.
  • the audio module and the communication module may be coupled through a PCM bus interface.
  • the audio module may also pass audio signals to the communication module through the PCM interface, so as to implement the function of receiving calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication, and the sampling rates of the two interfaces are different.
  • the UART interface is a universal serial data bus for asynchronous communication. This bus is a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor and the communication module 160.
  • the processor communicates with the Bluetooth module through a UART interface to implement the Bluetooth function.
  • the audio module can transmit audio signals to the communication module through the UART interface to implement the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect processors with peripheral devices such as displays and cameras.
  • the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like.
  • the processor and the camera communicate through a CSI interface to implement a shooting function of the terminal 100.
  • the processor and the display screen communicate through a DSI interface to implement a display function of the terminal 100.
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor with a camera, a display screen, a communication module, an audio module, a sensor, and the like.
  • GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface can be used to connect a charger to charge the terminal 100, and can also be used to transfer data between the terminal 100 and a peripheral device. It can also be used to connect headphones and play audio through headphones. It can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present invention is only a schematic description, and does not constitute a limitation on the structure of the terminal 100.
  • the terminal 100 may use different interface connection modes or a combination of multiple interface connection modes in the embodiments of the present invention.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module may receive a charging input of a wired charger through a USB interface.
  • the charging management module may receive a wireless charging input through a wireless charging coil of the terminal 100. While the charging management module is charging the battery, it can also supply power to the terminal device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charge management module 140 and the processor 110.
  • the power management module receives inputs from the battery and / or charge management module, and supplies power to a processor, an internal memory, an external memory, a display screen, a camera, and a communication module.
  • the power management module can also be used to monitor battery capacity, battery cycle times, battery health (leakage, impedance) and other parameters.
  • the power management module 141 may also be disposed in the processor 110.
  • the power management module 141 and the charge management module may also be provided in the same device.
  • the wireless communication function of the terminal 100 may be implemented by the antenna module 1, the antenna module 2 radio frequency module 150, the communication module 160, a modem, and a baseband processor.
  • the antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals.
  • Each antenna in the terminal 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, a cellular network antenna can be multiplexed into a wireless LAN diversity antenna. In some embodiments, the antenna may be used in conjunction with a tuning switch.
  • the radio frequency module 150 may provide a communication processing module applied to the terminal 100 and including a wireless communication solution such as 2G / 3G / 4G / 5G. It may include at least one filter, switch, power amplifier, Low Noise Amplifier (LNA), and the like.
  • the radio frequency module receives electromagnetic waves from the antenna 1, and processes the received electromagnetic waves by filtering, amplifying, etc., and transmitting them to the modem for demodulation.
  • the radio frequency module can also amplify the signal modulated by the modem and turn it into electromagnetic wave radiation through the antenna 1.
  • at least part of the functional modules of the radio frequency module 150 may be disposed in the processor 150.
  • at least part of the functional modules of the radio frequency module 150 may be provided in the same device as at least part of the modules of the processor 110.
  • the modem may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs sound signals through audio equipment (not limited to speakers, receivers, etc.), or displays images or videos through a display screen.
  • the modem may be a separate device.
  • the modem may be independent of the processor and disposed in the same device as the radio frequency module or other functional modules.
  • the communication module 160 can provide wireless LAN (wireless local area networks, WLAN), Bluetooth (Bluetooth, BT), global navigation satellite system (GNSS), frequency modulation (FM) applied to the terminal 100.
  • a communication processing module of a wireless communication solution such as near field communication (NFC), infrared technology (infrared, IR).
  • the communication module 160 may be one or more devices that integrate at least one communication processing module.
  • the communication module receives electromagnetic waves through the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor.
  • the communication module 160 may also receive a signal to be transmitted from the processor, frequency-modulate it, amplify it, and turn it into electromagnetic wave radiation through the antenna 2.
  • the antenna 1 of the terminal 100 is coupled to a radio frequency module, and the antenna 2 is coupled to a communication module. It enables the terminal 100 to communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include a global mobile communication system (GSM), a general packet radio service (GPRS), a code division multiple access (CDMA), and broadband.
  • GSM global mobile communication system
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA Code division multiple access
  • TD-SCDMA time-division code division multiple access
  • LTE long-term evolution
  • BT GNSS
  • WLAN NFC
  • FM FM
  • IR technology IR
  • the GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation navigation system (BDS), and a quasi-zenith satellite system (quasi -zenith satellite system (QZSS)) and / or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Bertdou navigation navigation system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the terminal 100 implements a display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display includes a display panel.
  • the display panel can use LCD (liquid crystal display), OLED (organic light-emitting diode), active matrix organic light emitting diode or active matrix organic light emitting diode emitting diodes, AMOLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (QLED), etc.
  • the terminal 100 may include one or N display screens, where N is a positive integer greater than 1.
  • the terminal 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen, and an application processor.
  • ISP is used to process data from camera feedback. For example, when taking a picture, the shutter is opened, and the light is transmitted to the light receiving element of the camera through the lens. The light signal is converted into an electrical signal, and the light receiving element of the camera passes the electrical signal to the ISP for processing and converts the image to the naked eye. ISP can also optimize the image's noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, an ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • An object generates an optical image through a lens and projects it onto a photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs digital image signals to the DSP for processing.
  • DSP converts digital image signals into image signals in standard RGB, YUV and other formats.
  • the terminal 100 may include one or N cameras, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, other digital signals can also be processed. For example, when the terminal 100 selects at a frequency point, the digital signal processor is used to perform a Fourier transform on the frequency point energy and the like.
  • Video codecs are used to compress or decompress digital video.
  • the terminal 100 may support one or more codecs. In this way, the terminal 100 can play or record videos in multiple encoding formats, such as: MPEG1, MPEG2, MPEG3, MPEG4, and so on.
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the terminal 100 can be implemented, such as: image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to realize the expansion of the storage capacity of the terminal 100.
  • the external memory card communicates with the processor through an external memory interface to implement a data storage function. For example, save music, videos and other files on an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the terminal 100 by executing instructions stored in the internal memory 121.
  • the memory 121 may include a program storage area and a data storage area.
  • the storage program area may store an operating system, at least one application required by a function (such as a sound playback function, an image playback function, etc.) and the like.
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the terminal 100.
  • the memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash memory (universal flash memory, UFS), etc. .
  • a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash memory (universal flash memory, UFS), etc.
  • the internal memory 121 may specifically include a RAM (random access memory) and a ROM (read-only memory).
  • RAM random access memory
  • ROM read-only memory
  • RAM random access memory
  • main memory main memory
  • It can be read and written at any time, and it is very fast. It is usually used as a temporary data storage medium for the operating system or other running programs.
  • the data stored in ROM can be easily read out, unlike RAM, which can be rewritten quickly and easily.
  • the data stored in ROM is relatively stable and will not change after power failure; its structure is simpler and easier to read, so it is often used to store various fixed programs and data.
  • RAM and ROM can include one or more partitions.
  • the ROM may include a system partition (such as a System partition, a Recovery partition), a program partition (such as a Data partition), and a storage partition (such as an SDCard partition).
  • the system partition can be used to store the operating system (such as the Android system), restore the backup system and resources such as swap space and hardware underlying space;
  • the program partition is used to store third-party APPs installed on the terminal.
  • the terminal can create a Data directory in the Data partition. For example, if there is an APP package named weixin.com, a directory named weixin.com can be created in the Data partition.
  • the application data generated by the APP running can be stored in a directory named weixin.com, and the APP can only operate the data in this directory, not the directories of other APPs; storage
  • the partition is equivalent to the "mobile hard disk” identified after the mobile phone is connected to the PC. This part of the space can be freely controlled by the user and can store data such as data packages, music, pictures, and videos of large games.
  • the terminal 100 can also dynamically create new partitions in RAM or ROM. For example, if the 2G space in the 4G ROM is not occupied, the terminal 100 may create a partition named "aaa" in the 2G space. Of course, the terminal 100 can also dynamically destroy the new partition created before, and the data in the partition is also destroyed after the new partition is destroyed.
  • one or more partitions in the ROM of the terminal 100 are generally formatted.
  • the terminal 100 may format the Data partition in the ROM and delete all files and folders in the Data partition, so that all applications installed in the Data partition and the data in each application are cleared, thereby destroying the terminal. 100 returns to the state it was in at the time of shipment.
  • the terminal 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, and an application processor. Such as music playback, recording, etc.
  • the audio module is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module can also be used to encode and decode audio signals.
  • the audio module may be disposed in the processor 110, or some functional modules of the audio module may be disposed in the processor 110.
  • the speaker 170A also called a "horn" is used to convert audio electrical signals into sound signals.
  • the terminal 100 can listen to music through a speaker, or listen to a hands-free call.
  • the receiver 170B also referred to as a "handset" is used to convert audio electrical signals into sound signals.
  • the terminal 100 answers a call or a voice message, it can answer the voice by placing the receiver close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound through the mouth close to the microphone, and input the sound signal into the microphone.
  • the terminal 100 may be provided with at least one microphone.
  • the terminal 100 may be provided with two microphones, in addition to collecting sound signals, it may also implement a noise reduction function.
  • the terminal 100 may further be provided with three, four, or more microphones to collect sound signals, reduce noise, and also identify sound sources, and implement directional recording functions.
  • the headset interface 170D is used to connect a wired headset.
  • the headphone interface can be a USB interface or a 3.5mm open mobile terminal platform (OMTP) standard interface, and the American Cellular Telecommunications Industry Association (United States of America, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA American Cellular Telecommunications Industry Association
  • the pressure sensor 180A is used to sense a pressure signal, and can convert the pressure signal into an electrical signal.
  • the pressure sensor may be disposed on the display screen.
  • the capacitive pressure sensor may be at least two parallel plates having a conductive material. When a force is applied to the pressure sensor, the capacitance between the electrodes changes.
  • the terminal 100 determines the intensity of the pressure according to the change in capacitance.
  • the terminal 100 detects the intensity of the touch operation according to a pressure sensor.
  • the terminal 100 may also calculate a touched position according to a detection signal of the pressure sensor.
  • touch operations acting on the same touch position but different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity lower than the first pressure threshold is applied to the short message application icon, an instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction for creating a short message is executed.
  • the gyro sensor 180B may be used to determine a movement posture of the terminal 100.
  • the angular velocity of the terminal 100 about three axes may be determined by a gyro sensor.
  • a gyroscope sensor can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor detects the angle of the terminal 100 to shake, and calculates the distance to be compensated by the lens module according to the angle, so that the lens can offset the shake of the terminal 100 through the backward movement to achieve image stabilization.
  • the gyroscope sensor can also be used for navigation and somatosensory game scenes.
  • the barometric pressure sensor 180C is used to measure air pressure.
  • the terminal 100 calculates an altitude based on the air pressure value measured by the air pressure sensor to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the terminal 100 can detect the opening and closing of the flip leather case by using a magnetic sensor.
  • the terminal 100 may detect the opening and closing of the flip according to a magnetic sensor. Further, according to the opened and closed state of the holster or the opened and closed state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the terminal 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the terminal 100 is stationary. It can also be used to identify the posture of the terminal, and is used in applications such as switching between horizontal and vertical screens, and pedometers.
  • the terminal 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal 100 may use a distance sensor to measure distances to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode. Infrared light is emitted outward through a light emitting diode.
  • the terminal 100 may use a proximity light sensor to detect that the user is holding the terminal 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor can also be used in holster mode, and the pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the terminal 100 can adaptively adjust the brightness of the display screen according to the perceived ambient light brightness.
  • the ambient light sensor can also be used to automatically adjust white balance when taking pictures.
  • the ambient light sensor can also cooperate with the proximity light sensor to detect whether the terminal 100 is in a pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the terminal 100 may use the collected fingerprint characteristics to realize fingerprint unlocking, access application lock, fingerprint photographing, fingerprint answering incoming calls, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the terminal 100 executes a temperature processing strategy using the temperature detected by the temperature sensor. For example, when the temperature reported by the temperature sensor exceeds a threshold, the terminal 100 executes reducing the performance of a processor located near the temperature sensor in order to reduce power consumption and implement thermal protection.
  • the touch sensor 180K is also called “touch panel”. Can be set on the display. Used to detect touch operations on or near it. The detected touch operation can be passed to the application processor to determine the type of touch event and provide corresponding visual output through the display screen.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor may acquire a vibration signal of a human voice oscillating bone mass.
  • Bone conduction sensors can also touch the human pulse and receive blood pressure beating signals.
  • a bone conduction sensor may also be provided in the headset.
  • the audio module 170 may analyze a voice signal based on a vibration signal of a oscillating bone mass obtained by the bone conduction sensor to implement a voice function.
  • the application processor may analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor, and implement a heart rate detection function.
  • the keys 190 include a power-on key, a volume key, and the like.
  • the keys can be mechanical keys. It can also be a touch button.
  • the terminal 100 receives key input, and generates key signal inputs related to user settings and function control of the terminal 100.
  • the motor 191 may generate a vibration prompt.
  • the motor can be used for incoming vibration alert and touch vibration feedback.
  • the touch operation applied to different applications can correspond to different vibration feedback effects.
  • Touch operations on different areas of the display can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminder, receiving information, alarm clock, game, etc.
  • Touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect to a subscriber identity module (SIM).
  • SIM subscriber identity module
  • the SIM card can be contacted and separated from the terminal 100 by inserting or removing the SIM card interface.
  • the terminal 100 may support one or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple SIM cards can be inserted into the same SIM card interface at the same time. The types of the multiple cards may be the same or different.
  • the SIM card interface can also be compatible with different types of SIM cards.
  • the SIM card interface is also compatible with external memory cards.
  • the terminal 100 interacts with the network through a SIM card to implement functions such as calling and data communication.
  • the terminal 100 uses an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the terminal 100 and cannot be separated from the terminal 100.
  • the software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
  • the Android system with a layered architecture is taken as an example to exemplify the software structure of the terminal 100.
  • the layered architecture divides the software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through interfaces.
  • the Android system is divided into four layers, which are an application layer, an application framework layer, an Android runtime and a system library, and a kernel layer from top to bottom.
  • the application layer can include a series of application packages.
  • the application package can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and other applications.
  • a system-level application generally means that the application has system-level permissions and can access various system resources.
  • Ordinary-level applications generally refer to: the application has ordinary permissions, may not be able to obtain some system resources, or needs user authorization to obtain some system resources.
  • System-level applications can be pre-installed applications in the phone.
  • Ordinary-level applications can be pre-installed applications in the phone, or can be installed by subsequent users.
  • the application framework layer provides an application programming interface (API) and a programming framework for applications at the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, and the like, which are not limited in the embodiment of the present application.
  • Activity Manager Used to manage the life cycle of each application. Applications usually run in the operating system as an Activity. For each Activity, there will be an application record (ActivityRecord) corresponding to it in the Activity Manager, and this ActivityRecord records the state of the Activity of the application. The activity manager can use this ActivityRecord as an identifier to schedule the application's Activity process.
  • ActivityRecord Used to manage the life cycle of each application. Applications usually run in the operating system as an Activity. For each Activity, there will be an application record (ActivityRecord) corresponding to it in the Activity Manager, and this ActivityRecord records the state of the Activity of the application. The activity manager can use this ActivityRecord as an identifier to schedule the application's Activity process.
  • Window manager used to manage graphical user interface (GUI) resources used on the screen, which can be specifically used to: obtain the size of the display screen, create and destroy windows, show and hide windows, layout of windows, focus Management, as well as input methods and wallpaper management.
  • GUI graphical user interface
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • the data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, and so on.
  • the view system includes visual controls, such as controls that display text, and controls that display pictures.
  • the view system can be used to build applications.
  • the display interface can consist of one or more views.
  • the display interface including the SMS notification icon may include a view displaying text and a view displaying pictures.
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages that can disappear automatically after a short stay without user interaction.
  • the notification manager is used to inform the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears in the status bar at the top of the system as a chart or scroll bar text, such as a notification from an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • the status bar prompts text messages, emits a tone, the terminal vibrates, and the indicator flashes.
  • Android Runtime includes core libraries and virtual machines.
  • Android runtime is responsible for the scheduling and management of the Android system.
  • the core library contains two parts: one is the functional functions that the Java language needs to call, and the other is the Android core library.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files. Virtual machines are used to perform object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library may include multiple functional modules. For example: surface manager (media manager), media library (Media library), OpenGL ES, SGL, etc.
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports a variety of commonly used audio and video formats for playback and recording, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • OpenGL ES is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • SGL is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
  • Application data generated by each application in the application layer at runtime can be saved to the corresponding directory or folder in the ROM.
  • a mobile phone housekeeper app for managing applications and files in the terminal can be installed in the application layer.
  • the mobile phone butler app is generally provided with functions such as "one-click restore” or "reset phone” to restore the terminal's factory settings.
  • the factory reset function of the terminal is actually a standard flashing protocol defined by android.
  • the terminal can start up and enter the recovery mode.
  • recovery mode the terminal can execute related programs in the recovery partition in ROM, such as the recovery program.
  • the recovery program Through the recovery program, the terminal can complete operations such as clearing data and installing flash packages.
  • the terminal may prompt the user to select the data to be restored, such as photos, videos, Contacts and applications.
  • the data to be restored selected by the user is actually stored in the data partition of the ROM.
  • the terminal can first back up the data to be restored to storage other than the data partition. Space (may be referred to as a target storage space in this application).
  • the data to be restored may be backed up to the RAM of the terminal, or the data to be restored may be backed up to other partitions of the ROM.
  • the terminal may enter the recovery mode described above, and format the data in the data partition by executing the corresponding recovery program, so that the terminal is restored to the state at the time of shipment.
  • the terminal After the terminal formats the data in the data partition, the user can be prompted to restore the backed up data to be restored to the data partition, so that the phone can retain the data such as applications that the user does not want to be cleared while restoring the factory settings.
  • the above-mentioned backup and recovery process of the data to be restored is completed by using the storage resources in the terminal. Therefore, during the entire process of restoring the factory settings, the terminal can ensure the security of the data to be restored without resorting to external storage devices. And stability.
  • the terminal restores the backed up data to be restored to the data partition
  • the terminal can delete the data to be restored in the target storage space to prevent the data to be restored from occupying storage resources during subsequent normal use of the terminal.
  • FIG. 4 is a schematic flowchart of a data recovery method when a terminal restores factory settings according to an embodiment of the present application. As shown in FIG. 4, the data recovery method may include:
  • the mobile phone receives the first input of the user to turn on the factory reset function.
  • the user wants to restore the phone to the state it was in when it was sold at the factory, the user can enter the phone's settings interface or open the phone manager app to find the function option of restoring factory settings.
  • an option 502 for restoring factory settings is set in the setting interface 501.
  • the mobile phone detects that the user opens option 502, it means that the user has performed the first input to turn on the factory reset function.
  • the mobile phone can continue to perform the following steps S402-S408 to complete the factory reset of the mobile phone and data backup before and after the factory reset. And resume operations.
  • the mobile phone In response to the first input, displays a display interface including at least one candidate data.
  • the above candidate data is generally stored in the ROM of the mobile phone.
  • stored in the data partition of the ROM For example, videos downloaded by the user using the video application 1 are generally stored in a folder corresponding to the video application 1 in the data partition, and videos downloaded by the user using the video application 2 are generally stored in a folder corresponding to the video application 2 in the data partition. in.
  • all data in the data partition will be formatted, causing user data loss.
  • the mobile phone may jump to the display interface 601 containing candidate data to be backed up.
  • the user may select the data to be restored that the user wishes to keep when restoring the factory settings in the display interface 601.
  • the display interface 601 includes at least one candidate data such as a contact, a short message, a photo, a call history, music, and an application.
  • an application as the candidate data may specifically include the application itself, and may also include the recorded data and stored files generated by the user during the use of the application, such as contact avatars, buffers, and downloaded pictures.
  • the mobile phone can also display the size of the storage space occupied by each candidate data on the display interface 601.
  • the mobile phone can further jump to the detailed interface of the candidate data. For example, after a user selects an application in the display interface 601, the mobile phone can display all the applications (for example, 15 applications) installed in the current mobile phone, so that the user can choose which applications to back up in order to avoid the factory settings of the mobile phone. After the corresponding application is lost.
  • the applications for example, 15 applications
  • the mobile phone can also query whether the candidate data is stored in the data partition of the ROM. If the candidate data is not stored, the data will not be lost after the mobile phone is restored to the factory settings. Therefore, the mobile phone can format the data in the ROM according to the existing process of restoring the factory settings.
  • the mobile phone may display a display interface including at least one candidate data according to the method described in step S402.
  • the mobile phone receives a second input in which the user selects data to be restored in the display interface.
  • one or more candidate data selected by the user in the above display interface are data to be restored that need to be backed up and restored before and after the phone is restored to factory settings.
  • the display interface 601 shown in FIG. 6 is still used as an example.
  • step S403 if it is detected that the user clicks the three candidate data of the contact, information, and call history in the display interface 601, and the user clicks the confirmation button 602, then It means that the user has performed the above-mentioned second input.
  • the mobile phone may determine the contacts, information, and call records stored in the ROM as the data to be restored to be backed up.
  • the above-mentioned second input may also be a drag operation, a long-press operation, or a press operation, which is not limited in the embodiment of the present application.
  • the mobile phone marks the data to be restored.
  • the mobile phone After the mobile phone receives the above-mentioned second input, the mobile phone can mark the data to be restored selected by the user, so that the mobile phone can distinguish which data the user wants to keep when restoring the factory settings later.
  • the mobile phone may create a backup list, and record the specific storage path of the data to be restored in the backup list.
  • the data to be restored selected by the user includes application A and application B.
  • the mobile phone may record the storage path “data / app / taobao.com” of the application A in the ROM in the backup list, and store the application B in the ROM.
  • the storage path "data / app / weixin.com” is recorded in the backup list. In this way, the mobile phone can learn which data is selected by the user and needs to be backed up to be restored by reading the backup list.
  • the mobile phone may add a corresponding identifier to the data to be restored selected by the user.
  • a header file may be added to the file where the data to be restored is located, or an identification file may be added to the folder where the data to be restored is located.
  • the mobile phone can learn which data is selected by the user and needs to be backed up to be restored by reading the above-mentioned header file or identification file.
  • the target storage space may be any storage space in the mobile phone other than the data partition in the ROM.
  • the target storage space may be RAM in the mobile phone, or the mobile phone may dynamically create a new partition as the target storage space.
  • the phone performs the operation of restoring factory settings, the data in the target storage space will not be formatted.
  • the operating mode of a mobile phone generally includes a normal mode, a safe mode, a bootloader mode, and a recovery mode.
  • the mobile phone can automatically enter the recovery mode, or it can enter the recovery mode after the user manually confirms that the mobile phone is reset to factory settings.
  • the mobile phone may pop up a dialog box 701 to prompt the user to confirm whether to perform the operation of restoring factory settings. If the user enters a confirmation to perform the operation of restoring factory settings, the mobile phone may Turn off automatically, and then enter recovery mode after turning on automatically.
  • the mobile phone can first check whether the marked data to be recovered is stored in the mobile phone. For example, the mobile phone can read the backup list created in step S404. If the marked list of data to be restored is recorded in the backup list, it means that the data to be restored needs to be backed up before restoring the phone to the factory settings. Data to be recovered is lost. Otherwise, the phone can directly perform the factory reset operation.
  • the mobile phone can also calculate the amount of space required to back up the data to be restored. Take the target storage space as the RAM of the mobile phone as an example. If the space required for the data to be recovered is less than or equal to the size of the available storage space in RAM, then as shown in Figure 8, after the mobile phone enters the recovery mode, it can jump to the interface 801 The interface 801 prompts the user that the data to be restored selected by the user is being backed up. At the same time, the mobile phone can read the data to be restored selected by the user according to the storage path recorded in the backup list, and then copy the data to be restored to the RAM to complete the backup.
  • the mobile phone may first perform a memory cleaning operation to release as much RAM space as possible. If after performing the memory cleaning operation, the available storage space in the RAM still cannot meet the space required for the data to be recovered, the mobile phone may continue to stay in the above display interface 601. At this time, as shown in FIG. 9, the mobile phone may A prompt 901 is displayed on the display interface 601 to prompt the user that the current available backup space is insufficient, and the user needs to cancel some of the selected data to be restored.
  • the user may cancel one or more of the data to be restored to be backed up selected in step S403 in the display interface 601 according to the prompt 901, until the available storage space size of the RAM can satisfy the space required by the user for the data to be restored after the update. size. Further, as shown in FIG. 8, when the mobile phone enters the recovery mode, the user can read the data to be restored finally updated by the user according to the storage path recorded in the backup list, and copy the data to be restored to the RAM to complete the backup.
  • the mobile phone may copy the data to be restored in the data partition in the ROM to the tmp partition in the RAM.
  • the tmp partition is generally used to store temporary files generated when the mobile phone is running. Copying the data to be restored to the tmp partition can prevent the mobile phone from occupying additional system resources when backing up the data to be restored, increasing the load of the phone in the recovery mode.
  • the mobile phone may use the space required for the data to be restored, Create a new partition, such as the resume partition, in the free storage space of the ROM. At this time, the newly created resume partition is the target storage space.
  • the ROM size of a mobile phone is 128G, and 80G of unused storage space is left in addition to the data partition, and the space required for the data to be recovered is 20G. Then, the mobile phone can create a 20G size resume partition in the remaining 80G storage space. Furthermore, the mobile phone can read the data to be restored according to the storage path recorded in the backup list, and copy the data to be restored to the newly created resume partition to complete the backup.
  • the mobile phone can also open a new partition from the data partition as the target storage space.
  • the size of the data partition in ROM is 90G, of which 30G is unoccupied storage space.
  • the size of the data to be recovered selected by the user is 15G, then the mobile phone can create a 15G resume partition in the above-mentioned 30G unoccupied storage space for storing the above-mentioned data to be recovered.
  • the size of the data partition changed from 90G to 75G after the new partition was created.
  • the mobile phone may delete data in the data partition other than the data to be recovered, thereby releasing storage resources in the data partition.
  • the mobile phone may create a resume partition in the data partition with a size that satisfies the size of the data to be restored to store the data to be restored.
  • the mobile phone can also obtain a part of the storage resources from the data partition in ROM, and obtain a part of the storage resources (such as the unoccupied storage space of 5G) from other partitions (such as the system partition) in addition to the data partition, and then use this Two parts of the storage resource create a new resume partition.
  • a part of the storage resources such as the unoccupied storage space of 5G
  • other partitions such as the system partition
  • the target storage space may include both the RAM in the mobile phone and the newly created resume partition.
  • the mobile phone can back up a part of the data to be restored to the RAM, and back up another part of the data to be restored to the newly created resume partition.
  • users can use the target storage space to back up as much data as possible to be restored.
  • the mobile phone when the mobile phone copies the data to be restored in the above target storage space, it may also compress the data to be restored first to minimize the target storage space occupied by the data to be restored. Alternatively, the mobile phone may also encrypt the data to be restored first to improve the security of the mobile phone when copying the data to be restored.
  • the mobile phone performs an operation of restoring factory settings.
  • step S406 the mobile phone can follow the existing method of restoring factory settings and format the data partition in the ROM in the recovery mode. After formatting, the files and folders in the data partition are erased. In addition, in the recovery mode, the mobile phone can also restore the settings of the operating system to the initial default settings, so that the mobile phone is restored to the state when it was sold at the factory.
  • a dialog box 1001 shown in FIG. 10 may be displayed to prompt the user to restore the data to be restored backed up before restoring the factory settings to the phone after restoring the factory settings. Then, if the user confirms to recover the data to be recovered, the mobile phone may read the data to be recovered from the target storage space and copy the data to be recovered to the data partition of the ROM.
  • a correspondence relationship between the backed up data to be restored in the target storage space and the data to be restored in the data partition may be established.
  • the mobile phone restores the original to-be-recovered data in the data partition, it can restore each backup to-be-recovered data to a corresponding position in the data partition according to the corresponding relationship.
  • the data to be backed up named a under the original storage path A is stored in location B in the target storage space and renamed b, then the correspondence between "A ⁇ a" and "B ⁇ b" is recorded .
  • the data with the name b at the position B in the target storage space can be restored to the original storage path A, and the name can be changed to a.
  • the mobile phone may use the backup list created when backing up the data to be restored as the foregoing correspondence relationship.
  • the name of the data to be restored and the storage structure within the data to be restored are not modified.
  • a mobile phone backs up a folder named "weibo.com” in the "app” folder in the data partition, it still uses "weibo.com” as the name of the folder to copy the contents of the folder to the target storage. In space.
  • the mobile phone can copy the folder "weibo.com” of Weibo APP and the folder “taobao.com” of Taobao APP to ROM according to the storage path recorded in the backup list.
  • the folder named "app”. Of course, if there is no folder named “app” after the data partition is formatted, the phone can first create a folder named “app”, and then add the Weibo APP folder “weibo.com” and the Taobao APP ’s The folder “taobao.com” is copied to the newly created folder named "app” in the data partition. At this time, as shown in FIG.
  • the restored Weibo APP and Taobao APP will be displayed on the desktop 1101 again. Since the data in the folders of Weibo APP and Taobao APP have not changed before and after the factory reset, the functions such as settings in the Weibo APP and Taobao APP have not changed, so that users can experience the changes To seamless operation experience.
  • the foregoing correspondence relationship may also be a correspondence list newly created when the mobile phone backs up the data to be restored. For example, when a mobile phone backs up a file named 002 in the "aa” folder in the data partition, the file name is modified to 001 and stored in the target storage space. Then, the mobile phone may record in the above corresponding list that the file named "001" in the target storage space corresponds to the file named 002 in the "aa” folder in the data partition.
  • the mobile phone when the mobile phone subsequently restores the data to be restored to the data partition, even if the name of the data to be restored is stored in the target storage space or the storage structure in the data to be restored is changed, the mobile phone can still use the corresponding storage list to restore the target storage space The data to be restored is restored to the data partition.
  • a to-be-restored data list 1201 shown in FIG. 12 may be displayed.
  • the to-be-restored data list 1201 includes one or more items of to-be-restored data selected by the user in step S403.
  • the user may select from the list of data to be restored 1201 which data to be restored is restored to the mobile phone after restoring factory settings.
  • the user can choose which data to back up specifically when data is to be restored, and which data to be restored when data is restored, thereby improving the friendliness of human-computer interaction when the phone is restored to factory settings.
  • the data to be restored in the target storage space can also be automatically restored to the data partition.
  • the mobile phone can copy the data to be recovered in the target storage space to the data partition in the recovery mode.
  • the mobile phone may also exit the recovery mode and re-enter the normal mode, and in the normal mode, the data to be recovered in the target storage space is copied to the data partition, which is not limited in this embodiment of the present application.
  • the mobile phone restores the data to be recovered in the target storage space to the data partition in the recovery mode, it can exit the recovery mode and enter the normal mode. For example, after the mobile phone receives the user's confirmation of restarting the mobile phone, it can automatically shut down and then enter the normal mode after automatically turning on the mobile phone. Since the mobile phone has recovered the data to be recovered from the target storage space to the data partition in the recovery mode, as shown in Figure 11, the Weibo APP and Taobao APP that were restored after the mobile phone entered normal mode will be displayed on the desktop 1101 again. .
  • the mobile phone may also prompt the user to exit the recovery mode and enter the normal mode to restore the data to be restored backed up before restoring the factory settings to the mobile phone after restoring the factory settings.
  • This embodiment of the present application does not place any restrictions on this.
  • the mobile phone may delete the data to be restored stored in the target storage space to release the storage resources in the phone, and the phone is completely restored to the state at the time of factory sale.
  • the mobile phone may display the pop-up box shown in FIG. 10 or FIG. 12 multiple times to prompt the user to restore the data to be restored. If the user refuses to restore the data to be restored multiple times (for example, 3 times in a row), the mobile phone may delete the data stored in the target storage space. Data to be recovered. Alternatively, the mobile phone may save the data to be restored stored in the target storage space for a certain period of time (for example, 3 days). If the user does not receive an operation to restore the data to be restored within 3 days, the mobile phone may delete the storage in the target storage space. Data to be recovered.
  • the mobile phone deletes the data to be restored in the target storage space.
  • step S408 after the mobile phone restores the data to be restored to the data partition of the ROM in the mobile phone again, the data to be restored stored in the target storage space can be deleted to prevent the data to be restored in the target storage space from occupying the system resources of the mobile phone. .
  • the target storage space is a new partition (such as the resume partition) dynamically created by the mobile phone when backing up the data to be restored, the mobile phone can also destroy the new partition to prevent the new partition from occupying the system resources of the mobile phone.
  • the resume partition is created by the mobile phone from the data partition of the ROM, after the mobile phone destroys the resume partition, the storage resources occupied by the resume partition can be merged with the current data partition, so that the data partition in the phone can be restored The state before the resume partition is created on the phone.
  • the phone stores the data to be restored in the phone's RAM, the internal data will be automatically erased after the RAM is powered off. Therefore, when the phone exits the recovery mode and restarts the phone, the data to be restored in the RAM can be automatically deleted.
  • the mobile phone can back up the data to be restored that the user needs to back up to the internal storage space of the phone before restoring the factory settings, and then restore the factory settings before Restore the data to be restored from the internal storage space.
  • the entire data backup and data recovery process does not need to rely on external resources such as the Wi-Fi network environment, cloud server, etc., making the data more stable and secure during the backup and recovery process, and the user's operation when restoring the factory settings is simpler and more convenient.
  • an embodiment of the present application discloses a terminal.
  • the terminal is configured to implement the methods described in the foregoing method embodiments, and includes a display unit 1301 and an obtaining unit 1302. , Backup unit 1303, execution unit 1304, and recovery unit 1305.
  • the display unit 1301 is used to support the terminal to execute the process S402 in FIG. 4;
  • the obtaining unit 1302 is used to support the terminal to execute the processes S401 and S403 in FIG. 4;
  • the backup unit 1303 is used to support the terminal to execute the process S405 in FIG. 4;
  • the execution unit 1304 It is used to support the terminal to execute the processes S404, S406, and S408 in FIG. 4;
  • the recovery unit 1305 is used to support the terminal to execute the process S407 in FIG.
  • all relevant content of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
  • the embodiments of the present application disclose a terminal including a processor, and a memory, an input device, and an output device connected to the processor.
  • the input device and the output device may be integrated into one device.
  • a touch-sensitive surface may be used as an input device
  • a display screen may be used as an output device
  • the touch-sensitive surface and the display screen may be integrated into a touch screen.
  • the foregoing terminal may include: a touch screen 1401 including a touch-sensitive surface 1406 and a display screen 1407; one or more processors 1402; a memory 1403; and one or more application programs (not (Shown); and one or more computer programs 1404, each of which may be connected via one or more communication buses 1405.
  • the one or more computer programs 1404 are stored in the memory 1403 and are configured to be executed by the one or more processors 1402.
  • the one or more computer programs 1404 include instructions. 4 and the respective steps in the corresponding embodiments.
  • Each functional unit in each of the embodiments of the present application may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the embodiments of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution may be embodied in the form of a software product.
  • the computer software product is stored in a storage device.
  • the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to perform all or part of the steps of the method described in the embodiments of the present application.
  • the foregoing storage medium includes: various types of media that can store program codes, such as a flash memory, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Telephone Function (AREA)

Abstract

本申请实施例公开了一种终端恢复出厂设置时的数据恢复方法及终端,涉及终端领域,可在恢复出厂设置后快速安全的在手机中恢复用户希望保留的数据,提高终端内的数据稳定性和安全性。该方法包括:响应于用户打开恢复出厂设置功能的第一输入,所述终端显示至少一项候选数据;所述终端接收用户从所述候选数据中选中待恢复数据的第二输入;所述终端将所述待恢复数据备份至目标存储空间,所述目标存储空间为恢复出厂设置时不会被格式化的存储空间;所述终端执行恢复出厂设置的操作;所述终端将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,所述初始存储路径为所述待恢复数据在恢复出厂设置之前所在的存储目录。

Description

一种终端恢复出厂设置时的数据恢复方法及终端 技术领域
本申请涉及终端领域,尤其涉及一种终端恢复出厂设置时的数据恢复方法及终端。
背景技术
手机等终端一般都设有恢复出厂设置(recovery,也可称为一键还原或重置手机)的功能。该功能具体是指将手机恢复到手机出厂售卖时的状态,恢复出厂设置后手机现有的所有设置,存储和安装的应用以及应用中的数据都将被清空,回到出厂时的原始设定状态。
一般,为了不丢失手机内的照片、音乐、应用等数据,用户可在恢复出厂设置前将这些数据先备份在电脑、手机的SD卡(secure digital card)或者云端服务器等外部存储设备中。当手机完成恢复出厂设置的操作后,用户可以再将已经备份的数据恢复至手机内。可以看出,整个恢复出厂设置的操作过程较为繁琐,且备份和恢复数据的过程均需依赖Wi-Fi网络环境或外部存储设备等外部资源,使得整个恢复出厂设置过程中数据的稳定性和安全性随之降低。
发明内容
本申请提供一种终端恢复出厂设置时的数据恢复方法及终端,可在恢复出厂设置后快速安全的在手机中恢复用户希望保留的数据,提高终端内的数据稳定性和安全性。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种终端恢复出厂设置时的数据恢复方法,包括:响应于用户打开恢复出厂设置功能的第一输入,终端显示至少一项候选数据;终端接收用户从该候选数据中选中待恢复数据的第二输入;终端将选中的待恢复数据备份至目标存储空间,该目标存储空间为恢复出厂设置时不会被格式化的存储空间;那么,在终端执行恢复出厂设置的操作之后,可将上述待恢复数据从该目标存储空间恢复至该待恢复数据的初始存储路径下,该初始存储路径为该待恢复数据在恢复出厂设置之前所在的存储目录。
这样,终端在恢复出厂设置的同时能够保留用户不希望被清除的待恢复数据。并且,上述待恢复数据的备份和恢复过程都是借助终端内的存储资源完成的,因此在整个恢复出厂设置的过程中,终端可以在不借助外部存储设备的同时,保证待恢复数据的安全性和稳定性。
在一种可能的设计方法中,上述候选数据包括联系人、短信、图片、视频、通话记录、音乐以及应用中的至少一项。
在一种可能的设计方法中,在终端将上述待恢复数据备份至目标存储空间之前,还包括:若该待恢复数据的大小小于第一剩余空间的大小,则终端确定该目标存储空间为RAM中未被占用的存储空间,第一剩余空间为终端的RAM中未被占用的存储空间;或,若该待恢复数据的大小小于第二剩余空间的大小,则终端确定该目标存储空间为ROM中未被占用的存储空间,第二剩余空间为终端的ROM中未被占用的存储空间;或,若该待恢复数据的大小大于第一剩余空间的大小,且大于第二剩余空间的大小,且小于第一剩余空间 大小和第二剩余空间大小之和,则终端确定该目标存储空间包括ROM中未被占用的空间和该RAM中未被占用的存储空间。也就是说,终端在恢复出厂设置时用于备份待恢复数据的目标存储空间是根据待恢复数据的大小动态确定的。
在一种可能的设计方法中,在终端接收用户从候选数据中选中待恢复数据的第二输入之后,还包括:终端对该待恢复数据进行标记。例如,终端可将上述待恢复数据的初始存储路径记录在预设的备份清单中。这样,终端通过读取备份清单可以获知哪些数据是被用户选中的需要备份的待恢复数据。
在一种可能的设计方法中,终端将上述待恢复数据备份至目标存储空间,包括:终端按照该备份清单中记录的初始存储路径获取该待恢复数据,并将该待恢复数据拷贝至该目标存储空间。
在一种可能的设计方法中,在终端接收用户从该候选数据中选中待恢复数据的第二输入之后,还包括:终端比较上述待恢复数据的大小与该目标存储空间中未被占用的存储空间的大小;若上述待恢复数据的大小大于该目标存储空间中未被占用的存储空间的大小,则终端提示用户取消部分待恢复数据。
在一种可能的设计方法中,在终端将上述待恢复数据备份至目标存储空间之前,还包括:终端确定该待恢复数据的大小不大于该目标存储空间中未被占用的存储空间的大小。
在一种可能的设计方法中,在终端将上述待恢复数据备份至目标存储空间之前,还包括:终端根据该待恢复数据的大小在终端的ROM内创建新分区,该新分区作为该目标存储空间;其中,终端将该待恢复数据备份至目标存储空间,包括:终端将该待恢复数据从该原始存储空间备份至该新分区。
例如,上述新分区包括该ROM中数据分区内未被占用的存储空间。那么,在终端根据上述待恢复数据的大小在终端的ROM内创建新分区之前,还包括:终端删除该数据分区内除该待恢复数据之外的数据。
在一种可能的设计方法中,终端存储有目标存储空间中的待恢复数据与该初始存储路径下的待恢复数据之间的对应关系;其中,终端将上述待恢复数据从该目标存储空间恢复至该待恢复数据的初始存储路径下,包括:终端根据该对应关系,将该待恢复数据从该目标存储空间恢复至该待恢复数据的初始存储路径下。这样,即使待恢复数据在目标存储空间存储时名称被修改,或者待恢复数据内的存储结构改变,终端仍然能够根据上述对应列表将目标存储空间中的待恢复数据恢复至其初始存储路径内。
在一种可能的设计方法中,在终端执行恢复出厂设置的操作之后,还包括:终端展示上述待恢复数据列表;终端获取用户的第三输入,第三输入用于从该待恢复数据列表中选择要恢复的数据;其中,终端将上述待恢复数据从该目标存储空间恢复至该待恢复数据的初始存储路径下,包括:终端将第三输入选择的数据恢复至第三输入选择的数据的初始存储路径下,从而提高手机在恢复出厂设置时人机交互的友好性。
第二方面,本申请提供一种终端,包括获取单元、显示单元、备份单元、执行单元以及恢复单元,其中,显示单元用于:响应于用户打开恢复出厂设置功能的第一输入,显示至少一项候选数据;获取单元用于:接收用户从该候选数据中选中待恢复数据的第二输入;备份单元用于:将该待恢复数据备份至目标存储空间,该目标存储空间为恢复出厂设置时不会被格式化的存储空间;执行单元用于:执行恢复出厂设置的操作;恢复单元用于:将 该待恢复数据从该目标存储空间恢复至该待恢复数据的初始存储路径下,该初始存储路径为该待恢复数据在恢复出厂设置之前所在的存储目录。
在一种可能的设计方法中,上述备份单元还用于:若该待恢复数据的大小小于第一剩余空间的大小,则确定该目标存储空间为该RAM中未被占用的存储空间,第一剩余空间为终端的RAM中未被占用的存储空间;或若该待恢复数据的大小小于第二剩余空间的大小,则确定该目标存储空间为该ROM中未被占用的存储空间,第二剩余空间为终端的ROM中未被占用的存储空间;或若该待恢复数据的大小大于第一剩余空间的大小,且大于第二剩余空间的大小,且小于第一剩余空间大小和第二剩余空间大小之和,则确定该目标存储空间包括该ROM中未被占用的空间和该RAM中未被占用的存储空间。
在一种可能的设计方法中,上述执行单元还用于:对该待恢复数据进行标记。例如,将该待恢复数据的初始存储路径记录在预设的备份清单中
在一种可能的设计方法中,上述备份单元具体用于:按照该备份清单中记录的初始存储路径获取该待恢复数据,并将该待恢复数据拷贝至该目标存储空间。
在一种可能的设计方法中,上述执行单元还用于:比较该待恢复数据的大小与该目标存储空间中未被占用的存储空间的大小;若该待恢复数据的大小大于该目标存储空间中未被占用的存储空间的大小,则提示用户取消部分该待恢复数据。
在一种可能的设计方法中,上述执行单元还用于:根据该待恢复数据的大小在终端的ROM内创建新分区,该新分区作为该目标存储空间;上述备份单元具体用于:将该待恢复数据从该原始存储空间备份至该新分区。
在一种可能的设计方法中,该新分区包括该ROM中数据分区内未被占用的存储空间,上述执行单元还用于:删除该数据分区内除该待恢复数据之外的数据。
在一种可能的设计方法中,终端存储有该目标存储空间中的待恢复数据与该初始存储路径下的待恢复数据之间的对应关系;上述恢复单元具体用于:根据该对应关系,将该待恢复数据从该目标存储空间恢复至该待恢复数据的初始存储路径下。
在一种可能的设计方法中,上述显示单元还用于:展示该待恢复数据列表;获取单元还用于:获取用户的第三输入,第三输入用于从该待恢复数据列表中选择要恢复的数据;上述恢复单元具体用于:将第三输入选择的数据恢复至第三输入选择的数据的初始存储路径下。
第三方面,本申请提供一种终端,包括:触摸屏、一个或多个处理器、存储器、以及一个或多个程序;其中,处理器与存储器耦合,上述一个或多个程序被存储在存储器中,当终端运行时,该处理器执行该存储器存储的一个或多个程序,以使终端执行上述任一项终端恢复出厂设置时的数据恢复方法。
第四方面,本申请提供一种计算机存储介质,包括计算机指令,当计算机指令在终端上运行时,使得终端执行上述任一项所述的终端恢复出厂设置时的数据恢复方法。
第五方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述任一项所述的终端恢复出厂设置时的数据恢复方法。
可以理解地,上述提供的第二方面和第三方面所述的终端、第四方面所述的计算机存储介质,以及第五方面所述的计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种终端的结构示意图一;
图2为本申请实施例提供的一种终端内内部存储器的结构示意图;
图3为本申请实施例提供的一种终端内操作系统的架构示意图;
图4为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的流程图;
图5为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图一;
图6为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图二;
图7为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图三;
图8为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图四;
图9为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图五;
图10为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图六;
图11为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图七;
图12为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的场景示意图八;
图13为本申请实施例提供的一种终端的结构示意图二;
图14为本申请实施例提供的一种终端的结构示意图三。
具体实施方式
下面将结合附图对本申请实施例的实施方式进行详细描述。
本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法可应用于终端。示例性的,该终端可以为手机、平板电脑、桌面型、膝上型、笔记本电脑、超级移动个人计算机(Ultra-mobile Personal Computer,UMPC)、手持计算机、上网本、个人数字助理(Personal Digital Assistant,PDA)、可穿戴电子设备、虚拟现实设备等,本申请实施例中对终端的具体形式不做特殊限制。
图1是本发明实施例的终端100的结构框图。
终端100可以包括处理器110,外部存储器接口120,内部存储器121,USB接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,射频模块150,通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及SIM卡接口195等。其中传感器模块可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器等。
其中,上述触摸传感器180K、麦克风170C、天线1、天线2、射频模块150以及通信模块160等可作为终端100的输入设备,用于接收用户或其他设备输入的信息。上述扬声器170A、受话器170B和显示屏194等可作为终端100的输出设备,用于输出由用户输入的信息或提供给用户的信息以及终端100的各种菜单。
本发明实施例示意的结构并不构成对终端100的限定。可以包括比图示更多或更少的 部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以是集成在同一个处理器中。
控制器可以是指挥终端100的各个部件按照指令协调工作的决策者。是终端100的神经中枢和指挥中心。控制器根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器中的存储器为高速缓冲存储器。可以保存处理器刚用过或循环使用的指令或数据。如果处理器需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括接口。其中接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器可以包含多组I2C总线。处理器可以通过不同的I2C总线接口分别耦合触摸传感器,充电器,闪光灯,摄像头等。例如:处理器可以通过I2C接口耦合触摸传感器,使处理器与触摸传感器通过I2C总线接口通信,实现终端100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器可以包含多组I2S总线。处理器可以通过I2S总线与音频模块耦合,实现处理器与音频模块之间的通信。在一些实施例中,音频模块可以通过I2S接口向通信模块传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块与通信模块可以通过PCM总线接口耦合。在一些实施例中,音频模块也可以通过PCM接口向通信模块传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信,两种接口的采样速率不同。
UART接口是一种通用串行数据总线,用于异步通信。该总线为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器与通信模块160。例如:处理器通过UART接口与蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块可以通过UART接口向通信模块传递音频信号,实现通过 蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器与显示屏,摄像头等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器和摄像头通过CSI接口通信,实现终端100的拍摄功能。处理器和显示屏通过DSI接口通信,实现终端100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以配置为控制信号,也可配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器与摄像头,显示屏,通信模块,音频模块,传感器等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口可以用于连接充电器为终端100充电,也可以用于终端100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。还可以用于连接其他电子设备,例如AR设备等。
本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端100的结构限定。终端100可以采用本发明实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块可以通过USB接口接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块可以通过终端100的无线充电线圈接收无线充电输入。充电管理模块为电池充电的同时,还可以通过电源管理模块141为终端设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块接收所述电池和/或充电管理模块的输入,为处理器,内部存储器,外部存储器,显示屏,摄像头,和通信模块等供电。电源管理模块还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在一些实施例中,电源管理模块141也可以设置于处理器110中。在一些实施例中,电源管理模块141和充电管理模块也可以设置于同一个器件中。
终端100的无线通信功能可以通过天线模块1,天线模块2射频模块150,通信模块160,调制解调器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将蜂窝网天线复用为无线局域网分集天线。在一些实施例中,天线可以和调谐开关结合使用。
射频模块150可以提供应用在终端100上的包括2G/3G/4G/5G等无线通信的解决方案的通信处理模块。可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(Low Noise Amplifier,LNA)等。射频模块由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调器进行解调。射频模块还可以对经调制解调器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,射频模块150的至少部分功能模块可以被设置于处理器150中。在一些实施例中,射频模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调器可以包括调制器和解调器。调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器,受话器等)输出声音信号,或通过显示屏显示图像或视频。在一些实施例中,调制解调器可以是独立的器件。在一些实施例中,调制解调器可以独立于处理器,与射频模块或其他功能模块设置在同一个器件中。
通信模块160可以提供应用在终端100上的包括无线局域网(wireless local area networks,WLAN),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案的通信处理模块。通信模块160可以是集成至少一个通信处理模块的一个或多个器件。通信模块经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器。通信模块160还可以从处理器接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端100的天线1和射频模块耦合,天线2和通信模块耦合。使得终端100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS))和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏包括显示面板。显示面板可以采用LCD(liquid crystal display,液晶显示屏),OLED(organic light-emitting diode,有机发光二极管),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端100可以包括1个或N个显示屏,N为大于1的正整数。
仍如图1所示,终端100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏以及应用处理器等实现拍摄功能。
ISP用于处理摄像头反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端100可以包括1个或N个摄像头,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端100可以支持一种或多种编解码器。这样,终端100可以播放或录制多种编码格式的视频,例如:MPEG1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端100的存储能力。外部存储卡通过外部存储器接口与处理器通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端100的各种功能应用以及数据处理。存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,其他易失性固态存储器件,通用闪存存储器(universal flash storage,UFS)等。
在本申请实施例中,内部存储器121具体可包括RAM(random access memory,随机存取存储器)和ROM(read-only memory,只读存储器)。RAM是与处理器110直接交换数据的内部存储器,也叫主存(或内存)。它可以随时读写,而且速度很快,通常作为操作系统或其他正在运行中的程序的临时数据存储媒介。ROM中存储的数据可以方便地被读出,不像RAM那样能快速地、方便地加以改写。但ROM所存数据较为稳定,断电后所存数据也不会改变;其结构较简单,读出较方便,因而常用于存储各种固定程序和数据。
RAM和ROM中可以包括一个或多个分区。
以ROM为例,如图2所示,ROM中可以包括系统分区(例如System分区、Recovery分区)、程序分区(例如Data分区)以及存储分区(例如SDCard分区)等。其中,系统分区可用于存放操作系统(例如Android系统)、还原备份系统以及交换空间、硬件底层空间等资源;程序分区用于存放终端安装的第三方APP。对于每个APP,终端可在Data分区内对应创建一个Data目录,例如,如果有一个APP的包名叫weixin.com,则在Data分 区中可创建一个名为weixin.com的目录。该APP运行产生的应用数据,例如聊天记录、传输文件等,均可存储在名为weixin.com的目录下,并且,该APP只能操作此目录中的数据,不能操作其它APP的目录;存储分区相当于手机连接PC后所识别出来的“移动硬盘”,这部分空间可以由用户自由支配,可存放大型游戏的数据包、音乐、图片以及视频等数据。
终端100还可以在RAM或ROM内动态的创建新的分区。例如,大小为4G的ROM中有2G的空间未被占用,那么终端100可以在这2G空间中创建一个名称为“aaa”的分区。当然,终端100也可以动态的销毁之前创建的新分区,新分区销毁后分区内的数据也一并被销毁。
在本申请实施例中,当终端100恢复出厂设置时,一般是对终端100ROM中的一个或多个分区进行格式化(format)。例如,终端100可对ROM中的Data分区进行格式化,将Data分区中所有的文件和文件夹删除,使得Data分区中安装的所有应用,以及每个应用中的数据都被清除,从而将终端100恢复到出厂售卖时的状态。
终端100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块还可以用于对音频信号编码和解码。在一些实施例中,音频模块可以设置于处理器110中,或将音频模块的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。终端100可以通过扬声器收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当终端100接听电话或语音信息时,可以通过将受话器靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风发声,将声音信号输入到麦克风。终端100可以设置至少一个麦克风。在一些实施例中,终端100可以设置两个麦克风,除了采集声音信号,还可以实现降噪功能。在一些实施例中,终端100还可以设置三个,四个或更多麦克风,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口可以是USB接口,也可以是3.5mm的开放移动终端平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器可以设置于显示屏。压力传感器的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器,电极之间的电容改变。终端100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏,终端100根据压力传感器检测所述触摸操作强度。终端100也可以根据压力传感器的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标 时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定终端100的运动姿态。在一些实施例中,可以通过陀螺仪传感器确定终端100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器检测终端100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端100的抖动,实现防抖。陀螺仪传感器还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,终端100通过气压传感器测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。终端100可以利用磁传感器检测翻盖皮套的开合。在一些实施例中,当终端100是翻盖机时,终端100可以根据磁传感器检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测终端100在各个方向上(一般为三轴)加速度的大小。当终端100静止时可检测出重力的大小及方向。还可以用于识别终端姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。终端100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端100可以利用距离传感器测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。通过发光二极管向外发射红外光。使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端100附近有物体。当检测到不充分的反射光时,可以确定终端100附近没有物体。终端100可以利用接近光传感器检测用户手持终端100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。终端100可以根据感知的环境光亮度自适应调节显示屏亮度。环境光传感器也可用于拍照时自动调节白平衡。环境光传感器还可以与接近光传感器配合,检测终端100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。终端100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,终端100利用温度传感器检测的温度,执行温度处理策略。例如,当温度传感器上报的温度超过阈值,终端100执行降低位于温度传感器附近的处理器的性能,以便降低功耗实施热保护。
触摸传感器180K,也称“触控面板”。可设置于显示屏。用于检测作用于其上或附近的触摸操作。可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型,并通过显示屏提供相应的视觉输出。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器可以获取人体声部振动骨块的振动信号。骨传导传感器也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器也可以设置于耳机中。音频模块170可以基于所述骨传导传感器获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键可以是机械按键。也可以是触摸式按键。终端 100接收按键输入,产生与终端100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏不同区域的触摸操作,也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接用户标识模块(subscriber identity module,SIM)。SIM卡可以通过插入SIM卡接口,或从SIM卡接口拔出,实现和终端100的接触和分离。终端100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口也可以兼容不同类型的SIM卡。SIM卡接口也可以兼容外部存储卡。终端100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,终端100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端100中,不能和终端100分离。
上述终端100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明终端100的软件结构。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,Android runtime和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图3所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
这些应用程序可以是系统级应用(例如,桌面、短信、通话、日历、联系人等),也可是普通级别应用(例如,微信、淘宝等)。系统级应用一般指的是:该应用具有系统级权限,可以获取各种系统资源。普通级别应用一般指的是:该应用具有普通权限,可能无法获取某些系统资源,或者需要用户授权,才能获取一些系统资源。系统级应用可以为手机中预装的应用。普通级别应用可以为手机中预装的应用,也可以为后续用户自行安装的应用。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图3所示,应用程序框架层可以包括活动管理器、窗口管理器,内容提供器,视图系统,资源管理器,通知管理器等,本申请实施例对此不做任何限制。
活动管理器:用于管理每个应用的生命周期。应用通常以Activity的形式运行在操作系统中。对于每一个Activity,在活动管理器中都会有一个与之对应的应用记录(ActivityRecord),这个ActivityRecord记录了该应用的Activity的状态。活动管理器可以利用这个ActivityRecord作为标识,调度应用的Activity进程。
窗口管理器:用于管理在屏幕上使用的图形用户界面(graphical user interface,GUI)资源,具体可用于:获取显示屏大小、窗口的创建和销毁、窗口的显示与隐藏、窗口的布局、焦点的管理以及输入法和壁纸管理等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端振动,指示灯闪烁等。
如图3所示,Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
如图3所示,系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),OpenGL ES,SGL等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
OpenGL ES用于实现三维图形绘图,图像渲染,合成,和图层处理等。
SGL是2D绘图的绘图引擎。
如图3所示,内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
应用程序层中的各个应用在运行时产生的应用数据可被保存至ROM中相应的目录或文件夹内。并且,应用程序层中可安装用于管理终端内应用及文件的手机管家APP。手机管家APP中一般设置有“一键还原”或者“重置手机”等用于恢复终端出厂设置的功能。
其中,终端的恢复出厂设置功能实际是android定义的一个标准刷机协议。当用户打开恢复出厂设置功能后,终端可启动并进入恢复(recovery)模式。在recovery模式下,终端可执行ROM内recovery分区中的相关程序,例如recovery程序。通过recovery程序,终端可以完成清除数据、安装刷机包等操作。
在本申请实施例中,如果终端检测到用户从手机管家APP中打开“一键还原”或者“重置手机”的功能,终端可提示用户选择希望备份的待恢复数据,例如,照片、视频、通讯 录以及应用等。用户选中的这些待恢复数据实际存储在ROM的data分区内,为防止终端恢复出厂设置时对data分区格式化而造成数据丢失,终端可将这些待恢复数据先备份到除data分区之外的存储空间(本申请中可称为目标存储空间)中。例如,可以将上述待恢复数据备份至终端的RAM内,或者,将上述待恢复数据备份至ROM的其他分区内。进而,终端可进入上述recovery模式,通过执行相应的recovery程序将data分区内的数据格式化,使得终端恢复为出厂时的状态。
当终端将data分区内的数据格式化之后,可提示用户将已经备份的待恢复数据重新恢复至data分区,使得手机在恢复出厂设置的同时能够保留用户不希望被清除的应用等数据。另外,上述待恢复数据的备份和恢复过程都是借助终端内的存储资源完成的,因此在整个恢复出厂设置的过程中,终端可以在不借助外部存储设备的同时,保证待恢复数据的安全性和稳定性。
另外,当终端将已经备份的待恢复数据重新恢复至data分区后,终端可将目标存储空间内的待恢复数据删除,避免待恢复数据占用终端后续正常使用时的存储资源。
为了便于理解,以下结合附图对本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法进行具体介绍。以下实施例中均以手机作为终端举例说明。
图4为本申请实施例提供的一种终端恢复出厂设置时的数据恢复方法的流程示意图。如图4所示,该数据恢复方法可以包括:
S401、手机接收用户打开恢复出厂设置功能的第一输入。
如果用户希望将手机恢复到出厂售卖时的状态,用户可进入手机的设置界面或打开手机管家APP,查找恢复出厂设置这一功能选项。如图5所示,设置界面501中设置有用于恢复出厂设置的选项502。当手机检测到用户打开选项502时,说明用户执行了打开恢复出厂设置功能的第一输入,此时手机可继续执行下述步骤S402-S408完成手机恢复出厂设置、以及恢复出厂设置前后的数据备份和恢复操作。
S402、响应于上述第一输入,手机显示包含至少一项候选数据的显示界面。
其中,上述各项候选数据一般均存储在手机的ROM内。例如,存储在ROM的data分区内。示例性的,用户使用视频应用1下载的视频一般存储在data分区内与视频应用1对应的文件夹中,用户使用视频应用2下载的视频一般存储在data分区内与视频应用2对应的文件夹中。而当手机恢复出厂设置时会将data分区内的所有数据格式化,造成用户数据丢失。
因此,在手机接收到上述第一输入后,如图6所示,手机可跳转至包含待备份的候选数据的显示界面601。用户可以在显示界面601中选择恢复出厂设置时用户希望保留的待恢复数据。例如,上述显示界面601中包括联系人、短信、照片、通话记录、音乐以及应用等至少一项候选数据。其中,某一应用作为候选数据时具体可以包括其应用程序本身,还可以包括用户在使用该应用过程中产生的记录数据和储存的文件,例如联系人头像、缓冲和下载好的图片等。另外,仍如图6所示,手机还可以在显示界面601中显示每一项候选数据所占用的存储空间的大小。
当然,用户在上述显示界面601中选中某一项候选数据后,手机还可以进一步跳转至该项候选数据的详情界面中。例如,用户选中显示界面601中的应用后,手机可显示当前手机内安装的所有应用(例如15个应用),这样用户可以在这些应用中选择具体将哪些应 用进行备份,以避免手机恢复出厂设置后相应的应用丢失。
另外,在手机接收到上述第一输入后,手机还可以查询ROM的data分区内是否存储有上述候选数据。如果没有存储上述候选数据,则手机恢复出厂设置后不会造成数据丢失的情况,因此,手机可按照现有的恢复出厂设置的流程对ROM中的数据进行格式化。相应的,如果存储有上述候选数据,则手机可按照步骤S402所述的方法显示包含至少一项候选数据的显示界面。
S403、手机接收用户在上述显示界面中选中待恢复数据的第二输入。
其中,用户在上述显示界面中选中的一项或多项候选数据即为手机恢复出厂设置前后需要备份和恢复的待恢复数据。
仍以图6所示的显示界面601举例,在步骤S403中,如果检测到用户点击显示界面601中的联系人、信息以及通话记录这三项候选数据,且检测到用户点击确认按钮602,则说明用户执行了上述第二输入,此时手机可将ROM中存储的联系人、信息以及通话记录确定为待备份的待恢复数据。当然,上述第二输入也可以为拖动操作、长按操作或按压操作等,本申请实施例对此不做任何限制。
S404、响应于上述第二输入,手机对上述待恢复数据进行标记。
在手机接收到上述第二输入后,手机可对用户选中的待恢复数据进行标记,以便手机后续恢复出厂设置时能够区分出哪些是用户希望保留的数据。
示例性的,手机可创建一份备份清单,并在该备份清单中记录上述待恢复数据的具体存储路径。例如,用户选中的待恢复数据中包括应用A和应用B,那么,手机可将应用A在ROM中的存储路径“data/app/taobao.com”记录在备份清单中,并将应用B在ROM中的存储路径“data/app/weixin.com”记录在备份清单中。这样,手机通过读取备份清单可以获知哪些数据是被用户选中的需要备份的待恢复数据。
又或者,手机可以对用户选中的待恢复数据添加相应的标识。例如,可以在上述待恢复数据所在的文件中添加一个头文件,或者,可以在上述待恢复数据所在的文件夹中添加一个标识文件。这样,手机通过读取上述头文件或标识文件可以获知哪些数据是被用户选中的需要备份的待恢复数据。
S405、手机将已标记的待恢复数据备份至目标存储空间。
其中,目标存储空间可以是手机内除ROM中data分区之外的任意存储空间。例如,目标存储空间可以是手机中的RAM,或者,手机也可动态地创建一个新分区作为目标存储空间。当手机执行恢复出厂设置的操作时,不会对目标存储空间内的数据进行格式化。
以安卓操作系统为例,手机的运行模式一般包括正常模式(normal mode)、安全模式(safe mode)、引导模式(bootloader mode)以及恢复模式(recovery mode)等。当手机对上述待恢复数据进行标记之后,手机可自动进入recovery模式,也可在用户手动确认对手机执行恢复出厂设置这一操作后进入recovery模式。例如,当手机对上述待恢复数据进行标记之后,如图7所示,手机可弹出对话框701提示用户确认是否执行恢复出厂设置的操作,如果用户输入确认执行恢复出厂设置的操作,则手机可自动关机,再自动开机后进入recovery模式。
当手机进入recovery模式后,手机可先查看手机内是否存储有被标记的待恢复数据。例如,手机可读取步骤S404中创建的备份清单,如果备份清单中记录有被标记的待恢复 数据,则说明在对手机恢复出厂设置之前需要先备份该待恢复数据,避免恢复出厂设置之后该待恢复数据丢失。否则,手机可直接执行恢复出厂设置的操作。
另外,手机在上述步骤S404中对待恢复数据进行标记时,手机还可计算备份上述待恢复数据所需的空间大小。以目标存储空间为手机的RAM举例,如果上述待恢复数据所需的空间大小小于或等于RAM中可用存储空间的大小,则如图8所示,手机进入recovery模式后可跳转至界面801,在界面801中提示用户正在对用户选中的待恢复数据进行备份。同时,手机可按照备份清单中记录的存储路径读取到用户选中的待恢复数据,进而将该待恢复数据拷贝至RAM中完成备份。
如果手机计算出上述待恢复数据所需的空间大小小于RAM中可用存储空间的大小,则手机可先执行内存清理操作以释放出尽量多的RAM空间。如果在执行内存清理操作后,RAM中可用存储空间大小仍无法满足待恢复数据所需的空间大小,则手机可继续停留在上述显示界面601中,此时,如图9所示,手机可在显示界面601中显示提示语901,以提示用户当前的可用的备份空间不足,需要用户取消部分选中的待恢复数据。用户可根据提示语901在显示界面601中取消在步骤S403中选中的一项或多项待备份的待恢复数据,直至RAM的可用存储空间大小能够满足用户更新后的待恢复数据所需的空间大小。进而,如图8所示,当手机进入recovery模式后,可按照备份清单中记录的存储路径读取到用户最终更新后的待恢复数据,并将该待恢复数据拷贝至RAM中完成备份。
示例性的,手机可将ROM中data分区内的待恢复数据拷贝至RAM的tmp分区。tmp分区一般用来存放手机运行时产生的临时文件,将待恢复数据拷贝至tmp分区可避免手机备份该待恢复数据时占用额外的系统资源,增加手机在recovery模式下的负载。
在本申请的另一些实施例中,当手机进入recovery模式后,如果手机通过读取备份清单确定需要对用户选中的待恢复数据进行备份,则手机可根据上述待恢复数据所需的空间大小,在ROM的空闲存储空间内创建一个新的分区,例如resume分区,此时,这个新创建的resume分区即为目标存储空间。
例如,手机的ROM大小为128G,除data分区之外未被占用的存储空间还剩余80G,而上述待恢复数据所需的空间大小为20G。那么,手机可在剩余的80G存储空间中开辟一个大小为20G的resume分区。进而,手机可按照备份清单中记录的存储路径读取到上述待恢复数据,并将该待恢复数据拷贝至新创建的resume分区中完成备份。
或者,由于data分区的存储空间一般比较大,因此,手机也可以从data分区中开辟一个新的分区作为目标存储空间。例如,ROM中data分区的大小为90G,其中有30G未被占用的存储空间。用户选中的待恢复数据的大小为15G,那么,手机可以在上述30G未被占用的存储空间中创建一个15G的resume分区,用于存储上述待恢复数据。此时,新分区被创建后data分区的大小从90G变为75G。又例如,如果用户选中的15G待恢复数据的大小大于data分区中剩余的存储空间的大小,则手机可将data分区中除上述待恢复数据之外的数据删除,从而释放data分区内的存储资源。进而,手机可在data分区中创建一个大小满足上述待恢复数据大小的resume分区用于存储上述待恢复数据。
当然,手机也可以从ROM中的data分区内获取一部分存储资源,并且从除data分区之外的其他分区(例如系统分区)获取一部分存储资源(例如5G未被占用的存储空间),进而使用这两部分存储资源创建新的resume分区。
又或者,目标存储空间可以既包括手机内的RAM,还包括上述新创建的resume分区。这样,手机可以将上述待恢复数据中的一部分备份至RAM中,并将上述待恢复数据中的另一部分备份至上述新创建的resume分区中。这样用户可以利用该目标存储空间备份尽可能多的待恢复数据。
另外,手机在上述目标存储空间内拷贝待恢复数据时,还可以先对待恢复数据进行压缩,尽可能减小待恢复数据占用的目标存储空间。或者,手机还可以先对待恢复数据进行加密,以提高手机拷贝上述待恢复数据时的安全性。
S406、手机执行恢复出厂设置的操作。
在步骤S406中,手机可沿用现有的恢复出厂设置的方法,在recovery模式下对ROM中的data分区进行格式化,格式化之后data分区内的文件和文件夹均被擦除。另外,在recovery模式下手机还可以将操作系统的各项设置恢复初始的默认设置,使得手机被恢复为出厂售卖时的状态。
S407、手机恢复出厂设置后,将上述目标存储空间内的待恢复数据重新恢复至手机内。
手机恢复出厂设置后可显示如图10所示的对话框1001,以提示用户将恢复出厂设置之前备份的待恢复数据重新恢复在恢复出厂设置之后的手机中。那么,如果用户确认恢复上述待恢复数据,则手机可从上述目标存储空间中读取待恢复数据,并将待恢复数据拷贝至ROM的data分区内。
在本申请的一些实施例中,手机将上述待恢复数据备份至目标存储空间后,可建立目标存储空间中的备份的待恢复数据与data分区中的待恢复数据之间的对应关系。这样,在步骤S407中,手机在data分区中恢复原始的待恢复数据时,可按照该对应关系将每一项备份的待恢复数据恢复至data分区中相应的位置。
例如,原存储路径(如data分区中的存储路径)A下的名称为a的待备份数据,被存储到目标存储空间中的位置B,则记录“A\a”与“B\a”的对应关系。恢复时,可根据该对应关系,将目标存储空间中的位置B的名称为a的数据,恢复到原存储路径A下,名称仍为a。
再例如,原存储路径A下的名称为a的待备份数据,被存储到目标存储空间中的位置B,并被改名为b,则记录“A\a”与“B\b”的对应关系。恢复时,可根据该对应关系,将目标存储空间中的位置B的名称为b的数据,恢复到原存储路径A下,并将名称改为a。
示例性的,手机可以将备份待恢复数据时创建的备份清单作为上述对应关系。大多数情况下,手机在目标存储空间中备份待恢复数据时不会修改待恢复数据的名称和待恢复数据内的存储结构。例如,手机在备份data分区中“app”文件夹内名称为“weibo.com”的文件夹时,还是以“weibo.com”作为该文件夹的名称将该文件夹中的内容拷贝至目标存储空间中。在恢复该文件夹时,手机可按照备份清单中记录的存储路径,将目标存储空间中存储的微博APP的文件夹“weibo.com”以及淘宝APP的文件夹“taobao.com”拷贝至ROM的data分区中名称为“app”的文件夹内。当然,如果data分区被格式化后没有名称为“app”的文件夹,则手机可先创建名称为“app”的文件夹,再将微博APP的文件夹“weibo.com”以及淘宝APP的文件夹“taobao.com”拷贝至data分区中新创建的名称为“app”的文件夹内。此时,如图11所示,被恢复的微博APP和淘宝APP将重新显示在桌面1101中。由于恢复出厂设置前后微博APP和淘宝APP的文件夹中的数据均没有发生变化,因此, 微博APP和淘宝APP中的设置等功能均未发生变化,使得用户可以在恢复出厂设置前后能够感受到无缝衔接的操作体验。
又或者,上述对应关系也可以是手机在备份待恢复数据时新创建的对应列表。例如,手机在备份data分区中“aa”文件夹中名称为002的文件时,将该文件的名称修改为001后存储在目标存储空间中。那么,手机可在上述对应列表中记录目标存储空间中名称为“001”的文件对应的是data分区中“aa”文件夹中名称为002的文件。这样,手机在后续向data分区内恢复待恢复数据时,即使待恢复数据在目标存储空间存储时名称被修改,或者待恢复数据内的存储结构改变,手机仍然能够根据上述对应列表将目标存储空间中的待恢复数据恢复至data分区内。
又或者,手机恢复出厂设置后可显示如图12所示的待恢复数据列表1201,该待恢复数据列表1201中包括用户在步骤S403中选中的一项或多项待恢复数据。用户可以从待恢复数据列表1201中选择将哪些待恢复数据重新恢复在恢复出厂设置后的手机中。也就是说,用户既可以在待恢复数据时选择具体备份哪些数据,也可以在恢复数据时选择具体恢复哪些数据,从而提高手机在恢复出厂设置时人机交互的友好性。
当然,手机恢复出厂设置后,也可以自动将目标存储空间内的待恢复数据恢复至data分区。例如,手机可以在recovery模式下将目标存储空间内的待恢复数据拷贝至data分区。又或者,如果手机在步骤S405中将上述待恢复数据备份至ROM中新创建的新分区内,则手机退出recovery模式时新分区内的待恢复数据不会被清除。那么,手机也可以退出recovery模式后重新进入正常模式(normal mode),并在正常模式下将目标存储空间内的待恢复数据拷贝至data分区,本申请实施例对此不做任何限制。
另外,手机在recovery模式下将目标存储空间内的待恢复数据重新恢复至data分区之后,可退出recovery模式并进入正常模式(normal mode)。例如,手机接收到用户确认重启手机的操作后,可自动关机,再自动开机后进入normal模式。由于手机在recovery模式下已经将目标存储空间中的待恢复数据恢复至data分区,因此,如图11所示,手机进入normal模式后被恢复的微博APP和淘宝APP将重新显示在桌面1101中。
又或者,如果手机在步骤S405中将上述待恢复数据备份至ROM中新创建的新分区内,则手机退出recovery模式时新分区内的待恢复数据不会被清除。因此,手机也可以在退出recovery模式并进入normal模式之后提示用户将恢复出厂设置之前备份的待恢复数据重新恢复在恢复出厂设置之后的手机中,本申请实施例对此不做任何限制。
当然,如果用户确认不再恢复上述待恢复数据,则手机可将上述目标存储空间中存储的待恢复数据删除,以释放手机内的存储资源,此时手机完全恢复到出厂售卖时的状态。例如,手机可以多次显示图10或图12所示的弹框提示用户恢复待恢复数据,如果用户多次(例如连续3次)拒绝恢复待恢复数据,则手机可删除目标存储空间中存储的待恢复数据。又或者,手机可以将上述目标存储空间中存储的待恢复数据保存一定时间期限(例如3天),如果3天内没有接收到用户执行恢复待恢复数据的操作,则手机可删除目标存储空间中存储的待恢复数据。
S408、手机删除目标存储空间中的待恢复数据。
在步骤S408中,当手机重新将上述待恢复数据恢复至手机中ROM的data分区后,可将存储在目标存储空间的待恢复数据删除,避免目标存储空间内的待恢复数据占用手机 的系统资源。另外,如果上述目标存储空间是手机在备份上述待恢复数据时动态创建的新分区(例如上述resume分区),则手机也可以将该新分区销毁,避免该新分区占用手机的系统资源。
示例性的,如果resume分区是手机从ROM的data分区中创建的,则手机将resume分区销毁后,可将resume分区所占用的存储资源与当前的data分区合并,使得手机内的data分区可以还原至手机创建resume分区之前的状态。
另外,如果手机将待恢复数据存储在手机的RAM中,由于RAM断电后其内部数据会被自动擦除,因此,当手机退出recovery模式重启手机时可自动删除RAM中的待恢复数据。
可以看出,在本申请实施例提供的整个恢复出厂设置的过程中,手机可以在恢复出厂设置之前将用户需要备份的待恢复数据备份在手机的内部存储空间中,并在恢复出厂设置之后再从内部存储空间中重新恢复该待恢复数据。整个数据备份和数据恢复的过程无需依赖Wi-Fi网络环境、云服务器等外部资源,使得数据在备份和恢复过程中更加稳定和安全,用户在恢复出厂设置时的操作也更为简单便捷。
在本申请的一些实施例中,本申请实施例公开了一种终端,如图13所示,该终端用于实现以上各个方法实施例中记载的方法,其包括:显示单元1301、获取单元1302、备份单元1303、执行单元1304以及恢复单元1305。其中,显示单元1301用于支持终端执行图4中的过程S402;获取单元1302支持终端执行图4中的过程S401和S403;备份单元1303用于支持终端执行图4中的过程S405;执行单元1304用于支持终端执行图4中的过程S404、S406以及S408;恢复单元1305用于支持终端执行图4中的过程S407。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
在本申请的另一些实施例中,本申请实施例公开了一种终端,包括处理器,以及与处理器相连的存储器、输入设备和输出设备。其中,输入设备和输出设备可集成为一个设备,例如,可将触敏表面作为输入设备,将显示屏作为输出设备,并将触敏表面和显示屏集成为触摸屏。此时,如图14所示,上述终端可以包括:触摸屏1401,所述触摸屏1401包括触敏表面1406和显示屏1407;一个或多个处理器1402;存储器1403;一个或多个应用程序(未示出);以及一个或多个计算机程序1404,上述各器件可以通过一个或多个通信总线1405连接。其中该一个或多个计算机程序1404被存储在上述存储器1403中并被配置为被该一个或多个处理器1402执行,该一个或多个计算机程序1404包括指令,上述指令可以用于执行如图4及相应实施例中的各个步骤。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。

Claims (26)

  1. 一种终端恢复出厂设置时的数据恢复方法,其特征在于,包括:
    响应于用户打开恢复出厂设置功能的第一输入,所述终端显示至少一项候选数据;
    所述终端接收用户从所述候选数据中选中待恢复数据的第二输入;
    所述终端将所述待恢复数据备份至目标存储空间,所述目标存储空间为恢复出厂设置时不会被格式化的存储空间;
    所述终端执行恢复出厂设置的操作;
    所述终端将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,所述初始存储路径为所述待恢复数据在恢复出厂设置之前所在的存储目录。
  2. 根据权利要求1所述的数据恢复方法,其特征在于,所述候选数据包括联系人、短信、图片、视频、通话记录、音乐以及应用中的至少一项。
  3. 根据权利要求1或2所述的数据恢复方法,其特征在于,在所述终端将所述待恢复数据备份至目标存储空间之前,还包括:
    若所述待恢复数据的大小小于第一剩余空间的大小,则所述终端确定所述目标存储空间为随机存取存储器RAM中未被占用的存储空间,所述第一剩余空间为所述RAM中未被占用的存储空间;或
    若所述待恢复数据的大小小于第二剩余空间的大小,则所述终端确定所述目标存储空间为只读存储器ROM中未被占用的存储空间,所述第二剩余空间为所述ROM中未被占用的存储空间;或
    若所述待恢复数据的大小大于所述第一剩余空间的大小,且大于所述第二剩余空间的大小,且小于所述第一剩余空间大小和所述第二剩余空间大小之和,则所述终端确定所述目标存储空间包括所述ROM中未被占用的空间和所述RAM中未被占用的存储空间。
  4. 根据权利要求1-3中任一项所述的数据恢复方法,其特征在于,在所述终端接收用户从所述候选数据中选中待恢复数据的第二输入之后,还包括:
    所述终端对所述待恢复数据进行标记。
  5. 根据权利要求4所述的数据恢复方法,其特征在于,所述终端对所述待恢复数据进行标记,包括:
    所述终端将所述待恢复数据的初始存储路径记录在预设的备份清单中。
  6. 根据权利要求5所述的数据恢复方法,其特征在于,所述终端将所述待恢复数据备份至目标存储空间,包括:
    所述终端按照所述备份清单中记录的初始存储路径获取所述待恢复数据,并将所述待恢复数据拷贝至所述目标存储空间。
  7. 根据权利要求1-6中任一项所述的数据恢复方法,其特征在于,在所述终端接收用户从所述候选数据中选中待恢复数据的第二输入之后,还包括:
    所述终端比较所述待恢复数据的大小与所述目标存储空间中未被占用的存储空间的大小;
    若所述待恢复数据的大小大于所述目标存储空间中未被占用的存储空间的大小,则所述终端提示用户取消部分所述待恢复数据。
  8. 根据权利要求7所述的数据恢复方法,其特征在于,在所述终端将所述待恢复数 据备份至目标存储空间之前,还包括:
    所述终端确定所述待恢复数据的大小不大于所述目标存储空间中未被占用的存储空间的大小。
  9. 根据权利要求1-8中任一项所述的数据恢复方法,其特征在于,在所述终端将所述待恢复数据备份至目标存储空间之前,还包括:
    所述终端根据所述待恢复数据的大小在所述终端的ROM内创建新分区,所述新分区作为所述目标存储空间;
    其中,所述终端将所述待恢复数据备份至目标存储空间,包括:
    所述终端将所述待恢复数据从所述原始存储空间备份至所述新分区。
  10. 根据权利要求9所述的数据恢复方法,其特征在于,所述新分区包括所述ROM中数据分区内未被占用的存储空间。
  11. 根据权利要求10所述的数据恢复方法,其特征在于,在所述终端根据所述待恢复数据的大小在所述终端的ROM内创建新分区之前,还包括:
    所述终端删除所述数据分区内除所述待恢复数据之外的数据。
  12. 根据权利要求1-11中任一项所述的数据恢复方法,其特征在于,所述终端存储有所述目标存储空间中的待恢复数据与所述初始存储路径下的待恢复数据之间的对应关系;
    其中,所述终端将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,包括:
    所述终端根据所述对应关系,将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下。
  13. 根据权利要求1-12中任一项所述的数据恢复方法,其特征在于,在所述终端执行恢复出厂设置的操作之后,还包括:
    所述终端展示所述待恢复数据列表;
    所述终端获取用户的第三输入,所述第三输入用于从所述待恢复数据列表中选择要恢复的数据;
    其中,所述终端将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,包括:
    所述终端将所述第三输入选择的数据恢复至所述第三输入选择的数据的初始存储路径下。
  14. 一种终端,其特征在于,包括处理器,以及与所述处理器相连的存储器、输入设备和输出设备,其中,
    所述输入设备,用于:接收用户打开恢复出厂设置功能的第一输入;
    所述输出设备,用于:根据所述第一输入显示至少一项候选数据;
    所述输入设备,还用于:接收用户从所述候选数据中选中待恢复数据的第二输入;
    所述处理器,用于:根据所述第二输入将所述待恢复数据备份至所述存储器的目标存储空间,所述目标存储空间为恢复出厂设置时不会被格式化的存储空间;执行恢复出厂设置的操作;以及将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,所述初始存储路径为所述待恢复数据在恢复出厂设置之前所在的存储目录。
  15. 根据权利要求14所述的终端,其特征在于,所述存储器包括随机存取存储器RAM 和只读存储器ROM,
    所述处理器,还用于:若所述待恢复数据的大小小于第一剩余空间的大小,则确定所述目标存储空间为所述RAM中未被占用的存储空间,所述第一剩余空间为所述RAM中未被占用的存储空间;或,若所述待恢复数据的大小小于第二剩余空间的大小,则确定所述目标存储空间为所述ROM中未被占用的存储空间,所述第二剩余空间为所述ROM中未被占用的存储空间;或,若所述待恢复数据的大小大于所述第一剩余空间的大小,且大于所述第二剩余空间的大小,且小于所述第一剩余空间大小和所述第二剩余空间大小之和,则确定所述目标存储空间包括所述ROM中未被占用的空间和所述RAM中未被占用的存储空间。
  16. 根据权利要求14或15所述的终端,其特征在于,
    所述处理器,还用于:对所述待恢复数据进行标记。
  17. 根据权利要求16所述的终端,其特征在于,
    所述处理器用于对所述待恢复数据进行标记,具体为:
    所述处理器用于:将所述待恢复数据的初始存储路径记录在预设的备份清单中。
  18. 根据权利要求17所述的终端,其特征在于,
    所述处理器用于将所述待恢复数据备份至目标存储空间,具体为:
    所述处理器用于:按照所述备份清单中记录的初始存储路径获取所述待恢复数据,并将所述待恢复数据拷贝至所述目标存储空间。
  19. 根据权利要求14-18中任一项所述的终端,其特征在于,
    所述处理器,还用于:比较所述待恢复数据的大小与所述目标存储空间中未被占用的存储空间的大小;
    所述输出设备,还用于:若所述待恢复数据的大小大于所述目标存储空间中未被占用的存储空间的大小,则提示用户取消部分所述待恢复数据。
  20. 根据权利要求14-19中任一项所述的终端,其特征在于,
    所述处理器,还用于:根据所述待恢复数据的大小在所述存储器的ROM内创建新分区,所述新分区作为所述目标存储空间;
    其中,所述处理器用于将所述待恢复数据备份至目标存储空间具体为:
    所述处理器用于将所述待恢复数据从所述原始存储空间备份至所述新分区。
  21. 根据权利要求20所述的终端,其特征在于,所述新分区包括所述ROM中数据分区内未被占用的存储空间,
    所述处理器,还用于:在所述根据所述待恢复数据的大小在所述终端的ROM内创建新分区之前,删除所述数据分区内除所述待恢复数据之外的数据。
  22. 根据权利要求14-21中任一项所述的终端,其特征在于,所述存储器中存储有所述目标存储空间中的待恢复数据与所述初始存储路径下的待恢复数据之间的对应关系;
    所述处理器用于将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,具体为:
    所述处理器用于:根据所述对应关系,将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下。
  23. 根据权利要求14-21中任一项所述的终端,其特征在于,
    所述输出设备,还用于:展示所述待恢复数据列表;
    所述输入设备,还用于:获取用户的第三输入,所述第三输入用于从所述待恢复数据列表中选择要恢复的数据;
    其中,所述处理器用于将所述待恢复数据从所述目标存储空间恢复至所述待恢复数据的初始存储路径下,具体为:
    所述处理器用于:将所述第三输入选择的数据恢复至所述第三输入选择的数据的初始存储路径下。
  24. 一种终端,其特征在于,包括:
    触摸屏,其中,所述触摸屏包括触敏表面和显示器;
    一个或多个处理器;
    一个或多个存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述一个或多个存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述终端执行时,使得所述终端执行如权利要求1-13中任一项所述的一种终端恢复出厂设置时的数据恢复方法。
  25. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在终端上运行时,使得所述终端执行如权利要求1-13中任一项所述的一种终端恢复出厂设置时的数据恢复方法。
  26. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在终端上运行时,使得所述终端执行如权利要求1-13中任一项所述的一种终端恢复出厂设置时的数据恢复方法。
PCT/CN2018/095487 2018-07-12 2018-07-12 一种终端恢复出厂设置时的数据恢复方法及终端 WO2020010584A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US17/256,858 US20210149578A1 (en) 2018-07-12 2018-07-12 Data Restoration Method Used When Terminal Is Restored to Factory Settings, and Terminal
CN201880075248.0A CN111373380A (zh) 2018-07-12 2018-07-12 一种终端恢复出厂设置时的数据恢复方法及终端
BR112020026449-0A BR112020026449A2 (pt) 2018-07-12 2018-07-12 Método de restauração de dados, terminal, meio de armazenamento legível por computador e produto de programa de computador
PCT/CN2018/095487 WO2020010584A1 (zh) 2018-07-12 2018-07-12 一种终端恢复出厂设置时的数据恢复方法及终端

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/095487 WO2020010584A1 (zh) 2018-07-12 2018-07-12 一种终端恢复出厂设置时的数据恢复方法及终端

Publications (1)

Publication Number Publication Date
WO2020010584A1 true WO2020010584A1 (zh) 2020-01-16

Family

ID=69143005

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/095487 WO2020010584A1 (zh) 2018-07-12 2018-07-12 一种终端恢复出厂设置时的数据恢复方法及终端

Country Status (4)

Country Link
US (1) US20210149578A1 (zh)
CN (1) CN111373380A (zh)
BR (1) BR112020026449A2 (zh)
WO (1) WO2020010584A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400091A (zh) * 2020-03-06 2020-07-10 Oppo(重庆)智能科技有限公司 恢复出厂设置方法、恢复出厂设置装置及移动终端
CN111475463A (zh) * 2020-04-01 2020-07-31 中国人民解放军火箭军工程大学 一种gnss观测数据的数字化关系存储方法
CN112231147A (zh) * 2020-10-22 2021-01-15 深圳市沃特沃德股份有限公司 恢复出厂的方法、装置和计算机设备
CN116775383A (zh) * 2023-08-25 2023-09-19 北京紫光青藤微系统有限公司 恢复出厂设置的方法及装置、se芯片和存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210271572A1 (en) * 2018-07-20 2021-09-02 Huawei Technologies Co., Ltd. Data Backup Method and Terminal
KR20200014094A (ko) * 2018-07-31 2020-02-10 삼성전자주식회사 팩토리 데이터 리셋 기능에 의해 제거된 어플리케이션을 복원하는 장치 및 방법
CN112596947B (zh) * 2020-12-16 2023-12-26 深圳万兴软件有限公司 工程文件恢复方法、装置、计算机设备及存储介质
KR20220156171A (ko) * 2021-05-18 2022-11-25 삼성전자주식회사 모바일 전자 장치의 부트로더 복구 방법 및 이를 수행하는 부트로더 복구 시스템
CN113434334A (zh) * 2021-06-18 2021-09-24 宇龙计算机通信科技(深圳)有限公司 恢复设置方法、装置及存储介质
CN115002537B (zh) * 2021-12-23 2023-06-16 荣耀终端有限公司 视频分享方法、电子设备、存储介质和程序产品
US20230289192A1 (en) * 2022-03-08 2023-09-14 Lenovo (United States) Inc. Reversible virtual factory reset
WO2023173324A1 (en) * 2022-03-16 2023-09-21 Nvidia Corporation Application programming interface to select storage
CN114896219B (zh) * 2022-07-15 2022-09-20 深圳市沃特沃德信息有限公司 资源数据存储的方法、装置、计算机设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902602A (zh) * 2012-09-19 2013-01-30 华为技术有限公司 数据热备份的方法、装置及存储系统
CN106095615A (zh) * 2016-06-01 2016-11-09 乐视控股(北京)有限公司 应用数据还原方法及装置
CN106502826A (zh) * 2016-10-19 2017-03-15 广东欧珀移动通信有限公司 数据备份及传输方法及移动终端

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE2547488C2 (de) * 1975-10-23 1982-04-15 Ibm Deutschland Gmbh, 7000 Stuttgart Mikroprogrammierte Datenverarbeitungsanlage
US5930824A (en) * 1997-02-04 1999-07-27 International Business Machines Corporation System and method for demand-base data recovery
US7526495B2 (en) * 2006-01-03 2009-04-28 Emc Corporation Real-time construction of a selection representation for items in tree structures
WO2008049102A2 (en) * 2006-10-19 2008-04-24 Fair Thomas T System and methods for zero-configuration data backup
US20120311279A1 (en) * 2011-06-02 2012-12-06 Toshiba America Information Systems, Inc. Data recovery and backup system and process
US9280483B1 (en) * 2013-05-22 2016-03-08 Sprint Communications Company L.P. Rebranding a portable electronic device while maintaining user data
CN107908340A (zh) * 2017-09-29 2018-04-13 捷开通讯(深圳)有限公司 恢复出厂设置的方法、移动终端及具有存储功能的装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902602A (zh) * 2012-09-19 2013-01-30 华为技术有限公司 数据热备份的方法、装置及存储系统
CN106095615A (zh) * 2016-06-01 2016-11-09 乐视控股(北京)有限公司 应用数据还原方法及装置
CN106502826A (zh) * 2016-10-19 2017-03-15 广东欧珀移动通信有限公司 数据备份及传输方法及移动终端

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400091A (zh) * 2020-03-06 2020-07-10 Oppo(重庆)智能科技有限公司 恢复出厂设置方法、恢复出厂设置装置及移动终端
CN111400091B (zh) * 2020-03-06 2024-04-26 Oppo(重庆)智能科技有限公司 恢复出厂设置方法、恢复出厂设置装置及移动终端
CN111475463A (zh) * 2020-04-01 2020-07-31 中国人民解放军火箭军工程大学 一种gnss观测数据的数字化关系存储方法
CN112231147A (zh) * 2020-10-22 2021-01-15 深圳市沃特沃德股份有限公司 恢复出厂的方法、装置和计算机设备
CN116775383A (zh) * 2023-08-25 2023-09-19 北京紫光青藤微系统有限公司 恢复出厂设置的方法及装置、se芯片和存储介质
CN116775383B (zh) * 2023-08-25 2023-12-22 北京紫光青藤微系统有限公司 恢复出厂设置的方法及装置、se芯片和存储介质

Also Published As

Publication number Publication date
CN111373380A (zh) 2020-07-03
US20210149578A1 (en) 2021-05-20
BR112020026449A2 (pt) 2021-03-23

Similar Documents

Publication Publication Date Title
WO2020010584A1 (zh) 一种终端恢复出厂设置时的数据恢复方法及终端
CN114679537B (zh) 一种拍摄方法及终端
KR102470275B1 (ko) 음성 제어 방법 및 전자 장치
WO2020259452A1 (zh) 一种移动终端的全屏显示方法及设备
WO2020000448A1 (zh) 一种柔性屏幕的显示方法及终端
WO2020224485A1 (zh) 一种截屏方法及电子设备
CN109766036B (zh) 消息处理方法及电子设备
WO2021042978A1 (zh) 一种主题切换方法以及主题切换装置
WO2021159746A1 (zh) 文件共享方法、系统及相关设备
CN111913750B (zh) 一种应用程序管理方法、装置及设备
WO2020098664A1 (zh) 一种删除安全业务的方法及电子设备
WO2020107463A1 (zh) 一种电子设备的控制方法及电子设备
CN113805797B (zh) 网络资源的处理方法、电子设备及计算机可读存储介质
CN113704205B (zh) 日志存储的方法、芯片、电子设备和可读存储介质
WO2021218429A1 (zh) 应用窗口的管理方法、终端设备及计算机可读存储介质
CN113452945A (zh) 分享应用界面的方法、装置、电子设备及可读存储介质
WO2021073337A1 (zh) 安装插件的方法、装置和存储介质
CN113536374A (zh) 图像隐私的保护方法及电子设备
WO2020192716A1 (zh) 一种系统语言的切换方法及相关装置
CN110609650B (zh) 一种应用状态切换方法及终端设备
CN116795476B (zh) 一种删除壁纸的方法及电子设备
CN114244951B (zh) 应用程序打开页面的方法及其介质和电子设备
CN115952564B (zh) 数据写入方法和终端设备
CN115941836B (zh) 一种界面显示方法、电子设备及存储介质
CN117009023B (zh) 显示通知信息的方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18926202

Country of ref document: EP

Kind code of ref document: A1

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112020026449

Country of ref document: BR

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 112020026449

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20201222

122 Ep: pct application non-entry in european phase

Ref document number: 18926202

Country of ref document: EP

Kind code of ref document: A1