File backup method, device, electronic device and storage medium
By receiving the files to be backed up in the file backup method and judging the difference between them and the historical backup files, generating hard links to reduce duplicate backups, the problem of insufficient security of backup in the existing technology is solved, and the security of important files is insufficient in the existing technology is achieved. Efficient and secure file backup.
Patent Information
- Application Number
- CN202411375587.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Existing backup methods occupy a large amount of disk space when backup frequency is high, and cannot guarantee the security of important files, because important files that have not been modified will not be included in incremental backups.
Provide a file backup method, by receiving files to be backed up from the client, determine whether there is a matching historical backup file in the second client, if there is, determine whether the file has been modified, and if there is no modification, generate a hard link and send it to The second client reduces duplicate backups.
Reduce disk space usage during the backup process, improve backup efficiency, and ensure the security of important files through hard link mechanism.
Smart Images

Figure CN118939200B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data backup, and in particular to a file backup method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of computer technology and Internet technology, a large amount of business data will be generated in the production process. The operating system that carries the business data faces the risk of paralysis and data loss due to network penetration, ransomware attacks, software and hardware failures, etc. Backing up data has become one of the best means of passively defending against the above problems. The existing backup method generally performs a full backup of the backup source for the first time, and then performs an incremental backup, integrating the changed file backup and the last backed-up file into a new backup. In the case of a high backup frequency, a large amount of disk space will be occupied. At the same time, there are some important files for the production environment. If the important files have not been modified, they will not be included in the incremental backup object, and the security of important files cannot be guaranteed. Summary of the invention
[0003] The present application provides a file backup method, device, electronic device and storage medium, which reduces disk space usage during the backup process and improves backup efficiency by providing a third-party file backup tool.
[0004] In a first aspect, the present application provides a file backup method, which is applied to a file backup tool, wherein the file backup tool is connected to a first client and a second client respectively; the method comprises:
[0005] Receiving the file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client;
[0006] If the historical backup file exists in the second client, determining whether the file to be backed up is modified compared to the historical backup file;
[0007] If the file to be backed up is modified compared to the historical backup file, backing up the modified file in the file to be backed up, and sending the backed-up file to the second client;
[0008] If the file to be backed up has not been modified compared to the historical backup file, a hard link pointing to the historical backup file is generated, and the hard link is sent to the second client.
[0009] In some possible embodiments, if the to-be-backed-up file is not modified compared to the historical backup file, generating a hard link pointing to the historical backup file, and sending the hard link to the second client includes:
[0010] If the file to be backed up is not modified compared to the historical backup file, determining the file priority of the file to be backed up;
[0011] Determining whether the file to be backed up is a file of a target priority type according to the file priority of the file to be backed up;
[0012] If the file to be backed up is a file of a target priority type, generating a hard link pointing to the historical backup file, and sending the hard link to the second client;
[0013] If the file priority of the file to be backed up is not a file of the target priority type, then backing up the file to be backed up again to obtain a new backup file;
[0014] The new backup file is sent to the second client.
[0015] In some possible embodiments, if the to-be-backed-up file is not modified compared to the historical backup file, determining the file priority of the to-be-backed-up file includes:
[0016] If the to-be-backed-up file has not been modified compared to the historical backup file, the file priority of the to-be-backed-up file is determined using a target file priority determination model.
[0017] In some possible embodiments, before determining the file priority of the to-be-backed-up file by using the target file priority determination model, the method further includes:
[0018] Obtain a training set of files to be backed up, wherein the training set of files to be backed up includes a plurality of training files to be backed up and their corresponding training file priorities;
[0019] Using the initial file priority determination model to identify the file features corresponding to each of the plurality of training files to be backed up, to obtain a plurality of file feature sets;
[0020] Determine the file priorities corresponding to the plurality of training files to be backed up according to the plurality of file feature sets, and obtain a plurality of predicted file priorities;
[0021] Calculate the difference between the plurality of predicted file priorities and the plurality of training file priorities to obtain a plurality of file priority differences;
[0022] Adjusting the model parameters of the initial file priority determination model according to the plurality of file priority differences to obtain a new file priority determination model;
[0023] The new file priority determination model is used to predict the file priority until the priority difference meets the preset priority difference condition, and the training of the initial file priority determination model is stopped to obtain the target file priority model.
[0024] In some possible embodiments, if the to-be-backed-up file is not modified compared to the historical backup file, determining the file priority of the to-be-backed-up file includes:
[0025] If the file to be backed up has not been modified compared to the historical backup file, determining respective weight values of a plurality of weight parameters of the file to be backed up to obtain a plurality of weight values;
[0026] Obtaining a weight calculation formula between the comprehensive weight value and multiple weight values, so as to determine the comprehensive weight value of the file to be backed up according to the multiple weight values;
[0027] The file priority of the file to be backed up is determined according to the comprehensive weight value.
[0028] In some possible embodiments, the weight calculation formula includes a plurality of weight coefficients; if the to-be-backed-up file is not modified compared to the historical backup file, determining the file priority of the to-be-backed-up file further includes:
[0029] Based on the user feedback strategy, dynamically adjust multiple weight coefficients in the weight calculation formula to obtain a new weight calculation formula;
[0030] The file priority of the file to be backed up is determined using a new weight calculation formula.
[0031] In some possible embodiments, if the historical backup file exists in the second client, after determining whether the file to be backed up is modified compared to the historical backup file, the method further includes:
[0032] If the historical backup file does not exist in the second client, backing up the file to be backed up to obtain a new backup file;
[0033] The new backup file is sent to the second client for storage.
[0034] In a second aspect, an embodiment of the present application provides a file backup device, wherein the file backup device is configured in a file backup tool, and the file backup tool is connected to a first client and a second client respectively; the file backup device comprises:
[0035] A file receiving module, used for receiving the file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client;
[0036] A file comparison module, configured to determine whether the file to be backed up is modified compared to the historical backup file if the historical backup file exists in the second client;
[0037] A first backup module, configured to back up the modified files in the files to be backed up if the files to be backed up are modified compared to the historical backup files, and send the backed-up files to the second client;
[0038] The second backup module is used to generate a hard link pointing to the historical backup file if the file to be backed up is not modified compared to the historical backup file, and send the hard link to the second client.
[0039] In a third aspect, the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the file backup method as described in any one of the first aspects.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in the file backup method as described in any one of the first aspects.
[0041] In an embodiment of the present application, a file backup method, device, electronic device and storage medium are provided. The method is applied to a file backup tool, which is connected to a first client and a second client respectively. The method includes: receiving a file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client; if there is a historical backup file in the second client, determining whether the file to be backed up has been modified compared to the historical backup file; if the file to be backed up has been modified compared to the historical backup file, backing up the modified file in the backup file and sending the backed-up file to the second client; if the file to be backed up has not been modified compared to the historical backup file, generating a hard link to the historical backup file and sending the hard link to the second client. The present application provides a third-party file backup tool, which moves the data backup process to a third-party backup tool and stores the backup file in the second client, greatly reducing the disk usage of the first client; at the same time, duplicate files are bound to the historical backup file through hard links, reducing the backup of duplicate files and further reducing disk usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 is a schematic diagram of the network architecture of the file backup system provided in an embodiment of the present application;
[0044] Figure 2 This is a flowchart of an embodiment of the file backup method provided in the embodiments of the present application;
[0045] Figure 3 A schematic diagram of a process flow of an embodiment of generating a hard link provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of a flow chart of an embodiment of a training target file priority determination model provided in an embodiment of the present application;
[0047] Figure 5 A complete flowchart of an embodiment of a file backup method provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of file changes during a file backup process provided in an embodiment of the present application;
[0049] Figure 7 A schematic diagram of an embodiment of a file backup device provided in an embodiment of the present application;
[0050] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0051] Fig. 9 It is a schematic diagram of the terminal structure provided in an embodiment of the present application;
[0052] Fig.10 It is a schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0054] In the following description, the specific embodiments of the present application will be described with reference to the steps and symbols performed by one or more computers, unless otherwise specified. Therefore, these steps and operations will be mentioned several times as being performed by a computer, and the computer execution referred to herein includes the operation of a computer processing unit by an electronic signal representing data in a structured form. This operation converts the data or maintains it at a location in the memory system of the computer, which can be reconfigured or otherwise change the operation of the computer in a manner familiar to testers in the field. The data structure maintained by the data is a physical location in the memory, which has specific characteristics defined by the data format. However, the principles of the present application are described in the above text, which does not represent a limitation, and testers in the field will understand that the various steps and operations described below can also be implemented in hardware.
[0055] The terms "module" or "unit" used herein may be considered as software objects executed on the computing system. The different components, modules, engines and services described herein may be considered as implementation objects on the computing system. The devices and methods described herein are preferably implemented in software, but may also be implemented in hardware, all within the scope of protection of this application.
[0056] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0057] Please refer to Figure 1 , the present application also provides a network architecture diagram of a file backup system, such as Figure 1 As shown, the file backup system includes a first client 100, a second client 200 and a file backup tool 300, and the file backup tool 300 is connected to the first client 100 and the second client 200 respectively; the first client is usually deployed with a first operating system, and the second client is deployed with a second operating system.
[0058] In an embodiment of the present application, the first client 100 may be a terminal device or a server. In an embodiment of the present application, when the first client 100 is a server, the server may be an independent server, or a server network or server cluster composed of servers. For example, the server described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing (Cloud Computing). In an embodiment of the present application, communication between the server and the client may be achieved through any communication method, including but not limited to mobile communications based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communications based on TCP / IP Protocol Suite (TCP / IP), User Datagram Protocol (UDP) and the like.
[0059] It is understandable that when the first client 100 used in the embodiment of the present application is a terminal device, the terminal device may be a device including both receiving hardware and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such terminal devices may include: cellular or other communication devices having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific first client 100 may be a desktop terminal or a mobile terminal, and the first client 100 may be one of a mobile phone, a tablet computer, a laptop computer, etc.
[0060] The terminal device involved in the embodiments of the present application may also refer to a device that provides voice and / or data connectivity to a user, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem. For example, a mobile phone (or "cellular" phone) and a computer with a mobile terminal, for example, a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device, which exchanges voice and / or data with a wireless access network. For example, a personal communication service (English full name: Personal Communication Service, English abbreviation: PCS) phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (Wireless Local Loop, English abbreviation: WLL) station, a personal digital assistant (English full name: Personal Digital Assistant, English abbreviation: PDA) and other devices.
[0061] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer computing devices, or computing device network connection relationships, such as Figure 1 Only one computing device is shown. It can be understood that the file backup system can also include one or more other computing devices, or / and one or more other computing devices connected to the first client 100 through a network, which is not specifically limited here.
[0062] In addition, if Figure 1 As shown, the file backup system may further include a second client 200, and the second client may be a storage device for storing backup files.
[0063] In the embodiment of the present application, the second client 200 can be a cloud storage. Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0064] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume, and the physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0065] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0066] It should be noted that Figure 1 The scenario diagram of the file backup system shown is only an example. The file backup system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the file backup system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0067] The solutions provided in the embodiments of the present application involve technologies such as artificial intelligence (AI), computer vision (CV), and machine learning (ML), which are specifically described by the following embodiments:
[0068] Among them, AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0069] AI technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0070] CV is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision that uses cameras and computers to replace human eyes to identify, track and measure targets, and further performs graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes adversarial disturbance generation, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0071] The following is a detailed description of the file backup method, device, electronic device and storage medium provided in the embodiments of the present application. It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0072] like Figure 2 As shown, it is a flowchart of an embodiment of the file backup method provided by the embodiment of the present application. Specifically, the file backup method may include the following steps:
[0073] 201. Receive a file to be backed up from a first client, and determine whether a historical backup file matching the file to be backed up exists in a second client.
[0074] The data backup method provided by the present application mainly backs up the data in the first client to the second client. The data backup process is carried out in the file backup tool, so that while realizing the file backup, it will not affect the normal operation of the first client; and the file backup tool does not store the backup file, and the backed-up file is stored in the second client, so that it will not occupy the disk storage of the first client, and it is convenient to use the files stored in the second client for file recovery. Therefore, it is necessary to first receive the file to be backed up sent by the first client, and then it is necessary to determine whether there is a historical backup file matching the file to be backed up in the second client. This is because the backup file is stored in the second client, so it is necessary to determine whether there is a historical backup file matching the file to be backed up in the second client.
[0075] In the above embodiment, the historical backup file is a file that matches the file to be backed up; and in some embodiments, judging whether there is a historical backup file that matches the file to be backed up in the second client can be: judging whether there is a file that is duplicated with the file to be backed up in the second client. The file that is duplicated with the file to be backed up can have the same name as the file to be backed up, or the same file type as the file to be backed up; the method for judging whether there is a file that is duplicated with the file to be backed up in the second client can refer to the prior art and is not limited here.
[0076] 202. If a historical backup file exists in the second client, determine whether the file to be backed up is modified compared to the historical backup file.
[0077] 203. If the file to be backed up is modified compared to the historical backup file, the modified file in the file to be backed up is backed up, and the backed-up file is sent to the second client.
[0078] If there is a historical backup file matching the file to be backed up in the second client, it means that the file to be backed up has been backed up before, and this application mainly performs incremental backup of files, that is, backs up files that have been modified; therefore, it is necessary to further determine whether the file to be backed up at this time has been modified compared to the historical backup file that has been stored before. If the file to be backed up at this time has been modified, the modified file needs to be stored again; if the file to be backed up has not changed compared to the stored file, there is no need to store it repeatedly, which will take up a lot of storage space.
[0079] Specifically, determine whether the file to be backed up is modified compared to the historical backup file; wherein the file modification includes but is not limited to: file update, deletion, naming, etc. In a specific embodiment, if the current file to be backed up is A, the second client stores a historical backup file A1; by comparing the file to be backed up A and the historical backup file A1, it can be seen that the file to be backed up A and the historical backup file A1 are both configuration files of the client; wherein the historical backup file A1 is the configuration file of the client in the first time period, and the file to be backed up is the configuration file of the client in the second time period, and the second time period is later than the first time period. In the process from the first time period to the second time period, the configuration file of the client may be artificially changed, such as the configuration parameters of the client are changed from m1 to m2; at this time, although the historical backup file A1 and the current file to be backed up have the same file type and are both configuration files of the client, the specific file contents are actually different, and the current file to be backed up A needs to be backed up and stored again, and the re-backed file is stored in the second client.
[0080] Therefore, in the embodiment of the present application, to determine whether the historical backup file matches the file to be backed up, it is usually determined from a wider perspective, such as whether the file types of the two match; and to determine whether the file to be backed up has been modified compared to the stored historical backup file, it is determined from the specific file content. If the file to be backed up has been modified, it is necessary to re-back up the modified part of the file to be backed up, and send the backed-up file to the second client for storage. Saving the backed-up file in the second client can reduce the disk usage in the first client and ensure the normal operation of the first client.
[0081] 204. If the file to be backed up is not modified compared to the historical backup file, a hard link pointing to the historical backup file is generated, and the hard link is sent to the second client.
[0082] The above-mentioned embodiment describes that when there is a historical backup file matching the file to be backed up in the second client, and the file to be backed up is modified compared to the historical backup file, it is necessary to re-backup the modified part of the file and send it to the second client for storage. In other embodiments, if the file to be backed up is not modified compared to the historical backup file, it is usually not necessary to store the unmodified file again to avoid duplicate backup files occupying storage space. In the embodiment of the present application, although the backup file is not backed up, it is necessary to generate a hard link pointing to the historical backup file and send the hard link to the second client for storage. When data recovery is required, the corresponding (historical) backup file can be found in the second client through the hard link stored in the second client to use the backup file for file recovery. Among them, the hard link can only point to the file stored in the second client, but not to the file in the first client; this is because hard links can only create hard links between files in the same file system, and hard links cannot be established between two files in different disk partitions, and the previous backup file is stored in the second client, so the hard link points to the file stored in the second client.
[0083] It should be noted that during the data backup process, each time a data backup is performed, as long as the historical backup file that matches the file to be backed up can be determined in the second client and the historical backup file has not changed, a hard link pointing to the historical backup file needs to be generated. The same historical backup file can correspond to multiple hard links at the same time, and there is no primary or secondary distinction between the multiple hard links. In this way, even if one or more hard links are deleted, the corresponding historical backup file can be found through other hard links.
[0084] The present application provides a file backup method, which is applied to a file backup tool, which is connected to a first client and a second client respectively, and the method includes: receiving a file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client; if there is a historical backup file in the second client, determining whether the file to be backed up has been modified compared to the historical backup file; if the file to be backed up has been modified compared to the historical backup file, backing up the modified files in the backup file and sending the backed-up files to the second client; if the file to be backed up has not been modified compared to the historical backup file, generating a hard link to the historical backup file and sending the hard link to the second client. The present application provides a third-party file backup tool, which moves the data backup process to a third-party backup tool and stores the backup file in the second client, greatly reducing the disk usage of the first client; at the same time, for duplicate files, hard links are used to bind to historical backup files, reducing the backup of duplicate files and further reducing disk usage.
[0085] like Figure 3 As shown, it is a schematic diagram of an embodiment of generating a hard link provided by an embodiment of the present application. Specifically, if the file to be backed up has not been modified compared to the historical backup file, a hard link pointing to the historical backup file is generated, and the hard link is sent to the second client, which may include the following multiple steps:
[0086] 301. If the file to be backed up is not modified compared to the historical backup file, determine the file priority of the file to be backed up.
[0087] 302. Determine whether the file to be backed up is a file of a target priority type according to the file priority of the file to be backed up.
[0088] 303. If the file to be backed up is a file of a target priority type, generate a hard link pointing to the historical backup file, and send the hard link to the second client.
[0089] 304. If the file priority of the file to be backed up is not a file of the target priority type, the file to be backed up is backed up again to obtain a new backup file.
[0090] 305. Send the new backup file to the second client.
[0091] In the embodiment of the present application, after determining that the file to be backed up has not been modified compared to the historical backup file, it is actually necessary to determine the file priority of the file to be backed up, and perform different processing for the files to be backed up of different priorities. Specifically, it is necessary to first determine the file priority of the file to be backed up. If the file to be backed up is a file of the target priority type, such as a file of the low priority type, a hard link pointing to the historical backup file needs to be generated at this time, and the hard link is sent to the second client for storage; the hard link can be used to find the corresponding backup file in the second client later. If the file to be backed up is not a file of the target priority type, such as a file of the low priority type, it is necessary to back up the file to be backed up again, obtain a new backup file, and send the new backup file to the second client. That is, although the file to be backed up has not been modified, since the file to be backed up is a relatively important file such as a high priority file, it is necessary to back up such important files multiple times and retain multiple copies; at the same time, multiple backups are also sent to the second client for storage. Using the above backup method, it is possible to further ensure multiple backups of important files on the premise of reducing the disk occupancy caused by repeated backup of some files that have not been modified and already have backups, and avoid errors caused by the failure to back up important files, thereby ensuring the security of important files.
[0092] In the above embodiment, the file priority of the files to be backed up can be determined by using the target file priority determination model to determine the file priority of the files to be backed up. Before using the target file priority determination model to determine the file priority of the files to be backed up, it is also necessary to obtain the target file priority determination model. Figure 4 As shown, a flow chart of an embodiment of the training target file priority model provided in the embodiment of the present application may include the following steps:
[0093] 401. Obtain a training set of files to be backed up.
[0094] 402. Using the initial file priority determination model, identify file features corresponding to each of the plurality of training files to be backed up, and obtain a plurality of file feature sets.
[0095] 403. Determine the file priorities corresponding to the multiple training files to be backed up according to the multiple file feature sets, and obtain multiple predicted file priorities.
[0096] Before training to obtain the target file priority determination model, it is first necessary to obtain the training set of files to be backed up, which includes multiple training files to be backed up and their corresponding training file priorities; then use the training set of files to be backed up to train the initial file priority determination model. Specifically, the initial file priority can be used to first identify the file features corresponding to each of the multiple training files to be backed up, including but not limited to file type, file size, backup time, number of backups and other features, to obtain multiple file feature sets; each training file to be backed up corresponds to a file feature set, and each file feature set includes all the file features corresponding to a training file to be backed up. Then, the file features can be preprocessed, such as converting the file features into numerical form. Specifically, the file features can be one-hot encoded to convert the file features into data that can be recognized by the model. The encoded data is then normalized to improve the subsequent model training effect.
[0097] The aforementioned processed file features are used to train the initial file priority determination model to obtain the target file priority determination model. Specifically, the initial file priority determination model can be used to identify file features to determine the predicted file priorities of the training files to be backed up. The multiple predicted file priorities obtained here are obtained using the initial file priority determination model.
[0098] 404. Calculate the difference between the multiple predicted file priorities and the multiple training file priorities to obtain multiple file priority differences.
[0099] 405. Adjust model parameters of the initial file priority determination model according to the multiple file priority differences to obtain a new file priority determination model.
[0100] 406. Use the new file priority determination model to predict file priorities until the priority difference meets a preset priority difference condition, stop training the initial file priority determination model, and obtain a target file priority model.
[0101] After obtaining multiple predicted file priorities, it is also necessary to calculate the difference between the predicted file priority and the actual training file priority to obtain multiple file priority differences; then adjust the model parameters of the initial file priority determination model according to the multiple file priority differences to obtain a new file priority determination model after the model parameters are adjusted. In other embodiments, the initial file priority determination model can also be optimized by adjusting the number of layers or nodes in the initial file priority determination model, or by using different activation functions. The optimized new file priority determination model is used to re-predict the file priorities of multiple training files to be backed up until the final calculated priority difference meets the preset priority difference condition; at this time, stop adjusting the parameters of the initial file priority determination model to obtain the final target file priority model. The trained target file priority determination model can be used to determine the file priority of the files to be backed up.
[0102] The above embodiments describe the use of a target file priority determination model to determine the file priority of the file to be backed up. In other embodiments, other methods may be used to determine the file priority. Specifically, if the file to be backed up has not been modified compared to the historical backup file, the weight values of the multiple weight parameters of the file to be backed up are determined to obtain multiple weight values; then a calculation formula between the comprehensive weight value and the multiple weight values is obtained to determine the comprehensive weight value of the file to be backed up based on the multiple weight values; and the file priority of the file to be backed up is determined based on the comprehensive weight value.
[0103] In an embodiment of the present application, the weight parameter of the file to be backed up can be the file feature of the file to be backed up or the processing behavior to be performed on the backup file, such as the storage location of the file to be backed up, the type of the file to be backed up, the number of modifications to the file to be backed up, etc. Different weight parameters can be assigned different weight values. For example, if the file type of the file to be backed up is a system configuration file, the weight value is 8, and if the file type of the file to be backed up is an ordinary file generated during the operation of the system, the weight value is 4. Depending on the weight parameters, the weight values corresponding to different weight parameters can be obtained respectively. Then obtain the weight calculation formula between the file priority and multiple weight values, for example: comprehensive weight value = a1*m1+ a2*m2+……+ an*mn; wherein a1-an is the weight coefficient corresponding to each weight value (or each weight parameter), a1-an is a determined value; m1-mn is the size of each weight value respectively. Based on the above weight calculation formula, after determining the size of multiple weight values, the comprehensive weight value of the file to be backed up can be calculated. In a specific embodiment, assuming that a file is accessed 30 times and modified 2 times, the weight coefficients are 1 and 2 respectively, and the weight parameter corresponding to the file type is 10; at this time, the calculated comprehensive weight value can be: comprehensive weight value = 30*1+2*2+10*1=44.
[0104] After calculating the comprehensive weight value, the comprehensive weight value range in which the comprehensive weight value is located can be determined to determine the file priority; different total weight value ranges correspond to different file priorities. For example, when the comprehensive weight value is between 0-30, it is a file with a low file priority; when the comprehensive weight value is greater than 30, it is a file with a high file priority. That is, it can be determined whether the calculated comprehensive weight value is not less than the comprehensive weight value threshold. If it is not less than the comprehensive weight value threshold, it is a high priority file; if it is less than the comprehensive weight value threshold, it is a low priority file. In other embodiments, there may also be multiple comprehensive weight value thresholds to divide file priorities into multiple different levels such as high, medium, and low. The specific division method can refer to the prior art and is not limited here.
[0105] In the above embodiment, the weight calculation formula includes multiple weight coefficients; in the present application, multiple weight parameters in the weight calculation formula can be dynamically adjusted based on the user feedback strategy to obtain a new weight calculation formula. When the comprehensive weight value is subsequently calculated, the new weight calculation formula can be used to calculate the comprehensive weight value to determine the file priority of the new file to be backed up. Specifically, the user can adjust the specific numerical value of the weight parameter according to actual needs to obtain a new weight calculation formula.
[0106] The aforementioned embodiments mainly describe the process of processing backup files when there are historical backup files in the second client; in other embodiments, if there are no historical backup files in the second client, it is necessary to back up the backup files, obtain new backup files, and send the new backup files to the second client for storage.
[0107] It should be noted that when backing up files for the first time, all files in the first client need to be backed up once, that is, the first backup is a full backup, and all backed-up files will be stored in the backup directory of the second client. When backing up later, a process similar to incremental backup will be performed, and high-priority files (i.e. important files) and modified files will be backed up. Files that have historical backup files and have not been modified in the current backup files will not be backed up repeatedly, but hard links will be generated to use the hard links to find the corresponding backup files in the second client.
[0108] like Figure 5 As shown, a complete flow chart of an embodiment of a file backup method is provided for an embodiment of the present application. Figure 5In the example, when incremental backup is turned on, first, the data or files to be backed up from the first client need to be obtained, and then the file priority model is used to determine the priority of the files to be backed up before subsequent backup. Then it is necessary to determine whether there are duplicate files in the second client that match the files to be backed up, that is, to determine whether the files to be backed up have been backed up. If there are no duplicate files, the files to be backed up are backed up, and the files to be backed up are sent to the second client for storage to obtain a new backup. If there are duplicate files, it means that the files to be backed up have been backed up; then it is necessary to determine whether the files to be backed up at this time have been modified compared to the existing backup files. This is because the present application mainly performs incremental backup of files, and incremental backup mainly backs up files that have changed, while data that has not changed is not backed up to save disk space. If the current file to be backed up has been modified compared to the backup file already existing in the second client, it is necessary to perform incremental backup; that is, the different parts of the current file to be backed up compared to the existing backup file are backed up and sent to the second client for storage. If the current file to be backed up has not been modified compared to the existing backup file, it is usually not necessary to back it up again and save it. However, in the embodiment of the present application, it is necessary to determine the file priority of the current file to be backed up. If the file to be backed up is a low-priority file, it does not need to be backed up again, and a hard link pointing to the existing backup file needs to be generated and sent to the second client for saving; the hard link can be used to find the corresponding backup file in the second client later. If the file to be backed up is a high-priority file, the high-priority file to be backed up needs to be backed up and saved in the second client. This is because high-priority files are more important and multiple copies need to be kept, so multiple backups need to be made and saved.
[0109] like Figure 6 , which is a schematic diagram of file changes during the file backup process provided by the embodiment of the present application. Figure 6 In the illustrated embodiment, when performing the first backup, the files to be backed up are file 1, file 2, and file 3, respectively, where file 1 is an important file with a high priority; since it is the first backup, a full backup is required, so the files stored in the second client include file 1, file 2, and file 3. When performing the second backup, the files to be backed up are file 2 and file 4. Since file 2 exists in the second client and is a low-priority file, a hard link pointing to file 2 needs to be created, and file 2 is not backed up again at this time; and file 4 does not exist in the second client, so file 4 needs to be backed up again. At this time, the second client stores file 1, file 2, file 3, and file 4, as well as a hard link pointing to file 2.
[0110] In order to facilitate better implementation of the file backup method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above file backup method. The meanings of the terms are the same as those in the above file backup method, and the specific implementation details can refer to the description in the method embodiment. The present application provides a file backup device, which is configured in a file backup tool, and the file backup tool is connected to the first client and the second client respectively. Figure 7 As shown, a schematic diagram of an embodiment of a file backup device provided in an embodiment of the present application may include:
[0111] The file receiving module 701 is used to receive the file to be backed up from the first client, and determine whether there is a historical backup file matching the file to be backed up in the second client.
[0112] The file comparison module 702 is used to determine whether the file to be backed up is modified compared with the historical backup file if there is a historical backup file in the second client.
[0113] The first backup module 703 is configured to back up the modified files in the to-be-backed-up file if the to-be-backed-up file is modified compared to the historical backup file, and send the backed-up files to the second client.
[0114] The second backup module 704 is configured to generate a hard link pointing to the historical backup file if the file to be backed up is not modified compared to the historical backup file, and send the hard link to the second client.
[0115] The file backup device provided by the present application is configured in a file backup tool, which is connected to a first client and a second client respectively, and the method includes: receiving a file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client; if there is a historical backup file in the second client, determining whether the file to be backed up has been modified compared to the historical backup file; if the file to be backed up has been modified compared to the historical backup file, backing up the modified files in the backup file and sending the backed-up files to the second client; if the file to be backed up has not been modified compared to the historical backup file, generating a hard link to the historical backup file and sending the hard link to the second client. The present application provides a third-party file backup tool, which moves the data backup process to a third-party backup tool and stores the backup files in the second client, greatly reducing the disk usage of the first client; at the same time, duplicate files are bound to historical backup files through hard links, reducing the backup of duplicate files and further reducing disk usage.
[0116] In some embodiments, the second backup module 704 may be specifically used for:
[0117] If the file to be backed up has not been modified compared to the historical backup file, determine the file priority of the file to be backed up;
[0118] If the file priority of the file to be backed up is less than the preset priority threshold, a hard link pointing to the historical backup file is generated, and the hard link is sent to the second client;
[0119] If the file priority of the file to be backed up is not less than the preset priority threshold, the file to be backed up is backed up again to obtain a new backup file; and the new backup file is sent to the second client.
[0120] In some embodiments, the second backup module 704 may be specifically used for:
[0121] If the file to be backed up has not been modified compared to the historical backup file, the file priority of the file to be backed up is determined using the target file priority determination model.
[0122] In some embodiments, the second backup module 704 may be specifically used for:
[0123] If the file to be backed up has not been modified compared to the historical backup file, then determining the weight values of the multiple weight parameters of the file to be backed up to obtain multiple weight values;
[0124] A weight calculation formula between the comprehensive weight value and multiple weight values is obtained to determine the comprehensive weight value of the file to be backed up according to the multiple weight values; and a file priority of the file to be backed up is determined according to the comprehensive weight value.
[0125] In some embodiments, the weight calculation formula includes multiple weight coefficients; the second backup module 704 can be specifically used to: dynamically adjust the multiple weight coefficients in the weight calculation formula based on user feedback strategy to obtain a new weight calculation formula; use the new weight calculation formula to determine the file priority of the file to be backed up.
[0126] The present application also provides an electronic device, such as Figure 8 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:
[0127] The electronic device may include components such as a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will appreciate that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0128] The processor 801 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operation storage medium, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0129] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating storage medium, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0130] The electronic device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management storage medium, so as to manage charging, discharging, and power consumption management through the power management storage medium. The power supply 803 can also include any components such as one or more DC or AC power supplies, recharge storage media, power failure detection circuits, power converters or inverters, and power status indicators.
[0131] The electronic device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0132] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the electronic device will load the executable file corresponding to the process of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application program stored in the memory 802, thereby implementing the steps in the above-mentioned file backup method embodiment.
[0133] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0134] To this end, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. The computer program is loaded by a processor to execute the steps in any one of the file backup methods provided in the embodiments of the present application.
[0135] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0136] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. Since the computer program stored in the computer-readable storage medium can execute the steps in any file backup method provided in the embodiments of the present application, the beneficial effects that can be achieved by any file backup method provided in the embodiments of the present application can be achieved, as detailed in the previous embodiments, which will not be repeated here.
[0137] When the computing device in the embodiment of the present application is a terminal device, the embodiment of the present application also provides a terminal device, such as Fig. 9 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal device can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a car computer, etc., taking the mobile phone as an example:
[0138] Fig. 9 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig. 9 The mobile phone includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, a processor 980, and a power supply 990. Those skilled in the art will understand that Fig. 9The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0139] Combine the following Fig. 9 A detailed introduction to the various components of the mobile phone:
[0140] The RF circuit 910 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 980 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 910 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 910 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0141] The memory 920 can be used to store software programs and modules. The processor 980 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 920. The memory 920 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 920 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0142] The input unit 930 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 931 or near the touch panel 931 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 931 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch panel 931 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 931, the input unit 930 may further include other input devices 932. Specifically, the other input devices 932 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0143] The display unit 940 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941. Optionally, the display panel 941 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 931 may cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, it is transmitted to the processor 980 to determine the type of touch event. Subsequently, the processor 980 provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in Fig. 9 In the embodiment, the touch panel 931 and the display panel 941 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 931 and the display panel 941 can be integrated to realize the input and output functions of the mobile phone.
[0144] The mobile phone may also include at least one sensor 950, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 941 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 941 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0145] The audio circuit 960, the speaker 961, and the microphone 962 can provide an audio interface between the user and the mobile phone. The audio circuit 960 can transmit the received audio data to the speaker 961 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 962 converts the collected sound signal into an electrical signal, which is received by the audio circuit 960 and converted into audio data, and then the audio data is output to the processor 980 for processing, and then sent to another mobile phone through the RF circuit 910, or the audio data is output to the memory 920 for further processing.
[0146] Wi-Fi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the Wi-Fi module 970. It provides users with wireless broadband Internet access. Fig. 9 A Wi-Fi module 970 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0147] The processor 980 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 920, and calling data stored in the memory 920, so as to monitor the mobile phone as a whole. Optionally, the processor 980 may include one or more processing units; optionally, the processor 980 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 980.
[0148] The mobile phone also includes a power supply 990 (such as a battery) for supplying power to each component. Optionally, the power supply can be logically connected to the processor 980 through a power management system, so as to manage charging, discharging, and power consumption management through the power management system. Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here. In the embodiment of the present application, the processor 980 included in the mobile phone also has a function of controlling and executing the file backup method process executed by the file backup device.
[0149] The present application also provides a server. Fig.10 , Fig.10 1 is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1022 (for example, one or more processors) and a memory 1032, and one or more storage media 1030 (for example, one or more mass storage devices) storing application programs 1042 or data 1044. Among them, the memory 1032 and the storage medium 1030 may be short-term storage or permanent storage. The program stored in the storage medium 1030 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1022 may be configured to communicate with the storage medium 1030 to execute a series of instruction operations in the storage medium 1030 on the server 1000.
[0150] The server 1000 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1058, and / or one or more operating systems 1041, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.
[0151] The steps in the file backup method in the above embodiment can be based on the Fig.10 The structure of the server 1000 is shown. For example, the central processor 1022 performs the following operations by calling the instructions in the memory 1032:
[0152] Receive a file to be backed up from a first client, and determine whether a historical backup file matching the file to be backed up exists in a second client; if a historical backup file exists in the second client, determine whether the file to be backed up is modified compared to the historical backup file;
[0153] If the file to be backed up is modified compared to the historical backup file, the modified file in the backup file is backed up and the backed-up file is sent to the second client; if the file to be backed up is not modified compared to the historical backup file, a hard link pointing to the historical backup file is generated and sent to the second client.
[0154] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0156] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0157] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0158] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0159] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0160] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0161] The technical solutions provided in the embodiments of the present application are introduced in detail above. The principles and implementation methods of the embodiments of the present application are explained by using specific examples in the embodiments of the present application. The description of the above embodiments is only used to help understand the methods and core ideas of the embodiments of the present application. At the same time, for those skilled in the art, according to the ideas of the embodiments of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of the present application.
Claims
1. A file backup method, characterized in that: Applied to a file backup tool, the file backup tool is connected to a first client and a second client respectively; The method comprises: Receiving the file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client; If the historical backup file exists in the second client, determining whether the file to be backed up is modified compared to the historical backup file; If the file to be backed up is modified compared to the historical backup file, backing up the modified file in the file to be backed up, and sending the backed-up file to the second client; If the file to be backed up is not modified compared to the historical backup file, a hard link pointing to the historical backup file is generated, and the hard link is sent to the second client; If the file to be backed up is not modified compared to the historical backup file, generating a hard link pointing to the historical backup file, and sending the hard link to the second client, comprises: If the file to be backed up is not modified compared to the historical backup file, determining the file priority of the file to be backed up; Determining whether the file to be backed up is a file of a target priority type according to the file priority of the file to be backed up; If the file to be backed up is a file of a target priority type, generating a hard link pointing to the historical backup file, and sending the hard link to the second client; If the file priority of the file to be backed up is not a file of the target priority type, then backing up the file to be backed up again to obtain a new backup file; The new backup file is sent to the second client.
2. The file backup method according to claim 1, characterized in that: If the file to be backed up is not modified compared to the historical backup file, determining the file priority of the file to be backed up includes: If the to-be-backed-up file has not been modified compared to the historical backup file, the file priority of the to-be-backed-up file is determined using a target file priority determination model.
3. The file backup method according to claim 2, characterized in that: Before determining the file priority of the to-be-backed-up file using the target file priority determination model, the method further includes: Obtain a training set of files to be backed up, wherein the training set of files to be backed up includes a plurality of training files to be backed up and their corresponding training file priorities to be backed up; Using the initial file priority determination model to identify the file features corresponding to each of the plurality of training files to be backed up, to obtain a plurality of file feature sets; Determine the file priorities corresponding to the plurality of training files to be backed up according to the plurality of file feature sets, and obtain a plurality of predicted file priorities; Calculating differences between the plurality of predicted file priorities and the plurality of trained to-be-backed-up file priorities to obtain a plurality of file priority differences; Adjusting the model parameters of the initial file priority determination model according to the plurality of file priority differences to obtain a new file priority determination model; The new file priority determination model is used to predict the file priority until the priority difference meets the preset priority difference condition, and the training of the initial file priority determination model is stopped to obtain the target file priority determination model.
4. The file backup method according to claim 1, characterized in that: If the file to be backed up is not modified compared to the historical backup file, determining the file priority of the file to be backed up includes: If the file to be backed up has not been modified compared to the historical backup file, determining respective weight values of a plurality of weight parameters of the file to be backed up to obtain a plurality of weight values; Obtaining a weight calculation formula between the comprehensive weight value and multiple weight values, so as to determine the comprehensive weight value of the file to be backed up according to the multiple weight values; The file priority of the file to be backed up is determined according to the comprehensive weight value.
5. The file backup method according to claim 4, characterized in that: The weight calculation formula includes a plurality of weight coefficients; if the to-be-backed-up file is not modified compared to the historical backup file, determining the file priority of the to-be-backed-up file also includes: Based on the user feedback strategy, dynamically adjust multiple weight coefficients in the weight calculation formula to obtain a new weight calculation formula; The file priority of the file to be backed up is determined using a new weight calculation formula.
6. The file backup method according to claim 1, characterized in that: If the historical backup file exists in the second client, after determining whether the file to be backed up is modified compared to the historical backup file, the method further includes: If the historical backup file does not exist in the second client, backing up the file to be backed up to obtain a new backup file; The new backup file is sent to the second client for storage.
7. A file backup device, characterized in that: The file backup device is configured in a file backup tool, and the file backup tool is connected to the first client and the second client respectively; the file backup device includes: A file receiving module, used for receiving the file to be backed up from the first client, and determining whether there is a historical backup file matching the file to be backed up in the second client; A file comparison module, configured to determine whether the file to be backed up is modified compared to the historical backup file if the historical backup file exists in the second client; A first backup module, configured to back up the modified files in the files to be backed up if the files to be backed up are modified compared to the historical backup files, and send the backed-up files to the second client; A second backup module, configured to generate a hard link pointing to the historical backup file if the file to be backed up is not modified compared to the historical backup file, and send the hard link to the second client; The second backup module is used to: if the file to be backed up is not modified compared to the historical backup file, determine the file priority of the file to be backed up; Determining whether the file to be backed up is a file of a target priority type according to the file priority of the file to be backed up; If the file to be backed up is a file of a target priority type, generating a hard link pointing to the historical backup file, and sending the hard link to the second client; If the file priority of the file to be backed up is not a file of the target priority type, then backing up the file to be backed up again to obtain a new backup file; The new backup file is sent to the second client.
8. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps in the file backup method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the file backup method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data backup method, mobile terminal and storage server
CN106708658A
Data backup method and device, node equipment and readable storage medium
CN111831475A