CN113535483B - File backup method and device and computing equipment - Google Patents

File backup method and device and computing equipment Download PDF

Info

Publication number
CN113535483B
CN113535483B CN202111077493.5A CN202111077493A CN113535483B CN 113535483 B CN113535483 B CN 113535483B CN 202111077493 A CN202111077493 A CN 202111077493A CN 113535483 B CN113535483 B CN 113535483B
Authority
CN
China
Prior art keywords
backup
weight value
file
backed
resource
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
Application number
CN202111077493.5A
Other languages
Chinese (zh)
Other versions
CN113535483A (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.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology 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 Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202111077493.5A priority Critical patent/CN113535483B/en
Publication of CN113535483A publication Critical patent/CN113535483A/en
Application granted granted Critical
Publication of CN113535483B publication Critical patent/CN113535483B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file backup method, a device and a computing device, wherein the method comprises the following steps: acquiring a file to be backed up; when the occupancy rate of the backup device to the resources does not exceed an upper limit value, calculating a total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource, and judging whether the total weight value reaches a starting weight value corresponding to the backup device; if the total weight value reaches the starting weight value, judging whether the difference data of the file to be backed up relative to the backed-up file after the last backup exceeds an increment threshold value; and if the difference data exceeds an increment threshold, backing up the file to be backed up. According to the technical scheme, the influence on the system performance during file backup can be effectively relieved, and the file backup efficiency is improved.

Description

File backup method and device and computing equipment
Technical Field
The present invention relates to the technical field of computers and operating systems, and in particular, to a file backup method, device and computing device.
Background
A computer, as a terminal device of an information system, often has a large amount of file data on its operating system, including, for example, table data, pictures, videos, and the like. In order to prevent the file data from being lost, the file is often required to be backed up.
Depending on the way files are backed up, there are a broad classification into hard and soft backups. The hard backup is that a disk array is built by adding disks, and files are simultaneously stored on two disks when the files are stored so as to realize real-time backup of the files, the scheme does not influence the system performance and can provide good error recovery capability, but the hard backup has the defect that the utilization rate of the disks is only 50%, so that the hardware cost is multiplied. The soft backup refers to that files are automatically copied and stored on a current disk through manual or software, wherein the manual copying completely depends on the behavior of an operator and has serious uncertainty, and the automatic software copying refers to that the files are automatically backed up when a triggering strategy is met after software is configured in advance.
In the prior art, on a Windows system, automatic backup of files can be assisted by a planning task of the system. On a Linux system, a file backup is generally realized by creating a script in cooperation with an operation and maintenance tool. In addition, there are some backup software provided by third parties, and the work flow is generally as follows: the user runs the backup software, selects files or folders to be backed up, selects the destination position of the backup, selects the backup period, and the software can back up the files regularly after the storage setting.
According to the existing file backup scheme, when a large number of files are backed up, besides the disk space is consumed, a large number of system resources such as a CPU (central processing unit), a memory and the like are occupied in the process of executing a backup task by backup software, so that the performance of a computer is influenced, even the use of other software is influenced, and the problems of stagnation and the like in the running process of the computer are caused.
For this reason, a file backup method is needed to solve the problems in the above technical solutions.
Disclosure of Invention
To this end, the present invention provides a file backup method and apparatus in an attempt to solve, or at least alleviate, the problems identified above.
According to an aspect of the present invention, there is provided a file backup method, executed in a backup apparatus of a computing device, the method comprising the steps of: acquiring a file to be backed up; when the occupancy rate of the backup device to the resources does not exceed an upper limit value, calculating a total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource, and judging whether the total weight value reaches a starting weight value corresponding to the backup device; if the total weight value reaches the starting weight value, judging whether the difference data of the file to be backed up relative to the backed-up file after the last backup exceeds an increment threshold value; and if the difference data exceeds an increment threshold, backing up the file to be backed up.
Optionally, in the file backup method according to the present invention, the backup apparatus is connected to a storage device, and before the file to be backed up is backed up, the method further includes the steps of: and judging whether the residual storage space of the storage equipment reaches an alarm threshold value, and if not, backing up the file to be backed up.
Optionally, in the file backup method according to the present invention, the step of determining whether the remaining storage space of the storage device reaches the alarm threshold further includes: and if the alarm threshold is reached, generating a prompt popup window and displaying the prompt popup window to remind a user to clean the data in the storage equipment.
Optionally, in the file backup method according to the present invention, the step of determining whether difference data of the file to be backed up with respect to the backed-up file after the last backup exceeds an increment threshold includes: determining the difference data quantity of the file to be backed up relative to the backed-up file after the last backup, and calculating the ratio of the difference data quantity to the data quantity of the backed-up file as a difference data ratio; and judging whether the difference data ratio exceeds an increment threshold value.
Optionally, in the file backup method according to the present invention, if the incremental threshold is not exceeded, the difference data of the file to be backed up is monitored at predetermined time intervals to determine whether the difference data ratio exceeds the incremental threshold.
Optionally, in the file backup method according to the present invention, before determining whether the total weight value reaches the start weight value corresponding to the backup device, the method includes: calculating the time difference between the current time and the last backup time, and judging whether the time difference reaches a backup period; and if the backup period reaches one backup period, determining that the condition of the backup period is met, and judging whether the resource occupancy rate of the backup device exceeds an upper limit value.
Optionally, in the file backup method according to the present invention, the weight values corresponding to the one or more resources include a first resource weight value corresponding to the processor, a second resource weight value corresponding to the memory, and a third resource weight value corresponding to the storage device, where a sum of the weight values corresponding to the one or more resources is 1; the step of calculating the total weight value based on the weight values corresponding to the one or more resources and the current idle rate of each resource comprises: calculating a first product of the first resource weight value and the current idle rate of the processor, a second product of the second resource weight value and the current idle rate of the memory, and a third product of the third resource weight value and the current idle rate of the storage device; and calculating the sum of the first product, the second product and the third product as the total weight value.
Optionally, in the file backup method according to the present invention, the storage device includes a local disk of the computing device or a network storage device, and the network storage device includes an FTP server and a cloud disk.
Optionally, in the file backup method according to the present invention, when the storage device is a network storage device, the weight values corresponding to the one or more resources further include a fourth resource weight value corresponding to a network bandwidth; the step of calculating the total weight value based on the weight values corresponding to the one or more resources and the current idle rate of each resource comprises: calculating a first product of the first resource weight value and the current idle rate of the processor, a second product of the second resource weight value and the current idle rate of the memory, a third product of the third resource weight value and the current idle rate of the storage device, and a fourth product of a fourth resource weight value and the current idle rate of the network bandwidth; and calculating the sum of the first product, the second product, the third product and the fourth product as the total weight value.
Optionally, in the file backup method according to the present invention, the upper limit value includes a first upper limit value corresponding to the processor and a second upper limit value corresponding to the memory; the method that the occupancy rate of the backup device to the resource does not exceed the upper limit value comprises the following steps: the occupancy rate of the backup device to the processor does not exceed a first upper limit value, and the occupancy rate to the memory does not exceed a second upper limit value.
Alternatively, in the file backup method according to the present invention, the first upper limit value is 50%, and the second upper limit value is 40%.
Optionally, in the file backup method according to the present invention, a file list to be backed up is obtained, where the file list to be backed up includes one or more files to be backed up and/or folders to be backed up.
According to one aspect of the present invention, there is provided a backup apparatus residing in a computing device, the apparatus comprising: the acquisition module is suitable for acquiring a file to be backed up; the judging module is suitable for calculating a total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource when the occupancy rate of the backup device to the resources does not exceed an upper limit value, and judging whether the total weight value reaches a starting weight value corresponding to the backup device; if the starting weight value is reached, judging whether the difference data of the file to be backed up relative to the backed-up file after the last backup exceeds an increment threshold value or not; and the backup module is suitable for backing up the file to be backed up when the difference data exceeds an increment threshold value.
According to an aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the file backup method as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method as described above.
According to the technical scheme of the invention, the file backup method and the file backup device are provided, when the occupancy rate of the backup device to the resources is determined not to exceed the upper limit value, the total weight value is calculated based on the weight values corresponding to one or more resources and the current idle rate of each resource, and when the total weight value is determined to reach the starting weight value corresponding to the backup device, the backup device is determined to meet the operating priority condition. Therefore, files can be backed up under the condition of ensuring sufficient system resources, the influence on the system performance during file backup is effectively relieved, and the file backup efficiency is improved. By limiting the resource occupancy rate of the backup device, the problems that other application programs are blocked and the like in the operation process due to more occupied system resources in the file backup process through the backup device can be avoided, so that the files are efficiently backed up in the stable operation state of each application program.
And an increment threshold is configured for file backup in advance, and when the difference data ratio is determined to exceed the increment threshold, the file to be backed up is backed up. Therefore, the problem that multiple repeated backups are carried out on files which are not modified or are less modified for a long time when the backup task is executed only depending on the backup period can be solved, multiple small changes can be integrated into one backup task, occupation of system resources is greatly reduced, and backup efficiency is improved.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a computing device 100, according to one embodiment of the invention;
FIG. 2 illustrates a flow diagram of a file backup method 200 according to one embodiment of the invention; and
fig. 3 shows a schematic diagram of a backup device 300 according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic block diagram of an example computing device 100.
As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing, including but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a level one cache 110 and a level two cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, the application 122 can be arranged to execute instructions on an operating system with program data 124 by one or more processors 104.
Computing device 100 also includes a storage device 132, storage device 132 including removable storage 136 and non-removable storage 138.
Computing device 100 may also include a storage interface bus 134. The storage interface bus 134 enables communication from the storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to the basic configuration 102 via the bus/interface controller 130. At least a portion of the operating system 120, applications 122, and data 124 may be stored on removable storage 136 and/or non-removable storage 138, and loaded into system memory 106 via storage interface bus 134 and executed by the one or more processors 104 when the computing device 100 is powered on or the applications 122 are to be executed.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus/interface controller 130. The example output device 142 includes an image processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communications with one or more other computing devices 162 over a network communication link via one or more communication ports 164.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in a manner that encodes information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, Radio Frequency (RF), microwave, Infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 100 may be implemented as a personal computer including both desktop and notebook computer configurations. Of course, computing device 100 may also be implemented as part of a small-form factor portable (or mobile) electronic device such as a cellular telephone, a digital camera, a Personal Digital Assistant (PDA), a personal media player device, a wireless web-watch device, a personal headset, an application specific device, or a hybrid device that include any of the above functions. And may even be implemented as a server, such as a file server, a database server, an application server, a WEB server, and so forth. The embodiments of the present invention are not limited thereto.
In an embodiment in accordance with the invention, the computing device 100 is configured to perform a file backup method 200 in accordance with the invention. Wherein the operating system 120 of the computing device 100 contains thereon a plurality of program instructions for executing the file backup method 200 of the present invention, such that the file backup method 200 of the present invention may be executed in the operating system 120 of the computing device 100.
According to an embodiment of the present invention, the application disposed on the operating system 120 includes the backup apparatus 300, and the backup apparatus 300 includes a plurality of program instructions for executing the file backup method 200 of the present invention, so that the file backup method 200 of the present invention can be executed in the backup apparatus 600 to backup a file to be backed up.
FIG. 2 shows a flow diagram of a file backup method 200 according to one embodiment of the invention. The file backup method 200 may be performed in a backup appliance 300 of a computing device, such as the computing device 100 described above.
According to an embodiment of the present invention, the backup apparatus 300 is connected to a storage device for storing backup files, where the storage device is, for example, a local disk of the computing device 100, and may also be a network storage device. The network storage device includes, for example, an FTP server, a cloud disk, and the like. It should be noted that the present invention is not limited to a particular deployment location of the storage device.
As shown in fig. 2, the method 200 begins at step S210.
In step S210, a file to be backed up is acquired.
Here, a to-be-backed-up file list generated by pre-configuration is acquired, and the to-be-backed-up file list includes one or more to-be-backed-up files and/or folders to be backed-up. Therefore, each file to be backed up in the file list to be backed up and each file in the folder to be backed up are backed up. It should be noted that before executing the backup method 200, the user may freely add one or more files and folders to be backed up to the backup file list, so that the backup apparatus 300 may backup the files to be backed up and/or the folders to be backed up in the list according to the backup file list generated by the pre-configuration.
In one embodiment, before step S220 is executed, the time difference between the current time and the last backup time is calculated, and whether the time difference reaches one backup cycle is determined. If a backup period is reached, it is determined that the backup period condition is satisfied, and it may be further determined whether the occupancy rate of the resource by the backup apparatus 300 exceeds the upper limit value.
Here, the backup period may be previously configured to be a time period of every hour, every day, every week, or the like. It should be noted that when the backup period is a time period, the time difference may be calculated to determine whether the backup period condition is satisfied. If the backup period condition is not met, a timer can be started, and the calculated time difference value is set to be overtime time, so that the backup period condition can be determined to be met after the timer is overtime.
In still other embodiments, the backup period may also be configured as an irregular time period such as a working day, a holiday, etc., or the backup period may be configured as an event trigger period such as each time a user logs in, each time a file is opened, etc. The present invention does not specifically limit the backup period. If the backup period is an irregular time period, the current date is acquired, the day of the week is calculated, and the current date is compared with a preset festival form to determine whether the backup period condition is met. If the backup period is an event trigger period, it may be set to determine that the period condition is satisfied when a corresponding event is triggered.
In one embodiment, after determining that the backup period condition is satisfied, it is further determined whether the occupancy rate of the resource by the backup apparatus 300 exceeds an upper limit value. Wherein, the upper limit value corresponding to one or more resources can be configured in advance. The pre-configured upper limit values include, for example, a first upper limit value corresponding to the processor and a second upper limit value corresponding to the memory. In this way, when determining whether the occupancy rate of the backup device to the resource exceeds the upper limit value, it may be determined whether the occupancy rate of the backup device to the processor exceeds a first upper limit value, and whether the occupancy rate of the backup device to the memory exceeds a second upper limit value. Here, the present invention is not limited to specific values of the first upper limit value and the second upper limit value. For example, in one implementation, the first upper limit value may be set to 50% and the second upper limit value may be set to 40%.
When the occupancy rate of the backup device 300 to the processor does not exceed a first upper limit value and the occupancy rate to the memory does not exceed a second upper limit value, it is determined that the occupancy rate of the backup device to the resource does not exceed the upper limit value. If the resource occupancy rate of the backup device does not exceed the upper limit, it indicates that the backup device meets the resource occupancy condition, and the following step S220 may be executed.
When the occupancy rate of the backup device 300 to the processor exceeds a first upper limit value or the occupancy rate to the memory exceeds a second upper limit value, it is determined that the occupancy rate of the backup device to the resource exceeds the upper limit value. If the resource occupancy rate of the backup device exceeds the upper limit value, the resource occupancy rate of the backup device can be controlled by controlling the operation rate of the backup device 300 and the size of the backup file block, so that the resource occupancy rate of the backup device does not exceed the first upper limit value, and the resource occupancy condition is met.
In addition, if the storage device connected to the backup apparatus 300 is a network storage device (e.g., FTP server, cloud disk, etc.), when determining whether the resource occupancy rate of the backup apparatus 300 exceeds the upper limit, it may further determine whether the network card resource occupancy rate and the network bandwidth resource occupancy rate exceed the corresponding upper limit, so as to avoid affecting the use of network resources by other applications during the process of operating the backup apparatus 300 to backup files.
It should be noted that by limiting the resource occupancy rate of the backup device, the problem that other applications are stuck during the operation due to occupying more system resources during the file backup process by the backup device 300 can be avoided, so as to ensure that the files are backed up in the stable operation state of each application.
In step S220, when the occupancy rate of the backup apparatus for the resource does not exceed the upper limit value, it is determined whether the resource usage priority of the backup apparatus satisfies the priority condition. Specifically, a total weight value is calculated based on the weight values corresponding to one or more resources and the current idle rate of each resource, and it is determined whether the total weight value reaches (is greater than or equal to) the start weight value corresponding to the backup apparatus 300. And if the starting weight value is reached, determining that the resource use priority meets the priority condition.
In one embodiment, the one or more resources include, for example, a processor, memory, storage device for storing files to be backed up of computing device 100. Accordingly, the weight values corresponding to the one or more resources include: a first resource weight value corresponding to the processor, a second resource weight value corresponding to the memory, and a third resource weight value corresponding to the storage device. It should be noted that the sum of the weight values corresponding to one or more resources is 1, in this embodiment, that is, the sum of the first resource weight value, the second resource weight value and the third resource weight value is 1. Here, the storage device may be configured as a local disk or a network storage device (e.g., FTP server, cloud disk, etc.) in advance, and the backup method 200 of the present invention does not limit the specific deployment of the storage device.
The method for calculating the total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource specifically includes the following steps:
the method comprises the steps of calculating a first product of a first resource weight value and the current idle rate of a processor to obtain a weight value of a storage capable of being occupied by a backup device, calculating a second product of a second resource weight value and the current idle rate of a memory to obtain a weight value of the memory capable of being occupied by the backup device, and calculating a third product of a third resource weight value and the current idle rate of a storage device to obtain a weight value of the storage device capable of being occupied by the backup device. The total weight value may be obtained by calculating a sum of the first product, the second product, and the third product. Further, it is determined whether the resource usage priority of the backup apparatus satisfies the priority condition by determining whether the total weight value reaches the startup weight value corresponding to the backup apparatus 300.
Here, a first resource weight value corresponding to the processor, a second resource weight value corresponding to the memory, a third resource weight value corresponding to the storage device, and a start weight value corresponding to the backup apparatus 300 may be configured in advance. For example, a first resource weight value configured in advance is denoted by a, a second resource weight value is denoted by B, and a third resource weight value is denoted by C, where a + B + C = 1. The preconfigured startup weight value is M.
In one implementation, the file to be backed up is backed up in a local backup manner, and the storage device is a local disk. Assuming that the current processor occupancy is 40% (idle rate is 1-40%), the current memory occupancy is 10% (idle rate is 1-10%), and the current storage device (local disk) occupancy is 20% (idle rate is 1-20%), then a first product of the first resource weight and the current processor idle rate is a (1-40%), a second product of the second resource weight and the current memory idle rate is B (1-10%), and a third product of the third resource weight and the current storage device idle rate is C (1-20%). When a is (1-40%) + B (1-10%) + C (1-20%) > M, it is determined that the total weight value reaches the start weight value corresponding to the backup apparatus 300, and it is determined that the resource usage priority of the backup apparatus 300 satisfies the priority condition.
For example, when a =0.5, B =0.3, C =0.2, and M =0.6, a × (1-40%) + B × (1-10%) + C × (1-20%) =0.73, obviously 0.73 > 0.6, so that it can be determined that the total weight value reaches the activation weight value corresponding to the backup apparatus 300.
In another implementation manner, when the file to be backed up is backed up in a network backup manner, and the storage device is a network storage device (e.g., an FTP server, a cloud disk, etc.), a fourth resource weight value corresponding to a network bandwidth resource is also preconfigured, where the fourth resource weight value is denoted by D. That is, the weight value corresponding to the one or more resources further includes a fourth resource weight value corresponding to the network bandwidth, and a sum of the first resource weight value, the second resource weight value, the third resource weight value, and the fourth resource weight value is 1, that is, a + B + C + D = 1.
When the total weight value of the backup apparatus 300 is calculated, a fourth product of a fourth resource weight value and the current idle rate of the network bandwidth is further calculated, that is, a first product of the first resource weight value and the current idle rate of the processor, a second product of the second resource weight value and the current idle rate of the memory, a third product of the third resource weight value and the current idle rate of the storage device, and a fourth product of the fourth resource weight value and the current idle rate of the network bandwidth are calculated, and then, the total weight value is obtained by calculating a sum of the first product, the second product, the third product and the fourth product. Specifically, assume that the current processor occupancy is 40% (idle rate is 1-40%), the current memory occupancy is 10% (idle rate is 1-10%), the current storage device (network storage device) occupancy is 10% (idle rate is 1-10%), and the current network bandwidth resource occupancy is 70% (idle rate is 1-70%). Then, a first product of the first resource weight value and the current idle rate of the processor is a (1-40%), a second product of the second resource weight value and the current idle rate of the memory is B (1-10%), a third product of the third resource weight value and the current idle rate of the network storage device is C (1-10%), and a first product of the fourth resource weight value and the current idle rate of the network bandwidth is D (1-70%). When a is (1-40%) + B (1-10%) + C (1-10%) + D (1-70%) + M, it is determined that the total weight value reaches the start weight value corresponding to the backup apparatus 300, and it is determined that the resource usage priority of the backup apparatus 300 satisfies the priority condition.
For example, when a =0.4, B =0.2, C =0.1, D =0.3, and M =0.7, a × (1-40%) + B × (1-10%) + C × (1-10%) + D × (1-70%) =0.6, obviously 0.6 < 0.7, it may be determined that the total weight value does not reach the activation weight value corresponding to the backup apparatus 300. At this time, it is determined that the resource use priority of the backup apparatus 300 does not satisfy the priority condition, and the execution of the current backup task is suspended.
According to the embodiment of the invention, the full-volume backup scheme can be configured to be executed when the file to be backed up is backed up for the first time, and the incremental backup scheme can be executed when the file to be backed up is backed up for the next time.
If the total weight value reaches the start weight value, that is, the resource usage priority satisfies the priority condition, step S230 is further performed. In step S230, it is determined whether the difference data of the file to be backed up with respect to the backed-up file after the last backup exceeds an increment threshold to determine whether the difference data meets the backup condition.
If the difference data exceeds the increment threshold, step S240 is performed. In step S240, the file to be backed up is backed up, that is, the file to be backed up is stored in the storage device.
Specifically, the difference data amount of the file to be backed up relative to the backed-up file after the last backup is determined, and the ratio between the difference data amount and the data amount of the backed-up file is calculated as the difference data ratio. And then, judging whether the difference data ratio exceeds an increment threshold, determining that the backup condition is met when the difference data ratio exceeds the increment threshold, and then backing up the file to be backed up. It should be noted that if the file to be backed up is backed up for the first time, that is, the full-scale backup is performed, the calculated difference data ratio bit is 100%, which inevitably exceeds the incremental threshold, and the backup condition is satisfied.
In one embodiment, if the difference data ratio does not exceed the increment threshold, the difference data of the file to be backed up may be dynamically monitored according to a preset configuration to determine whether the difference data ratio exceeds the increment threshold until the difference data ratio exceeds the increment threshold. In an implementation manner, dynamically monitoring difference data of a file to be backed up may specifically be implemented as: and monitoring the difference data of the files to be backed up at preset time intervals, judging whether the ratio of the difference data exceeds an increment threshold value, and starting the backup of the files to be backed up until the ratio of the difference data exceeds the increment threshold value. Thus, the consumption of system resources can be reduced as much as possible.
In another embodiment, if the difference data ratio does not exceed the increment threshold, the backup of the file to be backed up may be performed after waiting for the next backup cycle according to a preset configuration. Alternatively, it may be configured to end the backup task.
It should be noted that, in the present invention, an increment threshold is configured for file backup in advance, and when it is determined that the difference data ratio exceeds the increment threshold, the file to be backed up is backed up. Therefore, the problem that repeated backup is carried out on files which are not modified for a long time when the backup task is executed only by depending on the backup period can be solved, repeated backup is carried out on the files which are not modified for a long time for many times due to slight change for many times, multiple slight changes can be integrated into one backup task, occupation of system resources is greatly reduced, and backup efficiency is improved.
In an embodiment, before the file to be backed up is backed up in step S240, it is further determined whether the remaining storage space of the storage device reaches an alarm threshold, and if the remaining storage space of the storage device does not reach the alarm threshold, the file to be backed up may be started to be backed up. And if the alarm threshold is reached, generating a prompt popup window and displaying the prompt popup window on the desktop of the system so as to remind a user to clean the data in the storage device. Here, the alarm threshold may be preconfigured. In one implementation, when a user cleans up data in the storage device, if the current file to be backed up is backed up again by the full amount, all backup data records backed up before may be cleared.
It should be noted that, according to the backup scheme of the present invention, a plurality of backup conditions and parameters may be configured in advance, for example, the backup conditions and parameters include the file to be backed up, the backup address, the backup period, the increment threshold, the upper limit value corresponding to the resource occupancy rate, the weight values corresponding to a plurality of resources, the start weight value of the backup device, and the like. In this way, when the file backup method 200 of the present invention is executed, one or more files to be backed up may be backed up according to a preconfigured policy.
Fig. 3 shows a schematic diagram of a backup device 300 according to an embodiment of the invention. The backup apparatus 300 resides in a computing device (e.g., the aforementioned computing device 100) and is adapted to perform the file backup method 200 of the present invention.
The backup apparatus 300 includes an obtaining module 310, a determining module 320, and a backup module 330 connected to each other. The obtaining module 310 is configured to obtain a file to be backed up. When determining that the occupancy rate of the backup device to the resource does not exceed the upper limit value, the determining module 320 calculates a total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource, and determines whether the total weight value reaches a start weight value corresponding to the backup device; and if the starting weight value is reached, judging whether the difference data of the file to be backed up relative to the backed-up file after the last backup exceeds an increment threshold value. When the difference data exceeds the increment threshold, the file to be backed up is backed up by the backup module 330.
It should be noted that the obtaining module 310 is configured to perform the step S210, the determining module 320 is configured to perform the steps S220 to S230, and the backup module 330 is configured to perform the step S240. Here, for the specific execution logic of the obtaining module 310, the determining module 320 and the backup module 330, reference is made to the detailed description of the steps S210 to S240 in the method 200, and details are not repeated here.
According to the file backup scheme, when the occupancy rate of the backup device to the resources is determined not to exceed the upper limit value, the total weight value is calculated based on the weight values corresponding to one or more resources and the current idle rate of each resource, and when the total weight value is determined to reach the starting weight value corresponding to the backup device, the backup device is determined to meet the operating priority condition. Therefore, files can be backed up under the condition of ensuring sufficient system resources, the influence on the system performance during file backup is effectively relieved, and the file backup efficiency is improved. By limiting the resource occupancy rate of the backup device, the problems that other application programs are blocked and the like in the operation process due to more occupied system resources in the file backup process through the backup device can be avoided, so that the files are efficiently backed up in the stable operation state of each application program. And an increment threshold is configured for file backup in advance, and when the difference data ratio is determined to exceed the increment threshold, the file to be backed up is backed up. Therefore, the problem that multiple repeated backups are carried out on files which are not modified or are less modified for a long time when the backup task is executed only depending on the backup period can be solved, multiple small changes can be integrated into one backup task, occupation of system resources is greatly reduced, and backup efficiency is improved.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the multilingual spam-text recognition method of the present invention according to instructions in said program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense, and the scope of the present invention is defined by the appended claims.

Claims (10)

1. A method for backing up files, performed in a backup apparatus of a computing device, the backup apparatus being connected to a storage device, the storage device comprising a local disk of the computing device, the method comprising the steps of:
acquiring a file to be backed up;
when the occupancy rate of the backup device to the processor does not exceed a first upper limit value and the occupancy rate of the backup device to the memory does not exceed a second upper limit value, determining that the occupancy rate of the backup device to the resource does not exceed the upper limit value;
when the occupancy rate of the backup device to the resources does not exceed an upper limit value, calculating a total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource, and judging whether the total weight value reaches a starting weight value corresponding to the backup device;
if the total weight value reaches the starting weight value, judging whether the difference data of the file to be backed up relative to the backed-up file after the last backup exceeds an increment threshold value; and
if the difference data exceeds the increment threshold, judging whether the residual storage space of the storage equipment reaches an alarm threshold, and if not, backing up the file to be backed up.
2. The method of claim 1, wherein the step of determining whether the difference data of the file to be backed up with respect to the backed-up file after the last backup exceeds an increment threshold comprises:
determining the difference data quantity of the file to be backed up relative to the backed-up file after the last backup, and calculating the ratio of the difference data quantity to the data quantity of the backed-up file as a difference data ratio;
and judging whether the difference data ratio exceeds an increment threshold value.
3. The method of claim 2, wherein,
and if the difference data ratio does not exceed the increment threshold, monitoring the difference data of the file to be backed up at preset time intervals to judge whether the difference data ratio exceeds the increment threshold.
4. The method according to any one of claims 1-3, wherein determining whether the total weight value reaches a startup weight value corresponding to the backup device comprises:
calculating the time difference between the current time and the last backup time, and judging whether the time difference reaches a backup period;
and if the backup period reaches one backup period, determining that the condition of the backup period is met, and judging whether the resource occupancy rate of the backup device exceeds an upper limit value.
5. The method of any of claims 1-3, wherein the weight values corresponding to the one or more resources comprise a first resource weight value corresponding to the processor, a second resource weight value corresponding to the memory, and a third resource weight value corresponding to the storage device, wherein a sum of the weight values corresponding to the one or more resources is 1;
the step of calculating the total weight value based on the weight values corresponding to the one or more resources and the current idle rate of each resource comprises:
calculating a first product of the first resource weight value and the current idle rate of the processor, a second product of the second resource weight value and the current idle rate of the memory, and a third product of the third resource weight value and the current idle rate of the storage device;
and calculating the sum of the first product, the second product and the third product as the total weight value.
6. The method of claim 5, wherein,
the storage device further comprises a network storage device, and the network storage device comprises an FTP server and a cloud disk.
7. The method of claim 6, wherein, when the storage device is a network storage device, the weight values corresponding to the one or more resources further comprise a fourth resource weight value corresponding to a network bandwidth;
the step of calculating the total weight value based on the weight values corresponding to the one or more resources and the current idle rate of each resource comprises:
calculating a first product of the first resource weight value and the current idle rate of the processor, a second product of the second resource weight value and the current idle rate of the memory, a third product of the third resource weight value and the current idle rate of the storage device, and a fourth product of a fourth resource weight value and the current idle rate of the network bandwidth;
and calculating the sum of the first product, the second product, the third product and the fourth product as the total weight value.
8. A backup apparatus residing in a computing device, the backup apparatus being connected to a storage device, the storage device comprising a local disk of the computing device, the apparatus comprising:
the acquisition module is suitable for acquiring a file to be backed up;
the judging module is suitable for determining that the occupancy rate of the backup device to the resources does not exceed the upper limit value when the occupancy rate of the backup device to the processor does not exceed the first upper limit value and the occupancy rate of the backup device to the memory does not exceed the second upper limit value; when the occupancy rate of the backup device to the resources does not exceed an upper limit value, calculating a total weight value based on the weight values corresponding to one or more resources and the current idle rate of each resource, and judging whether the total weight value reaches a starting weight value corresponding to the backup device; if the starting weight value is reached, judging whether the difference data of the file to be backed up relative to the backed-up file after the last backup exceeds an increment threshold value or not; if the difference data exceeds the increment threshold, judging whether the residual storage space of the storage equipment reaches an alarm threshold; and
and the backup module is suitable for backing up the file to be backed up when the residual storage space of the storage equipment does not reach the alarm threshold value.
9. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-7.
10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-7.
CN202111077493.5A 2021-09-15 2021-09-15 File backup method and device and computing equipment Active CN113535483B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111077493.5A CN113535483B (en) 2021-09-15 2021-09-15 File backup method and device and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111077493.5A CN113535483B (en) 2021-09-15 2021-09-15 File backup method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN113535483A CN113535483A (en) 2021-10-22
CN113535483B true CN113535483B (en) 2021-12-07

Family

ID=78093252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111077493.5A Active CN113535483B (en) 2021-09-15 2021-09-15 File backup method and device and computing equipment

Country Status (1)

Country Link
CN (1) CN113535483B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114115726B (en) * 2021-10-25 2024-04-19 浙江大华技术股份有限公司 File storage method, terminal device and computer readable storage medium
CN115827774A (en) * 2022-10-24 2023-03-21 超聚变数字技术有限公司 Data synchronization method and computing equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020147733A1 (en) * 2001-04-06 2002-10-10 Hewlett-Packard Company Quota management in client side data storage back-up

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104023088B (en) * 2014-06-28 2017-04-19 山东大学 Storage server selection method applied to distributed file system
CN105354110B (en) * 2015-10-26 2018-05-18 武汉帕菲利尔信息科技有限公司 Cloud Server data back up method and device
CN105760259A (en) * 2016-03-01 2016-07-13 北京金山安全软件有限公司 Data backup method and device and electronic equipment
CN107643962A (en) * 2017-09-27 2018-01-30 郑州云海信息技术有限公司 A kind of backup method of data storage, device, equipment and readable storage medium storing program for executing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020147733A1 (en) * 2001-04-06 2002-10-10 Hewlett-Packard Company Quota management in client side data storage back-up

Also Published As

Publication number Publication date
CN113535483A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN113535483B (en) File backup method and device and computing equipment
US7930507B2 (en) Method of providing to a processor an estimated completion time of a storage operation
CN110730136B (en) Method, device, server and storage medium for realizing flow control
CN109086135B (en) Resource scaling method and device, computer equipment and storage medium
JP2018045671A (en) Method and apparatus for scheduling cloud server
CN110119306B (en) Method, device and equipment for balancing automatic scheduling of jobs and storage medium
CN111343288B (en) Job scheduling method and system and computing device
CN114416252A (en) Window display method and device, computing equipment and storage medium
CN114691226A (en) Multi-operating-system switching operation method, computing device and storage medium
TWI608377B (en) Monitoring management systems and methods
CN116483546B (en) Distributed training task scheduling method, device, equipment and storage medium
CN113342452A (en) Window display method, computing device and readable storage medium
CN110941597B (en) Method and device for cleaning decompressed file, computing equipment and computer storage medium
CN109426563B (en) Process management method and device
JP2005222366A (en) Automatic recovery method, program, program recording medium, processor
CN103488506A (en) Method and device for unloading management of application programs
CN108845845B (en) Shortcut key creation method and device, electronic equipment and storage medium
TWI465889B (en) Hibernation management methods and devices using the same
CN111090627A (en) Log storage method and device based on pooling, computer equipment and storage medium
CN114884974B (en) Data multiplexing method, system and computing device
CN114020531A (en) Operating system restoration method, restoration device and computing equipment
CN111897741B (en) Application software detection method and computing device
CN108984344B (en) Method, device and equipment for dynamically generating snapshot and storage medium
CN114461138B (en) Scheduling method and device of storage resources, electronic equipment and readable storage medium
CN113742140B (en) File backup method and device and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant