WO2020024748A1 - 备份数据的方法和终端设备 - Google Patents

备份数据的方法和终端设备 Download PDF

Info

Publication number
WO2020024748A1
WO2020024748A1 PCT/CN2019/093963 CN2019093963W WO2020024748A1 WO 2020024748 A1 WO2020024748 A1 WO 2020024748A1 CN 2019093963 W CN2019093963 W CN 2019093963W WO 2020024748 A1 WO2020024748 A1 WO 2020024748A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
period
terminal device
backup
time
Prior art date
Application number
PCT/CN2019/093963
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 华为技术有限公司
Publication of WO2020024748A1 publication Critical patent/WO2020024748A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Definitions

  • the present application relates to the field of communications, and more particularly, to a method and terminal device for backing up data.
  • a common method is that the data on the user's mobile phone can be periodically backed up to the cloud server periodically. When the user loses the phone or changes the phone, the backup data in the cloud server can be restored to the new phone.
  • the present application provides a method for backing up data and a terminal device, which can improve the success rate of backup in a cycle.
  • a method for backing up data including: determining first data at a first time, wherein the first time is within a backup cycle, and the first time is at a standby time of the backup cycle. Before the settlement time of the backup data; in a first period, sending the first data to the server, the first period is within the backup period, and the first period is after the first moment, the backup Before the settlement time of the periodic data to be backed up.
  • a pre-upload of the data to be backed up is performed in the first period before the settlement time of the backup period (the time at which the data to be backed up is determined in a preset backup period) is reached, which can be By reducing the amount of data to be backed up when the preset data backup time arrives, the time of each data backup can be shortened, the probability of anomalies during data backup can be reduced, and the backup success rate can be improved.
  • multiple above-mentioned first times and first periods may be included, that is, before the settlement time of the data to be backed up in the backup cycle, there may be multiple times and multiple periods.
  • the data to be backed up is determined at each of a plurality of times, and the data to be backed up is sent to the server in a corresponding period of each time.
  • the amount of data to be backed up when the preset data backup time arrives can be further reduced, thereby reducing the time of each data backup and improving
  • the backup success rate can also increase the flexibility of the terminal device when backing up data.
  • the second data is determined, and the second data is different from the first data; in a second period, all the data is sent to the server.
  • the second period is within the backup period, and the second period is a backup period after the settlement time of the data to be backed up in the backup period.
  • the second data is determined at the settlement time of the data to be backed up in the backup cycle, and the second data is sent to the server in the second period after the settlement time, and the backup period All the data to be backed up is sent to the server, so that the integrity of the data to be backed up sent to the server can be guaranteed, and the optionality of backup is improved.
  • the method before determining the first data, further includes: determining that the status of the terminal device meets at least one of the following conditions: the network connection status of the terminal device is a wireless fidelity WiFi connection status, The charging status of the terminal device is a connected charger status, the screen status of the terminal device is a lock screen status, and the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value.
  • the terminal device performs data backup only when the foregoing preset conditions are met.
  • Backup can reduce the probability of terminal equipment interruption due to network interruption or power outage during data backup, thereby improving backup reliability.
  • Backing up data when the screen state of the terminal device is the lock screen state can avoid affecting the user's use of the terminal device and improve the user experience.
  • the determining the first data includes: determining the third data, where the third data is data that needs to be sent in the third period, and the sending is not completed before the end time of the third period.
  • the third period of time is a period preceding the first period for sending data to be backed up; the third data is determined as the first data.
  • the third data is data that has not been sent at the end time of the third period, the third data is determined as the first data, and the end time of the third period is continuously sent to the server
  • the unsent data can avoid the omission of the data to be backed up and improve the success rate of the backup. At the same time, it does not need to send data from the beginning, which saves the sending time and improves the user experience.
  • the determining the third data includes: determining the first data according to a first interrupt identifier, where the first interrupt identifier is used to indicate that the third data needs to be sent in a third period.
  • the last data that is sent before the end of the third period, and the first data includes data in the third data that is located after the data indicated by the first interruption identifier, the third period It is a period before the first period for sending data to be backed up.
  • the data backup is interrupted.
  • the terminal device records a first interruption identifier, which is used to instruct the terminal device to The location of the interruption during the third period of data backup.
  • the first data can be determined according to the first interruption identifier, so that execution can be continued where the last interruption occurred, reducing the time for each data backup and increasing the success rate of the backup.
  • the method further includes: when the first data is not completely sent in the first period, configuring a second interruption identifier, where the second interruption identifier is used to indicate all The last data in the first data that is transmitted before the end of the first period of time.
  • the determining the first data includes: determining fourth data, where the fourth data is data stored by the terminal device in the first time period relative to the terminal device in the third time period Incremental data of the stored data, the third period is a period before the first period for sending data to be backed up; the fourth data is determined as the first data.
  • the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier with respect to data corresponding to the update version indicated by the first update identifier,
  • the fourth data is determined as the first data, which can reduce the amount of data uploaded by the terminal device during backup, reduce the time required for backup, thereby increasing the backup speed, and correspondingly, reduce the space occupied by the user's backup data on the server side.
  • the determining the fourth data includes: determining the fourth data according to a first update identifier, where the first update identifier is used to indicate data stored by the terminal device in a third period of time.
  • the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier. And indicating an updated version of the data stored by the terminal device in the first period.
  • an increment of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier The data is determined as the first data, where the updated version is used to indicate a "version number" of the data stored by the terminal device.
  • the increment is determined according to the updated version of the data stored by the terminal device in the two periods, which can improve the reliability of the determined incremental data, thereby improving the reliability of the backup.
  • the fourth data is incremental data
  • the amount of data uploaded by the terminal device can be reduced during backup, and the time required for backup can be reduced, thereby increasing the backup speed. Accordingly, the user's backup data can also be reduced on the server side. Space.
  • a correspondence between a second update identifier and the first period is recorded, and the second update identifier is used to indicate an updated version of data stored by the terminal device in the first period.
  • a duration of the first period is less than or equal to a preset first threshold.
  • a terminal device including: a processor, configured to determine first data at a first moment, wherein the first moment is within a backup period, and the first moment is within the backup Before the settlement time of the data to be backed up in the cycle; the transmitter is configured to send the first data to the server in the first time period, the first time period is within the backup period, and the first time period is located in the After the first time, before the settlement time of the data to be backed up in the backup cycle.
  • a pre-upload of the data to be backed up is performed in the first period before the settlement time of the backup cycle (the time to determine the data to be backed up in the preset backup cycle) is reached, which can reduce the pre-upload.
  • a plurality of the foregoing first times and first time periods may be included, that is, before the settlement time of the backup cycle, there may be multiple time points and multiple time periods.
  • the data to be backed up is determined at each of a plurality of times, and the data to be backed up is sent to the server in a corresponding period of each time.
  • the backup success rate can also increase the flexibility of the terminal device for data backup.
  • the processor is further configured to determine the second data at the settlement time of the data to be backed up in the backup cycle, where the second data is different from the first data; the The sender is further configured to send the second data to the server in a second period, where the second period is after the settlement time of the data to be backed up in the backup cycle.
  • the second data is determined at the settlement time of the data to be backed up in the backup cycle, and the second data is sent to the server in the second period after the settlement time.
  • the data to be backed up are all sent to the server, so that the integrity of the data to be backed up sent to the server can be guaranteed, and the optionality of the backup can be improved.
  • the processor before determining the first data, is further configured to determine that the status of the terminal device meets at least one of the following conditions: the network connection status of the terminal device is a wireless fidelity WiFi connection status, The charging status of the terminal device is a connected charger status, the screen status of the terminal device is a lock screen status, and the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value.
  • the terminal device performs data backup only when the preset conditions are met.
  • the network connection status of the terminal device is a WiFi connection status
  • the charging status of the terminal device is a connected charger status, and / or the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value
  • data is performed
  • the backup can reduce the probability of the terminal equipment being interrupted due to network interruption or power outage during data backup, thereby improving the reliability of the backup.
  • Backing up data when the screen state of the terminal device is the lock screen state can avoid affecting the user's use of the terminal device and improve the user experience.
  • the processor is specifically configured to determine third data, where the third data is data that is not sent before the end of the third period among the data that needs to be sent in the third period Data, the third period is a period preceding the first period for sending data to be backed up; determining the third data as the first data.
  • the third data is data that has not been completely sent at the end time of the third period, determines the third data as the first data, and continues to send to the server the end time of the third period is not completed
  • the sent data can avoid the omission of the data to be backed up and improve the success rate of the backup. At the same time, it does not need to send data from the beginning, which saves the sending time and improves the user experience.
  • the processor is specifically configured to determine the third data according to a first interrupt identifier, and the first interrupt identifier is used to indicate that data that needs to be sent in a third period is included in the data.
  • the last data that is transmitted before the end of the third period, and the third data includes data that is located after the data indicated by the first interruption flag among the data that needs to be transmitted in the third period.
  • the terminal device when an abnormality occurs when the terminal device sends data to be backed up to the server in the third period, the data backup is interrupted. At this time, the terminal device records a first interruption identifier for indicating the terminal device. The location where the data was interrupted during the third period. In this way, after the data backup is interrupted, the first data can be determined according to the first interruption identifier, so that execution can be continued where the last interruption occurred, reducing the time for each data backup and increasing the success rate of the backup.
  • the processor when the first data is not completely sent in the first period, the processor is further configured to configure a second interrupt identifier, and the second interrupt identifier is used to indicate The last data in the first data that is transmitted before the end of the first period of time.
  • the processor is specifically configured to determine fourth data, where the fourth data is data stored by the terminal device in the first period of time relative to data stored in the third period of time.
  • the incremental data of the data stored by the terminal device, the third period is a period before the first period for sending data to be backed up, and the fourth data is determined as the first data.
  • the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier, and the fourth data
  • the determination as the first data can reduce the amount of data uploaded by the terminal device during backup, reduce the time required for backup, thereby increasing the backup speed, and correspondingly, reduce the space occupied by the user's backup data on the server side.
  • the processor is specifically configured to determine the fourth data according to a first update identifier, and the first update identifier is used to indicate that the terminal device stores the fourth data in the third period.
  • An updated version of the data the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier, and the second update identifier It is used to indicate an updated version of data stored by the terminal device in the first period.
  • the incremental data of the data corresponding to the update version indicated by the second update identifier with respect to the data corresponding to the update version indicated by the first update identifier is determined. Is the first data, where the updated version is used to indicate the "version number" of the data stored by the terminal device.
  • the increment is determined according to the updated version of the data stored by the terminal device in two periods, which can improve the reliability of the determined incremental data, thereby improving the reliability of the backup.
  • the processor is further configured to record a correspondence between a second update identifier and the first period, and the second update identifier is used to indicate that the terminal device An updated version of the stored data.
  • a duration of the first period is less than or equal to a preset first threshold.
  • a terminal device includes: a determining module, configured to determine first data at a first time, where the first time is within a backup period, and the first time is at Before the settlement time of the data to be backed up in the backup cycle; a sending module, configured to send the first data to the server in a first time period, the first time period is within the backup period, and the first time period It is located after the first time and before the settlement time of the data to be backed up in the backup cycle.
  • a pre-upload of the data to be backed up is performed in the first period before the settlement time of the backup cycle (the time to determine the data to be backed up in the preset backup cycle) is reached, which can reduce the pre-upload.
  • multiple first times and first periods may be included, that is, before the settlement time of the data to be backed up in the backup cycle, multiple times and multiple times may exist.
  • Time period, the data to be backed up is determined at each of the plurality of times, and the data to be backed up is sent to the server at the corresponding time period of each time.
  • the backup success rate can also increase the flexibility of the terminal device for data backup.
  • the determining module is further configured to determine the second data at the settlement time of the data to be backed up in the backup cycle, where the second data is different from the first data; the The sending module is further configured to send the second data to the server in a second period, the second period being after the settlement time of the data to be backed up in the backup cycle.
  • the second data is determined at the settlement time of the data to be backed up in the backup cycle, and the second data is sent to the server in the second period after the settlement time.
  • the data to be backed up are all sent to the server, so that the integrity of the data to be backed up sent to the server can be guaranteed, and the optionality of the backup can be improved.
  • the determining module before determining the first data, further determines that the status of the terminal device meets at least one of the following conditions: the network connection status of the terminal device is a wireless fidelity WiFi connection status, the The charging status of the terminal device is a connected charger status, the screen status of the terminal device is a lock screen status, and the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value.
  • the terminal device performs data backup only when the preset conditions are met.
  • the network connection status of the terminal device is a WiFi connection status
  • the charging status of the terminal device is a connected charger status, and / or the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value
  • data is performed
  • the backup can reduce the probability of the terminal equipment being interrupted due to network interruption or power outage during data backup, thereby improving the reliability of the backup.
  • Backing up data when the screen state of the terminal device is the lock screen state can avoid affecting the user's use of the terminal device and improve the user experience.
  • the determining module is specifically configured to determine third data, where the third data is data that is not sent before the end of the third period among data that needs to be sent in the third period Data, the third period is a period preceding the first period for sending data to be backed up; determining the third data as the first data.
  • the third data is data that has not been completely sent at the end time of the third period, determines the third data as the first data, and continues to send to the server the end time of the third period is not completed
  • the sent data can avoid the omission of the data to be backed up and improve the success rate of the backup. At the same time, it does not need to send data from the beginning, which saves the sending time and improves the user experience.
  • the determining module is specifically configured to determine the third data according to a first interrupt identifier, and the first interrupt identifier is used to indicate that data that needs to be sent in a third period is included in the data.
  • the last data that is transmitted before the end of the third period, and the third data includes data that is located after the data indicated by the first interruption flag among the data that needs to be transmitted in the third period.
  • the terminal device when an abnormality occurs when the terminal device sends data to be backed up to the server in the third period, the data backup is interrupted. At this time, the terminal device records a first interruption identifier for indicating the terminal device. The location where the data was interrupted during the third period. In this way, after the data backup is interrupted, the first data can be determined according to the first interruption identifier, so that execution can be continued where the last interruption occurred, reducing the time for each data backup and increasing the success rate of the backup.
  • the determining module is further configured to configure a second interruption identifier, where the second interruption identifier is used to indicate The last data in the first data that is transmitted before the end of the first period of time.
  • the determining module is specifically configured to determine fourth data, where the fourth data is data stored by the terminal device in the first period of time relative to data stored in the third period of time.
  • the incremental data of the data stored by the terminal device, the third period is a period before the first period for sending data to be backed up, and the fourth data is determined as the first data.
  • the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier, and the fourth data
  • the determination as the first data can reduce the amount of data uploaded by the terminal device during backup, reduce the time required for backup, thereby increasing the backup speed, and correspondingly, reduce the space occupied by the user's backup data on the server side.
  • the determining module is specifically configured to determine the fourth data according to a first update identifier, and the first update identifier is used to indicate that the terminal device stores the An updated version of the data, the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier, and the second update identifier It is used to indicate an updated version of data stored by the terminal device in the first period.
  • the incremental data of the data corresponding to the update version indicated by the second update identifier with respect to the data corresponding to the update version indicated by the first update identifier is determined. Is the first data, where the updated version is used to indicate the "version number" of the data stored by the terminal device.
  • the increment is determined according to the updated version of the data stored by the terminal device in two periods, which can improve the reliability of the determined incremental data, thereby improving the reliability of the backup.
  • the determining module is further configured to record a correspondence between a second update identifier and the first time period, and the second update identifier is used to indicate that the terminal device is in the first time period. An updated version of the stored data.
  • a duration of the first period is less than or equal to a preset first threshold.
  • a chip system including a processor, configured to call and run a computer program from a memory, so that a device installed with the chip system executes any of the first aspect or the first aspect.
  • the chip system further includes the memory.
  • a computer-readable medium includes instructions that, when running on a terminal device, cause the terminal device to execute the foregoing first aspect or the method in any possible implementation manner of the first aspect .
  • a computer program product includes instructions that, when run on a terminal device, cause the terminal device to execute the method in the first aspect or any possible implementation manner of the first aspect.
  • FIG. 1 is a schematic diagram of an example of a terminal device to which a method for backing up data according to an embodiment of the present application is applied.
  • FIG. 2 is a schematic diagram of a backup system applied in an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a data backup method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of determining incremental data according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of determining incremental data according to another embodiment of the present application.
  • FIG. 6 is a schematic flowchart of another method for backing up data according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a terminal device 700 for backing up data according to an embodiment of the present application.
  • Terminal equipment can also be called user equipment, which can be mobile phones, bracelets, phone watches, tablets, laptops, desktop computers, Ultra-Mobile Personal Computer (UMPC), Personal Digital Assistant (Personal Digital Assistant, PDA) devices, point of sale (POS), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, etc., this embodiment of the present application does not address this. limited.
  • user equipment can be mobile phones, bracelets, phone watches, tablets, laptops, desktop computers, Ultra-Mobile Personal Computer (UMPC), Personal Digital Assistant (Personal Digital Assistant, PDA) devices, point of sale (POS), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, etc.
  • the server can also be called cloud or cloud. It can be a tablet, laptop, desktop computer, Ultra-Mobile Personal Computer (UMPC), Personal Digital Assistant (PDA) device, and has wireless communication capabilities. Handheld device, computing device, or other processing device connected to the wireless modem, which is not limited in the embodiments of the present application.
  • UMPC Ultra-Mobile Personal Computer
  • PDA Personal Digital Assistant
  • the terminal device may also be a terminal device in an Internet of Things (IoT) system.
  • IoT Internet of Things
  • the IoT is an important part of the development of future information technology. Its main technical feature is to pass items through communication technology. It is connected to the network to realize the intelligent network of human-machine interconnection and physical interconnection.
  • FIG. 1 uses a mobile phone as an example to illustrate an example of the terminal device.
  • the terminal device 100 may include the following components.
  • the RF circuit 110 may be used to receive and send signals during the transmission and reception of information or during a call.
  • the downlink information of the base station is received and processed by the processor 180; in addition, the uplink data of the design is transmitted to the base station.
  • the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • the RF circuit 110 can also communicate with a network and other devices through wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to Wireless Local Area Networks (WLAN) Global System of Mobile Communication (GSM) system, Code Division Multiple Access (CDMA) system, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, LTE frequency division duplex (Frequency Frequency Division Duplex (FDD)) system, LTE Time Division Duplex (TDD), Universal Mobile Telecommunications System (UMTS), Global Interoperability for Microwave Access (WiMAX) communication system 5.
  • WLAN Global System of Mobile Communication
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • GPRS General Packet Radio Service
  • LTE Long Term Evolution
  • FDD Frequency Frequency Division Duplex
  • TDD Time Division Duplex
  • UMTS Universal Mobile Telecommunications System
  • WiMAX Global Interoperability for Microwave Access
  • the memory 120 may be configured to store software programs and modules, and the processor 180 executes various functional applications and data processing of the terminal device 100 by running the software programs and modules stored in the memory 120.
  • the memory 120 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.), etc .; the storage data area may store Data (such as audio data, phone book, etc.) created based on the use of the terminal device 100.
  • the memory 120 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the other input devices 130 may be used to receive inputted numeric or character information, and generate key signal inputs related to user settings and function control of the terminal device 100.
  • the other input devices 130 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, an joystick, and a light mouse (a light mouse is a touch-sensitive device that does not display visual output Or one or more of a touch sensitive surface formed by a touch screen).
  • the other input devices 130 are connected to other input device controllers 171 of the I / O subsystem 170, and perform signal interaction with the processor 180 under the control of the other device input controllers 171.
  • the display screen 140 may be used to display information input by the user or information provided to the user and various menus of the terminal device 100, and may also accept user input.
  • the specific display screen 140 may include a display panel 141 and a touch panel 142.
  • the display panel 141 may be configured with a liquid crystal display (Liquid Crystal Display, LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), or the like.
  • Touch panel 142 also known as touch screen, touch-sensitive screen, etc., can collect user's contact or non-contact operations on or near it (for example, the user uses a finger, a stylus or any suitable object or accessory on touch panel 142 Or the operation near the touch panel 142 may also include a somatosensory operation; the operation includes a single-point control operation, a multi-point control operation and the like), and the corresponding connection device is driven according to a preset program.
  • the touch panel 142 may include a touch detection device and a touch controller.
  • the touch detection device detects a user's touch orientation and posture, and detects signals brought by the touch operation, and transmits the signals to the touch controller; the touch controller receives touch information from the touch detection device and converts it into a processor capable of The processed information is then sent to the processor 180, which can receive commands from the processor 180 and execute them.
  • the touch panel 142 may be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave, and the touch panel 142 may also be implemented using any technology developed in the future.
  • the touch panel 142 may cover the display panel 141, and the user may display the display panel 141 (the display content includes, but is not limited to, a soft keyboard, a virtual mouse, virtual keys, icons, etc.) on the display panel 141 An operation is performed on or near the covered touch panel 142. After the touch panel 142 detects an operation on or near the touch panel 142, the touch panel 142 transmits the operation to the processor 180 through the I / O subsystem 170 to determine a user input. The inputs provide corresponding visual outputs on the display panel 141 through the I / O subsystem 170.
  • the touch panel 142 and the display panel 141 are implemented as two independent components to implement the input and input functions of the terminal device 100, in some embodiments, the touch panel 142 and the display panel 141 may be used. Integrated to implement the input and output functions of the terminal device 100.
  • the sensor 150 may be one or more types.
  • the sensor 150 may include a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor.
  • the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light.
  • the proximity sensor may close the display panel 141 when the terminal device 100 is moved to the ear. And / or backlight.
  • an acceleration sensor can detect the magnitude of acceleration in various directions (usually three axes), and can detect the magnitude and direction of gravity when it is stationary. Games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc.
  • the terminal device 100 may be configured with other sensors such as a gravity sensor (also referred to as a gravity sensor), a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, and details are not described herein again.
  • a gravity sensor also referred to as a gravity sensor
  • a gyroscope also referred to as a barometer
  • a hygrometer a thermometer
  • an infrared sensor and the like, and details are not described herein again.
  • the audio circuit 160 may transmit the received converted signal of the audio data to the speaker 161, and the speaker 161 converts it into a sound signal for output.
  • the microphone 162 converts the collected sound signal into a signal, which is received by the audio circuit 160. It is converted into audio data, and then the audio data is output to the RF circuit 108 for transmission to, for example, another terminal device, or the audio data is output to the memory 120 for further processing.
  • the I / O subsystem 170 is used to control input and output of external devices, and may include other device input controllers 171, sensor controllers 172, and display controllers 173.
  • one or more other input control device controllers 171 receive signals from and / or send signals to other input devices 130.
  • the other input devices 130 may include physical buttons (press buttons, rocker buttons, etc.) , Dial, slide switch, joystick, click wheel, light mouse (light mouse is a touch-sensitive surface that does not display visual output, or an extension of a touch-sensitive surface formed by a touch screen). It is worth noting that the other input control device controller 171 may be connected to any one or more of the above devices.
  • the display controller 173 in the I / O subsystem 170 receives signals from the display screen 140 and / or sends signals to the display screen 140. After the display screen 140 detects a user input, the display controller 173 converts the detected user input into interaction with a user interface object displayed on the display screen 140, that is, realizes human-computer interaction.
  • the sensor controller 172 may receive signals from and / or send signals to one or more sensors 150.
  • the processor 180 is a control center of the terminal device 100, and uses various interfaces and lines to connect various parts of the entire terminal device.
  • the processor 180 runs or executes software programs and / or modules stored in the memory 120, and calls the stored programs in the memory 120.
  • the data performs various functions of the terminal device 100 and processes data, thereby performing overall monitoring of the terminal device.
  • the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, etc.
  • the modem processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 180.
  • the terminal device 100 further includes a power source 190 (such as a battery) for supplying power to various components.
  • a power source 190 such as a battery
  • the power source can be logically connected to the processor 180 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system.
  • the terminal device 100 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the structure of the terminal device shown in FIG. 1 does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine some components, or disassemble some components. , Or different component arrangements.
  • the technical solution of the embodiment of the present application can be applied to various storage systems composed of the terminal device 210 and the server 220, such as a cloud storage system, a traditional storage system, and other systems capable of providing a storage function.
  • the terminal device 210 may include: an application program, a file system, and physical storage. Those skilled in the art can understand that the terminal device shown in FIG. 2 does not constitute a limitation on the terminal device.
  • the server 220 may implement backup services, backup metadata storage, and file storage. Those skilled in the art can understand that the server shown in FIG. 2 does not constitute a limitation on the server.
  • the terminal device 210 may back up the stored data at a preset time in the backup cycle, that is, the terminal device 210 periodically determines the data to be backed up and sends the data to be backed up to the server 220 to implement data backup of the terminal device.
  • the data here may include data used or generated by contacts, memos, calendars, and applications installed by other users on the terminal device, or other files or data stored on the terminal device, which is not limited in the embodiment of the present application.
  • the backup period of the terminal device may be set in advance.
  • the backup period of the terminal device can be set to seven days in advance.
  • the backup cycle here is seven days. It should be understood that the backup cycle is at least seven days. For example, when the backup data is completed seven days apart from the preset backup completion time in the previous backup cycle, the terminal device cannot perform data because it does not meet the backup conditions or for other reasons. When backing up, the backup period at this time is greater than seven days.
  • the data to be backed up determined by the terminal device may be all the data currently stored by the terminal device.
  • the server may also store all the data currently stored by the terminal device. data.
  • the data to be backed up may also be incremental data of all data currently stored by the terminal device relative to data stored when the last backup is completed.
  • the server can also store the incremental data, which can reduce the amount of data uploaded by the user and reduce the time required for backup, thereby increasing the backup speed. Reduce the space occupied by users' backup data on the server side.
  • the time determined during the backup period to determine the data to be backed up is referred to as the settlement time of the backup period, that is, when the terminal device performs data backup at the preset backup time, the time to determine the data to be backed up.
  • the terminal device stores more data or the terminal device changes more data during the backup cycle, there may be more data to be backed up at the settlement time of the backup cycle. At this time, it takes a long time to Sending all the backup data to the server will cause the data backup time to be too long.
  • the data to be backed up may be determined before the settlement time of the backup cycle, and the determined data to be backed up may be pre-uploaded and sent to the server, thereby reducing the data to be backed up that the terminal device needs to send to the server at the settlement time.
  • a pre-upload of data to be backed up is performed in the first period before the settlement time of the backup cycle arrives, which can reduce the amount of data to be backed up when the preset data backup time arrives, thereby reducing each The time of secondary data backup reduces the probability of abnormality during data backup and improves the success rate of backup.
  • FIG. 3 A schematic flowchart of a method for backing up data according to an embodiment of the present application is shown in FIG. 3. This method may be performed by the terminal device 100 shown in FIG. 1.
  • FIG. 3 shows the steps or operations of the backup method, but these steps or operations are merely examples, and the embodiments of the present application may also perform other operations or a modification of each operation in FIG. 3.
  • each step in FIG. 3 may be performed in a different order than that presented in FIG. 3, and it may not be necessary to perform all operations in FIG. 3.
  • S310, S311, S312, S340, S341, and S342 in FIG. 3 are optional steps.
  • S310 Determine that the status of the terminal device meets a preset condition.
  • the terminal device may perform data backup only when a preset condition is satisfied. That is, before performing data backup, it can be determined that the status of the terminal device meets a preset condition.
  • determining that the status of the terminal device meets a preset condition may mean that the status of the terminal device meets at least one of the following conditions: the network connection status of the terminal device is a wireless fidelity (WiFi) connection status, the The charging status of the terminal device is a connected charger status, the screen status of the terminal device is a lock screen status, and the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value.
  • the screen state of the terminal device here is the lock screen state, which can be understood as that the terminal device is in an unused state, that is, the user has not performed any operation on the terminal device in a specific period of time.
  • the state of the terminal device meeting a preset condition may also mean that the user actively backs up the terminal device. At this time, the terminal device performs data backup regardless of whether the state of the terminal device meets the preset condition.
  • the user may actively back up the terminal device before the settlement time.
  • the terminal device directly determines the first data and sends the first data to the server in the corresponding first time period.
  • the user can also set the data backup time in advance, so that the terminal device determines the first data as soon as the preset data backup time is reached.
  • the first data will be directly determined and the corresponding Send the first data to the server in the first period.
  • the user can set the way in which the terminal device detects its status.
  • the terminal device can detect its status in real time during the backup cycle. If the preset backup conditions are met, the data backup starts; the terminal device can also Check its status at specific times during the backup cycle, such as at 10 PM every night. This application does not limit this.
  • each time the terminal device meets a preset condition it can check the status of the last backup transaction.
  • the last backup transaction can be executed, that is, S311 in FIG. 3 is executed, and according to the first interruption identifier, Determine the unprocessed data or unfinished steps in the last backup transaction, determine the data that currently needs to be processed or backed up, and then continue with the outstanding portion of the last backup transaction.
  • the first interruption identifier here can be understood as the location of the interruption during data backup in the last backup transaction recorded in the transaction list.
  • the expiration of the backup transaction may mean that since the start of the backup transaction, the total time spent has exceeded a preset duration threshold.
  • the terminal device may record the currently ongoing steps and completed steps in real time during the backup process, and store the record in the terminal device in real time.
  • the record may be used as the first interruption identifier, which is used to indicate the location where the terminal device interrupted during the third period of data backup.
  • the terminal device may record that the data is currently in a data preparation stage and record the determined data to be backed up in real time.
  • data in which data to be backed up has not been determined may also be recorded in real time.
  • the data preparation stage here means that the terminal device is determining data to be backed up.
  • the terminal device when the terminal device determines that certain data is data to be backed up, it records the data in real time as data to be backed up.
  • the data (file) directory may be used as the unit, that is, the terminal device may record the data to be backed up in the directory in real time after determining the data to be backed up in the directory; it may also be a folder, that is, After the terminal device determines the data to be backed up in a folder, it records the data to be backed up in the folder in real time; it can also use an application (APP) as a unit, that is, the terminal device can determine the data to be backed up in an application After that, the data to be backed up in the application is recorded in real time.
  • the data in each application here may refer to the data generated when the application is installed on the terminal device, or it may refer to the application after it is installed on the terminal device. Data generated during use.
  • the terminal device when the terminal device sends data to be backed up to the server, it may record that it is currently in the data sending stage, and record the data to be backed up that has been sent to the server in real time.
  • the data to be backed up that has not been sent to the server may also be recorded in real time.
  • the terminal device when the terminal device sends the data to be backed up to the server, the terminal device may record the data to be backed up that has been sent to the server in real time, or may record the data to be backed up that has not been sent to the server;
  • the data to be backed up may be all data currently stored by the terminal device, or may be all incremental data of all data currently stored by the terminal device relative to data stored when the last backup is completed
  • the data backup will be interrupted. For example, a network interruption or insufficient power during the data backup process will cause the data backup to be interrupted.
  • the terminal device can record the currently ongoing steps and completed steps in real time during the backup process, and store the record in the terminal device in real time. If an exception occurs during data backup, the record can be used to indicate the location where the data backup was interrupted, that is, it can indicate whether the data to be backed up or the data to be backed up is being sent to the server when an interruption occurs. Further, it can also indicate that it has been determined Data to be backed up or data to be backed up that has been sent to the server. Therefore, the record can be used as an interruption identifier at the time of the interruption to indicate the location of the interruption of the data backup.
  • the data backup is interrupted.
  • the terminal device records that the data to be backed up is being sent to the server when it is interrupted, and records the data to be backed up that has been sent to the server.
  • the record can be used as the first interruption identifier to indicate the location of the interruption when the terminal device performs data backup.
  • the terminal device may determine the third data according to the first interruption identifier, where the first interruption identifier may be used to indicate completion before the end time of the data backup period.
  • the last data sent that is, the data that has not been sent at the end time of the above-mentioned data backup period is determined as the third data.
  • determining the third data may include: determining the third data according to the first interruption identifier, where the first interruption identifier is used to indicate that the data to be sent in the third period is in the third period.
  • the last data that was sent before the end time, and the third data includes the data that needs to be sent in the third period after the data indicated by the first interruption flag.
  • the third period is before the first period in the current backup cycle. A period for sending data to be backed up.
  • the terminal device before the first moment in the current backup cycle, the terminal device has determined the data that needs to be backed up and has sent these data in the third period before the first moment. However, in the third period, only part of the data that needs to be backed up is successfully sent, and the terminal device records in real time the data that has not been successfully transmitted in the third period. In this case, the record may be used as the first interruption identifier, and the terminal device may determine the third data according to the first interruption identifier, that is, the data indicated by the first interruption identifier that is not successfully transmitted in the third period is determined as the third data.
  • the status of the last backup transaction is successful, it means that the last backup transaction has been completed.
  • the backup transaction ID can be used to identify the backup transaction.
  • the transaction list can record the data that the terminal device needs to back up and the data that has been backed up. It can record the current ongoing steps and completed steps in real time during the backup process. You can also record the status of the backup transaction as successful or failed. For example, when the backup transaction is completed, the status of the backup transaction can be recorded as successful; when the backup transaction is interrupted or stopped due to an exception, the status of the backup transaction can be recorded as failed.
  • determining the fourth data may include: determining the fourth data according to the first update identifier, where the first update identifier is used to indicate an updated version of the data stored by the terminal device in the third period, and the fourth data includes Incremental data of the data corresponding to the update version indicated by the second update identifier relative to the data corresponding to the update version indicated by the first update identifier.
  • the second update identifier is used to indicate that the terminal device stores the An updated version of the data.
  • the terminal device before the first time in the current backup cycle, the terminal device has determined the data that needs to be backed up, and sends all these data to the server in the third period before the first time. At this time, the terminal device may determine the incremental data of the data stored by the terminal device in the first period with respect to the data stored by the terminal device in the third period as the fourth data.
  • the first update identifier may be used to indicate an updated version of data stored by the terminal device in the third period
  • the second update identifier may be used to indicate the updated version of data stored by the terminal device in the first period.
  • the updated version can be used to indicate the "version number" of the data stored by the terminal device.
  • a "version (V)" attribute can be added to each file, and the initial version number of each file can take V1; and a global transaction ID ID can be defined
  • the initial value of the global transaction ID can be V0.
  • the global transaction identifier is an example of a first update identifier.
  • the file system can increase the current global transaction ID by 1, and ,
  • the global transaction ID added by 1 is used as the version number of the changed file, and is assigned to the "version number" attribute of the changed file.
  • the initial version numbers of file A, file B, file C, file D, file E, file F, file G, and directory A in the terminal device are all V1, global transactions.
  • the initial value of ID is V1.
  • the first time a file is changed that is, after the file A, file E, and file F and the target A are changed, the global transaction ID is updated to V2, and as shown in the middle figure of FIG.
  • the Version Number attribute is updated to V2.
  • the second time the file is changed that is, after the file D is changed, the global transaction ID is updated to V3, and as shown in the figure below, the "version number" attribute of the file D is updated to V3.
  • the terminal device determines the data to be backed up, it may be implemented in the following manner: According to the "version number" attribute of the file currently stored on the terminal device, a file with a version number less than and equal to the current global transaction ID in the file is used as Incremental files. The incremental file is the data to be backed up for the current terminal device.
  • the current global transaction ID is V3. Since it is the first backup, all files in the current terminal device are incremental files, that is, file A, file B, and file. C, file D, file E, file F, and files in directory A are all data to be backed up.
  • the current global transaction ID is updated to V5, and the "version numbers" of file C, file D, and file H are greater than the corresponding global transaction ID V3 during the last backup. And is less than or equal to the current global transaction ID V5, the data to be backed up by the terminal device may be file C, file D, and file H.
  • S320 Determine the first data at the first moment.
  • the first time is within the backup period, and the first time is before the settlement time of the data to be backed up in the backup period.
  • the backup period may refer to a backup period preset by the terminal device.
  • the terminal device can be preset to perform data backup every seven days, that is, the backup period can be seven days.
  • the backup period here is seven days. It should be understood that the backup period is at least seven days. For example, when the interval between the completion of the preset data backup in the previous backup period is seven days, the terminal device cannot perform data because the backup conditions are not met or other reasons. When backing up, the backup period at this time is greater than seven days.
  • the first time is within the backup cycle, it means that the first time is a time in the backup cycle.
  • the first moment may be one of the seven days, for example, at ten in the morning on the next day.
  • the settlement time of the data to be backed up in the backup cycle is the preset data backup time in the backup cycle.
  • the terminal device backs up the data to be backed up in each backup cycle at the settlement time of the data to be backed up. It should be understood that each backup cycle There will be a preset data backup time inside. When the terminal device is preset to perform a preset data backup every (at least) seven days, the settlement time of two adjacent data to be backed up is also (at least) seven days apart.
  • the first time is before the settlement time of the data to be backed up in the backup cycle means that the first time is not a data backup time preset in the backup cycle. For example, a terminal device completes a backup of data at 10:00 a.m. on the first Monday according to a preset backup cycle. If the backup period is seven days, the terminal device usually performs a backup at 10:00 a.m. on the second Monday. Preset data backup.
  • the first time is between 10 am on the first Monday and 10 am on the second Monday.
  • the first time can also be 10 am on the first Monday, but it cannot be Ten o'clock in the morning on the second Monday.
  • the settlement time of the data to be backed up in the backup cycle refers to a preset data backup time in the backup cycle, that is, it can be 10 o'clock in the morning on the second Monday.
  • Determining the first data at the first time refers to data that can be pre-uploaded incrementally before the preset data backup time is determined at the first time. For example, when the backup cycle is seven days, the first moment may be a moment in the backup cycle. For example, the data to be backed up may be determined at three o'clock in the afternoon on the second day of the seven days.
  • At least one incremental pre-upload of data may be performed before a preset data backup time, that is, there may be at least one first time before the settlement time of the data to be backed up.
  • the third data obtained in S311 may be determined as the first data, and the third data is data that needs to be sent in the third period before the end time of the third period
  • the third period is a period before the first period described above for sending data to be backed up.
  • the fourth data obtained in S312 may be determined as the first data, and the fourth data is data stored in the terminal device in the first period of time relative to that in the third period. Incremental data of the data stored by the terminal device during the time period, and the third time period is a time period before the first time period described above for sending data to be backed up.
  • each piece of data stored on the terminal device can be determined through its corresponding metadata.
  • the metadata can uniquely determine each piece of data.
  • the metadata here can include the name of the data, and the modification of the data. Time, the size of the data, and the fifth version of the message's message digest algorithm (Message 5, Algorithm 5, MD5), etc.
  • the MD5 of the data may be a 128-bit feature value obtained by mathematically transforming the data through an existing MD5 algorithm, and the application does not limit the manner of obtaining the MD5 feature value.
  • the terminal device may determine the incremental data to be backed up, that is, the first data according to the metadata corresponding to each data currently stored. For example, as an example and not a limitation, if two data have the same name, the same modification time, but different sizes, and different MD5 characteristic values, the two data can be considered different; if the two data have different names, the modification time is different, However, if the sizes are the same and the MD5 characteristic values are the same, the two data can be regarded as the same. It should be understood that the present application may also determine the incremental data to be backed up by using other attribute values or characteristic values of the data, that is, determine whether the data has changed by using other attribute values or characteristic values of the data, which is not limited in this application. .
  • the terminal device may also determine the incremental data to be backed up by listening to instructions of the operating system or file system in real time. For example, if the terminal device detects that the current instruction of the operating system or file system is to modify a certain data, the changed data is the first data; if the terminal device detects that the current instruction of the operating system or file system is to a certain data, When a data is deleted, the data changes.
  • the terminal device may also first obtain metadata corresponding to each data according to the stored data; next, send the metadata corresponding to each data to the server, and the server according to the metadata corresponding to the data and each server currently stored in the server.
  • the metadata of the data is compared to determine the current incremental data of the terminal device, and the metadata corresponding to the incremental data is sent to the terminal device.
  • the terminal device may determine the first data according to the metadata.
  • the terminal device may, according to the stored backup record, compare the metadata of the currently stored data with the data metadata stored when the terminal device last completed the backup, and compare it with the data stored when the last backup was completed
  • the changed part is determined as the incremental data to be backed up, that is, the first data.
  • a first period send the first data to the server.
  • the first time period is located within the backup period, and the first time period is located before the settlement time of the data to be backed up in the backup period.
  • the first time may be the start time of the first time period, or may be a certain interval from the start time of the first time period.
  • the first period is before the settlement time of the data to be backed up in the backup period means that the end time of the first period is before the settlement time of the data to be backed up in the backup period, that is, the first period is located in advance in the backup period Before the time of data backup.
  • an example where the first time is the starting time of the first time period is as follows: when the backup period is seven days, and it is determined that the second day of the seven days is three o'clock in the afternoon After backing up the data, the first period can start at 3 pm on the second day.
  • an example of a certain interval between the first time and the starting time of the first time period is as follows: when the backup period is seven days, and on the second day of the seven days After determining the data to be backed up at 3 pm, the first time period can start at 8 am on the third day.
  • a pre-upload of data to be backed up is performed in the first period before the settlement time of the backup cycle arrives, which can reduce the amount of data to be backed up when the preset data backup time arrives, thereby reducing each The time of secondary data backup reduces the probability of abnormality during data backup and improves the success rate of backup.
  • steps S320 and S330 described above may be included, that is, there may be multiple times and periods before the settlement time of the data to be backed up in the backup cycle. , Determining data at each of the plurality of times, and transmitting the data at each time period.
  • the backup period there may be a certain time and a certain period of time before the first time, at which time the data to be backed up is determined, and the data to be backed up is sent during this time period; There is another time and another period between the settlement moments, at which time the data to be backed up is determined, and the data to be backed up is sent at this time.
  • the terminal device when the terminal device sends the first data, if the first data cannot be completely sent in the first period, the terminal device may be configured with a second interruption identifier, and the second interruption identifier is used to indicate that the first data is in the first data. The last data sent before the end of the period.
  • the terminal device when the terminal device sends the first data under the preset condition, if the terminal device detects that the preset condition has not been met, the terminal device may stop sending the first data and generate a second interruption flag.
  • the two terminal identifiers indicate the last data in the first data that was successfully transmitted before the transmission was stopped.
  • the unsent data in the first period is determined as the data to be backed up according to the second interruption identifier.
  • the maximum duration of data backup each time may be preset, and if the length of actual backup data each time exceeds the preset maximum duration, the current data backup may be stopped.
  • the terminal device stops the data backup when the backup duration reaches the first threshold.
  • the data determined at the first time is not completely transmitted in the first period, and the remaining data that is not transmitted can continue to be transmitted when the preset conditions are met next time.
  • the terminal device may generate a corresponding interruption identifier, which is used to indicate that the last data in the first period is completed. In this way, at the next backup, the data to be sent can be determined according to the interruption identifier.
  • S340 Determine that the status of the terminal device meets a preset condition.
  • the terminal device may determine the second data when it is determined that a preset condition is met. That is, before determining the second data, it may be determined that the state of the terminal device meets a preset condition.
  • determining that the status of the terminal device meets a preset condition may mean that the status of the terminal device meets at least one of the following conditions: the network connection status of the terminal device is a WiFi connection status, and the charging status of the terminal device is connected
  • the state of the charger, the screen state of the terminal device is a lock screen state, and the state of the battery of the terminal device is that the remaining power is greater than or equal to a preset power value.
  • the screen state of the terminal device here is the lock screen state, which can be understood as that the terminal device is in an unused state, that is, the user has not performed any operation on the terminal device in a specific period of time.
  • the user may also preset that the terminal device determines the second data as soon as the settlement time of the backup cycle is reached. At this time, regardless of whether the above-mentioned preset conditions are met, the second data is directly determined, and is sent to the corresponding second time period.
  • the server sends the second data.
  • the backup method of the present application further includes determining the second data at the settlement time of the data to be backed up in the backup cycle, where the second data is different from the first data.
  • the second data is determined at the settlement time of the backup cycle, where the second data refers to data that the terminal device needs to back up when performing data backup at a preset time within the backup cycle.
  • the second data is determined at the settlement time of the backup period.
  • the second data refers to the terminal device determining the waiting time when the terminal device performs data backup every seven days. Back up your data.
  • the second period send the second data to the server.
  • the second period is within the backup period, and the second period may be a preset data backup time after the settlement time of the data to be backed up in the backup period.
  • the second period is within the backup period, and the second period is the backup period after the settlement time of the data to be backed up in the backup period.
  • the second period is the data backup period preset in the backup period, and the data sent in the second period. It can be determined at the settlement time of the data to be backed up in the backup cycle.
  • the backup period is set to seven days.
  • the terminal device is set to back up data every seven days.
  • the second data is sent in two periods, and the backup period ends when the second data is sent in the second period, that is, the backup period is greater than or equal to seven days (this "seven days" should be understood as the interval between the first time and the settlement time
  • the time can be set by the user, and can be set to at least seven days here) and the total duration of the second period.
  • end time of the second time period and the settlement time of the next backup period may be fixed at a fixed interval, which may be set to at least seven days here.
  • the terminal device completes the backup data at 10:00 a.m. on the first Monday according to a preset backup cycle. If the backup period can be seven days, the terminal device can perform the backup at 10:00 a.m. on the second Monday. A data backup.
  • the maximum duration of data backup each time may be preset, and if the length of actual backup data each time exceeds the preset maximum duration, the current data backup may be stopped.
  • the terminal device stops the data backup when the backup duration reaches the first threshold.
  • the data determined at the settlement time is not completely transmitted in the second period, and the remaining data that is not transmitted can continue to be transmitted when the preset conditions are met next time.
  • the current backup transaction has ended, and the next backup cycle is entered.
  • the terminal device may send information of all backup data recorded in the backup period to the server, and the server creates a backup record according to the information of all the backup data.
  • the information of the backup data here may refer to metadata corresponding to all data that has been backed up during the backup cycle, or any other characteristic value or information that can represent the data.
  • all the data corresponding to the backup record may be determined according to the backup record saved on the server side, and sent to the terminal device to restore the backup data.
  • the terminal device performs a pre-upload of data to be backed up at least once before the settlement time of the backup cycle arrives, which can reduce the amount of data to be backed up when the preset data backup time arrives, thereby reducing each The time of secondary data backup reduces the probability of abnormality during data backup and improves the success rate of backup.
  • the terminal device performs data backup once at the settlement time of the backup cycle, and can perform at least one data backup before the settlement time of the backup cycle, that is, , The terminal device will perform data backup at least twice in each backup cycle.
  • the data backup process in FIG. 6 may be any one of at least two data backups in the backup cycle in FIG. 3.
  • FIG. 6 shows the steps or operations of the backup method, but these steps or operations are merely examples, and the embodiment of the present application may also perform other operations or a modification of each operation in FIG. 6.
  • each step in FIG. 6 may be performed in a different order than that presented in FIG. 6, and it is possible that not all operations in FIG. 6 are to be performed.
  • the last backup transaction may include the last backup transaction ID and transaction list.
  • the transaction list can include the status of the last backup transaction.
  • the last backup transaction corresponds to the last data backup of the terminal device, and includes a backup transaction ID and a transaction list.
  • the backup transaction ID can uniquely determine the last data backup.
  • data can be recorded in units of data (file) directories, data can be recorded in units of folders, and data can also be recorded in units of applications.
  • data is recorded in units of applications in FIG. 6.
  • the transaction list can record the backup status of each application in the previous backup transaction as success or failure. Specifically, the transaction list can record the backup status of each application in the last backup transaction as “data preparation failed” or “data upload failed”. If the backup status of the application is not "Failed to prepare data” or "Failed to upload data”, it can indicate that the application has not been processed in the last backup transaction.
  • a new backup transaction can be created, including a new backup transaction ID.
  • the new backup transaction ID corresponds to this data backup.
  • one of the applications recorded in the transaction list that needs to be backed up to the server this time is determined as the current application.
  • This application does not limit the method for determining the backup sequence of each application.
  • the expiration of the backup transaction may refer to that from the start of the backup transaction, the total usage time has exceeded a preset duration threshold, but has not yet been completed, and the backup transaction may be said to be expired .
  • the time threshold can be set to 5 days.
  • the backup transaction starts at 12:00 noon on the first day of the backup cycle, and an interruption occurs during the backup process, which causes the backup transaction to be completed by 12:00 noon on the fifth day. At this time, if the total time of the backup transaction exceeds 5 days, that is, the preset duration threshold has been exceeded, the backup transaction has expired.
  • the terminal device When the last backup transaction was interrupted, the terminal device was sending data to the cloud but did not finish sending, that is, the terminal device only sent part of the data in the last data backup.
  • the cloud here is also a server that stores data to be backed up.
  • the location of the last backup transaction interruption can be determined according to the first interruption identifier, so as to determine the data to be processed or backed up in this backup transaction, and then continue to execute the outstanding data step.
  • the first interruption identifier here can be understood as unprocessed data or incomplete steps in the last backup transaction recorded in the transaction list.
  • the data that needs to be backed up in the current application may be determined according to the first update identifier and stored in the transaction list.
  • the first update identifier may be used to indicate the updated version of the data stored by the terminal device at the time when the last backup transaction started, and the updated version herein may be used to indicate the "version number" of the data stored by the terminal device.
  • the data to be backed up in the current application may be the incremental data of the data stored in the application in the terminal device at the current time relative to the data stored in the application at the time when the last backup transaction started.
  • the application that was preparing data when the last backup transaction was interrupted may be determined according to the first interruption identifier. Identify this app as the current app and continue preparing the data in the app that needs to be backed up.
  • the first interruption identifier here can be understood as an application that is preparing data when the last backup transaction recorded in the transaction list is interrupted.
  • the method described in FIG. 6 may be performed.
  • FIG. 7 is a schematic block diagram of a terminal device 700 according to an embodiment of the present application. As shown in FIG. 7, the terminal device 700 may include a determining module 710 and a sending module 720.
  • the determining module 710 may be the processor 180 of the terminal device 100 shown in FIG. 1, and the sending module 720 may be the RF circuit 110 in the terminal device 100 shown in FIG. 1.
  • the determining module 710 is configured to determine the first data at a first time, where the first time is within a backup period, and the first time is before a settlement time of the data to be backed up in the backup period.
  • the sending module 720 is configured to send the first data to the server in a first period, the first period is within the backup period, and the first period is after the first moment, the backup period Before the settlement time of the data to be backed up.
  • the determining module is further configured to determine second data at the settlement time of the data to be backed up in the backup cycle, where the second data is different from the first data.
  • the sending module is further configured to send the second data to the server in a second period, the second period being after the settlement time of the data to be backed up in the backup period.
  • the determining module is further configured to determine that the status of the terminal device meets at least one of the following conditions: the network connection status of the terminal device is Wireless fidelity WiFi connection status, the charging status of the terminal device is a connected charger status, the screen status of the terminal device is a lock screen status, and the battery status of the terminal device is that the remaining power is greater than or equal to a preset power value .
  • the determining module is specifically configured to determine third data, where the third data is data that is not sent before the end of the third period among data that needs to be sent in the third period, and
  • the third period is a period preceding the first period for sending data to be backed up; the third data is determined as the first data.
  • the determining module is specifically configured to determine the third data according to a first interruption identifier, where the first interruption identifier is used to indicate an end of the third period of data to be sent in the third period.
  • the last data completed before the time is sent, and the third data includes data that needs to be sent in the third period after the data indicated by the first interruption identifier.
  • the determining module is further configured to configure a second interruption identifier, and the second interruption identifier is used to indicate the first data The last data that was sent before the end of the first period.
  • the determining module is specifically configured to determine fourth data, where the fourth data is data stored by the terminal device in the first period relative to data stored by the terminal device in the third period Incremental data of the stored data, the third period is a period preceding the first period for sending data to be backed up; the fourth data is determined as the first data.
  • the determining module is specifically configured to determine the fourth data according to a first update identifier, where the first update identifier is used to indicate an updated version of data stored by the terminal device in a third period,
  • the fourth data includes incremental data of data corresponding to the update version indicated by the second update identifier relative to data corresponding to the update version indicated by the first update identifier, and the second update identifier is used to indicate that The updated version of the data stored by the terminal device in the first period is described.
  • the determining module is further configured to record a correspondence between a second update identifier and the first period, and the second update identifier is used to indicate an update of data stored by the terminal device in the first period version.
  • the duration of the first period is less than or equal to a preset first threshold.
  • terminal device 700 may be used to perform the steps or operations performed by the terminal device in any of the foregoing methods for backing up data, and details are not described herein again.
  • the processor in the embodiment of the present application may be an integrated circuit chip and has a signal processing capability.
  • each step of the foregoing method embodiment may be completed by using an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the above-mentioned processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable processors. Programming logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • Programming logic devices, discrete gate or transistor logic devices, discrete hardware components Various methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed and completed by using a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a mature storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, and the like.
  • the storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the foregoing method in combination with its hardware.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, which may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of this application is essentially a part that contributes to the existing technology or a part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the aforementioned storage media include: U disks, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks or compact discs and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本申请提供了一种备份数据的方法和终端设备。该方法包括:在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前;在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述备份周期的待备份数据的结算时刻之前。该技术方案可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以提高备份的成功率。

Description

备份数据的方法和终端设备 技术领域
本申请涉及通信领域,并且更具体地,涉及备份数据的方法和终端设备。
背景技术
在手机日益重要的今天,以手机为例的终端设备上存储了大量的用户重要的数据,比如照片、通信录、日历、备忘录、应用数据(比如微信的聊天数据)。如果用户丢失了手机或者更换了手机,必须提供一种方案迁移和恢复用户的这些数据。
目前,各手机厂家都提供了云备份功能。一种常用的方式为,用户手机上的数据可以周期性地定时备份到云服务器中。当用户丢失了手机或者换手机的时候,可以将云服务器中的备份数据恢复到新的手机上。
但是,手机在某周期内需要备份的数据量比较大时,待备份数据的传输时间会很长,此时,出现备份失败的概率也很高。
发明内容
本申请提供一种备份数据的方法和终端设备,可以提高周期内备份的成功率。
第一方面,提供了一种备份数据的方法,包括:在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前;在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述第一时刻之后,所述备份周期的待备份数据的结算时刻之前。
根据本申请实施例提供的备份数据的方法,在备份周期的结算时刻(在预设的备份周期确定待备份数据的时刻)到达之前的第一时段就进行了一次待备份数据的预上传,可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,降低进行数据备份时发生异常的概率,提高备份的成功率。
可选地,在备份周期的结算时刻之前,可以包括多个上述第一时刻和第一时段,即在备份周期的待备份数据的结算时刻之前,可以存在多个时刻和多个时段,在该多个时刻中的每个时刻确定待备份数据,并在每个时刻的对应时段向服务器发送该待备份数据。
由于在预设的数据备份时刻之前就进行了多次待备份数据的预上传,可以进一步减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,提高备份的成功率,同时,还可以增加终端设备进行数据备份时的灵活性。
在一种可能的实现方式中,在所述备份周期的待备份数据的结算时刻,确定第二数据,所述第二数据与所述第一数据相异;在第二时段,向服务器发送所述第二数据,所述第二时段位于所述备份周期内,且所述第二时段是所述备份周期的待备份数据的结算时刻之后的备份时段。
根据本申请实施例提供的备份数据的方法,在备份周期的待备份数据的结算时刻确定第二数据,并在位于结算时刻之后的第二时段向服务器发送第二数据,可以将该备份周期 内的全部待备份数据都发送到服务器,从而可以保证向服务器发送的待备份数据的完整性,提高备份的可选性。
在一种可能的实现方式中,在确定第一数据之前,所述方法还包括:确定终端设备的状态满足以下至少一个条件:所述终端设备的网络连接状态为无线保真WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。
根据本申请实施例提供的备份数据的方法,终端设备在满足上述预设条件时才进行数据备份。当终端设备的网络连接状态为WiFi连接状态,和/或当终端设备的充电状态为已连接充电器状态,和/或终端设备的电池状态为剩余电量大于或等于预设电量值时,进行数据备份,可以降低终端设备在数据备份时由于网络中断或电量中足发生中断的概率,从而提高备份的可靠性。当终端设备的屏幕状态为锁屏状态时进行数据备份,能够避免影响用户对终端设备的使用,提高用户体验。
在一种可能的实现方式中,所述确定第一数据包括:确定第三数据,所述第三数据是在第三时段需要发送的数据中在所述第三时段的结束时刻之前未完成发送的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将第三数据确定为所述第一数据。
根据本申请实施例提供的备份数据的方法,第三数据为第三时段的结束时刻未完成发送的数据,将该第三数据确定为第一数据,继续向服务器发送该第三时段的结束时刻未完成发送的数据,可以避免待备份数据的遗漏,提高备份的成功率,同时由于无需从头开始发送数据,节约了发送时间,提高了用户体验。
在一种可能的实现方式中,所述确定第三数据包括:根据第一中断标识,确定所述第一数据,所述第一中断标识用于指示在第三时段需要发送的第三数据中在所述第三时段的结束时刻之前完成发送的最后一个数据,且所述第一数据包括所述第三数据中位于所述第一中断标识所指示的数据之后的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段。
根据本申请实施例提供的备份数据的方法,当终端设备在第三时段向服务器发送待备份数据时发生异常,则数据备份中断,此时终端设备记录第一中断标识,用于指示终端设备在第三时段进行数据备份时中断的位置。这样在数据备份中断后,可以根据第一中断标识确定第一数据,因而可以在上次中断的地方继续执行,减少了每次数据备份的时间,提高备份的成功率。
在一种可能的实现方式中,所述方法还包括:当所述第一数据未能在所述第一时段全部发送完毕时,配置第二中断标识,所述第二中断标识用于指示所述第一数据中在所述第一时段的结束时刻之前完成发送的最后一个数据。
在一种可能的实现方式中,所述确定第一数据包括:确定第四数据,所述第四数据是在所述第一时段内终端设备所存储的数据相对于在第三时段内终端设备所存储的数据的增量数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将第四数据确定为所述第一数据。
根据本申请实施例提供的备份数据的方法,第四数据包括第二更新标识所指示的更新版本对应的数据相对于第一更新标识所指示的更新版本对应的数据的增量数据,将该第四数据确定为第一数据,可以减少终端设备在备份时上传的数据量,减少备份时需要的时间,从而提高备份速度,相应地,也可以减少用户的备份数据在服务器侧占用的空间。
在一种可能的实现方式中,所述确定第四数据包括:根据第一更新标识,确定所述第四数据,所述第一更新标识用于指示在第三时段内终端设备所存储的数据的更新版本,所述第四数据包括第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据,所述第二更新标识用于指示在所述第一时段内终端设备所存储的数据的更新版本。
根据本申请实施例提供的备份数据的方法,根据第一更新标识,将第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据确定为第一数据,其中,更新版本用于指示终端设备所存储的数据的“版本号”。这里根据两个时段内终端设备所存储的数据的更新版本确定增量,可以提高确定的增量数据的可靠性,从而提高备份的可靠性。
由于,第四数据为增量数据,在进行备份的时候可以减少终端设备上传的数据量,减少备份时需要的时间,从而提高备份速度,相应地,也可以减少用户的备份数据在服务器侧占用的空间。
在一种可能的实现方式中,记录第二更新标识与所述第一时段的对应关系,所述第二更新标识用于指示在第一时段内终端设备所存储的数据的更新版本。
在一种可能的实现方式中,所述第一时段的时长小于或等于预设的第一阈值。
第二方面,提供了一种终端设备,包括:处理器,用于在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前;发送器,用于在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述第一时刻之后,所述备份周期的待备份数据的结算时刻之前。
根据本申请实施例提供的终端设备,在备份周期的结算时刻(在预设的备份周期确定待备份数据的时刻)到达之前的第一时段就进行了一次待备份数据的预上传,可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,降低进行数据备份时发生异常的概率,提高备份的成功率。
可选地,在备份周期的待备份数据的结算时刻之前,可以包括多个上述第一时刻和第一时段,即在备份周期的结算时刻之前,可以存在多个时刻和多个时段,在该多个时刻中的每个时刻确定待备份数据,并在每个时刻的对应时段向服务器发送该待备份数据。
由于在预设的数据备份时刻之前就进行了多次待备份数据的预上传,可以进一步减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,提高备份的成功率,同时,还可以增加该终端设备进行数据备份时的灵活性。
在一种可能的实现方式中,所述处理器还用于在所述备份周期的待备份数据的结算时刻,确定第二数据,所述第二数据与所述第一数据相异;所述发送器还用于在第二时段, 向服务器发送所述第二数据,所述第二时段位于所述备份周期的待备份数据的结算时刻之后。
根据本申请实施例提供的终端设备,在备份周期的待备份数据的结算时刻确定第二数据,并在位于结算时刻之后的第二时段向服务器发送第二数据,可以将该备份周期内的全部待备份数据都发送到服务器,从而可以保证向服务器发送的待备份数据的完整性,提高备份的可选性。
在一种可能的实现方式中,在确定第一数据之前,所述处理器还用于确定终端设备的状态满足以下至少一个条件:所述终端设备的网络连接状态为无线保真WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。
根据本申请实施例提供的终端设备,该终端设备在满足上述预设条件时才进行数据备份。当该终端设备的网络连接状态为WiFi连接状态、当该终端设备的充电状态为已连接充电器状态、和/或该终端设备的电池状态为剩余电量大于或等于预设电量值时,进行数据备份,可以降低该终端设备在数据备份时由于网络中断或电量中足发生中断的概率,从而提高备份的可靠性。当该终端设备的屏幕状态为锁屏状态时进行数据备份,能够避免影响用户对该终端设备的使用,提高用户体验。
在一种可能的实现方式中,所述处理器具体用于确定第三数据,所述第三数据是在第三时段需要发送的数据中在所述第三时段的结束时刻之前未完成发送的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将所述第三数据确定为所述第一数据。
根据本申请实施例提供的终端设备,第三数据为第三时段的结束时刻未完成发送的数据,将该第三数据确定为第一数据,继续向服务器发送该第三时段的结束时刻未完成发送的数据,可以避免待备份数据的遗漏,提高备份的成功率,同时由于无需从头开始发送数据,节约了发送时间,提高了用户体验。
在一种可能的实现方式中,所述处理器具体用于根据第一中断标识,确定所述第三数据,所述第一中断标识用于指示在第三时段需要发送的数据中在所述第三时段的结束时刻之前完成发送的最后一个数据,以及所述第三数据包括在第三时段需要发送的数据中位于所述第一中断标识所指示的数据之后的数据。
根据本申请实施例提供的终端设备,当该终端设备在第三时段向服务器发送待备份数据时发生异常,则数据备份中断,此时该终端设备记录第一中断标识,用于指示该终端设备在第三时段进行数据备份时中断的位置。这样在数据备份中断后,可以根据第一中断标识确定第一数据,因而可以在上次中断的地方继续执行,减少了每次数据备份的时间,提高备份的成功率。
在一种可能的实现方式中,当所述第一数据未能在所述第一时段全部发送完毕时,所述处理器还用于配置第二中断标识,所述第二中断标识用于指示所述第一数据中在所述第一时段的结束时刻之前完成发送的最后一个数据。
在一种可能的实现方式中,所述处理器具体用于确定第四数据,所述第四数据是在所 述第一时段内所述终端设备所存储的数据相对于在第三时段内所述终端设备所存储的数据的增量数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将所述第四数据确定为所述第一数据。
根据本申请实施例提供的终端设备,第四数据包括第二更新标识所指示的更新版本对应的数据相对于第一更新标识所指示的更新版本对应的数据的增量数据,将该第四数据确定为第一数据,可以减少该终端设备在备份时上传的数据量,减少备份时需要的时间,从而提高备份速度,相应地,也可以减少用户的备份数据在服务器侧占用的空间。
在一种可能的实现方式中,所述处理器具体用于根据第一更新标识,确定所述第四数据,所述第一更新标识用于指示在第三时段内所述终端设备所存储的数据的更新版本,所述第四数据包括第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据,所述第二更新标识用于指示在所述第一时段内所述终端设备所存储的数据的更新版本。
根据本申请实施例提供的终端设备,根据第一更新标识,将第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据确定为第一数据,其中,更新版本用于指示该终端设备所存储的数据的“版本号”。这里根据两个时段内该终端设备所存储的数据的更新版本确定增量,可以提高确定的增量数据的可靠性,从而提高备份的可靠性。
在一种可能的实现方式中,所述处理器还用于记录第二更新标识与所述第一时段的对应关系,所述第二更新标识用于指示在第一时段内所述终端设备所存储的数据的更新版本。
在一种可能的实现方式中,所述第一时段的时长小于或等于预设的第一阈值。
第三方面,提供了一种终端设备,该终端设备包括:确定模块,用于在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前;发送模块,用于在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述第一时刻之后,所述备份周期的待备份数据的结算时刻之前。
根据本申请实施例提供的终端设备,在备份周期的结算时刻(在预设的备份周期确定待备份数据的时刻)到达之前的第一时段就进行了一次待备份数据的预上传,可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,降低进行数据备份时发生异常的概率,提高备份的成功率。
可选地,在备份周期的待备份数据的结算时刻之前,可以包括多个上述第一时刻和第一时段,即在备份周期的待备份数据的结算时刻之前,可以存在多个时刻和多个时段,在该多个时刻中的每个时刻确定待备份数据,并在每个时刻的对应时段向服务器发送该待备份数据。
由于在预设的数据备份时刻之前就进行了多次待备份数据的预上传,可以进一步减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,提高备份的成功率,同时,还可以增加该终端设备进行数据备份时的灵活性。
在一种可能的实现方式中,所述确定模块还用于在所述备份周期的待备份数据的结算 时刻,确定第二数据,所述第二数据与所述第一数据相异;所述发送模块还用于在第二时段,向服务器发送所述第二数据,所述第二时段位于所述备份周期的待备份数据的结算时刻之后。
根据本申请实施例提供的终端设备,在备份周期的待备份数据的结算时刻确定第二数据,并在位于结算时刻之后的第二时段向服务器发送第二数据,可以将该备份周期内的全部待备份数据都发送到服务器,从而可以保证向服务器发送的待备份数据的完整性,提高备份的可选性。
在一种可能的实现方式中,在确定第一数据之前,所述确定模块还确定终端设备的状态满足以下至少一个条件:所述终端设备的网络连接状态为无线保真WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。
根据本申请实施例提供的终端设备,该终端设备在满足上述预设条件时才进行数据备份。当该终端设备的网络连接状态为WiFi连接状态、当该终端设备的充电状态为已连接充电器状态、和/或该终端设备的电池状态为剩余电量大于或等于预设电量值时,进行数据备份,可以降低该终端设备在数据备份时由于网络中断或电量中足发生中断的概率,从而提高备份的可靠性。当该终端设备的屏幕状态为锁屏状态时进行数据备份,能够避免影响用户对该终端设备的使用,提高用户体验。
在一种可能的实现方式中,所述确定模块具体用于确定第三数据,所述第三数据是在第三时段需要发送的数据中在所述第三时段的结束时刻之前未完成发送的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将所述第三数据确定为所述第一数据。
根据本申请实施例提供的终端设备,第三数据为第三时段的结束时刻未完成发送的数据,将该第三数据确定为第一数据,继续向服务器发送该第三时段的结束时刻未完成发送的数据,可以避免待备份数据的遗漏,提高备份的成功率,同时由于无需从头开始发送数据,节约了发送时间,提高了用户体验。
在一种可能的实现方式中,所述确定模块具体用于根据第一中断标识,确定所述第三数据,所述第一中断标识用于指示在第三时段需要发送的数据中在所述第三时段的结束时刻之前完成发送的最后一个数据,以及所述第三数据包括在第三时段需要发送的数据中位于所述第一中断标识所指示的数据之后的数据。
根据本申请实施例提供的终端设备,当该终端设备在第三时段向服务器发送待备份数据时发生异常,则数据备份中断,此时该终端设备记录第一中断标识,用于指示该终端设备在第三时段进行数据备份时中断的位置。这样在数据备份中断后,可以根据第一中断标识确定第一数据,因而可以在上次中断的地方继续执行,减少了每次数据备份的时间,提高备份的成功率。
在一种可能的实现方式中,当所述第一数据未能在所述第一时段全部发送完毕时,所述确定模块还用于配置第二中断标识,所述第二中断标识用于指示所述第一数据中在所述第一时段的结束时刻之前完成发送的最后一个数据。
在一种可能的实现方式中,所述确定模块具体用于确定第四数据,所述第四数据是在所述第一时段内所述终端设备所存储的数据相对于在第三时段内所述终端设备所存储的数据的增量数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将所述第四数据确定为所述第一数据。
根据本申请实施例提供的终端设备,第四数据包括第二更新标识所指示的更新版本对应的数据相对于第一更新标识所指示的更新版本对应的数据的增量数据,将该第四数据确定为第一数据,可以减少该终端设备在备份时上传的数据量,减少备份时需要的时间,从而提高备份速度,相应地,也可以减少用户的备份数据在服务器侧占用的空间。
在一种可能的实现方式中,所述确定模块具体用于根据第一更新标识,确定所述第四数据,所述第一更新标识用于指示在第三时段内所述终端设备所存储的数据的更新版本,所述第四数据包括第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据,所述第二更新标识用于指示在所述第一时段内所述终端设备所存储的数据的更新版本。
根据本申请实施例提供的终端设备,根据第一更新标识,将第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据确定为第一数据,其中,更新版本用于指示该终端设备所存储的数据的“版本号”。这里根据两个时段内该终端设备所存储的数据的更新版本确定增量,可以提高确定的增量数据的可靠性,从而提高备份的可靠性。
在一种可能的实现方式中,所述确定模块还用于记录第二更新标识与所述第一时段的对应关系,所述第二更新标识用于指示在第一时段内所述终端设备所存储的数据的更新版本。
在一种可能的实现方式中,所述第一时段的时长小于或等于预设的第一阈值。
第四方面,提供了一种芯片系统,包括处理器,用于从存储器调用并运行计算机程序,使得安装有所述芯片系统的设备执行如上述第一方面或第一方面中任一项可能的实现方式中的方法。可选地,所述芯片系统还包括所述存储器。
第五方面,提供了一种计算机可读介质,包括指令,当其在终端设备上运行时,使得所述终端设备执行上述第一方面或第一方面中任一项可能的实现方式中的方法。
第六方面,提供了一种计算机程序产品,包括指令,当其在终端设备上运行时,使得所述终端设备执行第一方面或第一方面中任一项可能的实现方式中的方法。
附图说明
图1是本申请实施例的备份数据的方法所适用于的终端设备的一例的示意图。
图2是本申请实施例应用的一种备份系统的示意图。
图3是本申请实施例的一种备份数据的方法的示意性流程图。
图4是本申请一个实施例的确定增量数据的示意图。
图5是本申请另一个实施例的确定增量数据的示意图。
图6是本申请实施例的另一个备份数据的方法的示意性流程图。
图7是本申请实施例的备份数据的终端设备700的示意性框图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请的备份数据的方法可以用于终端设备的数据备份。终端设备也可以称为用户设备,可以是手机、手环、电话手表、平板电脑、笔记本电脑、台式电脑、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、个人数字助理(Personal Digital Assistant,PDA)设备、销售终端(Point of Sales,POS)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备等,本申请实施例对此并不限定。
服务器也可以称为云或云端,可以是平板电脑、笔记本电脑、台式电脑、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、个人数字助理(Personal Digital Assistant,PDA)设备、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备等,本申请实施例对此并不限定。
此外,在本申请实施例中,终端设备还可以是物联网(Internet of Things,IoT)系统中的终端设备,IoT是未来信息技术发展的重要组成部分,其主要技术特点是将物品通过通信技术与网络连接,从而实现人机互连,物物互连的智能化网络。
图1以手机为例,示出了该终端设备的一例的示意图,如图1所示,该终端设备100可以包括以下部件。
A.RF电路110
RF电路110可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器180处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、LNA(Low Noise Amplifier,低噪声放大器)、双工器等。此外,RF电路110还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于无线局域网(Wireless Local Area Networks,WLAN)全球移动通讯(Global System of Mobile communication,GSM)系统、码分多址(Code Division Multiple Access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)系统、通用分组无线业务(General Packet Radio Service,GPRS)、长期演进(Long Term Evolution,LTE)系统、LTE频分双工(Frequency Division Duplex,FDD)系统、LTE时分双工(Time Division Duplex,TDD)、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、全球互联微波接入(Worldwide Interoperability for Microwave Access,WiMAX)通信系统、未来的第五代(5th Generation,5G)系统或新无线(New Radio,NR)等。
B.存储器120
存储器120可用于存储软件程序以及模块,处理器180通过运行存储在存储器120的软件程序以及模块,从而执行终端设备100的各种功能应用以及数据处理。存储器120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所 需的应用程序(比如声音播放功能、图象播放功能等)等;存储数据区可存储根据终端设备100的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
C.其他输入设备130
其他输入设备130可用于接收输入的数字或字符信息,以及产生与终端设备100的用户设置以及功能控制有关的键信号输入。具体地,其他输入设备130可包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)等中的一种或多种。其他输入设备130与I/O子系统170的其他输入设备控制器171相连接,在其他设备输入控制器171的控制下与处理器180进行信号交互。
D.显示屏140
显示屏140可用于显示由用户输入的信息或提供给用户的信息以及终端设备100的各种菜单,还可以接受用户输入。具体的显示屏140可包括显示面板141,以及触控面板142。其中显示面板141可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板141。触控面板142,也称为触摸屏、触敏屏等,可收集用户在其上或附近的接触或者非接触操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板142上或在触控面板142附近的操作,也可以包括体感操作;该操作包括单点控制操作、多点控制操作等操作类型),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板142可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位、姿势,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成处理器能够处理的信息,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板142,也可以采用未来发展的任何技术实现触控面板142。进一步的,触控面板142可覆盖显示面板141,用户可以根据显示面板141显示的内容(该显示内容包括但不限于,软键盘、虚拟鼠标、虚拟按键、图标等等),在显示面板141上覆盖的触控面板142上或者附近进行操作,触控面板142检测到在其上或附近的操作后,通过I/O子系统170传送给处理器180以确定用户输入,随后处理器180根据用户输入通过I/O子系统170在显示面板141上提供相应的视觉输出。虽然在图4中,触控面板142与显示面板141是作为两个独立的部件来实现终端设备100的输入和输入功能,但是在某些实施例中,可以将触控面板142与显示面板141集成而实现终端设备100的输入和输出功能。
E.传感器150
传感器150可以为一种或多种,例如,该可以包括光传感器、运动传感器以及其他传感器。
具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在终端设备100移动到耳边时, 关闭显示面板141和/或背光。
作为运动传感器的一种,加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等。
此外,终端设备100还可配置的重力感应器(也可以称为重力传感器)、陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
F.音频电路160、扬声器161、麦克风162
可提供用户与终端设备100之间的音频接口。音频电路160可将接收到的音频数据转换后的信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,麦克风162将收集的声音信号转换为信号,由音频电路160接收后转换为音频数据,再将音频数据输出至RF电路108以发送给比如另一终端设备,或者将音频数据输出至存储器120以便进一步处理。
G.I/O子系统170
I/O子系统170用来控制输入输出的外部设备,可以包括其他设备输入控制器171、传感器控制器172、显示控制器173。可选的,一个或多个其他输入控制设备控制器171从其他输入设备130接收信号和/或者向其他输入设备130发送信号,其他输入设备130可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)。值得说明的是,其他输入控制设备控制器171可以与任一个或者多个上述设备连接。所述I/O子系统170中的显示控制器173从显示屏140接收信号和/或者向显示屏140发送信号。显示屏140检测到用户输入后,显示控制器173将检测到的用户输入转换为与显示在显示屏140上的用户界面对象的交互,即实现人机交互。传感器控制器172可以从一个或者多个传感器150接收信号和/或者向一个或者多个传感器150发送信号。
H.处理器180
处理器180是终端设备100的控制中心,利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行终端设备100的各种功能和处理数据,从而对终端设备进行整体监控。可选的,处理器180可包括一个或多个处理单元;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。
终端设备100还包括给各个部件供电的电源190(比如电池),优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。
另外,尽管未示出,终端设备100还可以包括摄像头、蓝牙模块等,在此不再赘述。
本领域技术人员可以理解,图1中示出的终端设备结构并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的 部件布置。
如图2所示,本申请实施例的技术方案可以应用于各种由终端设备210和服务器220组成的存储系统,例如云存储系统、传统存储系统,及其它能够提供存储功能的系统等。
如图所示,该终端设备210可以包括:应用程序、文件系统和物理存储等,本领域技术人员可以理解,图2中示出的终端设备并不构成对该终端设备的限定。如图所示,该服务器220可以实现:备份服务、备份元数据存储和文件存储等,本领域技术人员可以理解,图2中示出的服务器并不构成对该服务器的限定。
终端设备210可以在备份周期内预设的时刻对存储的数据进行备份,即终端设备210会定期确定待备份数据,并将该待备份数据发送至服务器220,以实现终端设备的数据备份。这里的数据可以包括终端设备上通信录、备忘录、日历及其他用户安装的应用等使用或产生的数据,也可以包括终端设备上存储的其他文件或数据,本申请实施例对此并不限定。
在本申请实施例中,终端设备的备份周期可以预先进行设置。例如,可以预先设置终端设备的备份周期为七天。此处的备份周期为七天应该理解为该备份周期至少为七天,比如,当与上一备份周期中预设数据备份完成时刻相隔整七天时,终端设备由于不满足备份条件或其他原因无法进行数据备份时,则此时的备份周期大于七天。
在本申请中,终端设备确定的待备份数据可以为终端设备当前存储的所有数据,同样地,终端设备将该待备份数据发送到服务器后,该服务器存储的也可以是终端设备当前存储的所有数据。
该待备份数据也可以为终端设备当前存储的所有数据相对于上次备份完成时存储的数据的增量数据。相应地,终端设备将该待备份数据发送到服务器后,该服务器存储的也可以是该增量数据,这样可以减少用户上传的数据量,减少备份时需要的时间,从而提高备份速度,也可以减少用户的备份数据在服务器侧占用的空间。
在本申请实施例中终端设备在预设的备份周期内进行数据备份时,需要先确定待备份数据,然后再将确定的待备份数据发送至服务器。因此,本申请中可以将备份周期内预设的确定待备份数据的时刻称为备份周期的结算时刻,即终端设备在预设的备份时刻进行数据备份时,确定待备份数据的时刻。
若终端设备存储的数据较多,或终端设备在备份周期内变化的数据较多时,则在该备份周期的结算时刻可能会出现待备份数据较多的情况,此时需要很长时间才能将待备份数据全部发送至服务器,会导致数据备份时间过长。此时,可以在该备份周期的结算时刻之前,确定待备份数据,并对确定的待备份数据进行预上传,发送至服务器,从而可以减少终端设备在结算时刻需要向服务器发送的待备份数据。
本申请的方法中,在备份周期的结算时刻到达之前的第一时段就进行了一次待备份数据的预上传,可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,降低进行数据备份时发生异常的概率,提高备份的成功率。
本申请实施例的一种备份数据的方法的示意性流程图如图3所示。该方法可以由图1中所示的终端设备100执行。
应理解,图3示出了该备份方法的步骤或操作,但这些步骤或操作仅是示例,本申请实施例还可以执行其他操作或者图3中的各个操作的变形。此外,图3中的各个步骤可以按照与图3呈现的不同的顺序来执行,并且有可能并非要执行图3中的全部操作。
例如,图3中的S310、S311、S312、S340、S341、S342为可选的步骤。
S310,确定终端设备的状态满足预设的条件。
在本申请实施例中,终端设备可以在满足预设的条件时才进行数据备份。也就是说,在进行数据备份之前,可以先确定终端设备的状态满足预设的条件。
具体而言,确定终端设备的状态满足预设的条件可以是指终端设备的状态满足以下至少一个条件:所述终端设备的网络连接状态为无线保真(Wireless Fidelity,WiFi)连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。这里的终端设备的屏幕状态为锁屏状态可以理解为该终端设备处于未使用状态,即用户在特定时段未对该终端设备进行任何操作。
可选地,终端设备的状态满足预设的条件也可以是指用户主动对该终端设备进行备份,此时不论终端设备的状态是否满足上述预设的条件,终端设备都会进行数据备份。
例如,用户可以在结算时刻之前主动对该终端设备进行数据备份,此时终端设备会直接确定第一数据,并在对应的第一时段向服务器发送第一数据。用户也可以预先设置数据备份的时刻,这样终端设备只要到了该预先设置的数据备份时刻就确定第一数据,此时无论是否满足上述预设的条件,都会直接确定第一数据,并在对应的第一时段向服务器发送第一数据。
作为示例而非限定,用户可以设置终端设备检测其状态的方式,比如,终端设备可以在备份周期内实时检测其状态,若满足预设的备份条件,则开始进行数据备份;终端设备也可以在备份周期内的特定时刻检测其状态,比如每天晚上十点。本申请对此不做限定。
可选地,终端设备在每次满足预设的条件时,可以检查上一次备份事务的状态。
作为本申请实施例一种可能的实现方式,若上一次备份事务的状态为失败,则说明上一次备份事务未完成,可以执行上一次备份事务,即执行图3中S311,根据第一中断标识确定上一次备份事务中未处理的数据或未完成的步骤,确定当前需要处理或备份的数据,然后继续执行上一次备份事务中未完成的部分。这里的第一中断标识可以理解为事务清单中记录的上一次备份事务中进行数据备份时中断的位置。
S311,根据第一中断标识确定第三数据。
可选地,在根据第一中断标识确定第三数据之前,还可以判断上一次备份事务是否过期。这里的备份事务过期可以是指从开始该备份事务起,其总用时已超过预设的时长门限。
在本申请实施例中,终端设备可以在备份的过程中实时记录当前正在进行的步骤和已经完成的步骤,并将该记录实时存储在终端设备中。当数据备份中断时,可以将该记录作为第一中断标识,用于指示终端设备在第三时段进行数据备份时中断的位置。
例如,当终端设备在确定第三数据时,可以记录当前处于数据准备阶段,并实时记录已经确定出的待备份数据。可选地,也可以实时记录还未确定待备份数据的数据。应理解, 这里的数据准备阶段就是指终端设备在确定待备份数据。
可选地,终端设备可以在确定某个数据为待备份数据时,实时记录该数据为待备份数据。可选地,也可以以数据(文件)目录为单位,即终端设备可以在确定完一个目录中的待备份数据后,实时记录该目录中的待备份数据;也可以以文件夹为单位,即终端设备可以确定完一个文件夹中的待备份数据后,实时记录该文件夹中的待备份数据;也可以以应用(APP)为单位,即终端设备可以确定完一个应用中数据的待备份数据后,实时记录该应用中数据的待备份数据,其中,这里的每个应用中的数据可以是指该应用在安装到终端设备时产生的数据,也可以是指该应用在安装到终端设备后的使用过程中所产生的数据。
再例如,当终端设备向服务器发送待备份数据时,可以记录当前处于数据发送阶段,并实时记录已经向服务器发送的待备份数据。可选地,也可以实时记录还未向服务器发送的待备份数据。
可选地,终端设备可以在向服务器发送待备份数据时,实时记录已经向服务器发送的待备份数据,或者,可以记录还未向服务器发送的待备份数据;
应理解,上述待备份数据可以是终端设备当前存储的所有数据,也可以是终端设备当前存储的所有数据相对于上次备份完成时存储的数据的增量数据
应理解,上文实施例仅为示例,不应对本申请构成任何限定,本申请也不排除通过其他的方式来实现。
如果在终端设备进行数据备份时发生异常,则此次数据备份会被中断,比如,在数据备份的过程中出现网络中断、或电量不足等,会导致此次数据备份中断。
终端设备可以在备份的过程中实时记录当前正在进行的步骤和已经完成的步骤,并将该记录实时存储在终端设备中。若在数据备份时发生异常,则该记录可以用于指示该数据备份中断的位置,即可以指示发生中断时,在确定待备份数据还是在向服务器发送待备份数据,进一步,也可以指示已经确定出的待备份数据或已经向服务器发送的待备份数据。因此,该记录在中断时可以作为中断标识,用于指示该数据备份中断的位置。
例如,在当前备份周期内,当终端设备向服务器发送待备份数据时发生异常,则数据备份中断。终端设备记录了中断时正在向服务器发送待备份数据,并记录了已经向服务器发送的待备份数据,此时,该记录可以作为第一中断标识,用于指示终端设备进行数据备份时中断的位置。
可选地,在当前备份周期内,在上述数据备份时段之后,终端设备可以根据上述第一中断标识确定第三数据,其中,第一中断标识可以用于指示在数据备份时段的结束时刻之前完成发送的最后一个数据,也就是说,将上述数据备份时段的结束时刻未完成发送的数据确定为第三数据。
本申请实施例中,可选地,确定第三数据可以包括:根据第一中断标识,确定第三数据,该第一中断标识用于指示在第三时段需要发送的数据中在第三时段的结束时刻之前完成发送的最后一个数据,以及第三数据包括在第三时段需要发送的数据中位于第一中断标识所指示的数据之后的数据,第三时段是当前备份周期内第一时段的前一个用于发送待备份的数据的时段。
或者可以说,在当前备份周期中位于第一时刻之前,终端设备已经确定过需要备份的数据并在第一时刻之前的第三时段已经发送过这些数据。但是,在第三时段,这些需要备份的数据中仅有部分数据发送成功,并且终端设备实时记录了这些数据中在第三时段还未发送成功的数据。这种情况下,可以将该记录作为第一中断标识,终端设备可以根据第一中断标识确定第三数据,即将第一中断标识指示的在第三时段未发送成功的数据确定为第三数据。
作为本申请实施例一种可能的实现方式,若上一次备份事务的状态为成功,则说明上一次备份事务已完成。此时可以创建一个新的备份事务,该备份事务与本次数据备份对应,包括备份事务标识(identification,ID)和事务清单,然后执行图3中S312,根据第一更新标识确定当前备份事务需要备份的数据,并将其保存在事务清单中。
其中,备份事务ID可以用于标识此次备份事务,事务清单可以记录终端设备需要备份的数据及已经完成备份的数据,可以在备份的过程中实时记录当前正在进行的步骤和已经完成的步骤,也可以记录备份事务的状态为成功或失败。比如,当备份事务完成时,可以记录该备份事务的状态为成功;当备份事务发生中断或因异常而停止时,可以记录该备份事务的状态为失败。
S312,根据第一更新标识确定第四数据。
可选地,确定第四数据可以包括:根据第一更新标识,确定第四数据,该第一更新标识用于指示在第三时段内终端设备所存储的数据的更新版本,该第四数据包括第二更新标识所指示的更新版本对应的数据相对于该第一更新标识所指示的更新版本对应的数据的增量数据,第二更新标识用于指示在上述第一时段内终端设备所存储的数据的更新版本。
也就是说,在当前备份周期中位于第一时刻之前,终端设备已经确定过需要备份的数据,并在第一时刻之前的第三时段将这些数据全部发送至服务器。此时,终端设备可以将在第一时段内该终端设备所存储的数据相对于在第三时段内终端设备所存储的数据的增量数据确定为第四数据。
在本申请实施例中,第一更新标识可以用于指示终端设备在第三时段内存储的数据的更新版本,第二更新标识可以用于指示终端设备在第一时段内存储的数据的更新版本,其中,更新版本可以用于指示终端设备所存储的数据的“版本号”。
下面举例来说一下如何根据终端设备所存储的数据的“版本号”来确定增量数据。
可选地,在终端设备的文件系统层面,可以给每个文件增加一个“版本号(version,V)”属性,每个文件的初始版本号可以取V1;并且,可以定义一个全局事务标识ID,全局事务ID的初始值可以取V0。该全局事务标识为第一更新标识的一种示例。
每次有文件发生变化时,例如,有文件增加了数据或有文件中的数据被修改时,在文件发生变化的操作提交到文件系统后,文件系统可以将当前的全局事务ID加1,并且,将加1后的全局事务ID作为本次发生变化的文件的版本号,赋值给本次变化的文件的“版本号”属性。
例如,如图4中上边的图所示,终端设备中的文件A、文件B、文件C、文件D、文件E、文件F、文件G以及目录A的初始版本号为均为V1,全局事务ID的初始值为V1。
第一次文件发生改变,即文件A、文件E和文件F以及目标A发生改变后,全局事务ID更新为V2,且如图4中间的图所示,文件A、文件E和文件F的“版本号”属性更新为V2。
第二次文件发生改变,即文件D发生改变后,全局事务ID更新为V3,且如图4下边的图所示,文件D的“版本号”属性更新为V3。
可选地,当终端设备确定待备份数据时,可以通过以下方式实现:根据终端设备当前存储的文件的“版本号”属性,将该文件中,版本号小于和等于当前全局事务ID的文件作为增量文件。该增量文件即为当前终端设备的待备份数据。
以图4为例,若当前终端设备首次进行数据备份,当前的全局事务ID为V3,由于是首次备份,则当前终端设备中的所有文件都是增量文件,即文件A、文件B、文件C、文件D、文件E、文件F和目录A中的文件都是待备份数据。
当然,也可以通过其他方式来准备当前待备份的应用中需要备份的数据,本申请实施例对此不做限定。例如,可以将此时终端设备上所有应用的所有文件中的数据作为待备份数据。
以图5为例,首次备份结束后,每次有文件发生变化时,例如,有文件增加了数据或有文件中的数据被修改时,在文件发生变化的操作提交到文件系统后,文件系统可以将当前的全局事务ID加1,并且,将加1后的全局事务ID作为本次发生变化的文件的版本号,赋值给本次变化的文件的“版本号”属性。
例如,文件C和文件D发生改变后,如图5中间的图所示,全局事务ID更新为V4,且,文件C和文件D的“版本号”属性更新为V4。
新增文件H后,如图5下边的图所示,全局事务ID更新为V5,且如图5下边的图所示,文件D的“版本号”属性更新为V5。
如图5,若上一次备份时对应的全局事务ID为V3,当前全局事务ID更新为V5,文件C、文件D和文件H的“版本号”大于上一次备份时对应的全局事务ID V3,且小于或等于当前的全局事务ID V5,则终端设备的待备份数据可以是文件C、文件D和文件H。
S320,在第一时刻,确定第一数据。其中,该第一时刻位于备份周期内,且该第一时刻位于备份周期的待备份数据的结算时刻之前。
备份周期可以指终端设备预先设置的备份周期。例如,终端设备可以预先设置每隔七天备份进行一次数据备份,即备份周期可以为七天。此处的备份周期为七天应该理解为该备份周期至少为七天,比如,当与上一备份周期中预设数据备份完成时刻相隔为七天时,终端设备由于不满足备份条件或其他原因无法进行数据备份时,则此时的备份周期大于七天。
第一时刻位于备份周期内是指第一时刻为备份周期中的一个时刻。例如,备份周期为七天时,第一时刻可以是这七天中的一个时刻,例如,第二天中的早上十点。
备份周期的待备份数据的结算时刻是该备份周期内预先设置的数据备份时刻,终端设备在待备份数据的结算时刻对每个备份周期内的待备份数据进行备份,应理解,每个备份周期内都会有一个预先设置的数据备份时刻,当终端设备预先设置每隔(至少)七天进行 一次预设的数据备份时,则相邻的两个待备份数据的结算时刻也相隔(至少)七天。
第一时刻位于备份周期的待备份数据的结算时刻之前是指第一时刻不是在备份周期中预先设置的数据备份时刻。例如,终端设备根据预设的备份周期在第一个星期一早上十点完成了一次备份数据,若备份周期为七天,则终端设备在第二个星期一的早上十点时,通常会进行一次预设的数据备份,第一时刻位于第一个星期一早上十点与第二个星期一早上十点之间,第一时刻也可以是第一个星期一早上十点,但不可以是该第二个星期一早上十点。该备份周期的待备份数据的结算时刻是指该备份周期中预先设置的数据备份时刻,即可以为上述第二个星期一的早上十点。
在第一时刻确定第一数据是指在第一时刻确定在预设的数据备份时刻之前可以增量预上传的数据。例如,备份周期为七天时,该第一时刻可以为备份周期中的某一时刻,比如,可以在这七天中的第二天的下午三点确定即将备份的数据。
应理解,在本申请实施例中,在预设的数据备份时刻之前可以进行至少一次数据的增量预上传,即在待备份数据的结算时刻之前可以存在至少一个第一时刻。
作为本申请实施例的一种可能的实现方式,可以将S311中得到的第三数据确定为第一数据,该第三数据是在第三时段需要发送的数据中在第三时段的结束时刻之前未完成发送的数据,该第三时段是上述第一时段的前一个用于发送待备份的数据的时段。
作为本申请实施例的另一种可能的实现方式,可以将S312中得到的第四数据确定为第一数据,该第四数据是在第一时段内终端设备所存储的数据相对于在第三时段内终端设备所存储的数据的增量数据,该第三时段是上述第一时段的前一个用于发送待备份的数据的时段。
可选地,终端设备上存储的各个数据可以通过其对应的元数据进行确定,元数据作为数据的特征值可以唯一地确定各个数据,这里的元数据可以包括该数据的名称、该数据的修改时间、该数据的大小和该数据的信息摘要算法第五版(Message Digest Algorithm 5,MD5)等。其中,数据的MD5可以为通过现有的MD5算法对该数据进行数学变换得到的一个128比特(bit)的特征值,本申请对于得到其MD5特征值的方式不做限定。
在本申请实施例中,终端设备可以根据当前存储的各个数据对应的元数据来确定待备份的增量数据,即第一数据。比如,作为示例而非限定,若两个数据的名称一样,修改时间一样,但大小不同,MD5特征值不同,则可以认为该两个数据不同;若两个数据的名称不同,修改时间不同,但大小相同,MD5特征值相同,则可以认为该两个数据相同。应理解,本申请也可以通过数据的其他属性值或特征值来确定待备份的增量数据,即通过数据的其他属性值或特征值来确定该数据是否发生变化,本申请对此不做限定。
可选地,终端设备也可以通过实时侦听操作系统或文件系统的指令来确定待备份的增量数据。比如,若终端设备监测到操作系统或文件系统当前的指令为对某一数据进行修改操作,则该发生变化数据为第一数据;若终端设备监测到操作系统或文件系统当前的指令为对某一数据进行删除操作,则该数据发生变化。
可选地,终端设备也可以先根据存储的数据得到各个数据对应的元数据;接下来将各个数据对应的元数据发送到服务器,服务器根据该各个数据对应的元数据与服务器当前已 经存储的各个数据的元数据进行比较,确定出终端设备当前的增量数据,并将该增量数据对应的元数据发送给终端设备,此时,终端设备可以根据该元数据确定第一数据。
可选地,终端设备可以根据存储的备份记录,将当前存储的数据的元数据与该终端设备上次备份完成时存储的数据元数据进行比较,将其相对于上次备份完成时存储的数据发生变化的部分确定为待备份的增量数据,即第一数据。
应理解,上文列举的用于确定第一数据的方式仅为示例,不应对本申请构成任何限定,本申请也不排除通过其他的方式来确定第一数据。
S330,在第一时段,向服务器发送第一数据。其中,该第一时段位于备份周期内,且该第一时段位于备份周期的待备份数据的结算时刻之前。
可选地,第一时刻可以为第一时段的起始时刻,也可以与第一时段的起始时刻之间具有一定间隔。
换个角度说,第一时刻确定好数据后,可以立即开始发送数据,也可以过段时间再发送数据。
第一时段位于备份周期的待备份数据的结算时刻之前是指第一时段的结束时刻在备份周期的待备份数据的结算时刻之前,也就是说,该第一时段位于该备份周期中预先设置的数据备份时刻之前。
作为本申请实施例一种可能的实现方式,第一时刻是第一时段的起始时刻的一种示例如下:备份周期为七天时,且在这七天中的第二天的下午三点确定即将备份的数据后,第一时段可以以该第二天的下午三点为起始时段。
作为本申请实施例另一种可能的实现方式,第一时刻与第一时段的起始时刻之间具有一定间隔的一种示例如下:备份周期为七天时,且在这七天中的第二天的下午三点确定即将备份的数据后,第一时段可以以第三天的上午八点为起始时刻。
本申请的方法中,在备份周期的结算时刻到达之前的第一时段就进行了一次待备份数据的预上传,可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,降低进行数据备份时发生异常的概率,提高备份的成功率。
在本申请实施例中,在备份周期的待备份数据的结算时刻之前,可以包括多个上述S320和S330的步骤,即在备份周期的待备份数据的结算时刻之前,可以存在多个时刻和时段,在该多个时刻中的每个时刻确定数据,并在每个时段发送该数据。
例如,本申请中在备份周期内,在第一时刻之前可以存在某一时刻及某一时段,在该时刻确定待备份数据,并在该时段发送该待备份数据;也可以在第一时刻与结算时刻之间存在另一时刻及另一时段,在该时刻确定待备份数据,并在该时段发送该待备份数据。
可选地,终端设备发送第一数据时,若第一数据未能在第一时段全部发送完毕,则终端设备可以配置第二中断标识,第二中断标识用于指示第一数据中在第一时段的结束时刻之前完成发送的最后一个数据。
例如,终端设备在满足预设的条件下发送第一数据的过程中,若终端设备检测到预设条件已经不满足,则终端设备可以停止发送第一数据,并生成第二中断标识,该第二终端标识指示第一数据中在停止发送之前最后一个发送成功的数据。
这样,终端设备可以在下一次进行备份时,例如终端设备下一次满足预设条件时,根据第二中断标识将第一时段中未发送成功的数据确定为将要备份的数据。
本申请实施例中,可选地,可以预设每次备份数据的最大时长,如果每次实际备份数据的时长超过该预设的最大时长,则可以停止此次数据备份。
例如,预设的最大备份时长为第一阈值时,若第一时段的时长大于或等于预设的第一阈值,则终端设备在备份时长到达第一阈值时,停止此次数据备份。这种情况下,在第一时刻确定的数据在第一时段没有全部发送完成,剩余没有发送的数据可以在下一次满足预设的条件时继续进行发送。
其中,终端设备可以生成相应的中断标识,用于指示第一时段中最后一个完成发送的数据。这样,下一次备份时,可以根据该中断标识确定需要发送的数据。
S340,确定终端设备的状态满足预设的条件。
可选地,在本申请实施例中,在待备份数据的结算时刻,终端设备可以在确定满足预设的条件时确定第二数据。也就是说,在确定第二数据之前,可以先确定终端设备的状态满足预设的条件。
具体而言,确定终端设备的状态满足预设的条件可以是指终端设备的状态满足以下至少一个条件:所述终端设备的网络连接状态为WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。这里的终端设备的屏幕状态为锁屏状态可以理解为该终端设备处于未使用状态,即用户在特定时段未对该终端设备进行任何操作。
可选地,用户也可以预先设置终端设备只要到了备份周期的结算时刻就确定第二数据,此时无论是否满足上述预设的条件,都会直接确定第二数据,并在对应的第二时段向服务器发送该第二数据。
S341,在备份周期的结算时刻,确定第二数据。
可选地,在本申请的备份方法中,还包括在备份周期的待备份数据的结算时刻,确定第二数据,该第二数据与第一数据不同。
在备份周期的结算时刻确定第二数据,这里的第二数据是指终端设备在备份周期内预设的时刻进行数据备份时需要备份的数据。
例如,当终端设备的备份周期预先设置为七天时,在备份周期的结算时刻确定第二数据,这里的第二数据是指终端设备每隔七天备份进行一次数据备份时,该终端设备确定的待备份数据。
S342,在第二时段,向服务器发送第二数据。其中,第二时段位于备份周期内,且第二时段可以是备份周期的待备份数据的结算时刻之后预设的数据备份时刻。
第二时段位于备份周期内,且第二时段是该备份周期的待备份数据的结算时刻之后的备份时段是指第二时段是备份周期中预设的数据备份时段,在第二时段发送的数据可以在该备份周期的待备份数据的结算时刻确定。
还以备份周期设置成七天为例,例如,终端设备设置了每隔七天备份进行一次数据备份,在备份周期的待备份数据的结算时刻确定需要在该备份周期进行备份的第二数据,在 第二时段发送该第二数据,在第二时段发送完第二数据的时刻该备份周期结束,也就是说,备份周期大于或等于七天(这个“七天”应该理解为第一时刻与结算时刻的间隔时间,用户可以设置,这里可以设置为至少七天)和第二时段的总时长。
应理解,第二时段的结束时刻与下一个备份周期的结算时刻可以间隔固定的时长,这里可以设置为至少七天。
例如,终端设备根据预设的备份周期在第一个星期一早上十点完成了一次备份数据,若备份周期可以为七天,则终端设备可以在第二个星期一的早上十点时,再进行一次数据备份。
本申请实施例中,可选地,可以预设每次备份数据的最大时长,如果每次实际备份数据的时长超过该预设的最大时长,则可以停止此次数据备份。
例如,预设的最大备份时长为第一阈值时,若第二时段的时长大于或等于预设的第一阈值,则终端设备在备份时长到达第一阈值时,停止此次数据备份。这种情况下,在结算时刻确定的数据在第二时段没有全部发送完成,剩余没有发送的数据可以在下一次满足预设的条件时继续进行发送。
从第二时段的结束时刻开始(也就是向服务器发送完第二数据的时刻),当前备份事务已结束,此时进入下一个备份周期。
在本申请实施例中,在当前备份事务结束时,终端设备可以将备份周期内记录的所有备份数据的信息发送给服务器,服务器根据该所有备份数据的信息创建备份记录。这里的备份数据的信息可以是指备份周期内完成备份的所有数据对应的元数据,也可以是其他任何可以表示该数据的特征值或信息。
进一步地,当用户后续希望恢复此次备份的数据时,可以根据服务器侧保存的备份记录确定此备份记录对应的所有数据,并将其发送到终端设备,以实现此次备份数据的恢复。
在本申请实施例中,终端设备在备份周期的结算时刻到达之前就进行了至少一次待备份数据的预上传,可以减少预设的数据备份时刻到达之际进行备份的数据量,从而可以缩短每次数据备份的时间,降低进行数据备份时发生异常的概率,提高备份的成功率。
从图3从描述的实施例可以看出,在本申请实施例中,终端设备在备份周期的结算时刻会进行一次数据备份,在备份周期的结算时刻之前可以进行至少一次数据备份,也就是说,终端设备在每个备份周期内至少会进行两次数据备份。
下面结合图6详细说明终端设备在备份周期内一次数据备份的一种示例性过程。图6中的数据备份过程可以为图3中备份周期内至少两次数据备份中的任何一次。
应理解,图6示出了该备份方法的步骤或操作,但这些步骤或操作仅是示例,本申请实施例还可以执行其他操作或者图6中的各个操作的变形。此外,图6中的各个步骤可以按照与图6呈现的不同的顺序来执行,并且有可能并非要执行图6中的全部操作。
S601,获取上一次备份事务的状态。
上一次备份事务可以包括上一次备份事务ID和事务清单。事务清单中可以包括上一次备份事务的状态。
应理解,上一次备份事务与终端设备的上一次数据备份对应,包括备份事务标识ID和 事务清单,该备份事务ID可以唯一地确定上一次数据备份。
应理解,事务清单中可以以数据(文件)目录为单位记录数据,可以以文件夹为单位记录数据,也可以以应用为单位记录数据。
作为示例而非限定,图6中以应用为单位记录数据。
可选地,事务清单中可以记录上一次备份事务中各应用备份状态为成功或失败。具体地,事务清单可以记录上一次备份事务各应用备份状态为“准备数据失败”或“上传数据失败”。若应用备份状态不为“准备数据失败”或“上传数据失败”,则可以说明该应用在上一次备份事务中还未处理。
S602,上一次备份事务是否完成。
根据事务清单中上一次备份事务的状态判断上一次数据备份是否成功。若上一次备份事务的状态为成功,则执行S603,否则执行S604。
S603,开始新的备份事务。
由于上一次数据备份已完成,可以创建一个新的备份事务,包括新的备份事务ID,新的备份事务ID与本次数据备份对应。同时,可以清空事务清单中保存的上一次备份事务的数据。
S604,准备本次备份事务的事务清单。
可选地,确定本次需要向服务器备份的应用及各待备份应用中需要备份的数据,将其记录在本次备份事务的事务清单中。
S605,备份第一个应用。
可选地,将事务清单中记录的、本次需要向服务器备份的应用中的一个应用确定为当前应用。本申请对确定各应用备份顺序的方法不做限定。
S606,上一次备份事务是否已经过期。
当上一次备份事务的状态为失败时,判断上一次备份事务是否已经过期,若过期,执行S607;否则,执行S610。
作为本申请实施例一种可能的实现方式,上述备份事务过期可以是指从开始该备份事务起,其总用时已超过预设的时长门限,但还未完成,此时可以称该备份事务过期。例如,可以将该时长门限设置为5天,在备份周期内第一天中午12点开始备份事务,在备份过程中发生中断,导致到第五天中午12点时此次备份事务还未完成。此时,该备份事务的总用时超过5天,即已超过预设的时长门限,则该备份事务已过期。
S607,终止上一次备份事务。
当上一次备份事务过期时,可以清空上一次备份事务的事务ID和事务清单。
S608,清理云端数据。
删除上一次备份事务中断时,终端设备正在向云端但未发送完的数据,也就是上一次数据备份中该终端设备只发送了部分的数据。应理解,这里的云端也就是存储待备份数据的服务器。
S609,删除终端侧存储的临时数据。
此时,可以删除上一次备份事务中,终端设备存储的临时数据,然后执行S603,开始 新的备份事务。
S610,继续执行上一次备份事务。
当上一次备份事务未过期时,可以根据第一中断标识确定上一次备份事务发生中断的位置,从而确定本次备份事务中需要处理或备份的数据,然后继续执行上一次备份事务中未完成的步骤。这里的第一中断标识可以理解为事务清单中记录的上一次备份事务中未处理的数据或未完成的步骤。
S611,准备数据是否完成。
判断上一次备份事务发生中断时,可以根据事务清单确定上一次备份事务中正在进行备份的应用是否已完成准备数据。若事务清单中的应用备份状态为为“准备数据失败”,则执行S612;若为“上传数据失败”,则执行S614。
S612,准备应用数据。
若上一次备份事务已完成,可以根据第一更新标识确定当前应用中需要备份的数据,并将其保存在事务清单中。第一更新标识可以用于指示终端设备在上一次备份事务开始的时刻存储的数据的更新版本,这里的更新版本可以用于指示终端设备所存储的数据的“版本号”。
可选地,当前应用中需要备份的数据可以为当前时刻终端设备中该应用存储的数据相对于上一次备份事务开始的时刻该应用存储的数据的增量数据。
若上一次备份事务中数据准备未完成,可以根据第一中断标识确定上一次备份事务中断时正在准备数据的应用。将此应用确定为当前应用,然后继续准备该应用中需要备份的数据。这里的第一中断标识可以理解为事务清单中记录的上一次备份事务中断时正在准备数据的应用。
S613,准备数据是否成功。
判断准备当前应用中需要备份的数据是否成功。若成功,执行S614;否则,执行S619。
S614,上传应用数据。
向服务器上传当前应用中需要备份的数据。
S615,上传应用数据是否成功。
判断当前应用中需要备份的数据是否已经全部上传至服务器。若是,执行S616;否则,执行S621。
S616,在事务清单中保存当前应用备份状态为成功。
若当前应用的数据备份已完成,可以在事务清单中保存此应用的备份状态为成功。
S617,本次备份事务是否结束。
判断终端设备本次备份事务中的应用是否全部备份成功。若是,则可本次备份事务的状态为成功,然后结束本次备份事务;否则,执行S618。
S618,备份下一个应用。
将本次备份事务中还未备份的应用中的一个应用确定为当前应用,执行S612。
S619,在事务清单中保存当前应用备份状态为准备数据失败。
在当前备份事务的事务清单中记录当前应用的应用备份状态为“准备数据失败”。
S620,清理当前备份事务中终端侧存储的临时数据。
此时,可以删除当前备份事务中,终端设备存储的临时数据。
S621,在事务清单中保存当前应用备份状态为上传数据失败。
在当前备份事务的事务清单中记录当前应用的应用备份状态为“上传数据失败”,也就是说,当前应用准备数据成功,但上传数据失败。
可选地,当下一次终端设备的状态满足预设的条件时,可以执行图6中描述的方法。
图7是本申请实施例提供的终端设备700的示意性框图。如图7所示,该终端设备700可以包括确定模块710和发送模块720。
作为一种示例,确定模块710可以为图1所示的终端设备100的处理器180,发送模块720可以为图1所示的终端设备100中的RF电路110。
确定模块710,用于在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前。
发送模块720,用于在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述第一时刻之后,所述备份周期的待备份数据的结算时刻之前。
可选地,所述确定模块还用于在所述备份周期的待备份数据的结算时刻,确定第二数据,所述第二数据与所述第一数据相异。
所述发送模块还用于在第二时段,向服务器发送所述第二数据,所述第二时段位于所述备份周期的待备份数据的结算时刻之后。
可选地,在第二种可能的实现方式中,在确定第一数据之前,所述确定模块还用于确定所述终端设备的状态满足以下至少一个条件:所述终端设备的网络连接状态为无线保真WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。
可选地,所述确定模块具体用于:确定第三数据,所述第三数据是在第三时段需要发送的数据中在所述第三时段的结束时刻之前未完成发送的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将所述第三数据确定为所述第一数据。
可选地,所述确定模块具体用于根据第一中断标识,确定所述第三数据,所述第一中断标识用于指示在第三时段需要发送的数据中在所述第三时段的结束时刻之前完成发送的最后一个数据,以及所述第三数据包括在第三时段需要发送的数据中位于所述第一中断标识所指示的数据之后的数据。
可选地,当所述第一数据未能在所述第一时段全部发送完毕时,所述确定模块还用于配置第二中断标识,所述第二中断标识用于指示所述第一数据中在所述第一时段的结束时刻之前完成发送的最后一个数据。
可选地,所述确定模块具体用于:确定第四数据,所述第四数据是在所述第一时段内所述终端设备所存储的数据相对于在第三时段内所述终端设备所存储的数据的增量数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;将所述第四数据确定为所述第一数据。
可选地,所述确定模块具体用于根据第一更新标识,确定所述第四数据,所述第一更新标识用于指示在第三时段内所述终端设备所存储的数据的更新版本,所述第四数据包括第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据,所述第二更新标识用于指示在所述第一时段内所述终端设备所存储的数据的更新版本。
可选地,所述确定模块还用于记录第二更新标识与所述第一时段的对应关系,所述第二更新标识用于指示在第一时段内所述终端设备所存储的数据的更新版本。
可选地,所述第一时段的时长小于或等于预设的第一阈值。
应理解,终端设备700可以用于执行前述任意一个备份数据的方法中由终端设备执行的步骤或操作,此处不再赘述。
应理解,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请各实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络 单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (22)

  1. 一种备份数据的方法,其特征在于,包括:
    在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前;
    在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述第一时刻之后,所述备份周期的待备份数据的结算时刻之前。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述备份周期的待备份数据的结算时刻,确定第二数据,所述第二数据与所述第一数据相异;
    在第二时段,向服务器发送所述第二数据,所述第二时段位于所述备份周期的待备份数据的结算时刻之后。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:在确定第一数据之前,确定终端设备的状态满足以下至少一个条件:
    所述终端设备的网络连接状态为无线保真WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述确定第一数据包括:
    确定第三数据,所述第三数据是在第三时段需要发送的数据中在所述第三时段的结束时刻之前未完成发送的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;
    将所述第三数据确定为所述第一数据。
  5. 根据权利要求4所述的方法,其特征在于,所述确定第三数据包括:
    根据第一中断标识,确定所述第三数据,所述第一中断标识用于指示在第三时段需要发送的数据中在所述第三时段的结束时刻之前完成发送的最后一个数据,以及所述第三数据包括在第三时段需要发送的数据中位于所述第一中断标识所指示的数据之后的数据。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述方法还包括:
    当所述第一数据未能在所述第一时段全部发送完毕时,配置第二中断标识,所述第二中断标识用于指示所述第一数据中在所述第一时段的结束时刻之前完成发送的最后一个数据。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述确定第一数据包括:
    确定第四数据,所述第四数据是在所述第一时段内所述终端设备所存储的数据相对于在第三时段内所述终端设备所存储的数据的增量数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段;
    将所述第四数据确定为所述第一数据。
  8. 根据权利要求7所述的方法,其特征在于,所述确定第四数据包括:
    根据第一更新标识,确定所述第四数据,所述第一更新标识用于指示在第三时段内所 述终端设备所存储的数据的更新版本,所述第四数据包括第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据,所述第二更新标识用于指示在所述第一时段内所述终端设备所存储的数据的更新版本。
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述方法还包括:
    记录第二更新标识与所述第一时段的对应关系,所述第二更新标识用于指示在第一时段内所述终端设备所存储的数据的更新版本。
  10. 根据权利要求1至9中任一项所述的方法,其特征在于,所述第一时段的时长小于或等于预设的第一阈值。
  11. 一种终端设备,其特征在于,包括:
    处理器,用于在第一时刻,确定第一数据,其中,所述第一时刻位于备份周期内,且所述第一时刻位于所述备份周期的待备份数据的结算时刻之前;
    发送器,用于在第一时段,向服务器发送所述第一数据,所述第一时段位于所述备份周期内,且所述第一时段位于所述第一时刻之后,所述备份周期的待备份数据的结算时刻之前。
  12. 根据权利要求11所述的终端设备,其特征在于,所述处理器还用于在所述备份周期的待备份数据的结算时刻,确定第二数据,所述第二数据与所述第一数据相异;
    所述发送器还用于在第二时段,向服务器发送所述第二数据,所述第二时段位于所述备份周期的待备份数据的结算时刻之后。
  13. 根据权利要求11或12所述的终端设备,其特征在于,在确定第一数据之前,所述处理器还用于确定所述终端设备的状态满足以下至少一个条件:
    所述终端设备的网络连接状态为无线保真WiFi连接状态、所述终端设备的充电状态为已连接充电器状态、所述终端设备的屏幕状态为锁屏状态以及所述终端设备的电池状态为剩余电量大于或等于预设电量值。
  14. 根据权利要求11至13中任一项所述的终端设备,其特征在于,所述处理器具体用于确定第三数据,所述第三数据是在第三时段需要发送的数据中在所述第三时段的结束时刻之前未完成发送的数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段,将所述第三数据确定为所述第一数据。
  15. 根据权利要求14所述的终端设备,其特征在于,所述处理器具体用于根据第一中断标识,确定所述第三数据,所述第一中断标识用于指示在第三时段需要发送的数据中在所述第三时段的结束时刻之前完成发送的最后一个数据,以及所述第三数据包括在第三时段需要发送的数据中位于所述第一中断标识所指示的数据之后的数据。
  16. 根据权利要求11至15中任一项所述的终端设备,其特征在于,当所述第一数据未能在所述第一时段全部发送完毕时,所述处理器还用于配置第二中断标识,所述第二中断标识用于指示所述第一数据中在所述第一时段的结束时刻之前完成发送的最后一个数据。
  17. 根据权利要求11至16中任一项所述的终端设备,其特征在于,所述处理器具体用于确定第四数据,所述第四数据是在所述第一时段内所述终端设备所存储的数据相对于 在第三时段内所述终端设备所存储的数据的增量数据,所述第三时段是所述第一时段的前一个用于发送待备份的数据的时段,将所述第四数据确定为所述第一数据。
  18. 根据权利要求17所述的终端设备,其特征在于,所述处理器具体用于根据第一更新标识,确定所述第四数据,所述第一更新标识用于指示在第三时段内所述终端设备所存储的数据的更新版本,所述第四数据包括第二更新标识所指示的更新版本对应的数据相对于所述第一更新标识所指示的更新版本对应的数据的增量数据,所述第二更新标识用于指示在所述第一时段内所述终端设备所存储的数据的更新版本。
  19. 根据权利要求11至18中任一项所述的终端设备,其特征在于,所述处理器还用于记录第二更新标识与所述第一时段的对应关系,所述第二更新标识用于指示在第一时段内所述终端设备所存储的数据的更新版本。
  20. 根据权利要求11至19中任一项所述的终端设备,其特征在于,所述第一时段的时长小于或等于预设的第一阈值。
  21. 一种计算机可读存储介质,包括指令,当其在终端设备上运行时,使得所述终端设备执行如权利要求1至10中任一项所述的方法。
  22. 一种芯片系统,其特征在于,包括:
    处理器,用于从存储器调用并运行计算机程序,使得安装有所述芯片系统的设备执行如权利要求1至10中任一项所述的方法。
PCT/CN2019/093963 2018-07-30 2019-06-29 备份数据的方法和终端设备 WO2020024748A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810895711.8 2018-07-30
CN201810895711.8A CN110784499B (zh) 2018-07-30 2018-07-30 备份数据的方法和终端设备

Publications (1)

Publication Number Publication Date
WO2020024748A1 true WO2020024748A1 (zh) 2020-02-06

Family

ID=69232181

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/093963 WO2020024748A1 (zh) 2018-07-30 2019-06-29 备份数据的方法和终端设备

Country Status (2)

Country Link
CN (1) CN110784499B (zh)
WO (1) WO2020024748A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112052249A (zh) * 2020-08-27 2020-12-08 青岛聚好联科技有限公司 一种基于层级时间栅栏的增量数据管理的方法及装置
CN114721880B (zh) * 2022-05-19 2022-09-09 中诚华隆计算机技术有限公司 任务恢复方法、soc芯片及电子设备
CN115276699B (zh) * 2022-07-13 2024-04-26 读书郎教育科技有限公司 一种可数据对齐记录的分体式设备及方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030156A (zh) * 2006-03-03 2007-09-05 国际商业机器公司 用于数据备份的装置和方法
CN103399795A (zh) * 2013-06-28 2013-11-20 贵阳朗玛信息技术股份有限公司 通讯录同步方法及装置
CN103678042A (zh) * 2013-12-25 2014-03-26 上海爱数软件有限公司 一种基于数据分析的备份策略信息生成方法
CN103929480A (zh) * 2014-04-11 2014-07-16 北京智谷睿拓技术服务有限公司 基于任务的数据备份方法及数据备份装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064730A (zh) * 2006-09-21 2007-10-31 上海交通大学 计算机网络数据文件本地和远程的备份方法
CN102541940A (zh) * 2010-12-31 2012-07-04 上海可鲁系统软件有限公司 一种工业数据库数据完整性管控方法
CN103425552B (zh) * 2013-08-29 2015-12-02 江苏省邮电规划设计院有限责任公司 一种数据备份的设备、系统和方法
US9852026B2 (en) * 2014-08-06 2017-12-26 Commvault Systems, Inc. Efficient application recovery in an information management system based on a pseudo-storage-device driver
CN105446828B (zh) * 2014-09-30 2019-05-31 北京金山云网络技术有限公司 一种数据库备份、恢复方法、装置及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030156A (zh) * 2006-03-03 2007-09-05 国际商业机器公司 用于数据备份的装置和方法
CN103399795A (zh) * 2013-06-28 2013-11-20 贵阳朗玛信息技术股份有限公司 通讯录同步方法及装置
CN103678042A (zh) * 2013-12-25 2014-03-26 上海爱数软件有限公司 一种基于数据分析的备份策略信息生成方法
CN103929480A (zh) * 2014-04-11 2014-07-16 北京智谷睿拓技术服务有限公司 基于任务的数据备份方法及数据备份装置

Also Published As

Publication number Publication date
CN110784499B (zh) 2021-08-20
CN110784499A (zh) 2020-02-11

Similar Documents

Publication Publication Date Title
CN107402835B (zh) 应用程序的异常处理方法、装置及存储介质和移动终端
WO2020024748A1 (zh) 备份数据的方法和终端设备
EP3499918B1 (en) Data sharing method and terminal
US11082906B2 (en) Terminal behavior triggering method and terminal based on environment parameter and terminal status parameter
CA2441118A1 (en) Personal electronic device
CN106658753B (zh) 一种数据迁移方法及终端设备
CN106507269B (zh) 一种数据迁移方法及终端设备
WO2018049901A1 (zh) 数据迁移方法及相关设备
WO2019019952A1 (zh) 文件夹发送方法、发送终端、接收终端以及存储介质
CN103279288A (zh) 数据传输方法、装置和终端设备
WO2018010596A1 (zh) 一种模式切换方法及装置
US20200310771A1 (en) Application Processing Method for Terminal Device, and Terminal Device
WO2018049904A1 (zh) 数据迁移方法及相关设备
WO2018049971A1 (zh) 热点网络切换方法及终端
CN108021298B (zh) 利用剪切板粘贴信息的方法及装置
WO2021115254A1 (zh) 可穿戴设备的控制方法和装置、电子设备、可读存储介质
CN104793879B (zh) 终端设备上的对象选择方法和终端设备
CN113609107A (zh) 数据库管理方法、装置、电子设备及存储介质
CN106484563B (zh) 一种数据迁移方法及终端设备
WO2020001190A1 (zh) 应用程序界面显示方法、装置、可读存储介质及移动终端
WO2020015415A1 (zh) 一种终端重启方法及装置
WO2024159968A1 (zh) 数据存储的校验方法、装置、电子设备及存储介质
WO2018068327A1 (zh) 一种终端的亮屏时长调整方法及终端
US11147038B2 (en) Notification message processing method and terminal
CN106371896B (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: 19845533

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19845533

Country of ref document: EP

Kind code of ref document: A1