File Unidirectional Transmission System and Method
Through the distributed file storage and memory sharing mechanism, the problem of file loss in the one-way file transfer system is solved, reliable file transmission and fault detection is realized, and the availability and reliability of the system are improved.
Patent Information
- Application Number
- CN202510452185.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-04-11
AI Technical Summary
The existing one-way file transmission system cannot promptly notify the external terminal when a channel abnormality is detected, resulting in loss of file data and affecting the availability and reliability of the system.
The distributed file storage and memory sharing mechanism are adopted to ensure that the files received by the external terminal are stored in the distributed file storage system, and the transmission information is recorded through the distributed memory sharing mechanism. The internal terminal adopts the distributed memory sharing mechanism to detect the file transfer status and perform deduplication processing.
It improves the availability and reliability of the one-way file transmission system, ensures that files can be transferred to the internal terminal in a timely and complete manner, and promptly detects transmission failures.
Smart Images

Figure CN119996407B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of one-way file transmission, and in particular to a one-way file transmission system and method. Background Art
[0002] One-way file transmission is suitable for scenarios where data flow needs to be strictly controlled. Through the collaborative work of the internal and external terminals, combined with one-way transmission mechanism, data encryption and security monitoring technologies, the one-way file transmission system can effectively ensure the security and one-way nature of data.
[0003] Related technologies use technologies such as Keepalived to implement device failover; Linux Virtual Server (LVS) is used to implement the self-load balancing function of the device. This solution uses the external machine as the cluster working node, and fault detection is mainly based on the external machine. It does not have the ability to detect the working status of the one-way channel. Due to the one-way transmission characteristics of the system, the internal machine cannot notify the external machine after discovering the channel abnormality, and the external machine cannot know the status of the internal machine, causing the file data to be lost due to the problem of the one-way channel. When the intranet server detects that the received file is missing, it can only be processed passively through human intervention (retransmission), which may lead to untimely discovery and low efficiency, seriously affecting the availability and reliability of the one-way system.
[0004] Therefore, how to improve the availability and reliability of one-way file transmission systems has become a technical problem that needs to be solved urgently in the industry. Summary of the invention
[0005] The present invention provides a one-way file transmission system and method, which are used to solve the technical problem of how to improve the availability and reliability of the one-way file transmission system.
[0006] The present invention provides a one-way file transmission system, comprising: a plurality of one-way devices;
[0007] The unidirectional device comprises: an external terminal and an internal terminal unidirectionally connected to the external terminal;
[0008] The external terminal includes: a file storage module and a first shared memory;
[0009] The file storage modules of each external terminal are interconnected and used for distributed storage of the files to be transmitted received by each external terminal;
[0010] The first shared memory is used to record first transmission information of the file to be transmitted from the external terminal to the internal terminal, and to share the first transmission information with each external terminal;
[0011] The internal terminal includes: a second shared memory;
[0012] The second shared memory is used to record the second transmission information of the to-be-transmitted file transmitted by the inner terminal, and share the second transmission information with each inner terminal.
[0013] In some embodiments, the file unidirectional transmission system further includes a first service switch and a first synchronization switch;
[0014] The outer terminals in each unidirectional device are connected to multiple file sending servers based on the first service switch;
[0015] The outer terminals in each unidirectional device are connected to each other based on the first synchronization switch.
[0016] In some embodiments, the file unidirectional transmission system further includes a second service switch and a second synchronization switch;
[0017] The inner terminals in each unidirectional device are connected to multiple file receiving servers based on the second service switch;
[0018] The inner terminals in each unidirectional device are connected to each other based on the second synchronization switch.
[0019] The present invention provides a file unidirectional transmission method, which is applied to the outer terminal in the file unidirectional transmission system, and includes:
[0020] Receiving a to-be-transmitted file sent by a file sending server;
[0021] Storing the to-be-transmitted file into a distributed file storage system; the distributed file storage system is constructed based on the file storage modules of each outer terminal;
[0022] Unidirectionally transmitting the to-be-transmitted file to the inner terminal corresponding to the outer terminal, so that the inner terminal sends the to-be-transmitted file to a file receiving server;
[0023] Recording the first transmission information of the outer terminal transmitting the to-be-transmitted file to the inner terminal in a first shared memory.
[0024] In some embodiments, after unidirectionally transmitting the to-be-transmitted file to the inner terminal corresponding to the outer terminal, the method includes:
[0025] Accessing the first shared memories of each outer terminal to obtain the first transmission information of each to-be-transmitted file;
[0026] Obtaining the storage duration of each to-be-transmitted file;
[0027] When the first transfer information of any file to be transferred and / or the storage duration of any file to be transferred stored in the first shared memory of each external terminal is greater than a preset storage duration, delete the any file to be transferred in the file storage module of each external terminal.
[0028] The present invention provides a file unidirectional transfer method, which is applied to an internal terminal in the file unidirectional transfer system, and includes:
[0029] Receive a file to be transferred;
[0030] Access the second shared memory of each internal terminal to obtain the second transfer information of the file to be transferred;
[0031] When the second transfer information of the file to be transferred does not exist in the second shared memory of each internal terminal, send the file to be transferred to a file receiving server;
[0032] Record the second transfer information of the internal terminal transferring the file to be transferred in the second shared memory.
[0033] In some embodiments, after accessing the second shared memory of each internal terminal to obtain the second transfer information of the file to be transferred, the method further includes:
[0034] When the second transfer information of the file to be transferred exists in the second shared memory of any internal terminal, delete the file to be transferred.
[0035] The present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the file unidirectional transfer method is implemented.
[0036] The present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the file unidirectional transfer method is implemented.
[0037] The present invention provides a computer program product, including a computer program, and when the computer program is executed by a processor, the file unidirectional transfer method is implemented.
[0038] The file unidirectional transmission system and method provided by the present invention include multiple unidirectional devices; the unidirectional device includes an external terminal and an internal terminal unidirectionally connected to the external terminal; the external terminal includes a file storage module and a first shared memory; the file storage modules of each external terminal are interconnected and used for distributed storage of the files to be transmitted received by each external terminal; the first shared memory is used to record the first transmission information of the external terminal transmitting the files to be transmitted to the internal terminal, and share the first transmission information with each external terminal; the internal terminal includes a second shared memory; the second shared memory is used to record the second transmission information of the internal terminal transmitting the files to be transmitted, and share the second transmission information with each internal terminal; on the external terminal side, a distributed file storage mechanism is adopted to ensure that any external terminal can directly store the received files into the distributed file storage system to avoid file loss. Through the distributed memory sharing mechanism and the unidirectional redundant transmission mechanism, it is ensured that as long as there is a complete unidirectional transmission link in the entire transmission system, the files can be unidirectionally transmitted to the internal terminal completely; on the internal terminal side, a distributed memory sharing mechanism is adopted to detect the transmission status of the files and perform deduplication processing on the files to be transmitted, ensuring that the files to be transmitted can be reliably transmitted to the file receiving server; the availability and reliability of the file unidirectional transmission system are improved; and according to the first transmission information and the second transmission information, the transmission of the files in the external terminal and the internal terminal can be detected, and the faults of the file unidirectional transmission system can be found in a timely and accurate manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments in line with the present invention, and are used together with the specification to explain the principles of the present invention.
[0040] To more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0041] Figure 1 is one of the schematic structural diagrams of the file unidirectional transmission system provided by the present invention.
[0042] Figure 2 is the second of the schematic structural diagrams of the file unidirectional transmission system provided by the present invention.
[0043] Figure 3 is one of the schematic flowcharts of the file unidirectional transmission method provided by the present invention.
[0044] Figure 4 is the schematic diagram of the single external file processing flow provided by the present invention.
[0045] Figure 5 It is the second flow schematic diagram of the file unidirectional transmission method provided by the present invention.
[0046] Figure 6 It is the schematic diagram of the unidirectional inner-end file processing flow provided by the present invention.
[0047] Figure 7 It is the schematic diagram of the structure of the electronic device provided by the present invention. Detailed implementation manners
[0048] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0049] It should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units or modules does not necessarily have to be limited to those steps or units or modules clearly listed, but may include other steps or units or modules not clearly listed or inherent to these processes, methods, products or devices.
[0050] Figure 1 It is one of the schematic diagrams of the structure of the file unidirectional transmission system provided by the present invention. As Figure 1 shown, the file unidirectional transmission system 100 includes a plurality of unidirectional devices 200.
[0051] The unidirectional device 200 includes an outer-end machine 210 and an inner-end machine 220 that is unidirectionally connected to the outer-end machine 210.
[0052] The outer-end machine 210 includes a file storage module 211 and a first shared memory 212. The inner-end machine 220 includes a second shared memory 221.
[0053] The file storage modules of each outer-end machine are interconnected and used for distributed storage of the files to be transmitted received by each outer-end machine.
[0054] The first shared memory is used to record the first transmission information of the files to be transmitted from the external terminal to the internal terminal, and share the first transmission information with each external terminal.
[0055] The second shared memory is used to record the second transmission information of the files to be transmitted by the internal terminal, and share the second transmission information with each internal terminal.
[0056] Specifically, the file one-way transmission system provided by the embodiments of the present invention is applied to technical scenarios that require strict control of data flow direction, ensure data security, and prevent data leakage. The file one-way transmission system is used to ensure that files can only flow in one direction during the transmission process and reverse transmission is not allowed. For example, files can only be transmitted from a file sending server on the external network (outer network) to a file receiving server on the internal network (inner network).
[0057] The file one-way transmission system may include multiple unidirectional devices arranged in parallel. The unidirectional device is a key component for realizing unidirectional data transmission, usually deployed between networks with different security levels to ensure that data can only be transmitted from one direction to another and cannot flow in the reverse direction.
[0058] In terms of structure, the unidirectional device may include an external terminal and an internal terminal that is unidirectionally connected to the external terminal. The external terminal is a device deployed in the external security domain (such as a non-secret network), responsible for receiving the files sent by the file sending server and forwarding them to the internal terminal. The internal terminal is a device in the internal security domain (such as a secret network), responsible for receiving the files sent by the external terminal and sending the files to the file receiving server.
[0059] The external terminal and the internal terminal are connected through a unidirectional channel. The unidirectional channel can be a file transmission channel constructed by unidirectional transmission components such as a unidirectional optical switch or a unidirectional network switch, or a file transmission channel constructed by setting the network data flow direction through a software program. The external terminal and the internal terminal in the unidirectional device are set in a one-to-one correspondence.
[0060] The external terminal may include a file storage module and a first shared memory. The file storage module can be one or more independent storage areas divided from the storage of the external terminal. The file storage modules in each external terminal are interconnected to form a distributed file system (DFS). The specific connection method may include network connection or signal cable connection. Each file storage module constitutes a storage node in the distributed file system. The distributed file system can perform distributed storage on the files to be transmitted received by each external terminal.
[0061] All the file data received by the external terminal is scattered and stored in each storage node. The distributed file storage system is used to ensure the security and integrity of the files. Even if only one effective storage node remains in the entire system, the file data can still be obtained completely. At the same time, combined with the storage characteristics of the distributed file storage system, after any external terminal receives or grabs a file, the file is stored in the distributed file storage system through the Application Programming Interface (API) method, and the other external terminals can directly read the file from the distributed file storage system and perform one-way packet transmission.
[0062] To ensure that the same file to be transmitted can be transmitted by all external terminals in the system, all external terminals also need to build a set of Distributed Shared Memory (DSM) mechanisms. The file information that has been transmitted from the distributed file storage system by the external terminal needs to be informed to all other external terminals through this memory sharing mechanism. Therefore, the external terminal also includes a first shared memory. This memory is used to record the first transmission information of the file to be transmitted from the external terminal to the corresponding internal terminal, and to share the first transmission information with each external terminal. The first transmission information may include file name, file size, file importance level, file destination, file source, transmission time, and the external terminal number of the transmitting file, etc.
[0063] Due to the use of one-way redundant transmission, the same file to be transmitted will appear in multiple internal terminals, but it cannot be pushed to the file receiving server on the internal network. Therefore, all internal terminals in the system also need to build a set of distributed memory sharing mechanisms to share the file transmission situation. As long as one internal terminal successfully pushes the file to the file receiving server on the internal network, the other internal terminals will directly discard the file and record the log information. Therefore, the internal terminal includes a second shared memory. The second shared memory is used to record the second transmission information of the file to be transmitted by the internal terminal, and to share the second transmission information with each internal terminal. The second transmission information may include file name, file size, file importance level, file destination, file source, transmission time, the external terminal number of the transmitting file, the internal terminal number of the transmitting file, etc.
[0064] The external terminal acts as both a storage node, performing distributed storage on the file to be transmitted to ensure that any external terminal can directly store the file in the distributed file storage system after receiving it; and as a sending node, performing one-way redundant transmission on the file to be transmitted to ensure that as long as there is a complete one-way transmission link in the entire transmission system, the file can be completely transmitted to the internal terminal in one direction.
[0065] Meanwhile, to ensure that the file receiving server in the internal network only receives one complete file data (file to be transmitted), technically, a distributed memory sharing mechanism needs to be built for all internal institutions to detect the transmission status of the file and deduplicate the file to be transmitted. The relevant technical measures of the unidirectional internal and external ends in the entire transmission system cooperate with each other to ultimately ensure the integrity, reliability, and non-loss of unidirectional file transmission.
[0066] The file unidirectional transmission system provided by the embodiments of the present invention includes multiple unidirectional devices; the unidirectional device includes an external machine and an internal machine unidirectionally connected to the external machine; the external machine includes a file storage module and a first shared memory; the file storage modules of each external machine are interconnected for distributed storage of the files to be transmitted received by each external machine; the first shared memory is used to record the first transmission information of the external machine transmitting the file to be transmitted to the internal machine and share the first transmission information with each external machine; the internal machine includes a second shared memory; the second shared memory is used to record the second transmission information of the internal machine transmitting the file to be transmitted and share the second transmission information with each internal machine; a distributed file storage mechanism is adopted on the external machine side to ensure that any external machine can directly store the received file into the distributed file storage system to avoid file loss. Through the distributed memory sharing mechanism and the unidirectional redundant transmission mechanism, it is ensured that as long as there is a complete unidirectional transmission link in the entire transmission system, the file can be unidirectionally transmitted to the internal machine completely; a distributed memory sharing mechanism is adopted on the internal machine side to detect the transmission status of the file and deduplicate the file to be transmitted, ensuring that the file to be transmitted can be reliably transmitted to the file receiving server; the availability and reliability of the file unidirectional transmission system are improved; and according to the first transmission information and the second transmission information, the transmission of the file in the external machine and the internal machine can be detected, and the faults of the file unidirectional transmission system can be found in a timely and accurate manner.
[0067] In some embodiments, the file unidirectional transmission system further includes a first service switch, a second service switch, a first synchronization switch, and a second synchronization switch.
[0068] The external machines in each unidirectional device are connected to multiple file sending servers based on the first service switch; the external machines in each unidirectional device are interconnected based on the first synchronization switch.
[0069] The internal machines in each unidirectional device are connected to multiple file receiving servers based on the second service switch; the internal machines in each unidirectional device are interconnected based on the second synchronization switch.
[0070] Specifically, Figure 2 is the second structural schematic diagram of the file unidirectional transmission system provided by the present invention, as Figure 2As shown in the figure, the file unidirectional transmission system further includes a first service switch 230, a second service switch 240, a first synchronization switch 250, and a second synchronization switch 260.
[0071] The external terminal includes a first service interface and a second service interface. The first service interface is connected to the first service switch; the second service interface is connected to the first synchronization switch.
[0072] Each file sending server is also connected to the first service switch. Through the first service switch, the external terminal is connected to multiple file sending servers and can receive the files to be transmitted sent by any file sending server.
[0073] Optionally, the first service switch can run a load balancing algorithm. According to the real-time load, communication quality, and storage space size of each external terminal, etc., it dynamically allocates file transfer tasks and transfers the files to be transmitted sent by the file sending server to a suitable external terminal. For example, the first service switch can monitor the processor, memory usage, and the number of tasks currently being processed of the external terminal in real time, and preferentially allocate tasks to the external terminal with lower load. The first service switch can preferentially select an external terminal with low network latency, high bandwidth, and low network packet loss rate to improve the file transfer speed. The first service switch can monitor the storage space and read / write speed of the external terminal in real time to ensure that the external terminal has enough storage space to receive and temporarily store files, and select an external terminal with better read / write performance.
[0074] Each external terminal is connected to each other through the first synchronization switch, and can access the first shared memory with each other to obtain the first transmission information.
[0075] The internal terminal includes a first service interface and a second service interface. The first service interface is connected to the second service switch; the second service interface is connected to the second synchronization switch.
[0076] Each file receiving server is also connected to the second service switch. Through the second service switch, the internal terminal is connected to multiple file receiving servers and can send the files to be transmitted to any file receiving server.
[0077] Optionally, the second service switch can run a content detection algorithm to detect the content of the files to be transmitted sent by any internal terminal, and identify whether there is malicious code, virus, or unauthorized content in the files to ensure that the file content complies with specific laws, regulations, or enterprise policies. The content detection algorithm can include a text detection algorithm, an image detection algorithm, etc. When detecting content that does not meet the requirements, it automatically intercepts the file transfer and triggers an alarm mechanism.
[0078] Each internal terminal is connected to each other through the second synchronization switch, and can access the second shared memory with each other to obtain the second transmission information.
[0079] The file unidirectional transmission system provided by the embodiment of the present invention realizes parallel transmission by setting up a service switch; access between external machines and between internal machines is realized by setting up a synchronization switch; the service switch is responsible for traffic management and load balancing, while the synchronization switch is responsible for data consistency and real-time management; the collaborative work of the two can significantly improve the overall performance of the file unidirectional transmission system.
[0080] Figure 3 is one of the schematic flowcharts of the file unidirectional transmission method provided by the present invention, as Figure 3 shown, this method is applied to the external machine in the file unidirectional transmission system in the above embodiment, and includes step 310, step 320, step 330 and step 340.
[0081] Step 310: Receive the file to be transmitted sent by the file sending server.
[0082] Specifically, each external machine can be connected to multiple file sending servers through the first service switch to receive the file to be transmitted.
[0083] Step 320: Store the file to be transmitted in the distributed file storage system; the distributed file storage system is constructed based on the file storage modules of each external machine.
[0084] Specifically, the distributed file storage system can be constructed according to the file storage modules of each external machine.
[0085] After the external machine receives the file to be transmitted, it can store the file to be transmitted in the distributed file storage system. The distributed file storage system disperses and stores the file to be transmitted in the file storage modules of each external machine. For example, the file to be transmitted can be split into multiple smaller data blocks (or objects), and each data block will be stored on the file storage module of a different external machine. To ensure data reliability, the distributed file storage system usually performs redundant backup on each data block and stores the backup on different file storage modules.
[0086] When a file needs to be restored, the distributed file storage system reads the scattered data blocks from each storage node (the file storage module of the external terminal) according to the metadata information and reorganizes them into a complete file. The metadata records the location, size, and replica information of each data block, and the system locates and reads the data blocks through this metadata. Multiple replicas of each data block are stored on different nodes. As long as one replica exists, the system can restore the data block. When a storage node failure is detected, the system automatically restores the data from other replicas and recreates replicas to maintain redundancy. Through the above mechanism, even if there is only one effective external terminal left in the entire system, the distributed file storage system can still ensure the integrity of the data.
[0087] Step 330: Unidirectionally transmit the file to be transmitted to the internal terminal corresponding to the external terminal, so that the internal terminal sends the file to be transmitted to the file receiving server.
[0088] Specifically, after storing the file to be transmitted in the distributed file storage system, the external terminal unidirectionally transmits the file to be transmitted to the internal terminal corresponding to the external terminal, so that the internal terminal can send the file to be transmitted to the file receiving server.
[0089] Step 340: Record the first transmission information of the external terminal transmitting the file to be transmitted to the internal terminal in the first shared memory.
[0090] Specifically, the external terminal generates the first transmission information according to the transmission process of the file to be transmitted, and then records this information in the first shared memory.
[0091] The file unidirectional transmission method provided by the embodiments of the present invention is applied to an external terminal, and includes: receiving the file to be transmitted sent by the file sending server; storing the file to be transmitted in the distributed file storage system; the distributed file storage system is constructed based on the file storage modules of each external terminal; unidirectionally transmitting the file to be transmitted to the internal terminal corresponding to the external terminal, so that the internal terminal sends the file to be transmitted to the file receiving server; recording the first transmission information of the external terminal transmitting the file to be transmitted to the internal terminal in the first shared memory; adopting a distributed file storage mechanism on the external terminal side to ensure that any external terminal can directly store the received file in the distributed file storage system to avoid file loss, and through the distributed memory sharing mechanism and the unidirectional redundancy transmission mechanism, ensuring that as long as there is a complete unidirectional transmission link in the entire transmission system, the file can be unidirectionally transmitted to the internal terminal completely; improving the availability and reliability of the file unidirectional transmission system.
[0092] In some embodiments, after unidirectionally transmitting the file to be transmitted to the internal terminal corresponding to the external terminal, the method includes:
[0093] Access the first shared memory of each external terminal, and obtain the first transmission information of each file to be transmitted;
[0094] Obtain the storage duration of each file to be transmitted;
[0095] When the first transmission information of any file to be transmitted exists in the first shared memory of each external terminal and / or the storage duration of any file to be transmitted is greater than the preset storage duration, delete any file to be transmitted in the file storage module of each external terminal.
[0096] Specifically, after the file to be transmitted is unidirectionally transmitted from the external terminal to the internal terminal, the file to be transmitted can be deleted.
[0097] It is possible to access the first shared memory of each external terminal, so as to obtain the first transmission information of each file to be transmitted. Each file to be transmitted may be a file that has been transmitted by some external terminals and has not been transmitted by the remaining external terminals. At the same time, obtain the storage duration of each file to be transmitted. The storage duration refers to the length of time that the file to be transmitted is received and stored in the distributed file storage system by any external terminal.
[0098] If the first transmission information of any file to be transmitted exists in the first shared memory of each external terminal (condition 1), it means that the file to be transmitted has been unidirectionally and redundantly transmitted by all external terminals; if the storage duration of any file to be transmitted is greater than the preset storage duration (condition 2), it means that the file to be transmitted can be cleared to avoid accumulation in the distributed file storage system. The preset storage duration can be set as needed.
[0099] Condition 1 can determine that the file has been transmitted and does not need to be saved; condition 2 can avoid the accumulation of files in the external terminal. For example, when the file reaches the preset storage duration and there are still some external terminals that have not been able to transmit, this measure is used to deal with situations such as abnormal external terminals and disconnections, which cause the file to be unable to be downloaded and transmitted, and prevent the file from accumulating in the distributed file storage system. The above two conditions can be combined. For example, for some important files, although they have been unidirectionally transmitted to the internal terminal, they still need to be retained in the external terminal if it is not determined that the internal terminal has transmitted them to the file receiving server on the internal network.
[0100] When the above condition 1 and / or condition 2 are met, the file to be transmitted can be deleted in the file storage module of each external terminal.
[0101] The file unidirectional transmission method provided by the embodiments of the present invention can determine whether to delete a file according to the first transmission information in the first shared memory of each external terminal or the storage duration of the file to be transmitted, and can prevent files from accumulating in the distributed file storage system constructed by the external terminal.
[0102] Figure 4 It is a schematic diagram of the one-way outer-end file processing flow provided by the present invention. As Figure 4 shown, after the outer-end machine starts a task, it receives the file sent by the file sending server, caches it locally, then uploads it to the distributed file storage system, and then performs one-way transmission on the file.
[0103] The distributed file storage system can obtain a file list, detect each file, and obtain the first transmission information from the first shared memory of each outer-end machine. Determine whether each file has been sent according to the first transmission information. If not sent, perform one-way transmission on the file; if already sent, delete each file according to whether the storage duration of each file exceeds the preset storage duration.
[0104] In some embodiments, fault diagnosis can be performed on each outer-end machine according to the first transmission information in the first shared memory of each outer-end machine.
[0105] For example, if the difference between the number of the first transmission information in the first shared memory of any outer-end machine and the number of the first transmission information in the first shared memory of the remaining outer-end machines is greater than the preset threshold, it can be determined that the outer-end machine may have a fault. Further, according to the comparison between the first transmission information in the first shared memory of this outer-end machine and the first transmission information in the first shared memory of the remaining outer-end machines, determine the files that cannot be transmitted and the time of transmission failure, etc.
[0106] Figure 5 It is the second schematic diagram of the file one-way transmission method provided by the present invention. As Figure 5 shown, this method is applied to the inner-end machine in the file one-way transmission system in the above embodiments, and includes step 510, step 520, step 530, and step 540.
[0107] Step 510: Receive the file to be transmitted.
[0108] Specifically, the inner-end machine obtains the file to be transmitted through the outer-end machine connected to it.
[0109] Step 520: Access the second shared memory of each inner-end machine to obtain the second transmission information of the file to be transmitted.
[0110] Specifically, the second shared memory of each inner-end machine can be accessed to obtain the second transmission information of the file to be transmitted.
[0111] Step 530: In the case where the second transmission information of the file to be transmitted does not exist in the second shared memory of each inner-end machine, send the file to be transmitted to the file receiving server.
[0112] Specifically, if the second transmission information of the file to be transmitted does not exist in the second shared memory of each internal terminal, it indicates that the file has not been transmitted to the file receiving server in the internal network. At this time, the file to be transmitted can be sent to the file receiving server.
[0113] Step 540: Record the second transmission information of the internal terminal transmitting the file to be transmitted in the second shared memory.
[0114] Specifically, the internal terminal generates the second transmission information according to the transmission process of the file to be transmitted, and then records this information in the second shared memory.
[0115] The file unidirectional transmission method provided by the embodiments of the present invention is applied to an internal terminal and includes: receiving a file to be transmitted; accessing the second shared memory of each internal terminal to obtain the second transmission information of the file to be transmitted; when the second transmission information of the file to be transmitted does not exist in the second shared memory of each internal terminal, sending the file to be transmitted to the file receiving server; recording the second transmission information of the internal terminal transmitting the file to be transmitted in the second shared memory; adopting a distributed memory sharing mechanism on the internal terminal side to detect the transmission status of the file, perform deduplication processing on the file to be transmitted, and ensure that the file to be transmitted can be reliably transmitted to the file receiving server; improving the availability and reliability of the file unidirectional transmission system.
[0116] In some embodiments, after accessing the second shared memory of each internal terminal to obtain the second transmission information of the file to be transmitted, the method further includes:
[0117] When the second transmission information of the file to be transmitted exists in the second shared memory of any internal terminal, deleting the file to be transmitted.
[0118] Specifically, if the second transmission information of the file to be transmitted exists in the second shared memory of any internal terminal, it indicates that the file has been transmitted by this internal terminal to the file receiving server. At this time, the file to be transmitted can be deleted to avoid the accumulation of files in the internal terminal.
[0119] The file unidirectional transmission method provided by the embodiments of the present invention performs deduplication processing on the file to be transmitted, and ensures that the file to be transmitted can be reliably transmitted to the file receiving server.
[0120] Figure 6 It is a schematic diagram of the unidirectional internal terminal file processing flow provided by the present invention. As Figure 6 shown, after the internal terminal starts a task, it receives the current file sent by the external terminal, detects the status of the current file by accessing the second transmission information in the second shared memory of the other internal terminals, and determines whether the current file has been sent. If it has been sent, the current file is discarded; if not, it is locally cached and then sent to the file receiving server.
[0121] The local cache can be scanned regularly. If the file has been sent, discard the file; if the file has not been sent, continue to send the file and clear the local cache after sending the file; if the continuous sending fails, end the task and perform fault diagnosis.
[0122] Figure 7 is a schematic structural diagram of the electronic device provided by the present invention. As Figure 7 shown, the electronic device may include: a processor (Processor) 710, a communication interface (Communications Interface) 720, a memory (Memory) 730, and a communication bus (Communications Bus) 740. Among them, the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call the logical commands in the memory 730 to execute the methods described in the above embodiments, for example:
[0123] Receive the file to be transmitted sent by the file sending server; store the file to be transmitted in the distributed file storage system; the distributed file storage system is constructed based on the file storage modules of each external terminal; unidirectionally transmit the file to be transmitted to the internal terminal corresponding to the external terminal, so that the internal terminal sends the file to be transmitted to the file receiving server; record the first transmission information of the file to be transmitted from the external terminal to the internal terminal in the first shared memory;
[0124] Or, receive the file to be transmitted; access the second shared memory of each internal terminal to obtain the second transmission information of the file to be transmitted; in the case where the second transmission information of the file to be transmitted does not exist in the second shared memory of each internal terminal, send the file to be transmitted to the file receiving server; record the second transmission information of the internal terminal transmitting the file to be transmitted in the second shared memory.
[0125] In addition, when the logical commands in the above-mentioned memory are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several commands for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0126] The processor in the electronic device provided in the embodiments of the present invention can call the logical instructions in the memory to implement the above method. The specific implementation manner is the same as that of the foregoing method embodiment and can achieve the same beneficial effects, which will not be elaborated here.
[0127] The embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the methods provided in the above-mentioned various embodiments.
[0128] The specific implementation manner is the same as that of the foregoing method embodiment and can achieve the same beneficial effects, which will not be elaborated here.
[0129] The embodiments of the present invention provide a computer program product, including a computer program, which when executed by a processor, implements the method as described above.
[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.
[0131] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A one-way file transfer system, characterized in that, Comprising: Multiple one-way devices; The one-way device includes: an outer terminal machine, and an inner terminal machine that is unidirectionally connected to the outer terminal machine; The outer terminal machine includes: a file storage module and a first shared memory; The file storage modules of each outer terminal machine are interconnected to form a distributed file storage system for distributed storage of the files to be transmitted received by each outer terminal machine; the file storage modules of each outer terminal machine are storage nodes in the distributed file storage system; The first shared memory is used to record the first transmission information of the outer terminal machine transmitting the file to be transmitted to the inner terminal machine, and to share the first transmission information with each outer terminal machine; The inner terminal machine includes: a second shared memory; The second shared memory is used to record the second transmission information of the inner terminal machine transmitting the file to be transmitted, and to share the second transmission information with each inner terminal machine.
2. The file one-way transmission system according to claim 1, wherein The file unidirectional transmission system further includes a first service switch and a first synchronization switch; The outer terminal machines in each one-way device are connected to multiple file sending servers based on the first service switch; The outer terminal machines in each one-way device are interconnected based on the first synchronization switch.
3. The file one-way transmission system according to claim 1, characterized in that, The file unidirectional transmission system further includes a second service switch and a second synchronization switch; The inner terminal machines in each one-way device are connected to multiple file receiving servers based on the second service switch; The inner terminal machines in each one-way device are interconnected based on the second synchronization switch.
4. A unidirectional file transfer method, characterized in that, An outer terminal machine applied to the file unidirectional transmission system according to any one of claims 1 to 3 includes: Receiving a file to be transmitted sent by a file sending server; Storing the file to be transmitted in the distributed file storage system; the distributed file storage system is constructed based on the file storage modules of each outer terminal machine; Unidirectionally transmitting the file to be transmitted to the inner terminal machine corresponding to the outer terminal machine, so that the inner terminal machine sends the file to be transmitted to a file receiving server; Recording the first transmission information of the outer terminal machine transmitting the file to be transmitted to the inner terminal machine in the first shared memory.
5. The file one-way transmission method according to claim 4, characterized in that After the step of unidirectionally transmitting the file to be transmitted to the inner terminal machine corresponding to the outer terminal machine, the method includes: Accessing the first shared memory of each outer terminal machine to obtain the first transmission information of each file to be transmitted; Obtaining the storage duration of each file to be transmitted; In the case that the first transmission information of any file to be transmitted and / or the storage duration of any file to be transmitted is greater than a preset storage duration in the first shared memory of each outer terminal machine, deleting the any file to be transmitted in the file storage module of each outer terminal machine.
6. A one-way file transfer method, characterized in that, An inner terminal machine applied to the file unidirectional transmission system according to any one of claims 1 to 3 includes: Receiving a file to be transmitted; Accessing the second shared memory of each inner terminal machine to obtain the second transmission information of the file to be transmitted; In the case that the second transmission information of the file to be transmitted does not exist in the second shared memory of each inner terminal machine, sending the file to be transmitted to a file receiving server; Recording the second transmission information of the inner terminal machine transmitting the file to be transmitted in the second shared memory.
7. The file one-way transmission method according to claim 6, wherein After accessing the second shared memory of each internal terminal and obtaining the second transmission information of the file to be transmitted, the method further includes: When the second transmission information of the file to be transmitted exists in the second shared memory of any internal terminal, deleting the file to be transmitted.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the file one-way transmission method according to any one of claims 4 to 7.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the file one-way transmission method according to any one of claims 4 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the file one-way transmission method according to any one of claims 4 to 7.
Citation Information
Patent Citations
One-way message transmission method and device, storage medium and equipment
CN117336262A