CN104486243A - Data transmission method, equipment and system - Google Patents

Data transmission method, equipment and system Download PDF

Info

Publication number
CN104486243A
CN104486243A CN201410706795.8A CN201410706795A CN104486243A CN 104486243 A CN104486243 A CN 104486243A CN 201410706795 A CN201410706795 A CN 201410706795A CN 104486243 A CN104486243 A CN 104486243A
Authority
CN
China
Prior art keywords
data
heartbeat packet
packet
link
transmitting equipment
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
CN201410706795.8A
Other languages
Chinese (zh)
Other versions
CN104486243B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201410706795.8A priority Critical patent/CN104486243B/en
Publication of CN104486243A publication Critical patent/CN104486243A/en
Application granted granted Critical
Publication of CN104486243B publication Critical patent/CN104486243B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a data transmission method. The data transmission method comprises the steps of transmitting N heartbeat packets to data transmission equipment one by one through a UDP (User Datagram Protocol) link, wherein N is larger than or equal to 1 and the data transmission equipment immediately feeds back the heartbeat packet after the heartbeat packet is received at each other; receiving the N heartbeat packets fed back by the data transmission equipment one by one through the UDP link; judging whether the fed-back N heartbeat packets are overtime or not; if the fed-back N heartbeat packets are not overtime, transmitting a command of closing a TCP (Transmission Control Protocol) link to the data transmission equipment; closing the TCP link for data transmission with the data transmission equipment; conducting data transmission with the data transmission equipment through the UDP link. The invention further discloses other two data transmission methods, data transmission equipment, data receiving equipment and a data transmission system. By adopting the embodiment of the invention, on the basis that high-quality data transmission is guaranteed, the network flow and the system load are reduced.

Description

Data transmission method, equipment and system
Technical field
The present invention relates to Internet technical field, particularly relate to a kind of data transmission method, equipment and system.
Background technology
In the prior art, instant messaging uses TCP connected mode usually.Such as in online game, usually adopt a TCP to connect between client and server to intercom mutually, if but client has opened a sudden peal of thunder, or client has opened a sudden peal of thunder or other download software, the network fluency of meeting extreme influence online game with the other machines of local area network (LAN).According to the statistics of reality, in online game, when using TCP to connect, the drop rate of client is approximately 30%-40%.This is because the mechanism of initiatively dodging of TCP causes.TCP initiatively dodges mechanism and is specially: after network layer finds first time Network Abnormal (such as packet loss) phenomenon, the machine-processed network rate that initiatively can reduce oneself of TCP.Such as, if when network delay is 50ms, there is packet loss in TCP first time, and system can attempt retransmitting at next 50ms, if still packet loss, can retransmit at lower 100ms, if still packet loss, can retransmit at lower 200ms.The time of trial equals one times of the last trial time, and this is the rank of an index, if number of retransmissions is more than 5 times, retransmission latency will be long, finally probably goes offline.When therefore adopting TCP to connect between client and server, (if such as network quality is very poor suddenly, once more recover afterwards) when network quality is unstable, the time that TCP attempts retransmitting can be waited for for a long time, because the stand-by period is too of a specified duration, client can be caused to go offline.
Some application or software can adopt UDP connected mode to send data, but adopt the server of UDP connected mode can not return confirmation response after receiving the data, therefore adopt UDP connected mode unreliable.In addition, some software such as fire compartment wall can limit UDP connection traffic, therefore when adopting UDP connection transmission data more, can be limited flow, thus causes transfer of data smoothness, drop rate increase not, even causes data-transmission interruptions.
Summary of the invention
The embodiment of the present invention proposes a kind of data transmission method, equipment and system, on the basis ensureing data high-quality transmission, can reduce network traffics and system load.
The embodiment of the present invention provides a kind of data transmission method, comprising:
N number of heartbeat packet is sent to data transmitting equipment seriatim, N >=1 by UDP link; Described data transmitting equipment often receives a heartbeat packet and just returns described heartbeat packet immediately;
N number of heartbeat packet that described data transmitting equipment returns is received seriatim by described UDP link;
Whether the N number of heartbeat packet returned described in judgement is overtime;
If described in N number of heartbeat packet of returning all time-out, then send the order of closing TCP link to described data transmitting equipment;
Close the TCP link carrying out transfer of data between described data transmitting equipment;
Transfer of data is carried out by described UDP link and described data transmitting equipment.
Present invention also offers another data transmission method, comprising:
Received N number of heartbeat packet of data receiver transmission seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately; Wherein, N >=1;
Receive the order of the closedown TCP link that described data receiver sends; The order of described closedown TCP link is that described data receiver sends when the N number of heartbeat packet judging to return is all not overtime;
Close the TCP link carrying out transfer of data between described data receiver;
Transfer of data is carried out by described UDP link and described data receiver.
Present invention also offers another data transmission method, comprising:
Data receiver sends N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1;
Described data transmitting equipment receives described N number of heartbeat packet seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately;
Described data receiver judges that whether N number of heartbeat packet that described data transmitting equipment returns is overtime;
If described in N number of heartbeat packet of returning all time-out, then described data receiver sends the order of closing TCP link to described data transmitting equipment, and closes the TCP link carrying out transfer of data between described data transmitting equipment;
Described data transmitting equipment receives the order of the closedown TCP link that described data receiver sends, and closes the TCP link carrying out transfer of data between described data receiver;
Described data transmitting equipment and described data receiver carry out transfer of data by described UDP link.
Present invention also offers a kind of data receiver, comprising:
Heartbeat packet sending module, for sending N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1; Described data transmitting equipment often receives a heartbeat packet and just returns described heartbeat packet immediately;
First heartbeat packet receiver module, for receiving N number of heartbeat packet that described data transmitting equipment returns seriatim by described UDP link;
Time-out judge module, whether overtime for the N number of heartbeat packet returned described in judging;
Shutdown command sending module, for when the N number of heartbeat packet returned described in described overtime judge module judgement is all overtime, sends the order of closing TCP link to described data transmitting equipment;
One TCP link-down module, for closing the TCP link carrying out transfer of data between described data transmitting equipment; And,
First data transmission module, for carrying out transfer of data by described UDP link and described data transmitting equipment.
Present invention also offers a kind of data transmitting equipment, comprising:
Heartbeat packet returns module, and for being received N number of heartbeat packet that data receiver sends seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately; Wherein, N >=1;
Shutdown command receiver module, for receiving the order of the closedown TCP link that described data receiver sends; The order of described closedown TCP link is that described data receiver sends when the N number of heartbeat packet judging to return is all not overtime;
2nd TCP link-down module, for closing the TCP link carrying out transfer of data between described data receiver; And,
Second data transmission module, for carrying out transfer of data by described UDP link and described data receiver.
Present invention also offers a kind of data transmission system, comprise data transmitting equipment and data receiver; Described data transmitting equipment comprises heartbeat packet receiver module, shutdown command receiver module and data transmission module; Described data receiver comprises heartbeat packet sending module, overtime judge module and shutdown command sending module; Wherein:
Described heartbeat packet sending module, sends N number of heartbeat packet to data transmitting equipment for data receiver by UDP link, N >=1 seriatim;
Described heartbeat packet receiver module, receives described N number of heartbeat packet for described data transmitting equipment seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately;
For described data receiver, described overtime judge module, judges that whether N number of heartbeat packet that described data transmitting equipment returns is overtime;
Described shutdown command sending module, for when the N number of heartbeat packet returned described in described overtime judge module judgement is all overtime, described data receiver sends the order of closing TCP link to described data transmitting equipment, and closes the TCP link carrying out transfer of data between described data transmitting equipment;
Described shutdown command receiver module, receives the order of the closedown TCP link that described data receiver sends for described data transmitting equipment, close the TCP link carrying out transfer of data between described data receiver;
Described data transmission module, carries out transfer of data for described data transmitting equipment and described data receiver by described UDP link.
Implement the embodiment of the present invention, there is following beneficial effect:
The data transmission method that the embodiment of the present invention provides, equipment and system, can when data be transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of an embodiment of data transmission method provided by the invention;
Fig. 2 is the schematic flow sheet of another embodiment of data transmission method provided by the invention;
Fig. 3 is the schematic flow sheet of another embodiment of data transmission method provided by the invention;
Fig. 4 is the functional block diagram of an embodiment of data receiver provided by the invention;
Fig. 5 is the functional block diagram of an embodiment of data transmitting equipment provided by the invention;
Fig. 6 is the functional block diagram of an embodiment of data transmission system provided by the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 1, be the schematic flow sheet of an embodiment of data transmission method provided by the invention, the present embodiment be aimed at data receiver side describe, as shown in Figure 1, the data transmission method that the embodiment of the present invention provides comprises:
S101, the first data packet sent by UDP link reception data transmitting equipment.
Wherein, data transmitting equipment can be client, and what data receiver can be corresponding is server; In addition, data transmitting equipment and data receiver also can be two reciprocity terminals, or data transmitting equipment is server, and what data receiver was corresponding is client.
S102, parse the connection ID of described data transmitting equipment from described first data packet, and be stored in data transmitting equipment information list.
Concrete, the connection ID of described data transmitting equipment and the link ID of current UDP link can be parsed from described first data packet, and be stored in data transmitting equipment information list.Wherein, data transmitting equipment information list can preserve the connection ID of multiple data transmitting equipment.Concrete, data transmitting equipment information list can be Hash table, and the key of Hash table is the connection ID of data transmitting equipment, and value is the link ID of current UDP link.
S103, return the confirmation response of described first data packet to described data transmitting equipment.
Concrete, data receiver all can return a confirmation response after the data packet receiving data transmitting equipment transmission.
S104, receive the TCP request for building link that described data transmitting equipment sends, and set up TCP link with described data transmitting equipment.
Wherein, to be described data transmitting equipment send detecting to exceed when preset duration does not receive the confirmation response of described first data packet yet described TCP request for building link.
S105, to be received the second data packet that described data transmitting equipment sends by described UDP link and TCP link.
Concrete, when after TCP link establishment, data transmitting equipment can send the second identical data packet by described UDP link and TCP chain road direction data receiver.Wherein, the second data packet comprises the connection ID of data transmitting equipment.
S106, from the second data packet received by TCP link, parse the connection ID of described data transmitting equipment, and according to described connection ID, authentication is carried out to described data transmitting equipment.
Concrete, the connection ID of described data transmitting equipment and the link ID of current TCP link can be parsed from the second data packet received by TCP link, and the link ID of current TCP link is also stored in described data transmitting equipment information list, being specifically kept at key in Hash table is in the value of the connection ID of current data transmitting apparatus.
Wherein, whether authentication have employed UDP connection before mainly checking current data transmitting equipment.
Wherein, describedly according to described connection ID, authentication is carried out to described data transmitting equipment and specifically comprise: detect described connection ID whether in described data transmitting equipment information list; If described connection ID is in described data transmitting equipment information list, be then judged to be that authentication is passed through.Because connect if having employed UDP before, then can be kept in data transmitting equipment information list.
If S107 authentication is passed through, then returned the confirmation response of described second data packet by current data transmitting apparatus described in described UDP link and described TCP chain road direction.
Concrete, if the verification passes, have employed UDP before then showing to connect, therefore current data transmitting apparatus is directed to, the value that key is the connection ID of current data transmitting apparatus is found out from data transmitting equipment information list, from value, find out the link ID of UDP link and the link ID of TCP link, and return the confirmation response of described second data packet by current data transmitting apparatus described in corresponding UDP link and TCP chain road direction.
Based on S101-S107, the present embodiment establishes and a kind ofly occurs time delay/when going offline at UDP link, trigger and set up the scheme that TCP link synchronization carries out data transmission, obviously, such scheme can improve the stability that data transmit, but double-channel data transmits and volume of transmitted data will be made double, increases the pressure of server and network simultaneously.For reducing this pressure, need to set up the Restoration Mechanism recovering the transmission of UDP single channel.
But owing to transmitting data by UDP link, can't return confirmation response, how to set up described Restoration Mechanism to make: on the one hand in the state section of acceptance of routine, significantly the amount of calculation of section is received/sent out to increase transfer of data pressure and data; On the other hand, avoid the establishment repeatedly of TCP link and destruction to cause server stress significantly to increase, become a technical barrier.For this reason, the present embodiment solves above-mentioned technical barrier further by following proposal.
S108, send N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1; Described data transmitting equipment often receives a heartbeat packet and just returns described heartbeat packet immediately.
Concrete, according to the heartbeat packet transmission frequency preset, send heartbeat packet, until send N number of heartbeat packet to described data transmitting equipment seriatim by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
Data receiver also can send a heartbeat packet at interval of regular time to data transmitting equipment, until send N number of heartbeat packet continuously.Wherein, data receiver can send a heartbeat packet every 10s.
S109, to be received N number of heartbeat packet that described data transmitting equipment returns seriatim by described UDP link.
Whether the N number of heartbeat packet returned described in S110, judgement is overtime.
Concrete, S110 comprises:
The transmitting time of described heartbeat packet is obtained from each heartbeat packet returned;
Calculate each transmitting time of the heartbeat packet returned and the difference of current time, obtain the duration of each heartbeat packet time delay;
Judge whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
Wherein, can preset duration threshold value be 150ms, if data receiver sends heartbeat packet according to heartbeat packet transmission frequency, then can arrange N be 30, make data receiver send 30 heartbeat packet continuously, and judge whether the delay duration of these 30 heartbeat packet is all less than 150ms; If data receiver sends heartbeat packet according to the cycle every 10s, then can be arranged on continuous print and judge whether the duration of each heartbeat packet time delay received all is less than 150ms in 5 minutes.
If the N number of heartbeat packet returned described in S111 is all not overtime, then send the order of closing TCP link to described data transmitting equipment.
Concrete, if the N number of heartbeat packet returned continuously is all not overtime, then illustrate that UDP link is stablized, without the need to transmitting data by UDP link and TCP link simultaneously, therefore, send the order of closing TCP link to data transmitting equipment, make data transmitting equipment close TCP link.
S112, between closedown and described data transmitting equipment, carry out the TCP link of transfer of data.
Concrete, data receiver closes TCP link, and reclaims the respective resources of this link transmission.
S113, carry out transfer of data by described UDP link and described data transmitting equipment.
Concrete, after network stabilization, data receiver closes TCP link, carries out transfer of data by UDP link and data transmitting equipment; When unstable networks, UDP link transmission quality difference, data receiver sets up TCP link, carries out transfer of data by UDP link and TCP link with data transmitting equipment simultaneously.
In the embodiment of the present invention, when data are transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
Fig. 2 is the schematic flow sheet of another embodiment of data transmission method provided by the invention, the present embodiment be aimed at data transmitting equipment side describe, as shown in Figure 2, the data transmission method that the embodiment of the present invention provides comprises:
S201, send the first data packet by UDP chain road direction data receiver.
Wherein, data transmitting equipment can be client, and what data receiver can be corresponding is server; Understandable, data transmitting equipment and data receiver also can be two reciprocity terminals, or data transmitting equipment is server, and what data receiver was corresponding is client.
S202, the first data packet sent and transmitting time thereof to be stored in transmission list.
Wherein, transmission list is queue structure, wherein saves the data packet and transmitting time thereof that have sent, detects for time-out afterwards.
If S203 receives the confirmation response of described first data packet that described data receiver returns, from described transmission list, delete described first data packet and transmitting time thereof.
Concrete, data receiver can return a confirmation response after the data packet receiving data transmitting equipment transmission, represents and receives this data packet.The confirmation response of described first data packet represents that described data receiver receives described first data packet.If after data transmitting equipment have received confirmation response, the data packet of correspondence and transmitting time thereof can be deleted from transmission list, what therefore preserved in transmission list is all the data packet not receiving the confirmation response.
S204, detect the moment in time-out, detect and whether receive the confirmation response of described first data packet that described data receiver returns.
Concrete, S204 comprises:
Detect the moment in time-out, described in detection, whether transmission list exists described first data packet;
If there is described first data packet, then judge whether the transmitting time of described first data packet and the difference of current time are greater than preset duration;
When described difference is greater than preset duration, be judged to be that exceeding preset duration does not receive described confirmation response yet.
In addition, if described transmission list does not exist described first data packet, or described difference is less than or equal to preset duration, then continue through data receiver described in described UDP chain road direction and send the second data packet.
Wherein, time-out detection is the detection of one-period, and can be detect once every 500ms, corresponding preset duration can be 2s.What wherein preserved in transmission list is all the data packet not receiving the confirmation response, therefore, if transmission list does not have described first data packet, namely represents that described first data packet has received the first data packet.
If S205 detects that exceeding preset duration does not receive described confirmation response yet, then set up TCP link to described data receiver request.
Concrete, detect that exceeding the confirmation response that preset duration do not receive described first data packet yet represents that current UDP link is likely limited or occurs network problem etc., therefore set up TCP link to described data receiver request.Concrete, connection IP and the ports-settings of newly-built TCP link are the same with UDP link.
Step S204 and step S205 is that the overtime testing process of a certain data packet sent for data transmitting equipment is described, in actual mechanical process, if all carry out time-out detection to each data packet that data transmitting equipment sends, so memory consumption can be increased, lower efficiency, therefore the embodiment of step S204 and step S205 in actual mechanical process can be: detect the moment in time-out, travel through former the data packets (such as first 7) in transmission list, if exist and exceed the data packet that preset duration does not receive the confirmation response, then set up TCP link to described data receiver request.Namely only traversal and time-out detection are carried out to former data packets of transmission list.
S206, send the second data packet by data receiver described in described UDP link and described TCP chain road direction.
Wherein, described second data packet comprises the connection ID of described data transmitting equipment, to enable described data receiver carry out authentication according to described connection ID to described data transmitting equipment, and after being verified, returned the confirmation response of described second data packet by data transmitting equipment described in described UDP link and described TCP chain road direction.
S207, receive described data receiver by described in described UDP link and the data packet that returns of TCP link, and the judgement of repeating data package and filtration are carried out to described data packet.
Concrete, when receiving the data packet that described data receiver is returned by described UDP link and TCP link, the judgement of repeating data package and filtration are carried out to the data packet received.Because data receiver is identical packet by the data packet that described UDP link and TCP link return, the data packet to repeating therefore is needed to filter.
S208, to be received N number of heartbeat packet that data receiver sends seriatim by UDP link, and often receive a heartbeat packet and just return described heartbeat packet to described data receiver immediately; Wherein, N >=1.
Concrete, receive the heartbeat packet of described data receiver according to the heartbeat packet transmission frequency transmission preset seriatim by UDP link, until receive N number of heartbeat packet that described data receiver sends; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
Concrete, data transmitting equipment often receives a heartbeat packet and just immediately this heartbeat packet is returned to data receiver.Data transmitting equipment receives N number of heartbeat packet that data receiver sends one by one, then return N number of heartbeat packet to data receiver one by one.
S209, receive the order of closedown TCP link that described data receiver sends.
Wherein, the order of described closedown TCP link is that described data receiver sends when the N number of heartbeat packet judging to return is all not overtime.
S210, between closedown and described data receiver, carry out the TCP link of transfer of data.
Concrete, data transmitting equipment, according to the order of closing TCP link, is closed the TCP link carrying out transfer of data between data receiver, and is reclaimed the respective resources of this link transmission.
S211, carry out transfer of data by described UDP link and described data receiver.
Concrete, after network stabilization, data transmitting equipment closes TCP link, carries out transfer of data by UDP link and data receiver; When unstable networks, UDP link transmission quality difference, data transmitting equipment sets up TCP link, carries out transfer of data by UDP link and TCP link with data receiver simultaneously.
In the embodiment of the present invention, when data are transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
Fig. 3 is the schematic flow sheet of another embodiment of data transmission method provided by the invention, and the present embodiment describes for data receiver and data transmitting equipment both sides, and as shown in Figure 3, the data transmission method that the embodiment of the present invention provides comprises:
S301, data transmitting equipment send the first data packet by UDP chain road direction data receiver, and the first data packet sent and transmitting time thereof are stored in transmission list.
Wherein, data transmitting equipment can be client, and what data receiver can be corresponding is server; Understandable, data transmitting equipment and data receiver also can be two reciprocity terminals, or data transmitting equipment is server, and what data receiver was corresponding is client.Wherein, transmission list is queue structure, wherein saves the data packet and transmitting time thereof that have sent, detects for time-out afterwards.
S302, described data receiver receive the first data packet of described data transmitting equipment transmission by described UDP link, and parse the connection ID of described data transmitting equipment from described first data packet, and are stored in data transmitting equipment information list.
Concrete, the connection ID of described data transmitting equipment and the link ID of current UDP link can be parsed from described first data packet, and be stored in data transmitting equipment information list.Wherein, data transmitting equipment information list can preserve the connection ID of multiple data transmitting equipment.Concrete, data transmitting equipment information list can be Hash table, and the key of Hash table is the connection ID of data transmitting equipment, and value is the link ID of current UDP link.
S303, described data receiver return the confirmation response of described first data packet to described data transmitting equipment.
Concrete, data receiver can return a confirmation response after the data packet receiving data transmitting equipment transmission, represents and receives this data packet.The confirmation response of described first data packet represents that described data receiver receives described first data packet.
If S304, described data transmitting equipment receive the confirmation response of described first data packet that described data receiver returns, from described transmission list, delete described first data packet and transmitting time thereof.
If after data transmitting equipment have received confirmation response, the data packet of correspondence and transmitting time thereof can be deleted from transmission list, what therefore preserved in transmission list is all the data packet not receiving the confirmation response.
S305, described data transmitting equipment detect the moment in time-out, detect the confirmation response whether receiving described first data packet that described data receiver returns.
Concrete, S305 comprises:
Described data transmitting equipment detects the moment in time-out, and described in detection, whether transmission list exists described first data packet;
If there is described first data packet, then judge whether the transmitting time of described first data packet and the difference of current time are greater than preset duration;
When described difference is greater than preset duration, judge that exceeding preset duration does not receive described confirmation response yet.
In addition, if described transmission list does not exist described first data packet, or described difference is less than or equal to preset duration, then continue through data receiver described in described UDP chain road direction and send the second data packet.
Wherein, time-out detection is the detection of one-period, and can be detect once every 500ms, corresponding preset duration can be 2s.What wherein preserved in transmission list is all the data packet not receiving the confirmation response, therefore, if transmission list does not have described first data packet, namely represents that described first data packet has received the first data packet.
If S306, described data transmitting equipment detect that exceeding preset duration does not receive described confirmation response yet, then send TCP request for building link to described data receiver.
Concrete, detect that exceeding the confirmation response that preset duration do not receive described first data packet yet represents that current UDP link is likely limited or occurs network problem etc., therefore set up TCP link to described data receiver request.Concrete, connection IP and the ports-settings of newly-built TCP link are the same with UDP link.
Step S305 and step S306 is that the overtime testing process of a certain data packet sent for data transmitting equipment is described, in actual mechanical process, if all carry out time-out detection to each data packet that data transmitting equipment sends, so memory consumption can be increased, lower efficiency, therefore the embodiment of step S305 and step S306 in actual mechanical process can be: detect the moment in time-out, travel through former the data packets (such as first 7) in transmission list, if exist and exceed the data packet that preset duration does not receive the confirmation response, then set up TCP link to described data receiver request.Namely only traversal and time-out detection are carried out to former data packets of transmission list.
S307, described data receiver receive the TCP request for building link that described data transmitting equipment sends, and set up TCP link with described data transmitting equipment.
S308, described data transmitting equipment send the second data packet by data receiver described in described UDP link and described TCP chain road direction.
Wherein, described second data packet comprises the connection ID of described data transmitting equipment, to enable described data receiver carry out authentication according to described connection ID to described data transmitting equipment, and after being verified, returned the confirmation response of described second data packet by data transmitting equipment described in described UDP link and TCP chain road direction.
S309, described data receiver receive the second data packet of described data transmitting equipment transmission by described UDP link and described TCP link, and carry out the judgement of repeating data package and filtration to described second data packet.
S310, described data receiver parse the connection ID of described data transmitting equipment from the second data packet received by TCP link, and carry out authentication according to described connection ID to described data transmitting equipment.
Concrete, the connection ID of described data transmitting equipment and the link ID of current TCP link can be parsed from the second data packet received by TCP link, and the link ID of current TCP link is also stored in described data transmitting equipment information list, being specifically kept at key in Hash table is in the value of the connection ID of current data transmitting apparatus.
Wherein, authentication mainly checks whether current data transmitting equipment have employed UDP before and connect.
Wherein, describedly according to described connection ID, authentication is carried out to described data transmitting equipment and specifically comprise: detect described connection ID whether in described data transmitting equipment information list; If described connection ID, in described data transmitting equipment information list, is judged to be that authentication is passed through.Because connect if having employed UDP before, then can be kept in data transmitting equipment information list.
If S311 authentication is passed through, then described data receiver returns the confirmation response of described second data packet by current data transmitting apparatus described in described UDP link and TCP chain road direction.
Concrete, if the verification passes, have employed UDP before then showing to connect, therefore current data transmitting apparatus is directed to, the value that key is the connection ID of current data transmitting apparatus is found out from data transmitting equipment information list, from value, find out the link ID of UDP link and the link ID of TCP link, and return the confirmation response of described second data packet by current data transmitting apparatus described in corresponding UDP link and TCP chain road direction.
S312, described data transmitting equipment receive the data packet that described data receiver is returned by described UDP link and described TCP link, and described data packet carries out the judgement of repeating data package and filtration.
Concrete, when receiving the data packet that described data receiver is returned by described UDP link and TCP link, the judgement of repeating data package and filtration are carried out to the data packet received.Because data receiver is identical packet by the data packet that described UDP link and TCP link return, the data packet to repeating therefore is needed to filter.
S313, data receiver send N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1.
Concrete, according to the heartbeat packet transmission frequency preset, send heartbeat packet, until send N number of heartbeat packet to described data transmitting equipment seriatim by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
Data receiver also can send a heartbeat packet at interval of regular time to data transmitting equipment, until send N number of heartbeat packet continuously.Wherein, data receiver can send a heartbeat packet every 10s.
S314, described data transmitting equipment receive described N number of heartbeat packet seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately.
Concrete, data transmitting equipment often receives a heartbeat packet and just immediately this heartbeat packet is returned to data receiver.Therefore, data transmitting equipment receives N number of heartbeat packet that data receiver sends one by one, then return N number of heartbeat packet to data receiver one by one.
S315, described data receiver judge that whether N number of heartbeat packet that described data transmitting equipment returns is overtime.
Concrete, S315 comprises:
The transmitting time of described heartbeat packet is obtained from each heartbeat packet returned;
Calculate each transmitting time of the heartbeat packet returned and the difference of current time, obtain the duration of each heartbeat packet time delay;
Judge whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
Wherein, can preset duration threshold value be 150ms, if data receiver sends heartbeat packet according to heartbeat packet transmission frequency, then can arrange N be 30, make data receiver send 30 heartbeat packet continuously, and judge whether the delay duration of these 30 heartbeat packet is all less than 150ms; If data receiver sends heartbeat packet according to the cycle every 10s, then can be arranged on continuous print and judge whether the duration of each heartbeat packet time delay received all is less than 150ms in 5 minutes.
If the N number of heartbeat packet returned described in S316 is all not overtime, then described data receiver sends the order of closing TCP link to described data transmitting equipment, and closes the TCP link carrying out transfer of data between described data transmitting equipment.
Concrete, if the N number of heartbeat packet returned continuously is all not overtime, then illustrate that UDP link is stablized, without the need to transmitting data by UDP link and TCP link simultaneously, therefore, send the order of closing TCP link to data transmitting equipment, make data transmitting equipment close TCP link.Meanwhile, data receiver closes TCP link, and respective resources when reclaiming this link transmission.
S317, described data transmitting equipment receive the order of the closedown TCP link that described data receiver sends, and close the TCP link carrying out transfer of data between described data receiver.
Concrete, data transmitting equipment, according to the order of closing TCP link, is closed the TCP link carrying out transfer of data between data receiver, and is reclaimed the respective resources of this link transmission.
S318, described data transmitting equipment and described data receiver carry out transfer of data by described UDP link.
Concrete, after network stabilization, data transmitting equipment and data receiver close TCP link, and data are transmitted by UDP link; When unstable networks, UDP link transmission quality difference, set up TCP link between data transmitting equipment and data receiver, data are transmitted by UDP link and TCP link simultaneously.
In the embodiment of the present invention, when data are transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
Fig. 4 is the functional block diagram of an embodiment of data receiver provided by the invention, and as shown in Figure 4, the data receiver that the embodiment of the present invention provides comprises:
First data packet receiver module 401, for receiving the first data packet that data transmitting equipment sends by UDP link;
First data packet parsing module 402, for parsing the connection ID of described data transmitting equipment in the first data packet from described first data packet receiver module reception, and is stored in data transmitting equipment information list;
First confirmation response returns module 403, for returning the confirmation response of described first data packet to described data transmitting equipment;
TCP link establishment module 404, for receiving the TCP request for building link that described data transmitting equipment sends, and sets up TCP link with described data transmitting equipment; To be described data transmitting equipment send detecting to exceed when preset duration does not receive the confirmation response of described first data packet yet described TCP request for building link;
Second data packet receiver module 405, for being received the second data packet that described data transmitting equipment sends by described UDP link and described TCP link, and carries out the judgement of repeating data package and filtration to described second data packet.
Authentication module 406, for parsing the connection ID of described data transmitting equipment from the second data packet received by described TCP link, and carries out authentication according to described connection ID to described data transmitting equipment;
Second confirmation response returns module 407, for be judged to be in described authentication module authentication by time, returned the confirmation response of described second data packet by current data transmitting apparatus described in described UDP link and described TCP chain road direction;
Heartbeat packet sending module 408, for sending N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1; Described data transmitting equipment often receives a heartbeat packet and just returns described heartbeat packet immediately;
First heartbeat packet receiver module 409, for receiving N number of heartbeat packet that described data transmitting equipment returns seriatim by described UDP link;
Time-out judge module 410, whether overtime for the N number of heartbeat packet returned described in judging;
Shutdown command sending module 411, for when the N number of heartbeat packet returned described in described overtime judge module judgement is all overtime, sends the order of closing TCP link to described data transmitting equipment;
One TCP link-down module 412, for closing the TCP link carrying out transfer of data between described data transmitting equipment; And,
First data transmission module 413, for carrying out transfer of data by described UDP link and described data transmitting equipment.
Wherein, authentication module 406 specifically comprises:
ID detecting unit, parses connection ID whether in described data transmitting equipment information list for detecting from described second data packet;
Checking identifying unit, if for described connection ID in described data transmitting equipment information list, is then judged to be that authentication is passed through.
Wherein, described heartbeat packet sending module 408, specifically for according to the heartbeat packet transmission frequency preset, sends heartbeat packet, until send N number of heartbeat packet to described data transmitting equipment seriatim by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
Wherein, described overtime judge module 410 specifically comprises:
Transmitting time acquiring unit, for obtaining the transmitting time of described heartbeat packet from each heartbeat packet returned;
Delay duration acquiring unit, for calculating each transmitting time of the heartbeat packet returned and the difference of current time, obtains the duration of each heartbeat packet time delay; And,
Delay duration judging unit, for judging whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
The embodiment one_to_one corresponding of the embodiment of the present invention and data transmission method as shown in Figure 1 provided by the invention, therefore, the specifying information of each module please refer to the first embodiment of data transmission method provided by the invention, does not repeat them here.
The data transmission method that the embodiment of the present invention provides, equipment and system, can when data be transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
Fig. 5 is the functional block diagram of an embodiment of data transmitting equipment provided by the invention, and as shown in Figure 5, the data transmitting equipment that the embodiment of the present invention provides comprises:
First data packet sending module 501, for sending the first data packet by UDP chain road direction data receiver;
Data storage module 502, is stored in transmission list for the first data packet of being sent by described first data packet sending module 501 and transmitting time thereof;
Data removing module 503, for when receive that described data receiver returns the confirmation response of described first data packet time, from described transmission list, delete described first data packet and transmitting time thereof;
Time-out detection module 504, for detecting the moment in time-out, detects the confirmation response whether receiving described first data packet that described data receiver returns; The confirmation response of described first data packet represents that described data receiver receives described first data packet;
TCP link request sets up module 505, if for detecting that exceeding preset duration does not receive described confirmation response yet, then sets up TCP link to described data receiver request;
Second data packet sending module 506, for sending the second data packet by data receiver described in described UDP link and TCP chain road direction;
Repeating data filtering module 507, for receiving the data packet that described data receiver is returned by described UDP link and TCP link, and carries out the judgement of repeating data package and filtration to the data packet received;
Second heartbeat packet receiver module 508, for being received N number of heartbeat packet that data receiver sends seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately; Wherein, N >=1;
Shutdown command receiver module 509, for receiving the order of the closedown TCP link that described data receiver sends; The order of described closedown TCP link is that described data receiver sends when the N number of heartbeat packet judging to return is all not overtime;
2nd TCP link-down module 510, for closing the TCP link carrying out transfer of data between described data receiver; And,
Second data transmission module 511, for carrying out transfer of data by described UDP link and described data receiver.
Wherein, described overtime detection module 504 specifically comprises:
Transmission list detecting unit, for detecting the moment in time-out, described in detection, whether transmission list exists described first data packet;
Time-out computing unit, if for there is described first data packet, then judges whether the transmitting time of described first data packet and the difference of current time are greater than preset duration;
Time-out identifying unit, for when described difference is greater than preset duration, judges that exceeding preset duration does not receive described confirmation response yet.
Wherein, described second data packet comprises the connection ID of described data transmitting equipment, to enable described data receiver carry out authentication according to described connection ID to described data transmitting equipment, and after being verified, returned the confirmation response of described second data packet by data transmitting equipment described in described UDP link and described TCP chain road direction.
Wherein, the heartbeat packet that described second heartbeat packet receiver module 508 is sent according to the heartbeat packet transmission frequency preset specifically for being received described data receiver seriatim by UDP link, until the N number of heartbeat packet receiving that described data receiver sends; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
The embodiment one_to_one corresponding of the embodiment of the present invention and data transmission method as shown in Figure 2 provided by the invention, therefore, the specifying information of each module please refer to the second embodiment of data transmission method provided by the invention, does not repeat them here.
In the embodiment of the present invention, when data are transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
Fig. 6 is the functional block diagram of an embodiment of data transmission system provided by the invention, as shown in Figure 6, the data transmission system that the embodiment of the present invention provides comprises data transmitting equipment 61 and data receiver 63, described data transmitting equipment 61 comprises the first data packet sending module 611, data storage module 612, data removing module 613, time-out detection module 614, TCP link request sets up module 615, second data packet module 616, repeating data filtering module 617, heartbeat packet returns module 618, shutdown command receiver module 619 and data transmission module 620, described data receiver 63 comprises the first data packet receiver module 631, first data packet parsing module 632, first confirmation response returns module 633, TCP link establishment module 634, second data packet receiver module 635, authentication module 636, second confirmation response returns module 637, heartbeat packet sending module 638, time-out judge module 639 and shutdown command sending module 640.
First data packet sending module 611, sends the first data packet for data transmitting equipment 61 by UDP chain road direction data receiver 63.
Data storage module 612, is stored in transmission list for the first data packet of being sent by described first data packet sending module and transmitting time thereof.
Data removing module 613, for when receiving the confirmation response of described first data packet that described data receiver 63 returns, deletes described first data packet and transmitting time thereof from described transmission list.
First data packet receiver module 631, receives the first data packet of described data transmitting equipment 61 transmission by described UDP link for described data receiver 63.
First data packet parsing module 632, for parsing the connection ID of described data transmitting equipment 61 and the link ID of a described UDP link in the first data packet from described first data packet receiver module reception, and is stored in link ID table.
First confirmation response returns module 633, returns the confirmation response of described first data packet for described data receiver 63 to described data transmitting equipment 61.
Time-out detection module 614, detects the moment for described data transmitting equipment 61 in time-out, detects the confirmation response whether receiving described first data packet that described data receiver 63 returns.
TCP link request sets up module 615, if detect that exceeding preset duration does not receive described confirmation response yet, then send TCP request for building link to described data receiver 63 for described data transmitting equipment 61.
TCP link establishment module 634, receives the TCP request for building link of described data transmitting equipment 61 transmission, and sets up TCP link with described data transmitting equipment 61 for described data receiver 63.
Second data packet sending module 616, sends the second data packet for described data transmitting equipment 61 by data receiver 63 described in described UDP link and described TCP chain road direction.
Second data packet receiver module 635, receives the second data packet of described data transmitting equipment 61 transmission by described UDP link and described TCP link for described data receiver 63.
Authentication module 636, for parsing the connection ID of described data transmitting equipment 61 from the second data packet received by described TCP link, and carries out authentication according to described connection ID to described data transmitting equipment 61.
Second confirmation response returns module 637, for be judged to be in described authentication module authentication by time, returned the confirmation response of described second data packet by current data transmitting apparatus 61 described in described UDP link and TCP chain road direction.
Repeating data filtering module 617, receives for data transmitting equipment 61 data packet that described data receiver 63 returned by described UDP link and described TCP link, and carries out the judgement of repeating data package and filtration to described data packet.
Described heartbeat packet sending module 638, sends N number of heartbeat packet to data transmitting equipment 61 for data receiver 63 by UDP link, N >=1 seriatim.
Described heartbeat packet returns module 618, receives described N number of heartbeat packet for described data transmitting equipment 61 seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver 63 immediately.
For described data receiver 63, described overtime judge module 639, judges that whether N number of heartbeat packet that described data transmitting equipment 61 returns is overtime.
Described shutdown command sending module 640, for N number of heartbeat packet of returning described in judging at described overtime judge module 639 all time-out time, described data receiver 63 sends the order of closing TCP link to described data transmitting equipment 61, and closes the TCP link carrying out transfer of data between described data transmitting equipment 61.
Described shutdown command receiver module 619, receives the order of the closedown TCP link that described data receiver 63 sends for described data transmitting equipment 61, close the TCP link carrying out transfer of data between described data receiver 63.
Described data transmission module 620, carries out transfer of data with described data receiver 63 by described UDP link for described data transmitting equipment 61.
Wherein, overtime detection module 614 specifically comprises:
Transmission list detecting unit, for detecting the moment in time-out, described in detection, whether transmission list exists described first data packet;
Time-out computing unit, if for there is described first data packet, judges whether the transmitting time of described first data packet and the difference of current time are greater than preset duration; And,
Time-out identifying unit, for when described difference is greater than preset duration, judges that exceeding preset duration does not receive described confirmation response yet.
Wherein, authentication module 636 specifically comprises:
ID detecting unit, parses connection ID whether in described data transmitting equipment information list for detecting from described second data packet; And,
Checking identifying unit, if for described connection ID in described data transmitting equipment information list, is then judged to be that authentication is passed through.
Wherein, described heartbeat packet sending module 638 according to the heartbeat packet transmission frequency preset, sends heartbeat packet to described data transmitting equipment 61 by UDP link, until send N number of heartbeat packet specifically for data receiver 63 seriatim; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
Wherein, described overtime judge module 639 specifically comprises:
Transmitting time acquiring unit, for obtaining the transmitting time of described heartbeat packet from each heartbeat packet returned;
Delay duration acquiring unit, for calculating each transmitting time of the heartbeat packet returned and the difference of current time, obtains the duration of each heartbeat packet time delay; And,
Delay duration judging unit, for judging whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
The embodiment one_to_one corresponding of the data transmission method shown in the embodiment of the present invention and Fig. 3 provided by the invention, therefore, the specifying information of each module please refer to the 3rd embodiment of data transmission method provided by the invention, does not repeat them here.
In the embodiment of the present invention, when data are transmitted by TCP link and UDP link simultaneously, judge whether network is stablized by sending heartbeat packet between data transmitting equipment and data receiver, if the N number of heartbeat packet sent continuously is all not overtime when returning, then network stabilization, close TCP link, data after making it are by UDP link transmission, thus on the basis ensureing data high-quality transmission, reduce because TCP link and UDP link transmit produced network traffics and system load simultaneously, when data are transmitted by UDP link, by detecting the whether overtime stability judging network of confirmation response that data receiver returns, when data transmitting equipment detects confirmation of receipt response timeout time, then unstable networks, set up TCP link, carry out auxiliary transmission, data after making it are transmitted by TCP link and UDP link simultaneously, thus going offline of causing of the application that effectively can solve some restriction UDP message flow such as fire compartment wall, transfer of data not smooth or interrupt problem, network fluency can be increased, reduce drop rate, optimizing data quality.
It should be noted that, in this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or device and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or device.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the device comprising this key element and also there is other identical element.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In several embodiments that the application provides, should be understood that, disclosed system and method can realize by another way.Such as, system embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
Professional can also recognize further, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with electronic hardware, computer software or the combination of the two, in order to the interchangeability of hardware and software is clearly described, generally describe composition and the step of each example in the above description according to function.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
The software module that the method described in conjunction with embodiment disclosed herein or the step of algorithm can directly use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in the storage medium of other form any known in random asccess memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (22)

1. a data transmission method, is characterized in that, comprising:
N number of heartbeat packet is sent to data transmitting equipment seriatim, N >=1 by UDP link; Described data transmitting equipment often receives a heartbeat packet and just returns described heartbeat packet immediately;
N number of heartbeat packet that described data transmitting equipment returns is received seriatim by described UDP link;
Whether the N number of heartbeat packet returned described in judgement is overtime;
If described in N number of heartbeat packet of returning all time-out, then send the order of closing TCP link to described data transmitting equipment;
Close the TCP link carrying out transfer of data between described data transmitting equipment;
Transfer of data is carried out by described UDP link and described data transmitting equipment.
2. data transmission method as claimed in claim 1, is characterized in that, describedly sends N number of heartbeat packet to data transmitting equipment seriatim by UDP link, specifically comprises:
According to the heartbeat packet transmission frequency preset, send heartbeat packet, until send N number of heartbeat packet to described data transmitting equipment seriatim by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
3. data transmission method as claimed in claim 2, it is characterized in that, whether the N number of heartbeat packet returned described in described judgement is overtime, specifically comprises:
The transmitting time of described heartbeat packet is obtained from each heartbeat packet returned;
Calculate each transmitting time of the heartbeat packet returned and the difference of current time, obtain the duration of each heartbeat packet time delay;
Judge whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
4. the data transmission method as described in any one of claims 1 to 3, is characterized in that, described send N number of heartbeat packet to data transmitting equipment seriatim by UDP link before, also comprise:
The first data packet of data transmitting equipment transmission is received by UDP link;
The confirmation response of described first data packet is returned to described data transmitting equipment;
Receive the TCP request for building link that described data transmitting equipment sends, and set up TCP link with described data transmitting equipment; To be described data transmitting equipment send detecting to exceed when preset duration does not receive the confirmation response of described first data packet yet described TCP request for building link;
Received the second data packet of described data transmitting equipment transmission by described UDP link and described TCP link, and the judgement of repeating data package and filtration are carried out to described second data packet.
5. a data transmission method, is characterized in that, comprising:
Received N number of heartbeat packet of data receiver transmission seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately; Wherein, N >=1;
Receive the order of the closedown TCP link that described data receiver sends; The order of described closedown TCP link is that described data receiver sends when the N number of heartbeat packet judging to return is all not overtime;
Close the TCP link carrying out transfer of data between described data receiver;
Transfer of data is carried out by described UDP link and described data receiver.
6. data transmission method as claimed in claim 5, is characterized in that, the described N number of heartbeat packet being received data receiver transmission by UDP link seriatim, is specifically comprised:
The heartbeat packet that described data receiver sends according to the heartbeat packet transmission frequency preset is received seriatim, until receive N number of heartbeat packet that described data receiver sends by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
7. the data transmission method as described in claim 5 or 6, is characterized in that, described to be received N number of heartbeat packet that data receiver sends seriatim by UDP link before, also comprise:
The first data packet is sent by UDP chain road direction data receiver;
Detect the moment in time-out, detect the confirmation response whether receiving described first data packet that described data receiver returns; The confirmation response of described first data packet represents that described data receiver receives described first data packet;
Exceed preset duration if detect and do not receive described confirmation response yet, then set up TCP link to described data receiver request;
The second data packet is sent by data receiver described in described UDP link and described TCP chain road direction.
8. a data transmission method, is characterized in that, comprising:
Data receiver sends N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1;
Described data transmitting equipment receives described N number of heartbeat packet seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately;
Described data receiver judges that whether N number of heartbeat packet that described data transmitting equipment returns is overtime;
If described in N number of heartbeat packet of returning all time-out, then described data receiver sends the order of closing TCP link to described data transmitting equipment, and closes the TCP link carrying out transfer of data between described data transmitting equipment;
Described data transmitting equipment receives the order of the closedown TCP link that described data receiver sends, and closes the TCP link carrying out transfer of data between described data receiver;
Described data transmitting equipment and described data receiver carry out transfer of data by described UDP link.
9. data transmission method as claimed in claim 8, it is characterized in that, described data receiver sends N number of heartbeat packet to data transmitting equipment seriatim by UDP link, specifically comprises:
According to the heartbeat packet transmission frequency preset, send heartbeat packet, until send N number of heartbeat packet to described data transmitting equipment seriatim by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
10. data transmission method as claimed in claim 9, it is characterized in that, described data receiver judges that whether N number of heartbeat packet that described data transmitting equipment returns is overtime, specifically comprises:
The transmitting time of described heartbeat packet is obtained from each heartbeat packet returned;
Calculate each transmitting time of the heartbeat packet returned and the difference of current time, obtain the duration of each heartbeat packet time delay;
Judge whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
11. data transmission methods as described in any one of claim 8 to 10, is characterized in that, before described data receiver sends N number of heartbeat packet to data transmitting equipment seriatim by UDP link, also comprise:
Described data transmitting equipment sends the first data packet by UDP chain road direction data receiver;
Described data receiver receives the first data packet of described data transmitting equipment transmission by described UDP link;
Described data receiver returns the confirmation response of described first data packet to described data transmitting equipment;
Described data transmitting equipment detects the moment in time-out, detects the confirmation response whether receiving described first data packet that described data receiver returns;
If described data transmitting equipment detects that exceeding preset duration does not receive described confirmation response yet, then send TCP request for building link to described data receiver;
Described data receiver receives the TCP request for building link that described data transmitting equipment sends, and sets up TCP link with described data transmitting equipment;
Described data transmitting equipment sends the second data packet by data receiver described in described UDP link and described TCP chain road direction.
Described data receiver receives the second data packet of described data transmitting equipment transmission by described UDP link and described TCP link, and carries out the judgement of repeating data package and filtration to described second data packet.
12. 1 kinds of data receivers, is characterized in that, comprising:
Heartbeat packet sending module, for sending N number of heartbeat packet to data transmitting equipment seriatim by UDP link, N >=1; Described data transmitting equipment often receives a heartbeat packet and just returns described heartbeat packet immediately;
First heartbeat packet receiver module, for receiving N number of heartbeat packet that described data transmitting equipment returns seriatim by described UDP link;
Time-out judge module, whether overtime for the N number of heartbeat packet returned described in judging;
Shutdown command sending module, for when the N number of heartbeat packet returned described in described overtime judge module judgement is all overtime, sends the order of closing TCP link to described data transmitting equipment;
One TCP link-down module, for closing the TCP link carrying out transfer of data between described data transmitting equipment; And,
First data transmission module, for carrying out transfer of data by described UDP link and described data transmitting equipment.
13. data receivers as claimed in claim 12, it is characterized in that, described heartbeat packet sending module, specifically for according to the heartbeat packet transmission frequency preset, sends heartbeat packet, until send N number of heartbeat packet to described data transmitting equipment seriatim by UDP link; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
14. data receivers as claimed in claim 13, it is characterized in that, described overtime judge module specifically comprises:
Transmitting time acquiring unit, for obtaining the transmitting time of described heartbeat packet from each heartbeat packet returned;
Delay duration acquiring unit, for calculating each transmitting time of the heartbeat packet returned and the difference of current time, obtains the duration of each heartbeat packet time delay; And,
Delay duration judging unit, for judging whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
15. data receivers as described in any one of claim 12 to 14, it is characterized in that, described data receiver also comprises:
First data packet receiver module, for receiving the first data packet that data transmitting equipment sends by UDP link;
First confirmation response returns module, for returning the confirmation response of described first data packet to described data transmitting equipment;
TCP link establishment module, for receiving the TCP request for building link that described data transmitting equipment sends, and sets up TCP link with described data transmitting equipment; To be described data transmitting equipment send detecting to exceed when preset duration does not receive the confirmation response of described first data packet yet described TCP request for building link; And,
Second data packet receiver module, for being received the second data packet that described data transmitting equipment sends by described UDP link and described TCP link, and carries out the judgement of repeating data package and filtration to described second data packet.
16. 1 kinds of data transmitting equipments, is characterized in that, comprising:
Second heartbeat packet receiver module, for being received N number of heartbeat packet that data receiver sends seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately; Wherein, N >=1;
Shutdown command receiver module, for receiving the order of the closedown TCP link that described data receiver sends; The order of described closedown TCP link is that described data receiver sends when the N number of heartbeat packet judging to return is all not overtime;
2nd TCP link-down module, for closing the TCP link carrying out transfer of data between described data receiver; And,
Second data transmission module, for carrying out transfer of data by described UDP link and described data receiver.
17. data transmitting equipments as claimed in claim 16, it is characterized in that, the heartbeat packet that described second heartbeat packet receiver module is sent according to the heartbeat packet transmission frequency preset specifically for being received described data receiver seriatim by UDP link, until the N number of heartbeat packet receiving that described data receiver sends; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
18. data transmitting equipments as described in claim 16 or 17, it is characterized in that, described data transmitting equipment also comprises:
First data packet sending module, for sending the first data packet by UDP chain road direction data receiver;
Time-out detection module, for detecting the moment in time-out, detects the confirmation response whether receiving described first data packet that described data receiver returns; The confirmation response of described first data packet represents that described data receiver receives described first data packet;
TCP link request sets up module, if for detecting that exceeding preset duration does not receive described confirmation response yet, then sets up TCP link to described data receiver request; And,
Second data packet sending module, for sending the second data packet by data receiver described in described UDP link and described TCP chain road direction.
19. 1 kinds of data transmission systems, is characterized in that, comprise data transmitting equipment and data receiver; Described data transmitting equipment comprises heartbeat packet and returns module, shutdown command receiver module and data transmission module; Described data receiver comprises heartbeat packet sending module, overtime judge module and shutdown command sending module; Wherein:
Described heartbeat packet sending module, sends N number of heartbeat packet to data transmitting equipment for data receiver by UDP link, N >=1 seriatim;
Described heartbeat packet returns module, receives described N number of heartbeat packet for described data transmitting equipment seriatim by UDP link, and often reception heartbeat packet just returns described heartbeat packet to described data receiver immediately;
For described data receiver, described overtime judge module, judges that whether N number of heartbeat packet that described data transmitting equipment returns is overtime;
Described shutdown command sending module, for when the N number of heartbeat packet returned described in described overtime judge module judgement is all overtime, described data receiver sends the order of closing TCP link to described data transmitting equipment, and closes the TCP link carrying out transfer of data between described data transmitting equipment;
Described shutdown command receiver module, receives the order of the closedown TCP link that described data receiver sends for described data transmitting equipment, close the TCP link carrying out transfer of data between described data receiver;
Described data transmission module, carries out transfer of data for described data transmitting equipment and described data receiver by described UDP link.
20. data transmission systems as claimed in claim 19, it is characterized in that, described heartbeat packet sending module according to the heartbeat packet transmission frequency preset, seriatim to described data transmitting equipment sends heartbeat packet, until send N number of heartbeat packet by UDP link specifically for data receiver; Each heartbeat packet comprises the transmitting time of this heartbeat packet.
21. data transmission systems as claimed in claim 20, it is characterized in that, described overtime judge module specifically comprises:
Transmitting time acquiring unit, for obtaining the transmitting time of described heartbeat packet from each heartbeat packet returned;
Delay duration acquiring unit, for calculating each transmitting time of the heartbeat packet returned and the difference of current time, obtains the duration of each heartbeat packet time delay; And,
Delay duration judging unit, for judging whether the duration of each heartbeat packet time delay is all less than default duration threshold value, and the N number of heartbeat packet returned described in if so, then determining is not overtime; If not, then determine described in the N number of heartbeat packet time-out that returns.
22. data transmission systems as described in any one of claim 19 to 21, is characterized in that, described data transmitting equipment also comprises the first data packet sending module, overtime detection module, TCP link request set up module and the second data packet module; Described data receiver also comprises the first data packet receiver module, the first confirmation response returns module, TCP link establishment module and the second data packet receiver module; Wherein:
Described first data packet sending module, sends the first data packet for data transmitting equipment by UDP chain road direction data receiver;
Described first data packet receiver module, receives the first data packet of described data transmitting equipment transmission by described UDP link for described data receiver;
Described first confirmation response returns module, returns the confirmation response of described first data packet for described data receiver to described data transmitting equipment;
Described overtime detection module, detects the moment for described data transmitting equipment in time-out, detects the confirmation response whether receiving described first data packet that described data receiver returns;
Described TCP link request sets up module, if when detecting that exceeding preset duration does not receive described confirmation response yet for described data transmitting equipment, sends TCP request for building link to described data receiver;
Described TCP link establishment module, receives the TCP request for building link of described data transmitting equipment transmission, and sets up TCP link with described data transmitting equipment for described data receiver;
Described second data packet sending module, sends the second data packet for described data transmitting equipment by data receiver described in described UDP link and described TCP chain road direction;
Described second data packet receiver module, received the second data packet of described data transmitting equipment transmission for described data receiver by described UDP link and described TCP link, and the judgement of repeating data package and filtration are carried out to described second data packet.
CN201410706795.8A 2014-11-27 2014-11-27 Data transmission method, equipment and system Active CN104486243B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410706795.8A CN104486243B (en) 2014-11-27 2014-11-27 Data transmission method, equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410706795.8A CN104486243B (en) 2014-11-27 2014-11-27 Data transmission method, equipment and system

Publications (2)

Publication Number Publication Date
CN104486243A true CN104486243A (en) 2015-04-01
CN104486243B CN104486243B (en) 2017-11-03

Family

ID=52760748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410706795.8A Active CN104486243B (en) 2014-11-27 2014-11-27 Data transmission method, equipment and system

Country Status (1)

Country Link
CN (1) CN104486243B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106940686A (en) * 2016-01-05 2017-07-11 佛山市顺德区顺达电脑厂有限公司 The method that data is synchronous between object wearing device and electronic installation
CN109862038A (en) * 2019-03-22 2019-06-07 江苏睿鸿网络技术有限公司 The processing method of data delay and packet loss in a kind of stream media protocol
CN110380934A (en) * 2019-07-23 2019-10-25 南京航空航天大学 A kind of distribution redundant system heartbeat detecting method
CN111371639A (en) * 2020-02-21 2020-07-03 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN111679931A (en) * 2020-06-12 2020-09-18 恒为科技(上海)股份有限公司 Heartbeat packet sending method and system to be tested
CN112911021A (en) * 2021-03-23 2021-06-04 厦门四信通信科技有限公司 Method, device and equipment for actively connecting terminal
CN113726817A (en) * 2021-11-01 2021-11-30 苏州万店掌软件技术有限公司 Streaming media data transmission method, device and medium
CN114199206A (en) * 2021-11-02 2022-03-18 青岛海洋科学与技术国家实验室发展中心 Water towing type measuring system and Ethernet data wired transmission method
CN114827236A (en) * 2022-01-29 2022-07-29 中国银联股份有限公司 Method and device for processing virtual connection of firewall and computer readable storage medium
CN114199206B (en) * 2021-11-02 2024-06-04 青岛海洋科技中心 Water towing type measurement system and Ethernet data wired transmission method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1784674A (en) * 2004-05-03 2006-06-07 微软公司 Fast startup for streaming media
CN103986762A (en) * 2014-05-15 2014-08-13 京信通信系统(中国)有限公司 Process state detection method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1784674A (en) * 2004-05-03 2006-06-07 微软公司 Fast startup for streaming media
CN103986762A (en) * 2014-05-15 2014-08-13 京信通信系统(中国)有限公司 Process state detection method and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106940686B (en) * 2016-01-05 2020-04-07 佛山市顺德区顺达电脑厂有限公司 Method for synchronizing data between wearable device and electronic device
CN106940686A (en) * 2016-01-05 2017-07-11 佛山市顺德区顺达电脑厂有限公司 The method that data is synchronous between object wearing device and electronic installation
CN109862038A (en) * 2019-03-22 2019-06-07 江苏睿鸿网络技术有限公司 The processing method of data delay and packet loss in a kind of stream media protocol
CN110380934A (en) * 2019-07-23 2019-10-25 南京航空航天大学 A kind of distribution redundant system heartbeat detecting method
CN111371639B (en) * 2020-02-21 2021-12-14 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN111371639A (en) * 2020-02-21 2020-07-03 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN111679931A (en) * 2020-06-12 2020-09-18 恒为科技(上海)股份有限公司 Heartbeat packet sending method and system to be tested
CN111679931B (en) * 2020-06-12 2023-11-24 恒为科技(上海)股份有限公司 Method for sending heartbeat packet and system to be tested
CN112911021A (en) * 2021-03-23 2021-06-04 厦门四信通信科技有限公司 Method, device and equipment for actively connecting terminal
CN113726817A (en) * 2021-11-01 2021-11-30 苏州万店掌软件技术有限公司 Streaming media data transmission method, device and medium
CN114199206A (en) * 2021-11-02 2022-03-18 青岛海洋科学与技术国家实验室发展中心 Water towing type measuring system and Ethernet data wired transmission method
CN114199206B (en) * 2021-11-02 2024-06-04 青岛海洋科技中心 Water towing type measurement system and Ethernet data wired transmission method
CN114827236A (en) * 2022-01-29 2022-07-29 中国银联股份有限公司 Method and device for processing virtual connection of firewall and computer readable storage medium
CN114827236B (en) * 2022-01-29 2023-07-14 中国银联股份有限公司 Firewall virtual connection processing method and device and computer readable storage medium

Also Published As

Publication number Publication date
CN104486243B (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN104486243A (en) Data transmission method, equipment and system
US10542064B2 (en) Method, server side and system for computing bandwidth of network transmission of streaming media
CN105516080B (en) The processing method of TCP connection, apparatus and system
CN107135216B (en) Method for enhancing streaming media transmission in weak network environment
CN103607302B (en) Fault information reporting method, monitoring device and management equipment
CN107645409B (en) Method and device for determining transmission fault reason of data
CN104283716A (en) Data transmission method, equipment and system
WO2016090978A1 (en) Traffic switching method and device
JP2006211632A (en) Detection method of crc inspection error out of range
CN103200622A (en) Communication handling method, device and gateway equipment
WO2022017529A1 (en) Data transmission method and system, electronic device, and storage medium
KR20130065619A (en) Method of transporting data from sending node to destination node
CN102769520B (en) Wireless network congestion control method based on stream control transmission protocol (SCTP)
CN105450441B (en) A kind of weak net acceleration method and device based on Transmission Control Protocol
CN105450969B (en) A kind of real time video data transmission method and electronic equipment
CN102510385A (en) Method for preventing fragment attack of IP (Internet Protocol) datagram
CN103338158A (en) GOOSE message transmission delay jitter suppression method
CN101562500A (en) Data transmission request method, data transmission method and data transmission device
CN104702596B (en) A kind of Information hiding based on data packet length and the method and system of transmission
CN102340508B (en) Data transmission method and equipment
EP3065500A1 (en) Communication device, and layer-2 status control method
CN108429700B (en) Method and device for sending message
CN108449280B (en) Method and device for avoiding ping-pong of TCP (Transmission control protocol) messages
CN104506383A (en) Method and system for measuring data processing efficiency of server in TCP (transmission control protocol) transmission
Usman et al. Energy efficiency of TCP: An analytical model and its application to reduce energy consumption of the most diffused transport protocol

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant