CN108401002A - Document transmission method and equipment - Google Patents

Document transmission method and equipment Download PDF

Info

Publication number
CN108401002A
CN108401002A CN201710068011.7A CN201710068011A CN108401002A CN 108401002 A CN108401002 A CN 108401002A CN 201710068011 A CN201710068011 A CN 201710068011A CN 108401002 A CN108401002 A CN 108401002A
Authority
CN
China
Prior art keywords
time
connection
file
transmission
out time
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.)
Granted
Application number
CN201710068011.7A
Other languages
Chinese (zh)
Other versions
CN108401002B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710068011.7A priority Critical patent/CN108401002B/en
Publication of CN108401002A publication Critical patent/CN108401002A/en
Application granted granted Critical
Publication of CN108401002B publication Critical patent/CN108401002B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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]

Abstract

The invention discloses a kind of document transmission method and equipment;Method includes:The type of access network based on transmitting terminal determines the initial time-out time at least two connections established between the transmitting terminal and the receiving terminal;Based on the initial time-out time of each connection, pass through each different file fragmentations connected to the receiving terminal parallel transmission file;The history round-trip transmission time based on each connection, the history time-out time accordingly connected is compensated, obtains the newer time-out time of each connection;Based on the newer time-out time of each connection, pass through each different file fragmentations connected to file described in the receiving terminal parallel transmission.Implement the present invention, can determine time-out time according to the type of access network and carry out adaptive updates, promotes the efficiency of file fragmentation transmission.

Description

Document transmission method and equipment
Technical field
The present invention relates to the communication technology more particularly to a kind of document transmission method and equipment.
Background technology
File transmission is the function of generally being used in current network application, typically, is used for following scene:1) lead to It is big to send share photos and video etc. to the one or more good friends for participating in session for the file transmitting function for crossing social networking application offer The file of capacity is shared;2) user transmits local file (such as media text of user terminal using networking client to high in the clouds Part, program, setting information) it is backed up, to restore if necessary from high in the clouds.
The application scenarios of above-mentioned file transmission all have the characteristics that transmission file size is big, require transmitting, in order to carry Rise file transfer speed, the relevant technologies provide sliced transmission scheme, in simple terms, if transmitting terminal by file be split for Dry fragment, using multiple connection parallel transmission fragments between transmitting terminal and receiving terminal, the fragment of each connection transmission is obtaining Continue to transmit next fragment when the response of receiving terminal, can make full use of the transmission belt between receiving terminal and transmitting terminal in this way Width maximizes file transfer rate, as long as in addition, retransmit corresponding fragment when sliced transmission fail, it is whole without re-transmission A file, ensure that efficiency of transmission.
Wherein, after connecting transmission fragment at one when transmitting terminal, transmitting terminal needs wait for transmitting terminal in time-out time The response for receiving fragment continues to transmit next fragment if received, and fragment is retransmitted if not receiving response, it is seen that super When the time be influence file transmission efficiency an important factor for.
In practical application, the type complexity of the access network of transmitting terminal is various, and the characteristic of the movement due to user, hair The type of the access network of sending end can inevitably occur frequently to change, for how according to the access network of transmitting terminal Situation targetedly determines time-out time, promotes the efficiency of slicing files transmission, and the relevant technologies there is no effective scheme.
Invention content
A kind of document transmission method of offer of the embodiment of the present invention and equipment, can be adaptive according to the access network of transmitting terminal It should determine time-out time, promote file transmission efficiency.
What the technical solution of the embodiment of the present invention was realized in:
In a first aspect, the embodiment of the present invention provides a kind of document transmission method, including:
The type of access network based on transmitting terminal, determines and is established at least between the transmitting terminal and the receiving terminal The initial time-out time of two connections;
Based on the initial time-out time of each connection, described connected to the receiving terminal parallel transmission file by each Different file fragmentations;
The history round-trip transmission time based on each connection, the history time-out time accordingly connected is compensated, is obtained To the newer time-out time of each connection;
Based on the newer time-out time of each connection, described connected to described in the receiving terminal parallel transmission by each The different file fragmentations of file.
Second aspect, the embodiment of the present invention provide a kind of electronic equipment for carrying out file transmission, as transmitting terminal, packet It includes:
Overtime unit, the type of the access network based on the transmitting terminal, determine the transmitting terminal and the receiving terminal it Between established at least two connection initial time-out times;
Transmission unit described is connected to the receiving terminal simultaneously by each based on the initial time-out time of each connection The different file fragmentations of row transmission file;
Compensating unit, be used for the history round-trip transmission time based on each connection, to accordingly connect history time-out when Between compensate, obtain the newer time-out time of each connection;
The transmission unit is additionally operable to the newer time-out time based on each connection, described is connected to institute by each State the different file fragmentations of file described in receiving terminal parallel transmission.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment as transmitting terminal, including:Memory and processing Device is stored with executable instruction in memory, for causing processor to execute document transmission method provided in an embodiment of the present invention.
Fourth aspect, the embodiment of the present invention provide a kind of storage medium, executable instruction are stored with, for executing the present invention The document transmission method that embodiment provides.
The embodiment of the present invention has the advantages that:
First, when the type of the access network based on transmitting terminal primarily determines the time-out by connection transmission file fragmentation Between, for good access network, it can avoid transmission bandwidth can not being utilized maximum because unified time-out time is arranged The problem of changing efficiency of transmission;For the limited access network of bandwidth, it can avoid causing because time-out time is too short frequently weight Transmitting file fragment, the problem of causing the further congestion of access network and consume network flow excessively;
Secondly, initial time-out time is compensated by the history round-trip transmission time of each connection, due to past back pass The defeated time reflect connection transmission file fragmentation real-time performance, by using the history round-trip transmission time to time-out time into Row compensation can be directed to the actual conditions (as access network failure, access network bandwidth are promoted) of access network and connection is made to pass Defeated file fragmentation performance carries out adaptive adjustment, when avoiding time-out time long and influence connection utilization rate, and avoiding time-out Between it is too short caused by frequently retransmit the case where, utmostly promote file transmission efficiency.
Description of the drawings
Fig. 1 is an optional processing schematic diagram of document transmission method provided in an embodiment of the present invention;
Fig. 2 is an optional flow diagram of document transmission method provided in an embodiment of the present invention;
Fig. 3 is an optional flow diagram of document transmission method provided in an embodiment of the present invention;
Fig. 4 is that an optional software and hardware structure of the electronic equipment 10 provided in an embodiment of the present invention as transmitting terminal shows It is intended to;
Fig. 5-1 is an optional flow diagram of document transmission method provided in an embodiment of the present invention
Fig. 5-2 is that the embodiment of the present invention provides the optional flow signal that connection is established between transmitting terminal and receiving terminal Figure;
Fig. 6 is an optional illustrative view of functional configuration of equipment provided in an embodiment of the present invention;
Fig. 7 is an optional flow signal of user end to server transmission file fragmentation provided in an embodiment of the present invention Figure;
Fig. 8 is an optional flow signal of user end to server transmission file fragmentation provided in an embodiment of the present invention Figure.
Specific implementation mode
The present invention is further described in detail below with reference to the accompanying drawings and embodiments.It should be appreciated that mentioned herein Embodiment is only used to explain the present invention, is not intended to limit the present invention.In addition, embodiment provided below is for implementing The section Example of the present invention, rather than the whole embodiments for implementing the present invention are provided, creation is not paid in those skilled in the art Property labour under the premise of, to the technical solution of following embodiment recombinated gained embodiment and based on to invention institute in fact The other embodiment applied all belongs to the scope of protection of the present invention.
It should be noted that in embodiments of the present invention, the terms "include", "comprise" or its any other variant are intended to Cover non-exclusive inclusion, so that method or device including a series of elements are not only wanted including what is be expressly recited Element, but also include other elements that are not explicitly listed, or further include for implementation or device intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Method either there is also other relevant factor (such as the step in method or units in device) in device.
For example, document transmission method provided in an embodiment of the present invention contains a series of step, but the present invention is implemented The document transmission method that example provides is not limited to recorded step, similarly, document transmission device-provided in an embodiment of the present invention Transmitting terminal includes a series of units, but document transmission device provided in an embodiment of the present invention is not limited to include being expressly recited Unit, can also include to obtain the unit of relevant information or the required setting of while being handled based on information.
Before the present invention will be described in further detail, to involved in the embodiment of the present invention noun and term say Bright, noun and term involved in the embodiment of the present invention are suitable for following explanation.
1) file fragmentation, (such as video, audio, image, installation kit and any form of support of compressed package replicate simultaneously file The file of transmission) data be split to be formed, usually, identical file is split the file fragmentation to be formed have it is identical Capacity, it is of course also possible to divide the file fragmentation to form different capabilities.
2) network is accessed, access network is a kind of user network, and connection user equipment to specific service provider and leads to It crosses bearer network and reaches other networks (such as internet), it may for example comprise the cellular communications networks of 2G/3G/4G, Wireless LAN Such as WiFi network and fiber optic network.
3) time-out time is corresponded with connecting, before transmitting terminal transmits file fragmentation again by connection to receiving terminal The time waited for.
4) round-trip transmission time (RTT, Round-Trip Time), transmitting terminal since receiving terminal transmit file fragmentation, until Receive the time spent by the response (ACK) from receiving terminal.
To be based on for the connection of transmission control protocol (TCP, Transmission Control Protocol), receive When end and transmitting terminal support TCP time stamp options simultaneously, the time stamp that transmitting terminal is recorded in the packet option of TCP data packet can be connect Receiving end is reflected with response, and transmitting terminal can utilize the reflection time stamp of response message to calculate the instant past of some TCP packet Return transmission time.
5) long connection, refers to the connection that multiple file fragmentations are continuously transmitted between transmitting terminal and receiving terminal, is kept in connection Period, if transmitted in long connection without file fragmentation in the predetermined time, transmitting terminal is connected with receiving terminal release.
6) short connection refers to the connection for continuously transmitting a file fragmentation between transmitting terminal and receiving terminal, is being transmitted The i.e. connection of release afterwards.
It is analyzed in problem present on efficiency of transmission continuing with file transmission scenario, referring to Fig. 1 and Fig. 2, Fig. 1 It is an optional processing schematic diagram of document transmission method provided in an embodiment of the present invention, Fig. 2 is that the embodiment of the present invention provides Document transmission method an optional flow diagram, by mobile phone QQ user end to server transmit file for, mobile phone The client of QQ when the file for carrying out Rich Media to server transmits, by accessing network insertion internet established by client File to be transmitted is split to form file point by multiple connections based on TCP between server according to fixed size Piece, based on the different file fragmentation of multiple connection parallel transmissions.
Client, to one file fragmentation of server transport, and starts timing in each connection, at time-out time (45s) It is inside not received by the response that server receives file fragmentation, that is, thinks that transmitting file fragmentation loses, and transmits file point again Piece, until receiving the response of server and continuing to transmit remaining file fragmentation.When file fragmentation is more than pre-determined number again (such as 3 times) and when not receiving the response of server, if the spent time of transmission file has exceeded (such as 8 points of predetermined time Clock), then can with ends file transfer, if transmission file the spent time without departing from predetermined time (such as 8 minutes), can It continues to attempt to transmit again in the IP address of access network to attempt to replace.
Based on the file transmission scenario that Fig. 1 and Fig. 2 is provided, have at least the following problems:
1) when the type difference of the access network of transmitting terminal, the time-out time of use is all identical, is unfavorable in access network The case where being high-quality wireless network, carries out the Fast retransmission of file fragmentation.
For example the quality of WiFi network is far superior to 2G networks on average, but the time-out of WiFi network and 2G networks Time is identical, can cause under quality preferably WiFi network, transmission mistake before waiting for very long time-out time that could retransmit The file fragmentation lost, this can reduce efficiency of transmission when retransmitting file fragmentation because of packet loss under high-quality wireless network.
2) cannot according to it is same access network quality variation and adaptive updates.
For example, the mobile communications network of China is extremely complex, different geographical difference province various zones different base station Different periods, network quality is multifarious, and network quality is continually changing, such as peak period and personnel's congestion location net Network quality is with regard to very poor, and low peak period and scarcity location network quality are with regard to fine.If using fixed time-out time, very may be used The area that network quality can be caused good or period are still to just retry transmission file point using very long time-out time in packet loss Piece, very long so as to cause transmission time, user experience is very poor.When network quality is particularly poor, fixed time-out is relative to quality It is too short for lower access network, cause the file fragmentation for retrying transmission that can increase, increases the fragment into network, to Waste customer flow.
In view of the above-mentioned problems, the embodiment of the present invention provides a kind of document transmission method, provides and transmitting terminal is passed using connection The scheme that the time-out time of defeated file fragmentation is adaptively adjusted is file provided in an embodiment of the present invention referring to Fig. 3, Fig. 3 One optional flow diagram of transmission method, includes the following steps:
Step 101, the type of access network of the transmitting terminal based on transmitting terminal, determines and is established between transmitting terminal and receiving terminal At least two corresponding initial time-out times of connection.Step 102, transmitting terminal connects corresponding initial surpass based on each When the time, pass through each different file fragmentations connected to receiving terminal parallel transmission file.Step 103, transmitting terminal is based on each connection The history round-trip transmission time, the history time-out time accordingly connected is compensated, it is corresponding newer super to obtain each connection When the time.Step 104, transmitting terminal is based on the corresponding newer time-out time of each connection, is passed parallel by each connect to receiving terminal The different file fragmentations of defeated file.
First, when the type of the access network based on transmitting terminal primarily determines the time-out by connection transmission file fragmentation Between so that time-out time because of the type of access network there is the characteristic of differentiation can be kept away for good access network The problem of exempting to be unable to fully maximize efficiency of transmission using transmission bandwidth because unified time-out time is arranged;It is limited for bandwidth Access network for, can avoid causing because time-out time is too short frequently retransmitting file fragmentation, cause access network it is further The problem of congestion;
Secondly, initial time-out time is compensated by the round-trip transmission time of each connection, when due to round-trip transmission Between reflect access network transmission file fragmentation real-time performance, time-out time is mended by using the round-trip transmission time It repays, the actual conditions (such as access network failure, the variation of access network bandwidth) of access network can be directed to and make connection transmission text Part fragment performance carries out adaptive adjustment, avoids time-out time long and influences connection utilization rate, and avoids time-out time mistake The case where frequently being retransmitted caused by section, utmostly promotes file transmission efficiency.
Hereinafter, continue to illustrate by taking transmitting terminal and receiving terminal as an example, it is possible to understand that ground, in different business scenarios In, transmitting terminal and receiving terminal may be embodied as different equipment, such as terminal and server.
For example, in the business scenario of instant messaging, transmitting terminal can be the terminal of operation instant communication client, receive End can be the instant communication server being deployed in network, for receiving a certain user by instant communication client in session The file of middle transmission.
Meanwhile file fragmentation (can be the file fragmentation that is received, or be root by server as transmitting terminal again The file fragmentation divided again after file is merged into according to the file fragmentation of reception) it is transferred to the instant of the other users for participating in session Communication customer end.
For another example beyond the clouds in the business scenario of storage service, transmitting terminal can be the terminal of operation Dropbox client, connect Receiving end can be to be deployed with the server of high in the clouds storage service.
Corresponding with transmitting terminal above-mentioned, the embodiment of the present invention is also provided to be set for implementing the electronics of above-mentioned document transmission method It is standby, for example, electronic equipment can be based on the terminal of user side, for example, smart mobile phone, tablet computer, laptop, it can also To dispose the server for transmitting background service for providing file in a network.
On hardware view, realize that the hardware resource of electronic equipment includes such as the computing resource of processor and memory, such as net The communication resource of network interface is realized;On software view, electronic equipment may be embodied as being stored in executable in storage medium It instructs (computer executable instructions for including such as program, module etc).
As above, optional referring to one of the electronic equipment 10 provided in an embodiment of the present invention as transmitting terminal shown in Fig. 4 Software and hardware structure schematic diagram, electronic equipment 10 include hardware layer, middle layer, operating system layer and software layer.However, this field It will be appreciated by the skilled person that the structure of the electronic equipment 10 shown in Fig. 4 is merely illustrative, do not constitute to 10 structure of electronic equipment Restriction.For example, electronic equipment 10 can be arranged according to needs are implemented compared with the more components of Fig. 4, or province is needed according to implementation Slightly setting unit component.
The hardware layer of electronic equipment 10 includes processor 11, input/output interface 13, storage medium 14 and network interface 12, component can be through system bus connection communication.
Processor 11 may be used central processing unit (CPU), microprocessor (MCU, Microcontroller Unit), specially With integrated circuit (ASIC, Application Specific Integrated Circuit) or logic programmable gate array (FPGA, Field-Programmable Gate Array) is realized.
Input/output interface 13 may be used such as display screen, touch screen, loud speaker input/output device and realize.
The realization of the non-volatile memory mediums such as flash memory, hard disk, CD may be used in storage medium 14, can also use double The volatile storage mediums such as rate (DDR, Double Data Rate) dynamic buffering are realized, wherein being stored with to execute above-mentioned text The executable instruction of part transmission method.
Illustratively, storage medium 14 can be with the other assemblies concentrated setting of electronic equipment 10, can also be relative to electricity Other assemblies distribution setting in sub- equipment 10.Network interface 12 provides the external data storage that such as strange land is arranged to processor 11 The access ability of medium 14, illustratively, network interface 12 can be based on near-field communication (NFC, Near Field Communication) the short-range communication that technology, bluetooth (Bluetooth) technology, purple honeybee (ZigBee) technology carry out, in addition, It can also realize the communication of such as CDMA, WCDMA communication standard and its evolution standard.
Driving layer include for for operating system 16 identify hardware layer and with the middleware 15 of each assembly communication of hardware layer, example It such as can be the set for the driver of each component of hardware layer.
Operating system 16 is for providing user oriented graphical interfaces, illustratively, including plug-in unit icon, desktop background and Application icon, the support user of operating system 16 is via graphical interfaces to the control embodiment of the present invention of equipment to the soft of above equipment Part environment such as OS Type, version does not limit, for example, can be (SuSE) Linux OS, UNIX operating system or other Operating system.
Protocol layer realizes agreement such as Wireless Fidelity (WiFi) association of wireless LAN communication configured with holding equipment View is also configured with holding equipment and file fragmentation is packaged as data message and is passed by the form of data message by connecting Defeated TCP/ Internet protocols (Internet Protocol).
Application layer includes the case where being provided with the application of file transmitting function, be terminal for equipment, and application layer can wrap It includes such as instant communication client 19, provides and transmit file to user good friend and carry out shared function, then such as Dropbox client 18, It provides the local file of electronic equipment 10 (such as user picture, video personal document and operating system setting file, peace Dress APMB package) server in high in the clouds is uploaded to, and file is restored to electronic equipment 10 from high in the clouds if necessary.It is for equipment The case where server, application layer may include that such as supporting the service logic of instant messaging service, (such as user data management disappears Breath management).
It is an optional flow signal of document transmission method provided in an embodiment of the present invention referring to Fig. 5-1, Fig. 5-1 Figure, including:
Step 201, transmitting terminal is by accessing the multiple companies for being used for transmission file fragmentation between network foundation and receiving terminal It connects.
In one embodiment, multiple long connections are established by three-way handshake between transmitting terminal and client, passes through long connect The transmission for tapping into the subsequent file fragmentation of row still maintains certain time since long connection has when no file fragmentation transmits Characteristic, when transmitting terminal continuously transmits multiple files to receiving terminal, the resource that can be saved between transmitting terminal and receiving terminal disappears Consumption and time loss.
In another embodiment, at least multiple short connections are established by three-way handshake between transmitting terminal and client, led to Too short connection carries out the transmission of subsequent file fragmentation, since short connection has the spy discharged when no file fragmentation transmits Property, when a large amount of transmitting terminal connects transmission file to receiving terminal, receiving terminal can be saved and safeguard the resource largely concurrently connected Consumption.
The process that connection is established between transmitting terminal and receiving terminal illustrates, referring to shown in Fig. 5-2 transmitting terminal with connect An optional flow diagram of connection, including three-way handshake operation are established between receiving end.It shakes hands for the first time:Establish connection When, transmitting terminal sends synchronization serial number (SYN, Synchronize Sequence Numbers) packet (SYN=j) and arrives receiving terminal, And enter SYN_SENT states, wait for receiving terminal to confirm;Synchronizing sequence is numbered.Second handshake:Receiving terminal receives SYN packets, must It must confirm the SYN (ack=j+1) of client, while oneself also send a SYN packet (SYN=k), i.e. SYN+ACK packets, connect at this time Receiving end enters SYN_RECV states.Third time is shaken hands:Transmitting terminal receives the SYN+ACK packets of server, sends and confirms to receiving terminal ACK (ack=k+1) is wrapped, this packet is sent, and transmitting terminal and receiving terminal enter ESTABLISHED (TCP connection success) state, Complete three-way handshake.
Step 202, the type of access network of the receiving terminal based on transmitting terminal, determines and is established between transmitting terminal and receiving terminal The respective initial time-out time of multiple connections.
In one embodiment, the initial time-out time respectively connected is compensated to the basic time-out time of each connection It obtains.For basic time-out time, it is different types of access network basic time-out time with access network bandwidth with And transmission rate is negatively correlated, that is, the bandwidth for accessing network is bigger, and transmission rate is faster, then by connecting transmitted file fragmentation The required time is fewer, to which transmitting terminal can receive reception after sending file fragmentation within the relatively much shorter time The confirmation at end, correspondingly, the time (basic time-out time) waited for before retransmitting file fragmentation are also shorter.
In practical application, as an example, the basic time-out time of different types of access network can pass through one section Used time-out time is counted (hair when transmitting file fragmentation in the access network that transmitting terminal passes through respective type in the time Sending end is counted or is counted by receiving terminal), and the time-out time counted on is sought being worth to.As to nearest one week or January Time-out time is counted and seeks being worth to, and mean value here can be that arithmetic mean of instantaneous value or median (count on Sort value in an intermediate position in the round-trip transmission time), to form different types of access network and basic time-out time Correspondence.
Alternatively, as another example, the basic time-out time of different types of access network, can also pass through one Section the time in, transmitting terminal by respective type access network establish connection transmission file fragmentation when the round-trip transmission time into Row statistics, and the round-trip transmission time counted on is sought being worth to.Such as to nearest one week or the round-trip transmission time in January It is counted and seeks being worth to, mean value here can be arithmetic mean of instantaneous value or the median (round-trip transmission counted on Sort value in an intermediate position in time), to form corresponding pass of the different types of access network with basic time-out time System.
One optional example of different types of access network and the correspondence of basic time-out time is as shown in table 1.
Access network 2G networks 3G/4G WiFi network
Basic time-out time 60 seconds (s) 40s 20s
Table 1
For transmitting terminal detects the type of accessed network, transmitting terminal is based on above-mentioned different types of access net Correspondence between network and basic time-out time, when can determine with the corresponding basis time-out of the access network of transmitting terminal Between.
Step 203, transmitting terminal compensates the basic time-out time accordingly connected based on each establishment of connection time, right It should obtain the initial time-out time of each connection.
In one embodiment, transmitting terminal based on each establishment of connection time, (i.e. held three times with receiving terminal by transmitting terminal Hand connects consumed time to establish), the basic time-out time that accordingly connects seek adduction in a manner of to basic time-out time It compensates, obtains the initial time-out time of each connection.
For example, one that transmitting terminal is established with receiving terminal connect for, it is assumed that transmitting terminal and receiving terminal three-way handshake It is T to establish the time that the connection is consumedconnect, the corresponding basic time-out time of access network of transmitting terminal is Tbase, then should Connecting initial time-out time can be expressed as:
Tinitial=Tbase+Tconnect (1)
When transmitting the time-out of file fragmentation for the first time as connection in conjunction with the underlying transport time of connection and connection setup time Between, the transmission performance (being reflected by basic time-out time) and access net of the entirety reflected from the type of access network Two aspects of the real-time transmission performance of network (being reflected by connection setup time) determine time-out time, both consider transmitting terminal The influence of the factor of this macroscopic view of the type of access network to the transmission performance of connection, and taken into account the different accesses of same type Network is to the difference of (WLAN of the WLAN and 1,000,000,000 bandwidth of 100,000,000 bandwidth) to the transmission performance of connection It influences so that time-out time can accurately reflect the transmission performance of connection.
For example, sending file fragmentation for transmitting terminal access WLAN, 2G cellular networks are accessed compared to transmitting terminal Send file fragmentation the case where, due to the connection setup time of WLAN, necessarily shorter than 2G cellular communications networks when company Settling time is connect, meanwhile, the basic time-out time of WLAN, necessarily the basis of shorter than access 2G cellular communications networks is overtime Time.Therefore, the initial time-out time of WLAN is necessarily shorter than the initial time-out time of 2G cellular networks, is transmitting When failure, the connection established based on WLAN can faster initiate file compared with the connection established based on 2G cellular communications networks Fragment retransmits, to promote efficiency of transmission.
For another example the WLAN for accessing 100,000,000 bandwidth for transmitting terminal sends file fragmentation, terminated compared to sending The case where entering the WLAN transmission file fragmentation of 1,000,000,000 bandwidth, since the connection of 1,000,000,000 bandwidth WLANs is established Time, inevitable shorter than connection setup time of 100,000,000 bandwidth WLANs, meanwhile, the base of 1,000,000,000 bandwidth WLANs Plinth time-out time, the inevitable shorter than basic time-out time of 100,000,000 bandwidth WLANs, therefore, 1,000,000,000 bandwidth wireless locals The initial time-out time of net is necessarily shorter than the initial time-out time of 100,000,000 bandwidth WLANs, when transmitting failure, hair Sending end accesses the connection that 1,000,000,000 bandwidth WLANs are established can access the foundation of 100,000,000 bandwidth WLANs compared with transmitting terminal Connection faster initiate file fragmentation re-transmission, to make full use of high-quality access network promotion efficiency of transmission.
In another embodiment, based on each establishment of connection time, (i.e. transmitting terminal carries out three times transmitting terminal with receiving terminal Shake hands and connect consumed time to establish), the adduction of the first product of basic time-out time and the first weighting coefficient, to deserved To the initial time-out time of each connection.
For example, one that transmitting terminal is established with receiving terminal connect for, it is assumed that transmitting terminal and receiving terminal three-way handshake It is T to establish the time that the connection is consumedconnect, the corresponding basic time-out time of access network of transmitting terminal is Tbase, first adds Weight coefficient is β, then the time-out time T that the connection is initialinitialIt can be expressed as:
Tinitial=Tbase+β*Tconnect (2)
File fragmentation is encapsulated as data message in the TCP protocol layer of transmitting terminal (using the data of file fragmentation as load data) Form transmit in this connection, also, data message inevitably needs to transmit in heterogeneous network, in light of this situation, is Data message is avoided to be fragmented in heterogeneous network, to causing the partial data of a file fragmentation to be lost in heterogeneous network The case where packet, before receiving terminal compensates the basic time-out time of connection, compares transmitting terminal and is passed parallel to receiving terminal first The maximum length for the data message that the capacity and transmitting terminal of defeated file fragmentation are transmitted to receiving terminal, is adjusted based on comparative result Then integral basis plinth time-out time uses comparison result super to the basis after accordingly connecting corresponding adjustment as the first weighting coefficient When the time compensate.
Wherein, for adjusting basic time-out time based on comparative result, such mode may be used:Add with first Weight coefficient and the basic time-out time that the corresponding product for connecting basic time-out time is after adjustment, wherein the first weighting coefficient is hair The maximum length for the data message that sending end is transmitted to the capacity and transmitting terminal of the file fragmentation of receiving terminal parallel transmission to receiving terminal Ratio.
For example, it is assumed that transmitting terminal is SIZE to the capacity of the file fragmentation of receiving terminal parallel transmission, then capacity SIZE can be with It is expressed as:
SIZE=L*Nallow*S (3)
Wherein, L establishes the quantity connecting, N with receiving terminal by transmitting terminalallowAllow the file of simultaneous transmission for connection The quantity of fragment, S are file fragmentation size (capacity).
Assuming that the maximum length for the data message that transmitting terminal is transmitted to receiving terminal is MSS, then MSS is from transmitting terminal to reception The minimum for being big transmission unit (MTU, Maximum Transmission Unit) that each network allows in the passed through network in end Value, when using comparison result as when the first weighting coefficient β, the first weighting coefficient β can be expressed as:
β=SIZE/MSS (4)
Correspondingly, the basic time-out time adjusted based on comparative result can be expressed as:
β*Tconnect=(SIZE/MSS) * Tconnect (5)
Then when comparison result compensates the basic time-out time of adjustment as the first weighting coefficient β, it is obtained just The time-out time T of beginninginitialIt can be expressed as:
Tinitial=Tbase+(SIZE/MSS)*Tconnect (6)
Step 204, receiving terminal is passed based on the corresponding initial time-out time of each connection by each connect to receiving terminal parallel The different file fragmentations of defeated file.
Referring still to Fig. 1, file division is N number of file fragmentation by transmitting terminal, in the text of each connection transmission predetermined quantity Part fragment, it is assumed that it is 2 to allow the quantity of the file fragmentation of simultaneous transmission in each connection, then transmitting terminal passes in connection 1 first Defeated file fragmentation 1 and file fragmentation 2, transmission file fragmentation 3 and file fragmentation 4 in connection 2.
T is based on after being sent for each fragmentinitialStart timing and is handled accordingly, by taking file fragmentation 1 as an example, If in initial time-out time TinitialIt is not received by the response for file fragmentation 1 that server is returned by connection 1, File fragmentation 1 is then transmitted again, when file fragmentation 1 again is more than pre-determined number (such as 3 times) and does not receive the response of server, It, can be with ends file transfer, if transmission text if the spent time of transmission file has exceeded the predetermined time (such as 8 minutes) The spent time of part without departing from predetermined time (such as 8 minutes), then can attempt replacement IP address and continue to attempt to pass again Defeated file fragmentation 1.
After receiving terminal transmits file fragmentation by the initial time-out time of connection, new text is subsequently being transmitted every time When part fragment, or when meeting predetermined condition by connecting the new file fragmentation of transmission, pass through the time-out used connection Time (such as initial time-out time) compensates, the newer time-out time connected, based on newer time-out time after The file fragmentation for resuming defeated file executes following step 205 and step 206 to complete by cycle.
Step 205, history round-trip transmission time of the transmitting terminal based on each connection, to the history time-out time that accordingly connects into Row compensation obtains the corresponding newer time-out time of each connection.
Step 206, newer time-out time of the transmitting terminal based on each connection is connected by each to receiving terminal parallel transmission text The different file fragmentations of part.
Step 205 and step 206 are executed with reference to cycle to illustrate the realization method for updating time-out time.
For example, when executing step 205 for the first time, history time-out time ThistoryThe initial of determination surpasses as in step 203 When time Tinitial, history round-trip transmission time RTThistoryAs by connecting the initial round-trip of transmission file fragmentation for the first time Transmission time RTTinitial(that is, consumed to the response for receiving receiving terminal return by connecting first transmission file fragmentation Time), the initial round-trip transmission time RTT based on each connectioninitial, to the initial time-out time T accordingly connectedinitial It compensates, obtains the corresponding newer time-out time of each connection.
When executing step 206 for the first time, as a kind of compensation way, by the initial time-out of initial time-out time and connection The mode of temporal summation compensates, the corresponding newer time-out time T of obtained connectionoptimalIt can be expressed as:
Toptimal=RTTinitial+Tinitial (7)
Subsequently, when executing step 204 again, history time-out time is the time-out time of last update Tlasttime, the history round-trip transmission time is the last round-trip transmission time that file fragmentation is transmitted by connection RTTlasttime(that is, by connect that the last transmission file fragmentation to the response for receiving receiving terminal return consumed when Between), then history round-trip transmission time based on each connection, to the initial time-out time T accordingly connectedinitialIt compensates, Obtain the corresponding newer time-out time of each connection.
As a kind of compensation way, the side that the history time-out time of the history round-trip transmission time of connection and connection is summed Formula compensates, obtained newer time-out time ToptimalIt can be expressed as:
Toptimal=RTTlasttime+Tlasttime (8)
Subsequently, when step 205 and step 206 execute again, according to above-mentioned formula (8) can iteration update time-out time, It repeats no more.
Continue to illustrate the above-mentioned compensation way for history time-out time, it is false as another compensation way If the history time-out time of connection is Thistory, then can be by the history round-trip transmission time of the time-out time of history and connection RTThistoryThe mode of summation is to history time-out time ThistoryIt compensates, the corresponding newer time-out time of obtained connection ToptimalIt can be expressed as:
Toptimal=RTThistory+Thistory (9)
It may be noted that ground, when the time-out time of compensation is not initial time-out time the case where, text has been transmitted for connection History round-trip transmission time RTT corresponding to part fragmenthistoryValue for, value is there are many optional situation, for example, taking Value can be by connecting the round-trip transmission time RTT corresponding to the last transmission file fragmentationlasttime, alternatively, value can To be the mean value RTT by connecting the time-out time corresponding to transmission section or all files fragmentaverage;Similarly, for even The history time-out time T connecthistoryValue for, value is there are many optional situation, for example, value can pass through connection Used time-out time T when the last time transmission file fragmentationlasttime, alternatively, value can be by connecting transmission section Or the mean value T of time-out time used in all files fragmentaverage
From this point of view, the expression expression way shown in addition to use formula (8) based on formula (9), newer time-out time, There can also be other expression ways, to be based on mean value RTTaverageWith the mean value T of time-out timeaverageFor expression way, more New time-out time ToptimalIt can be expressed as:
Toptimal=RTTaverage+Taverage (10)
In another embodiment, the interchangeable compensation way of the compensation way shown as aforementioned formula (9), provides The mode that another kind compensates time-out time.First, the history round-trip transmission time of each connection is adjusted, to each company The history time-out time connect is adjusted, then, the history round-trip transmission time after the adjustment based on each connection, to accordingly connecting Adjustment after history time-out time compensate, obtain the corresponding newer time-out time of each connection.
It, can be with the history round-trip transmission time of connection for the history round-trip transmission time to connection is adjusted RTThistory(i.e. since transmitting file fragmentation by the connection, until receive from receiving terminal for this document fragment Confirm consumed time) the second product α * RTT with the second weighting coefficient α (being less than 1)historyIt is past as the history after adjustment Return transmission time.
It, can be with the history time-out time T of connection for the history time-out time to connection is adjustedhistoryWith Third product (1- α) * T of three weighting coefficient 1- α (being less than 1, it is of course also possible to for any other value for being less than 1)history As the history time-out time after corresponding connection adjustment.
Correspondingly, the newer time-out time T of connectionoptimalIt can be expressed as:
Toptimal=α * RTThistory+(1-α)*Thistory (11)
Similarly with compensation way above-mentioned, for the history round-trip transmission time RTT of connectionhistoryFor, value has The case where plurality of optional, history round-trip transmission time RTThistoryCan be right by connecting the last transmission file fragmentation institute The round-trip transmission time RTT answeredlasttime, alternatively, can be super corresponding to transmission section or all files fragment by connecting When the time mean value RTTaverage;Similarly, for the history time-out time T of connectionhistoryFor, there are many optional feelings for value Condition, for example, it may be used time-out time T when by connecting the last transmission file fragmentationlasttime, alternatively, can be with It is the mean value T by connecting time-out time used in transmission section or all files fragmentaverage
For example, working as ThistoryValue used time-out time when being by connecting the last transmission file fragmentation Tlasttime, and RTThistoryValue is by connecting round-trip transmission time RTT corresponding to the last transmission file fragmentationlasttime When, the newer time-out time T of connectionoptimalIt can be expressed as:
Toptimal=α * RTTlasttime+(1-α)*Tlasttime (12)
For another example working as ThistoryValue is by connecting time-out time used in transmission section or all files fragment Mean value Taverage, and RTThistoryValue is by connecting the time-out time corresponding to transmission section or all files fragment Mean value RTTaverageWhen, the newer time-out time T of connectionoptimalIt can be expressed as:
Toptimal=α * RTTaverage+(1-α)*Taverage (13)
It is illustrated with reference to this compensation way to updating time-out time in step 205.
When executing step 205 for the first time, as a kind of compensation way, initial round-trip transmission time RTT will be connectedinitialWith Second weighting coefficient α is multiplied to form the second product α * RTTinitial, by the initial time-out time T of connectioninitialIt is weighted with third Coefficient (1- α) multiplication forms third product (1- α) * Tinitial, to initial in such a way that the second product seeks adduction with third product Time-out time TinitialIt compensates, the newer time-out time T of obtained connectionoptimalIt can be expressed as:
Toptimal=α * RTTinitial+(1-α)*Tinitial (14)
Subsequently, when executing step 205 again, history time-out time is the time-out time of last update Tlasttime, the history round-trip transmission time is the last round-trip transmission time that file fragmentation is transmitted by connection RTTlasttime(that is, by connect that the last transmission file fragmentation to the response for receiving receiving terminal return consumed when Between), then history round-trip transmission time based on each connection, to the initial time-out time T accordingly connectedinitialIt compensates, Obtain the corresponding newer time-out time of each connection.
Correspondingly, the mode that the history time-out time of the history round-trip transmission time of connection and connection is summed is mended It repays, obtained newer time-out time ToptimalIt can be expressed as:
Toptimal=α * RTTlasttime+(1-α)*Tlasttime (15)
Subsequently, when step 205 and step 206 execute again, according to above-mentioned formula (15) can iteration update time-out time, It repeats no more.
In another embodiment, another mode compensated to time-out time is provided, based on above-mentioned compensation Mode, the history round-trip transmission time after the adjustment based on each connection compensate it to the history time-out time accordingly connected Afterwards, also the history time-out time accordingly connected is carried out again based on the number by each connection again transmission identical file fragment Compensation, obtains the newer time-out time of each connection.
For example, by each connection again number RetryTimes of transmission identical file fragment and dynamic adjustment network base The product δ * RetryTimes of number product δ compensate the history time-out time accordingly connected, i.e., by connection transmission file point The history time-out time of piece and the second product α * RTT of the second weighting coefficienthistory, corresponding history round-trip transmission time for connecting ThistoryWith third product (1- α) * T of third weighting coefficient (1- α)historySummation is summed up, obtains determining that each connection corresponds to Newer time-out time Toptimal, can be expressed as:
Toptimal=α * RTThistory+(1-α)*Thistory+δ*RetryTimes (16)
Similarly, work as ThistoryValue used time-out time when being by connecting the last transmission file fragmentation Tlasttime, and RTThistoryValue is by connecting round-trip transmission time RTT corresponding to the last transmission file fragmentationlasttime When, the newer time-out time T of connectionoptimalIt can be expressed as:
Toptimal=α * RTTlasttime+(1-α)*Tlasttime+δ*RetryTimes (17)
When compensating history time-out time, by the way that the factor of the number of transmissions is added again, can be current based on connection Actual transmissions performance accurately determines time-out time.
In one embodiment, for each connection established between transmitting terminal and receiving terminal, transmitting terminal is in each company After connecing transmission file fragmentation, i.e., the history time-out time of connection is compensated by step 205, to form newer time-out Time carries out the transmission of subsequent file fragmentation based on newer time-out time by connecting.A text is often transmitted by connecting The time-out time that i.e. update connects after part fragment, the actual conditions that can be directed to access network (such as access network failure, access Network bandwidth is promoted) adaptive adjustment time-out time, ensure the efficiency of file transmission.
In another embodiment, for each connection established between transmitting terminal and receiving terminal, transmitting terminal detection is The no predetermined condition for meeting update time-out time, it is when predetermined condition meets, i.e., past by history of the step 205 based on each connection Transmission time is returned, the history time-out time accordingly connected is compensated, obtains the corresponding newer time-out time of each connection.
Illustratively, predetermined condition may include following several types:
Update condition 1) transmitting terminal do not received in time-out time transmitting terminal be directed to transmitted file fragmentation response;
Update condition 2) transmitting terminal by connection retransmit file fragmentation number exceed pre-determined number when, do not receive reception yet Response of the end for transmitted file fragmentation;
Update condition 3) time of file fragmentation for being transmitted to receiving terminal of transmitting terminal reaches the scheduled update time;
Update condition 4) quantity of file fragmentation transmitted to receiving terminal of transmitting terminal reaches predetermined file fragment quantity;
Update condition 5) quantity of file transmitted to receiving terminal of transmitting terminal reaches predetermined file quantity.
The example of above-mentioned update condition is merely illustrative, and in the absence of conflict, above-mentioned update condition can select one or group It closes and uses, judge whether the scheme for updating time-out time using predetermined condition.
For example, the network quality of the access network of transmitting terminal is stablized, and transmitting terminal frequently transmits text to receiving terminal The case where part fragment, in general, when meeting above-mentioned update condition 1) to update condition 3) when, illustrate current time-out time with The network quality of access network is adaptation, and the network quality for accessing network is stablized, in this case, it is not necessary to connect passing through Connect the time-out time that i.e. update connects after transmission file fragmentation every time, on the one hand, for transmitting terminal, calculating money can be saved The expense in source, on the other hand, can timely update time-out time when being unsatisfactory for predetermined condition, ensure that file transmission efficiency.
Below in for document transmission process and file be transmitted after some cases illustrate.
In the transmission process of file, after each connect to the different file fragmentations of receiving terminal parallel transmission file, When the newer time-out time accordingly connected reaches, including following 2 kinds of situations:
If 1) receive the confirmation that receiving terminal is directed to transmitted file fragmentation, continue the file to be transmitted for transmitting file Fragment.
2) corresponding file fragmentation is transmitted again if not receiving receiving terminal for the response of transmitted file fragmentation, when Again when transmission file fragmentation is more than pre-determined number (such as 3 times) and does not receive the response of receiving terminal:
If 2.1) the spent time of transmission file has exceeded the predetermined time (such as 8 minutes), illustrate to access net at this time Network is likely to occur problem, it is not necessary that continues to transmit file, then can be with ends file transfer, and send out access network and be likely to occur The prompt of failure, to restore file transmission as early as possible.
2.2) if the spent time of transmission file without departing from predetermined time (such as 8 minutes), can attempt to replace IP address simultaneously updates time-out time, continues re-transmission file fragmentation by connection based on newer time-out time, by with replacing IP The mode of location and the mode for updating time-out time restore file transmission, ensure file transmission efficiency as early as possible.
After file is transmitted, including following 2 kinds of situations:
1) if transmitting terminal and the connection type that receiving terminal is established are short connection, by 4-Way Handshake operation release and receive The connection established is held, receiving terminal is saved and safeguards the resource consumption largely concurrently connected.
2) if transmitting terminal and the connection type that receiving terminal is established are long connection, transmitting terminal is believed by sending heartbeat to receiving terminal The mode of breath keeps each connection, until the scheduled retention time reaches, and when being transmitted there is no file fragmentation by with receiving terminal It executes 4-Way Handshake operation and discharges each connection.Since long connection has certain time is still maintained when no file fragmentation transmits Characteristic, when transmitting terminal continuously transmits multiple files to receiving terminal, the resource that can be saved between transmitting terminal and receiving terminal disappears Consumption and time loss
In the following, again to when transmitting terminal is finished to the file fragmentation of receiving terminal one file of transmission and it is expected to continue to transmit new text The case where file fragmentation of part, illustrates.
Step 207, when transmitting terminal needs to transmit new file to receiving terminal, the file point based on each connection transmission history file The history round-trip transmission time of piece, the history time-out time of each connection is compensated, it is corresponding newer super to obtain each connection When the time.
The file fragmentation that new file is transmitted to receiving terminal is connected since transmitting terminal is multiplexed, when transmitting terminal update is overtime Between when, used time-out time when can be in conjunction with each connection history file, based on formula (8), to the last time of each connection The time-out time of the file fragmentation of transmission history file compensates, and forms newer time-out time, alternatively, to being based on formula (10), the mean value of the time-out time of some or all of the transmission history file of each connection file fragmentation is compensated, is formed Newer time-out time, specific compensation way are repeated no more referring to can be understood according to record above-mentioned.
Step 208, transmitting terminal is based on the corresponding newer time-out time of each connection, is passed parallel by each connect to receiving terminal The different file fragmentations of defeated new file.
It is to be appreciated that after the processing of foregoing description being directed in the transmission process of file and file are transmitted Processing stand good new file file fragmentation transmission, repeat no more.
It is illustrated for the aforementioned functional structure for setting electronic equipment, is provided in an embodiment of the present invention referring to Fig. 6, Fig. 6 One optional illustrative view of functional configuration of electronic equipment, including:
Overtime unit 21 is determined and is built between transmitting terminal and receiving terminal for the type of the access network based on transmitting terminal The initial time-out time of at least two vertical connections;
Transmission unit 22 is used for the initial time-out time based on each connection, is connected to receiving terminal parallel transmission by each The different file fragmentations of file;
Compensating unit 23 is used for the history round-trip transmission time based on each connection, to the history time-out time accordingly connected It compensates, obtains the newer time-out time of each connection;
Transmission unit 22 is additionally operable to the newer time-out time based on each connection, is passed parallel by each connect to receiving terminal The different file fragmentations of defeated file.
In one embodiment, overtime unit 21 is additionally operable to based on different types of access network and basic time-out time Between correspondence, determine with transmitting terminal access network it is corresponding basis time-out time;When based on each establishment of connection Between the basic time-out time accordingly connected is compensated, correspondence obtain the initial time-out time of each connection.
In one embodiment, overtime unit 21 is additionally operable to basic time-out time corresponding to each connection and compensates it Before, compare the data that transmitting terminal can be transmitted to the capacity and transmitting terminal of the file fragmentation of receiving terminal parallel transmission to receiving terminal The maximum length of message adjusts the basic time-out time accordingly connected based on comparative result.
For example, when overtime unit 21 adjusts the basic time-out time accordingly connected based on comparative result, using such Mode:It is the basic time-out time after adjusting with the first weighting coefficient and the corresponding product for connect basic time-out time, wherein the One weighting coefficient is the data that transmitting terminal is transmitted to the capacity and transmitting terminal of the file fragmentation of receiving terminal parallel transmission to receiving terminal The ratio of the maximum length of message.
In one embodiment, compensating unit 23 are additionally operable to be adjusted the history round-trip transmission time of each connection, right The time-out time of the history respectively connected is adjusted, the history round-trip transmission time after the adjustment based on each connection, to accordingly connecting Time-out time after the adjustment connect compensates, and obtains the newer time-out time of each connection.
For example, being gone through to what is accordingly connected based on the history round-trip transmission time after the adjustment of each connection in compensating unit 23 When history time-out time compensates, in this manner:It determines used when each connection the last time transmission file fragmentation Time-out time and past back pass when the second product of the second weighting coefficient and the corresponding the last transmission file fragmentation connected The third product of defeated time and third weighting coefficient, the adduction based on the second product Yu third product, obtain the update of each connection Time-out time.
In one embodiment, compensating unit 23 are additionally operable to the history round-trip transmission time after the adjustment based on each connection, After being compensated to the history time-out time accordingly connected, based on the number for transmitting identical file fragment again by each connection The history time-out time accordingly connected is compensated again, obtains the newer time-out time of each connection.
For example, in compensating unit 23 based on the number by each connection again transmission identical file fragment to accordingly connecting When history time-out time compensates in this manner:
By it is each connection again transmission identical file fragment number with dynamic adjust network radix product adduction, with it is corresponding (the history time-out time of i.e. corresponding connection transmission file fragmentation multiplies the history time-out time of connection with the second of the second weighting coefficient Product, the history round-trip transmission time accordingly connected and the third product of third weighting coefficient sum up) summation, it obtains determining each Connect corresponding newer time-out time.
In one embodiment, transmission unit 22, the number for being additionally operable to again transmit file fragmentation by connection be more than Pre-determined number and transmit file spent by time without departing from the predetermined time when, update the internet protocol address of transmitting terminal, and base In newer time-out time, file fragmentation is transmitted by connection again.
In one embodiment, compensating unit 23 are additionally operable to, when needing to transmit new file to receiving terminal, be based on each connection The history round-trip transmission time of transmission history file fragmentation carries out the history time-out time of each connection transmission history file fragmentation Compensation obtains the corresponding newer time-out time of each connection;
Transmission unit 22 is additionally operable to, based on the corresponding newer time-out time of each connection, connect to receiving terminal simultaneously by each Row transmits the different file fragmentations of new file.
In one embodiment, transmission unit 22 are additionally operable to be long connection when the type of each connection and be transmitted to receiving terminal Each connection is kept after the completion of the file fragmentation of file, until the scheduled retention time reaches and there is no released when file fragmentation transmits Put each connection.
Referring to Fig. 7, Fig. 7 be user end to server provided in an embodiment of the present invention transmit one of file fragmentation it is optional Flow diagram, a business scenario for transmitting file to user end to server in conjunction with Fig. 7 illustrate.
One, the basic time-out time of the different types of network of hind computation (access network), is handed down to client.
Backstage connects data by the magnanimity to client daily and carries out statistics and analysis, for using same type network Client, the median of time-out time used in the connection using client transmissions fragment, as respective type network pair The basic time-out time T answeredbase, it is then handed down to client by way of configuring, it is primary to configure update daily.Such as the base of 2G Plinth time-out time is that 60s, 3G and 4G are 40s, and the basic time-out time of WiFi network is 20s.
Two, client calculates the initial time-out time that newly-built connection is transmitted for the first time.
Client and server establishes a plurality of connection simultaneously, client by newly-built connection transmit the first component sheets it Before, according to the basic time-out time T of current accessed networkbase, establish when time connection time (elapsed time) TconnectSimultaneously Hair transmits the total size SIZE of fragment to calculate the initial time-out time T that newly-built connection is transmitted for the first timeinitial, as follows:
Tinitial=Tbase+(SIZE/MSS)*Tconnect (6)
Wherein, every connection of concurrent transmission fragment total size SIZE=connection numbers * allows the fragment number * fragments of simultaneous transmission Size, by taking Fig. 1 as an example, it is assumed that connection number is 2, and every connection allows the quantity of the file fragmentation of simultaneous transmission to be 2, and fragment is big Small is 4KB, then SIZE is 2*2*4KiB=16KiB.MSS be network allow transmission maximum message size, usually 1460B or For smaller value.Then, client is according to initial time-out time TinitialSend the first component sheets.
In order to assess network quality in real time, show that successive fragment transmits optimal time-out time, client will also combine The time-out time T of previous sliced transmissionlasttime, previous sliced transmission round-trip transmission time RTTlasttimeTo calculate when secondary point The optimal time-out time T of piece transmissionoptimal, as follows:
Toptimal=α * RTTlasttime+(1-α)*Tlasttime+δ*RetryTimes (17)
Wherein, α is weighting coefficient, 0<α<1, generally take 1/8.δ is dynamic adjustment network time radix, such as 5s, i.e. fragment It often retries once, increases the time-out time of 5s.α and δ can be adjusted optimal value according to actual conditions, then pass through and configure Mode be handed down to client.
In order to avoid network quality is deteriorated suddenly, cause to work as ToptimalThe too small heavy new transmission file fragmentation of time-frequency, works as meter The T obtainedoptimalWhen limiting range beyond preset range [10s, 120s], then the boundary value conduct of the preset range is taken Toptimal
Three, client is according to optimal time-out time ToptimalSubsequent file fragment is sent, to creating connected first group For fragment, optimal time-out time ToptimalEqual to Tinitial
Four, client decides whether to retransmit fragment according to the optimal time-out time of file fragmentation.
Client is according to optimal time-out time ToptimalFile fragmentation is sent, if in optimal time-out time ToptimalReach Afterwards, the response of file fragmentation returns to client not yet, and client then retransmits this document fragment, and recalculates time-out time, Until reaching maximum number of retries or reaching the maximum sending time of file permission.
Five, client sends heartbeat message and keeps connection, is sent out using last file when subsequently sending the fragment of new file The time-out information sent.
After file is sent completely, heartbeat keep-alive of hair per minute connection, continuous 3 minutes files without new file point Piece transmission, which is sent, then discharges connection.It is directly last using last file if there is the file fragmentation of new file to send in 3 minutes The optimal time-out time of one file fragmentation and RTT times calculate the initial of new the first component sheets of file based on formula (17) Time-out time.
It is that mobile phone QQ clients provided in an embodiment of the present invention (hereinafter referred to as client) are passed to server referring to Fig. 8, Fig. 8 One optional flow diagram of the file fragmentation of defeated rich media format, in conjunction with Fig. 8 to client such as mobile phone QQ clients to One business scenario of server transport file illustrates.
Client establishes multiple connections with server, is split to form text to file to be transmitted according to fixed size Part fragment calculates initial time-out time based on above-mentioned formula (6) and transmits file when by connecting first transmission file fragmentation Fragment Tinitial, when transmitting file fragmentation again, counted according to the round-trip transmission time RTT of connection, based on above-mentioned formula (17) Calculate time-out time T optimal when current file sliced transmissionoptimal
In the transmission process of file fragmentation, if after transmission is by connecting a certain file fragmentation of transmission, in time-out Between (initial transmission Tinitial, subsequent transmission Toptimal), it is not received by server in time-out time and receives file point The response of piece, then transmit file fragmentation again, until receiving the response of server and continuing to transmit remaining file fragmentation.When Again file fragmentation is more than pre-determined number (such as 3 times) and when not receiving the response of server, if transmission file it is spent when Between exceeded the predetermined time (such as 8 minutes), then can be with ends file transfer, if the spent time of transmission file is not super Go out the predetermined time (such as 8 minutes), then can attempt to replace IP address, newly-built connection is realized since replacement IP address is equivalent to Therefore effect after replacing IP address, the initial time-out time for the connection for replacing IP address is recalculated based on formula (6), It continues to attempt to transmit file fragmentation again by connection based on initial time-out time, when transmission file fragmentation success again, and When continuing to transmit file fragmentation, optimal time-out time is calculated by formula (17), and company is passed through based on optimal time-out time It succeeds and resumes defeated file fragmentation.
In conclusion the embodiment of the present invention realizes following advantageous effect:
The embodiment of the present invention, solving cannot reflect network quality so as to cause abnormal net in real time using fixed-timeouts duration Under network state, time-out time long the problem of dragging down efficiency of transmission of file fragmentation is retransmitted.
According to basic time-out time different in different access networks (2G, 3G, 4G and WiFi), each sliced transmission Round-trip transmission time, previous transmission time-out time, the total size of concurrent transmission fragment and the number of retries of fragment dynamically calculate The optimal time-out time of transmission, can quickly incude the variation of network quality, allow file fragmentation can under various network states There is rational time-out time, to reduce forward delay interval, promotes transmission speed or reduce flow consumption.
Or it can be fast when network restores from abnormality to normal condition especially under high-quality wireless network Speed, which retransmits, loses fragment, to which forward delay interval be greatly reduced, improves file transfer speed, and then bring better file to user Transmission experience.
Under the conditions of heterogeneous networks, rational fragment time-out time can be arranged in transmitting terminal, to reduce the transmission of file Delay promotes file transfer speed or saves customer flow.By data statistics, using the embodiment of the present invention in 2G nets The average forward delay interval of file under network, which reduces, reduces about 10% under 15% or so, 3G and 4G networks, WiFi network declines Low about 5%, effectively improve file transmission efficiency.
It will be appreciated by those skilled in the art that:Realize that all or part of step of above method embodiment can pass through journey Sequence instructs relevant hardware to complete, and program above-mentioned can be stored in a computer read/write memory medium, which exists When execution, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:Flash memory device is deposited at random Access to memory (RAM, Random Access Memory), read-only memory (ROM, Read-Only Memory), magnetic disc or The various media that can store program code such as CD.
If alternatively, the above-mentioned integrated unit of the present invention is realized in the form of software function module and as independent product Sale in use, can also be stored in a computer read/write memory medium.Based on this understanding, the present invention is implemented The technical solution of example substantially in other words can be expressed in the form of software products the part that the relevant technologies contribute, The computer software product is stored in a storage medium, including some instructions are used so that computer installation (can be with It is personal computer, server or network equipment etc.) execute all or part of each embodiment the method for the present invention. And storage medium above-mentioned includes:Flash memory device, RAM, ROM, magnetic disc or CD etc. are various can to store program code Medium.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (16)

1. a kind of document transmission method, which is characterized in that including:
The type of access network based on transmitting terminal, determines at least two connections established between the transmitting terminal and receiving terminal Initial time-out time;
Based on the initial time-out time of each connection, described connected to the receiving terminal parallel transmission file not by each Same file fragmentation;
The history round-trip transmission time based on each connection, the history time-out time accordingly connected is compensated, is obtained each The newer time-out time of the connection;
Based on the newer time-out time of each connection, described connected to file described in the receiving terminal parallel transmission by each Different file fragmentations.
2. the method as described in claim 1, which is characterized in that the type of the access network based on transmitting terminal determines institute The initial time-out time at least two connections established between transmitting terminal and the receiving terminal is stated, including:
Based on the correspondence between different types of access network and basic time-out time, the access with the transmitting terminal is determined The corresponding basic time-out time of network;The basic time-out time accordingly connected is carried out based on each establishment of connection time Compensation, correspondence obtain the initial time-out time of each connection.
3. method as claimed in claim 2, which is characterized in that further include:
Before being compensated to the corresponding basic time-out time of each connection, the transmitting terminal is parallel to the receiving terminal The maximum length of the capacity of the file fragmentation of transmission, the data message that can be transmitted to the receiving terminal with the transmitting terminal, base The basic time-out time accordingly connected is adjusted in comparison result.
4. the method as described in claim 1, which is characterized in that the history round-trip transmission time based on each connection, The history time-out time accordingly connected is compensated, the newer time-out time of each connection is obtained, including:
The history round-trip transmission time of each connection is adjusted, the time-out time of the history of each connection is adjusted It is whole, the history round-trip transmission time after the adjustment based on each connection, to the history time-out time after the adjustment that accordingly connects It compensates, obtains the newer time-out time of each connection.
5. method as claimed in claim 4, which is characterized in that further include:
The history round-trip transmission time after adjustment based on each connection, the history time-out time accordingly connected is compensated Later, based on the number by each connection again transmission identical file fragment to the history time-out time that accordingly connects again It compensates, obtains the newer time-out time of each connection.
6. the method as described in claim 1, which is characterized in that further include:
When the number by the connection again transmission identical file fragment is more than spent by pre-determined number and the transmission file Time without departing from the predetermined time when, update the transmitting terminal it is described access network internet protocol address, and based on update Time-out time, by it is described connection transmit the file fragmentation again.
7. the method as described in claim 1, which is characterized in that further include:
When needing to transmit new file to the receiving terminal, the history based on each connection transmission history file fragmentation is toward back pass The defeated time compensates the history time-out time of each connection transmission history file fragmentation, obtains each connection and correspond to Newer time-out time;Based on the corresponding newer time-out time of each connection, described connected to the reception by each Hold the different file fragmentations of new file described in parallel transmission.
8. the method as described in claim 1, which is characterized in that further include:
When the type of each connection is long connection and transmits the file fragmentation holding after the completion of the file to the receiving terminal Each connection, until the scheduled retention time reaches and there is no discharge each connection when file fragmentation transmits.
9. a kind of equipment, the equipment is as transmitting terminal, which is characterized in that including:
Overtime unit, for the type of the access network based on the transmitting terminal, determine the transmitting terminal and the receiving terminal it Between established at least two connection initial time-out times;
Transmission unit is used for the initial time-out time based on each connection, described is connected to the receiving terminal simultaneously by each The different file fragmentations of row transmission file;
Compensating unit is used for the history round-trip transmission time based on each connection, to the history time-out time that accordingly connects into Row compensation, obtains the newer time-out time of each connection;
The transmission unit is additionally operable to the newer time-out time based on each connection, is connect by each described connect to described The different file fragmentations of file described in receiving end parallel transmission.
10. equipment as claimed in claim 9, which is characterized in that
The time-out unit, is additionally operable to based on the correspondence between different types of access network and basic time-out time, really Fixed basic time-out time corresponding with the access network of the transmitting terminal;Based on each establishment of connection time to accordingly connecting The basic time-out time connect compensates, and correspondence obtains the initial time-out time of each connection.
11. equipment as claimed in claim 10, which is characterized in that
The time-out unit, before being additionally operable to compensate the corresponding basic time-out time of each connection, the hair The number that sending end can be transmitted to the capacity of the file fragmentation of the receiving terminal parallel transmission and the transmitting terminal to the receiving terminal According to the maximum length of message, the basic time-out time accordingly connected is adjusted based on comparative result.
12. equipment as claimed in claim 9, which is characterized in that
The compensating unit is additionally operable to be adjusted the history round-trip transmission time of each connection, to each connection The time-out time of history is adjusted, the history round-trip transmission time after the adjustment based on each connection, to what is accordingly connected History time-out time after adjustment compensates, and obtains the newer time-out time of each connection.
13. equipment as claimed in claim 12, which is characterized in that
The compensating unit is additionally operable to the history round-trip transmission time after the adjustment based on each connection, to what is accordingly connected After history time-out time compensates, based on the number by each connection again transmission identical file fragment to accordingly connecting The history time-out time connect compensates again, obtains the newer time-out time of each connection.
14. equipment as claimed in claim 9, which is characterized in that
The transmission unit, be additionally operable to when by it is described connect transmit again the file fragmentation number be more than pre-determined number, And when transmitting the time spent by the file without departing from the predetermined time, update the internet protocol address of the transmitting terminal, and base In newer time-out time, file fragmentation is transmitted by the connection again.
15. equipment as claimed in claim 9, which is characterized in that
The compensating unit is additionally operable to, when needing to transmit new file to the receiving terminal, be based on each connection transmission history The history round-trip transmission time of file fragmentation mends the history time-out time of each connection transmission history file fragmentation It repays, obtains the corresponding newer time-out time of each connection;
The transmission unit, is additionally operable to based on the corresponding newer time-out time of each connection, described is connected to institute by each State the different file fragmentations of new file described in receiving terminal parallel transmission.
16. equipment as claimed in claim 9, which is characterized in that
The transmission unit is additionally operable to be long connection when the type of each connection and transmits the file to the receiving terminal File fragmentation after the completion of keep each connection, until the scheduled retention time reach and there is no released when file fragmentation transmits Put each connection.
CN201710068011.7A 2017-02-07 2017-02-07 File transmission method and equipment Active CN108401002B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710068011.7A CN108401002B (en) 2017-02-07 2017-02-07 File transmission method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710068011.7A CN108401002B (en) 2017-02-07 2017-02-07 File transmission method and equipment

Publications (2)

Publication Number Publication Date
CN108401002A true CN108401002A (en) 2018-08-14
CN108401002B CN108401002B (en) 2021-01-01

Family

ID=63093798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710068011.7A Active CN108401002B (en) 2017-02-07 2017-02-07 File transmission method and equipment

Country Status (1)

Country Link
CN (1) CN108401002B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543988A (en) * 2018-11-16 2019-03-29 中国银行股份有限公司 The method, apparatus and storage medium of optimization transaction overtime threshold
CN110213320A (en) * 2019-01-02 2019-09-06 腾讯科技(深圳)有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of communication connection
CN111147332A (en) * 2019-12-29 2020-05-12 北京浪潮数据技术有限公司 Method, system and related device for determining uploading progress of cloud backup of storage system
CN111355929A (en) * 2020-03-09 2020-06-30 江苏经贸职业技术学院 Public welfare system and method based on electronic commerce
CN112468354A (en) * 2019-09-09 2021-03-09 阿里巴巴集团控股有限公司 Time data recording method, device and equipment
CN115766519A (en) * 2022-10-24 2023-03-07 株洲华通科技有限责任公司 Data transmission method and system for portable communication equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103718477A (en) * 2011-12-28 2014-04-09 Sk电信有限公司 Multi-network-based simultaneous data transmission method and apparatus applied to same
CN104022852A (en) * 2014-06-25 2014-09-03 北京奇艺世纪科技有限公司 Document transmission method and device
CN104168093A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 File transmission method and device
JP2015023320A (en) * 2013-07-16 2015-02-02 日本放送協会 Parallel distributed management device, program, and parallel distributed processing system
CN104519090A (en) * 2013-09-27 2015-04-15 深圳市腾讯计算机系统有限公司 Method and device for file transfer
CN105791054A (en) * 2016-04-22 2016-07-20 西安交通大学 Autonomous controllable and reliable multicast transmission method based on flow classification realization

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103718477A (en) * 2011-12-28 2014-04-09 Sk电信有限公司 Multi-network-based simultaneous data transmission method and apparatus applied to same
CN104168093A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 File transmission method and device
JP2015023320A (en) * 2013-07-16 2015-02-02 日本放送協会 Parallel distributed management device, program, and parallel distributed processing system
CN104519090A (en) * 2013-09-27 2015-04-15 深圳市腾讯计算机系统有限公司 Method and device for file transfer
CN104022852A (en) * 2014-06-25 2014-09-03 北京奇艺世纪科技有限公司 Document transmission method and device
CN105791054A (en) * 2016-04-22 2016-07-20 西安交通大学 Autonomous controllable and reliable multicast transmission method based on flow classification realization

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543988A (en) * 2018-11-16 2019-03-29 中国银行股份有限公司 The method, apparatus and storage medium of optimization transaction overtime threshold
CN110213320A (en) * 2019-01-02 2019-09-06 腾讯科技(深圳)有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of communication connection
CN110213320B (en) * 2019-01-02 2021-11-02 腾讯科技(深圳)有限公司 Communication connection method and device, electronic equipment and computer readable storage medium
CN112468354A (en) * 2019-09-09 2021-03-09 阿里巴巴集团控股有限公司 Time data recording method, device and equipment
CN111147332A (en) * 2019-12-29 2020-05-12 北京浪潮数据技术有限公司 Method, system and related device for determining uploading progress of cloud backup of storage system
CN111355929A (en) * 2020-03-09 2020-06-30 江苏经贸职业技术学院 Public welfare system and method based on electronic commerce
CN111355929B (en) * 2020-03-09 2021-10-26 江苏经贸职业技术学院 Information transmission method based on advertisement player
CN115766519A (en) * 2022-10-24 2023-03-07 株洲华通科技有限责任公司 Data transmission method and system for portable communication equipment

Also Published As

Publication number Publication date
CN108401002B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN108401002A (en) Document transmission method and equipment
JP7154399B2 (en) DATA TRANSMISSION METHOD, APPARATUS, COMPUTER-READABLE MEDIUM AND ELECTRONIC DEVICE
US8750188B2 (en) System support for accessing and switching among multiple wireless interfaces on mobile devices
Dogar et al. Catnap: Exploiting high bandwidth wireless interfaces to save energy for mobile devices
US9100854B2 (en) Quality of service application controller and user equipment application profiler
US10686866B2 (en) Method and system for sending data
JP6510142B2 (en) System and method for rate based packet transmission through a network
EP2763036A1 (en) Terminal inter-application network resource allocation method and device thereof
US20190020594A1 (en) System for early system resource constraint detection and recovery
US7227847B2 (en) Power management system and method for a wireless communications device
CA2945702A1 (en) Buffer sizing for multi-hop networks
US11206706B2 (en) Method and apparatus for web browsing on multihomed mobile devices
CN104158755A (en) Method, device and system used for transmitting messages
US20090086650A1 (en) Method and system for conserving power by degrading network connection speed
US20240069977A1 (en) Data transmission method and data transmission server
CN109429306A (en) A kind of communication means and terminal device
US11316916B2 (en) Packet processing method, related device, and computer storage medium
CN102017505A (en) Method and apparatus for managing transmission of TCP data segments
CN108983942A (en) A kind of method and device of dynamic frequency
CN111698275B (en) Data processing method, device and equipment
CN109639586A (en) A kind of data transmission method, apparatus and system
US10805981B2 (en) Method and apparatus for closing a transmission control protocol connection for a wireless communications network
US9219670B2 (en) Link-aware throughput acceleration profiles
GB2412815A (en) Transmitting data over a network
WO2011004219A1 (en) Method and apparatus for scheduling downloads

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
GR01 Patent grant
GR01 Patent grant