CN102841827B - Method for backuping database files and communication terminal - Google Patents

Method for backuping database files and communication terminal Download PDF

Info

Publication number
CN102841827B
CN102841827B CN201210217423.XA CN201210217423A CN102841827B CN 102841827 B CN102841827 B CN 102841827B CN 201210217423 A CN201210217423 A CN 201210217423A CN 102841827 B CN102841827 B CN 102841827B
Authority
CN
China
Prior art keywords
backup
database
database file
file
communication terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201210217423.XA
Other languages
Chinese (zh)
Other versions
CN102841827A (en
Inventor
郭和平
金永虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201210217423.XA priority Critical patent/CN102841827B/en
Publication of CN102841827A publication Critical patent/CN102841827A/en
Application granted granted Critical
Publication of CN102841827B publication Critical patent/CN102841827B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention is applicable to the technical field of communication, and provides a method for backuping database files. The method comprises the steps that: after the backup command of a database file is received, a communication terminal is detected to be in an idle state or not; if in the idle state, the database file is backed up; during the backuping process of the database file, the communication terminal is detected to be in the idle state or not; and if still in the idle state, the database file is continuously backed up till completion, and otherwise, the database file is stopped backuping. Correspondingly, the invention further provides the communication terminal. Consequently, the backup is determined to execute or not according to the current operation state through the communication terminal, not only can the backup efficiency of the database files be increased, but also the normal working of the communication terminal can be prevented from being influenced.

Description

The backup method of database file and communication terminal
Technical field
The present invention relates to communication technical field, particularly relate to a kind of backup method and communication terminal of database file.
Background technology
In communication terminal, the wide area information server such as address list, communications records file is very important for user, once these database files are lost or damaged, will cause very large puzzlement to user.Therefore, existing communication terminal provides the backup functionality of database file, and (use experience with the experience of developer or user) can be selected sometime to carry out background backup to the significant data library file in communication terminal; When finding that database file damages, then carry out recovery operation with database file corresponding in backup, lose to avoid database file.But also there is following defect in available data library backup:
One, when carrying out the backup of database file, the running status considering communication terminal can not be gone, user in data backup may be caused normally cannot to use communication terminal, even cannot wake communication terminal up;
Two, in order to not affect the normal work of communication terminal, the BACKUP TIME of database file was selected usually at night, and the database file of the communication terminal causing shut down night cannot be backed up;
Three, when carrying out the backup of database file, all directly carrying out data Replica, may cause having backed up impaired database file;
Four, when carrying out the backup of database file, stopping if backup procedure is unexpected, backup rate database file that is slow or backup may be caused unavailable;
Five, when carrying out the backup of database file, not considering rights concerns, some database file may be caused successfully to back up.
In summary, obviously there is inconvenience and defect in actual use, so be necessary to be improved in the redundancy technique of available data library file.
Summary of the invention
For above-mentioned defect, the object of the present invention is to provide a kind of backup method and communication terminal of database file, it can determine whether performing backup according to the current operating conditions of communication terminal, not only can improve the backup efficiency of database file, and the normal work affecting communication terminal can be avoided.
To achieve these goals, the invention provides a kind of backup method of database file, comprising step has:
After receiving the backup instruction of database file, detect communication terminal and whether be in idle condition;
If be in described idle condition, then carry out the backup of described database file;
In the backup procedure of described database file, detect described communication terminal and whether be still in idle condition;
If be still in described idle condition, then proceed the backup of described database file until complete, otherwise stop the backup of described database file.
According to backup method of the present invention, described in receive the step of the backup instruction of database file before also comprise:
After receiving the screen broadcasting instructions that goes out, detect described communication terminal and whether be in idle condition;
If be in described idle condition, set the backup reference time of next time backing up;
When described backup arrives reference time, trigger and broadcast the described backup instruction of described database file.
According to backup method of the present invention, also comprise:
Set up backup directory, and the access limit of open described backup directory;
Described step of carrying out the backup of described database file also comprises:
Judge whether this application has the backup authority of described database file;
If have described backup authority, then direct by described Backup of database files to described backup directory;
If do not have described backup authority, then send the object being broadcast to and there is backup authority, notify described object by described Backup of database files to described backup directory.
According to backup method of the present invention, described in carry out the backup of described database file step also comprise:
Judge whether to be in predetermined time out section;
If be in described time out section, then suspend the backup of described database file, and the control of release to central processing unit.
According to backup method of the present invention, described in carry out the backup of described database file step also comprise:
Need the former database file backed up in coping database, and the first database temporary file that rename generates correspondence is carried out to the described former database file copied;
Described in the backup procedure of database file, detect the step whether described communication terminal be still in idle condition and comprise:
In the reproduction process of described database file, detect whether receive bright screen broadcasting instructions;
Still be in idle condition if described, then proceed the backup of described database file until complete, otherwise stop the step of the backup of described database file to comprise:
If receive described bright screen broadcasting instructions, then stop copying described former database file, and delete described first database temporary file;
If do not receive described bright screen broadcasting instructions, then what proceed described former database file copies until complete;
After this former database file completes and copies, detect whether to open described first database temporary file;
If described first database temporary file can be opened, then rename is carried out to described first database temporary file and generate corresponding Backup Data library file;
If described first database temporary file can not be opened, then delete described first database temporary file.
The present invention also provides a kind of communication terminal, includes:
First detection module, for receive database file backup instruction after, detect communication terminal and whether be in idle condition;
Backup module, for when described first detection module detects that described communication terminal is in described idle condition, carries out the backup of described database file;
Second detection module, in the backup procedure of described database file, detects described communication terminal and whether is still in idle condition;
Described backup module also for when described second detection module detects that described communication terminal is still in described idle condition, proceeds the backup of described database file until complete, otherwise stops the backup of described database file.
According to communication terminal of the present invention, described communication terminal also comprises:
3rd detection module, after receiving the screen broadcasting instructions that goes out, detects described communication terminal and whether is in idle condition;
Time setting module, for when described 3rd detection module detects that described communication terminal is in described idle condition, sets the backup reference time of next time backing up;
Instruction triggers module, for when described backup arrives reference time, triggers and broadcasts the described backup instruction of described database file.
According to communication terminal of the present invention, described communication terminal also comprises:
Catalogue sets up module, for setting up backup directory, and the access limit of open described backup directory;
Authority judge module, for when described first detection module detects that described communication terminal is in described idle condition, judges whether described backup module has the backup authority of described database file;
When described backup module is also for having described backup authority, directly by described Backup of database files to described backup directory; And during for not having described backup authority, sending the object being broadcast to and there is backup authority, notifying described object by described Backup of database files to described backup directory.
According to communication terminal of the present invention, described backup module also comprises:
Judging submodule, being in predetermined time out section for judging whether;
Suspending submodule, during for being in described time out section, suspending the backup of described database file, and the control of release to central processing unit.
According to communication terminal of the present invention, described backup module also comprises replicon module and stops submodule;
Described replicon module, for needing the former database file backed up in coping database, and carries out to the described former database file copied the first database temporary file that rename generates correspondence;
Described second detection module, also in the reproduction process of described database file, detects whether receive bright screen broadcasting instructions;
Described stopping submodule, during for receiving described bright screen broadcasting instructions, stopping copying described former database file, and deleting described first database temporary file;
When described replicon module is not also for receiving described bright screen broadcasting instructions, then proceed copying until complete of described former database file, and the backup data files that rename generates correspondence is carried out to described first database temporary file.
The present invention, after receiving the backup instruction of database file, detects communication terminal and whether is in idle condition, be only in the back-up job that idle condition just can start database file; And in the backup procedure of database file, detect communication terminal further and whether be still in idle condition, if be still in idle condition, then continue backup procedure until complete, otherwise stop the backup of database file; If critical data storehouse is damaged in communication terminal in the future, restoring operation can be carried out with the database file backed up, to avoid information loss.Whereby, the present invention can determine whether starting and continuing backup according to the current operating conditions of communication terminal, not only can improve the backup efficiency of database file, and backup operation can be avoided the impact of the normal work of communication terminal.Secondly, the operation that the authority that invention increases open backup directory authority and backup side judges, to ensure that backup operation cannot can not be carried out because of rights concerns.In addition, the present invention, by introducing database temporary file in backup procedure, can accelerate the relative velocity backed up, and ensures consistance and the integrality of database file further simultaneously; In addition, present invention also adds to database temporary file open judgement operation, to avoid backing up the database file damaged, to ensure the availability of Backup Data library file.
Accompanying drawing explanation
Fig. 1 is the structural representation of communication terminal of the present invention;
Fig. 2 is the structural representation of preferred communication terminal of the present invention;
Fig. 3 is the structural representation of the recovery module of preferred communication terminal of the present invention;
Fig. 4 is the process flow diagram of the backup method of database file of the present invention;
Fig. 5 is the process flow diagram of the backup method of database file in first embodiment of the invention;
Fig. 6 is the process flow diagram of the backup method of database file in second embodiment of the invention;
Fig. 7 is the flow instance figure of trigger backups instruction in backup method of the present invention; And
Fig. 8 is the flow instance figure of the method for reducing of database file of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 1 is the structural representation of communication terminal of the present invention, described communication terminal 100 can be mobile phone, PDA (Personal Digital Assistant, personal digital assistant), panel computer etc., and communication terminal 100 includes first detection module 10, backup module 20 and the second detection module 30, wherein:
Described first detection module 10, for receive database file backup instruction after, detect communication terminal 100 and whether be in idle condition.
Described backup module 20, for when first detection module 10 detects that communication terminal 100 is in idle condition, carries out the backup of database file.The database file that backup module 20 backs up for needs predetermined in backup database, such as important contacts.db etc., the database file needing backup can be set by system default, the self-defined database file needing backup can certainly be carried out by user.
Described second detection module 30, in the backup procedure of database file, detects communication terminal 100 and whether is still in idle condition.
Described backup module 20, also for when the second detection module 30 detects that communication terminal 100 is still in idle condition, proceeds the backup of database file until complete, otherwise stops the backup of database file.
The present invention is before the backup of database file starts and among backup procedure, all need to guarantee that communication terminal 100 is in idle condition, to determine whether start and continue backup, not only can improve the backup efficiency of database file, and backup operation can be avoided the impact of the normal work of communication terminal 100.Whether communication terminal 100 is in idle condition, can after the screen of communication terminal 100 be in screen state a period of time of going out, again the running status of communication terminal 100 detected and judge, idle condition herein can be determined according to specific circumstances voluntarily, mainly comprise screen state of going out, network state, communications status, CPU (Central ProcessingUnit, central processing unit) state etc.; And screen to be in screen state of going out be the important restrictions condition that backup procedure carries out in an idle state, and in operation by realizing easily the reception of bright screen broadcast and screen broadcast of going out.Preferably, the backup procedure of database file of the present invention uses background thread to carry out, and prevents the main thread of application or Provider (provider) from blocking.Be more preferably, the present invention is arranged on backup at non-night, but owing to not knowing when user can use communication terminal 100, database file to be backed up can be divided into several small documents, application piecemeal and the mode resumed, can reduce the probability be stopped among backup procedure.
Fig. 2 is the structural representation of preferred communication terminal of the present invention, described communication terminal 100 can include first detection module 10, backup module 20, second detection module 30, the 3rd detection module 40, time setting module 50, instruction triggers module 60, catalogue set up module 70, authority judge module 80 and/or recovery module 90, wherein:
Described 3rd detection module 40, after receiving the screen broadcasting instructions that goes out, detects communication terminal 100 and whether is in idle condition.
Described time setting module 50, for when the 3rd detection module 40 detects that communication terminal 100 is in idle condition, sets the backup reference time of next time backing up.The present invention preferably set the set time as backup reference time, be preferably selected in and cause backing up to avoid user to shut down evening daytime, such as every day 16:00.
Described instruction triggers module 60, for when back up arrive reference time time, trigger and the backup instruction of broadcast data library file.
Described first detection module 10, for receive database file backup instruction after, detect communication terminal 100 and whether be in idle condition.
Described catalogue sets up module 70, for setting up backup directory, and the access limit of open backup directory, backup directory can at will be read and write.
Described authority judge module 80, for when first detection module 10 detects that communication terminal 100 is in idle condition, judges whether backup module 20 has the backup authority of database file.
Described backup module 20, for have backup authority time, directly by Backup of database files to backup directory; And during for not having backup authority, send the object being broadcast to and there is backup authority, such as there are the backup application of authority or provider etc., notify described object by Backup of database files to backup directory.
The operation that the authority that invention increases open backup directory authority and backup side judges, to ensure that backup operation cannot can not be carried out because of rights concerns.
Described backup module 20 also comprises:
Judging submodule 21, being in predetermined time out section for judging whether in backup procedure.
Suspending submodule 22, during for being in time out section, suspending the backup of database file, and the control of release to CPU.By asking type release CPU control of having a rest, can preventing backup procedure from taking, CPU is too high causes that operation is slow, standby calls out problems such as not waking up.Discharge and backup after the control of CPU suspended, if time out section in the past after, will automatically recover the control to CPU, and again backup continued on former basis.
Described backup module 20 also comprises replicon module 23 and stops submodule 24, wherein:
Replicon module 23, for needing the former database file backed up in coping database, and carries out to the former database file copied the first database temporary file that rename generates correspondence.Such as, when copying beginning, under copying to backup directory by needing the database file such as contacts.db etc. backed up in certain database, and naming in the mode of database temporary file, preferably can adopt the method increasing suffix.
Second detection module 30, also in the reproduction process of database file, detects whether receive bright screen broadcasting instructions.
Stop submodule 24, during for receiving bright screen broadcasting instructions, forcing stopping to copy former database file, and deleting the first database temporary file.Whether the reproduction process due to database file is consuming time relatively long, need to monitor screen and be waken up, stop copying to ensure the normal use of user immediately if be waken up, and these replicated database file to delete.Because if stop copying and not deleting the file previously copied, when again copying, because doubling time exists different, the problem that replicated database file and current database file are inconsistent may be caused.
Replicon module 23, time also for not receiving bright screen broadcasting instructions, then proceeds copying until complete of former database file, and carries out to the first database temporary file the backup data files that rename generates correspondence.
The present invention, by introducing database temporary file in backup procedure, can accelerate the relative velocity backed up, and ensures consistance and the integrality of database file further simultaneously; But the present invention adds suffix name when Backup Data library file, generate database temporary file, when database file has all copied, the suffix name of delete database temporary file, just can obtain rapidly formal Backup Data library file, it is very fast that relative velocity mentioned here refers to that the suffix name of Update Table storehouse temporary file becomes the speed of this process of actual data library file soon.In addition, present invention also adds to database temporary file open judgement operation, to avoid backing up the database file damaged, to ensure the availability of Backup Data library file.
Fig. 3 is the structural representation of the recovery module of preferred communication terminal of the present invention, and described recovery module 90 comprises deletes submodule 91, reduction copying submodule 92, first rename submodule 93 and/or the second rename submodule 94, wherein:
Described deletion submodule 91, for receive database file reduction instruction after, delete in described database the described former database file needing to reduce.When database is damaged, the reduction instruction of the direct trigger data library file of meeting.
Described reduction copying submodule 92, for copying the described Backup Data library file corresponding with described former database file.
Described first rename submodule 93, forms the second corresponding database temporary file for carrying out rename to the described Backup Data library file copied.
Described second rename submodule 94, forms corresponding new database file for carrying out rename to described second database temporary file, so far completes the reduction process of database file.
Such as, when user uses application, when the database of accessing this application finds this database corruption, first delete legacy data storehouse, then the corresponding data library file backed up is carried out copying reduction from backup directory.Because reduction process is triggered by event, and require immediately to carry out, so process CIMS is simple, but the same method first generating the rename again of database temporary file that adopts is carried out, accelerate the relative velocity of backup with this, and ensure consistance and the integrality of database file.The processing mode of reduction process is included in the method for backup procedure, consistent with the processing mode copied to authority, repeats no more herein.
Fig. 4 is the process flow diagram of the backup method of database file of the present invention, and it realizes by communication terminal 100 as shown in Figure 1 or 2, and comprising step has:
Step S401, receives the backup instruction of database file.
Step S402, detects communication terminal 100 and whether is in idle condition, if then perform step S404, otherwise performs step S403.Whether communication terminal 100 is in idle condition, can after communication terminal 100 be in screen state a period of time of going out, judge by detecting the running status of communication terminal 100, idle condition herein can be determined according to specific circumstances voluntarily, mainly comprises screen state of going out, network state, communications status, CPU state etc.
Step S403, if be in busy state, then process ends, namely can not start the backup of database file.
Step S404, if be in idle condition, then carries out the backup of database file.The database file of needs backup predetermined in backup database in this step, can arrange by system default the database file needing backup, can certainly carry out the self-defined database file needing backup by user.
Step S405, in the backup procedure of database file, detects communication terminal 100 and whether is still in idle condition, if then perform step S406, otherwise perform step S407.It is the important restrictions condition that backup procedure carries out in an idle state that screen is in screen state of going out, and in operation by realizing easily the reception of bright screen broadcast and screen broadcast of going out.
Step S406, if be still in idle condition, then proceeds the backup of database file until complete.
Step S407, if be not in idle condition, then stops the backup of database file.
Fig. 5 is the process flow diagram of the backup method of database file in first embodiment of the invention, and it realizes by communication terminal 100 as shown in Figure 2, and comprising step has:
Step S501, receives the screen broadcasting instructions that goes out.
Step S502, detects communication terminal 100 and whether is in idle condition, if then perform step S504, otherwise performs step S503.
Step S503, if be in busy state, process ends.
Step S504, if be in idle condition, sets the backup reference time of next time backing up.The present invention preferably set the set time as backup reference time, be preferably selected in and cause backing up to avoid user to shut down evening daytime, such as every day 16:00.
Step S505, when back up arrive reference time time, trigger and the backup instruction of broadcast data library file.
Step S506, detects communication terminal 100 and whether is in idle condition, if then perform step S507, otherwise returns step S503.
Step S507, sets up backup directory, and the access limit of open backup directory, backup directory can at will be read and write.
Step S508, judges whether this application has the backup authority of database file, if then perform step S509, otherwise performs step S510.
Step S509, if having backup authority, then direct by Backup of database files to backup directory.Owing to having opened the access limit of this catalogue when creating backup directory, always can carry out so copy.
Step S510, if do not have backup authority, then sends the object being broadcast to and having backup authority, such as, has the backup application of authority or provider (provider) etc., notify object by Backup of database files to backup directory.The operation that the authority that invention increases open backup directory authority and backup side judges, to ensure that backup operation cannot can not be carried out because of rights concerns.
Step S511, judges whether to be in predetermined time out section, if then perform step S512, otherwise performs step S513.
Step S512, if be in time out section, then suspends the backup of database file, and the control of release to CPU.By batch-type release CPU control, can prevent backup procedure take CPU too high cause operation slow, standby call out wake up etc. problem.Discharge and backup after the control of CPU suspended, if time out section in the past after, will automatically recover the control to CPU, and again backup continued on former basis.
Step S513, in the backup procedure of database file, detects communication terminal 100 and whether is still in idle condition, if then perform step S514, otherwise perform step S515.
Step S514, if be still in idle condition, then proceeds the backup of database file until complete.
Step S515, if be not in idle condition, then stops the backup of database file.
Fig. 6 is the process flow diagram of the backup method of database file in second embodiment of the invention, and it realizes by communication terminal 100 as shown in Figure 2, and comprising step has:
Step S601, receives the backup instruction of database file.
Step S602, detects communication terminal 100 and whether is in idle condition, if then perform step S604, otherwise performs step S603.
Step S603, if be in busy state, then process ends.
Step S604, if be in idle condition, then needs the former database file backed up in coping database, and carries out to the former database file copied the first database temporary file that rename generates correspondence.Preferably the first database temporary file is saved in backup directory, such as, when copying beginning, under copying to backup directory by needing the database file such as contacts.db etc. backed up in certain database, and name in the mode of database temporary file, such as, can adopt the method increasing suffix.
Step S605, in the reproduction process of database file, detects whether receive bright screen broadcasting instructions, if then perform step S607, otherwise performs step S606.
Step S606, if receive bright screen broadcasting instructions, then stops copying former database file, and deletes the first database temporary file.Whether the reproduction process due to database file is consuming time relatively long, need to monitor screen and be waken up, if be waken up the normal use stopping copying to ensure user immediately, and these files copied will be deleted.
Step S607, if do not receive bright screen broadcasting instructions, then proceeds copying until complete of former database file.
Step S608, after this former database file completes and copies, detects whether to open the first database temporary file, if then perform step S609, otherwise performs step S610.If copied, then the interface of calling data base management system has carried out opening operation to the first database temporary file under backup directory, ensures the availability of database file.
Step S609, if successfully can open the first database temporary file, illustrates that this first database temporary file can be used, then carry out rename to the first database temporary file and generate corresponding Backup Data library file.
Step S610, if successfully can not open the first database temporary file, illustrates that this first database temporary file is unavailable, then deletes the first database temporary file.
Fig. 7 is the flow instance figure of trigger backups instruction of the present invention, and it realizes by communication terminal 100 as shown in Figure 2, and comprising step has:
Step S701, receives the screen broadcasting instructions that goes out.
Step S702, detects communication terminal 100 and whether is in idle condition, if then perform step S704, otherwise performs step S703.
Step S703, if be in busy state, then process ends.
Step S704, if be in idle condition, sets backup T0 reference time next time backed up.T0 is generally taken at daytime, as 16:00, and 0 < T0-current time < 24 hours).
Step S705, judges that T0 deducts 9 minutes and whether is greater than current time, if then perform step S706, otherwise performs step S707.
Step S706, setting timer time T1=T0.
Step S707, setting timer time T1=T0+9 minute.
Step S708, setting-up time is the timer of T1, Broadcast Backup instruction when this timer triggers.Preferably, if before timer not yet triggers, receive bright screen broadcasting instructions, then can remove the timer sending backup broadcast.
Fig. 8 is the flow instance figure of the method for reducing of database file of the present invention, and it realizes by communication terminal 100 as shown in Figures 2 and 3 and recovery module 70 thereof, and comprising step has:
Step S801, works as database corruption, the reduction instruction of trigger data library file;
Step S802, after receiving the reduction instruction of database file, deletes in described database the described former database file needing to reduce.
Step S803, detects whether backed up the Backup Data library file corresponding with described former database file, if then perform step S805, otherwise performs step S804.
Step S804, if do not back up, then process ends.
Step S805, if back up, then copies the described Backup Data library file corresponding with described former database file, and carries out to the described Backup Data library file copied the second database temporary file that rename forms correspondence.
Step S806, carry out rename to described second database temporary file and form corresponding new database file, described new database file is formal database file.
Such as, when user uses application, when the database of accessing this application finds this database corruption, first delete legacy data storehouse, then the corresponding data library file backed up is carried out copying reduction from backup directory.Because reduction process is triggered by event, and require immediately to carry out, so process CIMS is simple, but the same method first generating the rename again of database temporary file that adopts is carried out, accelerate the relative velocity of backup with this, and ensure consistance and the integrality of database file.The processing mode of reduction process is included in the method for backup procedure, consistent with the processing mode copied to authority, repeats no more herein.
In sum, the present invention, after receiving the backup instruction of database file, detects communication terminal and whether is in idle condition, be only in the back-up job that idle condition just can start database file; And in the backup procedure of database file, detect communication terminal further and whether be still in idle condition, if be still in idle condition, then continue backup procedure until complete, otherwise stop the backup of database file; If critical data storehouse is damaged in communication terminal in the future, restoring operation can be carried out with the database file backed up, to avoid information loss.Whereby, the present invention can determine whether starting and continuing backup according to the current operating conditions of communication terminal, not only can improve the backup efficiency of database file, and backup operation can be avoided the impact of the normal work of communication terminal.Secondly, the operation that the authority that invention increases open backup directory authority and backup side judges, to ensure that backup operation cannot can not be carried out because of rights concerns.In addition, the present invention, by introducing database temporary file in backup procedure, can accelerate the relative velocity backed up, and ensures consistance and the integrality of database file further simultaneously; In addition, present invention also adds to database temporary file open judgement operation, to avoid backing up the database file damaged, to ensure the availability of Backup Data library file.
Certainly; the present invention also can have other various embodiments; when not deviating from the present invention's spirit and essence thereof; those of ordinary skill in the art are when making various corresponding change and distortion according to the present invention, but these change accordingly and are out of shape the protection domain that all should belong to the claim appended by the present invention.

Claims (8)

1. a backup method for database file, is characterized in that, comprising step has:
After receiving the backup instruction of database file, detect communication terminal and whether be in idle condition;
If be in described idle condition, then carry out the backup of described database file;
In the backup procedure of described database file, detect described communication terminal and whether be still in idle condition;
If be still in described idle condition, then proceed the backup of described database file until complete, otherwise stop the backup of described database file;
Described step of carrying out the backup of described database file also comprises:
Need the former database file backed up in coping database, and the first database temporary file that rename generates correspondence is carried out to the described former database file copied;
Described in the backup procedure of database file, detect the step whether described communication terminal be still in idle condition and comprise:
In the reproduction process of described database file, detect whether receive bright screen broadcasting instructions;
Still be in idle condition if described, then proceed the backup of described database file until complete, otherwise stop the step of the backup of described database file to comprise:
If receive described bright screen broadcasting instructions, then stop copying described former database file, and delete described first database temporary file;
If do not receive described bright screen broadcasting instructions, then what proceed described former database file copies until complete;
After this former database file completes and copies, detect whether to open described first database temporary file;
If described first database temporary file can be opened, then rename is carried out to described first database temporary file and generate corresponding Backup Data library file;
If described first database temporary file can not be opened, then delete described first database temporary file.
2. backup method according to claim 1, is characterized in that, described in receive the step of the backup instruction of database file before also comprise:
After receiving the screen broadcasting instructions that goes out, detect described communication terminal and whether be in idle condition;
If be in described idle condition, set the backup reference time of next time backing up;
When described backup arrives reference time, trigger and broadcast the described backup instruction of described database file.
3. backup method according to claim 1, is characterized in that, also comprises:
Set up backup directory, and the access limit of open described backup directory;
Described step of carrying out the backup of described database file also comprises:
Judge whether this application has the backup authority of described database file;
If have described backup authority, then direct by described Backup of database files to described backup directory;
If do not have described backup authority, then send the object being broadcast to and there is backup authority, notify described object by described Backup of database files to described backup directory.
4. backup method according to claim 1, is characterized in that, described in carry out the backup of described database file step also comprise:
Judge whether to be in predetermined time out section;
If be in described time out section, then suspend the backup of described database file, and the control of release to central processing unit.
5. a communication terminal, is characterized in that, includes:
First detection module, for receive database file backup instruction after, detect communication terminal and whether be in idle condition;
Backup module, for when described first detection module detects that described communication terminal is in described idle condition, carries out the backup of described database file;
Second detection module, in the backup procedure of described database file, detects described communication terminal and whether is still in idle condition;
Described backup module also for when described second detection module detects that described communication terminal is still in described idle condition, proceeds the backup of described database file until complete, otherwise stops the backup of described database file;
Described backup module also comprises replicon module and stops submodule;
Described replicon module, for needing the former database file backed up in coping database, and carries out to the described former database file copied the first database temporary file that rename generates correspondence;
Described second detection module, also in the reproduction process of described database file, detects whether receive bright screen broadcasting instructions;
Described stopping submodule, during for receiving described bright screen broadcasting instructions, stopping copying described former database file, and deleting described first database temporary file;
When described replicon module is not also for receiving described bright screen broadcasting instructions, then proceed copying until complete of described former database file, and the backup data files that rename generates correspondence is carried out to described first database temporary file.
6. communication terminal according to claim 5, is characterized in that, described communication terminal also comprises:
3rd detection module, after receiving the screen broadcasting instructions that goes out, detects described communication terminal and whether is in idle condition;
Time setting module, for when described 3rd detection module detects that described communication terminal is in described idle condition, sets the backup reference time of next time backing up;
Instruction triggers module, for when described backup arrives reference time, triggers and broadcasts the described backup instruction of described database file.
7. communication terminal according to claim 5, is characterized in that, described communication terminal also comprises:
Catalogue sets up module, for setting up backup directory, and the access limit of open described backup directory;
Authority judge module, for when described first detection module detects that described communication terminal is in described idle condition, judges whether described backup module has the backup authority of described database file;
When described backup module is also for having described backup authority, directly by described Backup of database files to described backup directory; And during for not having described backup authority, sending the object being broadcast to and there is backup authority, notifying described object by described Backup of database files to described backup directory.
8. communication terminal according to claim 5, is characterized in that, described backup module also comprises:
Judging submodule, being in predetermined time out section for judging whether;
Suspending submodule, during for being in described time out section, suspending the backup of described database file, and the control of release to central processing unit.
CN201210217423.XA 2012-06-28 2012-06-28 Method for backuping database files and communication terminal Expired - Fee Related CN102841827B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210217423.XA CN102841827B (en) 2012-06-28 2012-06-28 Method for backuping database files and communication terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210217423.XA CN102841827B (en) 2012-06-28 2012-06-28 Method for backuping database files and communication terminal

Publications (2)

Publication Number Publication Date
CN102841827A CN102841827A (en) 2012-12-26
CN102841827B true CN102841827B (en) 2015-04-08

Family

ID=47369222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210217423.XA Expired - Fee Related CN102841827B (en) 2012-06-28 2012-06-28 Method for backuping database files and communication terminal

Country Status (1)

Country Link
CN (1) CN102841827B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744749A (en) * 2014-01-11 2014-04-23 浪潮电子信息产业股份有限公司 Virtual machine intelligent backup method based on prediction algorithm
CN106528582B (en) * 2015-09-15 2019-07-23 北京国双科技有限公司 The backup method and device of database
CN105786647A (en) * 2016-02-25 2016-07-20 努比亚技术有限公司 Data backup device and method and terminal
CN106201714A (en) * 2016-06-30 2016-12-07 宇龙计算机通信科技(深圳)有限公司 A kind of ODEX optimization method and system
CN108228384A (en) * 2016-12-22 2018-06-29 北京奇虎科技有限公司 A kind of method and apparatus of backup enterprise terminal data
CN108664524A (en) * 2017-03-31 2018-10-16 平安科技(深圳)有限公司 database data archiving method and system
CN110233851B (en) * 2019-06-21 2022-03-22 绿盟科技集团股份有限公司 Data transmission method and device
CN110471846B (en) * 2019-07-23 2024-05-07 平安科技(深圳)有限公司 Test data processing method and device based on automation platform and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980458A (en) * 2005-11-30 2007-06-13 中兴通讯股份有限公司 Method for realizing information back-up at network side
CN101765238A (en) * 2009-12-29 2010-06-30 上海闻泰电子科技有限公司 Intelligent backup time recognition method of mobile terminal
CN102289396A (en) * 2011-09-01 2011-12-21 宇龙计算机通信科技(深圳)有限公司 Terminal and backup and recovery method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1227616B1 (en) * 2001-01-26 2006-11-08 Siemens Aktiengesellschaft Method, program and arrangement for synchronization of a network manager with a network agent

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980458A (en) * 2005-11-30 2007-06-13 中兴通讯股份有限公司 Method for realizing information back-up at network side
CN101765238A (en) * 2009-12-29 2010-06-30 上海闻泰电子科技有限公司 Intelligent backup time recognition method of mobile terminal
CN102289396A (en) * 2011-09-01 2011-12-21 宇龙计算机通信科技(深圳)有限公司 Terminal and backup and recovery method

Also Published As

Publication number Publication date
CN102841827A (en) 2012-12-26

Similar Documents

Publication Publication Date Title
CN102841827B (en) Method for backuping database files and communication terminal
EP3493471B1 (en) Data disaster recovery method, apparatus and system
US20210011817A1 (en) Virtual Machine Recovery Method and Virtual Machine Management Device
US11892922B2 (en) State management methods, methods for switching between master application server and backup application server, and electronic devices
JP2008171387A (en) Backup system with continuous data protection
CN111327467A (en) Server system, disaster recovery backup method thereof and related equipment
CN105354113A (en) Server, and system and method for managing server
US20120101999A1 (en) Performing a background copy process during a backup operation
CN104216793A (en) Application program backing up and restoring method and device
WO2021208400A1 (en) Backup recovery system and method for modern application
CN111176900A (en) Distributed storage system and data recovery method, device and medium thereof
CN108173665B (en) Data backup method and device
CN108352995B (en) SMB service fault processing method and storage device
CN114356650A (en) Data backup method, device, equipment, system and storage medium
CN110597660A (en) Data backup method, device, equipment and medium for virtual machine
CN113986450A (en) Virtual machine backup method and device
CN112261164B (en) Logic clock synchronization method and device and central time service cluster
CN112333008B (en) Cloud host complete machine backup and restoration method, device, equipment and storage medium
CN109445909A (en) Backup method, system, terminal and the storage medium of virtual-machine data
CN101340675A (en) Method and apparatus for implementing backup and recovery by mobile terminal
CN112153215A (en) Call processing method and device, related equipment and storage medium
CN112241341A (en) Remote disaster recovery method, device and system
CN100362760C (en) Duplication of distributed configuration database system
CN115658390A (en) Container disaster tolerance method, system, device, equipment and computer readable storage medium
CN104951320A (en) Application installing and uninstalling method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150408

Termination date: 20210628

CF01 Termination of patent right due to non-payment of annual fee