[go: up one dir, main page]

CN101854286B - UDP (User Datagram Protocol)-based data stream sending-receiving method and device - Google Patents

UDP (User Datagram Protocol)-based data stream sending-receiving method and device Download PDF

Info

Publication number
CN101854286B
CN101854286B CN200910081075A CN200910081075A CN101854286B CN 101854286 B CN101854286 B CN 101854286B CN 200910081075 A CN200910081075 A CN 200910081075A CN 200910081075 A CN200910081075 A CN 200910081075A CN 101854286 B CN101854286 B CN 101854286B
Authority
CN
China
Prior art keywords
user datagram
datagram protocol
data
udp
packet
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.)
Expired - Fee Related
Application number
CN200910081075A
Other languages
Chinese (zh)
Other versions
CN101854286A (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.)
Peking University
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University
Peking University Founder Group Co Ltd
Beijing Founder Electronics 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 Peking University, Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University
Priority to CN200910081075A priority Critical patent/CN101854286B/en
Publication of CN101854286A publication Critical patent/CN101854286A/en
Application granted granted Critical
Publication of CN101854286B publication Critical patent/CN101854286B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种基于用户数据报协议的数据流发送、接收方法及装置,涉及多媒体网络通信技术领域。为了解决现有技术中,由于UDP包较大,所造成的IP层切分后数据包容易在网络传输中丢失的问题而发明。本发明提供的基于用户数据报协议的数据流发送方法,包括:将多媒体数据切分为不大于预设值的数据段;将所述数据段封装在用户数据报协议子包中;发送携带有所述用户数据报协议子包的用户数据报协议包。采用本发明可以降低IP层数据传输中的UDP包丢失的概率,还可以提高数据流的时效性。

Figure 200910081075

The invention discloses a data stream sending and receiving method and device based on the user datagram protocol, and relates to the technical field of multimedia network communication. In order to solve the problem in the prior art that the data packets after IP layer segmentation are easy to be lost in network transmission due to the large UDP packets, the invention is invented. The method for sending a data stream based on the User Datagram Protocol provided by the present invention includes: dividing the multimedia data into data segments not larger than a preset value; encapsulating the data segment in a User Datagram Protocol subpacket; The user datagram protocol packet of the user datagram protocol subpacket. By adopting the invention, the probability of UDP packet loss in IP layer data transmission can be reduced, and the timeliness of data flow can also be improved.

Figure 200910081075

Description

Data flow sending, receiving method and device based on UDP
Technical field
The present invention relates to the multimedia network communication technical field, relate in particular to a kind of data flow transmission technology based on UDP.
Background technology
Along with the fast development that multi-media network is used, the application that network is looked audio frequency more and more widely.Under the certain condition of bandwidth, the transmission requirement of network multimedia data is high efficient and reliable as much as possible.But because the data volume that multi-medium data has is big, real-time requires high, needs to select different bottom-layer network host-host protocols according to the concrete different emphasis of using, and then designs the transmission method of different video/audio data flows.
At present, TCP (Transmission Control Protocol, transmission control protocol) and UDP (UserDatagram Protocol, UDP) are two kinds and use the network transmission protocol widely.In the transmission of network multimedia data is used, connection-oriented, reliable data flow transmission that TCP provides, and UDP provides non-connection-oriented, insecure data flow transmission.TCP can guarantee the reliability of transmission data through the packet loss retransmission mechanism; And the transmission speed of UDP is very fast, and expense is also little than TCP.If network multimedia transmission requirement real-time is higher, promptly data transmission bauds is very fast, for obliterated data certain tolerance is arranged then, and then this network-multimedia application can adopt the mechanism based on UDP to realize.
In realizing process of the present invention, the inventor finds to exist at least in the prior art following problem:
When network multimedia The data UDP mechanism was carried out data flow transmission, because that UDP provides is non-connection-oriented, insecure data flow transmission was so be easy to cause losing of packet in the transmitting data stream.Especially when the bag of the UDP in the network multimedia data transmission procedure was big, described UDP bag at first need wrap cutting, just can transmit at the IP layer.Like this, the losing of UDP message with regard to making UDP message bag after the cutting be more prone to receive the influence of network reason and after causing cutting abandons thereby make whole UDP encapsulate.
Summary of the invention
In order to solve in the prior art, because the UDP bag is bigger, the problem that packet is lost in Network Transmission easily after the IP layer cutting that is caused.The invention provides a kind of data flow sending, receiving method and device based on UDP.
In the process that realizes technical scheme of the present invention, the invention provides a kind of data flow sending method based on UDP.This method comprises:
With the multi-medium data cutting is the data segment that is not more than preset value;
Said data segment is encapsulated in the UDP bag;
Transmission carries the UDP bag of said UDP bag.
In the process that realizes technical scheme of the present invention, the invention provides a kind of data flow method of reseptance based on UDP.This method comprises:
Reception carries the UDP bag of said UDP bag;
Described UDP bag is sorted.
In the process that realizes technical scheme of the present invention, the present invention also provides a kind of data flow dispensing device based on UDP.This device comprises:
Data cutting unit, being used for the multi-medium data cutting is the data segment that is not more than preset value;
Son bag acquiring unit is used for said data segment is encapsulated in UDP bag;
Information transmitting unit is used to send the UDP bag that carries said UDP bag.
In the process that realizes technical scheme of the present invention, the present invention also provides a kind of data flow receiving system based on UDP.This device comprises:
Information receiving unit is used to receive the UDP bag that carries said UDP bag;
The data sorting unit is used for described UDP bag is sorted.
A kind of data flow sending, receiving method and device based on UDP that the embodiment of the invention provides are through being the data segment that is not more than preset value with the multi-medium data cutting; And said data segment is encapsulated in the UDP bag; Transmission carries the UDP bag of said UDP bag and gives client.Wherein, Owing to describedly send to the UDP bag load of carrying in the UDP bag of client and be not more than preset value, saidly when the said UDP bag that carries UDP bag is transferred to the IP layer, need not carry out cutting and just can directly transmit.Compare with transmitting at IP after the prior art UDP cutting that load is bigger; The embodiment of the invention can not need cutting directly to transmit at the IP layer the said UDP bag that carries said UDP bag; Reduce the losing probability after the cutting of UDP message bag greatly, thereby improved the client-side multimedia play quality.
Description of drawings
The first embodiment flow chart of a kind of data flow sending method based on UDP that Fig. 1 provides for the embodiment of the invention;
The second embodiment flow chart of a kind of data flow sending method based on UDP that Fig. 2 provides for the embodiment of the invention;
A kind of data flow dispensing device structural representation that Fig. 3 provides for the embodiment of the invention based on UDP;
The first embodiment flow chart of a kind of data flow method of reseptance based on UDP that Fig. 4 provides for the embodiment of the invention;
The second embodiment flow chart of a kind of data flow method of reseptance based on UDP that Fig. 5 provides for the embodiment of the invention;
A kind of data flow receiving system structural representation that Fig. 6 provides for the embodiment of the invention based on UDP.
Embodiment
Below in conjunction with accompanying drawing a kind of data flow sending, receiving method and device based on UDP that the embodiment of the invention provides is described in detail.
As shown in Figure 1, first embodiment of a kind of data flow sending method based on UDP that the embodiment of the invention provides; In the process that realizes the embodiment of the invention, this method comprises:
101: with the multi-medium data cutting is the data segment that is not more than preset value; Because the multi-medium data that transmits based on udp protocol comprises: two types of video data and voice datas; Carry out cutting so the multi-medium data cutting just will be transferred to the video data and the voice data of client.Wherein, described preset value can be 128 bytes.
102: said data segment is encapsulated in the UDP bag;
Data segment after the said multi-medium data cutting is encapsulated in the UDP bag; Can video-data fragment after the cutting and audio data section be encapsulated in respectively in the user data UDP bag.
103: send the UDP bag that carries said UDP bag.
It should be noted that said UDP bag, comprising: sub-packet header type field, son bag load size field, son bag timestamp field and son bag payload data field.The sub-packet format of said UDP is as shown in the table:
Figure G2009100810756D00041
Wherein, HeadType is a sub-packet header type field, is used to indicate the type in this sub-packet header; Size is a son bag load size field, is used to indicate the size of this child bag load, does not comprise the size of each field in the son bag; The size of said son bag load can not surpass 128 bytes; Time is a son bag timestamp field, is used to indicate the timestamp of this child bag.
Below each bit position of HeadType is elaborated, its form is as shown in the table:
Figure G2009100810756D00051
Because that uses the UDP transmission has only video and two types of data of audio frequency, so available bit8 1 identifies that sub what comprise is video data; Using bit8 is that 0 what identify that son comprises is voice data.Because stream numbering is to identify a client and server end through 5 bit positions to set up after the connection number of transmission network stream simultaneously, therefore, can transmit 32 network flows simultaneously at most between the client and server end.That is to say that same connection can be transmitted a plurality of network flows simultaneously, is at most 32.
It should be noted that a plurality of network flows that the above same connection can be transmitted simultaneously can adjust maximum network flows according to the needs of actual conditions.
Below antithetical phrase bag load size field size is elaborated with son bag timestamp field time again; Above-described son bag load size field size and son bag timestamp field time all occur at every turn.Whether said field occurs deciding according to 2 bit positions of sub-packet header type.Its implication is represented respectively like following table:
Bits Sub-packet header long (byte) Explanation
00 5 A current Zi Bao and a last sub-packet have the same channels numbering, different child bag load sizes and son bag timestamp
01 4 A current Zi Bao and a last sub-packet have same channels numbering and son bag load size, different child bag timestamps
10 2 A current Zi Bao and a last sub-packet have same channels numbering and son bag timestamp, different child bag load sizes
11 1 A current Zi Bao and a last sub-packet have same channels numbering, son bag timestamp and son bag load size
It is also to be noted that because the load data of a sub-packet is at most 128 bytes, transmit if each UDP bag only carries a sub-packet, then the packet header expense is relatively large.Non-divided when transmitting in order both to guarantee that UDP wraps in the IP layer, make UDP packet header expense reduce again, the embodiment of the invention can also adopt intersects the son bag and carries out transfer of data.Promptly allow a UDP bag once can transmit a plurality of child bags that bond together, at receiving terminal the bag content of bonding is recombinated through the numbering of distinguishing different passages and stream.Make that so once transmission can be transmitted polytype content, and the short child bag sheet of several different types can provide better real-time property.For example, in UDP bag load simultaneously the Voice & Video data, compared with sending audio pack and video packets successively, client can be carried out the synchronous of audio & video quickly.In addition, when packet drop occurring,, also less after losing to the influence of client terminal playing multi-medium data because the volume of transmitted data of each each type is little.
As shown in Figure 2, second embodiment of a kind of data flow sending method based on UDP that provides for the embodiment of the invention; In the process that realizes the embodiment of the invention, this method comprises:
201: when request is set up in the connection that receives the client transmission, judged whether that idle transmission channel and related resource are that client provides service;
202:, obtain the required multi-medium data of client if promising client provides the idle transmission channel and the related resource of service; Continue execution in step 204;
203:, send to connect and expire the message informing client if the idle transmission channel and the related resource of service are not provided for client.
204: with the multi-medium data cutting is the data segment that is not more than preset value; That is to say that the multi-medium data that client is needed carries out cutting, is the data segment that is not more than preset value with said multi-medium data cutting; This preset value can be 128 bytes;
205: said data segment is encapsulated in the UDP bag;
206:, said UDP bag is sorted according to time sequencing;
207: the load summation is not more than the approaching UDP bag bonding of said time sequencing of 546 bytes, and is encapsulated in the UDP bag;
It should be noted that; The embodiment of the invention is limited in the size that UDP wraps load in 546 bytes; Load adds UDP packet header length 8 bytes, UDP number field length 2 bytes and IP packet header length 20 bytes like this; Just be not higher than 576 bytes of public network MTU MTU, generally no longer need unpack.Therefore, when the sub-bag of described UDP institute data carried by data was not more than 128 bytes, a UDP bag can carry 4 UDPs bags.
It is also to be noted that, when encapsulation UDP bag, can carry out son bag bonding through following method:
1, arranges video frequency user data newspaper agreement son bag and audio user datagram protocol bag respectively according to time sequencing;
When 2, timestamp is kept off, according to timestamp sequential combination UDP bag;
3, timestamp near the time, if having video frequency user data newspaper agreement bag and audio user datagram protocol bag, then these two types sons are wrapped combined crosswise;
4, UDP bag total load length can not surpass 546 bytes.If a bonding sub-packet makes load possibly surpass 546 bytes, then should be with putting into next UDP bag by the child bag.
208: send the UDP bag that carries said UDP bag.
It is also to be noted that, after server end sends the said UDP bag of some,
Server end judges whether active client is connected with said server end;
If active client is connected with said server end, then continue to send the UDP bag;
If active client and said server end break off, then stop to send the UDP bag.
A kind of data flow dispensing device as shown in Figure 3, as to provide for the embodiment of the invention based on UDP; In the process that realizes the embodiment of the invention, this device comprises:
Judging unit 301 is used for when request is set up in the connection that receives the client transmission, having judged whether that idle transmission channel and related resource are that client provides service;
Data capture unit 302 if be used for idle transmission channel and the related resource that promising client provides service, obtains the required multi-medium data of client;
Data cutting unit 303, being used for the multi-medium data cutting is the data segment that is not more than preset value; This preset value can be 128 bytes;
Son bag acquiring unit 304 is used for said data segment is encapsulated in UDP bag; Wherein, said UDP wraps institute's data carried by data and is not more than 128 bytes;
Sequencing unit 305 is used for according to time sequencing, and said UDP bag is sorted;
Son bag bonding element 306 is used for the load summation is not more than the approaching UDP bag bonding of said time sequencing of 546 bytes, and is encapsulated in the UDP bag.
Information transmitting unit 307 is used to send the UDP bag that carries said UDP bag; If also be used for not providing the idle transmission channel and the related resource of service, send to connect and expire the message informing client for client.
It should be noted that this device also comprises:
After server end sends the said UDP bag of some, also comprise:
The connection judgment unit is used to judge whether active client is connected with said server end;
If active client is connected with said server end, then continue to send the UDP bag;
If active client and said server end break off, then stop to send the UDP bag.
As shown in Figure 4, first embodiment of a kind of data flow method of reseptance based on UDP that provides for the embodiment of the invention; In the process that realizes the embodiment of the invention, this method comprises:
401: receive the UDP bag that carries said UDP bag;
402: described UDP bag is sorted.
As shown in Figure 5, second embodiment of a kind of data flow method of reseptance based on UDP that provides for the embodiment of the invention; In the process that realizes the embodiment of the invention, this method comprises:
501: receive the UDP bag that carries said UDP bag;
502: described UDP bag is sorted;
503: whether the order of judging described UDP bag is continuous;
504:, then carry out corresponding packet loss and handle if the order of described User Datagram Protocol bag is discontinuous.For example: its data packet disorder that receives when client terminal to discover; Be the m that is numbered of the current UDP bag that should receive of client, and actual reception to the UDP bag be numbered n, and n is greater than m; The UDP bag that then is numbered between m and the n possibly lost, and also possibly postpone;
It should be noted that when the order of described UDP bag is discontinuous,
Start timer; Wait for a period of time, if promptly client wait for during this period of time in the UDP bag is reordered the bag of while latency delays.
Regularly overtime when timer, judge whether the said UDP bag of losing carries configuration information; That is to say that client is not received the packet of disappearance yet, then confirms said data-bag lost, and judges further whether the said UDP bag of losing carries configuration information after timer is regularly ultra; For example: after t that timer is fixed time is overtime, still lacks the UDP bag between m and the n and then think described UDP packet loss, judge the said UDP that loses wraps whether carry configuration information.
If the described UDP bag of losing carries configuration information, then send said UDP bag retransmission information; Owing between the channel number of transmitting multimedia data and the numbering of media stream corresponding relation is arranged; So when receiving the load bag of 5 of sub-packet header less thaies; And when contained channel number is current non-existent numbering in should the header packet information of child bag, can confirm to have taken place the situation of the load packet loss of new stream.When the load packet loss of new stream, whether retransmit whether the data playback information that depends on new stream is configuration information, whether that is to say to retransmit needs to confirm whether the data message that carries in this child bag is the configuration information that client is carried out data playback; If be configuration information, then retransmit; If not configuration information, then abandon.
If what the described UDP bag of losing carried is not configuration information, then the UDP bag according to current reception upgrades synchronously.For example: behind timer expiry; Client end will be numbered minimum UDP packet start after m; Each passage is sought first load that contains timestamp bag respectively; Utilize the timestamp in these loads bag to upgrade synchronously, before this timestamp the child bag all abandon, and according to these timestamps each passage is carried out corresponding synchronous and upgrades.
It is also to be noted that; When client is broken off from server; When perhaps causing connection termination owing to the network reason; Server should be able to obtain message, stops continue to send the UDP bag, and this can be through letting client receive that whenever some UDP bag back returns a feedback data packet to server end and realize.To accept this feedback data packet overtime or in the regular hour, do not receive feedback data packet when server end, and then server end can judge that connection interrupts, and stops to send the UDP bag.That is to say,
Receive the said UDP bag of some when client after,
Send feedback data packet; Wherein, said feedback data packet is used for announcement server end and client maintenance connection status.Here, client can be through starting timer, perhaps counter; The transmission of Control and Feedback packet; When described timer timing to or the counting of counter when satisfying condition, send feedback data packet.
A kind of data flow receiving system as shown in Figure 6, as to provide for the embodiment of the invention based on UDP; In the process that realizes the embodiment of the invention, this device comprises:
Information receiving unit 601 is used to receive the UDP bag that carries said UDP bag;
Data sorting unit 602 is used for described UDP bag is sorted.
Order judging unit 603 is used to judge whether the order of described UDP bag is continuous;
Packet loss processing unit 604 is discontinuous if be used for the order of described User Datagram Protocol bag, then carries out corresponding packet loss and handles.
It should be noted that when the order of described UDP bag is discontinuous, also comprise:
The timer start unit is used to start timer;
The information type judging unit is used for when timer regularly overtimely, judges whether the said UDP bag of losing carries configuration information;
The retransmission information transmitting element carries configuration information if be used for the described UDP bag of losing, and then sends said UDP bag retransmission information;
Synchronous updating block, if what be used for that the described UDP bag of losing carries is not configuration information, then the UDP bag according to current reception upgrades synchronously.
It is also to be noted that, after receiving said UDP bag,
The feedback data packet transmitting element is used to send feedback data packet; Wherein, said feedback data packet is used for announcement server end and client maintenance connection status.Concretely:
When client and server end carried out data interaction, client can also start the transmission that timer or counter come the Control and Feedback packet through start unit; Promptly
Said feedback data packet transmitting element, be used for when described timer timing to or the counting of counter when satisfying condition, send feedback data packet; Wherein, described feedback data packet is used for the connection status of announcement server end active client and server end.
A kind of data flow sending, receiving method and device based on UDP that the embodiment of the invention provides are through being the data segment that is not more than preset value with the multi-medium data cutting; And said data segment is encapsulated in the UDP bag; Transmission carries the UDP bag of said UDP bag and gives client.Wherein, Owing to describedly send to the UDP bag load of carrying in the UDP bag of client and be not more than preset value, saidly when the said UDP bag that carries UDP bag is transferred to the IP layer, need not carry out cutting and just can directly transmit.Compare with transmitting at IP after the prior art UDP cutting that load is bigger; The embodiment of the invention can not need cutting directly to transmit at the IP layer the said UDP bag that carries said UDP bag; Reduce the losing probability after the cutting of UDP message bag greatly, thereby improved the client-side multimedia play quality.
Description through above execution mode; One of ordinary skill in the art will appreciate that: realize that all or part of step in the foregoing description method is to instruct relevant hardware to accomplish through program; Described program can be stored in the computer read/write memory medium, and this program comprises the step like above-mentioned method embodiment when carrying out; Described storage medium, as: ROM/RAM, magnetic disc, CD etc.
The above; Be merely embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technical staff who is familiar with the present technique field is in the technical scope that the present invention discloses; Can expect easily changing or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.

Claims (16)

1.一种基于用户数据报协议的数据流发送方法,其特征在于,包括:1. A data stream sending method based on User Datagram Protocol, characterized in that, comprising: 将多媒体数据切分为不大于预设值的数据段;Divide the multimedia data into data segments not larger than a preset value; 将所述数据段封装在用户数据报协议子包中;Encapsulating the data segment in a user datagram protocol subpacket; 按照时间顺序,对所述用户数据报协议子包进行排序;Sorting the user datagram protocol subpackets according to time order; 将负载总和不大于546字节的所述时间顺序接近的用户数据报协议子包粘结,并封装在用户数据报协议包;Bonding the user datagram protocol subpackages whose load sum is not greater than 546 bytes in close time order, and encapsulating them in a user datagram protocol packet; 发送携带有所述用户数据报协议子包的用户数据报协议包;sending a user datagram protocol packet carrying the user datagram protocol subpacket; 其中,所述用户数据报协议子包,包括:子包头类型字段、子包负载大小字段、子包时间戳字段和子包负载数据字段。Wherein, the UDP subpacket includes: a subpacket header type field, a subpacket payload size field, a subpacket timestamp field, and a subpacket payload data field. 2.根据权利要求1所述的基于用户数据报协议的数据流发送方法,其特征在于,所述将多媒体数据切分为不大于预设值的数据段的步骤之前,还包括:2. The method for sending data streams based on User Datagram Protocol according to claim 1, characterized in that, before the step of dividing the multimedia data into data segments no greater than preset values, further comprising: 当接收到客户端发送的连接建立请求时,判断是否有空闲传输通道及相关资源为客户端提供服务;When receiving the connection establishment request sent by the client, determine whether there are idle transmission channels and related resources to provide services for the client; 如果有为客户端提供服务的空闲传输通道及相关资源,获取客户端所需的多媒体数据;If there is an idle transmission channel and related resources providing services for the client, obtain the multimedia data required by the client; 如果没有为客户端提供服务的空闲传输通道及相关资源,发送连接已满消息通知客户端。If there is no idle transmission channel and related resources to provide services for the client, send a connection full message to notify the client. 3.根据权利要求2所述的基于用户数据报协议的数据流发送方法,其特征在于,当服务器端发送一定数量的所述用户数据报协议包之后,还包括:3. the method for sending data streams based on UDP according to claim 2, characterized in that, after the server sends a certain number of UDP packets, it also includes: 判断当前客户端与所述服务器端是否连接;judging whether the current client is connected to the server; 如果当前客户端与所述服务器端是连接的,则继续发送用户数据报协议包;If the current client is connected to the server, then continue to send the UDP packet; 如果当前客户端与所述服务器端是断开的,则停止发送用户数据报协议包。If the current client is disconnected from the server, stop sending UDP packets. 4.一种基于用户数据报协议的数据流接收方法,其特征在于,包括:4. A data stream receiving method based on User Datagram Protocol, characterized in that, comprising: 接收携带有所述用户数据报协议子包的用户数据报协议包;receiving a user datagram protocol packet carrying the user datagram protocol subpacket; 将所述的用户数据报协议包进行排序;所述携带有所述用户数据报协议子包的用户数据报协议包由服务器端发送,其包括:封装在用户数据报协议包中的粘结在一起的负载总和不大于546字节的时间顺序接近的用户数据报协议子包,其中,多媒体数据被切分为不大于预设值的数据段封装在用户数据报协议子包中,所述用户数据报协议子包包括:子包头类型字段、子包负载大小字段、子包时间戳字段和子包负载数据字段。The user datagram protocol packets are sorted; the user datagram protocol packets carrying the user datagram protocol subpackages are sent by the server side, which includes: the glue encapsulated in the user datagram protocol packets User datagram protocol sub-packets whose total load is not greater than 546 bytes in close time sequence, wherein the multimedia data is divided into data segments not greater than a preset value and encapsulated in the user data protocol sub-packet, the user The subpacket of the datagram protocol includes: a subpacket header type field, a subpacket payload size field, a subpacket timestamp field and a subpacket payload data field. 5.根据权利要求4所述的基于用户数据报协议的数据流接收方法,其特征在于,还包括:5. The data stream receiving method based on UDP according to claim 4, further comprising: 判断所述的用户数据报协议包的顺序是否连续;Judging whether the order of the user datagram protocol packets is continuous; 如果所述的用户数据包协议包的顺序是不连续的,则进行相应的丢包处理。If the sequence of the user data packet protocol packets is discontinuous, corresponding packet loss processing is performed. 6.根据权利要求5所述的基于用户数据报协议的数据流接收方法,其特征在于,当所述的用户数据报协议包的顺序不连续时,6. the data flow receiving method based on user datagram protocol according to claim 5, is characterized in that, when the order of described user datagram protocol packet is discontinuous, 启动定时器;start the timer; 当定时器定时超时,判断所述丢失的用户数据报协议包是否携带有配置信息;When the timer times out, determine whether the lost user datagram protocol packet carries configuration information; 如果所述的丢失的用户数据报协议包携带有配置信息,则发送所述用户数据报协议包重传信息;If the lost UDP packet carries configuration information, then send retransmission information of the UDP packet; 如果所述的丢失的用户数据报协议包携带的不是配置信息,则按照当前接收的用户数据报协议包进行同步更新。If the lost UDP packet does not carry configuration information, perform synchronous update according to the currently received UDP packet. 7.根据权利要求4至6中任意一项所述的基于用户数据报协议的数据流接收方法,其特征在于,当接收到所述用户数据报协议包后,7. according to the data flow receiving method based on user datagram agreement described in any one in claim 4 to 6, it is characterized in that, after receiving described user datagram agreement bag, 发送反馈数据包;其中,所述反馈数据包用于通知服务器端与客户端保持连接状态。Sending a feedback data packet; wherein, the feedback data packet is used to notify the server to maintain a connection state with the client. 8.根据权利要求7所述的基于用户数据报协议的数据流接收方法,其特征在于,当客户端与服务器端进行数据交互时,8. The data stream receiving method based on UDP according to claim 7, characterized in that, when the client and the server carry out data interaction, 启动定时器,或者计数器;Start the timer, or counter; 当所述的定时器定时时间到或者计数器的计数满足条件时,发送反馈数据包;其中,所述的反馈数据包用于通知服务器端当前客户端与服务器端的连接状态。When the timer expires or the counting of the counter satisfies the conditions, a feedback data packet is sent; wherein, the feedback data packet is used to notify the server of the current connection status between the client and the server. 9.一种基于用户数据报协议的数据流发送装置,其特征在于,包括:9. A data stream sending device based on user datagram protocol, characterized in that, comprising: 数据切分单元,用于将多媒体数据切分为不大于预设值的数据段;A data segmentation unit, configured to segment the multimedia data into data segments not larger than a preset value; 子包获取单元,用于将所述数据段封装在用户数据报协议子包中;A subpacket acquisition unit, configured to encapsulate the data segment in a user datagram protocol subpacket; 排序单元,用于按照时间顺序,对所述用户数据报协议子包进行排序;a sorting unit, configured to sort the user datagram protocol subpackets in chronological order; 子包粘结单元,用于将负载总和不大于546字节的所述时间顺序接近的用户数据报协议子包粘结,并封装在用户数据报协议包;A subpacket bonding unit, configured to bond the user datagram protocol subpackets whose load sum is not greater than 546 bytes and are close in time sequence, and encapsulate them in a user datagram protocol packet; 信息发送单元,用于发送携带有所述用户数据报协议子包的用户数据报协议包;an information sending unit, configured to send a user datagram protocol packet carrying the user datagram protocol subpacket; 其中,所述用户数据报协议子包,包括:子包头类型字段、子包负载大小字段、子包时间戳字段和子包负载数据字段。Wherein, the UDP subpacket includes: a subpacket header type field, a subpacket payload size field, a subpacket timestamp field, and a subpacket payload data field. 10.根据权利要求9所述的基于用户数据报协议的数据流发送装置,其特征在于,该装置还包括:10. The device for sending data streams based on User Datagram Protocol according to claim 9, characterized in that the device further comprises: 判断单元,用于当接收到客户端发送的连接建立请求时,判断是否有空闲传输通道及相关资源为客户端提供服务;The judging unit is used to judge whether there are idle transmission channels and related resources to provide services for the client when receiving the connection establishment request sent by the client; 数据获取单元,用于如果有为客户端提供服务的空闲传输通道及相关资源,获取客户端所需的多媒体数据;The data obtaining unit is used to obtain the multimedia data required by the client if there is an idle transmission channel and related resources providing services for the client; 所述信息发送单元,还用于如果没有为客户端提供服务的空闲传输通道及相关资源,发送连接已满消息通知客户端。The information sending unit is further configured to send a connection full message to notify the client if there is no idle transmission channel and related resources providing services for the client. 11.根据权利要求10所述的基于用户数据报协议的数据流发送装置,其特征在于,还包括:11. The device for sending data streams based on User Datagram Protocol according to claim 10, further comprising: 连接判断单元,用于当服务器端发送一定数量的所述用户数据报协议包之后,判断当前客户端与所述服务器端是否连接;A connection judging unit, configured to judge whether the current client is connected to the server after the server sends a certain number of user datagram protocol packets; 如果当前客户端与所述服务器端是连接的,则继续发送用户数据报协议包;If the current client is connected to the server, then continue to send the UDP packet; 如果当前客户端与所述服务器端是断开的,则停止发送用户数据报协议包。If the current client is disconnected from the server, stop sending UDP packets. 12.一种基于用户数据报协议的数据流接收装置,其特征在于,包括:12. A data stream receiving device based on user datagram protocol, characterized in that, comprising: 信息接收单元,用于接收携带有所述用户数据报协议子包的用户数据报协议包;An information receiving unit, configured to receive a user datagram protocol packet carrying the user datagram protocol subpacket; 数据排序单元,用于将所述的用户数据报协议包进行排序;a data sorting unit, configured to sort the user datagram protocol packets; 所述携带有所述用户数据报协议子包的用户数据报协议包由服务器端发送,其包括:封装在用户数据报协议包中的粘结在一起的负载总和不大于546字节的时间顺序接近的用户数据报协议子包,其中,多媒体数据被切分为不大于预设值的数据段封装在用户数据报协议子包中,所述用户数据报协议子包包括:子包头类型字段、子包负载大小字段、子包时间戳字段和子包负载数据字段。The user datagram protocol packet carrying the user datagram protocol subpacket is sent by the server, which includes: a time sequence in which the sum of the bonded loads encapsulated in the user datagram protocol packet is not greater than 546 bytes Approaching UDP subpackages, wherein the multimedia data is divided into data segments not greater than a preset value and encapsulated in UDP subpackages, the UDP subpackages include: subpacket header type field, Subpacket payload size field, subpacket timestamp field and subpacket payload data field. 13.根据权利要求12所述的基于用户数据报协议的数据流接收装置,其特征在于,还包括:13. The data stream receiving device based on UDP according to claim 12, further comprising: 顺序判断单元,用于判断所述的用户数据报协议包的顺序是否连续;A sequence judging unit, configured to judge whether the sequence of the user datagram protocol packets is continuous; 丢包处理单元,用于如果所述的用户数据报协议包的顺序是不连续的,则进行相应的丢包处理。A packet loss processing unit, configured to perform corresponding packet loss processing if the sequence of the user datagram protocol packets is discontinuous. 14.根据权利要求13所述的基于用户数据报协议的数据流接收装置,其特征在于,还包括:14. The data stream receiving device based on UDP according to claim 13, further comprising: 定时器启动单元,用于当所述的用户数据报协议包的顺序不连续时,启动定时器;A timer starting unit, configured to start the timer when the sequence of the user datagram protocol packets is discontinuous; 信息类型判断单元,用于当定时器定时超时,判断丢失的用户数据报协议包是否携带有配置信息;The information type judging unit is used for judging whether the lost user datagram protocol packet carries configuration information when the timer is timed out; 重传信息发送单元,用于如果所述的丢失的用户数据报协议包携带有配置信息,则发送所述用户数据报协议包重传信息;A retransmission information sending unit, configured to send retransmission information of the user datagram protocol packet if the lost user datagram protocol packet carries configuration information; 同步更新单元,用于如果所述的丢失的用户数据报协议包携带的不是配置信息,则按照当前接收的用户数据报协议包进行同步更新。A synchronous update unit, configured to perform synchronous update according to the currently received UDP packet if the lost UDP packet does not carry configuration information. 15.根据权利要求12至14中任意一项所述的基于用户数据报协议的数据流接收装置,其特征在于,还包括,15. The user datagram protocol-based data stream receiving device according to any one of claims 12 to 14, further comprising: 反馈数据包发送单元,用于当信息接收单元接收到所述用户数据报协议包后,发送反馈数据包;其中,所述反馈数据包用于通知服务器端与客户端保持连接状态。The feedback data packet sending unit is configured to send a feedback data packet after the information receiving unit receives the user datagram protocol packet; wherein, the feedback data packet is used to notify the server to maintain a connection state with the client. 16.根据权利要求15所述的基于用户数据报协议的数据流接收装置,其特征在于,还包括,16. The device for receiving data streams based on User Datagram Protocol according to claim 15, further comprising: 启动单元,用于当客户端与服务器端进行数据交互时,启动定时器,或者计数器;The start unit is used to start the timer or counter when the client performs data interaction with the server; 所述反馈数据包发送单元,还用于当所述的定时器定时时间到或者计数器的计数满足条件时,发送反馈数据包;其中,所述的反馈数据包用于通知服务器端当前客户端与服务器端的连接状态。The feedback data packet sending unit is further configured to send a feedback data packet when the timer expires or the count of the counter satisfies the condition; wherein, the feedback data packet is used to notify the server that the current client and Connection status on the server side.
CN200910081075A 2009-04-01 2009-04-01 UDP (User Datagram Protocol)-based data stream sending-receiving method and device Expired - Fee Related CN101854286B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910081075A CN101854286B (en) 2009-04-01 2009-04-01 UDP (User Datagram Protocol)-based data stream sending-receiving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910081075A CN101854286B (en) 2009-04-01 2009-04-01 UDP (User Datagram Protocol)-based data stream sending-receiving method and device

Publications (2)

Publication Number Publication Date
CN101854286A CN101854286A (en) 2010-10-06
CN101854286B true CN101854286B (en) 2012-09-05

Family

ID=42805563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910081075A Expired - Fee Related CN101854286B (en) 2009-04-01 2009-04-01 UDP (User Datagram Protocol)-based data stream sending-receiving method and device

Country Status (1)

Country Link
CN (1) CN101854286B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325158B (en) * 2011-07-15 2014-08-20 四川长虹电器股份有限公司 Dynamic multi-thread broadcasting transmitting and analysis method
CN102647621B (en) * 2012-04-28 2014-07-23 武汉兴图新科电子股份有限公司 Video synchronous playback device and method
US10250511B2 (en) * 2016-06-10 2019-04-02 International Business Machines Corporation Persistent flow identifiers enabling disparate applications
CN109327730B (en) * 2018-09-11 2020-05-26 视联动力信息技术股份有限公司 Method and device for downloading data packet
CN109379386A (en) * 2018-12-13 2019-02-22 广州市百果园信息技术有限公司 A kind of method for message transmission, device, equipment and medium
CN110557655B (en) * 2019-09-06 2021-10-26 卓米私人有限公司 Video picture display method and device, electronic equipment and storage medium
CN110535978B (en) * 2019-10-08 2021-06-25 湖南新云网科技有限公司 Data transmission method, device and system, intelligent wearable device and storage medium
CN110912942B (en) * 2019-12-30 2021-09-21 深圳市瑞云科技有限公司 Method for reducing UDP message sending time delay
CN113259370B (en) * 2021-06-03 2021-11-02 腾讯科技(深圳)有限公司 Data transmission method, device, equipment, system and readable storage medium
CN114070877B (en) * 2021-11-18 2023-10-20 北京云上曲率科技有限公司 Data transmission method, server and client based on user datagram protocol
CN115424483A (en) * 2022-10-10 2022-12-02 重庆康普达科技有限公司 Interactive teaching system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1481132A (en) * 2002-09-04 2004-03-10 清华同方股份有限公司 Multicast method for distributing mass file applied to satellite data broadcasting system
CN1482779A (en) * 2002-09-13 2004-03-17 北京威速科技有限公司 Forward error correction in internet multimedia realtime communication
US7002993B1 (en) * 2000-08-18 2006-02-21 Juniper Networks, Inc. Method and apparatus providing media aggregation in a packet-switched network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7002993B1 (en) * 2000-08-18 2006-02-21 Juniper Networks, Inc. Method and apparatus providing media aggregation in a packet-switched network
CN1481132A (en) * 2002-09-04 2004-03-10 清华同方股份有限公司 Multicast method for distributing mass file applied to satellite data broadcasting system
CN1482779A (en) * 2002-09-13 2004-03-17 北京威速科技有限公司 Forward error correction in internet multimedia realtime communication

Also Published As

Publication number Publication date
CN101854286A (en) 2010-10-06

Similar Documents

Publication Publication Date Title
CN101854286B (en) UDP (User Datagram Protocol)-based data stream sending-receiving method and device
US7558247B2 (en) Optimized radio bearer configuration for voice over IP
US6694471B1 (en) System and method for periodic retransmission of messages
JP3799326B2 (en) Packet transmission method and packet reception method
US7397819B2 (en) Packet compression system, packet restoration system, packet compression method, and packet restoration method
US7272153B2 (en) System and method for distributed processing of packet data containing audio information
US7865610B2 (en) Point to multipoint reliable protocol for synchronous streaming data in a lossy IP network
CN105656774B (en) A kind of network real-time video conversation media data multipath hybrid redundancy transmission method
CN1433623A (en) Method and apparatus for packet delay reduction using scheduling and header compression
US9106444B2 (en) Method for transmitting of a multi-channel data stream on a multi-transport tunnel, corresponding computer-readable storage means and tunnel end-points
WO2007128217A1 (en) Method of internet protocol(ip) message transmission, negotiated bandwidth saving capability and saving network bandwidth
CN103916375B (en) The encapsulation of hfc plant downlink data multichannel and transmission method
CN110474721A (en) Method of transmitting video data, device and computer readable storage medium
CN103430561A (en) Device and method for transmitting multimedia data in broadcasting system
US8416786B2 (en) Data transport container for transferring data in a high speed internet protocol network
EP1914933B1 (en) Method and apparatus for retransmission request reduction in a network
WO2011009369A1 (en) Method and equipment for realizing signaling negotiation of real-time transport protocol data stream multiplexing
WO2006086691A2 (en) A network for providing a streaming service
JP3933555B2 (en) DATA DISTRIBUTION SYSTEM, DATA DISTRIBUTION DEVICE, DATA DISTRIBUTION METHOD, DATA DISTRIBUTION PROGRAM, AND RECORDING MEDIUM CONTAINING THE PROGRAM
US8391284B2 (en) Usage of feedback information for multimedia sessions
Zink et al. LC-RTP (loss collection RTP): reliability for video caching in the Internet
WO2010009652A1 (en) Transmission method for multiplex data stream
CN102546626B (en) Data processing method, device and system
EP1709773A2 (en) Optimized radio bearer configuration for voice over ip
Bluetooth Audio/Video Distribution Transport Protocol Specification

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120905

Termination date: 20170401