A file transfer method and system
After encrypting and compressing the file, the pseudo-random sequence is sent out in an out-of-order manner, the problem of low reliability and security in file transfer is solved, and efficient file transfer is achieved.
Patent Information
- Application Number
- CN202211647276.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-12-21
AI Technical Summary
Existing file transfer protocols are prone to blocking and packet loss in file header packets during cross-Internet transmission, resulting in low reliability and security.
The preset encryption protocol is used to encrypt and compress the transferred files, and the file fragments are numbered and sent out indiscriminately through pseudo-random sequences. The receiver recovers the files according to the pseudo-random sequence and decrypts them, and uses reliable and unreliable transmission channels to ensure file integrity.
Improves the reliability and security of file transfers, reduces network bandwidth usage, and prevents listeners from restoring original files.
Smart Images

Figure CN115913773B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and more specifically, to a file transfer method and system. Background Art
[0002] Currently, file transfer is mainly carried out through the File Transfer Protocol (FTP) and the Trivial File Transfer Protocol (TFTP). The FTP protocol itself is based on the Transmission Control Protocol (TCP). The TCP protocol is a reliable connection. When transmitting data through the TCP protocol, there are no errors, no loss, no duplication, and it arrives in order.
[0003] Due to the development of Internet technology, more and more data is transmitted over the Internet. The bank data center is set up as multiple locations and multiple centers, and the need for data synchronization between them is increasing. When the cross-Internet communication time delay causes packet blocking in the file header during TCP file transfer, the entire file cannot be normally transmitted, resulting in low reliability of file transfer.
[0004] The TFTP protocol is implemented based on the User Datagram Protocol (UDP). However, the UDP protocol itself is an unreliable transmission protocol. Once a packet loss error occurs, the transmission will be interrupted, resulting in low reliability of file transfer.
[0005] How to ensure the reliability of files during transmission is an urgent problem to be solved in this application. Summary of the Invention
[0006] In view of this, this application discloses a file transfer method and system, aiming to improve the reliability and security during file transfer.
[0007] To achieve the above object, the disclosed technical solution is as follows:
[0008] The first aspect of this application discloses a file transfer method. The method is applied to the sending end and includes:
[0009] Encrypt the obtained file to be transmitted through a preset encryption protocol;
[0010] Compress the encrypted file to be transmitted according to a preset encryption and compression algorithm to obtain a compressed transmission file;
[0011] Slice the compressed transmission file to obtain file fragments;
[0012] Number the file segments in the order of the pseudo-random sequence, and reorder the numbered file segments to obtain the target transmission file;
[0013] Send the target transmission file to the receiving end through a preset sending method, so that the receiving end restores the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence, and decrypts the compressed and encrypted file; the preset sending method is a disordered sending method for encrypted transmission.
[0014] Preferably, encrypting the file to be transmitted obtained through a preset encryption protocol includes:
[0015] Create a reliable transmission channel; the reliable transmission channel is used for transmitting files for encrypted transmission;
[0016] Encrypt the file to be transmitted obtained through the reliable transmission channel and the preset encryption protocol.
[0017] Preferably, it further includes:
[0018] If a packet loss of the target transmission file is detected, adjust the sending sliding window parameter according to the flow control algorithm; the flow control algorithm is an algorithm for controlling the retransmission of the transmission file after packet loss;
[0019] Resend the target transmission file to the receiving end through the sending sliding window parameter, so that the receiving end restores the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence, and decrypts the compressed and encrypted file.
[0020] Preferably, it further includes:
[0021] When batch-sending multiple target transmission files to the receiving end, correspond the file names and file IDs of the multiple target transmission files.
[0022] Preferably, it further includes:
[0023] Create an unreliable transmission channel; the unreliable transmission channel is used to verify and limit the receiving end to receive data from a legal source IP and a legal source port.
[0024] A second aspect of the present application discloses a file transmission method, which is applied to the receiving end, and the method includes:
[0025] Receive the target transmission file sent by the sending end; the target transmission file is obtained by numbering the file segments in the order of the pseudo-random sequence and reordering the numbered file segments; the file segments are obtained by slicing the compressed transmission file; the compressed transmission file is obtained by compressing the encrypted file to be transmitted according to a preset compression algorithm.
[0026] Restore the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence, and decrypt the compressed and encrypted file.
[0027] Preferably, it further includes:
[0028] Analyze the target transmission file to obtain an analysis result;
[0029] When the analysis result indicates the lack of file shard numbers, send a confirmation message to the sending end so that the sending end resends the target transmission file.
[0030] The third aspect of the present application discloses a file transmission system, which is applied to the sending end. The system includes:
[0031] An encryption unit, configured to encrypt the obtained file to be transmitted through a preset encryption protocol;
[0032] A compression unit, configured to compress the encrypted file to be transmitted according to a preset encryption and compression algorithm to obtain a compressed transmission file;
[0033] A file slicing unit, configured to slice the compressed transmission file to obtain file segments;
[0034] A numbering and compression unit, configured to number the file segments in the order of the pseudo-random sequence, and reorder the numbered file slices to obtain a target transmission file;
[0035] A first sending unit, configured to send the target transmission file to the receiving end through a preset sending method, so that the receiving end restores the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence, and decrypts the compressed and encrypted file; the preset sending method is a disordered sending method for encrypted transmission.
[0036] Preferably, the encryption unit includes:
[0037] A creation module, configured to create a reliable transmission channel; the reliable transmission channel is used for transmitting encrypted transmission files;
[0038] An encryption module, configured to encrypt the obtained file to be transmitted through the reliable transmission channel and a preset encryption protocol.
[0039] The fourth aspect of the present application discloses a file transmission system, which is applied to the receiving end. The system includes:
[0040] A receiving unit, configured to receive a target transmission file sent by a sending end; the target transmission file is obtained by sequentially numbering file segments through a pseudo-random sequence and reordering the numbered file segments; the file segments are obtained by slicing a compressed transmission file; the compressed transmission file is obtained by compressing an encrypted file to be transmitted according to a preset compression algorithm.
[0041] A decryption unit, configured to restore the target transmission file into a compressed and encrypted file according to the pseudo-random sequence order and decrypt the compressed and encrypted file.
[0042] As can be seen from the above technical solutions, the present application discloses a file transmission method and system. By means of a preset encryption protocol, the obtained file to be transmitted is encrypted, and according to a preset encryption and compression algorithm, the encrypted file to be transmitted is compressed to obtain a compressed transmission file. The compressed transmission file is sliced to obtain file segments, and the file segments are numbered through a pseudo-random sequence to obtain a target transmission file. The target transmission file is sent to a receiving end through a preset sending method, so that the receiving end restores the target transmission file into a compressed and encrypted file according to the pseudo-random sequence order and decrypts the compressed and encrypted file. The preset sending method is a disordered sending method for encrypted transmission. Through the above, there is no need to use the TCP protocol to transmit files. Only through the application layer protocols of the sending end and the receiving end, the encrypted file to be transmitted is compressed and then the numbered file segments are sent, reducing the network bandwidth occupation and improving the reliability of file transmission. In addition, through the preset sending method that plays an encrypted transmission role, even if a listener obtains the message, it is impossible to splice and restore the original file according to the sequence number, improving the security of file transmission. Description of the Drawings
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application 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 only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.
[0044] Figure 1 It is a schematic flowchart of a file transmission method disclosed in an embodiment of the present application;
[0045] Figure 2 It is a schematic diagram of the encryption principle of a pseudo-random sequence disclosed in an embodiment of the present application;
[0046] Figure 3 It is a schematic flowchart of another file transmission method disclosed in an embodiment of the present application;
[0047] Figure 4 Schematic structural diagram of a file transfer system disclosed in an embodiment of the present application;
[0048] Figure 5 Schematic structural diagram of another file transfer system disclosed in an embodiment of the present application;
[0049] Figure 6 Schematic structural diagram of an electronic device disclosed in an embodiment of the present application. Detailed implementation manners
[0050] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0051] In the present application, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, elements defined by the statement "including one..." do not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0052] As can be seen from the background technology, due to the development of Internet technology, when the message in the file header is blocked due to the time delay of cross-Internet communication during TCP file transfer, the entire file cannot be normally transferred, resulting in low reliability of file transfer. The TFTP protocol is implemented based on the User Datagram Protocol (UDP) protocol, but the UDP protocol itself is an unreliable transport protocol. Once a packet loss error occurs, the transmission will be interrupted, resulting in low reliability of file transfer. How to ensure the reliability of the file during the transmission process is an urgent problem to be solved in the present application.
[0053] To solve the above problems, the present application discloses a file transfer method and system, which does not need to use the TCP protocol to transfer files. Only through the application layer protocols of the sending end and the receiving end, the encrypted file to be transferred is compressed and then the target transfer file is sent, reducing the network bandwidth occupation and improving the reliability of file transfer. In addition, through a preset sending method that plays an encryption transmission role, even if the listener gets the message, they cannot splice and restore the original file according to the sequence number, improving the security of file transfer. The specific implementation manner will be described through the following embodiments.
[0054] Refer to Figure 1As shown in the figure, it is a schematic flowchart of a file transmission method disclosed in an embodiment of the present application. This file transmission method is applied to the sending end and mainly includes the following steps:
[0055] S101: Encrypt the obtained file to be transmitted through a preset encryption protocol.
[0056] In S101, a reliable transmission channel is created, and the key information of the obtained file to be transmitted is encrypted and transmitted through the reliable transmission channel and the preset encryption protocol.
[0057] Among them, the key information includes the file name path, compression and encryption algorithm and password, pseudo-random sequence used for transmission, etc.
[0058] The reliable transmission channel is used to transmit the encrypted file.
[0059] The preset encryption protocol can be a protocol encrypted by the low-latency Internet transport layer protocol (Quick UDP Internet Connection, QUIC) based on UDP plus the Transport Layer Security (TLS) protocol, or other encryption protocols. The specific determination of the preset encryption protocol is set by technicians according to the actual situation, and the present application does not make specific limitations. The preset encryption protocol of the present application preferably uses QUIC plus TLS.
[0060] The reliable transmission channel uses the encryption method of the QUIC protocol plus the TLS protocol to transmit the information that needs to be encrypted and transmitted. The reliable transmission channel includes but is not limited to using the QUIC protocol, HTTP3 protocol, etc. for transmission.
[0061] The reliable transmission channel can also be offline. The reliable transmission channel agrees on the preset encryption protocol, preset compression algorithm, pseudo-random sequence generation, sorting algorithm, and flow control algorithm between the client and the server.
[0062] The information interaction of the QUIC part can also be completed in other ways. For example, the pseudo-random code, compression algorithm, and flow control algorithm are negotiated offline.
[0063] Since the client and the server have agreed to use the QUIC protocol to encrypt and transmit the key information of the file, only the receiving end can restore the file. Others cannot obtain the file shard information by capturing shard data information through methods such as packet capture, so they cannot splice and restore the file.
[0064] The preset compression algorithm can use a general compression algorithm or a custom compression algorithm. Compression can improve the transmission efficiency. At the same time, the message is not sent in plain text, which plays an encryption role.
[0065] The pseudo-random sequence can be a unique pseudo-random sequence, or multiple pseudo-random sequences can be used alternately according to an agreement.
[0066] The sorting algorithm is an algorithm that uses a pseudo-random sequence to re-sort and send the compressed file.
[0067] The flow control algorithm is an algorithm that controls retransmission after packet loss. The flow control algorithm can halve the size of the packet loss sliding window, or adjust the size of the sliding window according to the packet loss ratio algorithm, etc.
[0068] S102: Compress the encrypted file to be transmitted according to a preset encryption and compression algorithm to obtain a compressed transmission file.
[0069] Among them, the preset encryption and compression algorithm can use a general compression algorithm or a custom compression algorithm. The determination of the specific preset compression algorithm is set by the technical personnel according to the actual situation, and this application does not make specific limitations.
[0070] S103: Slice the compressed transmission file to obtain file segments.
[0071] To facilitate the understanding of the process of slicing the compressed transmission file to obtain file segments, an example is given here:
[0072] For example, after a file is compressed and sliced into 10 pieces, the pseudo-random sequence is 7986312540. When sending, instead of sending the 0th piece first, the 7th piece is sent first, and the data packet ID is still 0. When the receiver receives the data with ID 0, the data is written to the position of the 7th piece; during the sending process, some tampered file slices can be selected to increase the difficulty of splicing the file. If the file slice is larger than the length of the pseudo-random sequence, the pseudo-random sequence can be used cyclically. For the specific process of increasing the difficulty of splicing the file, reference can be made to Figure 2 as shown, Figure 2 shows a schematic diagram of the encryption principle of the random sequence, Figure 2 which is only an example.
[0073] Figure 2In this case, after a file is compressed, it is sliced into 10 pieces. The pseudo-random sequence is 7986312540. After the sender and the receiver establish a connection, when the sender sends the file to the receiver, it first sends the 7th piece. The data packet ID is 0. When the receiver receives the data with ID 0, it writes the data to the position of the 7th piece. Next, it sends the 9th piece. The ID of the data packet is 1. When the receiver receives the data with ID 1, it writes the data to the position of the 9th piece. Next, it sends the 8th piece. The ID of the data packet is 2. When the receiver receives the data with ID 2, it writes the data to the position of the 8th piece. Next, it sends the 6th piece. The ID of the data packet is 3. When the receiver receives the data with ID 3, it writes the data to the position of the 6th piece. Next, it sends the 3rd piece. The ID of the data packet is 4. When the receiver receives the data with ID 4, it writes the data to the position of the 3rd piece. Next, it sends the 1st piece. The ID of the data packet is 5. When the receiver receives the data with ID 5, it writes the data to the position of the 1st piece. Next, it sends the 2nd piece. The ID of the data packet is 6. When the receiver receives the data with ID 6, it writes the data to the position of the 2nd piece. Next, it sends the 5th piece. The ID of the data packet is 7. When the receiver receives the data with ID 7, it writes the data to the position of the 5th piece. Next, it sends the 4th piece. The ID of the data packet is 8. When the receiver receives the data with ID 8, it writes the data to the position of the 4th piece. Next, it sends the 0th piece. The ID of the data packet is 9. When the receiver receives the data with ID 9, it writes the data to the position of the 0th piece. If redundant packets (ID = 10) are added, then the number of packets sent is more than the file slices. It is necessary to agree in advance which packets are redundant so that they can be directly discarded when received by the receiver.
[0074] Figure 2 In this case, the client requests the server to receive a file. Port(7788) refers to the UDP port of the client; Port(69) refers to the listening port of the server for establishing a file transfer connection; the temporary Port(12345) refers to the temporary data transfer port used by the server to send data to the client; Ack refers to the confirmation packet returned by the client after receiving multiple file fragments. When no data is received within the preset time and the file transfer has not ended, Ack can be a timed Keep Alive packet. Among them, the determination of the preset time is set by the technical personnel according to the actual situation, and this application does not make specific limitations.
[0075] For example, if the file is sliced into 20 pieces, the correspondence between the sending order and the file slicing order is shown in Table 1.
[0076]
[0077] Table 1
[0078] Among them, if redundant packets are added, more packets are sent than the file slices. It is necessary to agree in advance which packets are redundant so that they can be directly discarded when received.
[0079] S104: Number the file segments according to the pseudo-random sequence order, and reorder the numbered file slices to obtain the target transmission file.
[0080] Among them, the numbered file segments are reordered in a disordered manner.
[0081] S105: Send the target transmission file to the receiving end through a preset sending method, so that the receiving end restores the target transmission file into a compressed and encrypted file according to the pseudo-random sequence order, and decrypts the compressed and encrypted file; the preset sending method is a disordered sending method for encrypted transmission.
[0082] Among them, the preset sending method is the UDP disordered sending method. Using the UDP disordered sending method for sending can ensure data encryption during the transmission of the compressed file without reducing the sending speed, and improve the security of file transmission.
[0083] When sending the target transmission file to the receiving end, it is not sent in order, but in accordance with the sequence number. Although the sending order is in accordance with the order of the sequence numbers, the packet IDs are still in order.
[0084] During the process of sending the target transmission file to the receiving end, first compress the file to be transmitted according to the pre-negotiated compression protocol. Then, slice the file into multiple slices, send one slice each time, and number each slice with a pre-negotiated sequence. When sending the target transmission file, it is not sent in order, but in accordance with the sequence number. Although the sending order is in accordance with the order of the sequence numbers, the packet IDs are still in order. The process of sending the target transmission file can refer to the above Figure 2 description, which will not be elaborated here.
[0085] If it is detected that a packet of the target transmission file is lost, adjust the sending sliding window parameter according to the flow control algorithm; the flow control algorithm is an algorithm for controlling the retransmission of the transmission file after a packet is lost.
[0086] Among them, during the process of sending the target transmission file to the receiving end, adjust the size of the sending sliding window parameter according to the pre-negotiated flow control algorithm. The process of adjusting the size of the sending sliding window parameter can be one frame of data within the sliding window or multiple frames of data within the sliding window. In the case of good network (no packet loss), the sliding window can be increased, send one window and verify one window. When there is packet loss in the network, one frame can be sent and one frame can be verified. When the number of lost packets within one window is greater than the preset number of lost packets, only the lost packet data needs to be retransmitted. In an extreme case, if no data is received, the receiving end needs to send Keep Alive packets to the sending end regularly to request retransmission of data.
[0087] The preset number of lost packets is set by technical personnel according to the actual situation, and this application does not make specific limitations.
[0088] By sending sliding window parameters, the target transfer file is resent to the receiving end so that the receiving end can perform pseudo-random sequence sorting recovery operation and decompression operation on the target transfer file.
[0089] When batch-sending multiple target transfer files to the receiving end, the file names and file IDs of the multiple target transfer files are corresponding.
[0090] Among them, when batch-sending files, the file name needs to be corresponding to the file ID. The sender notifies the receiving end to start receiving the file corresponding to a certain file ID, and the receiving end will create a file with the specified name under the specified file path according to the agreement.
[0091] Create an unreliable transmission channel; the unreliable transmission channel is used to verify and limit the data received by the receiving end from a legal source IP and a legal source port.
[0092] Among them, the unreliable transmission channel is the UDP channel unreliable transmission channel.
[0093] Establish a UDP channel unreliable transmission channel. By periodically sending heartbeat packets Keep Alive, keep the channel unobstructed. If the channel is disconnected, re-establish the channel and negotiate the communication quadruple.
[0094] The communication quadruple refers to the source IP, source port, destination IP, and destination port. For the UDP protocol, because it is an unreliable connection, only the destination IP and destination port are required, and any source can continuously send data to the destination server. To prevent the destination server from receiving data from an illegal source, the receiving end can verify and limit the data received only from a legal source IP and source port.
[0095] This solution can dynamically adjust the sending frequency according to the sending success rate of the target transfer file. In the case of unstable bandwidth, it can limit the speed. In the case of sufficient bandwidth, it can increase the sending speed and make full use of the bandwidth.
[0096] In the embodiments of this application, there is no need to use the TCP protocol to transfer files. Only through the application layer protocols of the sending end and the receiving end, the encrypted file to be transferred is compressed and then the target transfer file is sent, reducing the network bandwidth occupancy and improving the reliability of file transfer. In addition, through the preset sending method that plays an encryption transmission role, even if the listener gets the packet, it is impossible to splice and restore the original file according to the sequence number, improving the security of file transfer.
[0097] Reference Figure 3As shown in the figure, another file transfer method disclosed in the embodiment of the present application is applied to the receiving end. The file transfer method mainly includes the following steps:
[0098] S301: The receiving end receives the target transfer file sent by the sending end; the target transfer file numbers the file fragments in sequence through a pseudo-random sequence and reorders the numbered file fragments; the file fragments are obtained by slicing the compressed transfer file; the compressed transfer file is obtained by compressing the encrypted file to be transferred according to a preset compression algorithm.
[0099] S302: The receiving end restores the target transfer file into a compressed and encrypted file in the order of the pseudo-random sequence and decrypts the compressed and encrypted file.
[0100] Among them, the data received by the receiving end is restored and decompressed through the sorting of the pseudo-random sequence.
[0101] To facilitate the understanding of the process of restoring and decompressing the target transfer file through pseudo-random sequence sorting, an example is given here for illustration:
[0102] For example, after a transfer file is compressed, it is sliced into 10 pieces, and the pseudo-random sequence is 7986312540. When sending, instead of sending the first piece first, the 7th piece is sent first, and the data packet ID is still 0. When the receiving end receives the data with ID 0, it writes the data to the position of the 7th piece.
[0103] Analyze the target transfer file to obtain an analysis result.
[0104] When the analysis result indicates that the file fragment number is missing, a confirmation message is sent to the sending end so that the sending end resends the target transfer file.
[0105] After the sending end finishes sending the template transfer file, the receiving end analyzes the template transfer file and returns the missing file fragment numbers to the sending end through a confirmation message, requesting the sending end to resend the target transfer file without missing file fragment numbers.
[0106] The confirmation message can also play the function of adjusting the number of batch sending messages and play a role in flow control.
[0107] In the embodiment of the present application, there is no need to use the TCP protocol to transfer files. Only through the application layer protocols of the sending end and the receiving end, the encrypted file to be transferred is compressed and then the target transfer file is sent, reducing the network bandwidth occupation and improving the reliability of file transfer. In addition, through the preset sending method that plays an encryption transmission role, even if the listener gets the message, they cannot splice and restore the original file according to the sequence number, improving the security of file transfer.
[0108] Based on the above embodimentFigure 1 A disclosed file transfer method, and an embodiment of the present application also correspondingly discloses a file transfer system. As Figure 4 shown, this file transfer system is applied to a sending end, and the file transfer system includes an encryption unit 401, a compression unit 402, a file slicing unit 403, a numbering compression unit 404, and a first sending unit 405.
[0109] The encryption unit 401 is configured to encrypt the obtained file to be transferred through a preset encryption protocol;
[0110] The compression unit 402 is configured to compress the encrypted file to be transferred according to a preset encryption compression algorithm to obtain a compressed transfer file;
[0111] The file slicing unit 403 is configured to slice the compressed transfer file to obtain file segments;
[0112] The numbering compression unit 404 is configured to number the file segments in the order of a pseudo-random sequence, and reorder the numbered file slices to obtain a target transfer file.
[0113] The first sending unit 405 is configured to send the target transfer file to the receiving end through a preset sending method, so that the receiving end restores the target transfer file into a compressed encrypted file in the order of the pseudo-random sequence, and decrypts the compressed encrypted file; the preset sending method is a disordered sending method for encrypted transmission.
[0114] Further, the encryption unit 401 includes a creation module and an encryption module.
[0115] The creation module is configured to create a reliable transmission channel; the reliable transmission channel is a channel for transmitting encrypted transmission files.
[0116] The encryption module is configured to encrypt the obtained file to be transferred through the reliable transmission channel and a preset encryption protocol.
[0117] Further, the file transfer system further includes an adjustment unit and a second sending unit.
[0118] The adjustment unit is configured to, if it is monitored that the target transfer file is lost, adjust the sending window parameter according to a flow control algorithm; the flow control algorithm is an algorithm for controlling the retransmission of the transfer file after packet loss.
[0119] The second sending unit is configured to re-send the target transfer file to the receiving end through the sending window parameter, so that the receiving end restores the target transfer file into a compressed encrypted file in the order of the pseudo-random sequence, and decrypts the compressed encrypted file.
[0120] Further, the file transfer system further includes a corresponding unit.
[0121] A corresponding unit, which is used to correspond the file names and file IDs of multiple target transfer files when multiple target transfer files are sent to the receiving end in batches.
[0122] Furthermore, the file transfer system further includes a creation unit.
[0123] The creation unit is used to create an unreliable transfer channel; the unreliable transfer channel is used to verify and limit the data received by the receiving end from a legal source IP and a legal source port.
[0124] In the embodiments of the present application, there is no need to use the TCP protocol to transfer files. Only through the application layer protocols of the sending end and the receiving end, the encrypted file to be transferred is compressed and then the target transfer file is sent, reducing the network bandwidth occupancy and improving the reliability of file transfer. In addition, through the preset sending method that plays an encryption transmission role, even if the listener gets the packet, they cannot splice and restore the original file according to the sequence number, improving the security of file transfer.
[0125] Based on the above embodiments Figure 3 Another disclosed file transfer method, the embodiments of the present application also correspondingly disclose another file transfer system, as Figure 5 shown. This file transfer system is applied to the receiving end, and this file transfer system includes a receiving unit 501 and a decryption unit 502.
[0126] The receiving unit 501 is used to receive the target transfer file sent by the sending end; the target transfer file is obtained by sequentially numbering the file segments through a pseudo-random sequence and reordering the numbered file segments; the file segments are obtained by slicing the compressed transfer file; the compressed transfer file is obtained by compressing the encrypted file to be transferred according to a preset compression algorithm.
[0127] The decryption unit 502 is used to restore the target transfer file into a compressed encrypted file in the order of the pseudo-random sequence and decrypt the compressed encrypted file.
[0128] Furthermore, another file transfer system further includes an analysis unit and a third sending unit.
[0129] The analysis unit is used to analyze the target transfer file to obtain an analysis result.
[0130] The third sending unit is used to send a confirmation message to the sending end when the analysis result indicates that the file shard number is missing, so that the sending end resends the target transfer file.
[0131] In the embodiments of the present application, there is no need to use the TCP protocol to transmit files. Instead, the encrypted file to be transmitted is compressed and then sent as the target transmission file through the application layer protocols of the sending end and the receiving end, reducing the network bandwidth occupancy and improving the reliability of file transmission. In addition, through the preset sending method that plays an encryption transmission role, even if the eavesdropper obtains the packet, they cannot splice and restore the original file according to the sequence number, improving the security of file transmission.
[0132] The embodiments of the present application also provide a storage medium, which includes stored instructions. When the instructions run, they control the device where the storage medium is located to execute the above file transmission method.
[0133] The embodiments of the present application also provide an electronic device, and its structural schematic diagram is as Figure 6 shown. Specifically, it includes a memory 601 and one or more instructions 602. One or more of the instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to execute the above file transmission method.
[0134] The specific implementation processes and their derivative methods of the above various embodiments are all within the protection scope of the present application.
[0135] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiments. The systems and system embodiments described above are only 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. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0136] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.
[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use this application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the scope of this application. Therefore, this application will not be limited to these embodiments shown herein, but rather will be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0138] The above are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.
Claims
1. A file transfer method, characterized in that, The method is applied to a sending end, and the method includes: Encrypting the obtained file to be transmitted through a preset encryption protocol; Compressing the encrypted file to be transmitted according to a preset encryption compression algorithm to obtain a compressed transmission file; Slicing the compressed transmission file to obtain file fragments; Numbering the file fragments in the order of a pseudo-random sequence, and reordering the numbered file slices to obtain a target transmission file; Sending each file fragment of the target transmission file to the receiving end according to the sending sliding window parameter in the flow control algorithm through a preset sending method, so that the receiving end restores each file fragment of the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence, and decrypts the compressed and encrypted file; the preset sending method is a disordered sending method for encrypted transmission; wherein, the sending sliding window parameter is used to determine the number of frames of data sent in each batch; If packet loss of the target transmission file is detected, adjusting the sending sliding window parameter according to the flow control algorithm and the sending success rate of sending the target transmission file; the flow control algorithm is an algorithm for controlling the retransmission of the transmission file after packet loss; Resending the target transmission file to the receiving end through the sending sliding window parameter, so that the receiving end restores the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence, and decrypts the compressed and encrypted file.
2. The method according to claim 1, wherein The step of encrypting the obtained file to be transmitted through a preset encryption protocol includes: Creating a reliable transmission channel; the reliable transmission channel is used for transmitting encrypted transmission files; Encrypting the obtained file to be transmitted through the reliable transmission channel and a preset encryption protocol.
3. The method according to claim 1, wherein It further includes: When batch-sending multiple target transmission files to the receiving end, corresponding the file names and file IDs of the multiple target transmission files.
4. The method according to claim 1, characterized in that It further includes: Creating an unreliable transmission channel; The unreliable transmission channel is used for verifying and restricting the receiving end to receive data from a legal source IP and a legal source port.
5. A file transfer method, characterized in that, The method is applied to a receiving end, and the method includes: Receiving each file fragment of the target transmission file sent by the sending end according to the sliding window parameter in the flow control algorithm; the target transmission file is obtained by numbering the file fragments in the order of a pseudo-random sequence and reordering the numbered file fragments; the file fragments are obtained by slicing the compressed transmission file; the compressed transmission file is obtained by compressing the encrypted file to be transmitted according to a preset compression algorithm; Analyzing the target transmission file to obtain an analysis result; When the analysis result indicates that the file shard number is missing, sending a confirmation message to the sending end, so that the sending end adjusts the sending sliding window parameter according to the flow control algorithm and the sending success rate of sending the target transmission file, and resends the target transmission file based on the adjusted sliding window parameter; Adjusting the order of each file fragment in the order of the pseudo-random sequence, restoring the target transmission file into a compressed and encrypted file, and decrypting the compressed and encrypted file.
6. A file transfer system, characterized in that, The system is applied to a sending end, and the system includes: An encryption unit, configured to encrypt the acquired file to be transmitted through a preset encryption protocol; A compression unit, configured to compress the encrypted file to be transmitted according to a preset encrypted compression algorithm to obtain a compressed transmission file; A file slicing unit, configured to slice the compressed transmission file to obtain file segments; A numbering and compression unit, configured to number the file segments in the order of a pseudo-random sequence and reorder the numbered file segments to obtain a target transmission file; A first sending unit, configured to send each file segment of the target transmission file to a receiving end according to a sending sliding window parameter in a flow control algorithm through a preset sending method, so that the receiving end restores each file segment of the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence and decrypts the compressed and encrypted file; the preset sending method is a disordered sending method for encrypted transmission; wherein, the sending sliding window parameter is used to determine the number of frames of data sent in each batch; An adjustment unit, configured to adjust the sending sliding window parameter according to the flow control algorithm and the sending success rate of sending the target transmission file if a packet loss of the target transmission file is detected; the flow control algorithm is an algorithm for controlling the retransmission of the transmission file after a packet loss; A second sending unit, configured to resend the target transmission file to the receiving end through the sending sliding window parameter, so that the receiving end restores the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence and decrypts the compressed and encrypted file.
7. The system according to claim 6, wherein The encryption unit includes: A creation module, configured to create a reliable transmission channel; the reliable transmission channel is a channel for transmitting an encrypted transmission file; An encryption module, configured to encrypt the acquired file to be transmitted through the reliable transmission channel and a preset encryption protocol.
8. A file transfer system, characterized in that, The system is applied to a receiving end, and the system includes: A receiving unit, configured to receive each file segment of the target transmission file sent by a sending end according to a sliding window parameter in a flow control algorithm; the target transmission file is obtained by numbering the file segments in the order of a pseudo-random sequence and reordering the numbered file segments; the file segments are obtained by slicing the compressed transmission file; the compressed transmission file is obtained by compressing the encrypted file to be transmitted according to a preset compression algorithm; An analysis unit, configured to analyze the target transmission file to obtain an analysis result; A third sending unit, configured to send a confirmation message to the sending end when the analysis result indicates that a file shard number is missing, so that the sending end adjusts the sending sliding window parameter according to the flow control algorithm and the sending success rate of sending the target transmission file and resends the target transmission file based on the adjusted sliding window parameter; A decryption unit, configured to restore the target transmission file into a compressed and encrypted file in the order of the pseudo-random sequence and decrypt the compressed and encrypted file.
Citation Information
Patent Citations
File transmission method, device and system and electronic equipment
CN111211878A
File transmitting method and system, sending end equipment and receiving end equipment
CN111245818A
File transmission method and device, electronic equipment and readable storage medium
CN114338651A