CN102902606B - A kind of data back up method and device - Google Patents
A kind of data back up method and device Download PDFInfo
- Publication number
- CN102902606B CN102902606B CN201210384400.8A CN201210384400A CN102902606B CN 102902606 B CN102902606 B CN 102902606B CN 201210384400 A CN201210384400 A CN 201210384400A CN 102902606 B CN102902606 B CN 102902606B
- Authority
- CN
- China
- Prior art keywords
- backup
- time interval
- file
- value
- current
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000004364 calculation method Methods 0.000 claims abstract description 15
- 230000004048 modification Effects 0.000 claims description 12
- 238000012986 modification Methods 0.000 claims description 12
- 230000006870 function Effects 0.000 description 10
- 238000004883 computer application Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to a kind of data back up method, it comprises step D1: obtain backup parameter, and according to the next time interval value backed up of backup gain of parameter; Step D2: record the BACKUP TIME spacing value that this BACKUP TIME interval calculation module obtains, and carry out timing; Step D3: when arriving the execution time, file is backed up; Step D4: the backup parameter of record current backup.Relative to prior art, data back up method of the present invention and device can carry out automated back-up according to the time interval of the amendment situation automatic dynamic adjustment file backup of file data.
Description
Technical Field
The invention relates to the technical field of computer application, in particular to a data backup method and device.
Background
In the field of computer applications, data backup refers to a process of making copies of all or part of data sets in a computer to other storage locations. The file system of the computer is a core module for file management of application programs (such as office software) and manages data local persistence work of the application programs. During the process of using the software, users often encounter the situation of abnormal exit of the program, and the previous work result is lost instantly because the work result is not saved. To avoid this, it is common for application software to provide timed backup functionality. The timed backup refers to that an application program checks whether a currently running document is saved at intervals, and if the currently running document is not saved, the currently opened document is backed up, so that when the application program is abnormally quitted or data is lost or damaged due to computer system failure or misoperation, the backed-up data can be quickly restored to avoid unnecessary loss.
However, the backup time interval of the current timing backup is fixed, for example, the user sets the backup time interval through the menu page, for example, 10 minutes, the application automatically performs the backup every 10 minutes. However, the data in the time period between two automatic backups cannot be backed up in time, and if the user modifies the data to a large extent in the time period without backing up, a large loss is generated. If the user sets the time interval of the timed backup to be shorter, the risk of data loss is relatively small, but the backup in editing causes strong interruption, and the user experience is reduced.
Disclosure of Invention
The present invention is directed to overcome the disadvantages and drawbacks of the prior art, and to provide a data backup method and apparatus for dynamically adjusting a timing interval function.
The invention is realized by adopting the following technical scheme: a method of data backup comprising the steps of:
step D1: acquiring backup parameters, and acquiring a time interval value of the next backup according to the backup parameters;
step D2: recording the backup time interval value obtained by the backup time interval calculation module and timing;
step D3: when the execution time is up, the file is backed up;
step D4: and recording the backup parameters of the current backup.
The backup parameter is one or more of backup time consumption of the previous backup, current file size, current memory size, file type and hard disk rotating speed.
The step D4 includes the sub-steps of:
step D41: judging whether the file has new data, if yes, entering step D42; if not, returning to the step D1;
step D42: performing a backup of the file.
When the backup time consumption of the current backup is less than a threshold value, the higher the frequency of file backup is, and when the backup time consumption of the current backup is greater than the threshold value, the backup is performed according to a fixed time interval or a time interval fixed value set by a user.
And, a data backup apparatus comprising:
the backup time interval calculation module is used for acquiring the backup parameters and acquiring the time interval value of the next backup according to the backup parameters;
the timing module records the backup time interval value obtained by the backup time interval calculation module and performs timing;
the backup module backs up the file when the execution time is reached;
and the backup parameter recording module is used for recording the backup parameters of the current backup.
The backup parameter recorded by the backup parameter recording module is one or more of backup time consumed by the last backup, the current file size, the current memory size, the file type and the hard disk rotating speed.
The backup module comprises a modification judging unit and a backup executing unit, wherein the modification judging unit judges whether the file has newly added data, if so, the backup executing unit is instructed to execute backup on the file, and if not, the backup time interval calculating module is instructed to obtain the time interval value of the next backup.
Compared with the prior art, the data backup method and the data backup device can automatically and dynamically adjust the time interval of the file backup according to the modification condition of the file data to perform automatic backup. And the method also has good user experience on the premise of ensuring that the data can be backed up in time.
In order that the invention may be more clearly understood, specific embodiments thereof will be described hereinafter with reference to the accompanying drawings.
Drawings
FIG. 1 is a flow chart of a data backup method of the present invention.
Fig. 2 is a schematic block diagram of a data backup apparatus according to the present invention.
Fig. 3 is a functional image of a convergence function.
Detailed Description
Example 1
Please refer to fig. 1, which is a flowchart illustrating a data backup method according to the present invention. The data backup method comprises the following steps:
step S11: a file is opened or created.
Step S12: and calling the backup parameter during the previous backup, and obtaining the time interval value of the next backup according to the backup parameter.
In this embodiment, the time interval value of the next backup is obtained by means of a lookup table, and the lookup table of the time interval value is as follows:
specifically, for a new document, the time consumption of the previous backup is set to a value of 0 by default. As can be seen from the above table, the smaller the backup time consumed for the current backup, the smaller the time interval value for the next backup is set. The backup time consumption of the previous backup is smaller, which means that the file data amount is smaller, the backup speed is higher, and the interruption feeling of the card machine cannot be caused to a user; conversely, the larger the backup time consumption is, the larger the file data amount is, the slower the backup speed is, and the user may be interrupted by the card machine. In addition, the data volume of the data changed by the user is not too large in 300s, and great risk is not caused to data loss. Therefore, when the backup time consumption of the previous backup is less than a threshold, the higher the frequency of file backup is, and when the backup time consumption of the current backup is greater than the threshold, the backup is performed according to a "time interval" fixed value set by a user.
Step S13: starting timing;
step S14: when the execution time is up, the file is backed up;
wherein, the step comprises the following substeps:
step S141: judging whether the file has newly added data or not; if yes, go to step S142; if not, the process returns to step S12.
Specifically, during the running of the program, since an attribute is automatically added to the file during the modification process to indicate that the file is modified, whether the file has new data can be determined by accessing or querying the attribute of the file.
Step S142: performing a backup of the file.
Step S15: recording backup parameters of the current backup;
wherein, the backup parameter of the current backup is the time consumed by the current backup.
Step S16: judging whether the file is closed or not, if not, returning to the step S12; if so, the process ends.
In the method, the backup meaning includes backing up or saving the new content on the basis of the original document, or backing up or saving a document again in other areas of the storage medium.
Please refer to fig. 2, which is a block diagram of a data backup device according to the present invention. The data backup device comprises a detection module 11, a backup time interval calculation module 12, a timing module 13, a backup module 14, a backup parameter recording module 15 and a file closing judgment module 16.
The detection module 11 detects opening or creating a file. When it is detected that a file is opened or newly created, the backup interval calculation module 12 is notified.
The time interval calculating module 12 calls the backup parameter recorded by the backup parameter recording module 15 during the previous backup, and obtains the time interval value of the next backup according to the backup parameter. Wherein, the backup parameter is the time consumed by the backup of the previous backup.
In this embodiment, the time interval calculation module 12 includes a time interval value lookup table, and obtains the time interval value of the next backup through the corresponding parameter in the lookup table, where the time interval value lookup table is as follows:
specifically, for a new document, the time consumption of the previous backup is set to a value of 0 by default. As can be seen from the above table, the smaller the backup time consumed for the current backup, the smaller the time interval value for the next backup is set. The backup time consumption of the previous backup is smaller, which means that the file data amount is smaller, the backup speed is higher, and the interruption feeling of the card machine cannot be caused to a user; conversely, the larger the backup time consumption is, the larger the file data amount is, the slower the backup speed is, and the user may be interrupted by the card machine. In addition, the data volume of the data changed by the user is not too large in 300s, and great risk is not caused to data loss. Therefore, when the backup time consumption of the previous backup is less than a threshold, the higher the frequency of file backup is, and when the backup time consumption of the current backup is greater than the threshold, the backup is performed according to a "time interval" fixed value set by a user.
The timing module 13 records the backup time interval value obtained by the backup time interval calculation module 12 and performs timing.
When the execution time is reached, the backup module 14 backs up the file.
Specifically, the backup module 14 includes a modification judgment unit 141 and a backup execution unit 142. The modification determining unit 141 determines whether the file has new data. Specifically, during the running of the program, since an attribute is automatically added to the file during the modification process to indicate that the file is modified, whether the file has new data can be determined by accessing or querying the attribute of the file. When the modification determining unit 141 determines that the file has new data, the backup executing unit 142 is instructed to perform the backup of the file, and when the modification determining unit 141 determines that the file has no new data, the time interval calculating module 12 is instructed to recalculate the next backup time interval value.
The backup parameter recording module 15 records the backup parameters of the current backup as the backup parameters of the previous backup called by the time interval calculating module 12. In this embodiment, the backup parameter of the current backup is the current backup time consumption.
The file closing judgment module 16 judges whether to close the file, if the file is not closed, the time interval calculation module 12 is instructed to calculate the next backup time interval value, and if the file is closed, the judgment is finished.
Compared with the prior art, the data backup method and the data backup device can automatically and dynamically adjust the time interval of file backup according to the size of file data to perform automatic backup, and avoid interruption feeling caused by high-frequency backup of large data files on the premise of ensuring timely automatic backup.
Example 2
The data backup method of embodiment 2 is substantially the same as the data backup method of embodiment 1, and differs only in that: this step S12 is replaced with: and calling the backup parameter in the current operation, and obtaining the time interval value of the next backup according to the backup parameter.
The backup parameters of the current operation are a file size x value and a current memory size a value. The time interval value y of the next backup is calculated by a convergence function y = f (a, x). Specifically, the function is:
please refer to fig. 3, which is a function image of the convergence function. In the figure, a1< a < a2
The time interval value y of the next backup increases along with the increase of the size x of the current file, but the increase continuously decreases until the value tends to a certain fixed value. Namely: when the file size is large, the time interval for backup is relatively long.
Meanwhile, the current value of the memory size a also affects the result of the time interval value y of the next backup: when a1< a2, y1> y 2. Namely: when the memory value is larger, the backup time interval is shorter, and when the memory value is smaller, the backup time interval is longer, so that the problem that the user operation is influenced by a card machine and the like due to frequent backup when the memory value is smaller is avoided.
Further, the data backup apparatus in embodiment 2 is substantially the same as the data backup apparatus in embodiment 1, and differs only in that: the backup parameters recorded by the backup parameter recording module 15 are the current file size x value and the current memory size a value. The time interval calculating module 12 calls the backup parameters recorded by the backup parameter recording module 15, and obtains the time interval value of the next backup according to the backup parameters. Specifically, the time interval calculation module 12 calculates the time interval value y of the next backup by the convergence function y = f (a, x). Specifically, the function is:
in addition, the backup parameters described in the present invention refer to factors (or data) that affect the time consumption of file storage; it may include, but is not limited to: file size, file type, device memory size, hard disk rotation speed, time consumed for storage, time consumed for backup and the like.
In the above embodiment, different ways are used to obtain the next backup time interval. These ways include, but are not limited to: and searching the next backup time interval corresponding to the specific parameter in the table, substituting the parameter into the function to calculate the next backup time interval and the like. Depending on other connotations of the backup parameters, an arithmetic function may be established to set the next backup time interval.
The present invention is not limited to the above-described embodiments, and various modifications and variations of the present invention are intended to be included within the scope of the claims and the equivalent technology of the present invention if they do not depart from the spirit and scope of the present invention.
Claims (6)
1. A data backup method comprises the following steps:
step D1: obtaining backup parameters, and obtaining a time interval value of the next backup according to the backup parameters, wherein the backup parameters are one or more of backup time consumption of the previous backup, current file size, current memory size, file type and hard disk rotating speed;
wherein, when obtaining the backup parameters, obtaining the time interval value of the next backup by a table lookup mode,
Or,
passing functionObtaining the time interval value of the next backup, wherein x is the file size value, a is the current memory size value, and x>0,a>0;
Step D2: recording the obtained backup time interval value, and timing;
step D3: when the execution time is up, the file is backed up;
step D4: recording backup parameters of the current backup; when the time interval value of the next backup is obtained by a table searching mode, the recorded backup parameters are the backup time consumption of the current backup; and when the time interval value of the next backup is obtained in a functional mode, the recorded backup parameters are the current file size value and the current memory size value.
2. The data backup method according to claim 1, characterized in that: the step D3 includes the sub-steps of:
step D31: judging whether the file has new data, if yes, entering the step D32; if not, returning to the step D1;
step D32: performing a backup of the file.
3. The data backup method according to claim 1 or 2, characterized in that: when the time interval value of the next backup is obtained by means of table lookup, when the backup time consumption of the current backup is less than a threshold, the frequency of file backup is higher, and when the backup time consumption of the current backup is greater than the threshold, backup is performed according to a fixed time interval or a time interval fixed value set by a user.
4. A data backup apparatus, comprising:
the backup time interval calculation module is used for acquiring backup parameters and acquiring the time interval value of the next backup according to the backup parameters;
the backup time interval calculation module comprises a time interval value lookup table, and the backup time interval calculation module obtains the time interval value of the next backup through the corresponding parameter in the lookup table, wherein the time interval value lookup table is as follows:
The timing module records the backup time interval value obtained by the backup time interval calculation module and performs timing;
the backup module backs up the file when the execution time is reached;
and the backup parameter recording module is used for recording the backup parameters of the current backup, and the recorded backup parameters are the backup time consumption of the current backup.
5. The data backup apparatus according to claim 4, wherein: the backup time interval calculation module passes a functionTo obtain the time interval value of the next backup, where xIs a file size value, a is a current memory size value, x>0,a>And 0, the backup parameter recording module records the current backup parameters as the current file size value and the current memory size value.
6. The data backup apparatus according to claim 5, wherein: the backup module comprises a modification judging unit and a backup executing unit, wherein the modification judging unit judges whether the file has newly added data, if so, the backup executing unit is instructed to execute backup on the file, and if not, the backup time interval calculating module is instructed to obtain the time interval value of the next backup.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210384400.8A CN102902606B (en) | 2012-10-11 | 2012-10-11 | A kind of data back up method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210384400.8A CN102902606B (en) | 2012-10-11 | 2012-10-11 | A kind of data back up method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102902606A CN102902606A (en) | 2013-01-30 |
CN102902606B true CN102902606B (en) | 2016-04-06 |
Family
ID=47574852
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210384400.8A Active CN102902606B (en) | 2012-10-11 | 2012-10-11 | A kind of data back up method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102902606B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103425547B (en) * | 2013-08-22 | 2016-04-27 | 宁波三星医疗电气股份有限公司 | Based on the electric power data disposal route of vxworks operating system |
CN103617098B (en) * | 2013-12-03 | 2017-06-16 | 上海爱数信息技术股份有限公司 | Intelligent backup method and intelligent backup system based on data variation |
CN105677517A (en) * | 2016-02-25 | 2016-06-15 | 努比亚技术有限公司 | Data backup device, terminal and data backup method |
CN106569916A (en) * | 2016-11-07 | 2017-04-19 | 广东欧珀移动通信有限公司 | Data backup method and mobile terminal |
CN109032839A (en) * | 2018-06-27 | 2018-12-18 | 郑州云海信息技术有限公司 | A kind of cloud host backup method and device |
CN111382013A (en) * | 2020-03-20 | 2020-07-07 | 平安科技(深圳)有限公司 | Method and device for automatically adjusting initiation time of timing backup operation |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101833489A (en) * | 2010-05-06 | 2010-09-15 | 北京邮电大学 | Method for file real-time monitoring and intelligent backup |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7246254B2 (en) * | 2003-07-16 | 2007-07-17 | International Business Machines Corporation | System and method for automatically and dynamically optimizing application data resources to meet business objectives |
GB0424488D0 (en) * | 2004-11-05 | 2004-12-08 | Ibm | A method apparatus computer program and computer program product for adjusting the frequency at which data is backed up |
-
2012
- 2012-10-11 CN CN201210384400.8A patent/CN102902606B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101833489A (en) * | 2010-05-06 | 2010-09-15 | 北京邮电大学 | Method for file real-time monitoring and intelligent backup |
Also Published As
Publication number | Publication date |
---|---|
CN102902606A (en) | 2013-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102902606B (en) | A kind of data back up method and device | |
CN111090398B (en) | Garbage recycling method, device and equipment for solid state disk and readable storage medium | |
CN102831035B (en) | The method of backup information and device | |
CN106547635B (en) | Operation retry method and device for operation | |
US9946467B2 (en) | Data storage method and electronic device | |
WO2021135272A1 (en) | Memory anomaly processing method and system, electronic device, and storage medium | |
US20150347122A1 (en) | Method and Apparatus of Prompting an Update of an Application | |
US20170242744A1 (en) | Method and apparatus for performing data scrubbing management in storage system | |
CN106776113B (en) | Virtual machine backup method and device | |
CN110888712B (en) | Java virtual machine optimization method and system | |
CN111324303B (en) | SSD garbage recycling method, SSD garbage recycling device, computer equipment and storage medium | |
US20190391886A1 (en) | Technologies for limiting performance variation in a storage device | |
CN103870303A (en) | Method and device for reducing size of software installation package | |
US20130110785A1 (en) | System and method for backing up test data | |
CN102331956A (en) | User data backup method and device | |
US9639701B1 (en) | Scheduling data protection operations based on data activity | |
US20240320082A1 (en) | Systems and methods for pause-correct-replay workflow customization | |
CN106250181A (en) | The performance optimization method of a kind of (SuSE) Linux OS and framework | |
CN111130856A (en) | Server configuration method, system, equipment and computer readable storage medium | |
CN113190520A (en) | Method and system for processing filing log | |
CN107766057A (en) | A kind of Unloading Control method, apparatus, terminal and readable storage medium storing program for executing | |
EP2937787B1 (en) | Method for obtaining print processing time and electronic device having print function | |
CN111913918A (en) | File storage method and device and electronic equipment | |
CN106681992A (en) | Method and device for managing website login information | |
CN105808905A (en) | Balance calculation method and apparatus |
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 | ||
C56 | Change in the name or address of the patentee | ||
CP01 | Change in the name or title of a patent holder |
Address after: Jinshan software building No. 8 Jingshan Hill Road, Lane 519015 Lianshan Jida Zhuhai city in Guangdong Province Patentee after: Zhuhai Kingsoft Office Software Co., Ltd. Patentee after: Beijing Kingsoft office software Limited by Share Ltd Address before: Jinshan software building No. 8 Jingshan Hill Road, Lane 519015 Lianshan Jida Zhuhai city in Guangdong Province Patentee before: Zhuhai Kingsoft Office Software Co., Ltd. Patentee before: Beijing Kingsoft WPS Office Co., Ltd. |