WO2015117276A1 - 一种数据备份方法及装置 - Google Patents
一种数据备份方法及装置 Download PDFInfo
- Publication number
- WO2015117276A1 WO2015117276A1 PCT/CN2014/071913 CN2014071913W WO2015117276A1 WO 2015117276 A1 WO2015117276 A1 WO 2015117276A1 CN 2014071913 W CN2014071913 W CN 2014071913W WO 2015117276 A1 WO2015117276 A1 WO 2015117276A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- database
- backup
- backup file
- read
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000012544 monitoring process Methods 0.000 claims abstract description 60
- 238000004891 communication Methods 0.000 abstract description 8
- 230000003993 interaction Effects 0.000 description 18
- 238000011084 recovery Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 8
- 230000008859 change Effects 0.000 description 7
- 230000004044 response Effects 0.000 description 6
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/273—Asynchronous replication or reconciliation
Definitions
- the present invention relates to the field of communications, and in particular, to a data backup method and apparatus.
- FIG. 1 it is a flowchart of a data backup method in the prior art.
- the second terminal sends a backup request to the first terminal.
- the first terminal traverses the database that the second terminal requests to back up, for example, an address book database and a short message database, and reads the address book database and the short message database item by item.
- Data, and data is sent to the second terminal item by item, as shown in Figure 1, for example, m address records are to be read m times, and sent to the second terminal m times, n items of text messages need to be read n times, and The second terminal sends n times, and the second terminal aggregates all the received data to generate a backup file.
- the first terminal is a mobile terminal, and the second terminal is a personal computer; the address book database and the short message database shown in FIG. 1 are stored in the first terminal, and FIG. 1 is only for a clearer description of the data backup process, and the address book is The database and SMS database are represented separately from the first terminal.
- the first terminal after receiving the backup request sent by the second terminal, the first terminal reads the data of the database requested by the second terminal and sends it to the second terminal item by item, resulting in the first terminal and the second terminal.
- the terminals There are many interactions between the terminals, which results in a slow backup speed, and the first terminal and the second terminal interact with each other for a long time to prevent the second terminal from performing other services, which affects the overall service efficiency of the second terminal.
- Embodiments of the present invention provide a data backup method and apparatus, which improve the speed of data backup and improve overall service efficiency.
- the technical solution adopted by the embodiment of the present invention is the first aspect.
- the embodiment of the present invention provides a data backup method, including: reading data of at least one database;
- Backing up data of the at least one database generating at least one backup file; monitoring whether data of the at least one database changes; updating the at least one backup file when data of the at least one database changes;
- the updated at least one backup file is sent to the second terminal.
- the monitoring, whether the data of the at least one database is changed includes: reading data of the at least one database according to a preset time interval; Comparing data of the at least one database read by the preset time interval with data of the at least one backup file;
- updating the at least one backup file includes:
- the data of the at least one database read by the preset time interval is replaced with the data of the at least one backup file.
- updating the at least one backup file further includes:
- the data of the at least one database read by the preset time interval is inconsistent with the data of the at least one backup file, or the data of the at least one database read by the preset time interval is greater than
- the at least one backup file has less data, and the data of the at least one database read by the preset time interval is replaced with the data of the at least one backup file.
- the backup request includes a database identifier that requests backup
- the backup request includes a predefined identifier
- the embodiment of the present invention provides a data backup apparatus, including: a reading module, configured to read data of at least one database; and a backup module, configured to read the at least one database according to the reading module Data, backing up data of the at least one database, generating at least one backup file; a monitoring module, configured to monitor whether data of the at least one database is changed; and an update module, configured to: when the monitoring module detects data changes of the at least one database, update the at least one backup file; Receiving a backup request; the sending module, configured to send the updated at least one backup file to the second terminal according to the backup request received by the receiving module.
- the reading module is further configured to: read data of the at least one database according to a preset time interval; And comparing: the data of the at least one database read by the reading module according to the preset time interval and the data of the at least one backup file; determining, according to the comparison result, whether the data of the at least one database is changed.
- the updating module is specifically configured to: when determining that the monitoring module detects that the reading module is based on a pre- Setting the data of the at least one database read at intervals, when there is increased data relative to the data of the at least one backup file; adding the added data to the at least one backup file; or The reading module replaces data of the at least one backup file according to data of the at least one database read at a preset time interval.
- the update module is further configured to: when it is determined that the monitoring module detects that the data of the at least one database read by the reading module according to the preset time interval is inconsistent with the data of the at least one backup file, or The monitoring module determines that the data of the at least one database read by the reading module according to the preset time interval is less than the data of the at least one backup file.
- the backup request includes a database identifier that requests backup;
- the sending module is specifically configured to: send, according to the database identifier in the backup request, the updated at least one backup file corresponding to the database identifier to the second terminal.
- the backup request includes a predefined identifier, in combination with any one of the second possible implementation manners of the second aspect
- the sending module is specifically configured to: send the updated at least one backup file to the second terminal according to the predefined identifier in the backup request.
- the embodiment of the present invention provides a data backup terminal device, including: a processor, a memory, and a USB interface; the processor is configured to: read data of at least one database, and back up data of the at least one database, Generating at least one backup file, monitoring whether data of the at least one database changes, and when data of the at least one database changes, Resetting at least one backup file, and receiving a backup request by using the USB interface; sending, according to the backup request, the updated at least one backup file to the second terminal by using the USB interface; Data of the at least one database, and the at least one backup file, and operation instructions.
- the processor is further configured to: read data of the at least one database according to a preset time interval; compare the preset time interval Reading data of the at least one database and data of the at least one backup file;
- the processor is further configured to: when the data of the at least one database read by the preset time interval has increased data relative to data of the at least one backup file; adding the added data to The at least one backup file; or
- the data of the at least one database read by the preset time interval is replaced with the at least one backup file.
- the processor is further configured to: when the data of the at least one database read by the preset time interval is inconsistent with the data of the at least one backup file, or when the preset time interval is read
- the at least one database has less data than the at least one backup file, and the data of the at least one database read by the preset time interval is replaced with the at least one backup file.
- the backup request includes a database identifier that requests backup;
- the processor is further configured to: send, according to the database identifier in the backup request, the updated at least one backup file corresponding to the database identifier to the second terminal by using the USB interface.
- the backup request includes a predefined identifier;
- the processor is further configured to: send the updated at least one backup file to the second terminal by using the USB interface according to the predefined identifier in the backup request.
- An embodiment of the present invention provides a data backup method and apparatus, by reading data of at least one database in advance and generating at least one backup file, and updating the backup file when monitoring data of the database changes, so that the data of the backup file and the database are The data is consistent.
- the updated backup file is directly sent to the second terminal, and the backup file can be sent to the second terminal through one interaction, thereby reducing interaction with the second terminal, thereby improving
- the speed of data backup, and the second terminal can perform other services after completing an interaction, so that the overall service efficiency of the second terminal is improved, and the data of the prior art item-by-item reading database is solved and item by item
- the second terminal transmits, causing a large number of interactions between the first terminal and the second terminal, the backup speed is slow, and the first terminal and the second terminal interact for a long time to prevent the second terminal from performing other services, which affects the overall service efficiency of the second terminal. .
- FIG. 1 is a flowchart of a data backup method in the prior art
- FIG. 2 is a flowchart of a data backup method according to an embodiment of the present invention
- FIG. 3 is a schematic diagram of a database configuration item according to an embodiment of the present invention
- FIG. 4 is a structural diagram of a data backup device 40 according to an embodiment of the present invention
- FIG. 5 is a structural diagram of a data backup device 40 according to another embodiment of the present invention
- FIG. 6 is a structural diagram of a terminal device 50 for data backup according to an embodiment of the present invention.
- FIG. 2 is a flowchart of a data backup method according to an embodiment of the present invention.
- the data backup method in the embodiment of the present invention may be performed by a mobile terminal, a PAD tablet, or the like.
- the terminal for performing data backup according to the present invention is named as the first in the embodiment of the present invention.
- a terminal, the terminal that interacts with the first terminal is named as the second terminal, and the second terminal may be a terminal such as a personal computer or a host host.
- the following steps can be included:
- the first terminal reads data of at least one database.
- the first terminal reads the data of the at least one database, and the data of which database or the database is specifically read, may be configured in advance, and the pre-configuration may be performed in multiple manners, which is not limited in the embodiment of the present invention.
- a database configuration item can be set, and the first terminal determines the read database based on the input result of the user in the database configuration item. For example, if the user enters the address book database and the call record database in the database configuration item, the first terminal determines to read the data of the address book database and the call record database.
- the form of the database configuration item is not limited. For example, referring to FIG.
- the first terminal may set at least one database selection box in the database configuration item, and the user selects the selection box by Select at least one database.
- the first terminal may preset the read database in the factory settings.
- the first terminal may set a time for initially reading data of at least one database, for example, may be set to read data of at least one database after booting. This embodiment of the present invention does not limit this.
- the first terminal backs up data of the at least one database, and generates at least one backup file.
- the first terminal separately backs up the data in the read database to generate at least one backup file.
- the first terminal may generate a correspondence between the database and the backup file, and the correspondence between the database and the backup file includes a database identifier and a backup file identifier corresponding to the database identifier.
- the correspondence between the database and the backup file may be in the form of a table or other forms, which is not limited in this embodiment.
- Table 1 is a correspondence between a database and a backup file according to an embodiment of the present invention. Table 1
- the first terminal reads the data in the three databases of the database, the database B and the database C, and generates three backup files: the backup file S1, the backup file S2, and the backup file S3, wherein the database A corresponds to the backup.
- the file S 1 , the database B corresponds to the backup file S2
- the database C corresponds to the backup file S3.
- the backup file corresponding to the database is simply referred to as a backup file of the database.
- the backup file S 1 is referred to as a backup file of the database A
- the backup file corresponding to the address book database is referred to as a backup file of the address book database.
- the first terminal may store the generated at least one backup file in a backup folder, or store the generated at least one backup file on the storage medium of the first terminal.
- the first terminal stores the backup file S1, the backup file S2, and the backup file S3 in the backup folder S.
- the backup file S1, the backup file S2, and the backup file S3 are respectively stored in the storage medium of the first terminal. on.
- the backup file may be in the form of a compressed package, or may be in other forms, which is not limited by the embodiment of the present invention.
- the first terminal monitors whether data of the at least one database changes.
- the first terminal may read data of the at least one database according to a preset time interval, and perform data in at least one database read by the preset time interval and data in the at least one backup file.
- the item-by-item comparison determines whether the data of the at least one database is changed.
- the preset time interval may be preset by the first terminal according to the requirement, which is not limited by the embodiment of the present invention.
- at least one database data can be read according to a preset time interval.
- the comparison results are divided into the following four types:
- the first type the data of the at least one database read by the preset time interval is unchanged with respect to the data of the at least one backup file;
- the second type the at least one database read by the preset time interval Data, there is increased data relative to data of the at least one backup file;
- a third type data of the at least one database read by a preset time interval is inconsistent with data of the at least one backup file;
- the fourth type the data of the at least one database read by the preset time interval is less than the data of the at least one backup file.
- the following four types of comparison results are described below by taking the address book database as an example.
- the data of the backup file of the address book database contains four items of data, namely data 1, data 2, data 3 and data 4, each of which contains name, mobile At least one of attribute information such as a telephone number, a fixed telephone number, and the like.
- data 1, the data 2, the data 3, and the like in the embodiments of the present invention are only for the purpose of clearing the description of the embodiment, and do not limit the embodiment of the present invention.
- the data of the backup file is corresponding by the identifier.
- the data identified as "data 1" in the address book database corresponds to the data identified as "data 1" in the backup file of the address book database.
- the data of the at least one database read by the preset time interval, the data relative to the at least one backup file does not mean: the data of the at least one database read by the preset time interval, relative to at least one
- the number of items of data in the backup file and the attribute information of each item are identical. For example, suppose the data in the address book database read at the preset time interval is shown in Table 3.
- the data in the address book database read at the preset time interval contains four items of data, namely data 1, data 2, data 3 and data 4, each of which contains name, mobile phone number, landline telephone. At least one of attribute information such as a number. Compare the four items of data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item. According to Table 2 and Table 3, the data 1 and data 2 in Table 2 are known.
- the attribute information of the data 3 and the data 4 are the same as the attribute information of the data 1, the data 2, the data 3, and the data 4 in Table 3, respectively, so that the four data in the address book database read by the preset time interval are determined.
- the attribute information of the four data of the backup file of the address book database is completely the same, so it is determined that the data in the address book database read by the preset time interval is unchanged with respect to the data in the backup file of the address book database.
- the data of the at least one database read by the preset time interval, the data added with respect to the data of the at least one backup file refers to: at least one database data read by the preset time interval includes at least In addition to all the data of a backup file, it also contains data that is not in at least one backup file.
- the data in the address book database read at the preset time interval contains five items of data. Compare the five items in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item. According to Table 2 and Table 4, the data 1 and data 2 in Table 4 are known. The attribute information of the data 3 and the data 4 are the same as the attribute information of the data 1, the data 2, the data 3, and the data 4 in Table 2, respectively, and the data 5 not included in Table 2 is included in Table 4, so the preset time is determined.
- the data of the address book database read by the interval includes all the data of the backup file of the address book database, and the data not included in the backup file of the address book database, so the address book database read at the preset time interval is determined. Data, there is increased data relative to the data of the backup file of the address book database.
- the data of the at least one database read by the preset time interval and the data of the at least one backup file are inconsistent: the number of items of the data of the at least one database read by the preset time interval is greater than or equal to The number of items of data of the at least one backup file, and the attribute information of the at least one piece of data in the at least one database read by the preset time interval is not completely the same as the attribute information of the corresponding data in the at least one backup file.
- the data in the address book database read at the preset time interval contains four items of data. Compare the four items of data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item.
- the attribute information of the data 1 in Table 5 is The mobile phone number is different from the mobile phone number in the attribute information of the data 1 in Table 2, so it is determined that the data of the address book database read at the preset time interval is inconsistent with the data of the backup file of the address book database.
- the number of items of data in the database read at the preset time interval is greater than the number of items in the backup file of the database, but attribute information of at least one piece of data and attribute information of corresponding data in the backup file of the database
- the data of the database read at the preset time interval should not be considered to have increased data relative to the data of the backup file of the database, but the data of the database and the backup of the database should be considered as the preset time interval.
- the file data is inconsistent. For example: Assume that the data in the address book database read by the preset time interval is shown in Table 6.
- Data 4 Name: Zhao Liu Mobile Phone Number: 4444444444444
- Data 5 Name: Liu Yi Mobile Phone Number: 55555555555 According to Table 6, although Table 6 has more items than the data contained in Table 2, because of the movement of Data 1 in Table 6 The telephone number is different from the mobile phone number of data 1 in Table 2, so it is determined that the data of the address book database read at the preset time interval is inconsistent with the data of the backup file of the address book database.
- the data of the at least one database read by the preset time interval is less than the data of the at least one backup file: the number of items of the data of the at least one database read by the preset time interval is less than the The number of items of data for at least one backup file.
- the data in the address book database read by the preset time interval is shown in Table 7.
- Table 7 there are three items of data in the address book database read by the preset time interval. Compare the three data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item. Table 7 and Table 2 show that the communication is read at the preset time interval. Record data 1, data 2 and data 3 in the database The attribute information of the data 1, data 2, and data 3 in the backup file of the address book database are the same, and the address book database read in the preset time interval does not include the data in the backup file of the address book database 4, so , Determine that the data in the address book database read at the preset time interval is less than the data in the backup file in the address book.
- the at least one backup file may be updated by using different update manners.
- the first terminal monitors data of the at least one database read by a preset time interval, and when there is increased data relative to data of the at least one backup file, the added data may be added to the at least one backup. Or; replacing data of the at least one database read by the preset time interval with data of the at least one backup file.
- the address book database is still used as an example here. For example, if the data of the backup file of the address book database is data 1, data 2, data 3, and data 4, the data of the address book database read at the preset time interval is data 1, data 2, data 3, data 4, and data.
- the data of the address book database read at the preset time interval is the data 5 compared with the data of the backup file of the address book database, and the data 5 can be directly added to the backup file of the address book database, or the data 1 can also be used.
- Data 2, Data 3, Data 4, and Data 5 replace Data 1, Data 2, Data 3, and Data 4 in the backup file of the Address Book database.
- the first terminal detects that the data of the at least one database read by the preset time interval is inconsistent with the data of the at least one backup file; or the at least one database read by the preset time interval.
- the data of the at least one backup file is less than the data of the at least one backup file, the data of the at least one database read by the preset time interval is replaced with the data of the at least one backup file.
- the address book database is still used as an example here.
- the data of the backup file of the address book database is data 1, data 2, data 3, and data 4
- the data of the address book database read at the preset time interval is data 1, data 2, data 3, and data 4
- the data 1, data 2, and data of the address book database read at the preset time interval will be read.
- 3 and Data 4 replace Data 1, Data 2, Data 3, and Data 4 in the backup file of the Address Book database.
- the data of the backup file of the address book database is data 1, data 2, data 3, and data 4
- the data of the address book database read at the preset time interval is data 1, data 2, data 3, and data 5
- the data data 1, data 2, data 3, and data 5 of the address book database read at the preset time interval are replaced with data 1, data 2, data 3, and data 4 in the backup file of the address book database.
- the data of the backup file of the address book database is data 1, data 2, data 3, and data 4
- the data of the address book database read at the preset time interval is data 1, data 2, and data 3
- the first terminal When receiving the backup request, the first terminal sends the updated at least one backup file to the second terminal.
- the backup request may include a database identifier or a predefined identifier that requests the backup.
- a one-key backup can be performed, and the first terminal sends all backup files to the second terminal.
- the first terminal generates and updates the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C according to steps 201-204, when the first terminal receives the predefined identifier,
- the second terminal sends the updated backup file S1 of database A, the backup file S2 of database B, and the backup file S3 of database c.
- the first terminal sends the database identifier requesting the backup to the second terminal according to the correspondence between the database and the backup file.
- the corresponding backup file For example, the first terminal generates and updates the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C according to steps 201-204, if the backup request includes the identifier of the database A and the identifier of the database B. Then, the first terminal sends the updated backup file S1 of the database A and the updated backup file S2 of the database B to the second terminal.
- the following steps 1) - 4) may be further included to recover data of the database.
- the first terminal needs to be formatted, and the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C are sent to the second terminal by using step 201 - step 205 before formatting.
- the terminal stores the received backup file S1, the backup file S2, and the backup file S3.
- the backup file S1 sent to the second terminal may be utilized. Restoring the data of database A; if the data of database B is damaged or lost, the data of database B can be recovered by using backup file S2 sent to the second terminal. If the data of database C is damaged or lost, it can be sent to the first
- the backup file S3 of the second terminal recovers the data of the database C, which can be implemented by the following steps 1) - 4).
- the first terminal receives the recovery request sent by the second terminal and the at least one backup file.
- the second terminal may send all the backup files received by the second terminal to the first terminal, or the second terminal may send the partial backup file received by the second terminal to the first terminal, which is not performed by the embodiment of the present invention. Restriction, when the second terminal sends all the backup files received by the second terminal to the first terminal, one-key recovery can be implemented.
- the first terminal replaces the at least one backup file with the backup file in the first terminal.
- the backup file of the database A is replaced with the backup file S1 of the database A stored in the first terminal.
- the first terminal sends a first response message to the second terminal to notify the second terminal that the recovery task has been completed.
- the first terminal may send a first response message to the second terminal to notify the second terminal that the recovery task is completed, so that the second terminal may For other operations, the speed of data recovery is improved without waiting for a long period of data recovery.
- the first terminal reads the data in the backup file and writes the read data to the database.
- the first terminal after transmitting the first response message, the first terminal reads the data in the backup file by using the idle time of the first terminal, and writes the data in the backup file according to the correspondence between the backup file and the database.
- database The embodiment of the present invention provides a data backup method.
- the first terminal reads the data of at least one database in advance and generates at least one backup file, and updates the backup file when the data of the database changes, so that the data and database of the backup file are made. The data is consistent.
- the updated backup file is directly sent to the second terminal, and the backup file can be sent to the second terminal through one interaction, thereby reducing the interaction with the second terminal, and further
- the speed of data backup is improved, and the second terminal can perform other services after completing one interaction, so the overall service efficiency of the second terminal is improved.
- the prior art reads the data of the database that needs to be backed up item by item and sends the data to the second terminal item by item, which causes the first terminal and the second terminal to have more interactions, the backup speed is slow, and the first terminal and the second terminal are long.
- the time interaction hinders the second terminal from performing other services, which affects the defect of the overall service efficiency of the second terminal.
- FIG. 4 is a structural diagram of a data backup apparatus 40 according to an embodiment of the present invention.
- the data backup device 40 may be a mobile terminal such as a mobile phone or a PAD tablet.
- the terminal that interacts with the data backup device 40 is named as the second terminal, and the second terminal may be a terminal such as a personal computer or a host host.
- the data backup device 40 includes: a reading module 401, a backup module 402.
- the reading module 401 is configured to read data of at least one database. Exemplarily, the reading module 401 can determine the read database according to the input result of the database configuration item of the data backup device 40.
- the reading module 401 reads the data of the address book database and the call record database.
- the embodiment of the present invention does not limit the form of the database configuration item of the data backup device 40.
- FIG. 3 it is a schematic diagram of a database configuration item, including at least one database selection box, which the user can pass. Select at least one database by checking the selection box.
- the reading module 401 can also read data of at least one database according to a database preset in a factory setting of the data backup device 40.
- the backup module 402 is configured to back up data of the at least one database according to the data of the at least one database read by the reading module 401, and generate at least one backup file.
- the backup module 402 can generate a correspondence between the database and the backup file, and the correspondence between the database and the backup file includes a database identifier and a backup file identifier corresponding to the database identifier.
- the correspondence between the database and the backup file may be in the form of a table or other forms, which is not limited in this embodiment. For example, refer to Table 1, which is a correspondence between a database and a backup file generated by the backup module 402 provided by the embodiment of the present invention.
- the reading module 401 reads the data in the three databases of the database A, the database B, and the database C, and the backup module 402 generates three backup files: the backup file S1, the backup file S2, and the backup file S3.
- the database A corresponds to the backup file S1
- the database B corresponds to the backup file S2
- the database C corresponds to the backup file S3.
- the backup file corresponding to the database is simply referred to as a backup file of the database.
- the backup file S 1 is referred to as a backup file of the database A
- the backup file corresponding to the address book database is referred to as a backup file of the address book database.
- the backup file may be in the form of a compressed package, or may be in other forms, which is not limited by the embodiment of the present invention.
- the monitoring module 403 is configured to monitor whether data of the at least one database changes.
- the updating module 404 is configured to update the at least one backup file when the monitoring module 403 monitors data changes of the at least one database.
- the receiving module 405 is configured to receive a backup request.
- the sending module 406 is configured to send, according to the backup request received by the receiving module 405, the updated at least one backup file to the second terminal. Further, the reading module 401 is further configured to read data of the at least one database according to a preset time interval.
- the monitoring module 403 is specifically configured to: compare data of the at least one database and the data of the at least one backup file that are read by the reading module 401 according to a preset time interval; and determine the at least one according to the comparison result. Whether the data of the database changes.
- the data of the at least one database is compared with the data of the at least one backup file according to the preset time interval of the reading module 401, and the monitoring results of the monitoring module 403 are classified into the following four types:
- the monitoring module 403 monitors the data of the at least one database read by the reading module 401 at a preset time interval, and the data of the at least one backup file is unchanged;
- the second type the monitoring module 403 monitors the reading The data of the at least one database read by the module 401 at a preset time interval has increased data relative to the data of the at least one backup file;
- the third type the monitoring module 403 monitors the preset time interval of the reading module 401
- the data of the at least one database read is inconsistent with the data of the at least one backup file;
- the fourth type The monitoring module 403 monitors that the data of the at least one database read by the reading module 401 at a preset time interval is less than the data of the at least one backup file.
- the data of the backup file of the address book database generated by the backup module 402 is as shown in Table 2.
- the data of the backup file of the address book database generated by the backup module 402 is four items of data, namely data 1, data 2, data 3 and data 4, each of which contains a name, a mobile phone number, and a fixed telephone number. At least one of the attribute information.
- the data 1, the data 2, the data 3, and the like in the embodiments of the present invention are only for the purpose of clearing the description of the embodiment, and do not limit the embodiment of the present invention.
- the data of the backup file is corresponding by the identifier.
- the data identified as "data 1" in the address book database corresponds to the data identified as "data 1" in the backup file of the address book database.
- the monitoring module 403 determines the data of the at least one database read by the reading module 401 at a preset time interval, the number of items of data relative to the at least one backup file and the attribute information of each piece of data are completely the same, then the monitoring is determined to be read.
- the data in the database read by the module 401 at a preset time interval is unchanged from the data in the backup file of the database.
- the data in the address book database read by the reading module 401 at a preset time interval is as shown in Table 3.
- the data in the address book database read by the reading module 401 at a preset time interval is four items of data, namely data 1, data 2, data 3 and data 4, each of which contains a name, a mobile phone. At least one of attribute information such as a number, a fixed telephone number, and the like.
- the monitoring module 403 reads the number of contacts read by the reading module 401 at a preset time interval.
- the data is divided into two items according to Table 2 and Table 3.
- the data 1, data 2, data 3 and data in Table 2 are known.
- the attribute information of 4 is the same as the attribute information of data 1, data 2, data 3 and data 4 in Table 3, respectively, so the monitoring module 403 determines in the address book database read by the reading module 401 at a preset time interval.
- the four items of data are identical to the attribute information of the four items of the backup file of the address book database generated by the backup module 402. Therefore, the monitoring module 403 determines that the data in the address book database read by the reading module 401 at a preset time interval is relatively The data in the backup file of the address book database generated by the backup module 402 does not change.
- the monitoring module 403 determines that the data of the at least one database read by the reading module 401 at a preset time interval includes all the data of the at least one backup file, and the data that is not included in the at least one backup file, it is determined that the monitoring is read.
- the data of the at least one database read by the module 401 at a preset time interval has increased data relative to the data of the at least one backup file. For example, assume that the data in the address book database read by the reading module 401 at a preset time interval is as shown in Table 4. According to Table 4, the reading module 401 presets the time interval.
- the data in the address book database read includes five items of data.
- the monitoring module 403 compares the five items of data in the address book database read by the reading module 401 by the preset time interval with the four items of the backup file of the address book database generated by the backup module 402, according to Table 2 and the table. 4 It can be seen that the attribute information of Data 1, Data 2, Data 3 and Data 4 in Table 4 are the same as the attribute information of Data 1, Data 2, Data 3 and Data 4 in Table 2, respectively, and Table 2 contains Table 2 The data 5 is not included in the data. Therefore, the monitoring module 403 determines that the data of the address book database read by the reading module 401 at a preset time interval includes all the data of the backup file including the address book database, and the backup file of the address book database. There is no data in it, so the monitoring module 403 determines the data of the address book database read by the reading module 401 at a preset time interval, and there is increased data with respect to the data of the backup file of the address book database.
- the monitoring module 403 determines that the reading module 401 reads the preset time interval
- the number of items of the data of the at least one database is greater than or equal to the number of items of the data of the at least one backup file, and the attribute information of the at least one item of the at least one database read by the preset time interval and the at least one backup If the attribute information of the corresponding data in the file is not completely the same, it is determined that the data of the at least one database that is read by the reading module 401 at the preset time interval is inconsistent with the data of the at least one backup file. For example, assume that the data in the address book database read by the reading module 401 at a preset time interval is as shown in Table 5.
- the data in the address book database read by the reading module 401 at a preset time interval includes four items of data.
- the monitoring module 403 compares the four items of the data in the address book database read by the reading module 401 at a preset time interval with the four items of the backup file of the address book database item by item.
- Table 5 The mobile phone number in the attribute information of the data 1 is different from the mobile phone number in the attribute information of the data 1 in Table 2, so the monitoring module 403 determines the data and address book of the address book database read by the reading module 401 at the preset time interval.
- the data of the backup file of the database is inconsistent.
- the number of items of data in the database read by the reading module 401 at a preset time interval is greater than the number of items in the backup file of the database, but the attribute information of at least one piece of data corresponds to the backup file of the database. If the attribute information of the data is not completely the same, the monitoring module 403 determines that the data of the database read at the preset time interval is inconsistent with the data of the backup file of the database. For example: Assume that the data in the address book database read by the reading module 401 at a preset time interval is as shown in Table 6.
- Table 6 although Table 6 has more items than the data contained in Table 2, since the mobile phone number of Data 1 in Table 6 is different from the mobile phone number of Data 1 in Table 2, the monitoring module 403 determines to read.
- the data of the address book database read by the module 401 at the preset time interval is inconsistent with the data of the backup file of the address book database.
- the monitoring module 403 determines that the number of items of the data of the at least one database read by the reading module 401 at a preset time interval is less than the number of items of the data of the at least one backup file, determining to monitor the reading module 401 Setting the at least one of the time interval readings
- the data of the databases is less than the data of the at least one backup file. For example: Assume that the data in the address book database read by the reading module 401 at a preset time interval is as shown in Table 7. According to the table 7, the reading module 401 includes three items of data in the address book database read by the preset time interval.
- the monitoring module 403 compares the three items of data in the address book database read by the reading module 401 at a preset time interval with the four items of the backup file of the address book database item by item, as shown in Table 7 and Table 2, reading
- the data 1, the data 2, and the data 3 in the address book database read by the module 401 at the preset time interval are the same as the data information of the data 1, the data 2, and the data 3 in the backup file of the address book database, respectively, and the reading module is 401
- the address book database read by the preset time interval does not include the data 4 in the backup file of the address book database. Therefore, the monitoring module 403 determines that the data of the address book database read at the preset time interval is smaller than the backup file of the address book. Less data.
- the updating module 404 is specifically configured to: when it is determined that the monitoring module 403 detects data of the at least one database read by the reading module 401 according to a preset time interval, with respect to the at least one backup When the data of the file has increased data; adding the added data to the at least one backup file; or replacing the data of the at least one database read by the reading module 401 according to a preset time interval The data of the at least one backup file.
- the address book database is still used as an example here. For example, if the data of the backup file of the address book database is data 1, data 2, data 3, and data 4, the data of the address book database read by the reading module 401 at a preset time interval is data 1, data 2, and data 3.
- Data 4 and data 5 the data of the address book database read by the reading module 401 at a preset time interval is data 5 compared with the data of the backup file of the address book database, and the update module 404 can directly add the data 5 to the address book.
- Backup file of database you can also replace data 1, data 2, data 3 in the backup file of the address book database with data 1, data 2, data 3, data 4 and data 5.
- the updating module 403 is further configured to: when it is determined that the monitoring module 403 detects data of the at least one database and the at least one backup file that are read by the reading module 401 according to a preset time interval.
- the data is inconsistent, or when the monitoring module 403 determines that the data of the at least one database read by the reading module 401 according to the preset time interval is less than the data of the at least one backup file, the preset time is The data of the at least one database read at intervals is replaced with the data of the at least one backup file.
- the address book database is still used as an example here. For example, if the data of the backup file of the address book database is data 1, data 2, data 3, and data 4, the data of the address book database read by the reading module 401 at a preset time interval is data 1, data 2, data 3, and Data 4, but the reading module 401 presets the time interval to read the data in the database 1 and the data in the backup file of the address book database.
- the update module 404 replaces the data 1, data 2, data 3, and data 4 of the address book database read by the reading module 401 at a preset time interval with the data in the backup file of the address book database. , Data 2, Data 3, and Data 4.
- the data of the backup file of the address book database is data 1, data 2, data 3, and data 4
- the data of the address book database read by the reading module 401 at a preset time interval is data 1, data 2, and data 3.
- the update module 404 replaces the data data 1, the data 2, the data 3 and the data 5 of the address book database read by the reading module 401 at a preset time interval, and the data 1 and the data 2 in the backup file of the address book database.
- the data of the backup file of the address book database is data 1, data 2, data 3, and data 4
- the data of the address book database read by the reading module 401 at a preset time interval is data 1, data 2, and data 3.
- the update module 404 replaces the data 1, data 2, and data 3 of the address book database read by the reading module 401 at a preset time interval with the data 1, data 2, data 3, and data 4 in the backup file of the address book database.
- the sending module 406 is specifically configured to: send, according to the database identifier in the backup request, the database identifier corresponding to the database identifier Update at least one backup file.
- the backup module 402 When the backup request contains a predefined identifier, a one-key backup can be performed, and the sending module 406 sends all backup files to the second terminal.
- the backup module 402 For example, the backup module 402 generates three backup files, which are the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C.
- the update module 404 monitors the data change of the database A in the monitoring module 403.
- the backup file S1 is updated
- the backup file S2 is updated when the monitoring module 403 detects the data change of the database B
- the backup file S3 is updated when the monitoring module 403 detects the data change of the database C
- the receiving module 405 receives
- the sending module 406 sends the backup file S1, the backup file S2, and the backup file S3 updated by the update module 404 to the second terminal.
- the sending module 406 is specifically configured to: send the updated at least one backup to the second terminal according to the predefined identifier in the backup request file.
- the sending module 406 sends the backup file corresponding to the database identifier that requests the backup to the second terminal according to the correspondence between the database and the backup file.
- the backup module 402 generates three backup files, which are the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C.
- the update module 404 monitors the data change of the database A in the monitoring module 403.
- the backup file S1 is updated
- the backup file S2 is updated when the monitoring module 403 detects the data change of the database B
- the backup file S3 is updated when the monitoring module 403 detects the data change of the database C, if the backup request includes the database
- the sending module 406 sends the updated backup file S1 and the updated backup file S2 of the updated module 404 to the second terminal.
- the receiving module 405 is further configured to: receive a recovery request sent by the second terminal, and at least one backup file.
- the update module 404 is further configured to: replace the at least one backup file received by the receiving module 405 with the backup file in the first terminal.
- the sending unit 406 is further configured to: send a first response message to the second terminal, to notify the second terminal that the recovery task is completed.
- the reading module 401 is further configured to: read data in the backup file.
- the data backup device 40 further includes: a writing module 407, configured to write data of the backup file read by the reading module 401 into a database.
- the second terminal may send all the backup files received by the second terminal to the first terminal, or the second terminal may send the partial backup file received by the second terminal to the first terminal, which is not performed by the embodiment of the present invention. Restriction, when the second terminal sends all the backup files received by the second terminal to the first terminal, one-key recovery can be implemented.
- the sending unit 406 sends a first response message to the second terminal, to notify the second terminal that the recovery task has been completed, so that the second terminal can perform other operations (such as installing a mobile phone application, etc.), so that the second terminal does not need to wait for a long time.
- the process of time data recovery, the speed of data recovery has been improved.
- the embodiment of the present invention provides a data backup device 40.
- the backup module 402 generates at least one backup file according to data of at least one database read in advance by the reading module 401, and the update module 404 monitors when the data of the database changes when the monitoring module 403 detects
- the backup file is updated so that the data of the backup file and the data of the database are consistent.
- the sending module 406 directly sends the updated backup file to the second terminal, and sends the backup file through one interaction.
- the interaction with the second terminal is reduced, thereby improving the speed of data backup, and the second terminal can perform other services after completing an interaction, thereby improving the overall service efficiency of the second terminal.
- the prior art solves the data of the database that needs to be backed up item by item and sends it to the second terminal item by item, resulting in interaction with the second terminal. More, slower backups, and lower overall business efficiency.
- FIG. 6 is a schematic structural diagram of a terminal device 60 for data backup according to an embodiment of the present invention
- the data backup terminal device 60 includes: a processor 601, a memory 602, and a USB interface 603.
- At least one communication bus 604 is used to implement the connection and mutual communication between the devices;
- the processor 601 can be a central processing unit (English: central processing unit, abbreviated as CPU);
- the memory 602 can be a non-volatile memory (English: non-volatile memory), an example of a flash memory, a hard disk drive (English: flash memory), a hard disk (English: hard disk drive, abbreviation: HDD) or a solid state hard disk ( English: solid-state drive, abbreviation: SSD); or a combination of the above types of memory;
- the USB interface 603 is configured to perform data transmission between the external network element and the data line.
- the processor 601 is configured to read data of at least one database, back up data of the at least one database, generate at least one backup file, monitor whether data of the at least one database changes, and when the at least one database Updating the at least one backup file and receiving a backup request through the USB interface; and transmitting, according to the backup request, the updated at least one backup file to the second terminal according to the backup request; 602 is configured to store data of the at least one database, and the at least one backup file, and an operation instruction.
- the processor 601 can determine the read database according to the input result of the database configuration item of the terminal device 60 of the data backup.
- the processor 601 reads the data of the address book database and the call record database.
- the form of the database configuration item of the data backup terminal device 60 is not limited.
- FIG. 3 it is a schematic diagram of a database configuration item, including at least one database selection. With the box selected, the user can select at least one database by checking the selection box.
- the processor 601 can also read data of at least one database according to a database preset in a factory setting of the terminal device 60 of the data backup.
- the processor 601 can generate a correspondence between the database and the backup file, and the correspondence between the database and the backup file includes a database identifier and a backup file identifier corresponding to the database identifier.
- the correspondence between the database and the backup file may be in the form of a table or other forms, which is not limited in this embodiment. For example, refer to Table 1, which is a correspondence between a database and a backup file generated by the processor 601 according to an embodiment of the present invention.
- the processor 601 reads the data in the three databases of the database A, the database B, and the database C, and generates three backup files: the backup file S1, the backup file S2, and the backup file S3, wherein the database A Corresponding to the backup file S 1 , the database B corresponds to the backup file S2 , and the database C corresponds to the backup file S3 .
- the backup file corresponding to the database is simply referred to as a backup file of the database.
- the backup file S 1 is referred to as a backup file of the database A
- the backup file corresponding to the address book database is referred to as a backup file of the address book database.
- the processor 601 is further configured to: read data of the at least one database according to a preset time interval; compare data of the at least one database read by the preset time interval with the at least one Backing up data of the file; monitoring whether the data of the at least one database changes according to the comparison result.
- the processor 601 can read the data of the at least one database and the data of the at least one backup file according to the preset time interval, and divide the monitoring result into the following four types: The first type: the preset time interval The data of the at least one database read is unchanged with respect to the data of the at least one backup file; the second type: the data of the at least one database read by the preset time interval, relative to the at least one There is increased data in the data of the backup file; a third type: the data of the at least one database read by the preset time interval is inconsistent with the data of the at least one backup file;
- the fourth type the data of the at least one database read by the preset time interval is less than the data of the at least one backup file.
- the following describes the method for determining the four monitoring results by the processor 601 by taking the address book database as an example. Assume that the data of the backup file of the address book database generated by the processor 601 is as shown in Table 2. According to Table 2, the data of the backup file of the address book database generated by the processor 601 is four items of data, namely data 1, data 2, data 3 and data 4, each of which contains a name, a mobile phone number, a fixed telephone number. At least one of the attribute information.
- the data 1, the data 2, the data 3, and the like in the embodiments of the present invention are only for the purpose of clearing the description of the embodiment, and do not limit the embodiment of the present invention.
- the data of the backup file is corresponding by the identifier.
- the data identified as "data 1" in the address book database corresponds to the data identified as "data 1" in the backup file of the address book database.
- the processor 601 determines data of at least one database read by the preset time interval, the number of items of data relative to the at least one backup file and the attribute information of each piece of data are identical, determining that the preset time interval is read The data in the database is unchanged from the data in the backup file of the database.
- the data in the address book database read by the processor 601 at a preset time interval is four items of data, namely data 1, data 2, data 3, and data 4, each of which contains a name, a mobile phone number. , at least one of attribute information such as a fixed telephone number.
- the processor 601 compares four items of the data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item, according to Table 2 As can be seen from Table 3, the attribute information of Data 1, Data 2, Data 3, and Data 4 in Table 2 are the same as the attribute information of Data 1, Data 2, Data 3, and Data 4 in Table 3, respectively, so the processor 601 determines that the four items of data in the address book database read by the preset time interval are exactly the same as the attribute data of the four pieces of data of the backup file of the address book database, so that the address book database read by the preset time interval is determined. The data is unchanged from the data in the backup file of the address book database.
- the processor 601 determines that the data of the at least one database read by the preset time interval includes all the data of the at least one backup file, and further includes the data that is not included in the at least one backup file, determining to read the preset time interval.
- the data of the at least one database has increased data relative to data of the at least one backup file. For example, assume that the data in the address book database read by the processor 601 at a preset time interval is as shown in Table 4. According to Table 4, the data in the address book database read by the processor 601 at a preset time interval includes five items of data. The processor 601 compares the five items of the data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item.
- the data in Table 4 is The attribute information of the data 2, the data 3, and the data 4 are the same as the attribute information of the data 1, the data 2, the data 3, and the data 4 in Table 2, respectively, and the data 5 not included in Table 2 is included in Table 4, so
- the device 601 determines that the data of the address book database read by the preset time interval includes all the data of the backup file of the address book database, and the data that is not included in the backup file of the address book database, so the preset time interval is determined to be read.
- the data of the address book database is taken, and the data of the backup file relative to the address book database has increased data.
- the processor 601 determines that the number of items of the data of the at least one database read by the preset time interval is greater than or equal to the number of items of the data of the at least one backup file, and the at least the preset time interval reads
- the attribute information of the at least one piece of data in a database is not exactly the same as the attribute information of the corresponding data in the at least one backup file, and the processor 601 determines the data of the at least one database read by the preset time interval and the at least The data of a backup file is inconsistent. For example, assume that the data in the address book database read by the processor 601 at a preset time interval is as shown in Table 5.
- the data in the address book database read by the processor 601 at a preset time interval includes four items of data.
- the processor 601 compares four items of data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item.
- the data 1 in Table 5 is known.
- the mobile phone number in the attribute information is different from the mobile phone number in the attribute information of the data 1 in Table 2, so the processor 601 determines that the data of the address book database read at the preset time interval is inconsistent with the data of the backup file of the address book database.
- the processor 601 determines that the data of the database read at the preset time interval is inconsistent with the data of the backup file of the database. For example: Assume that the data in the address book database read by the preset time interval is shown in Table 6. According to Table 6, although Table 6 has more items than the data contained in Table 2, since the mobile phone number of Data 1 in Table 6 is different from the mobile phone number of Data 1 in Table 2, the processor 601 determines the preset. The data of the address book database read at the time interval is inconsistent with the data of the backup file of the address book database.
- the processor 601 determines that the number of items of the data of the at least one database read by the preset time interval is less than the number of items of the data of the at least one backup file. If the processor 601 determines that the number of items of the data of the at least one database read by the preset time interval is less than the number of items of the data of the at least one backup file, the processor 601 determines the location read by the preset time interval.
- the data of the at least one database is less than the data of the at least one backup file. For example: Assume that the data in the address book database read by the processor 601 at a preset time interval is as shown in Table 7. According to Table 7, the address book database read by the processor 601 at a preset time interval includes three items of data.
- the processor 601 compares the three items of data in the address book database read by the preset time interval with the four items of the backup file of the address book database item by item, by Table 7 and Table 2 shows that the data 1, data 2, and data 3 in the address book database read by the processor 601 at the preset time interval are the same as the data information of the data 1, data 2, and data 3 in the backup file of the address book database.
- the address book database read in the preset time interval does not include the data in the backup file of the address book database 4, so the processor 601 determines that the data of the address book database read at the preset time interval is more than the backup of the address book.
- the file has less data.
- the processor 601 is further configured to: when the data of the at least one database read by the preset time interval has increased data relative to data of the at least one backup file, the adding Adding data to the at least one backup file; or replacing the data of the at least one database read by the preset time interval with the at least one backup file.
- the address book database is still used as an example here. For example, if the data of the backup file of the address book database is data 1, data 2, data 3, and data 4, the data of the address book database read by the processor 601 at a preset time interval is data 1, data 2, data 3, and data.
- the data of the address book database read by the preset time interval is the data 5 compared with the backup file of the address book database, and the processor 601 can directly add the data 5 to the backup file of the address book database.
- Data 1, Data 2, Data 3, and Data 4 in the backup file of the Address Book database can also be replaced with Data 1, Data 2, Data 3, Data 4, and Data 5.
- the processor 601 is further configured to: the data of the at least one database read by the preset time interval is inconsistent with the data of the at least one backup file, or, when the preset time interval is read The data of the at least one database is less than the at least one backup file, and the data of the at least one database read by the preset time interval is replaced by the at least one backup file.
- the address book database is still used as an example here.
- the data of the backup file of the address book database is data 1, data 2, number According to 3 and data 4
- the data of the address book database read by the processor 601 at preset time intervals is data 1, data 2, data 3 and data 4, but the data 1 and the address book in the database read at preset time intervals.
- the attribute information of the data 1 in the backup file of the database is not completely the same, and the processor 601 replaces the data 1, data 2, data 3 and data 4 of the address book database read by the preset time interval in the backup file of the address book database.
- the processor 601 replaces the data 1, data 2, data 3, and data 5 of the address book database read by the preset time interval with the data 1, data 2, data 3, and data 4 in the backup file of the address book database.
- the processor 601 replaces data 1, data 2, and data 3 of the address book database read at the preset time interval with data 1, data 2, data 3, and data 4 in the backup file of the address book database.
- the processor 601 is further configured to: send, according to the database identifier in the backup request, to the second terminal by using the USB interface 603 The database identifies at least one backup file corresponding to the update.
- the processor 601 When the backup request includes a predefined identifier, a one-key backup can be performed, and the processor 601 sends all backup files to the second terminal through the USB interface 603. For example, the processor 601 generates and updates three backup files, which are the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C, when the processor 601 receives the USB interface 603. When the pre-defined identifier is reached, the updated backup file S1, the backup file S2, and the backup file S3 are sent to the second terminal through the USB interface 603.
- the processor 601 is further configured to: send, according to the predefined identifier in the backup request, to the second terminal by using the USB interface 603 At least one backup file of the update.
- the processor 601 sends a backup file corresponding to the database identifier requested by the backup to the second terminal through the USB interface 603 according to the correspondence between the database and the backup file. For example, the processor 601 generates and updates three backup files, which are the backup file S1 of the database A, the backup file S2 of the database B, and the backup file S3 of the database C.
- the processor 601 sends the updated backup file S 1 and the backup file S2 to the second terminal through the USB interface 603. Further, the processor 601 is further configured to: receive, by using the USB interface 603, the recovery request sent by the second terminal and the at least one backup file; and replace at least one backup file sent by the second terminal with the backup in the terminal device 60 of the data backup. Transmitting, by the USB interface 603, a first response message to the second terminal, to notify the second terminal that the recovery task has been completed; reading data in the backup file, and writing the data of the read backup file to the database .
- the second terminal may send all the backup files received by the second terminal to the terminal device 60 that is backed up by the data, or the second terminal may send the partial backup received by the second terminal to the terminal device 60 that backs up the data.
- the file is not limited in this embodiment of the present invention.
- the embodiment of the present invention provides a data backup terminal device 60.
- the processor 601 reads data of at least one database in advance and generates at least one backup file, and updates the backup file when the data of the database is changed, so that the backup file is The data is consistent with the data of the database.
- the updated backup file is directly sent to the second terminal through the USB interface 603, and the backup file can be sent to the second terminal in one interaction, which reduces Interaction with the second terminal, In addition, the speed of data backup is improved, and the second terminal can perform other services after completing one interaction, thereby improving the overall service efficiency of the second terminal.
- the prior art solves the problem that the data of the database that needs to be backed up is read item by item and is sent to the second terminal item by item, resulting in many interactions with the second terminal, slow backup speed, and low overall business efficiency.
- the disclosed system, mobile terminal and method may be implemented in other manners. For example, the mobile terminal embodiments described above are only schematic.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined. Either can be integrated into another system, or some features can be ignored, or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, mobile terminal or unit, and may be in electrical, mechanical or other form.
- 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, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
- the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
- the software functional units described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a Read-Only Memory (ROM), and a random access memory (Randic Access). Memory, referred to as RAM), disk or optical disk, and other media that can store program code.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种数据备份方法及装置。涉及通信领域,提高了数据备份的速度,并提高整体业务效率。该方法包括:读取至少一个数据库的数据,备份所述至少一个数据库的数据,生成至少一个备份文件,监测所述至少一个数据库的数据是否变化,并当所述至少一个数据库的数据变化时,更新所述至少一个备份文件,并接收备份请求,根据所述备份请求,向第二终端发送所述更新的至少一个备份文件。
Description
一种数据备份方法及装置 技术领域 本发明涉及通信领域, 尤其涉及一种数据备份方法及装置。
背景技术 随着通信技术的发展, 可以实现对移动终端内的重要数据进行 备份。 如图 1 所示, 为现有技术中一种数据备份方法流程图。 第二 终端向第一终端发送备份请求, 第一终端在接收到备份请求后, 遍 历第二终端请求备份的数据库, 例如为通讯录数据库和短信数据库, 并逐项读取通讯录数据库和短信数据库的数据, 以及逐项向第二终 端发送数据, 如图 1 所示, 比如 m个通讯录要读取 m次, 并向第二 终端发送 m次, n项短信需要读取 n次, 并向第二终端发送 n次, 第二终端汇总收到的所有数据后生成备份文件。 其中, 第一终端为 移动终端, 第二终端为个人计算机; 图 1 所示的通讯录数据库和短 信数据库存储在第一终端内, 图 1 只是为了更清楚的说明数据备份 的过程, 将通讯录数据库和短信数据库与第一终端分开表示。 但是, 现有技术中, 第一终端收到第二终端发送的备份请求后, 逐项读取第二终端请求备份的数据库的数据并逐项向第二终端发 送, 导致第一终端和第二终端之间交互多, 进而导致备份速度慢, 并且第一终端和第二终端长时间交互妨碍第二终端进行其他业务, 影响第二终端的整体业务效率。
发明内容 本发明的实施例提供一种数据备份方法及装置, 提高了数据备 份的速度, 并提高整体业务效率。
为达到上述目的, 本发明实施例采用的技术方案是, 第一方面, 本发明实施例提供一种数据备份方法, 包括: 读取至少一个数据库的数据;
备份所述至少一个数据库的数据, 生成至少一个备份文件; 监测所述至少一个数据库的数据是否变化; 当所述至少一个数据库的数据变化时, 更新所述至少一个备份 文件;
当接收到备份请求时, 向第二终端发送所述更新的至少一个备 份文件。
在第一方面的第一种可能的实现方式中, 结合第一方面, 所述 监测所述至少一个数据库的数据是否变化, 包括: 根据预设时间间隔, 读取所述至少一个数据库的数据; 比较所述预设时间间隔读取的所述至少一个数据库的数据与所 述至少一个备份文件的数据;
根据比较结果, 确定所述至少一个数据库的数据是否变化。 在第一方面的第二种可能的实现方式中, 结合第一方面的第一 种可能的实现方式, 当所述至少一个数据库的数据变化时, 更新所 述至少一个备份文件, 包括:
当所述预设时间间隔读取的所述至少一个数据库的数据, 相对 于所述至少一个备份文件的数据存在增加的数据时; 将所述增加的数据添加到所述至少一个备份文件; 或者,
将所述预设时间间隔读取的所述至少一个数据库的数据, 替换 所述至少一个备份文件的数据。
在第一方面的第三种可能的实现方式中, 结合第一方面的第二
种可能的实现方式, 当所述至少一个数据库的数据变化时, 更新所 述至少一个备份文件, 还包括:
当所述预设时间间隔读取的所述至少一个数据库的数据与所述 至少一个备份文件的数据不一致, 或者, 当所述预设时间间隔读取 的所述至少一个数据库的数据比所述至少一个备份文件的数据少, 将所述预设时间间隔读取的所述至少一个数据库的数据, 替换 所述至少一个备份文件的数据。
在第一方面的第四种可能的实现方式中, 结合第一方面至第一 方面的第三种可能的实现方式中的任一种实现方式, 所述备份请求 包括请求备份的数据库标识;
当接收到备份请求时, 向第二终端发送所述更新的至少一个备 份文件, 具体为:
根据所述备份请求中的所述数据库标识, 向所述第二终端发送 所述数据库标识对应的更新的至少一个备份文件。
在第一方面的第五种可能的实现方式中, 结合第一方面至第一 方面的第三种可能的实现方式中的任一种可能的实现方式, 所述备 份请求包括预定义标识;
当接收到备份请求时, 向第二终端发送所述更新的至少一个备 份文件, 具体为:
根据所述备份请求中的所述预定义标识, 向所述第二终端发送 所述更新的至少一个备份文件。
第二方面, 本发明实施例提供一种数据备份装置, 包括: 读取模块, 用于读取至少一个数据库的数据; 备份模块, 用于根据所述读取模块读取的所述至少一个数据库 的数据, 备份所述至少一个数据库的数据, 生成至少一个备份文件;
监测模块, 用于监测所述至少一个数据库的数据是否变化; 更新模块, 用于当所述监测模块监测到所述至少一个数据库的 数据变化时, 更新所述至少一个备份文件; 接收模块, 用于接收备份请求; 发送模块, 用于根据所述接收模块接收的备份请求, 向第二终 端发送所述更新的至少一个备份文件。 在第二方面的第一种可能的实现方式中, 结合第二方面, 所述读取模块, 还用于根据预设时间间隔, 读取所述至少一个 数据库的数据; 所述监测模块具体用于: 比较所述读取模块根据预设时间间隔读取的所述至少一个数据 库的数据与所述至少一个备份文件的数据; 根据比较结果, 确定所述至少一个数据库的数据是否变化。 在第二方面的第二种可能的实现方式中, 结合第二方面的第一 种可能的实现方式, 所述更新模块具体用于: 当确定所述监测模块监测到所述读取模块根据预设时间间隔读 取的所述至少一个数据库的数据, 相对于所述至少一个备份文件的 数据存在增加的数据时; 将所述增加的数据添加到所述至少一个备份文件; 或者, 将所述读取模块根据预设时间间隔读取的所述至少一个数据库 的数据, 替换所述至少一个备份文件的数据。 在第二方面的第三种可能的实现方式中, 结合第二方面的第二 种可能的实现方式,
所述更新模块还用于 当确定所述监测模块监测到所述读取模块根据预设时间间隔读 取的所述至少一个数据库的数据与所述至少一个备份文件的数据不 一致, 或者, 当所述监测模块确定所述读取模块根据预设时间间隔 读取的所述至少一个数据库的数据比所述至少一个备份文件的数据 少,
将所述预设时间间隔读取的所述至少一个数据库的数据, 替换 所述至少一个备份文件的数据。 在第二方面的第四种可能的实现方式中, 结合第二方面至第二 方面的第三种可能的实现方式中的任一种实现方式, 所述备份请求 包括请求备份的数据库标识; 所述发送模块具体用于: 根据所述备份请求中的所述数据库标识, 向所述第二终端发送 所述数据库标识对应的更新的至少一个备份文件。 在第二方面的第五种可能的实现方式中, 结合第二方面至第二 方面的第三种可能的实现方式中的任一种可能的实现方式, 所述备 份请求包括预定义标识; 所述发送模块具体用于: 根据所述备份请求中的所述预定义标识, 向所述第二终端发送 所述更新的至少一个备份文件。
第三方面, 本发明实施例提供一种数据备份的终端设备, 包括: 处理器、 存储器, USB接口; 所述处理器用于, 读取至少一个数据库的数据, 备份所述至少 一个数据库的数据, 生成至少一个备份文件, 监测所述至少一个数 据库的数据是否变化, 并当所述至少一个数据库的数据变化时, 更
新所述至少一个备份文件, 并通过所述 USB接口接收备份请求; 根 据所述备份请求, 通过所述 USB接口向第二终端发送所述更新的至 少一个备份文件; 所述存储器用于, 存储所述至少一个数据库的数据, 以及所述 至少一个备份文件, 以及操作指令。
在第三方面的第一种可能的实现方式中, 结合第三方面, 所述处理器还用于: 根据预设时间间隔, 读取所述至少一个数据库的数据; 比较所述预设时间间隔读取的所述至少一个数据库的数据与所 述至少一个备份文件的数据;
根据比较结果, 监测所述至少一个数据库的数据是否变化。 在第三方面的第二种可能的实现方式中, 结合第三方面或第三 方面的第一种可能的实现方式,
所述处理器还用于: 当所述预设时间间隔读取的所述至少一个数据库的数据, 相对 于所述至少一个备份文件的数据存在增加的数据时; 将所述增加的数据添加到所述至少一个备份文件; 或者,
将所述预设时间间隔读取的所述至少一个数据库的数据, 替换 所述至少一个备份文件。
在第三方面的第三种可能的实现方式中, 结合第三方面至第三 方面的第二种可能的实现方式任一种可能的实现方式,
所述处理器还用于: 当所述预设时间间隔读取的所述至少一个数据库的数据与所述 至少一个备份文件的数据不一致, 或者, 当所述预设时间间隔读取
的所述至少一个数据库的数据比所述至少一个备份文件少, 将所述预设时间间隔读取的所述至少一个数据库的数据, 替换 所述至少一个备份文件。 在第三方面的第四种可能的实现方式中, 结合第三方面至第三 方面的第三种可能的实现方式中的任一种实现方式, 所述备份请求 包括请求备份的数据库标识; 所述处理器还用于: 根据所述备份请求中的所述数据库标识, 通过所述 USB接口向 所述第二终端发送所述数据库标识对应的更新的至少一个备份文 件。
在第三方面的第五种可能的实现方式中, 结合第三方面至第三 方面的第三种可能的实现方式中的任一种可能的实现方式, 所述备 份请求包括预定义标识; 所述处理器还用于: 根据所述备份请求中的所述预定义标识, 通过所述 USB接口向 所述第二终端发送所述更新的至少一个备份文件。 本发明实施例提供一种数据备份方法及装置, 通过预先读取至 少一个数据库的数据并生成至少一个备份文件, 在监测到数据库的 数据发生变化时更新备份文件, 使得备份文件的数据和数据库的数 据保持一致, 在接收到备份请求后, 直接向第二终端发送更新后的 备份文件, 通过一次交互即可将备份文件发送至第二终端, 减少了 和第二终端之间的交互, 进而提高了数据备份的速度, 而且, 第二 终端在完成一次交互之后即可以进行其他业务, 所以, 提高了第二 终端整体业务效率, 解决了现有技术逐项读取数据库的数据并逐项 向第二终端发送, 导致第一终端和第二终端之间交互多, 备份速度 慢, 以及第一终端和第二终端长时间交互妨碍第二终端进行其他业 务, 影响第二终端的整体业务效率的缺陷。
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。 图 1 为现有技术中一种数据备份方法的流程图; 图 2为本发明实施例提供的一种数据备份方法的流程图; 图 3为本发明实施例提供的一种数据库配置项的示意图; 图 4为本发明实施例提供的一种数据备份装置 40的结构图; 图 5 为本发明另一实施例提供的一种数据备份装置 40 的结构 图;
图 6为本发明实施例提供的一种数据备份的终端设备 50的结构 图。
具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。 实施例一
图 2 为本发明实施例提供的一种数据备份方法的流程图, 本发 明实施例中的数据备份方法可以由手机、 PAD 平板等移动终端来执 行。 本发明涉及的执行数据备份的终端在本发明实施例中命名为第
一终端, 与第一终端进行交互的终端命名为第二终端, 第二终端可 以为个人计算机、 host主机等终端。 如图 2 所示, 可以包括以下步 骤:
201 : 第一终端读取至少一个数据库的数据。 第一终端读取至少一个数据库的数据中, 具体读取哪个或者哪 些数据库的数据, 可以预先进行配置, 其中, 可以选择多种方式进 行预先配置, 本发明实施例对此不进行限制。 例如, 可以设置数据库配置项, 第一终端根据用户在数据库配 置项的输入结果确定读取的数据库。 例如, 用户在数据库配置项输 入通讯录数据库和通话记录数据库, 则第一终端确定读取通讯录数 据库和通话记录数据库的数据。 需要说明的是, 本发明实施例对数 据库配置项的形式不进行限制, 例如, 参见图 3 , 第一终端可以在数 据库配置项中设置至少一个数据库的选择框, 用户通过勾选选择框 的方式选择至少一个数据库。 再例如, 第一终端可以在出厂设置中预先设置读取的数据库。 其中, 第一终端可以设置最开始读取至少一个数据库的数据的 时间, 例如, 可以设置为在开机后读取至少一个数据库的数据。 本 发明实施例对此不进行限制。
202 : 第一终端备份所述至少一个数据库的数据, 生成至少一个 备份文件。 第一终端分别将读取的数据库中的数据进行备份, 生成至少一 个备份文件。 第一终端可以生成数据库与备份文件的对应关系, 数 据库与备份文件的对应关系包含数据库标识和与数据库标识对应的 备份文件标识。 数据库与备份文件的对应关系可以为表格的形式, 也可以为其他形式, 本实施例对此不进行限制。 例如, 表 1 为本发明实施例提供的一种数据库与备份文件的对 应关系。
表 1
根据表 1 可知, 第一终端读取了数据库 、 数据库 B和数据库 C三个数据库中的数据, 生成了备份文件 S l、 备份文件 S2和备份文 件 S3 三个备份文件, 其中, 数据库 A对应备份文件 S 1 , 数据库 B 对应备份文件 S2 , 数据库 C对应备份文件 S3。 为了简便, 本发明实 施例将数据库对应的备份文件简称为数据库的备份文件, 例如, 备 份文件 S 1称为数据库 A的备份文件,通讯录数据库对应的备份文件 称为通讯录数据库的备份文件。 示例性的, 第一终端可以将生成的至少一个备份文件存储在一 个备份文件夹中, 也可以将生成的至少一个备份文件分别存储在第 一终端的存储介质上。 例如, 第一终端将备份文件 S l、 备份文件 S2 以及备份文件 S3存储在备份文件夹 S 中; 或者, 将备份文件 S l、 备份文件 S2和备份文件 S3分别存储在第一终端的存储介质上。 其中, 所述备份文件可以是压缩包的形式, 也可以是其他形式, 本发明实施例对此不进行限定。
203 : 第一终端监测所述至少一个数据库的数据是否变化。 示例性的, 第一终端可以根据预设时间间隔, 读取所述至少一 个数据库的数据, 将预设时间间隔读取到的至少一个数据库中的数 据与所述至少一个备份文件中的数据进行逐项比较, 确定所述至少 一个数据库的数据是否发生变化; 其中, 预设时间间隔可以由第一 终端根据需要预先设置, 本发明实施例对此不进行限定。 其中, 可以根据预设时间间隔读取到至少一个数据库的数据与
至少一个备份文件的数据比较的情况, 将比较结果分为以下四种类 型:
第一种类型: 预设时间间隔读取的所述至少一个数据库的数据, 相对于所述至少一个备份文件的数据不变; 第二种类型: 预设时间间隔读取的所述至少一个数据库的数据, 相对于所述至少一个备份文件的数据存在增加的数据; 第三种类型: 预设时间间隔读取的所述至少一个数据库的数据 与所述至少一个备份文件的数据不一致;
第四种类型: 预设时间间隔读取的所述至少一个数据库的数据 比所述至少一个备份文件的数据少。 下面仅以通讯录数据库为例分别对上述四种类型的比较结果进 行说明。
假设通讯录数据库的备份文件的数据如表 2所示。 表 2
根据表 2可知, 通讯录数据库的备份文件的数据包含四项数据, 分别为数据 1、 数据 2、 数据 3和数据 4 , 每项数据包含姓名, 移动
电话号码, 固定电话号码等属性信息中的至少一项。 需要说明的是, 本发明实施例涉及的数据 1、 数据 2 和数据 3 等仅是为了更清楚对本实施例进行说明而定义的标识, 不对本发明 实施例构成限制, 本发明实施例中数据库和备份文件的数据通过标 识进行对应, 例如, 通讯录数据库中标识为 "数据 1 " 的数据和通讯 录数据库的备份文件中标识为 "数据 1 " 的数据对应。
1、 预设时间间隔读取的所述至少一个数据库的数据, 相对于所 述至少一个备份文件的数据不变指的是: 预设时间间隔读取的至少 一个数据库的数据, 相对于至少一个备份文件的数据的项数以及每 项数据的属性信息完全相同。 例如,假设预设时间间隔读取到的通讯录数据库中的数据如表 3 所示。
根据表 3 可知, 预设时间间隔读取到的通讯录数据库中的数据 包含四项数据, 分别为数据 1、 数据 2、 数据 3和数据 4 , 每个数据 包含姓名, 移动电话号码, 固定电话号码等属性信息中的至少一项。
将预设时间间隔读取到的通讯录数据库中的四项数据与通讯录 数据库的备份文件的四项数据逐项进行比较, 根据表 2和表 3可知, 表 2 中的数据 1、 数据 2、 数据 3和数据 4的属性信息分别与表 3 中 数据 1、 数据 2、 数据 3和数据 4的属性信息相同, 所以, 确定预设 时间间隔读取到的通讯录数据库中的四项数据与通讯录数据库的备 份文件的四项数据的属性信息完全相同, 所以, 确定预设时间间隔 读取到的通讯录数据库中的数据相对于通讯录数据库的备份文件中 的数据不变。
2、 预设时间间隔读取的所述至少一个数据库的数据, 相对于所 述至少一个备份文件的数据存在增加的数据指的是: 预设时间间隔 读取的至少一个数据库的数据除包含至少一个备份文件的全部数据 外, 还包含至少一个备份文件中没有的数据。
例如 ,假设预设时间间隔读取到的通讯录数据库中的数据如表 4 所示。
表 4 标识 属性信息 数据 1 姓名: 张三
移动电话号码: 1 1 1 1 1 1 1 1 1 1 1 数据 2 姓名: 李四 固定电话: 22222222
数据 3 姓名: 王五 移动电话号码: 33333333333 数据 4 姓名: 赵六
移动电话号码: 44444444444 数据 5 姓名: 刘一 移动电话号码: 55555555555
根据表 4 可知, 预设时间间隔读取到的通讯录数据库中的数据 包含五项数据。 将预设时间间隔读取到的通讯录数据库中的五项数 据与通讯录数据库的备份文件的四项数据逐项进行比较, 根据表 2 和表 4可知, 表 4 中的数据 1、 数据 2、 数据 3和数据 4的属性信息 分别与表 2中数据 1、 数据 2、 数据 3和数据 4的属性信息相同, 而 且, 表 4中包含表 2中没有的数据 5 , 所以, 确定预设时间间隔读取 到的通讯录数据库的数据除包含通讯录数据库的备份文件的全部数 据外, 还包含通讯录数据库的备份文件中没有的数据, 所以, 确定 预设时间间隔读取的通讯录数据库的数据, 相对于通讯录数据库的 备份文件的数据存在增加的数据。
3、 预设时间间隔读取的所述至少一个数据库的数据与所述至少 一个备份文件的数据不一致指的是: 预设时间间隔读取的所述至少 一个数据库的数据的项数大于或等于所述至少一个备份文件的数据 的项数, 且预设时间间隔读取的所述至少一个数据库中至少一项数 据的属性信息与所述至少一个备份文件中对应数据的属性信息不完 全相同。
例如,假设预设时间间隔读取到的通讯录数据库中的数据如表 5 所示。
数据 4 姓名: 赵六 移动电话号码: 44444444444 根据表 5 可知, 预设时间间隔读取到的通讯录数据库中的数据 包含四项数据。 将预设时间间隔读取到的通讯录数据库中的四项数 据与通讯录数据库的备份文件的四项数据逐项进行比较, 根据表 2 和表 5可知, 表 5 中数据 1 的属性信息中的移动电话号码与表 2 中 数据 1 的属性信息中的移动电话号码不同, 所以, 确定预设时间间 隔读取的通讯录数据库的数据与通讯录数据库的备份文件的数据不 一致。 需要说明的是, 在预设时间间隔读取的数据库的数据的项数大 于数据库的备份文件中的数据的项数, 但是至少一项数据的属性信 息与数据库的备份文件中对应数据的属性信息不完全相同的情况 下, 不应认为预设时间间隔读取的数据库的数据相对于数据库的备 份文件的数据存在增加的数据, 而应该认为预设时间间隔读取的数 据库的数据与数据库的备份文件的数据不一致。 例如:假设预设时间间隔读取到的通讯录数据库中的数据如表 6 所示。
数据 4 姓名: 赵六 移动电话号码: 44444444444 数据 5 姓名: 刘一 移动电话号码: 55555555555 根据表 6可知, 虽然表 6 比表 2 包含的数据的项数多, 但是因 为表 6 中数据 1 的移动电话号码与表 2 中数据 1 的移动电话号码不 同, 所以, 确定预设时间间隔读取的通讯录数据库的数据与通讯录 数据库的备份文件的数据不一致。
4、 预设时间间隔读取的所述至少一个数据库的数据比所述至少 一个备份文件的数据少指的是: 预设时间间隔读取的所述至少一个 数据库的数据的项数小于所述至少一个备份文件的数据的项数。 例如:假设预设时间间隔读取到的通讯录数据库中的数据如表 7 所示。
根据表 7 可知, 预设时间间隔读取到的通讯录数据库中为三项 数据。 将预设时间间隔读取到的通讯录数据库中的三项数据与通讯 录数据库的备份文件的四项数据逐项进行比较, 由表 7和表 2可知, 预设时间间隔读取到的通讯录数据库中的数据 1、 数据 2 和数据 3
与通讯录数据库的备份文件中的数据 1、数据 2和数据 3的属性信息 分别相同, 且预设时间间隔读取到的通讯录数据库中不包含通讯录 数据库的备份文件中的数据 4 , 所以, 确定预设时间间隔读取的通讯 录数据库的数据比通讯录的备份文件的数据少。
204 : 当所述至少一个数据库的数据变化时, 更新所述至少一个 备份文件。 示例性的, 根据步骤 203 中所述四种不同的比较结果, 可以釆 用不同的更新方式更新所述至少一个备份文件。
1、 第一终端监测到预设时间间隔读取的所述至少一个数据库的 数据, 相对于所述至少一个备份文件的数据存在增加的数据时, 可 以将增加的数据添加到所述至少一个备份文件中; 或者, 将所述预 设时间间隔读取的所述至少一个数据库的数据, 替换所述至少一个 备份文件的数据。 在此仍以通讯录数据库为例进行说明。 例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数 据 3和数据 4 , 预设时间间隔读取的通讯录数据库的数据为数据 1、 数据 2、 数据 3、 数据 4和数据 5 , 预设时间间隔读取的通讯录数据 库的数据相对于通讯录数据库的备份文件增加的数据为数据 5 ,则可 以直接将数据 5添加到通讯录数据库的备份文件, 也可以用数据 1、 数据 2、 数据 3、 数据 4和数据 5替换通讯录数据库的备份文件中的 数据 1、 数据 2、 数据 3和数据 4。
2、 第一终端监测到所述预设时间间隔读取的所述至少一个数据 库的数据与所述至少一个备份文件的数据不一致; 或者, 所述预设 时间间隔读取的所述至少一个数据库的数据比所述至少一个备份文 件的数据少时, 将所述预设时间间隔读取的所述至少一个数据库的 数据, 替换所述至少一个备份文件的数据。 在此仍以通讯录数据库为例进行说明。
例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数 据 3和数据 4 , 预设时间间隔读取的通讯录数据库的数据为数据 1、 数据 2、 数据 3和数据 4 , 但是预设时间间隔读取的数据库中的数据 1和通讯录数据库的备份文件中的数据 1 的属性信息不完全相同,则 将预设时间间隔读取的通讯录数据库的数据 1、 数据 2、 数据 3和数 据 4替换通讯录数据库的备份文件中的数据 1、 数据 2、 数据 3和数 据 4。 再例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数据 3和数据 4 ,预设时间间隔读取的通讯录数据库的数据为数据 1、 数据 2、 数据 3和数据 5 , 则将预设时间间隔读取的通讯录数据库的 数据数据 1、 数据 2、 数据 3和数据 5替换通讯录数据库的备份文件 中的数据 1、 数据 2、 数据 3和数据 4。 再例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数据 3和数据 4 ,预设时间间隔读取的通讯录数据库的数据为数据 1、 数据 2和数据 3 , 则将预设时间间隔读取的通讯录数据库的数据 1、 数据 2和数据 3替换通讯录数据库的备份文件中的数据 1、 数据 2、 数据 3和数据 4。
205 : 当接收到备份请求时, 第一终端向第二终端发送所述更新 的至少一个备份文件。 其中, 备份请求可以包含请求备份的数据库标识或预定义标识。 当备份请求包含预定义标识时, 可以进行一键备份, 第一终端 向第二终端发送全部备份文件。 例如, 第一终端根据步骤 201 -204 生成并更新了数据库 A的备份文件 S l、 数据库 B的备份文件 S2和 数据库 C的备份文件 S3 , 则当第一终端收到预定义标识时, 向第二 终端发送更新的数据库 A的备份文件 S l、 数据库 B 的备份文件 S2 和数据库 c的备份文件 S3。 当备份请求包含请求备份的数据库标识时, 第一终端根据数据 库和备份文件的对应关系, 向第二终端发送请求备份的数据库标识
对应的备份文件。 例如, 第一终端根据步骤 201 -204 生成并更新了 数据库 A的备份文件 S l、 数据库 B的备份文件 S2和数据库 C的备 份文件 S3 , 若备份请求中包含数据库 A的标识和数据库 B的标识, 则第一终端向第二终端发送更新后的数据库 A的备份文件 S 1和更新 后的数据库 B的备份文件 S2。 可选的, 在步骤 205之后, 还可以包含以下步骤 1 ) -步骤 4 ) , 用于对数据库的数据进行恢复。 例如, 第一终端需要进行格式化, 在格式化前利用步骤 201 -步骤 205将数据库 A的备份文件 S l、数据 库 B的备份文件 S2和数据库 C的备份文件 S3发送到第二终端, 第 二终端将接收到的备份文件 S l、 备份文件 S2和备份文件 S3进行存 储, 在第一终端完成格式化以后, 若数据库 A的数据损坏或丟失, 可以利用发送给第二终端的备份文件 S 1 对数据库 A 的数据进行恢 复; 若数据库 B 的数据损坏或丟失, 可以利用发送给第二终端的备 份文件 S2对数据库 B 的数据进行恢复, 若数据库 C 的数据损坏或 丟失,可以利用发送给第二终端的备份文件 S3对数据库 C的数据进 行恢复, 具体可通过下述步骤 1 ) -步骤 4 ) 实现。
1 )第一终端接收第二终端发送的恢复请求以及至少一个备份文 件。
其中, 第二终端可以向第一终端发送第二终端接收到的全部备 份文件, 或者, 第二终端可以向第一终端发送第二终端接收到的部 分备份文件, 本发明实施例对此不进行限制, 当第二终端向第一终 端发送第二终端接收到的全部备份文件时, 可以实现一键恢复。
2 )第一终端将所述至少一个备份文件替换第一终端内的备份文 件。
例如, 若第一终端收到数据库 A的备份文件, 则将数据库 A的 备份文件替换第一终端内存储的数据库 A的备份文件 S l。
3 ) 第一终端向第二终端发送第一响应消息, 以通知第二终端恢 复任务已完成。
优选的, 为了不影响第二终端进行其他操作 (如安装手机应用 等), 第一终端可以向第二终端内发送第一响应消息, 以通知第二终 端恢复任务已完成, 使得第二终端可以进行其他操作, 无需等待长 时间数据恢复的过程, 数据恢复的速度得到了提升。
4 ) 第一终端读取备份文件中的数据, 将读取到的数据写入数据 库。
示例性的, 第一终端在发送第一响应消息后, 利用第一终端的 空闲时间, 读取备份文件中的数据, 根据备份文件与数据库的对应 关系, 将备份文件中的数据写入对应的数据库。 本发明实施例提供一种数据备份方法, 第一终端通过预先读取 至少一个数据库的数据并生成至少一个备份文件, 在监测到数据库 的数据发生变化时更新备份文件, 使得备份文件的数据和数据库的 数据保持一致, 在接收到备份请求后, 直接向第二终端发送更新后 的备份文件, 通过一次交互即可将备份文件发送至第二终端, 减少 了和第二终端之间的交互, 进而提高了数据备份的速度, 而且, 第 二终端在完成一次交互之后即可以进行其他业务, 所以, 提高了第 二终端整体业务效率。 解决了现有技术逐项读取需要备份的数据库 的数据并逐项向第二终端发送, 导致第一终端和第二终端之间交互 多, 备份速度慢, 以及第一终端和第二终端长时间交互妨碍第二终 端进行其他业务, 影响第二终端的整体业务效率的缺陷。
实施例二 图 4为本发明实施例提供的一种数据备份装置 40的结构图。 所 述数据备份装置 40可以为手机、 PAD平板等移动终端, 本实施例将 与数据备份装置 40进行交互的终端命名为第二终端, 第二终端可以 为个人计算机、 host主机等终端。 如图 4所示, 数据备份装置 40 包括: 读取模块 401、 备份模块
402、 监测模块 403、 更新模块 404、 接收模块 405和发送模块 406。 其中, 读取模块 401 , 用于读取至少一个数据库的数据。 示例性的, 读取模块 401可以根据数据备份装置 40的数据库配 置项的输入结果确定读取的数据库。 例如, 若数据库配置项的输入 结果为通讯录数据库和通话记录数据库, 则读取模块 401 读取通讯 录数据库和通话记录数据库的数据。 需要说明的是, 本发明实施例 对数据备份装置 40的数据库配置项的形式不进行限制, 例如, 参见 图 3 ,为一种数据库配置项的示意图,包含至少一个数据库的选择框, 用户可以通过勾选选择框的方式选择至少一个数据库。 示例性的, 读取模块 401还可以根据数据备份装置 40的出厂设 置中预先设置的数据库读取至少一个数据库的数据。 备份模块 402 ,用于根据所述读取模块 401读取的所述至少一个 数据库的数据, 备份所述至少一个数据库的数据, 生成至少一个备 份文件。 示例性的, 备份模块 402 可以生成数据库与备份文件的对应关 系, 数据库与备份文件的对应关系包含数据库标识和与数据库标识 对应的备份文件标识。 数据库与备份文件的对应关系可以为表格的 形式, 也可以为其他形式, 本实施例对此不进行限制。 例如, 参见表 1 , 为本发明实施例提供的备份模块 402生成的一 种数据库与备份文件的对应关系。 根据表 1 可知, 读取模块 401读取了数据库 A、 数据库 B和数 据库 C三个数据库中的数据, 备份模块 402生成了备份文件 S l、 备 份文件 S2和备份文件 S3三个备份文件, 其中, 数据库 A对应备份 文件 S 1 , 数据库 B对应备份文件 S2 , 数据库 C对应备份文件 S3。 为了简便, 本发明实施例将数据库对应的备份文件简称为数据 库的备份文件, 例如, 备份文件 S 1称为数据库 A的备份文件, 通讯 录数据库对应的备份文件称为通讯录数据库的备份文件。
其中, 所述备份文件可以是压缩包的形式, 也可以是其他形式, 本发明实施例对此不进行限定。 监测模块 403 , 用于监测所述至少一个数据库的数据是否变化。 更新模块 404 ,用于当所述监测模块 403监测到所述至少一个数 据库的数据变化时, 更新所述至少一个备份文件。 接收模块 405 , 用于接收备份请求。 发送模块 406 , 用于根据所述接收模块 405接收的备份请求, 向 第二终端发送所述更新的至少一个备份文件。 进一步的, 所述读取模块 401 , 还用于根据预设时间间隔, 读取 所述至少一个数据库的数据。 所述监测模块 403具体用于: 比较所述读取模块 401 根据预设时间间隔读取的所述至少一个 数据库的数据与所述至少一个备份文件的数据; 根据比较结果, 确 定所述至少一个数据库的数据是否变化。 具体的, 可以根据读取模块 401 预设时间间隔读取到至少一个 数据库的数据与至少一个备份文件的数据比较的情况, 将监测模块 403的监测结果分为以下四种类型: 第一种类型: 监测模块 403监测到读取模块 401 预设时间间隔 读取的所述至少一个数据库的数据, 相对于所述至少一个备份文件 的数据不变; 第二种类型: 监测模块 403监测到读取模块 401 预设时间间隔 读取的所述至少一个数据库的数据, 相对于所述至少一个备份文件 的数据存在增加的数据; 第三种类型: 监测模块 403监测到读取模块 401 预设时间间隔 读取的所述至少一个数据库的数据与所述至少一个备份文件的数据 不一致;
第四种类型: 监测模块 403监测到读取模块 401 预设时间间隔 读取的所述至少一个数据库的数据比所述至少一个备份文件的数据 少。
下面仅以通讯录数据库为例对监测模块 403 确定四种监测结果 的方法进行说明。 假设备份模块 402 生成的通讯录数据库的备份文件的数据如表 2所示。 根据表 2可知, 备份模块 402生成的通讯录数据库的备份文 件的数据为四项数据, 分别为数据 1、 数据 2、 数据 3和数据 4 , 每 项数据包含姓名, 移动电话号码, 固定电话号码等属性信息中的至 少一项。 需要说明的是, 本发明实施例涉及的数据 1、 数据 2 和数据 3 等仅是为了更清楚对本实施例进行说明而定义的标识, 不对本发明 实施例构成限制, 本发明实施例中数据库和备份文件的数据通过标 识进行对应, 例如, 通讯录数据库中标识为 "数据 1 " 的数据和通讯 录数据库的备份文件中标识为 "数据 1 " 的数据对应。
1、 若监测模块 403确定读取模块 401预设时间间隔读取的至少 一个数据库的数据, 相对于至少一个备份文件的数据的项数以及每 项数据的属性信息完全相同, 则确定监测到读取模块 401 预设时间 间隔读取到的数据库中的数据相对于数据库的备份文件中的数据不 变。
例如, 假设读取模块 401 预设时间间隔读取到的通讯录数据库 中的数据如表 3所示。 根据表 3 可知, 读取模块 401 预设时间间隔读取到的通讯录数 据库中的数据为四项数据, 分别为数据 1、 数据 2、 数据 3和数据 4 , 每个数据包含姓名, 移动电话号码, 固定电话号码等属性信息中的 至少一项。 监测模块 403 将读取模块 401 预设时间间隔读取到的通讯录数
据库中的四项数据与备份模块 402 生成的通讯录数据库的备份文件 的四项数据逐项进行比较, 根据表 2和表 3可知, 表 2中的数据 1、 数据 2、 数据 3和数据 4的的属性信息分别与表 3 中的数据 1、 数据 2、 数据 3和数据 4的属性信息相同, 所以, 监测模块 403确定读取 模块 401 预设时间间隔读取到的通讯录数据库中的四项数据与备份 模块 402 生成的通讯录数据库的备份文件的四项数据的属性信息完 全相同, 所以, 监测模块 403 确定读取模块 401 预设时间间隔读取 到的通讯录数据库中的数据相对于备份模块 402 生成的通讯录数据 库的备份文件中的数据不变。
2、 若监测模块 403确定读取模块 401预设时间间隔读取的至少 一个数据库的数据除包含至少一个备份文件的全部数据外, 还包含 至少一个备份文件中没有的数据, 则确定监测到读取模块 401 预设 时间间隔读取的所述至少一个数据库的数据, 相对于所述至少一个 备份文件的数据存在增加的数据。 例如, 假设读取模块 401 预设时间间隔读取到的通讯录数据库 中的数据如表 4所示。 根据表 4可知, 读取模块 401预设时间间隔 读取到的通讯录数据库中的数据包含五项数据。 监测模块 403 将读取模块 401 预设时间间隔读取到的通讯录数 据库中的五项数据与备份模块 402 生成的通讯录数据库的备份文件 的四项数据逐项进行比较, 根据表 2和表 4可知, 表 4中的数据 1、 数据 2、 数据 3和数据 4的属性信息分别与表 2中数据 1、 数据 2、 数据 3和数据 4的属性信息相同, 而且, 表 4 中包含表 2 中没有的 数据 5 , 所以, 监测模块 403确定读取模块 401预设时间间隔读取到 的通讯录数据库的数据除包含通讯录数据库的备份文件的全部数据 外, 还包含通讯录数据库的备份文件中没有的数据, 所以, 监测模 块 403确定读取模块 401预设时间间隔读取的通讯录数据库的数据, 相对于通讯录数据库的备份文件的数据存在增加的数据。
3、 若监测模块 403确定读取模块 401预设时间间隔读取的所述
至少一个数据库的数据的项数大于或等于所述至少一个备份文件的 数据的项数, 且预设时间间隔读取的所述至少一个数据库中至少一 项数据的属性信息与所述至少一个备份文件中对应数据的属性信息 不完全相同, 则确定监测到读取模块 401 预设时间间隔读取的所述 至少一个数据库的数据与所述至少一个备份文件的数据不一致。 例如, 假设读取模块 401 预设时间间隔读取到的通讯录数据库 中的数据如表 5 所示。 根据表 5可知, 读取模块 401预设时间间隔 读取到的通讯录数据库中的数据包含四项数据。 监测模块 403 将读取模块 401 预设时间间隔读取到的通讯录数 据库中的四项数据与通讯录数据库的备份文件的四项数据逐项进行 比较, 根据表 2和表 5可知, 表 5 中数据 1 的属性信息中的移动电 话号码与表 2 中数据 1 的属性信息中移动电话号码不同, 所以, 监 测模块 403 确定读取模块 401 预设时间间隔读取的通讯录数据库的 数据与通讯录数据库的备份文件的数据不一致。 需要说明的是, 在读取模块 401 预设时间间隔读取的数据库的 数据的项数大于数据库的备份文件中的数据的项数, 但是至少一项 数据的属性信息与数据库的备份文件中对应数据的属性信息不完全 相同的情况下, 监测模块 403 确定预设时间间隔读取的数据库的数 据与数据库的备份文件的数据不一致。 例如: 假设读取模块 401 预设时间间隔读取到的通讯录数据库 中的数据如表 6所示。 根据表 6可知, 虽然表 6 比表 2 包含的数据 的项数多, 但是因为表 6 中数据 1 的移动电话号码与表 2 中数据 1 的移动电话号码不同, 所以, 监测模块 403 确定读取模块 401 预设 时间间隔读取的通讯录数据库的数据与通讯录数据库的备份文件的 数据不一致。
4、 若监测模块 403确定读取模块 401预设时间间隔读取的所述 至少一个数据库的数据的项数小于所述至少一个备份文件的数据的 项数, 则确定监测到读取模块 401 预设时间间隔读取的所述至少一
个数据库的数据比所述至少一个备份文件的数据少。 例如: 假设读取模块 401 预设时间间隔读取到的通讯录数据库 中的数据如表 7所示。 根据表 7可知, 读取模块 401预设时间间隔 读取到的通讯录数据库中包含三项数据。 监测模块 403 将读取模块 401 预设时间间隔读取到的通讯录数 据库中的三项数据与通讯录数据库的备份文件的四项数据逐项进行 比较, 由表 7和表 2可知, 读取模块 401 预设时间间隔读取到的通 讯录数据库中的数据 1、数据 2和数据 3与通讯录数据库的备份文件 中的数据 1、 数据 2和数据 3 的属性信息分别相同, 且读取模块 401 预设时间间隔读取到的通讯录数据库中不包含通讯录数据库的备份 文件中的数据 4 , 所以, 监测模块 403确定预设时间间隔读取的通讯 录数据库的数据比通讯录的备份文件的数据少。 进一步的, 所述更新模块 404具体用于: 当确定所述监测模块 403 监测到所述读取模块 401 根据预设时 间间隔读取的所述至少一个数据库的数据, 相对于所述至少一个备 份文件的数据存在增加的数据时; 将所述增加的数据添加到所述至少一个备份文件; 或者, 将所 述读取模块 401 根据预设时间间隔读取的所述至少一个数据库的数 据, 替换所述至少一个备份文件的数据。 在此仍以通讯录数据库为例进行说明。 例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数 据 3和数据 4 ,读取模块 401预设时间间隔读取的通讯录数据库的数 据为数据 1、 数据 2、 数据 3、 数据 4和数据 5 , 读取模块 401预设 时间间隔读取的通讯录数据库的数据相对于通讯录数据库的备份文 件增加的数据为数据 5 ,则更新模块 404可以直接将数据 5添加到通 讯录数据库的备份文件, 也可以用数据 1、 数据 2、 数据 3、 数据 4 和数据 5替换通讯录数据库的备份文件中的数据 1、 数据 2、 数据 3
和数据 4。 进一步的, 所述更新模块 403还用于: 当确定所述监测模块 403 监测到所述读取模块 401 根据预设时 间间隔读取的所述至少一个数据库的数据与所述至少一个备份文件 的数据不一致, 或者, 当所述监测模块 403 确定所述读取模块 401 根据预设时间间隔读取的所述至少一个数据库的数据比所述至少一 个备份文件的数据少, 将所述预设时间间隔读取的所述至少一个数 据库的数据, 替换所述至少一个备份文件的数据。 在此仍以通讯录数据库为例进行说明。 例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数 据 3和数据 4 ,读取模块 401预设时间间隔读取的通讯录数据库的数 据为数据 1、 数据 2、 数据 3和数据 4 , 但是读取模块 401预设时间 间隔读取的数据库中的数据 1 和通讯录数据库的备份文件中的数据
1 的属性信息不完全相同,则更新模块 404将读取模块 401预设时间 间隔读取的通讯录数据库的数据 1、 数据 2、 数据 3和数据 4替换通 讯录数据库的备份文件中的数据 1、 数据 2、 数据 3和数据 4。 再例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数据 3和数据 4 ,读取模块 401预设时间间隔读取的通讯录数据库的 数据为数据 1、 数据 2、 数据 3和数据 5 , 则更新模块 404将读取模 块 401预设时间间隔读取的通讯录数据库的数据数据 1、 数据 2、 数 据 3和数据 5替换通讯录数据库的备份文件中的数据 1、 数据 2、 数 据 3和数据 4。 再例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数据 3和数据 4 ,读取模块 401预设时间间隔读取的通讯录数据库的 数据为数据 1、 数据 2和数据 3 , 则更新模块 404将读取模块 401预 设时间间隔读取的通讯录数据库的数据 1、数据 2和数据 3替换通讯 录数据库的备份文件中的数据 1、 数据 2、 数据 3和数据 4。
进一步的, 当所述备份请求包括请求备份的数据库标识时, 所 述发送模块 406具体用于: 根据所述备份请求中的所述数据库标识, 向所述第二终端发送 所述数据库标识对应的更新的至少一个备份文件。 当备份请求包含预定义标识时, 可以进行一键备份, 发送模块 406向第二终端发送全部备份文件。 例如, 备份模块 402生成了三个 备份文件, 分别为数据库 A 的备份文件 S l、 数据库 B 的备份文件 S2和数据库 C的备份文件 S3 ,更新模块 404在监测模块 403监测到 数据库 A的数据变化时更新了备份文件 S 1 , 在监测模块 403监测到 数据库 B的数据变化时更新了备份文件 S2 , 在监测模块 403监测到 数据库 C的数据变化时更新了备份文件 S3 , 则当接收模块 405收到 预定义标识时, 发送模块 406 向第二终端发送更新模块 404 更新的 备份文件 S l、 备份文件 S2和备份文件 S3。 进一步的, 当所述备份请求包括预定义标识时, 所述发送模块 406具体用于: 根据所述备份请求中的所述预定义标识, 向所述第二终端发送 所述更新的至少一个备份文件。 当备份请求包含请求备份的数据库标识时, 发送模块 406 根据 数据库和备份文件的对应关系, 向第二终端发送请求备份的数据库 标识对应的备份文件。 例如, 备份模块 402 生成了三个备份文件, 分别为数据库 A的备份文件 S l、 数据库 B的备份文件 S2和数据库 C的备份文件 S3 , 更新模块 404在监测模块 403监测到数据库 A的 数据变化时更新了备份文件 S 1 , 在监测模块 403监测到数据库 B的 数据变化时更新了备份文件 S2 , 在监测模块 403监测到数据库 C的 数据变化时更新了备份文件 S3 , 若备份请求中包含数据库 A的标识 和数据库 B 的标识, 则发送模块 406 向第二终端发送更新模块 404 更新后的备份文件 S 1和更新后的备份文件 S2。 进一步的,
接收模块 405 还用于: 接收第二终端发送的恢复请求以及至少 一个备份文件。 更新模块 404还用于: 将所述接收模块 405接收的至少一个备 份文件替换第一终端内的备份文件。 发送单元 406 还用于: 向第二终端发送第一响应消息, 以通知 第二终端恢复任务已完成。 读取模块 401还用于: 读取备份文件中的数据。 参见图 5 , 所述数据备份装置 40还包括: 写入模块 407 , 用于 将所述读取模块 401读取到的备份文件的数据写入数据库。 其中, 第二终端可以向第一终端发送第二终端接收到的全部备 份文件, 或者, 第二终端可以向第一终端发送第二终端接收到的部 分备份文件, 本发明实施例对此不进行限制, 当第二终端向第一终 端发送第二终端接收到的全部备份文件时, 可以实现一键恢复。 其中, 发送单元 406 向第二终端内发送第一响应消息, 用于通 知第二终端恢复任务已完成, 使得第二终端可以进行其他操作 (如 安装手机应用等), 使得第二终端无需等待长时间数据恢复的过程, 数据恢复的速度得到了提升。 本发明实施例提供一种数据备份装置 40 , 备份模块 402根据读 取模块 401 预先读取的至少一个数据库的数据生成至少一个备份文 件, 更新模块 404在监测模块 403 监测到数据库的数据发生变化时 更新备份文件, 使得备份文件的数据和数据库的数据保持一致, 发 送模块 406在接收模块 405接收到备份请求后, 直接向第二终端发 送更新后的备份文件, 通过一次交互即可将备份文件发送至第二终 端, 减少了和第二终端之间的交互, 进而提高了数据备份的速度, 而且, 第二终端在完成一次交互之后即可以进行其他业务, 所以, 提高了第二终端整体业务效率。 解决了现有技术逐项读取需要备份 的数据库的数据并逐项向第二终端发送, 导致和第二终端之间交互
多, 备份速度慢, 以及整体业务效率低的缺陷。
实施例三 图 6 为本发明实施例提供的一种数据备份的终端设备 60 的结 构示意图;如图 6所示,该数据备份的终端设备 60包括:处理器 601、 存储器 602、 USB接口 603 , 至少一个通信总线 604 , 用于实现这些装置 之间的连接和相互通信; 处理器 601可以是一个中央处理器 (英文: central processing unit, 简称为 CPU ) ;
存储器 602 , 可以是非易失性存储器 (英文: non-volatile memory ) , 例 ^口, 快闪存 4诸器(英文: flash memory ) , 硬盘(英文: hard disk drive , 缩写: HDD ) 或固态硬盘 (英文: solid-state drive , 缩写: SSD ) ; 或者 上述种类的存储器的组合;
USB接口 603 , 用于与外部网元之间通过数据线进行数据传输。 其中, 处理器 601 , 用于读取至少一个数据库的数据, 备份所述 至少一个数据库的数据, 生成至少一个备份文件, 监测所述至少一 个数据库的数据是否变化, 并当所述至少一个数据库的数据变化时, 更新所述至少一个备份文件, 并通过所述 USB接口接收备份请求; 根据所述备份请求, 通过所述 USB接口向第二终端发送所述更新的 至少一个备份文件; 所述存储器 602 用于, 存储所述至少一个数据库的数据, 以及 所述至少一个备份文件, 以及操作指令。 其中, 处理器 601可以根据数据备份的终端设备 60的数据库配 置项的输入结果确定读取的数据库。 例如, 若数据库配置项的输入 结果为通讯录数据库和通话记录数据库, 则处理器 601 读取通讯录 数据库和通话记录数据库的数据。 需要说明的是, 本发明实施例对 数据备份的终端设备 60的数据库配置项的形式不进行限制, 例如, 参见图 3 , 为一种数据库配置项的示意图, 包含至少一个数据库的选
择框, 用户可以通过勾选选择框的方式选择至少一个数据库。 处理 器 601还可以根据数据备份的终端设备 60的出厂设置中预先设置的 数据库读取至少一个数据库的数据。 处理器 601 可以生成数据库与备份文件的对应关系, 数据库与 备份文件的对应关系包含数据库标识和与数据库标识对应的备份文 件标识。 数据库与备份文件的对应关系可以为表格的形式, 也可以 为其他形式, 本实施例对此不进行限制。 例如, 参见表 1 , 为本发明实施例提供的处理器 601生成的一种 数据库与备份文件的对应关系。 根据表 1 可知, 处理器 601 读取了 数据库 A、 数据库 B和数据库 C三个数据库中的数据, 并生成了备 份文件 S l、 备份文件 S2和备份文件 S3三个备份文件, 其中, 数据 库 A对应备份文件 S 1 , 数据库 B对应备份文件 S2 , 数据库 C对应 备份文件 S3。 为了简便, 本发明实施例将数据库对应的备份文件简 称为数据库的备份文件, 例如, 备份文件 S 1称为数据库 A的备份文 件, 通讯录数据库对应的备份文件称为通讯录数据库的备份文件。 进一步的, 所述处理器 601还用于: 根据预设时间间隔, 读取所述至少一个数据库的数据; 比较所 述预设时间间隔读取的所述至少一个数据库的数据与所述至少一个 备份文件的数据; 根据比较结果, 监测所述至少一个数据库的数据 是否变化。 具体的, 处理器 601可以根据预设时间间隔读取到至少一个数据 库的数据与至少一个备份文件的数据比较的情况, 将监测结果分为 以下四种类型: 第一种类型: 预设时间间隔读取的所述至少一个数据库的数据, 相对于所述至少一个备份文件的数据不变; 第二种类型: 预设时间间隔读取的所述至少一个数据库的数据, 相对于所述至少一个备份文件的数据存在增加的数据;
第三种类型: 预设时间间隔读取的所述至少一个数据库的数据 与所述至少一个备份文件的数据不一致;
第四种类型: 预设时间间隔读取的所述至少一个数据库的数据 比所述至少一个备份文件的数据少。 下面仅以通讯录数据库为例对处理器 601 确定四种监测结果的 方法进行说明。 假设处理器 601生成的通讯录数据库的备份文件的数据如表 2所 示。 根据表 2可知, 处理器 601生成的通讯录数据库的备份文件的数 据为四项数据, 分别为数据 1、 数据 2、 数据 3和数据 4 , 每项数据 包含姓名, 移动电话号码, 固定电话号码等属性信息中的至少一项。 需要说明的是, 本发明实施例涉及的数据 1、 数据 2 和数据 3 等仅是为了更清楚对本实施例进行说明而定义的标识, 不对本发明 实施例构成限制, 本发明实施例中数据库和备份文件的数据通过标 识进行对应, 例如, 通讯录数据库中标识为 "数据 1 " 的数据和通讯 录数据库的备份文件中标识为 "数据 1 " 的数据对应。
1、 若处理器 601 确定预设时间间隔读取的至少一个数据库的数 据, 相对于至少一个备份文件的数据的项数以及每项数据的属性信 息完全相同, 则确定预设时间间隔读取到的数据库中的数据相对于 数据库的备份文件中的数据不变。
例如, 假设处理器 601预设时间间隔读取到的通讯录数据库中的 数据如表 3所示。
根据表 3可知, 处理器 601预设时间间隔读取到的通讯录数据库 中的数据为四项数据, 分别为数据 1、 数据 2、 数据 3和数据 4 , 每 个数据包含姓名, 移动电话号码, 固定电话号码等属性信息中的至 少一项。
处理器 601 将预设时间间隔读取到的通讯录数据库中的四项数 据与通讯录数据库的备份文件的四项数据逐项进行比较, 根据表 2
和表 3可知, 表 2 中的数据 1、 数据 2、 数据 3和数据 4的的属性信 息分别与表 3 中的数据 1、数据 2、数据 3和数据 4的属性信息相同, 所以, 处理器 601确定预设时间间隔读取到的通讯录数据库中的四项 数据与通讯录数据库的备份文件的四项数据的属性信息完全相同, 所以, 确定预设时间间隔读取到的通讯录数据库中的数据相对于通 讯录数据库的备份文件中的数据不变。
2、 若处理器 601 确定预设时间间隔读取的至少一个数据库的数 据除包含至少一个备份文件的全部数据外, 还包含至少一个备份文 件中没有的数据, 则确定预设时间间隔读取的所述至少一个数据库 的数据, 相对于所述至少一个备份文件的数据存在增加的数据。 例如, 假设处理器 601预设时间间隔读取到的通讯录数据库中的 数据如表 4所示。 根据表 4可知, 处理器 601预设时间间隔读取到的 通讯录数据库中的数据包含五项数据。 处理器 601 将预设时间间隔读取到的通讯录数据库中的五项数 据与通讯录数据库的备份文件的四项数据逐项进行比较, 根据表 2 和表 4可知, 表 4 中的数据 1、 数据 2、 数据 3和数据 4的属性信息 分别与表 2中数据 1、 数据 2、 数据 3和数据 4的属性信息相同, 而 且, 表 4中包含表 2中没有的数据 5 , 所以, 处理器 601确定预设时 间间隔读取到的通讯录数据库的数据除包含通讯录数据库的备份文 件的全部数据外, 还包含通讯录数据库的备份文件中没有的数据, 所以, 确定预设时间间隔读取的通讯录数据库的数据, 相对于通讯 录数据库的备份文件的数据存在增加的数据。
3、 若处理器 601 确定预设时间间隔读取的所述至少一个数据库 的数据的项数大于或等于所述至少一个备份文件的数据的项数, 且 预设时间间隔读取的所述至少一个数据库中至少一项数据的属性信 息与所述至少一个备份文件中对应数据的属性信息不完全相同, 则 处理器 601 确定预设时间间隔读取的所述至少一个数据库的数据与 所述至少一个备份文件的数据不一致。
例如, 假设处理器 601预设时间间隔读取到的通讯录数据库中的 数据如表 5所示。 根据表 5可知, 处理器 601预设时间间隔读取到的 通讯录数据库中的数据包含四项数据。 处理器 601 将预设时间间隔读取到的通讯录数据库中的四项数 据与通讯录数据库的备份文件的四项数据逐项进行比较, 根据表 2 和表 5可知, 表 5 中数据 1 的属性信息中的移动电话号码与表 2 中 数据 1 的属性信息中移动电话号码不同, 所以, 处理器 601确定预设 时间间隔读取的通讯录数据库的数据与通讯录数据库的备份文件的 数据不一致。 需要说明的是, 在预设时间间隔读取的数据库的数据的项数大 于数据库的备份文件中的数据的项数, 但是至少一项数据的属性信 息与数据库的备份文件中对应数据的属性信息不完全相同的情况 下, 处理器 601确定预设时间间隔读取的数据库的数据与数据库的备 份文件的数据不一致。 例如:假设预设时间间隔读取到的通讯录数据库中的数据如表 6 所示。 根据表 6可知, 虽然表 6 比表 2 包含的数据的项数多, 但是 因为表 6 中数据 1 的移动电话号码与表 2 中数据 1 的移动电话号码 不同, 所以, 处理器 601确定预设时间间隔读取的通讯录数据库的数 据与通讯录数据库的备份文件的数据不一致。
4、 若处理器 601 确定预设时间间隔读取的所述至少一个数据库 的数据的项数小于所述至少一个备份文件的数据的项数, 则处理器 601 确定预设时间间隔读取的所述至少一个数据库的数据比所述至 少一个备份文件的数据少。 例如: 假设处理器 601预设时间间隔读取到的通讯录数据库中的 数据如表 7所示。 根据表 7可知, 处理器 601预设时间间隔读取到的 通讯录数据库中包含三项数据。 处理器 601 将预设时间间隔读取到的通讯录数据库中的三项数 据与通讯录数据库的备份文件的四项数据逐项进行比较, 由表 7 和
表 2可知, 处理器 601预设时间间隔读取到的通讯录数据库中的数据 1、 数据 2和数据 3 与通讯录数据库的备份文件中的数据 1、 数据 2 和数据 3 的属性信息分别相同, 且预设时间间隔读取到的通讯录数 据库中不包含通讯录数据库的备份文件中的数据 4 ,所以,处理器 601 确定预设时间间隔读取的通讯录数据库的数据比通讯录的备份文件 的数据少。 进一步的, 所述处理器 601还用于: 当所述预设时间间隔读取的所述至少一个数据库的数据, 相对 于所述至少一个备份文件的数据存在增加的数据时, 将所述增加的 数据添加到所述至少一个备份文件; 或者, 将所述预设时间间隔读 取的所述至少一个数据库的数据, 替换所述至少一个备份文件。 在此仍以通讯录数据库为例进行说明。 例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数 据 3和数据 4 ,处理器 601预设时间间隔读取的通讯录数据库的数据 为数据 1、 数据 2、 数据 3、 数据 4和数据 5 , 预设时间间隔读取的 通讯录数据库的数据相对于通讯录数据库的备份文件增加的数据为 数据 5 ,则处理器 601可以直接将数据 5添加到通讯录数据库的备份 文件, 也可以用数据 1、 数据 2、 数据 3、 数据 4和数据 5替换通讯 录数据库的备份文件中的数据 1、 数据 2、 数据 3和数据 4。 进一步的, 所述处理器 601还用于: 当所述预设时间间隔读取的所述至少一个数据库的数据与所述 至少一个备份文件的数据不一致, 或者, 当所述预设时间间隔读取 的所述至少一个数据库的数据比所述至少一个备份文件少, 将所述 预设时间间隔读取的所述至少一个数据库的数据, 替换所述至少一 个备份文件。 在此仍以通讯录数据库为例进行说明。 例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数
据 3和数据 4 ,处理器 601预设时间间隔读取的通讯录数据库的数据 为数据 1、 数据 2、 数据 3和数据 4 , 但是预设时间间隔读取的数据 库中的数据 1 和通讯录数据库的备份文件中的数据 1 的属性信息不 完全相同, 则处理器 601 将预设时间间隔读取的通讯录数据库的数 据 1、 数据 2、 数据 3和数据 4替换通讯录数据库的备份文件中的数 据 1、 数据 2、 数据 3和数据 4。 再例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数据 3和数据 4 ,预设时间间隔读取的通讯录数据库的数据为数据 1、 数据 2、 数据 3和数据 5 , 则处理器 601将预设时间间隔读取的通讯 录数据库的数据数据 1、 数据 2、 数据 3和数据 5替换通讯录数据库 的备份文件中的数据 1、 数据 2、 数据 3和数据 4。 再例如, 若通讯录数据库的备份文件的数据为数据 1、 数据 2、 数据 3和数据 4 ,预设时间间隔读取的通讯录数据库的数据为数据 1、 数据 2和数据 3 ,则处理器 601将预设时间间隔读取的通讯录数据库 的数据 1、数据 2和数据 3替换通讯录数据库的备份文件中的数据 1、 数据 2、 数据 3和数据 4。 进一步的, 当所述备份请求包括请求备份的数据库标识时, 所 述处理器 601还用于: 根据所述备份请求中的所述数据库标识,通过所述 USB接口 603 向所述第二终端发送所述数据库标识对应的更新的至少一个备份文 件。
当备份请求包含预定义标识时, 可以进行一键备份, 处理器 601 通过所述 USB接口 603向第二终端发送全部备份文件。 例如, 处理 器 601生成并更新了三个备份文件,分别为数据库 A的备份文件 S l、 数据库 B的备份文件 S2和数据库 C的备份文件 S3 ,则当处理器 601 通过所述 USB接口 603接收到预定义标识时, 通过所述 USB接口 603 向第二终端发送更新的备份文件 S l、 备份文件 S2 和备份文件 S3。
进一步的, 当所述备份请求包括预定义标识时, 所述处理器 601 还用于: 根据所述备份请求中的所述预定义标识,通过所述 USB接口 603 向所述第二终端发送所述更新的至少一个备份文件。 当备份请求包含请求备份的数据库标识时, 处理器 601 根据数 据库和备份文件的对应关系, 通过所述 USB接口 603向第二终端发 送请求备份的数据库标识对应的备份文件。 例如, 处理器 601 生成 并更新了三个备份文件, 分别为数据库 A的备份文件 S l、 数据库 B 的备份文件 S2和数据库 C 的备份文件 S3 , 则当备份请求中包含数 据库 A的标识和数据库 B的标识时,处理器 601通过所述 USB接口 603向第二终端发送更新的备份文件 S 1和备份文件 S2。 进一步的, 处理器 601还用于: 通过所述 USB接口 603接收第 二终端发送的恢复请求以及至少一个备份文件; 将第二终端发送的 至少一个备份文件替换数据备份的终端设备 60 内的备份文件; 通过 所述 USB接口 603向第二终端发送第一响应消息, 以通知第二终端 恢复任务已完成; 读取备份文件中的数据, 将所述读取到的备份文 件的数据写入数据库。
其中, 第二终端可以向所述数据备份的终端设备 60发送第二终 端接收到的全部备份文件, 或者, 第二终端可以向所述数据备份的 终端设备 60发送第二终端接收到的部分备份文件, 本发明实施例对 此不进行限制, 当第二终端向所述数据备份的终端设备 60发送第二 终端接收到的全部备份文件时, 可以实现一键恢复。 本发明实施例提供一种数据备份的终端设备 60 , 处理器 601预 先读取至少一个数据库的数据并生成至少一个备份文件, 并在监测 到数据库的数据发生变化时更新备份文件, 使得备份文件的数据和 数据库的数据保持一致, 在通过 USB接口 603接收到备份请求后, 直接通过 USB接口 603向第二终端发送更新后的备份文件, 一次交 互即可将备份文件发送至第二终端, 减少了和第二终端之间的交互,
进而提高了数据备份的速度, 而且, 第二终端在完成一次交互之后 即可以进行其他业务, 所以, 提高了第二终端整体业务效率。 解决 了现有技术逐项读取需要备份的数据库的数据并逐项向第二终端发 送, 导致和第二终端之间交互多, 备份速度慢, 以及整体业务效率 低的缺陷。 在本申请所提供的几个实施例中, 应该理解到, 所揭露的***, 移动终端和方法, 可以通过其它的方式实现。 例如, 以上所描述的 移动终端实施例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为 一种逻辑功能划分, 实际实现时可以有另外的划分方式, 例如多个 单元或组件可以结合或者可以集成到另一个***, 或一些特征可以 忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直接 耦合或通信连接可以是通过一些接口, 移动终端或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。 所述作为分离部件说明的单元可以是或者也可以不是物理上分 开的, 作为单元显示的部件可以是或者也可以不是物理单元, 即可 以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实 际的需要选择其中的部分或者全部单元来实现本实施例方案的 目 的。 另外, 在本发明各个实施例中的各功能单元可以集成在一个处 理单元中, 也可以是各个单元单独物理包括, 也可以两个或两个以 上单元集成在一个单元中。 上述集成的单元既可以釆用硬件的形式 实现, 也可以釆用硬件加软件功能单元的形式实现。 上述以软件功能单元的形式实现的集成的单元, 可以存储在一 个计算机可读取存储介质中。 上述软件功能单元存储在一个存储介 质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 执行本发明各个实施例所述方法的部分 步骤。 而前述的存储介质包括: U 盘、 移动硬盘、 只读存储器 ( Read-Only Memory ,简称 ROM )、随机存取存储器( Random Access
Memory , 简称 RAM )、 磁碟或者光盘等各种可以存储程序代码的介 质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术人员应当理解: 其依然可以对前述各实施例所记 载的技术方案进行修改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本发明各实 施例技术方案的精神和范围。
Claims
1、 一种数据备份方法, 其特征在于, 包括:
读取至少一个数据库的数据;
备份所述至少一个数据库的数据, 生成至少一个备份文件; 监测所述至少一个数据库的数据是否变化;
当所述至少一个数据库的数据变化时, 更新所述至少一个备份文 件;
当接收到备份请求时, 向第二终端发送所述更新的至少一个备份 文件。
2、 根据权利要求 1 所述的方法, 其特征在于, 所述监测所述至 少一个数据库的数据是否变化, 包括:
根据预设时间间隔, 读取所述至少一个数据库的数据;
比较所述预设时间间隔读取的所述至少一个数据库的数据与所 述至少一个备份文件的数据;
根据比较结果, 确定所述至少一个数据库的数据是否变化。
3、 根据权利要求 2 所述的方法, 其特征在于, 当所述至少一个 数据库的数据变化时, 更新所述至少一个备份文件, 包括:
当所述预设时间间隔读取的所述至少一个数据库的数据, 相对于 所述至少一个备份文件的数据存在增加的数据时;
将所述增加的数据添加到所述至少一个备份文件; 或者,
将所述预设时间间隔读取的所述至少一个数据库的数据, 替换所 述至少一个备份文件的数据。
4、 根据权利要求 3 所述的方法, 其特征在于, 当所述至少一个 数据库的数据变化时, 更新所述至少一个备份文件, 还包括:
当所述预设时间间隔读取的所述至少一个数据库的数据与所述 至少一个备份文件的数据不一致, 或者, 当所述预设时间间隔读取的 所述至少一个数据库的数据比所述至少一个备份文件的数据少, 将所述预设时间间隔读取的所述至少一个数据库的数据, 替换所 述至少一个备份文件的数据。
5、 根据权利要求 1 -4 任一项所述的方法, 其特征在于, 所述备 份请求包括请求备份的数据库标识; 当接收到备份请求时, 向第二终端发送所述更新的至少一个备份 文件, 具体为: 根据所述备份请求中的所述数据库标识, 向所述第二终端发送所 述数据库标识对应的更新的至少一个备份文件。
6、 根据权利要求 1 -4 任一项所述的方法, 其特征在于, 所述备 份请求包括预定义标识; 当接收到备份请求时, 向第二终端发送所述更新的至少一个备份 文件, 具体为: 根据所述备份请求中的所述预定义标识, 向所述第二终端发送所 述更新的至少一个备份文件。
7、 一种数据备份装置, 其特征在于, 包括: 读取模块, 用于读取至少一个数据库的数据; 备份模块, 用于根据所述读取模块读取的所述至少一个数据库的 数据, 备份所述至少一个数据库的数据, 生成至少一个备份文件; 监测模块, 用于监测所述至少一个数据库的数据是否变化; 更新模块, 用于当所述监测模块监测到所述至少一个数据库的数 据变化时, 更新所述至少一个备份文件; 接收模块, 用于接收备份请求; 发送模块, 用于根据所述接收模块接收的备份请求, 向第二终端
发送所述更新的至少一个备份文件。
8、 根据权利要求 7所述的数据备份装置, 其特征在于, 所述读取模块, 还用于根据预设时间间隔, 读取所述至少一个数 据库的数据; 所述监测模块具体用于: 比较所述读取模块根据预设时间间隔读取的所述至少一个数据 库的数据与所述至少一个备份文件的数据; 根据比较结果, 确定所述至少一个数据库的数据是否变化。
9、 根据权利要求 8所述的数据备份装置, 其特征在于, 所述更新模块具体用于: 当确定所述监测模块监测到所述读取模块根据预设时间间隔读 取的所述至少一个数据库的数据, 相对于所述至少一个备份文件的数 据存在增加的数据时; 将所述增加的数据添加到所述至少一个备份文件; 或者, 将所述读取模块根据预设时间间隔读取的所述至少一个数据库 的数据, 替换所述至少一个备份文件的数据。
10、 根据权利要求 9所述的数据备份装置, 其特征在于, 所述更 新模块还用于: 当确定所述监测模块监测到所述读取模块根据预设时间间隔读 取的所述至少一个数据库的数据与所述至少一个备份文件的数据不 一致, 或者, 当所述监测模块确定所述读取模块根据预设时间间隔读 取的所述至少一个数据库的数据比所述至少一个备份文件的数据少, 将所述预设时间间隔读取的所述至少一个数据库的数据, 替换所 述至少一个备份文件的数据。
1 1、 根据权利要求 7- 10 任一项所述的数据备份装置, 其特征在 于, 所述备份请求包括请求备份的数据库标识; 所述发送模块具体用于: 根据所述备份请求中的所述数据库标识, 向所述第二终端发送所 述数据库标识对应的更新的至少一个备份文件。
12、 根据权利要求 7- 10 任一项所述的数据备份装置, 其特征在 于, 所述备份请求包括预定义标识; 所述发送模块具体用于: 根据所述备份请求中的所述预定义标识, 向所述第二终端发送所 述更新的至少一个备份文件。
13、 一种数据备份的终端设备, 其特征在于, 包括: 处理器、 存 储器, USB接口; 所述处理器用于, 读取至少一个数据库的数据, 备份所述至少一 个数据库的数据, 生成至少一个备份文件, 监测所述至少一个数据库 的数据是否变化, 并当所述至少一个数据库的数据变化时, 更新所述 至少一个备份文件, 并通过所述 USB 接口接收备份请求; 根据所述 备份请求, 通过所述 USB 接口向第二终端发送所述更新的至少一个 备份文件; 所述存储器用于, 存储所述至少一个数据库的数据, 以及所述至 少一个备份文件, 以及操作指令。
14、 根据权利要求 13 所述的一种数据备份的终端设备, 其特征 在于, 所述处理器还用于: 根据预设时间间隔, 读取所述至少一个数据库的数据; 比较所述预设时间间隔读取的所述至少一个数据库的数据与所 述至少一个备份文件的数据;
根据比较结果, 监测所述至少一个数据库的数据是否变化。
15、 根据权利要求 14所述的数据备份的终端设备, 其特征在于, 所述处理器还用于: 当所述预设时间间隔读取的所述至少一个数据库的数据, 相对于 所述至少一个备份文件的数据存在增加的数据时; 将所述增加的数据添加到所述至少一个备份文件; 或者, 将所述预设时间间隔读取的所述至少一个数据库的数据, 替换所 述至少一个备份文件。
16、 根据权利要求 15 任一项所述的数据备份的终端设备, 其特 征在于,
所述处理器还用于: 当所述预设时间间隔读取的所述至少一个数据库的数据与所述 至少一个备份文件的数据不一致, 或者, 当所述预设时间间隔读取的 所述至少一个数据库的数据比所述至少一个备份文件少, 将所述预设时间间隔读取的所述至少一个数据库的数据, 替换所 述至少一个备份文件。
17、 根据权利要求 13 - 16任一项所述的数据备份的终端设备, 其 特征在于, 所述备份请求包括请求备份的数据库标识; 所述处理器还用于: 根据所述备份请求中的所述数据库标识, 通过所述 USB 接口向 所述第二终端发送所述数据库标识对应的更新的至少一个备份文件。
18、 根据权利要求 13 - 16任一项所述的数据备份的终端设备, 其 特征在于,
所述备份请求包括预定义标识; 所述处理器还用于: 根据所述备份请求中的所述预定义标识, 通过所述 USB 所述第二终端发送所述更新的至少一个备份文件。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201480036349.9A CN105378723A (zh) | 2014-02-10 | 2014-02-10 | 一种数据备份方法及装置 |
PCT/CN2014/071913 WO2015117276A1 (zh) | 2014-02-10 | 2014-02-10 | 一种数据备份方法及装置 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2014/071913 WO2015117276A1 (zh) | 2014-02-10 | 2014-02-10 | 一种数据备份方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015117276A1 true WO2015117276A1 (zh) | 2015-08-13 |
Family
ID=53777119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/071913 WO2015117276A1 (zh) | 2014-02-10 | 2014-02-10 | 一种数据备份方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105378723A (zh) |
WO (1) | WO2015117276A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070099610A1 (en) * | 2005-10-31 | 2007-05-03 | Daesin Information Technology Co., Ltd. | Method of automatically backing up and restoring PIMS data of mobile communication terminal |
CN101351006A (zh) * | 2008-09-05 | 2009-01-21 | 宇龙计算机通信科技(深圳)有限公司 | 一种移动终端的通信数据备份方法及*** |
CN101719165A (zh) * | 2010-01-12 | 2010-06-02 | 山东高效能服务器和存储研究院 | 一种实现数据库高效快速备份的方法 |
CN102880531A (zh) * | 2012-09-27 | 2013-01-16 | 新浪网技术(中国)有限公司 | 数据库备份***及其备份方法和从数据库服务器 |
CN103268351A (zh) * | 2013-05-31 | 2013-08-28 | 网易(杭州)网络有限公司 | 一种数据同步方法和设备 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101426052A (zh) * | 2008-12-05 | 2009-05-06 | 上海闻泰电子科技有限公司 | 移动终端的通信录和短信的备份及导入方法 |
CN101661416B (zh) * | 2009-09-17 | 2012-10-10 | 宇龙计算机通信科技(深圳)有限公司 | 一种移动终端的数据备份方法及*** |
CN101729671A (zh) * | 2009-12-31 | 2010-06-09 | 宇龙计算机通信科技(深圳)有限公司 | 一种终端、备份文件管理的方法及*** |
CN103401904A (zh) * | 2013-07-19 | 2013-11-20 | 蓝盾信息安全技术股份有限公司 | 一种备份移动终端数据的方法 |
-
2014
- 2014-02-10 WO PCT/CN2014/071913 patent/WO2015117276A1/zh active Application Filing
- 2014-02-10 CN CN201480036349.9A patent/CN105378723A/zh active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070099610A1 (en) * | 2005-10-31 | 2007-05-03 | Daesin Information Technology Co., Ltd. | Method of automatically backing up and restoring PIMS data of mobile communication terminal |
CN101351006A (zh) * | 2008-09-05 | 2009-01-21 | 宇龙计算机通信科技(深圳)有限公司 | 一种移动终端的通信数据备份方法及*** |
CN101719165A (zh) * | 2010-01-12 | 2010-06-02 | 山东高效能服务器和存储研究院 | 一种实现数据库高效快速备份的方法 |
CN102880531A (zh) * | 2012-09-27 | 2013-01-16 | 新浪网技术(中国)有限公司 | 数据库备份***及其备份方法和从数据库服务器 |
CN103268351A (zh) * | 2013-05-31 | 2013-08-28 | 网易(杭州)网络有限公司 | 一种数据同步方法和设备 |
Also Published As
Publication number | Publication date |
---|---|
CN105378723A (zh) | 2016-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10261853B1 (en) | Dynamic replication error retry and recovery | |
TWI710897B (zh) | 資料處理方法和流計算系統 | |
US9031910B2 (en) | System and method for maintaining a cluster setup | |
WO2017107900A1 (zh) | 一种虚拟机恢复的方法及虚拟机管理设备 | |
WO2018049888A1 (zh) | 应用数据的迁移方法及装置 | |
JP6273927B2 (ja) | 情報処理システム,監視装置,監視プログラム,監視方法 | |
US10860447B2 (en) | Database cluster architecture based on dual port solid state disk | |
WO2020248507A1 (zh) | 基于容器云的***资源监控方法及相关设备 | |
WO2018121456A1 (zh) | 一种数据存储方法、服务器以及存储*** | |
CN112929401B (zh) | 一种注册方法及装置 | |
WO2015081470A1 (zh) | 数据处理设备和数据处理的方法 | |
WO2016078529A1 (zh) | 业务处理方法、装置及*** | |
CN108459824B (zh) | 一种数据修改写方法及装置 | |
WO2020088533A1 (zh) | 虚拟化平台的容灾方法及装置 | |
WO2021139224A1 (zh) | 云场景下的文件备份方法、装置、介质、电子设备 | |
WO2017088572A1 (zh) | 一种处理数据的方法、装置及*** | |
WO2013086811A1 (zh) | 数据处理方法、云服务器和终端 | |
US11275601B2 (en) | System and method for auto recovery of deleted virtual machines identified through comparison of virtual machine management application snapshots and having corresponding backups at a storage device | |
US20180129668A1 (en) | Intermediate file processing method, client, server, and system | |
US10496493B1 (en) | Method and system for restoring applications of particular point in time | |
CN112148206A (zh) | 一种数据读写方法、装置、电子设备及介质 | |
CN113419901A (zh) | 数据灾备方法、装置及服务器 | |
WO2015117276A1 (zh) | 一种数据备份方法及装置 | |
US11321185B2 (en) | Method to detect and exclude orphaned virtual machines from backup | |
JP2015114952A (ja) | ネットワークシステム、監視制御装置およびソフトウェア検証方法 |
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: 14881785 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: 14881785 Country of ref document: EP Kind code of ref document: A1 |