Batch file synchronization method and device, electronic equipment and storage medium
By maintaining synchronization operation records and breakpoint information for batch files, the system enables breakpoint resumption of batch file uploads, solving the problem of repeated synchronization when file uploads fail and reducing transmission costs and time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU SHUMEI TECHNOLOGY CO LTD
- Filing Date
- 2023-04-21
- Publication Date
- 2026-04-21
AI Technical Summary
The lack of a batch file resuming solution in existing technologies means that when a file upload fails, it needs to be re-uploaded, which increases transmission time and resource overhead.
By maintaining information on whether batch files have undergone synchronization, the synchronization results, and breakpoints in case of synchronization failure, the system enables resuming interrupted transmissions of files that failed to synchronize, thus avoiding duplicate synchronization of successfully synchronized files.
It reduces the time, network and resource overhead of batch file synchronization and improves synchronization efficiency.
Smart Images

Figure CN116527655B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a batch file synchronization method, apparatus, electronic device and storage medium. Background Technology
[0002] With the continuous development of internet technology, massive amounts of data and files are generated every day. In cloud-based file upload scenarios, network instability or failures can lead to upload failures. When an upload fails, the file needs to be re-uploaded, increasing transmission time, network overhead, and resource costs.
[0003] In heterogeneous file migration scenarios, such as synchronizing a batch of files from a source file server to a destination file server, it is necessary to synchronize the batch files periodically or periodically. If network instability or network failure occurs during the periodic synchronization of batch files, all files need to be resynchronized, which significantly increases the file synchronization cost.
[0004] However, the relevant technologies can only achieve breakpoint resumption for a single file, and there is no technical solution for breakpoint resumption for batch files. Therefore, how to achieve breakpoint resumption for batch files is very important. Summary of the Invention
[0005] The purpose of this application is to at least partially solve one of the aforementioned technical problems.
[0006] To address this, this application proposes a batch file synchronization method, apparatus, electronic device, and storage medium. By maintaining information on whether a batch of files has undergone synchronization, the synchronization results, and breakpoint information in cases where the synchronization results indicate failure, it is possible to synchronize or transmit files indicating synchronization failure each time a batch of files is synchronized, while not synchronizing or transmitting files indicating successful synchronization. This avoids duplicate file synchronization and reduces the synchronization time, network, and resource overhead for batch files. Furthermore, for files that failed to synchronize, the recorded breakpoint information allows for resumed transmission, further reducing the synchronization time, network, and resource overhead. For example, in scenarios where batch file synchronization fails, since it is not necessary to re-synchronize or transmit files indicating successful synchronization, resumed transmission of batch files can be achieved, reducing the synchronization cost of batch files.
[0007] The first aspect of this application proposes a batch file synchronization method, which maintains whether the batch files have undergone synchronization operations, the synchronization result, and breakpoint information in the event of synchronization failure; including:
[0008] Obtain the target file to be synchronized;
[0009] Determine whether the target file has undergone a synchronization operation;
[0010] If the target file has undergone a synchronization operation, obtain the synchronization result of the target file;
[0011] If the synchronization result of the target file indicates that the synchronization of the target file has failed, obtain the breakpoint information of the target file;
[0012] Synchronize the target file based on the breakpoint information.
[0013] A second aspect of this application provides a batch file synchronization device that maintains information on whether the batch files have undergone synchronization, the synchronization result, and breakpoint information in case of synchronization failure; including:
[0014] The first acquisition module is used to acquire the target file to be synchronized.
[0015] The judgment module is used to determine whether the target file has undergone a synchronization operation;
[0016] The second acquisition module is used to acquire the synchronization result of the target file when the target file has undergone a synchronization operation;
[0017] The third acquisition module is used to acquire the breakpoint information of the target file when the synchronization result of the target file indicates that the synchronization of the target file has failed.
[0018] The synchronization module is used to synchronize the target file based on the breakpoint information.
[0019] A third aspect of this application provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the batch file synchronization method as described in the first aspect.
[0020] The fourth aspect of this application provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the batch file synchronization method as described in the first aspect.
[0021] A fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the batch file synchronization method described in the first aspect of this application.
[0022] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects:
[0023] By maintaining information on whether a batch of files has undergone synchronization, the synchronization results, and breakpoints in cases where the synchronization result indicates failure, it's possible to synchronize or transmit files indicating synchronization failure each time a batch of files is synchronized, while files indicating successful synchronization are not synchronized or transmitted. This avoids duplicate file synchronization, reducing the synchronization time, network, and resource overhead for batch files. Furthermore, for files that failed to synchronize, the recorded breakpoint information allows for resumed transmission, further reducing the synchronization time, network, and resource overhead. For example, in scenarios where batch file synchronization fails, since it's unnecessary to re-synchronize or transmit files indicating successful synchronization, breakpoint resumed transmission can be implemented, reducing the synchronization cost of batch files.
[0024] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0025] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0026] Figure 1 A flowchart illustrating a batch file synchronization method provided in an embodiment of this application;
[0027] Figure 2 A flowchart illustrating another batch file synchronization method provided in this application embodiment;
[0028] Figure 3 A flowchart illustrating another batch file synchronization method provided in this application embodiment;
[0029] Figure 4 A flowchart illustrating another batch file synchronization method provided in this application embodiment;
[0030] Figure 5 A flowchart illustrating another batch file synchronization method provided in this application embodiment;
[0031] Figure 6 This is a schematic diagram illustrating the implementation principle of an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of a batch file synchronization device according to an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0034] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0035] This application provides a batch file synchronization method, apparatus, and electronic device. Before describing the embodiments of this application in detail, for ease of understanding, commonly used technical terms are first introduced:
[0036] An FTP (File Transfer Protocol) server is a computer that provides file storage and access services on the Internet, and provides services in accordance with the FTP protocol.
[0037] OSS (Object Storage Service) is a cloud storage service that provides massive, secure, low-cost, and highly reliable storage services suitable for storing files of any type.
[0038] OBS (Object Storage Service) is an object-based storage service that provides users with massive, secure, highly reliable, and low-cost data storage capabilities. Users do not need to consider capacity limitations when using it, and it offers a variety of storage types to meet the needs of various business scenarios.
[0039] The following is combined Figure 1 This application provides a detailed description of the batch file synchronization method provided.
[0040] Figure 1 This is a flowchart illustrating a batch file synchronization method provided in an embodiment of this application.
[0041] The batch file synchronization method of this application embodiment can be executed by the batch file synchronization device provided in this application embodiment. The batch file synchronization device in this application can be applied to an electronic device to perform batch file synchronization function. Alternatively, the batch file synchronization device can be configured in an application of an electronic device so that the application can perform batch file synchronization function.
[0042] The electronic device can be any device with computing capabilities, and the device or the application within the device can perform file synchronization functions. The device with computing capabilities can be, for example, a personal computer, a mobile terminal, or a server. The mobile terminal can be, for example, an in-vehicle device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, or other hardware devices with various operating systems, touchscreens, and / or displays.
[0043] like Figure 1 As shown, this batch file synchronization method includes the following steps:
[0044] Step S101: Obtain the target file to be synchronized.
[0045] In this embodiment of the application, during batch file synchronization, it is possible to maintain whether a synchronization operation has been performed on the batch files, and if a synchronization operation has been performed on the batch files, to maintain the synchronization result of the batch files (to indicate whether the file synchronization was successful), and to maintain the breakpoint information of the files if the synchronization result indicates that the file synchronization failed. For example, the breakpoint information may include the breakpoint position, wherein the breakpoint position is used to indicate the position where data synchronization in the file was interrupted during the previous synchronization process.
[0046] In this embodiment of the application, the target file to be synchronized can be obtained from the source file server.
[0047] Step S102: Determine whether the target file has undergone a synchronization operation.
[0048] In this embodiment of the application, it can be determined whether the target file has undergone synchronization operation based on the maintenance information.
[0049] Step S103: If the target file has undergone a synchronization operation, obtain the synchronization result of the target file.
[0050] In this embodiment of the application, if the target file has undergone a synchronization operation, the synchronization result of the target file can be obtained from the maintained information. The synchronization result of the target file is used to indicate whether the target file was successfully synchronized; that is, the synchronization result of the target file indicates whether the synchronization was successful or failed.
[0051] Step S104: If the synchronization result of the target file indicates that the target file synchronization has failed, obtain the breakpoint information of the target file.
[0052] In this embodiment of the application, if the synchronization result of the target file indicates that the target file synchronization has failed, the breakpoint information of the target file can be obtained from the maintained information. The breakpoint information of the target file is used to indicate the interruption position of data synchronization in the target file during the previous synchronization process.
[0053] Step S105: Synchronize the target file based on the breakpoint information.
[0054] In this embodiment, the target file can be synchronized based on breakpoint information. For example, the target file can be resumed from where it was interrupted based on the breakpoint information. Specifically, the target file can be synchronized to the destination file server.
[0055] In this context, the destination file server and the source file server are different file servers. For example, the source file server can be an FTP server, while the destination file server can be OSS, OBS, etc.
[0056] There are no restrictions on the protocol types of the destination file server and the source file server. For example, the destination file server and the source file server can be file servers with the same protocol type (such as FTP, SFTP (Secure FTP, Secure File Transfer Protocol) etc.), or the destination file server and the source file server can be file servers with different protocol types. For example, the protocol type of the source file server can be FTP, and the destination file server can be a file server with other protocol types (i.e., other file service protocols).
[0057] The batch file synchronization method of this application embodiment obtains the target files to be synchronized; determines whether the target files have undergone synchronization operations; if the target files have undergone synchronization operations, obtains the synchronization result of the target files; if the synchronization result of the target files indicates that the synchronization of the target files has failed, obtains the breakpoint information of the target files; and synchronizes the target files according to the breakpoint information. Therefore, by maintaining information on whether batch files have undergone synchronization operations, the synchronization results, and the breakpoint information when the synchronization result indicates that the synchronization has failed, it is possible to synchronize or transmit files whose synchronization results indicate that the synchronization has failed each time batch files are synchronized, while not synchronizing or transmitting files whose synchronization results indicate that the synchronization has succeeded. This avoids duplicate file synchronization and reduces the synchronization time, network, and resource overhead of batch files. Furthermore, for files that have failed to synchronize, the record breakpoint information can be used to resume the transmission of those files, further reducing the synchronization time, network, and resource overhead of batch files. For example, in the scenario of batch file synchronization failure, since it is not necessary to re-synchronize or transmit files whose synchronization results indicate that the synchronization has succeeded, breakpoint resumption of batch files can be achieved, reducing the synchronization cost of batch files.
[0058] In one possible implementation of this application, during the batch file synchronization process, synchronization record information (referred to as first synchronization record information in this application) for each file that has undergone synchronization operation can be recorded. The first synchronization record information may include the synchronization status (including synchronization failure status or synchronization success status) of the files that have undergone synchronization operation and breakpoint information in cases where the synchronization status indicates that the file that underwent synchronization operation has failed (i.e., the synchronization status is synchronization failure status). Therefore, in this application, based on the maintained first synchronization record information, it is possible to determine whether a target file has undergone synchronization operation, and based on the maintained first synchronization record information, to obtain the synchronization result and breakpoint information of the target file. The following is in conjunction with... Figure 2 The above process will be explained in detail.
[0059] Figure 2 This is a flowchart illustrating another batch file synchronization method provided in an embodiment of this application.
[0060] like Figure 2 As shown, this batch file synchronization method may include the following steps:
[0061] Step S201: Obtain the target file to be synchronized.
[0062] The explanation of step S201 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0063] Step S202: Determine whether the first target synchronization record information corresponding to the target file is found. If not, proceed to steps S203 to S204. If yes, proceed to steps S205 to S208.
[0064] In this embodiment of the application, the first synchronization record information of each file that has undergone synchronization operation can be queried to determine whether there is a first target synchronization record information corresponding to the target file in each first synchronization record information.
[0065] For example, the first synchronization record information may include the storage path of the file. Based on the storage path of the target file, each first synchronization record information can be queried to determine whether there is a first target synchronization record information corresponding to the target file.
[0066] If there is no first target synchronization record information corresponding to the target file in each of the first synchronization record information, steps S203 to S204 can be executed; if there is a first target synchronization record information corresponding to the target file in each of the first synchronization record information, steps S205 to S208 can be executed.
[0067] It should be noted that steps S203 to S204 and steps S205 to S208 are two parallel implementation methods. In actual application, only one needs to be executed.
[0068] Step S203: Determine that the target file has not undergone synchronization operations.
[0069] In this embodiment of the application, if no first target synchronization record information corresponding to the target file is found, it can be determined that the target file has not undergone synchronization operation.
[0070] Step S204: Synchronize all data in the target file.
[0071] In this embodiment of the application, if the target file has not undergone a synchronization operation, all data in the target file can be synchronized, that is, all data in the target file can be synchronized to the destination file server.
[0072] It should be noted that during the synchronization of the target file, the synchronization status of the target file can be recorded. If the synchronization status is successful, the synchronization record information corresponding to the target file can be generated based on the synchronization status of the target file. If the synchronization status is unsuccessful, the synchronization record information corresponding to the target file can be generated based on the synchronization status and breakpoint information of the target file.
[0073] In this application, synchronization record information corresponding to the target file can also be stored. For example, the storage medium can be a relational database, a file, or other persistent storage.
[0074] As an example, if the target file is successfully synchronized when the synchronization ends, the synchronization status of the target file in the generated synchronization record information can be "synchronization successful".
[0075] As another example, if a network anomaly causes the target file synchronization to fail at the end of the synchronization process, the synchronization status of the target file in the generated synchronization record information can be set to a synchronization failure status. Furthermore, the breakpoint information of the target file in the generated synchronization record information can be used to indicate the interruption position of data synchronization in the target file during this synchronization process.
[0076] Therefore, for the first file synchronization, synchronizing the entire file to the destination file server improves the consistency of synchronized files between the source and destination file servers. Furthermore, upon completion of file synchronization (including success and failure), a synchronization record is generated for that file. This allows subsequent file synchronization processes to determine whether a file has undergone synchronization and its synchronization status during that process. This eliminates the need to re-synchronize successfully synchronized files, reducing synchronization costs. Additionally, the synchronization record information can be used to identify files that failed to synchronize and resume interrupted transmissions, further reducing synchronization costs.
[0077] In one possible implementation of this application embodiment, during the synchronization process of the target file, the file metadata of the target file can also be recorded, that is, the synchronization record information corresponding to the target file can also include the file metadata of the target file when performing the synchronization operation.
[0078] The recorded file metadata is used to indicate whether the target file has been updated. For example, the recorded file metadata may include, but is not limited to, update time (or modification time, i.e., the time when the file was last modified) and file size, which are metadata or information used to indicate whether the file has been updated.
[0079] Step S205: Determine that the target file has undergone a synchronization operation.
[0080] In this embodiment of the application, if the first target synchronization record information corresponding to the target file is found, it can be determined that the target file has undergone a synchronization operation.
[0081] Step S206: Determine the synchronization result of the target file based on the synchronization status in the first target synchronization record information.
[0082] In this embodiment of the application, the synchronization result of the target file can be determined based on the synchronization status in the first target synchronization record information. For example, when the synchronization status in the first target synchronization record information is a synchronization success status, the synchronization result of the target file is determined to indicate that the target file is synchronized successfully. When the synchronization status in the first target synchronization record information is a synchronization failure status, the synchronization result of the target file is determined to indicate that the target file is synchronized unsuccessfully.
[0083] Step S207: If the synchronization result of the target file indicates that the target file synchronization has failed, obtain the breakpoint information of the target file from the first target synchronization record information.
[0084] In this embodiment of the application, if the synchronization result of the target file indicates that the target file synchronization has failed, the breakpoint information of the target file can be obtained from the first target synchronization record information.
[0085] Step S208: Synchronize the target file based on the breakpoint information.
[0086] The explanation of step S208 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0087] It should be noted that when the target file is successfully synchronized, the synchronization status in the first target synchronization record information can be updated to a synchronization success status.
[0088] The batch file synchronization method of this application records the synchronization record information of each file that has undergone synchronization during the batch file synchronization process. This enables the synchronization or transmission of files in the synchronization failure state each time files are synchronized, based on the synchronization record information, while files in the synchronization success state are not synchronized or transmitted, thus avoiding the situation of repeated file synchronization.
[0089] In another possible implementation of this application, during the batch file synchronization process, synchronization record information (referred to as second synchronization record information in this application) corresponding to each file in the batch files can be recorded. That is, for any file in the batch files, regardless of whether the file has undergone a synchronization operation, the synchronization record information corresponding to that file is recorded. The second synchronization record information may include whether the corresponding file has undergone a synchronization operation, the synchronization result when the corresponding file has undergone a synchronization operation (used to indicate whether the corresponding file was successfully synchronized), and breakpoint information when the synchronization result of the corresponding file indicates a synchronization failure. Therefore, in this application, based on the maintained second synchronization record information, it is possible to determine whether a target file has undergone a synchronization operation, and based on the maintained second synchronization record information, to obtain the synchronization result and breakpoint information of the target file. The following is in conjunction with... Figure 3 The above process will be explained in detail.
[0090] Figure 3 This is a flowchart illustrating another batch file synchronization method provided in an embodiment of this application.
[0091] like Figure 3 As shown, this batch file synchronization method may include the following steps:
[0092] Step S301: Obtain the target file to be synchronized.
[0093] The explanation of step S301 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0094] Step S302: Query the second target synchronization record information corresponding to the target file.
[0095] In this embodiment of the application, the second synchronization record information corresponding to each file can be queried in order to determine the second target synchronization record information corresponding to the target file from each second synchronization record information.
[0096] For example, the second synchronization record information may include the storage path of the file. Based on the storage path of the target file, each second synchronization record information can be queried to determine the second target synchronization record information corresponding to the target file.
[0097] Step S303: If the second target synchronization record information indicates that the target file has performed a synchronization operation, determine that the target file has performed a synchronization operation.
[0098] In this embodiment of the application, the second target synchronization record information can also indicate whether the target file has performed a synchronization operation. If the second target synchronization record information indicates that the target file has performed a synchronization operation, it can be determined that the target file has performed a synchronization operation.
[0099] Step S304: Obtain the synchronization result of the target file from the second target synchronization record information.
[0100] In this embodiment of the application, if the target file has undergone a synchronization operation, the synchronization result of the target file can be further obtained from the second target synchronization record information (used to indicate whether the target file has been successfully synchronized).
[0101] Step S305: If the synchronization result of the target file indicates that the target file synchronization has failed, obtain the breakpoint information of the target file.
[0102] Step S306: Synchronize the target file based on the breakpoint information.
[0103] The explanation of steps S305 to S306 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0104] Step S307: If the second target synchronization record information indicates that the target file has not performed a synchronization operation, determine that the target file has not performed a synchronization operation.
[0105] In the embodiments of this application, when the second target synchronization record information indicates that the target file has not performed a synchronization operation, it can be determined that the target file has not performed a synchronization operation.
[0106] Step S308: Synchronize all data in the target file.
[0107] The explanation of step S308 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0108] It should be noted that steps S303 to S306 and steps S307 to S308 are two parallel implementation methods. In actual application, only one needs to be executed.
[0109] It should be noted that when the target file is successfully synchronized, the synchronization result in the second target synchronization record can be updated; that is, the updated synchronization result indicates that the target file was successfully synchronized. When the target file synchronization fails, the synchronization result and breakpoint information in the second target synchronization record can be updated; that is, the updated synchronization result indicates that the target file synchronization failed, and the updated breakpoint information is used to indicate the point where data synchronization in the target file was interrupted during this synchronization process.
[0110] The batch file synchronization method of this application records the synchronization record information of each file during the batch file synchronization process. This allows the method to synchronize or transmit files that fail to synchronize based on the synchronization record information each time files are synchronized, while not synchronizing or transmitting files that succeed in synchronization. This avoids the situation of repeated file synchronization.
[0111] It should be noted that after the previous file synchronization ends and before the start of the current file synchronization, some files on the source file server may be updated. In this case, in order to improve the accuracy and completeness of file synchronization, even if the synchronization record information includes the breakpoint information of the updated file, the file cannot be resumed based on the breakpoint information.
[0112] That is, in any embodiment of this application, file metadata of batch files can also be maintained. Based on the maintained file metadata, it can be determined whether the files that have undergone synchronization operations have been updated. If it is determined that the files that have undergone synchronization operations have been updated, then in order to improve the consistency of the synchronized files in the source file server and the destination file server, the file can be resynchronized without resuming the file based on the breakpoint information. The following is in conjunction with Figure 4 The above process will be explained in detail.
[0113] Figure 4 This is a flowchart illustrating another batch file synchronization method provided in an embodiment of this application.
[0114] like Figure 4 As shown, steps S105, S208, or S306 may include the following sub-steps:
[0115] Step S401: Obtain the current file metadata of the target file.
[0116] The current file metadata, also known as the current file metadata, includes, but is not limited to: the target file's creation time, update time (or modification time, i.e., the time of the file's most recent modification), access time, number of accesses, average access interval, file type, author information, storage creation time, storage address, storage path, etc.
[0117] Creation time refers to the creation time within the source file server access; file type refers to the type to which the file belongs.
[0118] The average access interval can be determined based on the access time T. t And the latest access time before the update (i.e., the previous access time) T t-1The interval for this visit is determined by multiplying the current visit interval by the average visit interval before the update by the number of visits before the update (N), and then dividing by the number of visits after the update.
[0119] For example, mark the average interval of the current visit as S. t Average visit interval S before update t-1 Then we have: S t =((T) t -T t-1 )+S t-1 *N) / (N+1).
[0120] In this embodiment of the application, the current file metadata of the target file can be obtained from the source file server.
[0121] Step S402: Determine whether the current file metadata matches the third file metadata in the third target synchronization record information.
[0122] In this embodiment, the third target synchronization record information may include either first synchronization record information or second synchronization record information. The first synchronization record information may further include first file metadata of the file that has undergone synchronization, and the second synchronization record information may further include second file metadata of the corresponding file. When the third synchronization record information is the first synchronization record information, the third file metadata may be the first file metadata; when the third synchronization record information is the second synchronization record information, the third file metadata may be the second file metadata.
[0123] The first file metadata or the second file metadata includes, but is not limited to, update time, file size, and other metadata used to indicate whether the file has been updated.
[0124] In this embodiment of the application, the current file metadata can be compared with the third file metadata in the third target synchronization record information to determine whether the current file metadata matches the third file metadata.
[0125] As an example, to improve the accuracy of the comparison results, the third file metadata, including update time and file size, is used as an example. The matching method between the current file metadata and the third file metadata is as follows: it is determined whether the first update time in the current file metadata matches the second update time in the third file metadata, and whether the first file size in the current file metadata matches the second file size in the third file metadata. If the first update time matches the second update time and the first file size matches the second file size, it is determined that the current file metadata matches the third file metadata. If the first update time does not match the second update time and / or the first file size does not match the second file size, it is determined that the current file metadata does not match the third file metadata.
[0126] Therefore, it is possible to effectively determine whether a target file has been updated in two adjacent file synchronization processes based on file size and update time. If an update has occurred, the target file can be resynchronized, which can improve the consistency and integrity of synchronized files on the source file server and the destination file server.
[0127] It should be noted that the above is only an example of the third file metadata including update time and file size. In actual application, the third file metadata may also include other metadata used to indicate whether the file has been updated. This application does not limit this.
[0128] Step S403: If the current file metadata matches the third file metadata, synchronize the target file according to the breakpoint information.
[0129] In this embodiment, if the current file metadata matches the third file metadata, it indicates that the target file has not been updated. In this case, the target file can be synchronized based on the breakpoint information. Therefore, not only can breakpoint resumption of a single file be achieved, but the consistency and integrity of synchronized files between the source and destination file servers can also be improved, thus enhancing the accuracy of file synchronization.
[0130] In one possible implementation of this application, if the current file metadata does not match the third file metadata, it indicates that the target file has been updated. At this time, all data in the target file can be resynchronized, that is, all data in the target file can be resynchronized to the destination file server to improve the consistency and integrity of the synchronized files in the source file server and the destination file server, and improve the accuracy of file synchronization.
[0131] The batch file synchronization method of this application embodiment only resumes the transmission of the target file if the target file has not been updated. This can improve the consistency and integrity of the synchronized files in the source file server and the destination file server. Furthermore, it can not only resume the transmission of batch files, but also resume the transmission of individual files, which can further reduce the file synchronization time, network and resource overhead.
[0132] It should be noted that after the previous file synchronization ended and before the start of the current file synchronization, some files on the source file server may have been updated. In this case, even if a file was successfully synchronized during the previous file synchronization, it still needs to be resynchronized because it has been updated since the previous synchronization ended. This is to improve the consistency and integrity of the synchronized files on the source and destination file servers. The following section will combine... Figure 5 The above process will be explained in detail.
[0133] Figure 5 This is a flowchart illustrating another batch file synchronization method provided in an embodiment of this application.
[0134] like Figure 5 As shown, this batch file synchronization method may include the following steps:
[0135] Step S501: Obtain the target file to be synchronized.
[0136] The explanation of step S501 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0137] In any embodiment of this application, the target file may be obtained in the following ways: when an update of the target file in the source file server is detected or monitored, the target file is obtained, that is, the target file is the file that has been updated in the source file server.
[0138] In any embodiment of this application, the method for obtaining the target file may be, for example, in response to a user-triggered configuration operation, configuring a first directory level range (such as the second level (or second layer) to the last level (or last layer), the second level (or second layer) to the third level (or third layer), etc.), and obtaining the target file matching the first directory level range from the source file server. The number of target files may be at least one.
[0139] For example, assuming the first target level range is from the second to the third level, the target files to be synchronized can be located in the second-level directory or the third-level directory.
[0140] In any embodiment of this application, the target file may be obtained in the following manner: obtaining a set second directory level range and obtaining target files that match the second directory level range from the source file server. The number of target files may be at least one.
[0141] Therefore, the target files to be synchronized in the source file server can be determined according to different methods, which can improve the applicability of the method. Furthermore, the range of target files to be synchronized can be configured by the user, which can improve the flexibility of the method and meet the personalized usage needs of different users.
[0142] Step S502: Determine whether the target file has undergone a synchronization operation.
[0143] Step S503: If the target file has undergone a synchronization operation, obtain the synchronization result of the target file.
[0144] The explanation of steps S502 to S503 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0145] Step S504: If the synchronization result of the target file indicates that the target file has been successfully synchronized, obtain the current file metadata of the target file.
[0146] In this embodiment of the application, if the synchronization result of the target file indicates that the target file has been successfully synchronized, the current file metadata of the target file can be obtained from the source file server.
[0147] The explanation of the current file metadata can be found in the relevant descriptions in any of the foregoing embodiments, and will not be repeated here.
[0148] Step S505: Determine whether the current file metadata matches the third file metadata in the third target synchronization record information. If yes, proceed to step S506; otherwise, proceed to step S507.
[0149] The third target synchronization record information includes either the first synchronization record information or the second synchronization record information.
[0150] The explanation of step S505 can be found in the relevant descriptions of any of the foregoing embodiments, and will not be repeated here.
[0151] It should be noted that steps S506 and S507 are two parallel implementation methods, and in actual application, only one needs to be executed.
[0152] Step S506: Stop the file synchronization process of the target file.
[0153] In this embodiment of the application, if the current file metadata matches the third file metadata, it indicates that the target file has not been updated. In this case, there is no need to repeat the synchronization of the target file. Therefore, the file synchronization process of the target file can be stopped. That is, when the target file is not the last file to be synchronized, the file synchronization operation can be performed on the next file, and when the target file is the last file to be synchronized, the current file synchronization process can be ended.
[0154] Step S507: Resynchronize all data in the target file.
[0155] In this embodiment of the application, if the current file metadata does not match the third file metadata, it indicates that the target file has been updated. In this case, in order to improve the consistency and integrity of the files synchronized in the source file server and the destination file server, all data in the target file can be resynchronized.
[0156] In one possible implementation of this application embodiment, if the target file fails to synchronize during the current file synchronization process, for example, due to a network failure during the current file synchronization process, the synchronization record information of the target file (including the first target synchronization record information or the second target synchronization record information) can be updated. For example, the synchronization status in the first target synchronization record information can be updated to a synchronization failure status, and the breakpoint information of the target file can be added to the updated first target synchronization record information corresponding to the target file. Alternatively, the breakpoint information of the target file can be added to the second target synchronization record information, and the synchronization result in the second target synchronization record information can be updated to indicate a synchronization failure. This allows the target file to be resumed from its breakpoint during the next file synchronization based on the updated synchronization record information (including the first target synchronization record information or the second target synchronization record information), reducing file transmission costs.
[0157] The breakpoint information indicates the location where data synchronization in the target file was interrupted during this synchronization process.
[0158] The batch file synchronization method of this application requires that, for files that have already been synchronized in the source file server, when the file is updated, the file needs to be resynchronized to the destination file server in order to improve the consistency and integrity of the synchronized files in the source file server and the destination file server.
[0159] In any embodiment of this application, in order to address the problem of high file retransmission costs due to network or service anomalies in scenarios such as batch file uploading to the cloud, this application enables breakpoint resumption of directory file uploads. Specifically, this mainly includes two dimensions:
[0160] The first dimension: file dimension. That is, during the synchronization or transmission of a large file, if the file synchronization to the cloud fails due to network, service, or other anomalies or failures, the successfully uploaded portion of the file does not need to be resynchronized; the transmission can resume from the point of failure.
[0161] The second dimension: directory dimension. That is, when there are a large number of files in a certain directory, files that have been successfully transferred and have not changed will not be resynchronized to the cloud.
[0162] The first dimension refers to existing mature technologies. Therefore, this application mainly focuses on the second dimension, providing a detailed explanation to illustrate how the synchronization record information corresponding to files that have undergone synchronization operations is recorded during file synchronization. The implementation principle is as follows: Figure 6 As shown, the main steps include:
[0163] Step 1: List the file metadata of each file in the directory to be synchronized from the source file server. If the file exists, proceed to Step 2. If the file does not exist, stop the current operation (i.e., stop the current file synchronization process).
[0164] Step 2: Load the synchronization record information (or record metadata, record file metadata) of each file, and obtain the file metadata of each file from Step 1 to perform synchronization judgment:
[0165] It should be noted that for files being synchronized for the first time, there is no corresponding synchronization record information for that file.
[0166] ① Determine if the file has been synchronized;
[0167] ② Determine if the files have been successfully synchronized;
[0168] ③ Determine whether the file has changed, that is, determine whether the last modification time in the file metadata is consistent with the last modification time in the synchronization record information;
[0169] ④ Determine whether the file size in the file metadata is consistent with the file size in the synchronization record information (the purpose of ③ and ④ is to be able to resynchronize the file when it is determined that the file has changed).
[0170] Step 3: If a file is successfully synchronized and remains unchanged (i.e., the results of judgments ①-④ are all "yes"), then the file is successfully synchronized, and the file transfer can be skipped to proceed to the next file transfer judgment.
[0171] Step 4: If the result of judgment ① in step 2 is "no", it means that the file has not been synchronized and all data in the file can be synchronized; if the result of judgment ① in step 2 is "yes" but the result of judgment ② is "no", it means that the file failed to be synchronized last time. In this case, the breakpoint position of the file can be read from the file's synchronization record information and the file can be resumed from the breakpoint position.
[0172] Step 5: If the results of judgments ①-② in step 2 are all "yes", but the results of judgments ③-④ are all "no", then the file has been modified and needs to be resynchronized.
[0173] Step 6: When file synchronization is complete (including synchronization success or failure), set the file synchronization status (success / failure), last modified time, and file size to the file metadata (storage medium such as relational database, file, or other persistent storage).
[0174] By following the steps above, breakpoint resumption for directory and file transfers can be achieved, reducing costs associated with transmission time, network, and resources. Specifically, by recording file synchronization information, breakpoint resumption for directory transfers is enabled; by recording file modification times and sizes, breakpoint resumption for file transfers is enabled, thus improving file integrity.
[0175] Corresponding to the batch file synchronization methods provided in the above embodiments, one embodiment of this application also provides a batch file synchronization device. Since the batch file synchronization device provided in this embodiment corresponds to the batch file synchronization methods provided in the above embodiments, the implementation methods of the batch file synchronization methods are also applicable to the batch file synchronization device provided in this embodiment, and will not be described in detail here.
[0176] Figure 7 This is a schematic diagram of a batch file synchronization device according to an embodiment of the present application.
[0177] like Figure 7 As shown, the batch file synchronization device 700 maintains whether a batch of files has undergone a synchronization operation, the synchronization result, and breakpoint information in the event of synchronization failure. It may include: a first acquisition module 701, a judgment module 702, a second acquisition module 703, a third acquisition module 704, and a synchronization module 705.
[0178] The first acquisition module 701 is used to acquire the target file to be synchronized.
[0179] The judgment module 702 is used to determine whether the target file has undergone a synchronization operation.
[0180] The second acquisition module 703 is used to acquire the synchronization result of the target file when the target file has undergone a synchronization operation.
[0181] The third acquisition module 704 is used to acquire the breakpoint information of the target file when the synchronization result of the target file indicates that the target file synchronization has failed.
[0182] Synchronization module 705 is used to synchronize target files based on breakpoint information.
[0183] As one possible implementation of this application, a first synchronization record information corresponding to the files that have undergone synchronization operations in the batch files is maintained; the first synchronization record information includes the synchronization status of the files that have undergone synchronization operations and breakpoint information in the event of synchronization failure.
[0184] The judgment module 702 is specifically used to: determine that the target file has undergone a synchronization operation when the first target synchronization record information corresponding to the target file is found; and determine that the target file has not undergone a synchronization operation when the first target synchronization record information corresponding to the target file is not found.
[0185] The second acquisition module 703 is specifically used to: determine the synchronization result of the target file based on the synchronization status in the first target synchronization record information.
[0186] The third acquisition module 704 is specifically used to: acquire breakpoint information of the target file from the first target synchronization record information.
[0187] As one possible implementation of this application, a second synchronization record information corresponding to each file in the batch files is maintained; the second synchronization record information includes whether the corresponding file has undergone a synchronization operation, the synchronization result, and breakpoint information in the case of synchronization failure.
[0188] The judgment module 702 is specifically used for: querying the second target synchronization record information corresponding to the target file; determining that the target file has performed a synchronization operation if the second target synchronization record information indicates that the target file has performed a synchronization operation; and determining that the target file has not performed a synchronization operation if the second target synchronization record information indicates that the target file has not performed a synchronization operation.
[0189] The second acquisition module 703 is specifically used to: acquire the synchronization result of the target file from the second target synchronization record information.
[0190] The third acquisition module 704 is specifically used to: obtain the breakpoint information of the target file from the second target synchronization record information.
[0191] As one possible implementation of this application, the first synchronization record information further includes the first file metadata of the file that has undergone synchronization operation, and the second synchronization record information further includes the second file metadata of the corresponding file.
[0192] The synchronization module 705 is specifically used for: obtaining the current file metadata of the target file; determining whether the current file metadata matches the third file metadata in the third target synchronization record information; wherein the third target synchronization record information includes the first synchronization record information or the second synchronization record information; and synchronizing the target file according to the breakpoint information if the current file metadata matches the third file metadata.
[0193] As one possible implementation of this application, the synchronization module 705 is further configured to: resynchronize all data in the target file when the current file metadata does not match the third file metadata.
[0194] As one possible implementation of this application, the synchronization module 705 is specifically used for: determining whether the first update time in the current file metadata matches the second update time in the third file metadata; determining whether the first file size in the current file metadata matches the second file size in the third file metadata; if the first update time matches the second update time and the first file size matches the second file size, determining that the current file metadata matches the third file metadata; if the first update time does not match the second update time and / or the first file size does not match the second file size, determining that the current file metadata does not match the third file metadata.
[0195] As one possible implementation of this application embodiment, the first synchronization record information further includes first file metadata of the file that has undergone synchronization operation, and the second synchronization record information further includes second file metadata of the corresponding file; the batch file synchronization device 700 may further include:
[0196] The fourth acquisition module is used to acquire the current file metadata of the target file when the synchronization result of the target file indicates that the target file has been successfully synchronized.
[0197] The judgment module 702 is also used to: determine whether the current file metadata matches the third file metadata in the third target synchronization record information; wherein the third target synchronization record information includes the first synchronization record information or the second synchronization record information.
[0198] The stop module is used to stop the file synchronization process of the target file if the current file metadata matches the metadata of the third file.
[0199] The synchronization module 705 is also used to: resynchronize all data in the target file when the metadata of the current file does not match the metadata of the third file.
[0200] As one possible implementation of this application, the synchronization module 705 is further configured to: synchronize all data in the target file when the target file has not undergone a synchronization operation.
[0201] As one possible implementation of this application, the first acquisition module 701 is specifically used to: acquire the target file when an update is detected in the target file in the source file server; or, in response to a configuration operation, configure a first directory level range and acquire the target file to be synchronized that matches the first directory level range from the source file server; or, acquire a set second directory level range and acquire the target file to be synchronized that matches the second directory level range from the source file server.
[0202] The batch file synchronization device in this embodiment acquires the target file to be synchronized; determines whether the target file has undergone a synchronization operation; if the target file has undergone a synchronization operation, acquires the synchronization result of the target file; if the synchronization result of the target file indicates that the target file synchronization failed, acquires the breakpoint information of the target file; and synchronizes the target file according to the breakpoint information. Therefore, by maintaining information on whether batch files have undergone synchronization operations, the synchronization result, and the breakpoint information when the synchronization result indicates synchronization failure, it is possible to synchronize or transmit files whose synchronization result indicates synchronization failure each time batch files are synchronized, while not synchronizing or transmitting files whose synchronization result indicates synchronization success. This avoids duplicate file synchronization and reduces the synchronization time, network, and resource overhead of batch files. Furthermore, for files that have failed to synchronize, the record breakpoint information can be used to resume the transmission of those files, further reducing the synchronization time, network, and resource overhead of batch files. For example, in the scenario of batch file synchronization failure, since it is not necessary to re-synchronize or transmit files whose synchronization result indicates synchronization success, breakpoint resumption of batch files can be achieved, reducing the synchronization cost of batch files.
[0203] To achieve the above embodiments, this application also proposes an electronic device. Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes:
[0204] The memory 801, the processor 802, and the computer program stored on the memory 801 and capable of running on the processor 802.
[0205] When processor 802 executes the program, it implements the batch file synchronization method provided in any of the above embodiments.
[0206] Furthermore, electronic devices also include:
[0207] Communication interface 803 is used for communication between memory 801 and processor 802.
[0208] The memory 801 is used to store computer programs that can run on the processor 802.
[0209] The memory 801 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0210] The processor 802 is used to implement the file synchronization method described in any of the above embodiments when executing the program.
[0211] If the memory 801, processor 802, and communication interface 803 are implemented independently, then the communication interface 803, memory 801, and processor 802 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0212] Optionally, in a specific implementation, if the memory 801, processor 802, and communication interface 803 are integrated on a single chip, then the memory 801, processor 802, and communication interface 803 can communicate with each other through an internal interface.
[0213] The processor 802 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0214] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements the batch file synchronization method provided in any of the above embodiments.
[0215] To implement the above embodiments, this application also proposes a computer program product that, when executed by an instruction processor, implements the batch file synchronization method provided in any of the above embodiments.
[0216] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0217] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0218] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0219] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0220] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0221] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.
[0222] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0223] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A batch file synchronization method, characterized in that, The method maintains information on whether the batch files have undergone synchronization, the synchronization result, and breakpoint information in case of synchronization failure. Specifically, it includes: maintaining first synchronization record information corresponding to files in the batch that have undergone synchronization, the first synchronization record information including the synchronization status of the files that underwent synchronization and breakpoint information in case of synchronization failure; and maintaining second synchronization record information corresponding to each file in the batch, the second synchronization record information including whether the corresponding file has undergone synchronization, the synchronization result, and breakpoint information in case of synchronization failure. The method includes: Obtain the target file to be synchronized; Determine whether the target file has undergone a synchronization operation; If the target file has undergone a synchronization operation, obtain the synchronization result of the target file; If the synchronization result of the target file indicates that the synchronization of the target file has failed, obtain the breakpoint information of the target file; Synchronize the target file based on the breakpoint information; The first synchronization record information also includes the first file metadata of the file that has undergone synchronization operation, and the second synchronization record information also includes the second file metadata of the corresponding file; The step of synchronizing the target file based on the breakpoint information includes: Obtain the current file metadata of the target file; Determine whether the current file metadata matches the third file metadata in the third target synchronization record information; wherein, the third target synchronization record information includes the first synchronization record information or the second synchronization record information; If the current file metadata matches the third file metadata, the target file is synchronized according to the breakpoint information; If the current file metadata does not match the third file metadata, all data in the target file will be resynchronized. After obtaining the synchronization result of the target file when the target file has undergone a synchronization operation, the method further includes: If the synchronization result of the target file indicates that the target file has been successfully synchronized, obtain the current file metadata of the target file; Determine whether the current file metadata matches the third file metadata in the third target synchronization record information; If the current file metadata matches the third file metadata, the file synchronization process of the target file is stopped. If the current file metadata does not match the third file metadata, all data in the target file will be resynchronized.
2. The method according to claim 1, characterized in that, The step of determining whether the target file has undergone a synchronization operation includes: If the first target synchronization record information corresponding to the target file is found, it is determined that the target file has undergone a synchronization operation; If no first target synchronization record information corresponding to the target file is found, it is determined that the target file has not undergone synchronization operation; The process of obtaining the synchronization result of the target file includes: Based on the synchronization status in the first target synchronization record information, determine the synchronization result of the target file; The step of obtaining the breakpoint information of the target file includes: The breakpoint information of the target file is obtained from the first target synchronization record information.
3. The method according to claim 1, characterized in that, The step of determining whether the target file has undergone a synchronization operation includes: Query the second target synchronization record information corresponding to the target file; If the second target synchronization record information indicates that the target file has undergone a synchronization operation, it is determined that the target file has undergone a synchronization operation. If the second target synchronization record information indicates that the target file has not undergone a synchronization operation, it is determined that the target file has not undergone a synchronization operation. The process of obtaining the synchronization result of the target file includes: Obtain the synchronization result of the target file from the second target synchronization record information; The step of obtaining the breakpoint information of the target file includes: The breakpoint information of the target file is obtained from the second target synchronization record information.
4. The method according to claim 1, characterized in that, The step of determining whether the current file metadata matches the third file metadata in the third target synchronization record information includes: Determine whether the first update time in the current file metadata matches the second update time in the third file metadata; Determine whether the size of the first file in the current file metadata matches the size of the second file in the third file metadata; If the first update time matches the second update time, and the first file size matches the second file size, then the current file metadata matches the third file metadata. If the first update time does not match the second update time, and / or the first file size does not match the second file size, it is determined that the current file metadata does not match the third file metadata.
5. The method according to any one of claims 1-3, characterized in that, After determining whether the target file has undergone synchronization, the method further includes: Synchronize all data in the target file if no synchronization operation has been performed on the target file.
6. The method according to any one of claims 1-3, characterized in that, The process of obtaining the target file to be synchronized includes: When an update to the target file is detected in the source file server, the target file is retrieved; or, In response to the configuration operation, a first directory level range is configured, and target files to be synchronized that match the first directory level range are obtained from the source file server; or, Obtain the set second directory level range, and retrieve the target files to be synchronized that match the second directory level range from the source file server.
7. A batch file synchronization device, characterized in that, It maintains whether the batch files have undergone synchronization operations, the synchronization results, and breakpoint information in the event of synchronization failure; The apparatus is used to implement the batch file synchronization method as described in claim 1, the apparatus comprising: The first acquisition module is used to acquire the target file to be synchronized. The judgment module is used to determine whether the target file has undergone a synchronization operation; The second acquisition module is used to acquire the synchronization result of the target file when the target file has undergone a synchronization operation; The third acquisition module is used to acquire the breakpoint information of the target file when the synchronization result of the target file indicates that the synchronization of the target file has failed. The synchronization module is used to synchronize the target file based on the breakpoint information.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the batch file synchronization method as described in any one of claims 1-6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the batch file synchronization method as described in any one of claims 1-6.
Citation Information
Patent Citations
Folder breakpoint continuous transmission method based on large data
CN107682399A
Data synchronization method and device, equipment and medium
CN113297156A