File synchronization request processing method, device, electronic device and readable medium

By extracting file path information, classifying files, segmenting, compressing, and writing in parallel, the problem of low security and low efficiency in file synchronization between internal and external networks is solved, and security and efficiency are improved.

CN117708073BActive Publication Date: 2024-10-29BEIJING GUODIANTONG NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311613996.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2024-10-29
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

During the file synchronization process of internal and external networks, directly establishing a network connection reduces the security of the internal network server, and the fixed split file size does not take into account the network status and file format, resulting in low file synchronization efficiency and high delay.

Method used

By extracting the target file path information, classifying the files to be synchronized, segmenting and compressing them according to the file format, and using idle file writing nodes for parallel writing and transmission, reducing the number of direct network connections, using the target database as the file synchronization transfer station, dynamically Adjust file split size and compression to suit network conditions.

Benefits of technology

It improves the security of the intranet server, reduces the waste of network resources, improves file synchronization efficiency, reduces latency, and reduces the number of retransmissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117708073B_ABST
    Figure CN117708073B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a method, device, electronic device and readable medium for processing file synchronization requests. A specific implementation of the method includes: in response to receiving a file synchronization processing request, extracting target file path information; obtaining a file information sequence; determining at least one file to be synchronized; classifying at least one file to be synchronized; for each group of files to be synchronized, performing the following file synchronization steps: segmenting and compressing each file to be synchronized; determining a target file writing node; writing each external network file information to be synchronized to an external network file information set to be synchronized through each target file writing node and a network isolation device; writing each generated compressed file to be synchronized in the form of a file stream to an external network compressed file set to be synchronized in a target database through each target file writing node and a network isolation device. This implementation can improve the security of the intranet server and reduce the waste of network resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, and readable medium for processing file synchronization requests. Background Art

[0002] Intranet and extranet file synchronization is a technology used to synchronize files between an intranet server and an extranet server. In addition, in order to improve the efficiency of intranet and extranet file synchronization, files are often segmented before file transfer. At present, when performing intranet and extranet file synchronization, the commonly used method is: when there are files that need to be synchronized on an intranet server or an extranet server, a network connection is established between the intranet and extranet servers and the files are segmented according to a fixed segmented file size, and then transmitted to complete the intranet and extranet file synchronization.

[0003] However, the inventors have found that when the above method is used to synchronize files between the internal and external networks, the following technical problems often occur:

[0004] First, the file transfer and synchronization is performed by directly establishing a network connection, which causes the intranet server to be directly accessed by the external network server, thereby reducing the security of the intranet server. In addition, when the network is abnormal during the file synchronization process, it is necessary to re-establish the network connection and re-transmit the entire file to be synchronized, resulting in a waste of network resources.

[0005] Second, the synchronization files are segmented according to a fixed segmentation file size without considering the influence of the current network status and the corresponding file format, resulting in the file block size generated by the segmentation not being compatible with the current network status, resulting in reduced file synchronization transmission efficiency, and thus causing higher file synchronization delays.

[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0007] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0008] Some embodiments of the present disclosure propose a file synchronization request processing method, device, electronic device, and computer-readable medium to solve one or more of the technical problems mentioned in the above background technology section.

[0009] In a first aspect, some embodiments of the present disclosure provide a method for processing a file synchronization request, the method comprising: in response to receiving a file synchronization processing request, extracting target file path information from the above file synchronization processing request; reading a target file directory corresponding to the above target file path information to obtain a file information sequence; determining at least one file to be synchronized according to the above file information sequence; classifying the above at least one file to be synchronized to obtain at least one file group to be synchronized, wherein each file to be synchronized included in each of the above at least one file group to be synchronized has a same file format; for each of the above at least one file group to be synchronized, performing the following file synchronization steps: according to the file format corresponding to each file to be synchronized in the above file group to be synchronized, splitting and compressing each file to be synchronized in the above file group to be synchronized, so as to obtain a file information sequence; Generate each compressed file to be synchronized; in response to determining that there is at least one idle file writing node, determine at least one target file writing node, wherein the number of the determined target file writing nodes is less than or equal to the number of the generated compressed files to be synchronized; through the determined target file writing nodes and the network isolation device, write each file information in the above file information sequence corresponding to the above file group to be synchronized as each external network file information to be synchronized into the external network file information set to be synchronized in the target database to update the above external network file information set to be synchronized, wherein the above target database is a database under the internal network environment; through the above target file writing nodes and the above network isolation device, write each generated compressed file to be synchronized as each external network compressed file to be synchronized into the external network compressed file set to be synchronized in the target database in the form of a file stream.

[0010] In a second aspect, some embodiments of the present disclosure provide a file synchronization request processing device, the device comprising: an extraction unit, configured to extract target file path information from the file synchronization processing request in response to receiving the file synchronization processing request; a reading unit, configured to read the target file directory corresponding to the target file path information to obtain a file information sequence; a determination unit, configured to determine at least one file to be synchronized according to the file information sequence; a classification unit, configured to classify the at least one file to be synchronized to obtain at least one file group to be synchronized, wherein each file group to be synchronized in the at least one file group to be synchronized includes files to be synchronized that have the same file format; an execution unit, configured to perform the following file synchronization steps for each file group to be synchronized in the at least one file group to be synchronized: according to the file formats corresponding to the files to be synchronized in the file group to be synchronized, Each file to be synchronized in the file group is split and compressed to generate individual compressed files to be synchronized; in response to determining that there is at least one idle file writing node, at least one target file writing node is determined, wherein the number of the determined target file writing nodes is less than or equal to the number of the generated compressed files to be synchronized; through the determined target file writing nodes and the network isolation device, each file information corresponding to the above-mentioned file group to be synchronized in the above-mentioned file information sequence is written as each external network file information to be synchronized to the external network file information set to be synchronized in the target database to update the above-mentioned external network file information set to be synchronized, wherein the above-mentioned target database is a database under the internal network environment; through the above-mentioned target file writing nodes and the above-mentioned network isolation device, each generated compressed file to be synchronized is written as each external network compressed file to be synchronized to the external network compressed file set to be synchronized in the above-mentioned target database in the form of a file stream.

[0011] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0012] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0013] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: the file synchronization request processing method of some embodiments of the present disclosure can improve the security of the intranet server and reduce the waste of network resources. Specifically, the reasons for the reduction of the security of the intranet server and the waste of network resources are: the file transmission and synchronization are performed by directly establishing a network connection, which causes the intranet server to be directly accessed by the external network server, thereby reducing the security of the intranet server, and when the network is abnormal during the file synchronization process, it is necessary to re-establish the network connection and re-transmit the entire file to be synchronized, resulting in a waste of network resources. Based on this, the file synchronization request processing method of some embodiments of the present disclosure, first, in response to receiving a file synchronization processing request, extracts the target file path information from the above file synchronization processing request. Thus, the target file path information representing the storage path of each target file can be obtained. Then, the target file directory corresponding to the above target file path information is read to obtain a file information sequence. Thus, the file information of each target file under the above target file directory can be obtained. Afterwards, at least one file to be synchronized is determined according to the above file information sequence. Thus, each file that needs to be synchronized under the above target file directory can be determined as a file to be synchronized through each file information. Secondly, the at least one file to be synchronized is classified to obtain at least one file group to be synchronized. Among them, each file group to be synchronized in the at least one file group to be synchronized includes files to be synchronized that have the same file format. Therefore, the files to be synchronized with the same file format can be divided into the same file group to be synchronized, so that the files to be synchronized with different file formats can be split and compressed accordingly. Then, for each file group to be synchronized in the at least one file group to be synchronized, the following file synchronization steps are performed: the first step is to split and compress each file to be synchronized in the file group to be synchronized according to the file format corresponding to each file to be synchronized in the file group to be synchronized, so as to generate each compressed file to be synchronized. Therefore, each file to be synchronized in the file group to be synchronized can be split and compressed according to the file format characteristics corresponding to the file group to be synchronized, so as to avoid the overall transmission of the file and improve the file transmission efficiency. The second step is to determine at least one target file write node in response to determining that there is at least one idle file write node. Among them, the number of the determined target file write nodes is less than or equal to the number of the generated compressed files to be synchronized. Therefore, when the number of the determined target file writing nodes is greater than one, each compressed file to be synchronized can be written and transmitted in parallel to improve the file synchronization efficiency.The third step is to write each file information in the above file information sequence corresponding to the above file group to be synchronized as each external network file information to be synchronized into the external network file information set to be synchronized in the target database through the determined target file writing nodes and network isolation devices, so as to update the above external network file information set to be synchronized. Among them, the above target database is a database under the internal network environment. Thus, the file information corresponding to each file to be synchronized can be synchronized to the target database first. The fourth step is to write each generated compressed file to be synchronized as each external network compressed file to be synchronized into the external network compressed file set to be synchronized in the target database in the form of a file stream through the above target file writing nodes and the above network isolation devices. Thus, each compressed file to be synchronized can be synchronized to the target database under the internal network environment, and the synchronization of files from the external network environment to the internal network environment is completed. By using the above target database as a file synchronization transfer station, the number of times the external network server directly establishes a network connection with the internal network server and the number of times the external network server directly accesses the internal network server can be greatly reduced, thereby improving the security of the internal network service network. In addition, by using the above-mentioned target database as a file synchronization transfer station and dividing and compressing each file to be synchronized, the efficiency of file synchronization can be greatly improved by parallel transmission and writing of each smaller compressed file to be synchronized while keeping the overall size of the transmitted file unchanged. And when a network anomaly occurs, the external network server only needs to retransmit the individual compressed files to be synchronized that failed to be transmitted or written, thereby reducing the number of times the entire file to be synchronized is retransmitted, thereby reducing the waste of network resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0015] Figure 1 is a flowchart of some embodiments of the method for processing file synchronization requests according to the present disclosure;

[0016] Figure 2 is a schematic diagram of the structure of some embodiments of the file synchronization request processing device according to the present disclosure;

[0017] Figure 3 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0019] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0020] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0021] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0022] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0023] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0024] Figure 1 The process 100 of some embodiments of the method for processing a file synchronization request according to the present disclosure is shown. The method for processing a file synchronization request comprises the following steps:

[0025] Step 101: In response to receiving a file synchronization processing request, extract target file path information from the file synchronization processing request.

[0026] In some embodiments, the execution subject (e.g., a computing device) of the file synchronization request processing method may extract the target file path information from the file synchronization processing request in response to receiving the file synchronization processing request. The above-mentioned execution subject may be an external network server, that is, a server in an external network environment. The external network environment and the internal network environment may be two network environments separated by a network isolation device. The above-mentioned network isolation device may be a firewall or a network isolation gateway. The above-mentioned file synchronization processing request may be a request initiated by a user of the above-mentioned external network server for synchronizing files between the internal and external networks. The above-mentioned target file path information may be information characterizing the storage path of each target file. The above-mentioned each target file may be a file uploaded or modified by a user of the external network server. The above-mentioned execution subject may receive the file synchronization processing request via a wired connection or a wireless connection. In practice, in response to receiving the file synchronization processing request, the above-mentioned execution subject may extract the target file path information from the above-mentioned file synchronization processing request by extracting JSON attributes.

[0027] It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future.

[0028] Step 102: read the target file directory corresponding to the target file path information to obtain a file information sequence.

[0029] In some embodiments, the above-mentioned execution subject can read the target file directory corresponding to the target file path information to obtain a file information sequence. Each file information in the above-mentioned file information sequence may include the file name, file size, file modification time and file format of the corresponding file. The above-mentioned file modification time can be the time when the corresponding file is uploaded to the above-mentioned target file directory or the last modification time of the corresponding file by the above-mentioned external network server user. In practice, the above-mentioned execution subject can traverse and read each file under the target file directory corresponding to the above-mentioned target file path information to obtain the file name, file size, file modification time and file format of each file as file information to obtain a file information sequence.

[0030] Step 103: Determine at least one file to be synchronized according to the file information sequence.

[0031] In some embodiments, the execution subject may determine at least one file to be synchronized based on the file information sequence. The determined file to be synchronized may be a file that needs to be synchronized. In practice, for each file information in the file information sequence, in response to determining that the file modification time included in the file information satisfies the time screening condition corresponding to the request reception time, the execution subject may determine the file corresponding to the file information in the target file directory as the file to be synchronized. The request reception time may be the time when the execution subject receives the file synchronization request. The time screening condition corresponding to the request reception time may be that the file modification time included in the file information is within the time range composed of the request reception time and the preset time length. For example, the preset time length may be 15 minutes. The request reception time may be "2023-11-17-10:15". Then the time range composed of the request reception time and the preset time length may be "2023-11-17-10:00-2023-11-17-10:15".

[0032] Step 104: classify at least one file to be synchronized to obtain at least one file group to be synchronized.

[0033] In some embodiments, the execution subject may classify the at least one file to be synchronized to obtain at least one file group to be synchronized. The files to be synchronized included in each file group to be synchronized in the at least one file group to be synchronized have the same file format. In practice, the execution subject may classify the files to be synchronized having the same file format in the at least one file to be synchronized into the same file group to be synchronized according to the corresponding file format. The file formats may include but are not limited to txt format, dox format, docx format, mp3 format, mp4 format, jpg format and png format.

[0034] Step 105: For each to-be-synchronized file group in at least one to-be-synchronized file group, perform the following file synchronization steps:

[0035] Step 1051 : split and compress each file to be synchronized in the file group to be synchronized according to the file format corresponding to each file to be synchronized in the file group to be synchronized, so as to generate each compressed file to be synchronized.

[0036] In some embodiments, the execution subject may split and compress each file to be synchronized in the file group to be synchronized according to the file format corresponding to each file to be synchronized in the file group to be synchronized, so as to generate each compressed file to be synchronized.

[0037] In some optional implementations of some embodiments, the execution subject may split and compress each file to be synchronized in the above-mentioned file group to be synchronized according to the file format corresponding to each file to be synchronized in the above-mentioned file group to be synchronized through the following steps to generate each compressed file to be synchronized:

[0038] The first step is to perform a status detection on the current network to obtain a network detection result. The network detection result includes a transmission delay time. In practice, the execution subject can monitor the status of the current network by sending a Ping command to the file writing node to receive the return information. Then, the execution subject can use the received return information as the network detection result. The transmission delay time can be the command response time contained in the return information.

[0039] In the second step, the file format corresponding to each file to be synchronized in the above-mentioned file group to be synchronized is determined as the target file format.

[0040] The third step is to determine the first file segmentation size, the second file segmentation size, and the first segmentation number corresponding to the first file segmentation size according to the transmission delay time and the target file format. The first file segmentation size is larger than the second file segmentation size. The first file segmentation size and the second file segmentation size are used to segment the files to be synchronized. In practice, the execution subject can determine the first file segmentation size, the second file segmentation size, and the first segmentation number corresponding to the first file segmentation size according to the transmission delay time and the target file format through the following steps: First, the execution subject can obtain the reference segmentation size and reference segmentation number corresponding to the target file format from the local database. The reference segmentation size can be a file segmentation size preset according to the corresponding file format. The reference segmentation number can be a preset segmentation number. Then, the execution subject can obtain a pre-constructed delay time information table from the local database. Each delay time information in the delay time information table corresponds to each adjustment coefficient. The delay time information in the delay time information table can represent a delay time range. Afterwards, the execution subject may compare the transmission delay time with each delay time information in the delay time information table in turn to determine the delay time information corresponding to the transmission delay time as the target delay time information. Wherein, the delay time information corresponding to the transmission delay time in the delay time information table may be the delay time information whose represented delay time range includes the transmission delay time. Next, the execution subject may use the adjustment coefficient corresponding to the target delay time information as the target adjustment coefficient. Afterwards, the execution subject may use the product of the target adjustment coefficient and the reference segmentation size as the first file segmentation size. Secondly, the execution subject may use half of the first file segmentation size as the second file segmentation size. Afterwards, in response to determining that the target adjustment coefficient is greater than the preset adjustment coefficient threshold, the sum of the reference segmentation number and the adjustment number is determined as the first file segmentation number. Wherein, the adjustment number may be the product of the coefficient difference and 10. The coefficient difference may be the difference between the target adjustment coefficient and the preset adjustment coefficient threshold. Finally, in response to determining that the target adjustment coefficient is less than or equal to the preset adjustment coefficient threshold, the reference segmentation number is determined as the first file segmentation number. For example, the target format may be .mp3 format, the reference segmentation size corresponding to the target format may be 10MB, and the reference segmentation number may be 1. The transmission delay time may be 256 milliseconds. The delay time range represented by the delay time information corresponding to the transmission delay time in the delay time information table may be "251 milliseconds-500 milliseconds", and the determined target adjustment coefficient may be 0.6. The preset adjustment coefficient threshold is 1.Then the determined first file segmentation size may be 6MB, the determined second file segmentation size may be 3MB, and the first segmentation number corresponding to the first file segmentation size may be 1. Thus, by dynamically adjusting the file segmentation size and the segmentation numbers corresponding to different file segmentation sizes, the size of the segmented files can be adapted to the current network conditions, thereby improving the file synchronization efficiency.

[0041] In the fourth step, for each file to be synchronized in the above-mentioned group of files to be synchronized, in response to determining that the above-mentioned file to be synchronized satisfies the file segmentation condition corresponding to the above-mentioned first file segmentation size, the above-mentioned file to be synchronized is segmented according to the above-mentioned first file segmentation size and the above-mentioned second file segmentation size, to obtain the first segmented file to be synchronized and each second segmented file to be synchronized. Among them, the number of the obtained first segmented files to be synchronized is equal to the above-mentioned first segmentation number. The above-mentioned file segmentation condition corresponding to the first file segmentation size can be that the file size of the file to be synchronized is greater than or equal to the product of the first segmentation number and the first segmentation size, that is, the size of the file to be synchronized ≥ the first segmentation number * the first segmentation size. In practice, the above-mentioned execution subject can use the split instruction to perform fixed-size segmentation on the file to be synchronized that meets the file segmentation condition corresponding to the above-mentioned first file segmentation size according to the above-mentioned first file segmentation size, and perform fixed-size segmentation on the segmented file to be synchronized again according to the second segmentation file size, to obtain the first segmented number of first segmented files to be synchronized and each second segmented file to be synchronized.

[0042] In the fifth step, according to the target file format, the first preset number of first split files to be synchronized and the second split files to be synchronized are compressed to generate compressed files to be synchronized. In practice, the execution subject can compress the first preset number of first split files to be synchronized and the second split files to be synchronized according to the file type represented by the target file format to generate compressed files to be synchronized.

[0043] As an example, when the file type represented by the above target file format is a document file type (such as txt format, dox format, docx format), the above execution entity can compress the first file to be synchronized after segmentation and the above-mentioned second files to be synchronized after segmentation by using a ZIP compression algorithm. When the file type represented by the above target file format is an audio file type (such as mp3 format), the above execution entity can compress the first file to be synchronized after segmentation and the above-mentioned second files to be synchronized after segmentation by using an AAC audio compression algorithm. When the file type represented by the above target file format is an image file type (such as jpg format, png format), the above execution entity can compress the first file to be synchronized after segmentation and the above-mentioned second files to be synchronized after segmentation by using a lossless compression algorithm or a JPEG algorithm.

[0044] The first to fifth steps mentioned above are an inventive point of an embodiment of the present disclosure, which solves the technical problem 2 mentioned in the background technology: "The synchronization file is segmented according to a fixed segmentation file size, and the influence of the current network state and the corresponding file format is not considered, resulting in the file block size generated by the segmentation not being compatible with the current network state, resulting in a decrease in the file synchronization transmission efficiency, thereby resulting in a high file synchronization delay". The factors that lead to a high file synchronization delay are often as follows: The synchronization file is segmented according to a fixed segmentation file size, and the influence of the current network state and the corresponding file format is not considered, resulting in the file block size generated by the segmentation not being compatible with the current network state, resulting in a decrease in the file synchronization transmission efficiency, thereby resulting in a high file synchronization delay. If the above factors are solved, the effect of increasing the file transmission rate and reducing the file synchronization delay can be achieved. In order to achieve this effect, the present disclosure first performs a status detection on the current network to obtain a network detection result. Then, the file segmentation size and the number of segmentations are dynamically adjusted according to the network detection result. Therefore, when the network delay is low, that is, the network state is good, the size of the segmented files can be increased, thereby reducing the number of file transmissions, thereby achieving the effect of improving the file transmission efficiency. When the network delay is high, that is, the network status is poor, the size of the segmented files can be reduced, thereby reducing the time consumption of a single transmission task and reducing the negative impact of high network delay. Finally, by performing compression operations on each segmented file that are compatible with the corresponding file format, the size of the segmented file can be further reduced. In this way, the effect of reducing the amount of transmitted data and reducing the time consumption of transmission can be achieved. Therefore, by dynamically adjusting the file segmentation size and adaptively compressing the segmented files, the size of the segmented files can be adapted to the current network status, reducing the amount of transmitted data, thereby improving the efficiency of file synchronization transmission, and then reducing the file synchronization delay.

[0045] Step 1052: In response to determining that there is at least one idle file writing node, determine at least one target file writing node.

[0046] In some embodiments, in response to determining that there is at least one idle file write node, the execution subject may determine at least one target file write node. The number of the determined target file write nodes is less than or equal to the number of files to be synchronized and compressed. Each file write node may be a service node for performing file write operations in a microservice architecture in an external network environment. An idle file write node may be a file write node that has not performed a file write operation. In practice, first, the execution subject may send a call request to each file write node in an external network environment through the network isolation device to receive each return result. Then, the execution subject may determine that there is at least one idle file write node by determining that there is at least one return result representing that the node is idle in each of the received return results. Afterwards, in response to determining that the number of idle file write nodes is less than or equal to the number of files to be synchronized and compressed, the execution subject may determine each file write node in the at least one idle file write node as a target file write node. Finally, in response to determining that the number of idle file write nodes is greater than the number of files to be synchronized and compressed, the execution subject may randomly select each idle file write node equal to the number of files to be synchronized and compressed from the idle file write nodes as the target file write node.

[0047] Step 1053, through the determined target file writing nodes and network isolation devices, write each file information corresponding to the file group to be synchronized in the file information sequence as each external network file information to be synchronized into the external network file information to be synchronized set in the target database to update the external network file information to be synchronized set.

[0048] In some embodiments, the above-mentioned execution subject can write each file information corresponding to the above-mentioned file group to be synchronized in the above-mentioned file information sequence as each external network file information to be synchronized into the external network file information set to be synchronized in the target database through the determined each target file write node and the network isolation device, so as to update the above-mentioned external network file information set to be synchronized. Among them, the above-mentioned target database is a database under the internal network environment. The external network compressed file set to be synchronized in the above-mentioned target database can be composed of each file information written by the above-mentioned execution subject to the target database. When there is no file that needs to be synchronized from the external network environment to the internal network environment, the external network compressed file set to be synchronized in the above-mentioned target database can be an empty set. In practice, first, the above-mentioned execution subject can establish a network connection with the above-mentioned each target file write node. Then, the above-mentioned execution subject can transmit each file information corresponding to the file group to be synchronized in the file information sequence to the above-mentioned each target file write node. Afterwards, the above-mentioned execution entity can establish a network connection with the above-mentioned target database through the port pre-configured in the above-mentioned network isolation device, and perform file writing operations through the above-mentioned each target file writing node to write the above-mentioned each file information as each external network file information to be synchronized into the external network file information to be synchronized set in the target database.

[0049] Step 1054, through each target file writing node and network isolation device, the generated compressed files to be synchronized are used as each external network compressed files to be synchronized, and are written into the external network compressed files to be synchronized collection in the target database in the form of file stream.

[0050] In some embodiments, the execution subject may write the generated compressed files to be synchronized as external network compressed files to be synchronized in the target database in the form of file streams through the target file writing nodes and the network isolation device. In practice, first, the execution subject may establish a network connection with the target file writing nodes. Then, the execution subject may transfer the generated compressed files to be synchronized to the target file writing nodes. Finally, the execution subject may establish a network connection with the target database through the pre-configured port in the network isolation device, and perform a file writing operation through the target file writing nodes, so as to write the compressed files to be synchronized as external network compressed files to be synchronized in the target database in the form of file streams.

[0051] Optionally, each compressed file to be synchronized corresponds to each compressed file information to be synchronized. Each compressed file information to be synchronized in the above compressed file information to be synchronized includes the name of the compressed file to be synchronized and the size of the compressed file to be synchronized.

[0052] Optionally, after each generated compressed file to be synchronized is written as each external network compressed file to be synchronized in the target database in the form of a file stream through each target file writing node and the network isolation device, the execution subject may further perform the following steps:

[0053] The first step is to determine the above-mentioned compressed file information to be synchronized as a compressed file information set to be synchronized.

[0054] The second step is to perform the following file resynchronization steps based on the compressed file information set to be synchronized:

[0055] In the first sub-step, the set of external network compressed files to be synchronized in the target database is queried through the network isolation device to obtain information about each external network compressed file to be synchronized. The information about each external network compressed file to be synchronized includes the name of the external network compressed file to be synchronized and the size of the external network compressed file to be synchronized. In practice, the execution subject can establish a network connection with the target database through a pre-configured port in the network isolation device. Then, the execution subject can query the set of external network compressed files to be synchronized in the target database to obtain information about each external network compressed file to be synchronized.

[0056] The second sub-step is to perform the following file writing verification steps for each compressed file information to be synchronized in the compressed file information set to be synchronized:

[0057] Sub-step 1: In response to determining that there is external network compressed file information to be synchronized that satisfies the same name condition among the acquired external network compressed file information to be synchronized, the external network compressed file information to be synchronized that satisfies the same name condition is determined as the target external network compressed file information to be synchronized. The same name condition may be that the name of the external network compressed file to be synchronized included in the external network compressed file information to be synchronized is the same as the name of the compressed file to be synchronized included in the compressed file information to be synchronized.

[0058] Sub-step two, in response to determining that the size of the external network compressed file to be synchronized included in the target external network compressed file information to be synchronized is not equal to the size of the compressed file to be synchronized included in the compressed file information to be synchronized, the external network compressed file to be synchronized corresponding to the target external network compressed file information to be synchronized is deleted from the set of external network compressed files to be synchronized in the above-mentioned target database through the above-mentioned network isolation device. The external network compressed file to be synchronized corresponding to the above-mentioned target external network compressed file information to be synchronized can be an external network compressed file to be synchronized in the set of external network compressed files to be synchronized whose file name is the same as the name of the external network compressed file to be synchronized included in the target external network compressed file information to be synchronized. In practice, first, the above-mentioned execution subject can establish a network connection with the above-mentioned target database through the above-mentioned network isolation device. Then, the above-mentioned execution subject can delete the external network compressed file to be synchronized corresponding to the target external network compressed file information to be synchronized from the set of external network compressed files to be synchronized in the above-mentioned target database through a preset database deletion statement and the name of the external network compressed file to be synchronized included in the above-mentioned target external network compressed file information to be synchronized.

[0059] Sub-step three, in response to determining that the size of the external network compressed file to be synchronized included in the target external network compressed file information is equal to the size of the compressed file to be synchronized included in the compressed file information to be synchronized, the compressed file information to be synchronized is deleted from the compressed file information to be synchronized set. Thus, after the external network server writes each compressed file to be synchronized to the target database, each compressed file to be synchronized written to the target database can be verified to ensure the integrity of each compressed file to be synchronized written to the target database.

[0060] Optionally, the above file synchronization step may further include the following steps:

[0061] In the first step, each to-be-synchronized compressed file corresponding to the to-be-synchronized compressed file information set is determined as each target to-be-synchronized compressed file.

[0062] In the second step, in response to determining that the number of executions of the above-mentioned file resynchronization step is less than or equal to the first preset number of executions, the above-mentioned target file writing nodes and the above-mentioned network isolation device are used to write the determined target compressed files to be synchronized as the external network compressed files to be synchronized to the set of external network compressed files to be synchronized in the above-mentioned target database in the form of a file stream, and the above-mentioned file resynchronization step is performed again. The above-mentioned implementation method of writing the determined target compressed files to be synchronized as the external network compressed files to be synchronized to the set of external network compressed files to be synchronized in the above-mentioned target database in the form of a file stream is similar to the above-mentioned implementation step of writing the generated compressed files to be synchronized as the external network compressed files to be synchronized to the set of external network compressed files to be synchronized in the above-mentioned target database in the form of a file stream, and will not be repeated here.

[0063] The third step, in response to determining that the execution number of the above-mentioned file resynchronization step is greater than the first preset execution number and the set of compressed file information to be synchronized is not an empty set, write the set of compressed file information to be synchronized and the operation type information corresponding to the above-mentioned file resynchronization step into the file synchronization log and perform an alarm operation. Among them, the operation type information can be a character string representing the operation type. The above-mentioned operation types can include "writing files to the target database" and "reading files from the target database". The operation type represented by the operation type information corresponding to the above-mentioned file resynchronization step can be the "writing files to the target database" operation type. The above-mentioned file synchronization log can be a log for recording information related to file synchronization. The above-mentioned alarm operation can be to display a file synchronization failure prompt message on the display screen associated with the above-mentioned execution subject. The above-mentioned file synchronization failure prompt message can be information used to prompt the external network server user that the file synchronization has failed.

[0064] Therefore, when the external network server determines that there are files to be synchronized that have failed to be transmitted or written, the files to be synchronized that have failed to be transmitted or written can be retransmitted or rewritten, and the files to be synchronized that have been rewritten into the target database can be verified again. When the number of verifications is greater than the first preset number of executions and there are still files to be synchronized that have failed to be transmitted or written, it is often caused by objective factors (such as insufficient storage space in the target database or current network anomalies), and relevant information needs to be written into the above-mentioned file synchronization log to facilitate the determination of the process node where the problem occurs and subsequent maintenance.

[0065] Optionally, the above execution subject may further perform the following steps:

[0066] The first step is to query the intranet file information set to be synchronized in the target database in response to determining that the current time satisfies the synchronization cycle condition corresponding to the preset time period through the network isolation device to obtain the intranet file information set to be synchronized as the synchronization file verification information set. The preset time period can be 15 minutes. The initial time can be 8 o'clock. The cycle time can be but not limited to 8:15, 8:30, 8:45 and 9:00. The intranet file information set to be synchronized in the target database can be composed of file information of each file that needs to be synchronized in the internal network environment written by the intranet server (server in the internal network environment). The intranet file information to be synchronized in the intranet file information set can include the name of the intranet file to be synchronized and the size of the intranet file to be synchronized. When there is no file that needs to be synchronized from the internal network environment to the external network environment, the intranet file information set to be synchronized in the target database can be an empty set. In practice, the execution subject can establish a network connection with the target database through the pre-configured port in the network isolation device. Then, the execution subject may query the set of intranet file information to be synchronized in the target database to obtain information of each extranet compressed file to be synchronized.

[0067] In the second step, in response to determining that the acquired synchronization file verification information set is not an empty set, the following steps are performed:

[0068] The first sub-step is to determine at least one target file reading node in response to determining that there is at least one idle file reading node. The file reading node may be a service node in the microservice framework for performing file reading operations. An idle file reading node may be a file reading node that does not perform a file reading operation. In practice, first, the execution subject may send a call request to each file reading node in an external network environment through the network isolation device to receive each return result. Then, the execution subject may determine that there is at least one idle file reading node by determining that there is at least one return result representing that the node is idle among the received return results. Finally, the execution subject may determine each file reading node among the at least one idle file reading node determined as a target file reading node.

[0069] The second sub-step is to perform file stream reading on the set of compressed files to be synchronized in the target database through the determined target file reading nodes and the network isolation device to obtain the set of compressed files to be synchronized in the target database. In practice, the execution subject can establish a network connection with the target database through the network isolation device. Then, the execution subject can establish a network connection with the determined target file reading nodes. Finally, the execution subject can perform file stream reading on the set of compressed files to be synchronized in the target database through the determined target file reading nodes to obtain the set of compressed files to be synchronized in the target database.

[0070] The third sub-step is to classify the obtained intranet compressed file set to be synchronized to obtain each intranet compressed file group to be synchronized. In practice, the above-mentioned execution subject can classify the files in the intranet compressed file set according to the file name of each intranet compressed file to be synchronized, and divide each intranet compressed file to be synchronized representing the same file into the same intranet compressed file group to be synchronized to obtain each intranet compressed file group to be synchronized. For example, the file name of each intranet compressed file to be synchronized in the above-mentioned intranet compressed file set may include "Attachment 1_01", "Attachment 1_02", "Attachment 1_03", "Attachment 2_01" and "Attachment 2_02". Then, the names of the intranet compressed files to be synchronized included in one of the two intranet compressed file groups to be synchronized may include "Attachment 1_01", "Attachment 1_02", and "Attachment 1_03". The names of the intranet compressed files to be synchronized included in the other intranet compressed file group to be synchronized in the above-mentioned two intranet compressed file groups to be synchronized may include "Attachment 2_01" and "Attachment 2_02".

[0071] The fourth sub-step is to merge and decompress each of the above-mentioned intranet compressed file groups to be synchronized to obtain each intranet synchronization file to be verified. In practice, for each of the above-mentioned intranet compressed file groups to be synchronized, the above-mentioned execution subject can perform the following steps: First, according to the file format corresponding to the above-mentioned intranet compressed file group to be synchronized, each intranet compressed file to be synchronized in the above-mentioned intranet compressed file group to be synchronized can be decompressed by a decompression algorithm corresponding to the file format to obtain each intranet synchronization file. Then, the above-mentioned execution subject can sequentially merge the decompressed intranet files to be synchronized through the cat command to obtain each intranet synchronization file to be verified.

[0072] The third step is to perform file verification on each of the above-mentioned intranet synchronization files to be verified to determine each intranet synchronization file.

[0073] The fourth step is to store each determined intranet synchronization file in a target folder corresponding to the preset file path information to complete the intranet and extranet file synchronization.

[0074] Thus, the external network server can synchronize various files in the target database that need to be synchronized from the internal network environment to the external network environment to the target folder, thereby realizing synchronization of the internal network files to the external network environment.

[0075] In some optional implementations of some embodiments, the execution subject may perform file verification on each of the intranet synchronization files to be verified through the following steps to determine each intranet synchronization file:

[0076] The first step is to determine the above-mentioned intranet synchronization files to be verified as a set of intranet synchronization files to be verified.

[0077] The second step is to perform the following file reading and verification steps based on the synchronization file verification information set and the intranet synchronization file set to be verified:

[0078] In the first sub-step, for each synchronization file verification information in the synchronization file verification information set, the following steps are performed:

[0079] Sub-step 1: In response to determining that there is an intranet synchronization file to be verified that satisfies the file name identical condition in the intranet synchronization file set to be verified, the intranet synchronization file to be verified that satisfies the file name identical condition is determined as the target intranet synchronization file to be verified. The file name identical condition may be that the file name of the intranet synchronization file to be verified is identical to the name of the intranet file to be synchronized included in the synchronization file verification information.

[0080] Sub-step 2: in response to determining that the file size of the target intranet synchronization file to be verified is equal to the intranet synchronization file size included in the synchronization file verification information, executing the following steps:

[0081] The first sub-step is to delete the synchronization file verification information from the synchronization file verification information set.

[0082] In the second sub-step, the intranet file information to be synchronized corresponding to the synchronization file verification information in the intranet file information set to be synchronized in the target database is deleted through the above-mentioned network isolation device. Among them, the intranet file information to be synchronized corresponding to the synchronization file verification information in the above-mentioned intranet file information set to be synchronized can be the intranet file information including the same intranet file name to be synchronized as the intranet file name to be synchronized included in the above-mentioned synchronization file verification information. In practice, firstly, the above-mentioned execution subject can establish a network connection with the above-mentioned target database through the above-mentioned network isolation device. Then, the above-mentioned execution subject can delete the intranet file information to be synchronized corresponding to the synchronization file verification information in the intranet file information set to be synchronized in the target database through a preset database deletion statement.

[0083] In the third sub-step, the target intranet synchronization file to be verified is determined as the intranet synchronization file.

[0084] Sub-step three, in response to determining that the file size of the target intranet synchronization file to be verified is not equal to the intranet synchronization file size included in the synchronization file verification information, executing the following steps:

[0085] In the first sub-step, the intranet compressed file group to be synchronized corresponding to the target intranet synchronization file to be verified is determined as the target intranet compressed file group to be synchronized.

[0086] The second sub-step is to delete the target intranet synchronization file to be verified from the set of intranet synchronization files to be verified.

[0087] The second sub-step is, in response to determining that the number of executions of the file reading and verification step is less than or equal to a second preset number of executions, executing the following steps:

[0088] Sub-step one, through the determined target file reading nodes and the above-mentioned network isolation device, perform file stream reading on the individual intranet compressed files to be synchronized in the above-mentioned target database that correspond to the determined target intranet compressed files to be synchronized groups. In practice, the above-mentioned execution subject can establish a network connection with the above-mentioned target database through the above-mentioned network isolation device. Then, the above-mentioned execution subject can establish a network connection with the determined target file reading nodes. Finally, the above-mentioned execution subject can perform a reading operation on the individual intranet compressed files to be synchronized in the above-mentioned target database that correspond to the determined target intranet compressed files to be synchronized groups through the determined target file reading nodes to perform file stream reading.

[0089] Sub-step two, generating each intranet synchronization file to be verified based on each intranet compressed file to be synchronized that is read. The above-mentioned implementation steps of generating each intranet synchronization file to be verified based on each intranet compressed file to be synchronized that is read can refer to the above-mentioned classification of the acquired intranet compressed file set to be synchronized to obtain each intranet compressed file group to be synchronized, and the above-mentioned steps of merging and decompressing each intranet compressed file group to be synchronized to obtain each intranet synchronization file to be verified, which will not be repeated here.

[0090] Sub-step three: inserting each generated intranet synchronization file to be verified into the intranet synchronization file set to be verified and executing the above file reading and verification step again.

[0091] Optionally, the above file reading and verification step may further include the following steps:

[0092] In response to determining that the number of executions of the file reading verification step is greater than the second preset number of executions and the synchronization file verification information set is not an empty set, the synchronization file verification information set and the operation type information corresponding to the file reading verification step are written to the file synchronization log and an alarm operation is performed. The operation type information corresponding to the file reading verification step can indicate that the corresponding operation type is an "read file from a target database" operation type.

[0093] Therefore, when the number of rereads of each intranet compressed file to be synchronized in the above-mentioned target data is greater than the second preset execution number and there are still unread intranet compressed files to be synchronized, it is often caused by objective factors (such as insufficient storage space on the external network server or current network abnormalities). Relevant information needs to be written into the above-mentioned file synchronization log to facilitate determination of the process node where the problem occurs and subsequent maintenance.

[0094] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: the file synchronization request processing method of some embodiments of the present disclosure can improve the security of the intranet server and reduce the waste of network resources. Specifically, the reasons for the reduction of the security of the intranet server and the waste of network resources are: the file transmission and synchronization are performed by directly establishing a network connection, which causes the intranet server to be directly accessed by the external network server, thereby reducing the security of the intranet server, and when the network is abnormal during the file synchronization process, it is necessary to re-establish the network connection and re-transmit the entire file to be synchronized, resulting in a waste of network resources. Based on this, the file synchronization request processing method of some embodiments of the present disclosure, first, in response to receiving a file synchronization processing request, extracts the target file path information from the above file synchronization processing request. Thus, the target file path information representing the storage path of each target file can be obtained. Then, the target file directory corresponding to the above target file path information is read to obtain a file information sequence. Thus, the file information of each target file under the above target file directory can be obtained. Afterwards, at least one file to be synchronized is determined according to the above file information sequence. Thus, each file that needs to be synchronized under the above target file directory can be determined as a file to be synchronized through each file information. Secondly, the at least one file to be synchronized is classified to obtain at least one file group to be synchronized. Among them, each file group to be synchronized in the at least one file group to be synchronized includes files to be synchronized that have the same file format. Therefore, the files to be synchronized with the same file format can be divided into the same file group to be synchronized, so that the files to be synchronized with different file formats can be split and compressed accordingly. Then, for each file group to be synchronized in the at least one file group to be synchronized, the following file synchronization steps are performed: the first step is to split and compress each file to be synchronized in the file group to be synchronized according to the file format corresponding to each file to be synchronized in the file group to be synchronized, so as to generate each compressed file to be synchronized. Therefore, each file to be synchronized in the file group to be synchronized can be split and compressed according to the file format characteristics corresponding to the file group to be synchronized, so as to avoid the overall transmission of the file and improve the file transmission efficiency. The second step is to determine at least one target file write node in response to determining that there is at least one idle file write node. Among them, the number of the determined target file write nodes is less than or equal to the number of the generated compressed files to be synchronized. Therefore, when the number of the determined target file writing nodes is greater than one, each compressed file to be synchronized can be written and transmitted in parallel to improve the file synchronization efficiency.The third step is to write each file information in the above file information sequence corresponding to the above file group to be synchronized as each external network file information to be synchronized into the external network file information set to be synchronized in the target database through the determined target file writing nodes and network isolation devices, so as to update the above external network file information set to be synchronized. Among them, the above target database is a database under the internal network environment. Thus, the file information corresponding to each file to be synchronized can be synchronized to the target database first. The fourth step is to write each generated compressed file to be synchronized as each external network compressed file to be synchronized into the external network compressed file set to be synchronized in the target database in the form of a file stream through the above target file writing nodes and the above network isolation devices. Thus, each compressed file to be synchronized can be synchronized to the target database under the internal network environment, and the synchronization of files from the external network environment to the internal network environment is completed. By using the above target database as a file synchronization transfer station, the number of times the external network server directly establishes a network connection with the internal network server and the number of times the external network server directly accesses the internal network server can be greatly reduced, thereby improving the security of the internal network service network. In addition, by using the above-mentioned target database as a file synchronization transfer station and dividing and compressing each file to be synchronized, the efficiency of file synchronization can be greatly improved by parallel transmission and writing of each smaller compressed file to be synchronized while keeping the overall size of the transmitted file unchanged. And when a network anomaly occurs, the external network server only needs to retransmit the individual compressed files to be synchronized that failed to be transmitted or written, thereby reducing the number of times the entire file to be synchronized is retransmitted, thereby reducing the waste of network resources.

[0095] Further references Figure 2 As an implementation of the methods shown in the figures, the present disclosure provides some embodiments of a file synchronization request processing device, and these device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0096] like Figure 2As shown, the file synchronization request processing device 200 of some embodiments includes: an extraction unit 201, a reading unit 202, a determination unit 203, a classification unit 204 and an execution unit 205. The extraction unit 201 is configured to extract target file path information from the file synchronization processing request in response to receiving the file synchronization processing request; the reading unit 202 is configured to read the target file directory corresponding to the target file path information to obtain a file information sequence; the determination unit 203 is configured to determine at least one file to be synchronized according to the file information sequence; the classification unit 204 is configured to classify the at least one file to be synchronized to obtain at least one file group to be synchronized, wherein each file group to be synchronized in the at least one file group to be synchronized includes files to be synchronized that have the same file format; the execution unit 205 is configured to perform the following file synchronization steps for each file group to be synchronized in the at least one file group to be synchronized: according to the file format corresponding to each file to be synchronized in the file group to be synchronized, The file is split and compressed to generate various compressed files to be synchronized; in response to determining that there is at least one idle file writing node, at least one target file writing node is determined, wherein the number of the determined target file writing nodes is less than or equal to the number of the generated compressed files to be synchronized; through the determined target file writing nodes and the network isolation device, each file information corresponding to the above-mentioned file group to be synchronized in the above-mentioned file information sequence is written into the external network file information set to be synchronized in the target database as each external network file information to be synchronized, so as to update the above-mentioned external network file information set to be synchronized, wherein the above-mentioned target database is a database under the internal network environment; through the above-mentioned target file writing nodes and the above-mentioned network isolation device, each generated compressed file to be synchronized is written into the external network compressed file set to be synchronized in the above-mentioned target database in the form of a file stream as each external network compressed file to be synchronized.

[0097] It is understood that the units described in the device 200 are similar to those described in the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 200 and the units contained therein, and will not be described in detail here.

[0098] Reference below Figure 3 , which shows a structural schematic diagram of an electronic device 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0099] like Figure 3As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0100] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0101] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the functions defined in the method of some embodiments of the present disclosure are executed.

[0102] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0103] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0104] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving a file synchronization processing request, extracts the target file path information from the above file synchronization processing request; reads the target file directory corresponding to the above target file path information to obtain a file information sequence; determines at least one file to be synchronized according to the above file information sequence; classifies the above at least one file to be synchronized to obtain at least one file group to be synchronized, wherein each file group to be synchronized in the above at least one file group to be synchronized includes files to be synchronized that have the same file format; for each file group to be synchronized in the above at least one file group to be synchronized, the following file synchronization steps are performed: classify each file to be synchronized in the above file group to be synchronized according to the file format corresponding to each file to be synchronized in the above file group to be synchronized; The method comprises the steps of: cutting and compressing the compressed files to be synchronized to generate compressed files to be synchronized; in response to determining that there is at least one idle file writing node, determining at least one target file writing node, wherein the number of the determined target file writing nodes is less than or equal to the number of the generated compressed files to be synchronized; through the determined target file writing nodes and the network isolation device, writing the file information in the file information sequence corresponding to the file group to be synchronized as each external network file information to be synchronized into the external network file information set to be synchronized in the target database, so as to update the external network file information set to be synchronized, wherein the target database is a database under the internal network environment; through the target file writing nodes and the network isolation device, writing the generated compressed files to be synchronized as each external network compressed files to be synchronized into the external network compressed files set to be synchronized in the target database in the form of file streams.

[0105] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0106] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0107] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including an extraction unit, a reading unit, a determination unit, a classification unit, and an execution unit. The names of these units do not constitute limitations on the units themselves in certain circumstances, for example, the extraction unit may also be described as "a unit that extracts target file path information from the above-mentioned file synchronization processing request in response to receiving the file synchronization processing request".

[0108] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0109] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of technical features, but should also cover other technical solutions formed by any combination of technical features or their equivalent features without departing from the inventive concept. For example, a technical solution formed by replacing the features with (but not limited to) the technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A method for processing file synchronization requests, include: In response to receiving the file synchronization processing request, extracting target file path information from the file synchronization processing request; Reading the target file directory corresponding to the target file path information to obtain a file information sequence; Determine at least one file to be synchronized according to the file information sequence; Classifying the at least one file to be synchronized to obtain at least one file group to be synchronized, wherein each file group to be synchronized in the at least one file group to be synchronized includes files to be synchronized that have the same file format; For each to-be-synchronized file group in the at least one to-be-synchronized file group, the following file synchronization steps are performed: According to the file formats corresponding to the individual files to be synchronized in the group of files to be synchronized, each file to be synchronized in the group of files to be synchronized is divided and compressed to generate individual compressed files to be synchronized, wherein according to the file formats corresponding to the individual files to be synchronized in the group of files to be synchronized, each file to be synchronized in the group of files to be synchronized is divided and compressed to generate individual compressed files to be synchronized, including: Performing a status detection on the current network to obtain a network detection result, wherein the network detection result includes a transmission delay time; Determine the file format corresponding to each to-be-synchronized file in the to-be-synchronized file group as the target file format; Determining, according to the transmission delay time and the target file format, a first file segmentation size, a second file segmentation size, and a first segmentation quantity corresponding to the first file segmentation size, wherein the first file segmentation size is larger than the second file segmentation size; For each to-be-synchronized file in the to-be-synchronized file group, in response to determining that the to-be-synchronized file satisfies the file segmentation condition corresponding to the first file segmentation size, the to-be-synchronized file is segmented according to the first file segmentation size and the second file segmentation size to obtain a first segmented to-be-synchronized file and each second segmented to-be-synchronized file, wherein the number of the obtained first segmented to-be-synchronized files is equal to the first segmentation number, and the file segmentation condition corresponding to the first file segmentation size is that the file size of the to-be-synchronized file is greater than or equal to the product of the first segmentation number and the first segmentation size; According to the target file format, compressing the first preset number of first split files to be synchronized and each of the second split files to be synchronized to generate each compressed file to be synchronized; In response to determining that there is at least one idle file writing node, determining at least one target file writing node, wherein the number of the determined target file writing nodes is less than or equal to the number of the generated to-be-synchronized compressed files; By means of the determined target file writing nodes and network isolation devices, each file information in the file information sequence corresponding to the to-be-synchronized file group is written as each external network to-be-synchronized file information into the external network to-be-synchronized file information set in the target database, so as to update the external network to-be-synchronized file information set, wherein the target database is a database in an internal network environment; Through the target file writing nodes and the network isolation device, the generated compressed files to be synchronized are taken as external network compressed files to be synchronized and written into the external network compressed files to be synchronized collection in the target database in the form of file stream.

2. The method according to claim 1, in, Each of the to-be-synchronized compressed files corresponds to each to-be-synchronized compressed file information, and each to-be-synchronized compressed file information in the to-be-synchronized compressed file information includes a to-be-synchronized compressed file name and a to-be-synchronized compressed file size; as well as After the generated compressed files to be synchronized are written as external network compressed files to be synchronized in the target database in the form of file streams through the target file writing nodes and the network isolation device, the method further includes: Determine the individual compressed file information to be synchronized as a compressed file information set to be synchronized; Based on the compressed file information set to be synchronized, perform the following file resynchronization steps: Through the network isolation device, query the set of external network compressed files to be synchronized in the target database to obtain information of each external network compressed file to be synchronized, wherein each acquired information of the external network compressed file to be synchronized includes the name of the external network compressed file to be synchronized and the size of the external network compressed file to be synchronized; For each compressed file information to be synchronized in the compressed file information set to be synchronized, perform the following file writing verification steps: In response to determining that there is external network compressed file information to be synchronized that satisfies the same name condition among the acquired external network compressed file information to be synchronized, determining the external network compressed file information to be synchronized that satisfies the same name condition as the target external network compressed file information to be synchronized; In response to determining that the size of the external network compressed file to be synchronized included in the target external network compressed file to be synchronized information is not equal to the size of the compressed file to be synchronized included in the compressed file to be synchronized information, deleting the external network compressed file to be synchronized corresponding to the target external network compressed file to be synchronized information from the set of external network compressed files to be synchronized in the target database through the network isolation device; In response to determining that the size of the external network compressed file to be synchronized included in the target external network compressed file to be synchronized information is equal to the size of the compressed file to be synchronized included in the compressed file to be synchronized information, the compressed file to be synchronized information is deleted from the compressed file information to be synchronized set.

3. The method according to claim 2, in, The file resynchronization step also includes the following steps: Determine each to-be-synchronized compressed file corresponding to the to-be-synchronized compressed file information set as each target to-be-synchronized compressed file; In response to determining that the number of executions of the file resynchronization step is less than or equal to the first preset number of executions, each of the determined target compressed files to be synchronized is used as each external network compressed file to be synchronized, and is written into the external network compressed file collection to be synchronized in the target database in the form of a file stream through each target file writing node and the network isolation device, and the file resynchronization step is executed again; In response to determining that the number of executions of the file resynchronization step is greater than a first preset number of executions and the compressed file information set to be synchronized is not an empty set, the compressed file information set to be synchronized and the operation type information corresponding to the file resynchronization step are written to the file synchronization log and an alarm operation is performed.

4. The method according to claim 1, in, The method further comprises: In response to determining that the current time satisfies the synchronization period condition corresponding to the preset time period, querying the intranet file information set to be synchronized in the target database through the network isolation device to obtain the intranet file information set to be synchronized as the synchronization file verification information set; In response to determining that the acquired synchronization file verification information set is not an empty set, the following steps are performed: In response to determining that there is at least one idle file reading node, determining at least one target file reading node; Through the determined target file reading nodes and the network isolation device, the file stream is read for the set of compressed files to be synchronized in the target database to obtain the set of compressed files to be synchronized in the target database; Classifying the acquired intranet compressed file collection to be synchronized to obtain each intranet compressed file group to be synchronized; Merging and decompressing each of the intranet compressed file groups to be synchronized to obtain each intranet synchronization file to be verified; Performing file verification on each of the intranet synchronization files to be verified to determine each intranet synchronization file; The determined intranet synchronization files are stored in the target folder corresponding to the preset file path information to complete the intranet and extranet file synchronization.

5. The method according to claim 4, in, The performing file verification on each of the to-be-verified intranet synchronization files to determine each intranet synchronization file includes: Determine the individual intranet synchronization files to be verified as an intranet synchronization file set to be verified; Based on the synchronization file verification information set and the intranet synchronization file set to be verified, perform the following file reading verification steps: For each synchronization file verification information in the synchronization file verification information set, perform the following steps: In response to determining that there is an intranet synchronization file to be verified that satisfies the file name same condition in the intranet synchronization file set to be verified, determining the intranet synchronization file to be verified that satisfies the file name same condition as the target intranet synchronization file to be verified; In response to determining that the file size of the target to-be-verified intranet synchronization file is equal to the intranet synchronization file size included in the synchronization file verification information, the following steps are performed: Deleting the synchronization file verification information from the synchronization file verification information set; Deleting, by means of the network isolation device, the intranet file information to be synchronized corresponding to the synchronization file verification information from the intranet file information to be synchronized set in the target database; Determine the target intranet synchronization file to be verified as the intranet synchronization file; In response to determining that the file size of the target to-be-verified intranet synchronization file is not equal to the intranet synchronization file size included in the synchronization file verification information, the following steps are performed: Determine the intranet compressed file group to be synchronized corresponding to the target intranet synchronization file to be verified as the target intranet compressed file group to be synchronized; Delete the target intranet synchronization file to be verified from the set of intranet synchronization files to be verified; In response to determining that the number of executions of the file reading and verification step is less than or equal to a second preset number of executions, the following steps are performed: Through the determined target file reading nodes and the network isolation device, file stream reading is performed on each intranet compressed file to be synchronized corresponding to each determined target intranet compressed file group in the set of intranet compressed files to be synchronized in the target database; Generate each intranet synchronization file to be verified according to each intranet compressed file to be synchronized that is read; Insert each generated intranet synchronization file to be verified into the intranet synchronization file set to be verified and execute the file reading and verification step again.

6. The method according to claim 1, in, The file reading and verification step also includes the following steps: In response to determining that the number of executions of the file read verification step is greater than a second preset number of executions and the synchronization file verification information set is not an empty set, the synchronization file verification information set and the operation type information corresponding to the file read verification step are written to the file synchronization log and an alarm operation is performed.

7. A file synchronization request processing device, include: an extracting unit, configured to extract target file path information from the file synchronization processing request in response to receiving the file synchronization processing request; A reading unit is configured to read a target file directory corresponding to the target file path information to obtain a file information sequence; a determination unit, configured to determine at least one file to be synchronized according to the file information sequence; A classification unit is configured to classify the at least one to-be-synchronized file to obtain at least one to-be-synchronized file group, wherein each to-be-synchronized file group in the at least one to-be-synchronized file group includes files to-be-synchronized that have the same file format; The execution unit is configured to perform the following file synchronization steps for each of the at least one file group to be synchronized: according to the file format corresponding to each of the files to be synchronized in the file group to be synchronized, split and compress each of the files to be synchronized in the file group to be synchronized to generate each compressed file to be synchronized, wherein, according to the file format corresponding to each of the files to be synchronized in the file group to be synchronized, split and compress each of the files to be synchronized in the file group to be synchronized to generate each compressed file to be synchronized, including: performing a state detection on the current network to obtain a network detection result, wherein the network detection result includes a transmission delay time; The file format corresponding to each to-be-synchronized file in the to-be-synchronized file group is determined as the target file format; according to the transmission delay time and the target file format, a first file segmentation size, a second file segmentation size, and a first segmentation number corresponding to the first file segmentation size are determined, wherein the first file segmentation size is greater than the second file segmentation size; for each to-be-synchronized file in the to-be-synchronized file group, in response to determining that the to-be-synchronized file satisfies the file segmentation condition corresponding to the first file segmentation size, the to-be-synchronized file is segmented according to the first file segmentation size and the second file segmentation size to obtain a first segmented to-be-synchronized file and each second segmented to-be-synchronized file, wherein the number of the obtained first segmented to-be-synchronized files is equal to the first segmentation number, and the file segmentation condition corresponding to the first file segmentation size is that the file size of the to-be-synchronized file is greater than or equal to the product of the first segmentation number and the first segmentation size; according to the target file format, the first preset number of first segmented to-be-synchronized files and each second segmented to-be-synchronized file are compressed to generate each to-be-synchronized compressed file; in response to determining that there is at least one idle file write node, at least one target file write node is determined, wherein the number of the determined target file write nodes is less than or equal to the generated The number of compressed files to be synchronized; through the determined target file writing nodes and the network isolation device, each file information in the file information sequence corresponding to the file group to be synchronized is written into the external network file information set to be synchronized in the target database as each external network file information to be synchronized, so as to update the external network file information set to be synchronized, wherein the target database is a database under the internal network environment; through the determined target file writing nodes and the network isolation device, each generated compressed file to be synchronized is written into the external network compressed file set to be synchronized in the target database in the form of a file stream as each external network compressed file to be synchronized.

8. An electronic device, include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, in, When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Data synchronization method and device, electronic equipment and readable storage medium

    CN112948340A

  • Task encryption method and device, electronic equipment and computer readable medium

    CN113032818A