File transmission method and device based on multi-path

By fragmenting files and transmitting them independently on multiple lines, combined with TCP or UDP protocols and FEC forward error correction algorithm, it solves the problem of limited file transmission speed in multi-network environments and achieves efficient multi-path file transmission.

CN115550246BActive Publication Date: 2024-09-03PIO CLOUD COMPUTING (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211242067.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-11
Publication Date
2024-09-03
Estimated Expiration
2042-10-11

AI Technical Summary

Technical Problem

The existing technology cannot effectively utilize the bandwidth of multiple lines when transferring files in a multi-network environment, resulting in limited transmission speed, and multi-path transmission may slow down due to packet loss or delay.

Method used

By dividing the file into multiple shards and establishing an independent transmission connection on each line, each line transmits the shards at its own maximum speed, and then shares the tasks of other lines when completed, preventing slow lines from slowing down fast lines. Use TCP or UDP protocol combined with FEC forward error correction algorithm to avoid the impact of packet loss and retransmission.

Benefits of technology

It realizes efficient file transmission between multiple lines without affecting each other, improves transmission performance, and avoids the disadvantages of TCP streaming transmission, such as packet loss and speed reduction caused by retransmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550246B
    Figure CN115550246B
Patent Text Reader

Abstract

The present invention discloses a multi-path based file transmission method, comprising the following steps: obtaining the number N of network lines between a target node and a current node, dividing the file to be transmitted into N fragments; establishing a transmission connection connected to the target node on each line, and downloading a fragment on each transmission connection, wherein each fragment is different from each other; in the case of completing the transmission of a file fragment transmitted on a certain line, finding the line with the largest remaining fragment to be transmitted on the remaining N-1 lines, dividing its fragment to be transmitted into a first fragment and a second fragment, and downloading the second fragment to the line that has completed the transmission for transmission; repeating the previous step until the transmission of the file to be transmitted is completed. This method can use multiple lines, and the slow line will not slow down the transmission speed of the fast line. After the fast line completes the transmission of the initially allocated data fragment to be transmitted, it can share the transmission task of the slow line until the file transmission is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of file transmission, and in particular relates to a multi-path based file transmission method, device, equipment and storage medium. Background Art

[0002] In a multi-network environment, the efficiency of file transfer depends on the network quality of the line. In the prior art, traditional TCP-based file transfer tools can only use a single path for transmission and cannot use the bandwidth of multiple networks at the same time. Although MP-TCP supports multi-path transmission, since the TCP protocol itself is a streaming general transmission protocol, it can only be transmitted within the range of the TCP sliding window. If packet loss occurs on the network, it is necessary to wait for retransmission. In a multi-line scenario, MP-TCP may often need to wait for transmission data from slower or poorer quality lines, which not only cannot increase the transmission speed, but may slow down the transmission speed. Specifically, the process of directly using TCP for file transfer: use TCP Socket to establish a connection; start transmitting file data from the beginning; when an error occurs, re-establish a TCP connection and continue transmission from the last transmission position until the file transfer is completed. The disadvantage of this solution is that it can only use a single network line and the speed is relatively limited.

[0003] In addition, the prior art also uses MultiPath-TCP for file transmission, and the process is as follows: when there are multiple network lines, TCP handshake is performed on each line separately, carrying MultiPath related information; when transmitting TCP stream data, the source file is distributed to multiple lines in a certain proportion in the form of TCP stream data according to the status of each line; the receiving end collects data from multiple lines, reorganizes according to the TCP sequence number, restores the TCP stream data, and writes it to the target file in sequence; if the data of a certain line is lost, the lost data block needs to be resent using this line or other lines to ensure the arrival of the data. The advantage of this solution is that multiple lines can be used, and the disadvantage is that because a single TCP stream data is transmitted, packet loss on a certain line will cause the TCP stream data transmission to be suspended or delayed. In other words, file transmission needs to wait for the arrival of the slowest line data or timeout retry, resulting in that in some cases, the speed of multi-line transmission is still very slow, and may even be slower than using only a single line.

[0004] Taking the above into consideration, the existing technologies generally have the defects of only being able to use a single line for transmission, resulting in limited transmission rate, or even using multiple lines for transmission, but still being limited by some line delays, packet loss or congestion, resulting in poor transmission performance. Summary of the invention

[0005] To solve the above problems, the purpose of the present invention is to provide a multi-path based file transmission method and device, which method can not only use multiple lines, but also the multiple lines will not affect each other, the slow line will not slow down the transmission speed of the fast line, each line will transmit at its own maximum speed, and after the fast line completes the transmission of its part of the data, it can share the transmission task of the slow line until the file transmission is completed.

[0006] To achieve the above-mentioned purpose, the technical solution of the present invention is: a multi-path based file transmission method, comprising the following steps: obtaining the number N of network lines between the target node and the current node, dividing the file to be transmitted into N fragments; establishing a transmission connection connected to the target node on each line, and downloading a fragment for each transmission connection, wherein each fragment is different from each other; when the file fragment is transmitted on a certain line, the line with the largest remaining fragment to be transmitted on the remaining N-1 lines is searched, and its fragment to be transmitted is divided into a first fragment and a second fragment, and the second fragment is downloaded to the line that has completed the transmission for transmission; repeating the previous step until the transmission of the file to be transmitted is completed.

[0007] The present invention can not only use multiple lines, but also the multiple lines will not affect each other. The slow line will not slow down the transmission speed of the fast line. Each line will transmit at its own maximum speed. After the fast line completes the transmission of its part of the data, it can share the transmission task of the slow line until the file transmission is completed.

[0008] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the line is continued to be used for delayed retries, and the retry interval increases exponentially. After reaching a certain threshold, the cycle is restarted until the transmission is restored.

[0009] By setting the delay retry to continue transmitting data according to the above rules, the purpose of retransmission can be achieved without causing a big impact on the overall transmission.

[0010] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In case of a transmission error on a certain line, the fragment to be transmitted on the remaining lines is downloaded for transmission after the transmission is completed.

[0011] Since the TCP protocol is a streaming universal transmission protocol, in order to avoid the delay of a certain line affecting the transmission efficiency of the entire file, after a certain line completes the fragment transmission, it can bear the transmission pressure of the line with slow transmission speed, thereby achieving the purpose of improving the transmission efficiency of the entire file.

[0012] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a UDP protocol connection, and the file data of a UDP packet is saved when a UDP packet is received, thereby avoiding the discarding and retransmission of cached data caused by packet loss to the greatest extent. The disadvantages of TCP streaming transmission can be avoided at the source.

[0013] Preferably, the UDP protocol connection adopts a FEC forward error correction algorithm to avoid the round-trip time overhead and impact on transmission speed caused by packet loss detection and retransmission by sending redundant data.

[0014] After adopting the above technical solution, compared with the prior art, the present invention has the following advantages:

[0015] 1. The present invention can not only use multiple lines, but also the multiple lines will not affect each other. The slow line will not slow down the transmission speed of the fast line. Each line will transmit at its own maximum speed. After the fast line completes the transmission of its part of the data, it can share the transmission task of the slow line until the file transmission is completed.

[0016] 2. In the present invention, the line that has completed the fragment transmission first is used to share the file fragments to be transmitted of the line with the greatest remaining transmission pressure, so as to achieve the purpose of balancing tasks and resources and improving transmission performance.

[0017] 3. The present invention is applicable to the TCP transmission protocol and can improve the inherent drawbacks of TCP streaming transmission.

[0018] 4. The present invention is applicable to the UDP transmission protocol. When a UDP packet is received, the file data of the UDP packet is saved, which can avoid the discarding and retransmission of cached data caused by packet loss to the greatest extent. The disadvantages of TCP streaming transmission can be avoided at the source. At the same time, the FEC forward error correction algorithm is adopted to avoid the round-trip time overhead and the impact on the transmission speed caused by packet loss detection and retransmission by sending redundant data. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings, wherein:

[0020] Figure 1 This is a flow chart of the multi-path based file transmission method of the present invention;

[0021] Figure 2 The figure is a schematic diagram of software execution steps of the multi-path based file transmission method of the present invention. DETAILED DESCRIPTION

[0022] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise ratios, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention.

[0023] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0024] Embodiment 1

[0025] See also Figure 1 , a multi-path based file transmission method, comprising the following steps:

[0026] S100: Obtain the number N of network lines between the target node and the current node, and divide the file to be transmitted into N fragments;

[0027] Among them, the file to be transmitted can be divided into N equal slices, or it can be scored based on the transmission conditions of each line detected, and the file to be transmitted is divided into slices based on the scoring results. The lines with good transmission environment are allocated with a larger share of transmission file slices, and the lines with poor transmission environment are allocated with a smaller share of transmission file slices.

[0028] S200: Establish a transmission connection connected to the target node on each line, and download a slice on each transmission connection, wherein each slice is different from each other;

[0029] S300: When the file fragments are transmitted on a certain line, find the line with the largest number of fragments to be transmitted among the remaining N-1 lines, divide the fragments to be transmitted into a first fragment and a second fragment, and download the second fragment to the line on which the transmission has been completed for transmission;

[0030] After completing the transmission of the task, the line with good transmission performance will find the line with the heaviest current task to help it share the transmission task.

[0031] S400: Repeat the cycle S300 until the file to be transferred is completed.

[0032] The present invention can not only use multiple lines, but also the multiple lines will not affect each other. The slow line will not slow down the transmission speed of the fast line. Each line will transmit at its own maximum speed. After the fast line completes the transmission of its part of the data, it can share the transmission task of the slow line until the file transmission is completed.

[0033] Preferably, see Figure 2 , a transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the line is continued to be used for delayed retries, and the retry interval increases exponentially. After reaching a certain threshold, the cycle is restarted until the transmission is restored.

[0034] By setting the delay retry to continue transmitting data according to the above rules, the purpose of retransmission can be achieved without causing a big impact on the overall transmission.

[0035] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In case of a transmission error on a certain line, the fragment to be transmitted on the remaining lines is downloaded for transmission after the transmission is completed.

[0036] Since the TCP protocol is a streaming universal transmission protocol, in order to avoid the delay of a certain line affecting the transmission efficiency of the entire file, after a certain line completes the fragment transmission, it can bear the transmission pressure of the line with slow transmission speed, thereby achieving the purpose of improving the transmission efficiency of the entire file.

[0037] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a UDP protocol connection, and the file data of a UDP packet is saved when a UDP packet is received, thereby avoiding the discarding and retransmission of cached data caused by packet loss to the greatest extent. The disadvantages of TCP streaming transmission can be avoided at the source.

[0038] Preferably, the UDP protocol connection adopts the FEC forward error correction algorithm to avoid the round-trip time overhead and the impact on the transmission speed caused by packet loss detection and retransmission by sending redundant data. When transmitting in fragments, 10% redundancy is reserved for each fragment. In this way, when the data of the packet loss is just within this range, packet loss detection and retransmission can be avoided, and the transmission performance can be improved to a certain extent.

[0039] Embodiment 2

[0040] Based on the same concept, this embodiment provides a multi-path based file transmission device, including: an acquisition module, used to obtain the number N of network lines between the target node and the current node, and divide the file to be transmitted into N fragments; a connection establishment module, used to establish a transmission connection connected to the target node on each line, and each transmission connection downloads a fragment, wherein each fragment is different from each other; a transmission module, used to, when the file fragment is transmitted on a certain line, find the line with the largest remaining fragment to be transmitted on the remaining N-1 lines, divide its fragment to be transmitted into a first fragment and a second fragment, and download the second fragment to the line that has completed the transmission for transmission; repeat the previous step until the transmission of the file to be transmitted is completed.

[0041] Preferably, the transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the line is continued to be used for delayed retries, and the retry interval increases exponentially. After reaching a certain threshold, the cycle is restarted until the transmission is restored.

[0042] By setting the delay retry to continue transmitting data according to the above rules, the purpose of retransmission can be achieved without causing a big impact on the overall transmission.

[0043] Optionally, the transmission connection may also be a UDP protocol connection, and the file data of a UDP packet is saved when a UDP packet is received, thereby avoiding the discarding and retransmission of cached data caused by packet loss to the greatest extent, and avoiding the disadvantages of TCP streaming transmission at the source.

[0044] Embodiment 3

[0045] Based on the same concept, this embodiment provides a computer device, which may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) (for example, one or more processors) and memories, and one or more storage media for storing applications or data (for example, one or more mass storage devices). Among them, the memory and the storage medium can be short-term storage or permanent storage. The program stored in the storage medium may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device. Furthermore, the processor can be configured to communicate with the storage medium and execute a series of instruction operations in the storage medium on the computer device.

[0046] The computer device may also include one or more power supplies, one or more wired or wireless network interfaces, one or more input and output interfaces, and / or one or more operating systems, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc.

[0047] Those skilled in the art will appreciate that the computer device structure of this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0048] When the computer-readable instructions are executed by the processor, the processor implements the following steps when executing the computer-readable instructions: obtaining the number N of network lines between the target node and the current node, and dividing the file to be transmitted into N fragments; establishing a transmission connection connected to the target node on each line, and downloading a fragment for each transmission connection, wherein each fragment is different from each other; when the file fragment transmitted on a certain line is completed, searching for the line with the largest number of remaining fragments to be transmitted on the remaining N-1 lines, dividing its fragments to be transmitted into a first fragment and a second fragment, and downloading the second fragment to the line that has completed the transmission for transmission; repeating the previous step until the transmission of the file to be transmitted is completed.

[0049] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the line is continued to be used for delayed retries, and the retry interval increases exponentially. After reaching a certain threshold, the cycle is restarted until the transmission is restored.

[0050] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In case of a transmission error on a certain line, the fragment to be transmitted on the remaining lines is downloaded for transmission after the transmission is completed.

[0051] Preferably, a transmission connection connected to the target node is established on each line, wherein the transmission connection is a UDP protocol connection, and the file data of a UDP packet is saved when a UDP packet is received, thereby avoiding the discarding and retransmission of cached data caused by packet loss to the greatest extent. The disadvantages of TCP streaming transmission can be avoided at the source.

[0052] Preferably, the UDP protocol connection adopts a FEC forward error correction algorithm to avoid the round-trip time overhead and impact on transmission speed caused by packet loss detection and retransmission by sending redundant data.

[0053] In one embodiment, a computer-readable storage medium is provided. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the above-mentioned multi-path-based file transfer method. The specific steps are not repeated here.

[0054] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0055] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0056] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-path based file transmission method, characterized in that: The following steps are involved: Get the number of network lines N between the target node and the current node, and divide the file to be transferred into N fragments; Establishing a transmission connection connected to the target node on each line, each transmission connection downloading a slice, wherein each slice is different from each other; When the file fragments are transmitted on a certain line, the line with the largest number of fragments to be transmitted among the remaining N-1 lines is searched, the fragments to be transmitted are divided into a first fragment and a second fragment, and the second fragment is downloaded to the line on which the transmission has been completed for transmission; Repeat the previous step until the file to be transferred is completed.

2. The multi-path based file transmission method according to claim 1, characterized in that: A transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the line is continued to be used for delayed retries, and the retry interval increases exponentially. After reaching a certain threshold, the cycle is restarted until the transmission is restored.

3. The multi-path based file transmission method according to claim 1, characterized in that: A transmission connection connected to the target node is established on each line, wherein the transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the segments on the line with the transmission error are downloaded and transmitted after the transmission of the segments to be transmitted on the remaining lines is completed.

4. The multi-path based file transmission method according to claim 1, characterized in that: A transmission connection connected to the target node is established on each line, wherein the transmission connection is a UDP protocol connection, and the target node saves the file data of a UDP packet upon receiving a UDP packet, thereby avoiding the discarding and retransmission of cached data caused by packet loss.

5. The multi-path based file transmission method according to claim 4, characterized in that: The UDP protocol connection adopts the FEC forward error correction algorithm to avoid the round-trip time overhead and the impact on the transmission speed caused by packet loss detection and retransmission by sending redundant data.

6. A multi-path based file transmission device, characterized in that: include: An acquisition module is used to obtain the number N of network lines between the target node and the current node, and divide the file to be transmitted into N fragments; A connection establishment module, used for establishing a transmission connection connected to a target node on each line, each transmission connection downloading a slice, wherein each slice is different from each other; The transmission module is used to find the line with the largest number of remaining fragments to be transmitted on the remaining N-1 lines when the transmission of the file fragment on a certain line is completed, divide the fragments to be transmitted into a first fragment and a second fragment, download the second fragment to the line where the transmission has been completed for transmission, and repeat the cycle until the transmission of the file to be transmitted is completed.

7. The multi-path based file transmission device according to claim 6, characterized in that: The transmission connection is a TCP protocol connection. In the event of a transmission error on a certain line, the line is continued to be used for delayed retries, and the retry interval increases exponentially. After reaching a certain threshold, the cycle is restarted until the transmission is restored.

8. The multi-path based file transmission device according to claim 6, characterized in that: The transmission connection is a UDP protocol connection. When the target node receives a UDP packet, it saves the file data of the UDP packet, thereby avoiding the discarding and retransmission of the cached data caused by packet loss.

9. A computer device, characterized in that: include: A memory, the memory being used to store a processing program; A processor, wherein when executing the processing program, the processor implements the multi-path based file transmission method as described in any one of claims 1 to 5.

10. A readable storage medium, characterized in that: The readable storage medium stores a processing program, and when the processing program is executed by the processor, the multi-path-based file transmission method according to any one of claims 1 to 5 is implemented.