Summary of the invention
In order to address the above problem, the invention provides a kind of backup and reset mode based on Android system.The installation and operation request of applying by monitoring, manages backup and the recovery of application oriented database relevant information, can be types of applications backup and restoration interface are provided, thereby backup completely and the recovery of applying installation and operation data is provided.
Particularly, the present invention is based on Android system a kind of application oriented backup and Restoration Mechanism are provided, this mechanism should be used for managing backup restore database by monitoring, for types of applications provides backup and restoration interface.When application is mounted or move, the behavior of all access storage media all can be undertaken by these interfaces, adopt the mode of initiatively calling that all data or the fileinfo relevant to application are backed up, realized the backup of the data base system mode of application-dependent data.After software or hardware system renewal, the partial data that can realize application recovers.
According to the first scheme of the present invention, provide a kind of for backing up and recover the system of data, comprising: backup units, is configured to the data relevant with application to backup to far-end server; Recovery unit, is configured to recover the data relevant with application from far-end server; And monitoring unit, be configured to: when monitoring application when being mounted or moving, control as required backup units and/or recovery unit, to back up and/or to recover the data relevant with application.
In one embodiment, monitoring unit is configured to: when monitoring application when being mounted or moving, detect and whether have the data relevant with described application that backed up; And if there are the data relevant with described application that backed up and need recovery, the data relevant with described application of indicating described recovery unit recovery to back up.
In one embodiment, monitoring unit is configured to: when monitoring application when being mounted or moving, detect and whether have the data relevant with described application that backed up; And the data relevant with described application that if there is no backed up and need backup, indicate the described backup units pair data relevant with described application to back up.
In one embodiment, the data relevant with application comprise the installation configuration data of application.
In one embodiment, the data relevant with application comprise service data and the downloading data of application.
In one embodiment, backup units is configured to: the data relevant with application are carried out to format conversion, and backup to far-end server in the mode of encrypting and/or compress.
In one embodiment, this system also comprises: record cell, is configured to the information recording relevant with backup and recovery operation in journal file.
According to alternative plan of the present invention, provide a kind of for backing up and recover the method for data, comprising: when monitoring application when being mounted or moving, back up as required and/or recover the data relevant with application; Wherein, backup comprises the data relevant with application will be backuped to far-end server with the relevant data of application, recovers the data relevant with application and comprises from far-end server and recover and apply relevant data.
In one embodiment, when monitoring application when being mounted or moving, detect and whether have the data relevant with described application that backed up; And if there are the data relevant with described application that backed up and need recovery, the data relevant with described application that recovery has been backed up.
In one embodiment, when monitoring application when being mounted or moving, detect and whether have the data relevant with described application that backed up; And the data relevant with described application that if there is no backed up and need backup, the data relevant with described application are backed up.
In one embodiment, the data relevant with application comprise the installation configuration data of application.
In one embodiment, the data relevant with application comprise service data and the downloading data of application.
In one embodiment, the data relevant with application are carried out to format conversion, and backup to far-end server in the mode of encrypting and/or compress.
In one embodiment, the method also comprises: by the information recording relevant with backup and recovery operation in journal file.
Adopt the present invention, after there is software or hardware system renewal, can realize the complete recovery of the data of application level, avoided because the data of changing in the data recovery procedure after hardware or system upgrade recover imperfect.
Embodiment
To a preferred embodiment of the present invention will be described in detail, in description process, having omitted is unnecessary details and function for the present invention with reference to the accompanying drawings, to prevent that the understanding of the present invention from causing, obscures.
Fig. 1 shows according to an embodiment of the invention for backing up and recover the block diagram of the system of data.As shown in Figure 1, system 10 comprises backup units 110, recovery unit 120 and monitoring unit 130.Alternatively, system 10 can also comprise record cell 140.Below, each assembly of the system 10 shown in Fig. 1 is described in detail.
Backup units 110 is configured to the data relevant with application to backup to far-end server.Preferably, backup units 110 is carried out format conversion by the data relevant with application, and backups to far-end server in the mode of encrypting and/or compress.
Recovery unit 120 is configured to recover the data relevant with application from far-end server.
Monitoring unit 130 is configured to: when monitoring application when being mounted or moving, control as required backup units 110 and/or recovery unit 120, to back up and/or to recover the data relevant with application.For example, when monitoring unit 130 monitors application while being mounted, monitoring unit 130 detects whether there are the data relevant with described application that backed up.If have the data relevant with described application that backed up and need, recover, monitoring unit 130 indication recovery units 120 recover the data relevant with described application that backed up.On the other hand, data relevant with described application that if there is no backed up and need backup, 110 pairs of data relevant with described application of monitoring unit 130 indication backup units back up.In this example, the data relevant with application can comprise the installation configuration data of application.
Further, when monitoring unit 130 monitors application by operation, monitoring unit 130 detects whether there are the data relevant with described application that backed up.If have the data relevant with described application that backed up and need, recover, monitoring unit 130 indication recovery units 120 recover the data relevant with described application that backed up.On the other hand, data relevant with described application that if there is no backed up and need backup, 110 pairs of data relevant with described application of monitoring unit 130 indication backup units back up.In this example, the data relevant with application can comprise service data and the downloading data of application.
Record cell 140 is configured to the relevant information recording of the backup/restore operations of carrying out with backup units 110/ recovery unit 120 in journal file.
Below, using Android operating system as application scenarios, describe an application example of the system 10 shown in Fig. 1 in detail.
First whether system created backup restore database in the SqlLite database in detection system after starting.If do not created, will in SqlLite, create backup restore database and master data table, and complete initialization.If backup restore database creates, will carry out integrality and capacity inspection to backup restore database, guarantee that the complete available and memory space of backup restore database does not surpass warning value.After inspection work completes, can to backup restore database, check according to Fixed Time Interval, can normal process backup and recovery request to guarantee backing up restore database.
For application installation process all configuration informations and the data relevant with running, backup units 110 can be stored in database by clear-text way.Further, backup units 110 is by scheduled store mode, all Backup Datas relevant with installation, operation, the download of application in backup restore database are become to file with the download file that may exist on storage medium by zip ciphered compressed, in " apply names _ version information _ Info.zip " mode, (for example store, a_1.0Info.zip), and with demonstration storage mode in far-end server, back up.Below, introduce respectively contingent backup and recovery in the installation and operation of applying.
When the installation of applying, whether monitoring unit 130 there is corresponding backup information according to the title of application and version information inquiry.If there is no corresponding backup information, this application continues installation process.In this process, when install to produce towards storage medium operation time, backup units 110 is adjusted the installation configuration data AIC of this application transmission and change according to following form:
< Apply Names application version information is installed configuration data content bar item >,
Then, backup units 110 is written in corresponding tables of data.Meanwhile, whether backup units 110 for being installed into first line flag record, and writes this application in the appointment table of backup in restore database.
If there is corresponding backup, monitoring unit 130 can point out user whether to need to use corresponding backup information by system message.Now, if user selects to recover backup information, before continuing that this application is installed, the title of recovery unit 120 use application and version information are as crucial index information, from far-end server, obtain Backup Data, and by Backup Data deciphering and decompress(ion), revert to SqlLite database back-up data.Then, according to the database data recovering, recovery unit 120 judges whether to recover download file.If needed, from the content of deciphering and decompress(ion), obtain download file and recover.After completing all operations of the installation configuration restore for this application, the subsequent installation process of this application is carried out the installation configuration data according to recovering.Like this, after the installation of application finishes, can guarantee the use continuity of application.
If user selects not recover Backup Data, monitoring unit 130 can point out user whether to need to carry out backup operation by system message.If user selects to back up, backup units 110 is carried out backup operation.If user selects not back up, continue the installation process of application.
When application operation, need to back up service data (RD) and download file.When needs write storage medium by RD, backup units 110 is adjusted and is changed RD according to following form:
< Apply Names application version call method service data content >
Then, backup units 110 is written in corresponding data table.When there is file download behavior, backup units 110 needs the relevant information of the file of download to store in corresponding tables of data according to following form this application:
The full name of < Apply Names application version download file memory location download file >
Here, " the full name of download file " comprises file suffixes name.
Recovery in application running comprises the recovery of service data and download file.
When needs read RD from storage medium, recovery unit 120 is read RD content, then according to following form, resolves:
< Apply Names application version call method service data content >
Afterwards, recovery unit 120 is returned to application.
When needs recover download file, recovery unit 120 obtains and applies corresponding download file information, according to following form, resolves:
The full name of < Apply Names application version download file memory location download file >
Recovery unit 120 confirms by " download file memory location " and " the full name of download file " whether download file this locality can recover.If cannot find corresponding download file in " download file memory location ", recovery unit 120 returns to this locality from far-end server by the download file of backup, and restoration result is returned to this application.
According to the present embodiment, when there is software or hardware system renewal, can realize the complete recovery of the data of application level.
Fig. 2 shows according to an embodiment of the invention for backing up and recover the flow chart of the method for data.As shown in Figure 2,method 20 starts at step S210 place.
In step S220 place, the installation of monitoring and measuring application or ruuning situation.
At step S230 place, when monitoring the installation of application or moving, back up as required and/or recover and apply relevant data.For example, backup can comprise the data relevant with application will be backuped to far-end server with the relevant data of application, and recover the data relevant with application, can comprise from far-end server and recovers and apply relevant data.
For example, when monitoring application while being mounted, detect and whether have the data relevant with described application that backed up.If have the data relevant with described application that backed up and need, recover, recover the data relevant with described application that backed up.On the other hand, the data relevant with described application that if there is no backed up and need backup, the data relevant with described application are backed up.In this example, the data relevant with application can comprise the installation configuration data of application.
When monitoring application by operation, detect and whether have the data relevant with described application that backed up.If have the data relevant with described application that backed up and need, recover, recover the data relevant with described application that backed up.On the other hand, the data relevant with described application that if there is no backed up and need backup, the data relevant with described application are backed up.In this example, the data relevant with application can comprise service data and the downloading data of application.
Preferably, in backup procedure, the data relevant with application can be carried out to format conversion, and backup to far-end server in the mode of encrypting and/or compress.
Alternatively, the method can also comprise: by the information recording relevant with backup and recovery operation in journal file.
Finally,method 20 finishes at step S240 place.
Should be appreciated that, the above embodiment of the present invention can realize by both combinations of software, hardware or software and hardware.For example, various assemblies in system 10 shown in Fig. 1 can be realized by multiple device, these devices include but not limited to: analog circuit, digital circuit, general processor, Digital Signal Processing (DSP) circuit, programmable processor, application-specific integrated circuit (ASIC) (ASIC), field programmable gate array (FPGA), programmable logic device (CPLD), etc.In addition, the mode that the various assemblies in system 10 also can combine by hardware and software realizes, or with the form of software, realizes completely.
In addition, those skilled in the art will appreciate that the data of describing in the embodiment of the present invention can be stored in local data base, also can be stored in distributed data base or can be stored in remote data base.
In addition, embodiments of the invention disclosed herein can be realized on computer program.More specifically, this computer program is following a kind of product: have computer-readable medium, on computer-readable medium, coding has computer program logic, and when carrying out on computing equipment, this computer program logic provides relevant operation to realize technique scheme of the present invention.While carrying out at least one processor at computing system, computer program logic makes the operation (method) described in the processor execution embodiment of the present invention.This set of the present invention is typically provided as and arranges or be coded in such as the software on the computer-readable medium of light medium (such as CD-ROM), floppy disk or hard disk etc., code and/or other data structures or such as other media or the Downloadable software image in one or more module, the shared data bank etc. of the firmware on one or more ROM or RAM or PROM chip or microcode.Software or firmware or this configuration can be arranged on computing equipment, so that the one or more processors in computing equipment are carried out the described technical scheme of the embodiment of the present invention.
So far invention has been described in conjunction with the preferred embodiments.Should be appreciated that, those skilled in the art without departing from the spirit and scope of the present invention, can carry out various other change, replacement and interpolations.Therefore, scope of the present invention is not limited to above-mentioned specific embodiment, and should be limited by claims.