CN110233851B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN110233851B
CN110233851B CN201910541438.3A CN201910541438A CN110233851B CN 110233851 B CN110233851 B CN 110233851B CN 201910541438 A CN201910541438 A CN 201910541438A CN 110233851 B CN110233851 B CN 110233851B
Authority
CN
China
Prior art keywords
data
file
receiving end
data receiving
forwarded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910541438.3A
Other languages
Chinese (zh)
Other versions
CN110233851A (en
Inventor
程幸福
夏绍华
郑钧元
徐越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Original Assignee
Nsfocus Technologies Inc
Nsfocus Technologies Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nsfocus Technologies Inc, Nsfocus Technologies Group Co Ltd filed Critical Nsfocus Technologies Inc
Priority to CN201910541438.3A priority Critical patent/CN110233851B/en
Publication of CN110233851A publication Critical patent/CN110233851A/en
Application granted granted Critical
Publication of CN110233851B publication Critical patent/CN110233851B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Abstract

The invention provides a data transmission method and a data transmission device, and belongs to the technical field of communication. If the data transmission device acquires first data from the data sending end through a first communication protocol requiring handshake by two communication parties and then establishing communication, a file to be forwarded is generated according to the first data, and then the file to be forwarded is transmitted to the data receiving end through a second communication protocol not requiring handshake by the two communication parties, so that data transmission from the data sending end to the data receiving end is automatically completed, the condition of manual assistance for data transmission is reduced, and the workload of network maintenance personnel is reduced.

Description

Data transmission method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data transmission method and apparatus.
Background
With the development of information technology, more and more information is spread through a network. In a network communication environment, in order to protect an office environment and confidential information, a plurality of units or mechanisms isolate an internal network from an external network, and a unidirectional optical gate is adopted to realize that data of the external network is transmitted to the internal network, and the internal network cannot transmit the data to the external network.
However, some communication protocols stipulate that when a data transmitting end transmits data to a data receiving end, the data transmitting end needs to obtain feedback from the data receiving end to establish connection and transmit data. For example, if data is transmitted through a TCP (Transmission Control Protocol), due to the existence of the unidirectional optical gate, the data source cannot obtain feedback from the data receiving end, and thus cannot establish connection with the data receiving end and implement data Transmission.
Therefore, although the unidirectional shutter can protect the internal network from being attacked by the external network, it brings great inconvenience to data transmission between the internal network and the external network. For example, when data is transmitted between the internal network and the external network via a communication protocol that requires handshaking between both communication parties and then establishes communication, the external network cannot receive a handshake signal fed back by the internal network, and thus cannot transmit data to the internal network. Under the above circumstances, data transmission between the internal network and the external network often needs to be implemented manually, which increases the workload of network maintenance personnel.
Disclosure of Invention
The embodiment of the invention provides a data transmission method and device, which are used for solving the problem that manual assistance is needed to realize data transmission among different networks in the prior art.
The embodiment of the invention provides the following specific technical scheme:
in a first aspect, an embodiment of the present invention provides a data transmission method, including:
if first data are acquired from a data transmitting end through a first type of communication protocol, generating a file to be forwarded according to the first data; the first type of communication protocol is a protocol for establishing communication after handshaking between two communication parties is needed;
transmitting the file to be forwarded to a data receiving end through a second type of communication protocol; wherein the second type of communication protocol is different from the first type of communication protocol.
According to the data transmission method provided by the embodiment of the invention, if the data transmission device acquires the first data from the data sending end through the first type of communication protocol which requires the two communication parties to handshake and then establishes communication, the file to be forwarded is generated according to the first data, and then the file to be forwarded is transmitted to the data receiving end through the second type of communication protocol which does not require the two communication parties to handshake, so that the data transmission from the data sending end to the data receiving end is automatically completed, the condition of manually assisting in data transmission is reduced, and the workload of network maintenance personnel is reduced.
In a possible implementation manner, the step of transmitting the file to be forwarded to a data receiving end includes:
and transmitting the file to be forwarded to a data receiving end through a one-way optical gate.
In the method, the unidirectional optical gate is arranged between the data transmission device and the data receiving end for executing the method, so that the data can only be transmitted from the data transmission device to the data receiving end but not from the data receiving end to the data transmission device, the data leakage can be prevented, and the data safety is ensured.
In a possible implementation manner, the generating a file to be forwarded according to the first data includes:
writing the first data into an intermediate file;
when the intermediate file meets the end condition set by a preset file generation strategy, stopping writing data into the intermediate file; the termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time;
and compressing the intermediate file according to a compression mode set by the file generation strategy to generate the file to be forwarded.
In the above method, when the first data is written in the intermediate file, and when the intermediate file reaches a predetermined size or the number of pieces of data in the intermediate file reaches a predetermined number, the writing of data in the intermediate file is stopped, thereby preventing the file from being excessively large. When the receiving interruption time of the first data exceeds the preset time, the writing of the data into the intermediate file can be stopped, and the file can be transmitted in time. The intermediate file is compressed to generate the file to be forwarded, so that the size of the file to be forwarded can be reduced, the data transmission quantity is reduced, and the data transmission efficiency is improved.
In a possible implementation manner, the transmitting the file to be forwarded to a data receiving end through a second type of communication protocol includes:
storing the file to be forwarded to a storage position corresponding to the data receiving end; when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the file to be forwarded to the data receiving end through the second type of communication protocol.
The method provides two transmission modes for transmitting the file to be forwarded to the data receiving end. And if the data transmission mode used by the data receiving end is active acquisition, storing the file to be forwarded to a storage position corresponding to the data receiving end, and actively pulling the file to be forwarded by the data receiving end. And if the data transmission mode used by the data receiving end is passive receiving, directly sending the file to be forwarded to the data receiving end through a second type of communication protocol. Through the two different modes, data transmission service can be provided for data receiving ends adopting different data transmission modes, and application scenes of the data transmission method provided by the embodiment of the invention are increased.
In a possible implementation manner, the directly sending the file to be forwarded to the data receiving end through the second type of communication protocol includes:
informing the data receiving end to establish a temporary file with unavailable attribute under the appointed directory;
sending the file to be forwarded to the data receiving end through the second type communication protocol so that the data receiving end stores the received file to be forwarded in the temporary file;
and after the file to be forwarded is sent, informing the data receiving end of modifying the unavailable attribute of the temporary file into the available attribute.
According to the method, when the file to be forwarded is directly sent to the data receiving end, the data receiving end is firstly informed to establish the temporary file with the unavailable attribute under the appointed directory, so that the situation that a user uses the file which is not completely transmitted to damage data in the file can be prevented, and the complete transmission of the file is ensured.
In one possible implementation manner, the method further includes:
and if second data are acquired from a data sending end through a second type of communication protocol, transmitting the second data to a corresponding data receiving end through the second type of communication protocol.
In the method, if the second data is acquired from the data transmitting end through the second type of communication protocol, the second data can be directly transmitted to the corresponding data receiving end through the second type of communication protocol, so that the data can be rapidly transmitted.
In a possible implementation manner, the transmitting the second data to the corresponding data receiving end through the second type communication protocol includes:
storing the second data to a storage position corresponding to the data receiving end; when a data pulling request sent by the data receiving end is received, the second data is transmitted to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the second data to the data receiving end through the second type communication protocol.
In the method, if the data transmission mode used by the data receiving end is active acquisition, the second data is stored to the storage position corresponding to the data receiving end, and the second data is actively pulled by the data receiving end. And if the data transmission mode used by the data receiving end is passive receiving, directly sending second data to the data receiving end through a second type of communication protocol. Through the two different modes, the second data can be transmitted to the data receiving ends adopting different data transmission modes, and application scenes of the data transmission method provided by the embodiment of the invention are increased.
In a second aspect, an embodiment of the present invention provides a data transmission apparatus, including:
the file generation module is used for generating a file to be forwarded according to first data if the first data is acquired from a data transmitting end through a first type of communication protocol; the first type of communication protocol is a protocol for establishing communication after handshaking between two communication parties is needed;
the file forwarding module is used for transmitting the file to be forwarded to a data receiving end through a second type communication protocol; wherein the second type of communication protocol is different from the first type of communication protocol.
In one possible implementation manner, the file forwarding module is further configured to:
and transmitting the file to be forwarded to a data receiving end through a one-way optical gate.
In one possible implementation manner, the file generation module is further configured to:
writing the first data into an intermediate file;
when the intermediate file meets the end condition set by a preset file generation strategy, stopping writing data into the intermediate file; the termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time;
and compressing the intermediate file according to a compression mode set by the file generation strategy to generate the file to be forwarded.
In one possible implementation manner, the file forwarding module is further configured to:
storing the file to be forwarded to a storage position corresponding to the data receiving end; when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the file to be forwarded to the data receiving end through the second type of communication protocol.
In one possible implementation manner, the file forwarding module is further configured to:
informing the data receiving end to establish a temporary file with unavailable attribute under the appointed directory;
sending the file to be forwarded to the data receiving end through the second type communication protocol so that the data receiving end stores the received file to be forwarded in the temporary file;
and after the file to be forwarded is sent, informing the data receiving end of modifying the unavailable attribute of the temporary file into the available attribute.
In one possible implementation manner, the file forwarding module is further configured to:
and if second data are acquired from a data sending end through a second type of communication protocol, transmitting the second data to a corresponding data receiving end through the second type of communication protocol.
In one possible implementation manner, the file forwarding module is further configured to:
storing the second data to a storage position corresponding to the data receiving end; when a data pulling request sent by the data receiving end is received, the second data is transmitted to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the second data to the data receiving end through the second type communication protocol.
In a third aspect, an embodiment of the present invention provides a data transmission apparatus, including a memory and at least one processor, where the memory stores a computer program that is executable on the processor, and when the computer program is executed by the at least one processor, the method described in the first aspect is implemented.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the data transmission method in any one of the first aspect are implemented.
For technical effects brought by any one implementation manner in the second aspect to the fourth aspect, reference may be made to technical effects brought by a corresponding implementation manner in the first aspect, and details are not described here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is an application scenario diagram of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a signaling interaction diagram when two communication parties establish communication connection through TCP protocol;
fig. 3 is a schematic flowchart of a data transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a transmission process when data is received through a first type of communication protocol according to an embodiment of the present invention;
fig. 5 is a schematic specific flowchart of step S407 in fig. 4;
fig. 6 is a schematic diagram illustrating a transmission process when data is received through a second type of communication protocol according to an embodiment of the present invention;
fig. 7 is a block diagram of a data transmission apparatus according to an embodiment of the present invention;
fig. 8 is a block diagram of another data transmission apparatus according to an embodiment of the present invention;
fig. 9 is a block diagram of another data transmission apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Some terms used in the embodiments of the present invention are explained below to facilitate understanding by those skilled in the art.
(1) FTP (File Transfer Protocol): the method is a set of standard protocols for file transmission on the network, uses a client/server mode, and can realize file transmission without handshaking between two communication parties.
(2) SFTP (Secure File Transfer Protocol): besides the grammar and function which are the same with those of FTP, the encryption transmission authentication information can be used for encrypting the transmitted file, a safe network encryption method is provided for the transmitted file, and the file transmission can be realized without handshaking between two communication parties.
(3) Samba: the client/Server mode is used for realizing an SMB (Server Message Block) protocol, and file transmission can be realized without handshaking between two communication parties. Through the SMB protocol, files and printers can be shared on the local area network, specifically, the SMB protocol can provide sharing services of resources such as files and printers for different computers in the local area network, and clients can access shared file systems, printers and other resources on the servers through the SMB protocol.
(4) TCP (Transmission Control Protocol): the method is a connection-oriented, reliable and byte stream-based transport layer communication protocol, and data can be transmitted only after three-way handshaking is carried out by two communication parties. The functions specified by the fourth layer transport layer are completed in the Open System Interconnection (OSI) model of the computer network.
(5) UDP (User Datagram Protocol): is a connectionless transport layer communication protocol at the same layer as the TCP protocol in the OSI model for handling data packets and providing transaction-oriented simple unreliable messaging services.
It should be noted that the following application scenarios described in the embodiments of the present invention are for more clearly illustrating the technical solutions of the embodiments of the present invention, and do not constitute limitations on the technical solutions provided in the embodiments of the present invention, and it is known by those skilled in the art that with the occurrence of new application scenarios, the technical solutions provided in the embodiments of the present invention are also applicable to similar technical problems.
The data transmission method provided by the embodiment of the invention can be applied to the application scene shown in fig. 1. Illustratively, the data receiving end 100 shown in fig. 1 may be understood as a device in an internal network of a certain unit or organization, and the data sending end 400 may be understood as a device in an external network with respect to the internal network. Since a large number of wireless communication systems have been developed in recent years with the development of information technology, the internal network and the external network may use different wireless communication systems, or the wireless communication technologies used by the internal network and the external network belong to different wireless carriers. Thus, the internal network and the external network constitute a heterogeneous network.
With the improvement of the concern of information security, in a heterogeneous network environment, in order to protect an office environment and confidential information, some units isolate an internal network from an external network, the unidirectional shutter 200 shown in fig. 1 may be used to enable data of the external network to be transmitted to the internal network, and the internal network cannot transmit data to the external network, so that data leakage can be prevented. The unidirectional optical gate is unidirectional isolation equipment based on light, which is developed on the basis of a security isolation GAP (GAP), and can obviously improve the security strength of an internal network.
In a possible implementation manner, a one-way optical splitting transmission technology of a physical layer may be adopted, and "handshaking" of both communication parties is cut off from the bottom layer to form feedback-free one-way transmission, so as to ensure that an internal network is protected from being attacked by an external network, which is also referred to as a physical isolation manner. For example, the national government department and the military key department adopt a physical isolation mode to realize unidirectional data transmission.
In a possible implementation manner, the unidirectional shutter may be implemented by a Data Diode (Data Diode), and the Data Diode has a pure unidirectional property, and can ensure that Data is transmitted from an external network to an internal network, and at the same time, Data of the internal network cannot possibly flow into the external network, thereby implementing a process of unidirectional Data transmission.
In the prior art, a unidirectional optical gate 200 is disposed between the data transmitting end 400 and the data receiving end 100, and the unidirectional optical gate 200 may support file transfer of FTP protocol, SFTP protocol, and Samba protocol. However, if data is transmitted through a communication protocol (hereinafter, referred to as a first-class communication protocol) that requires handshaking between both communication parties, data transmission may not be achieved because a connection cannot be established between the data transmitting end 400 and the data receiving end 100.
Taking the TCP protocol as an example, as shown in fig. 2, before data transmission, the client and the server need to go through three handshakes to establish a connection. The first handshake is that the client initiates a connection request to the server, and the second handshake is that after the server receives the connection request of the client, if the connection is confirmed, an ACK (Acknowledgement) message is replied, and resources are allocated for the connection. And the third handshake is that the client sends an ACK message to the server after receiving the acknowledgement reply of the server, and resources are allocated, so that the establishment of the TCP connection between the client and the server is completed. The third handshake is mainly to prevent the failed connection request from being transmitted to the server, and thus an error is generated. For example, the client sends out a connection request, but the connection request message is abnormally lost, the server does not receive the connection request, and then the client retransmits the connection request again. This time the server receives the connection request and gives an acknowledgement reply, establishing the connection. After the data transmission is finished, the connection is released. However, the lost message of the client may only be retained for a long time at some network nodes, and arrive at the server after delaying the connection release until a certain time, at this time, the server mistakenly thinks that the client sends a new connection request again, and then sends an ACK message to the client, at this time, the client does not reply to the server again, i.e., does not perform a third handshake, so that the misconnection can be prevented. The locations of the client and server shown in fig. 2 may also be interchanged.
In the embodiment of the present invention, the data sending end 400 may be understood as the above-mentioned client, and the data receiving end 100 may be understood as the above-mentioned server. During the second handshake of the three handshakes, the data receiving end is required to send confirmation feedback to the data sending end, and under the scene of the one-way optical gate, the data receiving end cannot send confirmation feedback to the data sending end, so that the connection between the data receiving end and the data sending end cannot be established. In the above situation, data transmission between the data transmitting end 400 and the data receiving end 100 often needs to be performed by means of manual assistance.
Based on this, the embodiment of the invention provides a data transmission method and device. The data transmission device 300 provided in the embodiment of the present invention is connected between the data sending end 400 and the one-way optical shutter 200, and if the data transmission device 300 obtains the first data from the data sending end 400 through the first type of communication protocol, a file to be forwarded is generated according to the first data, and then the file to be forwarded is transmitted to the data receiving end 100 through the second type of communication protocol that does not require handshaking between the two communicating parties, so that the first data transmitted through the first type of communication protocol can be transmitted to the data receiving end 100 through the one-way optical shutter.
Fig. 3 is a flowchart illustrating a data transmission method according to an embodiment of the present invention, and as shown in fig. 3, the method includes the following steps:
step S301, if first data is acquired from a data transmitting end through a first type of communication protocol, a file to be forwarded is generated according to the first data.
The first type of communication protocol is a protocol that requires both communication parties to establish communication after handshaking, such as a TCP protocol.
Step S302, the file to be forwarded is transmitted to the data receiving end through the second type communication protocol.
The second type of communication protocol is different from the first type of communication protocol, and the second type of communication protocol is a communication protocol that does not require handshaking between two communication parties, such as an FTP protocol, an SFTP protocol, a Samba protocol, and the like. The second type of communication protocol may be used to transmit the file to be forwarded to the data receiving end through the unidirectional optical gate.
The data transmission method can realize the function of data transmission by exchanging data among different communication protocols. For example, data transmission between the TCP protocol/UDP protocol/FTP protocol/SFTP protocol/Samba protocol can be implemented.
As an exemplary usage scenario, the above method may be applied to a data transmission apparatus installed between a data transmitting end and a unidirectional optical gate, which may be an active mode optical gate or a passive mode optical gate described below. The unidirectional optical gate is connected with the data receiving end, and a plurality of data transmitting ends and a plurality of data receiving ends can be configured at the same time to fulfill the aim of transmitting various data. For example, the transmission mode may be unicast, that is, one data transmitting end corresponds to one data receiving end; or broadcasting, that is, one data sending end corresponds to a plurality of data receiving ends; it may also be multicast, that is, one data transmitting end corresponds to a group of data receiving ends.
By applying the data transmission method, if the data transmission device acquires first data from the data transmitting end through a first communication protocol requiring communication establishment after handshake between two communication parties, a file to be forwarded is generated according to the first data, and then the file to be forwarded is transmitted to the data receiving end through a second communication protocol not requiring handshake between the two communication parties, so that data transmission from the data transmitting end to the data receiving end is automatically completed, the condition of manual assistance for data transmission is reduced, and the workload of network maintenance personnel is reduced.
Optionally, if the second data is acquired from the data transmitting end through the second type of communication protocol, the second data is transmitted to the corresponding data receiving end through the second type of communication protocol.
In an alternative embodiment, as shown in fig. 4, when first data is received, the data transmission method provided in the embodiment of the present invention includes the following steps:
step S401, if data transmitted by a first type communication protocol is received, acquiring an encryption mode of the data.
The data transmission device of the embodiment of the invention can be provided with a plurality of data receiving ports, each data receiving port is connected with one or more data transmitting ends, and communication protocols corresponding to the data receiving ports can be configured, for example, some data receiving ports are used for receiving data transmitted by a TCP (transmission control protocol) protocol, or acquiring data from the data transmitting ends by the TCP protocol; the other data receiving ports are used for receiving data transmitted by a UDP protocol, or acquiring data from a data transmitting end by the UDP protocol; there are also some data receiving ports for receiving data transmitted through the FTP protocol, the SFTP protocol, or the Samba protocol. According to the communication protocol corresponding to the data receiving port receiving the data, whether the data is transmitted through the first type communication protocol or not can be determined. In other words, the communication protocol of the listening configuration is a data receiving port of a TCP protocol or a UDP protocol, and the data received by the data receiving port is data transmitted through the first type of communication protocol.
For data transmitted by a TCP protocol or a UDP protocol, the encryption mode of the data is obtained. The encryption mode of the data can be acquired from the data sending end, the encryption mode corresponding to the data receiving port can also be configured in advance, and the encryption mode of the data can be determined according to the data receiving port receiving the data.
And S402, decrypting the received data according to the encryption mode to obtain first data.
The encryption mode may be a TLS (Transport Layer Security) encryption mode or an SSL (Secure Socket Layer) encryption mode. And if the encryption mode of the data is the TLS encryption mode, decrypting the received data by adopting a decryption mode corresponding to the TLS encryption mode, and if the encryption mode of the data is the SSL encryption mode, decrypting the received data by adopting a decryption mode corresponding to the SSL encryption mode to obtain the first data. If the data is not encrypted, decryption is not needed, and the first data is directly obtained.
Step S403, writing the first data into the intermediate file, and stopping writing the data into the intermediate file when the intermediate file satisfies an end condition set by the pre-configured file generation policy.
The termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time.
The file generation policy may be pre-configured by a user, and the user may configure the size of a single intermediate file, the number of data pieces contained in the single intermediate file, a separator of the data, the timeout time for automatically ending the intermediate file after the data reception timeout, the compression mode, the storage location of the file to be forwarded formed after the compression, and the like. For the file generation policy, a user may be supported to configure multiple policies and select whether to enable a policy. And writing the first data into the intermediate file according to a pre-configured file generation strategy. When the intermediate file reaches the specified size or the number of data pieces in the intermediate file reaches the specified number, the writing of data into the intermediate file is stopped, and the intermediate file is prevented from being too large. When the receiving interruption time of the first data exceeds the preset time, the writing of the data into the intermediate file can be stopped, and the file can be transmitted in time.
And S404, compressing the intermediate file according to the compression mode set by the file generation strategy to generate the file to be forwarded.
The compression modes supported by the device comprise the following modes: *. Tar-associated Unix files, tar.gz or tgz-Gzipped Tar files, bz2-Bzip2 compressed files. The intermediate file is compressed to generate the file to be forwarded, so that the size of the file to be forwarded can be reduced, the data transmission quantity is reduced, and the data transmission efficiency is improved.
After the file to be forwarded is generated, the file to be forwarded can be stored to a local storage position set by a file generation strategy, and the file caching function is achieved. If the communication link or the one-way optical gate has a fault or the pressure is too high, the file to be forwarded is firstly cached in the local memory, and the file is continuously sent when the communication link or the one-way optical gate is recovered to be normal, so that the data can be prevented from being lost in the transmission process.
Step S405, determining a data transmission mode of the data receiving end. If the data transmission mode of the data receiving end is active acquisition, executing step S406; if the data transmission mode at the data receiving end is passive reception, step S407 is performed.
The data transmission device of the embodiment of the invention is connected with the data receiving end through the one-way optical gate, and specifically, the data transmission device can be connected with different data receiving ends through different one-way optical gates. The unidirectional shutter may actively acquire the file or passively receive the file. And if the file acquisition mode of the one-way optical gate connected with the data receiving end is active acquisition, the data transmission mode of the data receiving end is active acquisition. And if the file acquisition mode of the unidirectional optical gate connected with the data receiving end is passive receiving, the data transmission mode of the data receiving end is passive receiving.
Step S406, storing the file to be forwarded to a storage position corresponding to the data receiving end; and when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position of the file to be forwarded through a second type of communication protocol.
If the data transmission mode of the data receiving end is active acquisition, the file to be forwarded can be stored to the storage position corresponding to the data receiving end, and the data receiving end is waited to pull the file to be forwarded from the storage position. The storage location is a storage location commonly recognized by the data transmission device and the data receiving end, and the storage location can be set by a user. And when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position of the file to be forwarded through a second type of communication protocol. The second type of communication protocol may be any one of FTP protocol, SFTP protocol, Samba protocol. The FTP protocol, the SFTP protocol and the Samba protocol all support the active transmission of files to a data receiving end and also support the active acquisition of files by the data receiving end.
For example, if the communication protocol used by the data receiving end is the FTP protocol, the data transmission mode of the data receiving end is actively acquired, the file to be forwarded is stored in the storage location corresponding to the data receiving end on the local FTP service, and the FTP service transmits the file to be forwarded to the data receiving end from the storage location of the file to be forwarded after receiving the file pulling request sent by the data receiving end. The data transmission process corresponding to the SFTP protocol and the Samba protocol is similar to the FTP protocol, and is not described herein again.
Step S407, the file to be forwarded is directly sent to the data receiving end through the second type communication protocol.
If the data transmission mode of the data receiving end is passive reception, the process of directly sending the file to be forwarded to the data receiving end may include the following steps as shown in fig. 5:
step S4071, informing the data receiving end to establish a temporary file with unavailable attribute under the specified directory;
step S4072, the file to be forwarded is sent to the data receiving end through the second type communication protocol, so that the data receiving end stores the received file to be forwarded in the temporary file;
step S4073, after the file to be forwarded is sent, the data receiving end is notified to modify the unavailable attribute of the temporary file into the available attribute.
For example, if the communication protocol used by the data receiving end is the FTP protocol, the data transmission mode of the data receiving end is passive reception, the data receiving end is notified to establish a temporary file under the designated directory of the FTP service, the file to be forwarded is sent to the temporary file on the FTP service of the data receiving end, and after the file to be forwarded is sent, the file name of the temporary file is renamed to be the real file name.
If the communication protocol used by the data receiving end is the SFTP protocol, the data transmission mode of the data receiving end is passive receiving, the data receiving end is informed to establish a temporary file under the specified directory of the SFTP service, the file to be forwarded is sent to the temporary file on the SFTP service of the data receiving end, and after the file to be forwarded is sent, the file name of the temporary file is renamed to be a real file name.
If the communication protocol used by the data receiving end is the Samba protocol, the data transmission mode of the data receiving end is passive receiving, the data receiving end is informed to establish a temporary file under the specified directory of the Samba service, the file to be forwarded is sent to the temporary file on the Samba service of the data receiving end, and after the file to be forwarded is sent, the file name of the temporary file is renamed to be a real file name.
When the file to be forwarded is directly sent to the data receiving end, the data receiving end is informed to establish a temporary file with unavailable attributes under the appointed directory, after the file to be forwarded is sent, the data receiving end is informed to modify the unavailable attributes of the temporary file into the available attributes, and the file name is renamed to be a real file name. The method can prevent the user from damaging the data in the file by using the file which is not completely transmitted, and ensure the complete transmission of the file.
In an alternative embodiment, as shown in fig. 6, a process of processing second data by the data transmission method according to the embodiment of the present invention includes the following steps:
step S601, determining a data transmission mode of the data transmitting end. If the data transmission mode of the data transmitting end is active transmission, executing step S602; if the data transmission mode of the data transmitting end is passive transmission, step S603 is performed.
Step S602, receiving second data sent by the data sending end through a second type of communication protocol.
Step S603, actively obtain second data from the data sending end through the second type communication protocol.
The second type of communication protocol is FTP protocol, SFTP protocol or Samba protocol, which is mainly used for file transfer, and thus the second data is generally file type data. The data transmission device provided by the embodiment of the invention supports active file acquisition and passive file reception, and can select the active file acquisition from the data transmitting terminal or the passive file reception from the data transmitting terminal according to the data transmission mode of the data transmitting terminal. If the second data is required to be actively acquired from the data transmitting end through the second type of communication protocol, the second data can be actively pulled to the position designated by the data transmitting end.
For the second data obtained through the second type of communication protocol, the user may also configure a file directory, a file filtering rule, a scanning interval, and the like corresponding to the second data. After the second data is acquired, the second data can also be processed according to a policy configured by a user.
For example, the received second data may be saved in a file directory corresponding to the local, so as to play a role of file caching. If the communication link or the one-way optical gate has a fault or the pressure is too high, the file to be forwarded is firstly cached in the local memory, and the file is continuously sent when the communication link or the one-way optical gate is recovered to be normal, so that the data can be prevented from being lost in the transmission process.
Step S604, determining a data transmission mode of the data receiving end. If the data transmission mode of the data receiving end is active acquisition, executing step S605; if the data transmission mode at the data receiving end is passive reception, step S606 is performed.
Step S605, storing the second data to a storage position corresponding to the data receiving end; and when a data pulling request sent by the data receiving end is received, transmitting the second data from the storage position to the data receiving end through the second type communication protocol.
Step S606, directly sending the second data to the data receiving end through the second type communication protocol.
The specific execution process of step S605 may be executed with reference to step S406, and the specific execution process of step S606 may be executed with reference to step S407, which is not described herein again.
In this embodiment, if the data transmission mode used by the data receiving end is active acquisition, the second data is stored in the storage location corresponding to the data receiving end, and the data receiving end actively pulls the second data. And if the data transmission mode used by the data receiving end is passive receiving, directly sending second data to the data receiving end through a second type of communication protocol. Through the two different modes, the second data can be transmitted to the data receiving ends adopting different data transmission modes, and application scenes of the data transmission method provided by the embodiment of the invention are increased.
The data transmission method is based on the same inventive concept, and the embodiment of the invention also provides a data transmission device, because the principle of the device for solving the problems is similar to the data transmission method, the device can be implemented by referring to the method embodiment, and repeated parts are not described again.
As shown in fig. 7, a data transmission apparatus according to an embodiment of the present invention includes a processor 700, a memory 701, a data receiving port 702, and a data transmitting port 703. The processor 700, memory 701, data receiving port 702, and data transmitting port 703 may be connected by a bus 704.
The processor 700 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the data transmission method may be implemented by hardware integrated logic circuits or instructions in the form of software in the processor 700. It should be noted that the processor 700 may also be a plurality of processors, or include a plurality of processor chips, each processor chip executes a part of the steps of the data transmission method, and the plurality of processor chips cooperate with each other to jointly complete the data transmission method.
The memory 701 may be a random access memory, a flash memory, a read only memory, a programmable read only memory, or an electrically erasable programmable memory, etc. The memory 701 is used to store a program implementing the above-described data transmission method and data used by the processor 700 when executing the program.
The data receiving port 702 is used for connecting with a data transmitting end and receiving data or files transmitted by the data transmitting end. The data transmission apparatus may be provided with a plurality of data receiving ports 702, different data receiving ports 702 are connected to different data transmitting terminals, and different data receiving ports 702 may be configured with different communication protocols correspondingly. Therefore, the data transmission device can acquire data transmitted by a plurality of data transmitting ends through different communication protocols, wherein the data comprises first data transmitted through a first type of communication protocol and second data transmitted through a second type of communication protocol.
The data sending port 703 is used for connecting with the data receiving end through a unidirectional optical gate, and sending data or files to the data receiving end through the unidirectional optical gate. Similarly, the data transmission apparatus may be provided with a plurality of data transmission ports 703, and different data transmission ports 703 are connected to different data receiving terminals. For example, one data transmitting port 703 may be correspondingly connected to one data receiving end. Different data sending ports 703 may be connected to their corresponding data receiving terminals through the same one-way optical gate, or may be connected to their corresponding data receiving terminals through different one-way optical gates.
Bus 704 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
The processes disclosed in the embodiments of the present invention may be applied to the processor 700, or implemented by the processor 700. In implementation, the steps of the signal processing flow may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 700. The processor 700 may be a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof that may implement or perform the methods, steps or logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 701, and the processor 700 reads the information in the memory 701, and completes the steps of the signal processing flow in combination with the hardware thereof.
Specifically, the processor 700 is configured to read the program in the memory 701 and execute the following steps:
if first data are acquired from a data transmitting end through a first type of communication protocol, generating a file to be forwarded according to the first data; the first type of communication protocol is a protocol for establishing communication after handshaking between two communication parties is needed;
transmitting the file to be forwarded to a data receiving end through a second type of communication protocol; wherein the second type of communication protocol is different from the first type of communication protocol.
In one possible implementation, the processor 700 is specifically configured to:
and transmitting the file to be forwarded to a data receiving end through a one-way optical gate.
In one possible implementation, the processor 700 is specifically configured to:
writing the first data into an intermediate file;
when the intermediate file meets the end condition set by a preset file generation strategy, stopping writing data into the intermediate file; the termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time;
and compressing the intermediate file according to a compression mode set by the file generation strategy to generate the file to be forwarded.
In one possible implementation, the processor 700 is specifically configured to:
storing the file to be forwarded to a storage position corresponding to the data receiving end; when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the file to be forwarded to the data receiving end through the second type of communication protocol.
In one possible implementation, the processor 700 is specifically configured to:
informing the data receiving end to establish a temporary file with unavailable attribute under the appointed directory;
sending the file to be forwarded to the data receiving end through the second type communication protocol so that the data receiving end stores the received file to be forwarded in the temporary file;
and after the file to be forwarded is sent, informing the data receiving end of modifying the unavailable attribute of the temporary file into the available attribute.
In one possible implementation, the processor 700 may be further configured to:
and if second data are acquired from a data sending end through a second type of communication protocol, transmitting the second data to a corresponding data receiving end through the second type of communication protocol.
In one possible implementation, the processor 700 is specifically configured to:
storing the second data to a storage position corresponding to the data receiving end; when a data pulling request sent by the data receiving end is received, the second data is transmitted to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the second data to the data receiving end through the second type communication protocol.
According to the data transmission device provided by the embodiment of the invention, if the first data is acquired from the data sending end through the first type of communication protocol which requires the two communication parties to perform handshake and then establishes communication, the file to be forwarded is generated according to the first data, and then the file to be forwarded is transmitted to the data receiving end through the second type of communication protocol which does not require the two communication parties to perform handshake, so that the data transmission from the data sending end to the data receiving end is automatically completed, the condition of manually assisting in data transmission is reduced, and the workload of network maintenance personnel is reduced.
The data transmission method is based on the same inventive concept, and the embodiment of the invention also provides a data transmission device, because the principle of the device for solving the problems is similar to the data transmission method, the device can be implemented by referring to the method embodiment, and repeated parts are not described again.
In an alternative embodiment, as shown in fig. 8, a data transmission apparatus provided in an embodiment of the present invention includes the following modules:
the file generation module 81 is configured to generate a file to be forwarded according to first data if the first data is acquired from a data transmitting end through a first type of communication protocol; the first type of communication protocol is a protocol for establishing communication after handshaking between two communication parties is needed;
the file forwarding module 82 is configured to transmit the file to be forwarded to a data receiving end through a second type of communication protocol; wherein the second type of communication protocol is different from the first type of communication protocol.
In a possible implementation manner, the file forwarding module 82 may further be configured to:
and transmitting the file to be forwarded to a data receiving end through a one-way optical gate.
In a possible implementation manner, the file generating module 81 may be further configured to:
writing the first data into an intermediate file;
when the intermediate file meets the end condition set by a preset file generation strategy, stopping writing data into the intermediate file; the termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time;
and compressing the intermediate file according to a compression mode set by the file generation strategy to generate the file to be forwarded.
In a possible implementation manner, the file forwarding module 82 may further be configured to:
storing the file to be forwarded to a storage position corresponding to the data receiving end; when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the file to be forwarded to the data receiving end through the second type of communication protocol.
In a possible implementation manner, the file forwarding module 82 may further be configured to:
informing the data receiving end to establish a temporary file with unavailable attribute under the appointed directory;
sending the file to be forwarded to the data receiving end through the second type communication protocol so that the data receiving end stores the received file to be forwarded in the temporary file;
and after the file to be forwarded is sent, informing the data receiving end of modifying the unavailable attribute of the temporary file into the available attribute.
In a possible implementation manner, the file forwarding module 82 may further be configured to:
and if second data are acquired from a data sending end through a second type of communication protocol, transmitting the second data to a corresponding data receiving end through the second type of communication protocol.
In a possible implementation manner, the file forwarding module 82 may further be configured to:
storing the second data to a storage position corresponding to the data receiving end; when a data pulling request sent by the data receiving end is received, the second data is transmitted to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the second data to the data receiving end through the second type communication protocol.
In another alternative embodiment, as shown in fig. 9, a data transmission apparatus provided in the embodiment of the present invention includes a data receiving module 901, a file generating module 902, and a file forwarding module 903. Optionally, the data transmission apparatus may further comprise a policy management module 904.
The policy management module 904 is responsible for managing a file generation policy, or a data drop policy, and is responsible for scheduling the file generation module 902 and the file forwarding module 903. For data transmitted by a TCP protocol or a UDP protocol, a user may configure the size of a single file, the number of data pieces contained in the file, a delimiter of the data, a timeout time or a compression mode for automatically ending the file when the data is received. For data transferred by FTP protocol, SFTP protocol or SAMBA protocol, the user can configure the file directory, file filtering rules and scanning intervals. The policy management module 904 also enables a user to configure multiple policies and select whether to enable a policy.
The data receiving module 901 is used to obtain data or files from a data sending end. The data transmission apparatus may include a plurality of data receiving modules 901, configured to receive data or files sent by different data sending terminals through different ports. For example, the data transmission apparatus may be provided with a data receiving module 901 corresponding to a data receiving port, where the first partial data receiving module is configured to receive data or a file sent by a data sending end through a TCP protocol or a UCP protocol, and for data reception of the TCP/UDP protocol, the first partial data receiving module monitors a specified port and may configure a TLS/SSL encryption transmission mode. The second part data receiving module is used for receiving data or files sent by the data sending end through the FTP protocol, the SFTP protocol or the Samba protocol. For receiving the FTP protocol, the SFTP protocol and the Samba protocol files, the second part of data receiving module can select to start corresponding service to passively receive the files or use a client to actively acquire the files according to the requirements.
The first partial data receiving module is connected to the file generating module 902, and a plurality of file generating modules 902 may be provided with the first partial data receiving module. Each file generation module 902 is connected with the policy management module 904, and according to a file generation policy configured by a user, the file generation module 902 writes received data into a temporary file, and when the size of the file reaches a specified size, the number of data contained in the file reaches the maximum value of the policy configuration, or no new data is accessed within a specified timeout, the file is automatically ended, then the file is renamed according to a naming template, the file is compressed according to the compression mode of the policy configuration, and finally the file to be forwarded in a corresponding compression format is generated and is placed into a specified storage address. The file forwarding module 903 may send the file to be forwarded, which is generated by the file generating module 902, to the data receiving end. The file forwarding module 903 supports the transmission and acquisition of FTP, SFTP, and SAMBA protocols, supports the active transmission of files to the unidirectional shutter, and supports the shutter to actively pull files. When the file is sent to FTP/SFTP or Samba service, the file is sent to a temporary file first, and then the temporary file is renamed to a real file name after the file is sent, so that the opposite side can not acquire the incomplete file.
The second partial data receiving module can be a client corresponding to the FTP protocol, the SFTP protocol or the Samba protocol. The second part of data receiving module supports two modes of active sending and passive sending of a data sending end when receiving files transmitted by FTP protocol, SFTP protocol or Samba protocol. And if the data sending end actively sends the file to the data transmission device, the corresponding client of the data transmission device is responsible for receiving the file. If the data transmitting terminal is an FTP, SFTP, or Samba server terminal, and provides the file but does not actively transmit the file, the client corresponding to the data transmission device of the embodiment of the present invention may actively go to the data transmitting terminal to obtain the file, and may configure the account, the data directory, the file filtering rule, the file scanning period, and the like. The data received by the second part of data receiving module can be directly transmitted to the data receiving end through the file forwarding module 903.
For data acquisition, the data transmission device in the embodiment of the invention can select and use corresponding client processing according to the protocol used by the data sending end, and supports two modes of active sending and passive sending of the data sending end. For example, the data sending end uses an FTP service, and a passive sending mode is adopted, then the data transmission apparatus in the embodiment of the present invention may start an FTP client process to actively get the file from the data sending end. For data transmission, the data transmission device according to the embodiment of the present invention may also support three protocols, STP, SFTP, and Samba. For example, if the data receiving end is an active optical shutter using the FTP protocol, the data transmission apparatus according to the embodiment of the present invention will put the file in the position specified by the FTP service according to the file generation policy to wait for the active acquisition by the data receiving end.
Each module of the data transmission device has an automatic pull-up mechanism, that is, when a certain module fails to work abnormally, the data transmission device can automatically pull up the module. The data receiving module 901 and the file forwarding module 903 support the simultaneous deployment of multiple modules, that is, the receiving of data from different ports and the sending to different destinations are completed simultaneously.
Compared with the prior art, the data transmission device provided by the embodiment of the invention has the following advantages: the method has the advantages that firstly, the transmission of multiple protocol data such as TCP, UDP, FTP, SFTP and Samba is supported, a user configuration file generation strategy is supported, the strategy supports multiple options such as file size, number of data contained in a file, compression mode and the like, greater flexibility is provided, and the method is suitable for more scenes; secondly, supporting the configuration of a plurality of data receiving modules and file forwarding modules, and completing different types of data communication tasks at the same time; thirdly, an automatic pull-up mechanism is provided, and the device can be timely recovered when abnormality occurs; fourthly, the method can play a role of data caching due to the fact that a step of local storage is added before file transmission. When the unidirectional optical shutter fails or the pressure is too high, the data can be cached in a local file, and the data can be continuously sent when the unidirectional optical shutter is recovered to be normal, so that the data is prevented from being lost in the transmission process; fifthly, a TLS/SSL encryption transmission mode is supported, and the data security is further enhanced; sixth, besides supporting TCP protocol communication, other communication protocols that require data receiving end feedback like TCP protocol can also use the present apparatus to complete communication.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method of data transmission, comprising:
if first data are acquired from a data transmitting end through a first type of communication protocol, generating a file to be forwarded according to the first data; the first type of communication protocol is a protocol for establishing communication after handshaking between two communication parties is needed;
determining a data transmission mode of a data receiving end;
if the data transmission mode is active acquisition, storing the file to be forwarded to a storage position corresponding to the data receiving end; when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position through a second type communication protocol;
if the data transmission mode is passive receiving, the data receiving end is informed to establish a temporary file with an unavailable attribute under a specified directory; sending the file to be forwarded to the data receiving end through a second type communication protocol so that the data receiving end stores the received file to be forwarded in the temporary file; after the file to be forwarded is sent, informing the data receiving end to modify the unavailable attribute of the temporary file into an available attribute;
wherein the second type of communication protocol is different from the first type of communication protocol.
2. The method according to claim 1, wherein the step of transmitting the file to be forwarded from the storage location to the data receiving end comprises:
transmitting the file to be forwarded from the storage position to the data receiving end through a one-way optical gate;
the step of directly sending the file to be forwarded to the data receiving end comprises the following steps:
and directly transmitting the file to be forwarded to the data receiving end through a unidirectional optical gate.
3. The method of claim 1, wherein the generating a file to be forwarded according to the first data comprises:
writing the first data into an intermediate file;
when the intermediate file meets the end condition set by a preset file generation strategy, stopping writing data into the intermediate file; the termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time;
and compressing the intermediate file according to a compression mode set by the file generation strategy to generate the file to be forwarded.
4. The method of claim 1, further comprising:
and if second data are acquired from a data sending end through a second type of communication protocol, transmitting the second data to a corresponding data receiving end through the second type of communication protocol.
5. The method according to claim 4, wherein said transmitting the second data to the corresponding data receiving end through the second type communication protocol comprises:
storing the second data to a storage position corresponding to the data receiving end; when a data pulling request sent by the data receiving end is received, the second data is transmitted to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the second data to the data receiving end through the second type communication protocol.
6. A data transmission apparatus, comprising:
the file generation module is used for generating a file to be forwarded according to first data if the first data is acquired from a data transmitting end through a first type of communication protocol; the first type of communication protocol is a protocol for establishing communication after handshaking between two communication parties is needed;
the file forwarding module is used for determining a data transmission mode of a data receiving end; if the data transmission mode is active acquisition, storing the file to be forwarded to a storage position corresponding to the data receiving end; when a file pulling request sent by the data receiving end is received, transmitting the file to be forwarded to the data receiving end from the storage position through a second type communication protocol; if the data transmission mode is passive receiving, the data receiving end is informed to establish a temporary file with an unavailable attribute under a specified directory; sending the file to be forwarded to the data receiving end through a second type communication protocol so that the data receiving end stores the received file to be forwarded in the temporary file; after the file to be forwarded is sent, informing the data receiving end to modify the unavailable attribute of the temporary file into an available attribute; wherein the second type of communication protocol is different from the first type of communication protocol.
7. The apparatus of claim 6, wherein the file generation module is further configured to:
writing the first data into an intermediate file;
when the intermediate file meets the end condition set by a preset file generation strategy, stopping writing data into the intermediate file; the termination condition includes at least one of: the intermediate file reaches a specified size, the number of data in the intermediate file reaches a specified number, and the receiving interruption time of the first data exceeds a specified time;
and compressing the intermediate file according to a compression mode set by the file generation strategy to generate the file to be forwarded.
8. The apparatus of claim 6, wherein the file forwarding module is further configured to:
and if second data are acquired from a data sending end through a second type of communication protocol, transmitting the second data to a corresponding data receiving end through the second type of communication protocol.
9. The apparatus of claim 8, wherein the file forwarding module is further configured to:
storing the second data to a storage position corresponding to the data receiving end; when a data pulling request sent by the data receiving end is received, the second data is transmitted to the data receiving end from the storage position through the second type communication protocol; or
And directly sending the second data to the data receiving end through the second type communication protocol.
10. A data transmission apparatus comprising a memory and at least one processor, the memory having stored thereon a computer program operable on the processor to, when executed by the at least one processor, implement the method of any one of claims 1 to 5.
CN201910541438.3A 2019-06-21 2019-06-21 Data transmission method and device Active CN110233851B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910541438.3A CN110233851B (en) 2019-06-21 2019-06-21 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910541438.3A CN110233851B (en) 2019-06-21 2019-06-21 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN110233851A CN110233851A (en) 2019-09-13
CN110233851B true CN110233851B (en) 2022-03-22

Family

ID=67857001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910541438.3A Active CN110233851B (en) 2019-06-21 2019-06-21 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN110233851B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202780B (en) * 2020-09-30 2022-10-11 深圳市元征科技股份有限公司 Data transmission method, device, equipment and medium based on double sockets
CN113542129B (en) * 2021-07-15 2023-01-24 无锡思朗电子科技有限公司 Single transmission method using signal linked list
CN113783939A (en) * 2021-08-20 2021-12-10 奇安信科技集团股份有限公司 File transmission method and device, electronic equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6434620B1 (en) * 1998-08-27 2002-08-13 Alacritech, Inc. TCP/IP offload network interface device
CN101127761A (en) * 2006-08-16 2008-02-20 北京城市学院 Unidirectional protocol isolation method and device in network
CN101589386B (en) * 2006-12-04 2013-03-27 桑迪士克Il有限公司 Incremental transparent file updating
CN102841827B (en) * 2012-06-28 2015-04-08 宇龙计算机通信科技(深圳)有限公司 Method for backuping database files and communication terminal
CN103491072B (en) * 2013-09-06 2017-03-15 中国航天系统科学与工程研究院 A kind of border access control method based on double unidirection insulation network brakes
US20150278545A1 (en) * 2014-03-28 2015-10-01 Aruba Networks, Inc. Anonymization of client data
CN107528718B (en) * 2016-08-16 2020-03-03 腾讯科技(深圳)有限公司 Method, device and system for acquiring resources
CN106686005A (en) * 2017-03-01 2017-05-17 北京博众益友科技有限公司 Safety protection system and safety protection method for industrial control system
CN109151763A (en) * 2018-10-22 2019-01-04 珠海格力电器股份有限公司 Wireless data transmission method, radio transmitting device and air-conditioning system

Also Published As

Publication number Publication date
CN110233851A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN110233851B (en) Data transmission method and device
CN110572460B (en) Data transmission method and device based on block chain system and computer equipment
CN107360154B (en) Intranet secure access method and system
CN111064755B (en) Data protection method and device, computer equipment and storage medium
US9998299B2 (en) Efficient transport of encapsulated media traffic over restrictive networks
CN111935017B (en) Cross-network application calling method and device and routing equipment
CN111064742B (en) Method, device and related equipment for realizing intranet access based on network agent
CN112437153A (en) Equipment linkage processing method and device
US20100306384A1 (en) Multi-directional secure common data transport system
CN116048538A (en) Service grid deployment method and device for DPU
WO2024067757A1 (en) Cross-terminal-communication device management method, system and apparatus based on bus, and medium
CN110995829B (en) Instance calling method and device and computer storage medium
CN103607324B (en) Data processing method for Java message service, Java message client and server
CN107819597B (en) Network data transmission method and front-end processor
CN116192863A (en) Micro-service flow processing method, DPU service grid deployment method and system
Almheiri et al. IoT Protocols–MQTT versus CoAP
CN113992740B (en) Middleware based on autonomous control and data transmission method
US20140177575A1 (en) Method for establishing an application session, device and corresponding notification
WO2023056713A1 (en) Cloud platform binding method and system for internet of things card, and device and medium
KR20190113200A (en) Message server and message processing apparatus including the same
CN102325187A (en) System and method for integrating multiple function services
US8140888B1 (en) High availability network processing system
US20210306442A1 (en) Adding or removing members from confederate rings
EP2739010B1 (en) Method for improving reliability of distributed computer systems based on service-oriented architecture
WO2016206381A1 (en) File processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100089 Beijing city Haidian District Road No. 4 North wa Yitai three storey building

Applicant after: NSFOCUS Technologies Group Co.,Ltd.

Applicant after: NSFOCUS TECHNOLOGIES Inc.

Address before: 100089 Beijing city Haidian District Road No. 4 North wa Yitai three storey building

Applicant before: NSFOCUS INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: NSFOCUS TECHNOLOGIES Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant