File synchronization method and device, computer equipment and storage medium
By dynamically adjusting the synchronization strategy based on file associations and backup system performance parameters in the big data processing system, and prioritizing the insertion of synchronization queues and files, the synchronization latency problem under bandwidth constraints in disaster recovery synchronization systems is solved, thereby improving the efficiency and reliability of file synchronization.
Patent Information
- Application Number
- CN202411108839.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-22
AI Technical Summary
In big data processing scenarios, when the disaster recovery synchronization system is limited by bandwidth, file synchronization may become slow, resulting in severe synchronization delays and affecting the reliability of disaster recovery switching and data backup.
By acquiring file backup requests and the performance parameters of the backup system, the priority of the target backup file is determined based on the relationship between files, and it is inserted into the corresponding priority synchronization queue. The synchronization strategy is dynamically adjusted to prioritize the synchronization of urgent and important files until the synchronization capacity of the backup system is reached.
It improves the efficiency and reliability of file synchronization in distributed batch processing systems, saves bandwidth resources, ensures timely synchronization of urgent files, rationally allocates network resources, and improves overall efficiency.
Smart Images

Figure CN119003244A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data processing technology, and in particular to a file synchronization method, device, computer equipment, and storage medium. Background Art
[0002] In a distributed batch processing system, especially in a big data processing scenario, the system will generate a large number of files in a short period of time. These files may come from different data sources, such as log files, analysis results, calculation outputs, etc. In order to ensure data consistency and availability, these files usually need to be synchronized to the disaster recovery system so that when the main system fails, it can quickly switch to the disaster recovery system to reduce business interruption time.
[0003] In the big data processing scenario, when the disaster recovery synchronization system is limited by bandwidth, file synchronization may become very slow, resulting in serious synchronization delays. When a large number of files to be synchronized are generated in a short period of time, they cannot be synchronized to the disaster recovery synchronization system in time, affecting the operation of the disaster recovery system after the disaster recovery switch, resulting in data backup failure. Summary of the invention
[0004] Based on this, it is necessary to provide a file synchronization method, device, computer equipment, and storage medium to address the above technical problems.
[0005] In a first aspect, the present application provides a file synchronization method. The method comprises:
[0006] Acquire a file backup request and performance parameters of a backup system, wherein the file backup request includes a first association relationship between a file to be backed up and a backed up file, and a second association relationship between the file to be backed up and a historical backup file;
[0007] Based on the first association relationship, obtaining a target backup file among the files to be backed up;
[0008] Based on the second association relationship, obtaining the priority of the target backup file;
[0009] Inserting the target backup file into a target synchronization queue of a corresponding priority based on the priority, and inserting the target backup file into a previous synchronization queue having a priority higher than the target synchronization queue when the capacity of the target synchronization queue reaches saturation;
[0010] The target backup file is synchronized to the backup system based on the priority of the synchronization queue until the synchronization capacity of the backup system is reached, and the synchronization capacity is determined according to the performance parameters of the backup system.
[0011] In one embodiment, obtaining the priority of the target backup file based on the second association relationship includes:
[0012] Get the usage time and size of historical files in the historical backup files;
[0013] Based on the usage time of the historical files, the size of the historical files, and the size of the target backup files, the priority of the target backup files is dynamically adjusted.
[0014] In one embodiment, the synchronization queue includes an immediate synchronization queue and a common synchronization queue, and when the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue includes:
[0015] Obtain the capacity of a target synchronization queue, where the target synchronization queue is a common synchronization queue;
[0016] When the capacity of the common synchronization queue reaches saturation, the target backup file is inserted into the immediate synchronization queue.
[0017] In one embodiment, the synchronization of the target backup file to the backup system based on the priority queue of the synchronization list includes:
[0018] When synchronization of files in the immediate synchronization queue is completed, files are acquired sequentially based on the priority of the common synchronization queue and synchronized to the backup system.
[0019] In one embodiment, the synchronization capacity is determined according to the performance parameters of the backup system, including:
[0020] Obtain the bandwidth and resource amount of the backup system, and adjust the synchronization rate and synchronization queue;
[0021] Based on the adjusted synchronization rate, the synchronization queue determines the synchronization capacity.
[0022] In one embodiment, the method further comprises:
[0023] The performance parameters of the backup system are monitored at preset intervals, and the synchronization queue, synchronization capacity, and synchronization time are determined based on the performance parameters.
[0024] In a second aspect, the present application further provides a file synchronization device, the device comprising:
[0025] An acquisition module, used to acquire a file backup request and performance parameters of a backup system, wherein the file backup request includes a first association relationship between a file to be backed up and a backed up file, and a second association relationship between a file to be backed up and a historical backup file;
[0026] A first associating module, configured to obtain a target backup file from the files to be backed up based on the first associating relationship;
[0027] A second association module, configured to obtain the priority of the target backup file based on the second association relationship;
[0028] an inserting module, configured to insert the target backup file into a target synchronization queue of a corresponding priority based on the priority, and when the capacity of the target synchronization queue reaches saturation, insert the target backup file into a previous synchronization queue having a priority higher than the target synchronization queue;
[0029] The synchronization module is used to synchronize the target backup file to the backup system based on the priority queue of the synchronization list until the synchronization capacity of the backup system is reached, and the synchronization capacity is determined according to the performance parameters of the backup system.
[0030] In one embodiment, obtaining the priority of the target backup file based on the second association relationship includes:
[0031] Get the usage time and size of historical files in the historical backup files;
[0032] Based on the usage time of the historical files, the size of the historical files, and the size of the target backup files, the priority of the target backup files is dynamically adjusted.
[0033] In one embodiment, the synchronization queue includes an immediate synchronization queue and a common synchronization queue, and when the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue includes:
[0034] Obtain the capacity of a target synchronization queue, where the target synchronization queue is a common synchronization queue;
[0035] When the capacity of the common synchronization queue reaches saturation, the target backup file is inserted into the immediate synchronization queue.
[0036] In one embodiment, the synchronization of the target backup file to the backup system based on the priority queue of the synchronization list includes:
[0037] When synchronization of files in the immediate synchronization queue is completed, files are acquired sequentially based on the priority of the common synchronization queue and synchronized to the backup system.
[0038] In one embodiment, the synchronization capacity is determined according to the performance parameters of the backup system, including:
[0039] Obtain the bandwidth and resource amount of the backup system, and adjust the synchronization rate and synchronization queue;
[0040] Based on the adjusted synchronization rate, the synchronization queue determines the synchronization capacity.
[0041] In one embodiment, the device further comprises:
[0042] The performance parameters of the backup system are monitored at preset intervals, and the synchronization queue, synchronization capacity, and synchronization time are determined based on the performance parameters.
[0043] In a third aspect, the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the file synchronization method when executing the computer program.
[0044] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the file synchronization method when executed by a processor.
[0045] In a fifth aspect, the present disclosure further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the file synchronization method are implemented.
[0046] The above file synchronization method has at least the following beneficial effects:
[0047] The embodiment scheme provided by the present disclosure obtains the target backup file in the files to be backed up based on the first association relationship. If the subsequent job no longer uses the files to be backed up, it can be selected not to synchronize or delay synchronization to save bandwidth resources. Based on the second association relationship, the priority of the target backup file is obtained to ensure that urgent and important files are synchronized first. Prioritize the backup of the target backup files in the immediate synchronization queue. If the number of target backup files is small, continue to return some of the target backup files in the subsequent queue, dynamically adjust the synchronization strategy, and improve the efficiency and reliability of file synchronization in the distributed batch processing system.
[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] FIG1 is a diagram of an application environment of a file synchronization method in one embodiment;
[0051] Figure 2A schematic diagram of a process flow of a file synchronization method in an embodiment;
[0052] Figure 3 is a schematic diagram of file synchronization in one embodiment;
[0053] Figure 4 is a schematic diagram of file synchronization in one embodiment;
[0054] Figure 5 is a structural block diagram of a file synchronization device in an embodiment;
[0055] FIG6 is a diagram showing the internal structure of a computer device in one embodiment;
[0056] FIG. 7 is a diagram showing the internal structure of a server in an embodiment. DETAILED DESCRIPTION
[0057] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0058] It should be noted that in the embodiments of the present application, certain software, groups, models and other existing solutions in the industry may be mentioned, which should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0059] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0061] The disclosed embodiment provides a file synchronization method, which can be applied in the application environment shown in FIG. 1 . The terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0062] In some embodiments of the present disclosure, Figure 2 As shown, a file synchronization method is provided, and the method is applied to the server in FIG1 to process the backup file as an example for explanation. It can be understood that the method can be applied to the server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In a specific embodiment, the method can include the following steps:
[0063] S202: Obtain a file backup request and performance parameters of a backup system, wherein the file backup request includes a first association relationship between files to be backed up and files that have been backed up, and a second association relationship between files to be backed up and historical backup files.
[0064] The first association relationship can be the relationship between the files to be backed up and the files that have been backed up. The configuration files, scripts, logs, etc. of the backed up files are collected, which usually contain file names or paths. The backed up files are analyzed to determine whether a specific file is referenced. For example, check whether there is a file path or file name in the configuration file, predict which files to be backed up may be needed for subsequent jobs, and build the first association relationship. The second association relationship can be the relationship between the files to be backed up and the historical backup files. The historical backup files can be files in previous batch jobs that have similar characteristics to the files to be backed up, such as files of the same type or purpose. By comparing the size of the historical backup files and the files to be backed up, the transmission time of the current file can be estimated, and the synchronization time can be better arranged.
[0065] S204: Based on the first association relationship, obtain a target backup file from the files to be backed up.
[0066] S206: Based on the second association relationship, obtain the priority of the target backup file.
[0067] The first association relationship can be used to calculate whether the subsequent operation uses the backup file. If not, it will not be synchronized. If it is used, the synchronized file in the backup file will be used as the target backup file. The urgency of the target backup file can be calculated according to the second association relationship to obtain the priority of the target backup file.
[0068] Figure 3 The figure is a schematic diagram of file synchronization in an embodiment. The files to be backed up may include multiple different files. Based on the first association relationship, the target backup files can be obtained as file A, file B, file C, and file D. Based on the second association relationship, the priorities of the target backup files are obtained as file C, file A, file B, and file D. They are inserted into the target synchronization queue of the corresponding priority. Based on the synchronization capacity, the files synchronized in this batch are file C, file A, and file B.
[0069] S208: inserting the target backup file into a target synchronization queue of a corresponding priority based on the priority, and when the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue having a priority higher than the target synchronization queue.
[0070] The total size and number of files in each queue are limited. Each synchronization queue has a maximum capacity limit, including the total file size and the number of files. These limits are set based on the resources of the backup system, such as the number of disaster recovery machines and available bandwidth. If the addition of a file causes the total size or number of files in the synchronization queue to exceed the preset maximum value, the file will not be placed in the current synchronization queue. You can put the file in the synchronization queue of the previous priority, that is, the synchronization queue where the file was used earlier, to avoid wasting resources.
[0071] S210: Synchronize the target backup file to the backup system based on the priority of the synchronization queue until the synchronization capacity of the backup system is reached, and the synchronization capacity is determined according to the performance parameters of the backup system.
[0072] The synchronization capacity can be determined based on factors such as the size of the target backup file, the status of other synchronization machines, and the current synchronization time. For example, if the performance of the current synchronization machine is good and the network bandwidth is sufficient, more data can be returned; otherwise, the data volume can be reduced. The performance indicators of the disaster recovery synchronization machine can be continuously monitored, such as CPU (Central Processing Unit) usage, memory usage, disk I / O (Input / Output) speed, etc., and the overall bandwidth usage will also be monitored to ensure that network resources are effectively used.
[0073] In the above file synchronization method, based on the first association relationship, the target backup file in the to-be-backed-up file is obtained. If the subsequent job no longer uses the to-be-backed-up file, it can be selected not to synchronize or delay synchronization to save bandwidth resources. Based on the second association relationship, the priority of the target backup file is obtained to ensure that urgent and important files are synchronized first. Prioritize the backup of the target backup files in the immediate synchronization queue. If the number of target backup files is small, continue to return some of the target backup files in the subsequent queue, dynamically adjust the synchronization strategy, and improve the efficiency and reliability of file synchronization in the distributed batch processing system.
[0074] In some embodiments of the present disclosure, obtaining the priority of the target backup file based on the second association relationship includes:
[0075] Get the usage time and size of historical files in the historical backup files;
[0076] Based on the usage time of the historical files, the size of the historical files, and the size of the target backup files, the priority of the target backup files is dynamically adjusted.
[0077] In the previous batch job, the system records the average time from the generation of each historical file to the first use, which can be used to predict the usage pattern of the target backup file. Each file has a certain size, and larger files take longer to synchronize, so the size of the file is also an important factor in determining when to synchronize. Multiple synchronization queues can be included, each queue corresponds to a specific time window, and the target backup files will be placed in a synchronization queue where they are expected to be used. For example, if a file is expected to be used within the next hour, it will be placed in a synchronization queue after 1 hour.
[0078] For each newly generated target backup file, calculate the estimated usage time of the target backup file, which can be obtained by analyzing the historical files, that is, calculating the usage time of similar files in previous batch jobs. Consider the actual size of the file, because larger files may need to be synchronized earlier to ensure that they are completed before the estimated usage time. This ensures that the target backup files that are about to be used can be synchronized in time, while the less urgent target backup files can be synchronized later, thereby reasonably allocating network resources and improving overall efficiency.
[0079] In some embodiments of the present disclosure, the synchronization queue includes an immediate synchronization queue and a common synchronization queue, and when the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue includes:
[0080] Obtain the capacity of a target synchronization queue, where the target synchronization queue is a common synchronization queue;
[0081] When the capacity of the common synchronization queue reaches saturation, the target backup file is inserted into the immediate synchronization queue.
[0082] Figure 4 The following is a schematic diagram of file synchronization in an embodiment. The synchronization queue may include an immediate synchronization queue and a common synchronization queue. The priority of the immediate synchronization queue is higher than that of the common synchronization queue.
[0083] If the addition of a target backup file will cause the total size of the queue or the number of files to exceed the preset maximum value, the file will not be placed in the current synchronization queue. It can be placed in the synchronization queue of the previous priority. If the synchronization queue expected to be inserted does not exist, it will be directly placed in the immediate synchronization queue.
[0084] In some embodiments of the present disclosure, synchronizing the target backup file to the backup system based on the priority queue of the synchronization list includes:
[0085] When synchronization of files in the immediate synchronization queue is completed, files are acquired sequentially based on the priority of the common synchronization queue and synchronized to the backup system.
[0086] The immediate synchronization queue contains files that need to be synchronized as soon as possible. When the backup system requests a synchronization queue, it will first return the target backup files in the immediate synchronization queue. If the number of target backup files in the immediate synchronization queue is small and insufficient to meet the current synchronization requirements, it can continue to return a partial file list in the subsequent ordinary synchronization queue.
[0087] In some embodiments of the present disclosure, the synchronization capacity is determined according to the performance parameters of the backup system, including:
[0088] Obtain the bandwidth and resource amount of the backup system, and adjust the synchronization rate and synchronization queue;
[0089] Based on the adjusted synchronization rate, the synchronization queue determines the synchronization capacity.
[0090] The amount of synchronized data returned, i.e. the synchronization capacity, is determined by factors such as the size of the target backup file, the status of other synchronized machines, and the current synchronization time. According to the bandwidth and resource amount of the monitored backup system, the synchronization rate and synchronization queue are adjusted to optimize the synchronization process. For example, if the performance of the current synchronized machine is good and the network bandwidth is sufficient, more data can be returned; otherwise, less data can be returned.
[0091] In some embodiments of the present disclosure, the method further includes:
[0092] The performance parameters of the backup system are monitored at preset intervals, and the synchronization queue, synchronization capacity, and synchronization time are determined based on the performance parameters.
[0093] The performance parameters of the monitored backup system will change with CPU utilization, memory usage, disk I / O speed, overall bandwidth usage, etc. The performance parameters of the backup system can be monitored at preset intervals and the synchronization queue, synchronization capacity, and synchronization time can be determined based on the performance parameters.
[0094] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0095] Based on the same inventive concept, the embodiment of the present disclosure also provides a file synchronization device for implementing the above-mentioned file synchronization method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in the file synchronization device embodiment provided below can refer to the limitations of the file synchronization method above, and will not be repeated here.
[0096] The device may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiments of this specification and is combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiments of the present disclosure is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0097] In one embodiment, Figure 5 As shown, a file synchronization device 500 is provided, and the device may be the aforementioned server, or a module, component, device, unit, etc. integrated in the server. The device 500 may include:
[0098] An acquisition module 502 is used to acquire a file backup request and performance parameters of a backup system, wherein the file backup request includes a first association relationship between a file to be backed up and a backed up file, and a second association relationship between a file to be backed up and a historical backup file;
[0099] A first associating module 504, configured to obtain a target backup file from the files to be backed up based on the first associating relationship;
[0100] A second association module 506, configured to obtain the priority of the target backup file based on the second association relationship;
[0101] An inserting module 508 is configured to insert the target backup file into a target synchronization queue of a corresponding priority based on the priority, and when the capacity of the target synchronization queue reaches saturation, insert the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue;
[0102] The synchronization module 510 is used to synchronize the target backup file to the backup system based on the priority queue of the synchronization list until the synchronization capacity of the backup system is reached, and the synchronization capacity is determined according to the performance parameters of the backup system.
[0103] In one embodiment, obtaining the priority of the target backup file based on the second association relationship includes:
[0104] Get the usage time and size of historical files in the historical backup files;
[0105] Based on the usage time of the historical files, the size of the historical files, and the size of the target backup files, the priority of the target backup files is dynamically adjusted.
[0106] In one embodiment, the synchronization queue includes an immediate synchronization queue and a common synchronization queue, and when the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue includes:
[0107] Obtain the capacity of a target synchronization queue, where the target synchronization queue is a common synchronization queue;
[0108] When the capacity of the common synchronization queue reaches saturation, the target backup file is inserted into the immediate synchronization queue.
[0109] In one embodiment, the synchronization of the target backup file to the backup system based on the priority queue of the synchronization list includes:
[0110] When synchronization of files in the immediate synchronization queue is completed, files are acquired sequentially based on the priority of the common synchronization queue and synchronized to the backup system.
[0111] In one embodiment, the synchronization capacity is determined according to the performance parameters of the backup system, including:
[0112] Obtain the bandwidth and resource amount of the backup system, and adjust the synchronization rate and synchronization queue;
[0113] Based on the adjusted synchronization rate, the synchronization queue determines the synchronization capacity.
[0114] In one embodiment, the device further comprises:
[0115] The performance parameters of the backup system are monitored at preset intervals, and the synchronization queue, synchronization capacity, and synchronization time are determined based on the performance parameters.
[0116] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0117] Each module in the above-mentioned file synchronization device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0118] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6 . The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store files to be synchronized. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a file synchronization method is implemented.
[0119] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a file synchronization method is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, a trackball or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0120] Those skilled in the art will understand that the structures shown in FIG. 6 and FIG. 7 are merely block diagrams of partial structures related to the scheme of the present disclosure, and do not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figures, or combine certain components, or have a different arrangement of components.
[0121] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present disclosure is implemented.
[0122] In one embodiment, a computer program product is provided, including a computer program, which implements the method described in any embodiment of the present disclosure when executed by a processor.
[0123] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
[0124] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0125] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A file synchronization method, characterized in that: The method comprises: Acquire a file backup request and performance parameters of a backup system, wherein the file backup request includes a first association relationship between a file to be backed up and a backed up file, and a second association relationship between the file to be backed up and a historical backup file; Based on the first association relationship, obtaining a target backup file among the files to be backed up; Based on the second association relationship, obtaining the priority of the target backup file; Inserting the target backup file into a target synchronization queue of a corresponding priority based on the priority, and inserting the target backup file into a previous synchronization queue having a priority higher than the target synchronization queue when the capacity of the target synchronization queue reaches saturation; The target backup file is synchronized to the backup system based on the priority of the synchronization queue until the synchronization capacity of the backup system is reached, and the synchronization capacity is determined according to the performance parameters of the backup system.
2. The method according to claim 1, characterized in that The obtaining the priority of the target backup file based on the second association relationship includes: Get the usage time and size of historical files in the historical backup files; Based on the usage time of the historical files, the size of the historical files, and the size of the target backup files, the priority of the target backup files is dynamically adjusted.
3. The method according to claim 1, characterized in that The synchronization queue includes an immediate synchronization queue and a common synchronization queue. When the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue includes: Obtain the capacity of a target synchronization queue, where the target synchronization queue is a common synchronization queue; When the capacity of the common synchronization queue reaches saturation, the target backup file is inserted into the immediate synchronization queue.
4. The method according to claim 3, characterized in that: The priority queue based on the synchronization list synchronizes the target backup file to the backup system, including: When synchronization of files in the immediate synchronization queue is completed, files are acquired sequentially based on the priority of the common synchronization queue and synchronized to the backup system.
5. The method according to claim 1, characterized in that The synchronization capacity is determined according to the performance parameters of the backup system, including: Obtain the bandwidth and resource amount of the backup system, and adjust the synchronization rate and synchronization queue; Based on the adjusted synchronization rate, the synchronization queue determines the synchronization capacity.
6. The method according to claim 1, characterized in that The method further comprises: The performance parameters of the backup system are monitored at preset intervals, and the synchronization queue, synchronization capacity, and synchronization time are determined based on the performance parameters.
7. A file synchronization device, characterized in that: The device comprises: An acquisition module, used to acquire a file backup request and performance parameters of a backup system, wherein the file backup request includes a first association relationship between a file to be backed up and a backed up file, and a second association relationship between a file to be backed up and a historical backup file; A first associating module, configured to obtain a target backup file from the files to be backed up based on the first associating relationship; A second association module, configured to obtain the priority of the target backup file based on the second association relationship; an inserting module, configured to insert the target backup file into a target synchronization queue of a corresponding priority based on the priority, and when the capacity of the target synchronization queue reaches saturation, insert the target backup file into a previous synchronization queue having a priority higher than the target synchronization queue; The synchronization module is used to synchronize the target backup file to the backup system based on the priority queue of the synchronization list until the synchronization capacity of the backup system is reached, and the synchronization capacity is determined according to the performance parameters of the backup system.
8. The device according to claim 7, characterized in that The obtaining the priority of the target backup file based on the second association relationship includes: Get the usage time and size of historical files in the historical backup files; Based on the usage time of the historical files, the size of the historical files, and the size of the target backup files, the priority of the target backup files is dynamically adjusted.
9. The device according to claim 7, characterized in that The synchronization queue includes an immediate synchronization queue and a common synchronization queue. When the capacity of the target synchronization queue reaches saturation, inserting the target backup file into a previous synchronization queue with a priority higher than the target synchronization queue includes: Obtain the capacity of a target synchronization queue, where the target synchronization queue is a common synchronization queue; When the capacity of the common synchronization queue reaches saturation, the target backup file is inserted into the immediate synchronization queue.
10. The device according to claim 9, characterized in that The priority queue based on the synchronization list synchronizes the target backup file to the backup system, including: When synchronization of files in the immediate synchronization queue is completed, files are acquired sequentially based on the priority of the common synchronization queue and synchronized to the backup system.
11. The device according to claim 7, characterized in that The synchronization capacity is determined according to the performance parameters of the backup system, including: Obtain the bandwidth and resource amount of the backup system, and adjust the synchronization rate and synchronization queue; Based on the adjusted synchronization rate, the synchronization queue determines the synchronization capacity.
12. The device according to claim 7, characterized in that The device also includes: The performance parameters of the backup system are monitored at preset intervals, and the synchronization queue, synchronization capacity, and synchronization time are determined based on the performance parameters.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
File synchronization method, electronic equipment, readable medium and program product
CN119892852A
