A file synchronization method, apparatus and electronic device
By generating a set of files to be synchronized and assigning synchronization tasks in a one-way optical shutter device, the problems of high cost and low speed of file synchronization in one-way optical shutter devices are solved, and efficient parallel synchronous transmission of files is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, unidirectional optical shutter devices have high costs and low speeds when performing file synchronization, especially when multiple devices transmit in parallel, resulting in uneven traffic distribution.
The first device determines the information of the files to be synchronized, generates a set of files to be synchronized, and allocates synchronization tasks based on the device information and file attributes. The first and second devices are then used to execute the corresponding synchronization tasks to achieve parallel synchronous file transmission.
Without incurring additional costs, it improved the file synchronization rate and balanced the distribution of synchronization tasks across devices, thereby enhancing file synchronization efficiency.
Smart Images

Figure CN115878573B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data security transmission technology, and in particular to a file synchronization method, apparatus and electronic device. Background Technology
[0002] One-way optical gateways are deployed between networks of different security levels, enabling unidirectional data transmission from a low-security domain to a high-security domain through a one-way, feedback-free physical transmission environment. The hardware architecture of a one-way optical gateway typically adopts a 2+1 architecture, consisting of an external terminal, an internal terminal, and a one-way isolation component. The one-way isolation component comprises two one-way isolation cards connected by a one-way fiber optic cable. The software architecture consists of network proxy programs and a security engine running on the external and internal terminals. Together, these hardware and software architectures form a secure host, which ultimately provides the one-way data transmission service.
[0003] Since file synchronization is a core function of the unidirectional optical shutter, it supports multiple synchronization methods. Among them, file synchronization using the built-in file transfer protocol is a widely used method, supporting FTP, SMB, and NFS protocols. Although the unidirectional optical shutter device supports clustering, it lacks cluster-based file synchronization functionality. To achieve parallel transmission across multiple devices, multiple unidirectional optical shutter devices are deployed, each configured with a different file synchronization strategy. This results in high costs. Furthermore, deploying multiple unidirectional optical shutter devices leads to uneven data distribution during file synchronization, resulting in a lower file synchronization rate. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a file synchronization method, apparatus and electronic device to solve the problems of high cost and low speed in the prior art when performing file synchronization.
[0005] In a first aspect, embodiments of this application provide a file synchronization method applied to an information security protection device, the information security protection device including a first device and a second device, wherein the second device may be one or more, and the file synchronization method includes:
[0006] The information of the files to be synchronized is determined using the first device;
[0007] A set of files to be synchronized is generated based on the information of the files to be synchronized.
[0008] From the set of files to be synchronized, determine the synchronization tasks for the first device and the second device respectively;
[0009] The first device and the second device are used to perform the corresponding synchronization tasks.
[0010] In one possible implementation, determining the file to be synchronized via the first device includes:
[0011] The first device communicates with each file server to obtain first file information included in each file server;
[0012] By comparing the first file information with the second file information, the file information to be synchronized is obtained, wherein the second file information is obtained and stored from the previous communication with each of the file servers.
[0013] In one possible implementation, generating the set of files to be synchronized based on the file information to be synchronized includes:
[0014] Extract the file attributes of the files to be synchronized from the information of the files to be synchronized;
[0015] The synchronization name of the file to be synchronized is determined based on the file attributes;
[0016] The first subset of files to be synchronized is determined based on the device information of the first device and the file name, and the second subset of files to be synchronized is determined based on the device information of the second device and the file name, wherein the device information includes at least device performance and device security factor;
[0017] The set of files to be synchronized is generated based on the first subset of files to be synchronized and the second subset of files to be synchronized.
[0018] In one possible implementation, determining the synchronization name of the file to be synchronized based on the file attributes includes:
[0019] Based on the file attributes, determine the synchronization priority, synchronization time, synchronization type, synchronization strategy, and file name of the file to be synchronized;
[0020] The synchronization name of the file to be synchronized is determined based on the synchronization priority level, the synchronization time, the synchronization type, the synchronization strategy, and the file name.
[0021] In one possible implementation, the first subset of files to be synchronized includes a first file to be synchronized, and if there are multiple first files to be synchronized, the first files to be synchronized are arranged in synchronization order; the second subset of files to be synchronized includes a second file to be synchronized, and if there are multiple second files to be synchronized, the second files to be synchronized are arranged in synchronization order.
[0022] In one possible implementation, the step of performing the corresponding synchronization task using the first device and the second device includes:
[0023] The first device is used to synchronize the first files in the first subset of files to be synchronized in the synchronization order of the first files to be synchronized.
[0024] The second device is used to synchronize the second files in the subset of the second files to be synchronized in the order of synchronization of the second files to be synchronized.
[0025] In one possible implementation, before determining the synchronization tasks for the first device and the second device from the set of files to be synchronized, the process includes:
[0026] The set of files to be synchronized is stored on a preset server, wherein both the first device and the second device have read and write permissions to the preset server.
[0027] In one possible implementation, the file synchronization method further includes:
[0028] The synchronization name of the first file to be synchronized is modified based on the synchronization result using the first device, thereby obtaining the first synchronization result name for each of the first files to be synchronized.
[0029] The second device is used to modify the synchronization name of the second file to be synchronized based on the synchronization result, so as to obtain the second synchronization result name of each second file to be synchronized;
[0030] The first file to be synchronized, whose name is changed to the first synchronization result name, and the second file to be synchronized, whose name is changed to the second synchronization result name, are stored in a preset location in the preset server.
[0031] Secondly, embodiments of this application also provide a file synchronization device, which is applied to an information security protection device, the information security protection device including a first device and a second device, wherein the second device may be one or more, and the file synchronization device includes:
[0032] The first determining module is configured to determine the file information to be synchronized through the first device;
[0033] The generation module is configured to generate a set of files to be synchronized based on the information of the files to be synchronized.
[0034] The second determining module is configured to determine the synchronization tasks of the first device and the second device from the set of files to be synchronized;
[0035] An execution module is configured to perform corresponding synchronization tasks using the first device and the second device.
[0036] Thirdly, embodiments of this application also provide a storage medium in which the computer program is executed by a processor to perform the steps of the file synchronization method as described in any of the above.
[0037] Fourthly, embodiments of this application also provide an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via a bus, and when the machine-readable instructions are executed by the processor, the steps of the file synchronization method as described in any of the above are performed.
[0038] This application embodiment generates a set of files to be synchronized using a first device, so that both the first device and the second device can determine and execute the corresponding synchronization tasks from the set of files to be synchronized. This achieves the purpose of parallel synchronous file transmission through the first device and the second device, without incurring additional costs. Furthermore, it can balance the synchronization tasks of the first device and the second device, greatly improving the file synchronization rate.
[0039] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart of a file synchronization method provided in this application is shown;
[0042] Figure 2 This application provides a flowchart illustrating the generation of a set of files to be synchronized based on information about the files to be synchronized during file synchronization.
[0043] Figure 3 A flowchart of another file synchronization method provided in this application is shown;
[0044] Figure 4 A schematic diagram of the structure of a file synchronization device provided in this application is shown;
[0045] Figure 5 A schematic diagram of the structure of an electronic device provided in this application is shown. Detailed Implementation
[0046] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0047] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0048] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0049] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0050] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0051] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0052] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0053] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0054] Firstly, to facilitate understanding of this application, a rule loading method provided in this application will be described in detail.
[0055] like Figure 1 The image shows a file synchronization method provided in an embodiment of this application, according to... Figure 1 The illustrated method steps can solve the problems of high cost and low speed in existing file synchronization technologies. Specific steps include S101-S104.
[0056] S101, determine the file information to be synchronized through the first device.
[0057] The file synchronization method provided in this application embodiment is applied to information security protection devices, such as one-way optical shutters. Further, the information security protection device in this application embodiment includes a first device and a second device, wherein the second device can be one or more. The hardware information of the first device and the second device may be the same, but their functions or roles may differ; for example, the first device may be a master device, and the second device a slave device.
[0058] In other words, information security protection equipment can include multiple identical devices, which can be defined and distinguished as a first device and multiple second devices, etc. Of course, in the event of a failure of the current first device, the first device can be stopped from operating, and a second device can be designated as the new first device to continue operating, so as to ensure the normal operation of the information security protection equipment.
[0059] Optionally, the first device is communicatively connected to each file server. When determining the file to be synchronized through the first device, it communicates with each file server to obtain first file information, which includes the first file and its associated file information on each file server. Then, the first device compares the first file information with second file information to obtain the file information to be synchronized, which includes each file to be synchronized and its associated file information. The second file information is obtained and stored from the previous communication with each file server. This second file information is stored on the first device or a file server; this embodiment does not specifically limit its storage location.
[0060] S102, Generate a set of files to be synchronized based on the information of the files to be synchronized.
[0061] After determining the information of the files to be synchronized, a set of files to be synchronized is generated based on the information of the files to be synchronized according to the preset generation rules.
[0062] As one example, Figure 2 A flowchart of a method for generating a set of files to be synchronized based on the information of the files to be synchronized is shown, wherein the specific steps include S201-S204.
[0063] S201, Extract file attributes of the file to be synchronized from the file information to be synchronized.
[0064] S202, determine the synchronization name of the file to be synchronized based on file attributes.
[0065] S203, a first subset of files to be synchronized is determined based on the device information and file name of the first device, and a second subset of files to be synchronized is determined based on the device information and file name of the second device, wherein the device information includes at least the device performance and the device security factor.
[0066] S204, Generate a set of files to be synchronized based on the first subset of files to be synchronized and the second subset of files to be synchronized.
[0067] In practice, the file attributes of the files to be synchronized are extracted from the information of the files to be synchronized. The file attributes include file name, type, update time, etc.
[0068] Next, the synchronization name of each file to be synchronized is determined based on its file attributes. Optionally, when determining the synchronization name of a file to be synchronized based on its file attributes, the synchronization priority, synchronization time, synchronization type, synchronization strategy, and file name of the file to be synchronized are determined based on the file attributes, and the synchronization name of the file to be synchronized is determined based on the synchronization priority, synchronization time, synchronization type, synchronization strategy, and file name.
[0069] For example, a 2-character string represents the synchronization priority level, consisting of two alphanumeric characters ranging from 00 (high priority) to 99 (low priority); a 10-character string represents the synchronization time, which is the order in which files were acquired, ranging from 0000000000 to 9999999999, with the sequence number cycling, meaning it can jump from 9999999999 to 0000000000; a 1-character string represents the synchronization type, including the file synchronization action and result. The file synchronization actions include adding, modifying, deleting, and synchronizing, corresponding to the letters "N", "U", "D", and "B" respectively; the file synchronization results include success, failure, retry, and abort, corresponding to the letters "S", "F", "R", and "A" respectively; and a 2-character string represents the synchronization strategy, which is pre-defined and has a certain correlation with the synchronization priority level. The synchronization name is 000000000000N01file0, which means that the synchronization priority level of the file to be synchronized is 00, which is the highest. Its synchronization time is 0000000000, which means that it is the first file to be identified as the file to be synchronized. Its synchronization type is N, which means new. Its synchronization strategy is 01, which means that it will be synchronized according to the pre-specified strategy. Its own file name is file0.
[0070] After determining the synchronization names of the files to be synchronized, a first subset of files to be synchronized is determined based on the device information and file names of the first device, and a second subset of files to be synchronized is determined based on the device information and file names of the second device. The device information includes at least device performance and device security factor. Optionally, the files to be synchronized for the first and second devices are determined according to the mapping relationship between device performance, device security factor, and synchronization priority level, thus obtaining the first and second subsets of files to be synchronized. For example, files with better device performance and higher device security factor correspond to files with higher synchronization priority, and files with poorer device performance and lower device security factor correspond to files with lower synchronization priority.
[0071] Then, a set of files to be synchronized is generated based on the first subset and the second subset. That is, the first subset includes the first files to be synchronized, and the second subset includes the second files to be synchronized. Furthermore, if there are multiple first files to be synchronized, they are arranged in synchronization order; similarly, if there are multiple second files to be synchronized, they are arranged in synchronization order.
[0072] Optionally, the synchronization order is arranged from highest to lowest according to the synchronization priority level. If the synchronization priority levels are the same, they are arranged from earliest to latest according to the synchronization time, and so on. The synchronization order is generated according to the synchronization priority level, synchronization time, synchronization type, and synchronization strategy.
[0073] S103, determine the synchronization tasks for the first device and the second device from the set of files to be synchronized.
[0074] After generating the set of files to be synchronized, the synchronization tasks for the first and second devices are determined from the set of files. Specifically, the synchronization tasks for the first and second devices can be determined according to the mapping relationship between device performance, device security factor and synchronization priority level.
[0075] Of course, the names of the file subsets to be synchronized corresponding to the first device and the second device can be predetermined. For example, the file subset to be synchronized corresponding to the first device is named "dev1", the file subset to be synchronized corresponding to one second device is named "dev2", and the file subset to be synchronized corresponding to another second device is named "dev3". When generating the file set to be synchronized, the files to be synchronized are stored in the corresponding locations according to the file subset names. Therefore, at the same time as generating the file set to be synchronized, the synchronization tasks of the first device and the second device are generated, that is, the files to be synchronized included in their corresponding file subsets.
[0076] Optionally, both the first and second devices can poll their respective subsets of files to be synchronized according to their corresponding polling cycles to determine whether their subsets include files to be synchronized, thereby determining their synchronization tasks. For example, it can be determined whether the file size of the corresponding subset of files to be synchronized is 0. If it is 0, it is determined that there is no corresponding synchronization task; if it is not 0, it is determined that there is a corresponding synchronization task, that is, the corresponding subset of files to be synchronized includes files to be synchronized.
[0077] It is worth noting that before determining the synchronization tasks for the first and second devices from the set of files to be synchronized, the set of files to be synchronized can be stored on a preset server. Both the first and second devices have read and write permissions on the preset server, thereby avoiding the problem of low file synchronization rate on the first device caused by storing the files on the first device. The preset server can be any one of the file servers.
[0078] S104, use the first and second devices to perform the corresponding synchronization tasks.
[0079] After determining the synchronization tasks for the first device and the second device, the corresponding synchronization tasks are executed using the first device and the second device, respectively. Optionally, when executing the corresponding synchronization tasks using the first device and the second device, the first device synchronizes the first files in the first subset of files to be synchronized in the order of synchronization of the first files to be synchronized, and the second device synchronizes the second files in the second subset of files to be synchronized in the order of synchronization of the second files to be synchronized.
[0080] It is worth noting that when the first and second devices perform their respective synchronization tasks, they can use the usual file communication protocol without the need to set up a special communication protocol, which makes the production and maintenance costs of the information security protection equipment lower.
[0081] This application embodiment generates a set of files to be synchronized using a first device, so that both the first device and the second device can determine and execute the corresponding synchronization tasks from the set of files to be synchronized. This achieves the purpose of parallel synchronous file transmission through the first device and the second device, without incurring additional costs. Furthermore, it can balance the synchronization tasks of the first device and the second device, greatly improving the file synchronization rate.
[0082] In practice, to easily distinguish between files that have already been synchronized and files that are yet to be synchronized, the following can also be executed: Figure 3 The method steps shown Figure 3 The flowchart shown includes S301-S303.
[0083] S301, the first device modifies the synchronization name of the first file to be synchronized based on the synchronization result to obtain the first synchronization result name of each first file to be synchronized.
[0084] S302, the second device modifies the synchronization name of the second file to be synchronized based on the synchronization result, and obtains the second synchronization result name of each second file to be synchronized.
[0085] S303, the first file to be synchronized, which has been modified to the first synchronization result name, and the second file to be synchronized, which has been modified to the second synchronization result name, are stored in a preset location on a preset server.
[0086] Optionally, after executing the corresponding synchronization task using the first device, the synchronization name of the first file to be synchronized is modified based on the synchronization result to obtain the first synchronization result name for each first file to be synchronized. Specifically, the corresponding synchronization type is modified, that is, the file synchronization action is changed to the file synchronization result. For example, after the file to be synchronized 00000000000N01file0 is synchronized, the synchronization name is changed to 000000000000S01file0, indicating that the file has been successfully synchronized.
[0087] Similarly, after performing the corresponding synchronization task using the second device, the synchronization name of the second file to be synchronized is modified based on the synchronization result to obtain the second synchronization result name of each second file to be synchronized.
[0088] Next, the first file to be synchronized, renamed with the first synchronization result name, and the second file to be synchronized, renamed with the second synchronization result name, are stored in a preset location on a preset server. This preset location is used to store synchronization results. For example, a subset of file synchronization results named "dev" is created in the set of files to be synchronized. In this case, the first file to be synchronized, renamed with the first synchronization result name, and the second file to be synchronized, renamed with the second synchronization result name, are stored in this subset of file synchronization results for querying and other processing of the file synchronization results.
[0089] Based on the same inventive concept, the second aspect of this application also provides a file synchronization device corresponding to the file synchronization method. Since the principle of the file synchronization device in this application is similar to that of the file synchronization method described above, the implementation of the file synchronization device can refer to the implementation of the method, and the repeated parts will not be described again.
[0090] Figure 4 This illustration shows a schematic diagram of a file synchronization device provided in an embodiment of this application, applied to an information security protection device. The information security protection device includes a first device and a second device, wherein the second device may be one or more. The file synchronization device includes:
[0091] The first determining module 401 is configured to determine the file information to be synchronized through the first device;
[0092] Generation module 402 is configured to generate a set of files to be synchronized based on the information of the files to be synchronized;
[0093] The second determining module 403 is configured to determine the synchronization tasks of the first device and the second device from the set of files to be synchronized.
[0094] The execution module 404 is configured to perform corresponding synchronization tasks using the first device and the second device.
[0095] In yet another embodiment, the first determining module 401 is specifically configured as follows:
[0096] The first device communicates with each file server to obtain first file information included in each file server;
[0097] By comparing the first file information with the second file information, the file information to be synchronized is obtained, wherein the second file information is obtained and stored from the previous communication with each of the file servers.
[0098] In yet another embodiment, the generation module 402 is specifically configured as follows:
[0099] Extract the file attributes of the files to be synchronized from the information of the files to be synchronized;
[0100] The synchronization name of the file to be synchronized is determined based on the file attributes;
[0101] The first subset of files to be synchronized is determined based on the device information of the first device and the file name, and the second subset of files to be synchronized is determined based on the device information of the second device and the file name, wherein the device information includes at least device performance and device security factor;
[0102] The set of files to be synchronized is generated based on the first subset of files to be synchronized and the second subset of files to be synchronized.
[0103] In yet another embodiment, the generation module 402 is further configured to:
[0104] Based on the file attributes, determine the synchronization priority, synchronization time, synchronization type, synchronization strategy, and file name of the file to be synchronized;
[0105] The synchronization name of the file to be synchronized is determined based on the synchronization priority level, the synchronization time, the synchronization type, the synchronization strategy, and the file name.
[0106] In another embodiment, the first subset of files to be synchronized includes a first file to be synchronized, and if there are multiple first files to be synchronized, the first files to be synchronized are arranged in synchronization order; the second subset of files to be synchronized includes a second file to be synchronized, and if there are multiple second files to be synchronized, the second files to be synchronized are arranged in synchronization order.
[0107] In yet another embodiment, the execution module 404 is specifically configured as follows:
[0108] The first device is used to synchronize the first files in the first subset of files to be synchronized in the synchronization order of the first files to be synchronized.
[0109] The second device is used to synchronize the second files in the subset of the second files to be synchronized in the order of synchronization of the second files to be synchronized.
[0110] In yet another embodiment, the file synchronization device further includes a storage module 405, configured as follows:
[0111] The set of files to be synchronized is stored on a preset server, wherein both the first device and the second device have read and write permissions to the preset server.
[0112] In yet another embodiment, the file synchronization device further includes a modification module 406, configured as follows:
[0113] The synchronization name of the first file to be synchronized is modified based on the synchronization result using the first device, thereby obtaining the first synchronization result name for each of the first files to be synchronized.
[0114] The second device is used to modify the synchronization name of the second file to be synchronized based on the synchronization result, so as to obtain the second synchronization result name of each second file to be synchronized;
[0115] The first file to be synchronized, whose name is changed to the first synchronization result name, and the second file to be synchronized, whose name is changed to the second synchronization result name, are stored in a preset location in the preset server.
[0116] This application embodiment generates a set of files to be synchronized using a first device, so that both the first device and the second device can determine and execute the corresponding synchronization tasks from the set of files to be synchronized. This achieves the purpose of parallel synchronous file transmission through the first device and the second device, without incurring additional costs. Furthermore, it can balance the synchronization tasks of the first device and the second device, greatly improving the file synchronization rate.
[0117] This application provides a storage medium, which is a computer-readable medium, storing a computer program. When executed by a processor, the computer program implements the method provided in any embodiment of this application, including the following steps S11 to S14:
[0118] S11, determine the file information to be synchronized through the first device;
[0119] S12, Generate a set of files to be synchronized based on the information of the files to be synchronized;
[0120] S13, determine the synchronization tasks for the first device and the second device from the set of files to be synchronized;
[0121] S14, use the first device and the second device to perform the corresponding synchronization task.
[0122] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 5 As shown, it includes at least a memory 501 and a processor 502. The memory 501 stores a computer program, and the processor 502 implements the method provided in any embodiment of this application when executing the computer program in the memory 501. Exemplarily, the steps of the electronic device computer program are as follows: S21 to S24:
[0123] S21, determine the file information to be synchronized through the first device;
[0124] S22, Generate a set of files to be synchronized based on the information of the files to be synchronized;
[0125] S23, determine the synchronization tasks for the first device and the second device from the set of files to be synchronized;
[0126] S24, perform the corresponding synchronization task using the first device and the second device.
[0127] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk. Optionally, in this embodiment, the processor executes the method steps described in the above embodiments according to the program code stored in the storage medium. Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, which will not be repeated here. Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed on a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be executed in a different order than those described here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any specific hardware and software combination.
[0128] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on this application that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, which will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the full scope of the following claims and their equivalents.
[0129] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. Other embodiments can be used by those skilled in the art when reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the application. This should not be construed as an intention that a disclosed feature not claimed is necessary for any claim. Rather, the subject matter of the application may be less than all the features of a particular disclosed embodiment. Thus, the following claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated to be combined with each other in various combinations or arrangements. The scope of this application should be determined by reference to the appended claims and the full scope of their equivalents.
[0130] The foregoing has described in detail several embodiments of this application, but this application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this application, and all such variations and modifications should fall within the scope of protection claimed in this application.
Claims
1. A file synchronization method, characterized by, The application is applied to one-way optical shutter to realize one-way data transmission from low security domain to high security domain, the one-way optical shutter comprises a first device and a second device, the second device is one or more, the file synchronization method comprises: Determine the to-be-synchronized file information through the first device; Generate a to-be-synchronized file set based on the to-be-synchronized file information; Determine the synchronization tasks of the first device and the second device from the to-be-synchronized file set respectively; Execute the corresponding synchronization tasks by using the first device and the second device; wherein: In the case that the first device and the second device correspond to a to-be-synchronized file subset respectively, the first device and the second device can poll their corresponding to-be-synchronized file subsets according to their corresponding polling periods, and then determine whether the to-be-synchronized file is included in the to-be-synchronized file subset corresponding to them, and then determine their synchronization tasks; The to-be-synchronized file set is generated based on the to-be-synchronized file information, comprising: Extract the file attributes of the to-be-synchronized file from the to-be-synchronized file information; Determine the synchronization name of the to-be-synchronized file based on the file attributes; Determine the first to-be-synchronized file subset based on the device information and the file name of the first device, and determine the second to-be-synchronized file subset based on the device information and the file name of the second device, wherein the device information at least includes device performance and device security coefficient; Generate the to-be-synchronized file set based on the first to-be-synchronized file subset and the second to-be-synchronized file subset.
2. The file synchronization method of claim 1, wherein, The to-be-synchronized file information is determined through the first device, comprising: Communicate with each file server through the first device to obtain the first file information included in each file server; Compare the first file information with the second file information to obtain the to-be-synchronized file information, wherein the second file information is obtained and stored by communicating with each file server last time.
3. The file synchronization method of claim 1, wherein, Determine the synchronization name of the to-be-synchronized file based on the file attributes, comprising: Determine the synchronization priority level, synchronization time, synchronization type, synchronization strategy and file name of the to-be-synchronized file based on the file attributes; Determine the synchronization name of the to-be-synchronized file based on the synchronization priority level, synchronization time, synchronization type, synchronization strategy and file name.
4. The file synchronization method according to any one of claims 1 to 3, characterized in that, The first to-be-synchronized file subset comprises a first to-be-synchronized file, in the case that the first to-be-synchronized file is multiple, the first to-be-synchronized file is arranged according to synchronization order; The second to-be-synchronized file subset comprises a second to-be-synchronized file, in the case that the second to-be-synchronized file is multiple, the second to-be-synchronized file is arranged according to synchronization order.
5. The file synchronization method of claim 4, wherein, The corresponding synchronization tasks are executed by using the first device and the second device, comprising: Synchronize the first to-be-synchronized file in the first to-be-synchronized file subset by using the first device according to the synchronization order of the first to-be-synchronized file; Synchronize the second to-be-synchronized file in the second to-be-synchronized file subset by using the second device according to the synchronization order of the second to-be-synchronized file.
6. The file synchronization method of claim 5, wherein, Before determining the synchronization tasks of the first device and the second device from the set of files to be synchronized respectively, comprising: storing the set of files to be synchronized to a preset server, wherein the first device and the second device both have read and write permissions of the preset server.
7. The file synchronization method of claim 6, wherein, Further comprising: modifying the synchronization name of the first file to be synchronized based on the synchronization result by using the first device to obtain the first synchronization result name of each first file to be synchronized; modifying the synchronization name of the second file to be synchronized based on the synchronization result by using the second device to obtain the second synchronization result name of each second file to be synchronized; storing the first file to be synchronized modified as the first synchronization result name and the second file to be synchronized modified as the second synchronization result name to a preset location in the preset server.
8. A file synchronization apparatus employing the method according to any one of claims 1 to 7, characterized by Applied to the one-way optical shutter, the one-way optical shutter comprises a first device and a second device, the second device is one or more, and the file synchronization device comprises: a first determination module configured to determine file information to be synchronized by a first device; a generation module configured to generate a set of files to be synchronized based on the file information to be synchronized; a second determination module configured to determine the synchronization tasks of the first device and the second device from the set of files to be synchronized respectively; an execution module configured to execute the corresponding synchronization tasks by using the first device and the second device.
9. An electronic device, comprising: Comprising: a processor and a memory, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, and the machine readable instructions executed by the processor execute the steps of the file synchronization method in any one of claims 1 to 7.
Citation Information
Patent Citations
File synchronization method, device and system
CN105893447A