WO2009082951A1 - Procédé et dispositif de réception d'une séquence de paquets de données - Google Patents

Procédé et dispositif de réception d'une séquence de paquets de données Download PDF

Info

Publication number
WO2009082951A1
WO2009082951A1 PCT/CN2008/073666 CN2008073666W WO2009082951A1 WO 2009082951 A1 WO2009082951 A1 WO 2009082951A1 CN 2008073666 W CN2008073666 W CN 2008073666W WO 2009082951 A1 WO2009082951 A1 WO 2009082951A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
virtual
sequence
serial number
packet
Prior art date
Application number
PCT/CN2008/073666
Other languages
English (en)
French (fr)
Inventor
Fan Yu
Original Assignee
Huawei Technologies 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 Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2009082951A1 publication Critical patent/WO2009082951A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0091Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location arrangements specific to receivers, e.g. format detection

Definitions

  • the present invention relates to a data packet receiving technique, and in particular, to a data packet sequence receiving method and apparatus.
  • a transmitting end encapsulates data to be transmitted in a data packet of various protocols for transmission.
  • the packet header format of different protocols is different, there are two common information fields in the header of the packet: Sequence Number and Timestamp.
  • the receiving end restores the original data packet sequence sent by the sending end according to the sequence number or time stamp information contained in the header of the data packet as the basis for reordering.
  • the server obtains one frame of data from the program each time, and divides it into several Real Time Protocol (RTP) data packets, encapsulates the encoded data into RTP data packets, and then adds the time stamp and sequence number.
  • RTP Real Time Protocol
  • packets belonging to the same frame have the same timestamp.
  • the server sends the audio and video data packet of this frame, and then reads the next frame data.
  • the audio and video RTP data packets are transmitted to the client receiving end via the Internet, they first enter a buffer queue, and all the data packets in the buffer queue are reordered according to the sequence numbers contained in the packet header. If there is a late data packet, then according to the data packet, The sequence number contained in the late packet re-inserts the late packet into the correct location to avoid the problem of out-of-order.
  • the client receives a frame of data from the buffer queue header each time, from the time stamp contained in the header.
  • the information solves the playback time of the frame, and then performs audio and video synchronization processing.
  • the synchronized data is sent to the decoder for decoding, and the decoded data is sent to a circular read buffer for waiting.
  • the decoded data is taken out of the cache and sent to the playback module to drive the underlying hardware device for display or playback.
  • the client receiver can also detect lost, corrupted, and duplicate packets based on the serial number.
  • the client receiving end reorders the original data packet sent by the transmitting end according to the sequence number included in the data packet header, and restores the original data packet sequence.
  • the sequence number based on the sequence number cannot reflect the interval change of the packet sending packet, and therefore,
  • the time interval of the data packet sent by the sender is normal, and the sequence number may be cleared for some reason or a large jump occurs.
  • the client receiver receives the data packet according to the included sequence number (the sequence number is cleared or a large one occurs). Jumping) The situation of the sender is not determined, and the complexity of statistics and processing is increased.
  • the bit width of the serial number is limited. For example, if the serial number bit width is 16 bits, the maximum value of the serial number is 65535. During the transmission process, the serial number overflow phenomenon may occur 4 hours later. If the serial number bit width is smaller, the frequency of the serial number overflow is more frequent. The system needs to add extra overhead to deal with the serial number overflow and zero return problem, which reduces the utilization of system resources.
  • Another method in the prior art for restoring the original data packet sequence of the transmitting end is to reorder the original data packet sequence according to the time stamp by using the time stamp information contained in the data packet.
  • the sender sets the timestamp in the first byte of the packet group, and the timestamp value follows the time of sending the packet.
  • the client receiver uses the time stamp information to reconstruct the original packet time, synchronize the data packet, and play the information at the correct rate.
  • the above method for restoring the original data packet sequence based on the time stamp requires higher time stamp accuracy. Compared with the serial number and the same bit width, the frequency of the overflow is much faster than the serial number, which also requires additional system overhead to be processed. Overflow turns back to zero.
  • the embodiment of the invention provides a method for receiving a data packet sequence, which can adapt to different data packet time intervals and improve resource utilization.
  • the embodiment of the invention further provides a device for receiving a data packet sequence, which can adapt to different data packet time intervals and improve resource utilization.
  • a method for receiving a data packet sequence comprising: receiving a sequence of data packets, assigning a virtual sequence number to the received data packet; and receiving the current data
  • the packet is the first data packet after the data packet of the virtual serial number is allocated, and the virtual serial number of the current data packet is obtained according to the previous data packet virtual serial number timely stamping information, the current data packet time stamping information, and the minimum data packing interval; Reordering the received sequence of data packets.
  • a device for receiving a data packet sequence comprising: a data packet receiving unit, configured to receive a data packet sequence; a virtual sequence number generating unit, configured to allocate a virtual serial number to the data packet received by the data packet receiving unit, and in the receiving unit
  • the current data packet received is the first data packet after the virtual serial number is assigned.
  • the data packet, the virtual serial number of the current data packet is obtained according to the previous data packet virtual serial number timely stamping information, the current data packet time stamping information, and the minimum data packing interval; the data packet processing unit is configured to use the virtual serial number included in the data packet Reorder the received packet sequence.
  • a method and a device for receiving a data packet sequence convert a time stamp information in a data packet into a virtual serial number whose bit width is not limited, and the virtual serial number carries time stamp information, and According to the virtual serial number, the sequence of received data packets is reordered, the bit width of the virtual serial number is large, the overflow frequency is low, the virtual serial number is related to the time stamp and the packet packing duration, the frequency of the overflow can be controlled, the certainty of the work is higher, and the stability is stable. Better sex, can adapt to any packet packing time, improve resource utilization.
  • FIG. 1 is a schematic structural diagram of an apparatus for receiving a sequence of data packets according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for receiving a sequence of data packets according to an embodiment of the present invention.
  • the embodiment of the present invention allocates a virtual sequence number to the first data packet of the data packet sequence and stores the corresponding virtual sequence number and time stamp information, and then according to the previous data packet virtual serial number timely stamp information, current data packet time stamp information, and minimum
  • the data packing interval obtains the virtual serial number of the current data packet, converts the time stamp information in the data packet into a virtual serial number whose bit width is not limited, reorders the received data packet sequence according to the virtual serial number, and can receive the virtual serial number pair.
  • the queue is sorted and output managed in units of data fragments or packets.
  • FIG. 1 is a schematic structural diagram of an apparatus for receiving a sequence of data packets according to an embodiment of the present invention.
  • the device includes: a data packet receiving unit 101, a virtual sequence number generating unit 102, and a data packet processing unit 103, wherein the data packet receiving unit 101 is configured to receive a data packet sequence, and the virtual sequence number generating unit 102 is configured to The data packet received by the data packet receiving unit randomly allocates a virtual serial number, and when the current data packet received by the receiving unit is the first data packet after the data packet of the virtual serial number is allocated, the virtual data packet is timely stamped according to the previous data packet.
  • the virtual sequence number generating unit includes a first virtual sequence number generating unit, configured to obtain a packing interval between the current data packet and the previous data packet according to a time stamp of the current data packet and a time stamp of the last data packet, and package the packet
  • the virtual sequence number increment is obtained by adding the virtual sequence number of the previous data packet to the virtual sequence number increment to obtain the virtual sequence number of the current data packet
  • the virtual sequence number generating unit may further include a second virtual sequence number generating unit, configured to obtain a packing interval between the current data packet and a previous data packet according to a time stamp of the current data packet and a time stamp of the previous data packet, and set the packing interval to a set scheduling packet compensation time
  • the virtual sequence number generating unit may include one of the first virtual sequence number generating unit and the second virtual sequence number generating unit; or may include the first virtual generating unit and the first Two virtual serial number generating units, and can be switched as needed.
  • the virtual sequence number generating unit of the embodiment of the present invention further includes: a virtual sequence number generating module and a storage module, where a storage module, configured to store virtual serial number and time stamp information of the data packet; a virtual serial number generating module, configured to send the virtual serial number of the data packet received by the data packet receiving unit, and store the allocated virtual serial number and the time stamp information of the corresponding data packet to The storage module; and when the current data packet received by the receiving unit is the first data packet after the data packet of the virtual serial number is allocated, according to the last data packet virtual serial number timely stamp information and the current data packet time stamp information stored by the storage module And the minimum data packing interval obtains the virtual serial number of the current data packet, and updates the obtained virtual serial number and the time stamp information of the current data packet to the storage module.
  • the received current data packet is the first data packet to which the virtual serial number is assigned, and may be selected according to the actual needs of the user. For example, the user may select one data packet in the received data packet sequence according to actual needs.
  • the first data packet, the virtual sequence number is randomly assigned to the data packet, and the subsequent data packets are sequentially received as the second, third, ..., kth.
  • the overflow and zero return processing is performed. Since the bit width of the virtual serial number can be much larger than the bit width of the serial number and the time stamp, the frequency of overflow is greatly reduced.
  • the data packet processing unit 103 is configured to reorder the received data packet sequence according to the virtual sequence number included in the data packet.
  • the data packet processing unit may further include a cache module and a sorting module; a cache module, configured to cache the data packet; the size of the cache module cache may be set according to actual needs, and after the data packet is cached, a cached data packet queue is formed, and the queue is sorted.
  • the module is configured to sort according to the virtual serial number of the current data packet, and insert the current data packet into a corresponding position of the data packet queue of the cache module.
  • the device may further comprise a data fragmentation unit for packing the current data packet Obtaining the number N of data fragments included in the current data packet compared with the minimum data packing interval, and allocating consecutive N virtual serial numbers starting from the virtual serial number of the current data packet obtained from the virtual sequence number generating unit to the N fragments of the current data packet, Each virtual sequence number corresponds to a data fragment of a minimum packetization interval.
  • FIG. 2 is a schematic flowchart of a method for receiving a sequence of data packets according to an embodiment of the present invention. Referring to FIG. 2, the process includes: Step 201: Record a received sequence of data packets, and assign a virtual sequence number to the received data packet.
  • a virtual sequence number of the first data packet of the received data packet sequence is N. And recording the time stamp information of the first data packet of the received data packet sequence and the set virtual serial number.
  • the value of N can be set according to actual needs, and the initial value of the setting, that is, the virtual serial number of the first data packet can be unrestricted.
  • the bit width of the virtual serial number can also be unlimited.
  • Set the received packet as the current packet. For example, if the first data packet of the data packet sequence is received, the first data packet is the current data packet; when the second data packet of the data packet sequence is received, the second data packet is the current data packet. Package, the first packet is the previous packet, and so on.
  • Step 202 When the received current data packet is the first data packet after the data packet of the virtual serial number is allocated, the current data is obtained according to the previous data packet virtual serial number timely stamp information, the current data packet time stamp information, and the minimum data packing interval.
  • the virtual serial number of the packet; in this step, the virtual serial number of the current data packet is obtained, that is, the virtual serial number algorithm may be: the virtual serial number of the current data packet the virtual serial number of the previous data packet + M [ (the current data packet time stamp - on The time stamp of a packet) / the minimum data packing interval];
  • Delta is the scheduling error of scheduling dispatching, which is a parameter introduced by considering the time error of the packet sending packet. That is to say, the scheduled dispatching compensation time is used to compensate the time jitter existing in the packet sending process, that is, the The delivery time is rounded off. If the packet is scheduled strictly at the packing interval, the Delta can be set to zero or not, and the Delta maximum does not exceed the minimum data packing interval. In practical applications, half of the minimum data packing interval can be taken, and the unit is consistent with the unit of the time stamp; the time stamp of the current data packet - the time stamp of the previous data packet, which is the packing interval of the current data packet. The minimum data packing interval is consistent with the unit of the time stamp; M[] , which represents the operator that performs the rounding operation on [].
  • other algorithms may be set to calculate the virtual sequence number of the data packet sequence, and the time stamp information of the current data packet and the calculated virtual sequence number are stored, that is, the time stamp information of the current data packet is used and calculated.
  • the virtual serial number replaces the stored last timestamp information and the virtual serial number.
  • Step 203 Calculate, according to the current packet packing interval and the minimum data packing interval, the number of data segments included in the current data packet, and reorder the data packet in the current step of the current data packet.
  • the current data packet packing interval is three times the minimum data packing interval unit, and the current data packet is considered to include three data fragments with virtual serial numbers of 100, 101, and 102, and The three data fragments are sorted in the order of the virtual sequence numbers and inserted into the appropriate locations of the cached packet queue.
  • the virtual sequence number of the current data packet is L according to the above algorithm, and the data in the current data packet (the actual packing interval) is P times of the minimum data packing interval unit, the data included in the current data packet is calculated.
  • the current data packet includes P data fragments with virtual serial numbers L, L + 1 L + P - 1, and each virtual serial number corresponds to a data fragment with a minimum packing interval time.
  • the P data fragments are sorted in the order of the virtual sequence numbers and inserted into the cache packet queue.
  • the cached packet queue may be directly managed in units of data packets without data fragmentation: that is, the data packet sequence of multiple data fragments may not be decomposed into data fragments with different virtual serial numbers.
  • the data packet is buffered and sorted according to the virtual serial number interval, that is, the virtual serial number of the data fragment included in the data packet is not considered, and the data packet is continuously played according to the number of data fragments included in the data packet when outputting. time.
  • the repetition and the out-of-order of the data packet may also be determined based on the virtual serial number, and the method for determining the same is similar to the method based on the serial number, and details are not described herein again.
  • a method and a device for receiving a data packet sequence allocate a virtual sequence number for a first data packet of a data packet sequence and store corresponding virtual sequence numbers and time stamp information, and subsequently The last data packet virtual serial number and time stamp information, the current data packet time stamp information, and the virtual serial number algorithm used to calculate the virtual serial number of the current data packet, and convert the time stamp information in the data packet into a bit width without limitation.
  • the virtual serial number, and the received data packet sequence is reordered according to the virtual serial number, and the received data packet sequence can be sorted and output managed in units of data fragments or data packets using the virtual serial number.
  • the bit width and initial value of the virtual serial number can be set, the range of the virtual serial number is greatly expanded, and the frequency of the overflow is reduced.
  • the virtual serial number is related to the time stamp and the packet packing duration, and the frequency of the overflow can be controlled, and the working It has higher certainty and better stability. It can adapt to any packet packing time and improve resource utilization.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

一种数据包序列接收的方法及设备 本申请要求于 2007 年 12 月 25 日提交中国专利局、 申请号为 200710301380.2,发明名称为"一种数据包序列接收的方法及设备 "的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域 本发明涉及数据包接收技术, 特别涉及一种数据包序列接收的方法及设 备。
背景技术 在网络中, 发送端将需要发送的数据封装在各种协议的数据包里进行传 输。 虽然不同协议的数据包报文头部格式不同, 但在数据包报文头部中都包 含有两个常见的信息字段: 序号 ( Sequence Number )和时戳( Timestamp )。 接收端接收到发送端发送的数据包后, 根据数据包报文头部中包含的序号或 时戳信息作为重排序的依据, 恢复发送端发出的原始数据包序列。 以播放音视频为例, 服务器每次从节目中获取一帧数据, 分成几个实时 传输协议( RTP , Real Time Protocol )数据包,将编码数据封装成 RTP数据包, 然后将时戳和序号添加到 RTP包头, 属于同一帧的数据包具有相同的时戳。 当到达数据包所应播放的时间后, 服务器便将这一帧的音视频数据包发送出 去, 然后再读取下一帧数据。 音视频 RTP数据包经互联网络传输到客户接收端后, 先进入一个緩冲队 列等待, 这个緩冲队列中的所有数据包按照包头中包含的序号重新排序, 如 果有迟到的数据包, 则根据迟到的数据包中包含的序号重新将迟到的数据包 插入到正确的位置上, 以避免乱序的问题。 客户接收端每次从緩冲队列头部读取一帧的数据, 从包头中包含的时戳 信息解出该帧的播放时间, 然后进行音视频同步处理。 同步后的数据将送入 解码器进行解码, 解码后的数据被送入一个循环读取的緩存中等待。 一旦该 帧的播放时间到达, 解码数据就被从緩存中取出, 送入播放模块驱动底层硬 件设备进行显示或播放。 客户接收端还可根据序列号对丟失、 损坏和重复的 数据包进行检测。 在现有技术中, 例如上述播放音视频中, 客户接收端根据数据包包头包 含的序号对发送端发送的原始数据包重新排序, 恢复原始数据包序列。 在实 际应用中, 如果发送的数据包间隔发生变化, 也就是数据包包头序号信息所 表示的时间长度发生变化时, 基于序号排序不能体现出这种数据包发包的间 隔变化, 因此, 在现有技术中, 对于发包时间间隔变化的数据包, 釆用其它 控制处理技术, 需要额外的处理开销。 此外, 发送端发送的数据包时间间隔正常, 而序号可能因为某种原因清 零或发生大的跳变的情况下, 客户接收端接收数据包, 根据包含的序号 (序 号清零或发生大的跳变) 不能确定发送端的情况, 增加了进行统计和处理的 复杂度。 进一步地, 如果客户接收端单纯根据接收的数据包包含的序号来恢复发 送端的原始数据包序列, 在某些应用场合下会受限于序号的位宽。 举例来说, 如果序号位宽为 16bit, 则序号的最大值为 65535, 传输过程中, 可能 4艮快就 将出现序号溢出的现象, 如果序号位宽更小, 序号溢出的频率也就越频繁, 需要系统增加额外的开销来处理序号溢出回转归零问题, 降低了系统资源的 利用率。 现有技术中另外一种恢复发送端的原始数据包序列的方法是通过数据包 中包含的时戳信息, 客户接收端根据时戳对原始数据包序列重新排序。 发送 端在釆样数据包分组中的第一个字节设置时戳, 时戳值随着发送分组的时间 推迟而递增, 客户接收端接收到数据包后, 利用时戳信息重建数据包原始时 间, 同步数据包, 并以正确的速率播放信息。 但上述基于时戳恢复原始数据包序列的方法, 时戳精度要求较高, 相对 于序号, 相同位宽的时戳, 其溢出的频率比序号快很多, 这也需要增加系统 额外的开销来处理溢出回转归零问题。
发明内容
本发明实施例提供一种数据包序列接收的方法, 可以适应不同的数据包 时间间隔, 提高资源利用率。 本发明实施例还提供一种数据包序列接收的设备, 可以适应不同的数据 包时间间隔, 提高资源利用率。 为达到上述目的, 本发明实施例的技术方案具体是这样实现的: 一种数据包序列接收的方法, 该方法包含: 接收数据包序列, 为接收的数据包分配虚拟序号; 当接收的当前数据包是第一个分配虚拟序号的数据包以后的数据包时, 根据上一个数据包虚拟序号及时戳信息、 当前数据包时戳信息以及最小数据 打包间隔获取当前数据包的虚拟序号; 根据虚拟序号对所述接收的数据包序列重新排序。 一种数据包序列接收的设备, 该设备包含: 数据包接收单元, 用于接收数据包序列; 虚拟序号生成单元, 用于给数据包接收单元接收到的数据包分配虚拟序 号, 并在接收单元接收到的当前数据包是第一个分配虚拟序号的数据包以后 的数据包时, 根据上一个数据包虚拟序号及时戳信息、 当前数据包时戳信息, 以及最小数据打包间隔获取当前数据包的虚拟序号; 数据包处理单元, 用于根据数据包包含的虚拟序号对接收的数据包序列 重新排序。 由上述技术方案可见, 本发明实施例的一种数据包序列接收的方法及设 备, 通过将数据包中的时戳信息转换成位宽不受限的虚拟序号, 虚拟序号携 带时戳信息, 并根据虚拟序号对接收的数据包序列进行重新排序, 虚拟序号 的位宽大, 溢出频率低, 虚拟序号与时戳及数据包打包时长相关, 其溢出的 频率可以控制, 工作的确定性更高, 稳定性更好, 可以自适应任意数据包打 包时长, 提高了资源的利用率。
附图说明
图 1为本发明实施例一种数据包序列接收的设备结构示意图;
图 2为本发明实施例一种数据包序列接收的方法流程示意图。
具体实施方式 为使本发明的目的、 技术方案及优点更加清楚明白, 以下参照附图并举 实施例, 对本发明作进一步详细说明。 本发明实施例通过为数据包序列的第一个数据包分配虚拟序号并存储相 应的虚拟序号和时戳信息, 后续中根据上一个数据包虚拟序号及时戳信息、 当前数据包时戳信息以及最小数据打包间隔获取当前数据包的虚拟序号, 将 数据包中的时戳信息转换成位宽不受限的虚拟序号, 根据虚拟序号对接收的 数据包序列进行重新排序, 并可以使用虚拟序号对接收队列以数据分片或数 据包为单位进行排序和输出管理。 为了实现上述目的, 本发明实施例提出了一种数据包序列接收的设备。 图 1为本发明实施例一种数据包序列接收的设备结构示意图。 参见图 1 , 该设备包含: 数据包接收单元 101、虚拟序号生成单元 102及数据包处理单元 103 , 其中, 数据包接收单元 101 , 用于接收数据包序列; 虚拟序号生成单元 102,用于给数据包接收单元接收到的数据包随机分配 虚拟序号, 并在接收单元接收到的当前数据包是第一个分配虚拟序号的数据 包以后的数据包时, 根据上一个数据包虚拟序号及时戳信息、 当前数据包时 戳信息, 以及最小数据打包间隔获取当前数据包的虚拟序号。 实际应用中, 虚拟序号生成单元包括第一虚拟序号生成单元, 用于根据 当前数据包的时戳和上一个数据包的时戳获取当前数据包与上一个数据包的 打包间隔, 将所述打包间隔与所述最小数据打包间隔相比, 得到虚拟序号增 量, 将上一个数据包的虚拟序号加上所述虚拟序号增量获取所述当前数据包 的虚拟序号; 虚拟序号生成单元还可以包括第二虚拟序号生成单元, 用于根据当前数 据包的时戳和上一个数据包的时戳获取当前数据包与上一个数据包的打包间 隔, 将所述打包间隔与设置的调度发包补偿时间相加后与最小数据打包间隔 相比, 对相比后的结果进行取整运算得到虚拟序号增量, 将上一个数据包的 虚拟序号加上所述虚拟序号增量获取所述当前数据包的虚拟序号。 易于理解的是, 所述虚拟序号生成单元既可以包括所述第一虚拟序号生 成单元和所述第二虚拟序号生成单元二者中的一个; 也可以同时包括所述第 一虚拟生成单元和第二虚拟序号生成单元, 并可根据需要进行切换。 本发明实施例的虚拟序号生成单元还包括: 虚拟序号生成模块及存储模 块, 其中, 存储模块, 用于存储数据包的虚拟序号及时戳信息; 虚拟序号生成模块, 用于给数据包接收单元接收到的数据包虚拟序号, 将分配的虚拟序号及对应数据包的时戳信息存储至存储模块; 并在接收单元 接收到的当前数据包是第一个分配虚拟序号的数据包以后的数据包时, 根据 存储模块存储的上一个数据包虚拟序号及时戳信息、 当前数据包时戳信息以 及最小数据打包间隔获取当前数据包的虚拟序号, 将获取的虚拟序号及当前 数据包的时戳信息更新至存储模块。 实际应用中, 判断接收到的当前数据包是否为第一个分配虚拟序号的数 据包, 可以根据用户的实际需求来进行选择, 如用户可以根据实际需求选择 接收的数据包序列中一个数据包为第一个数据包, 为该数据包随机分配虚拟 序号, 则后续依次接收的数据包为第二个, 第三个, …, 第 k个。 当计算出 的虚拟序号溢出时, 进行溢出回转归零处理, 由于虚拟序号的位宽可较序号 和时戳的位宽大很多, 大大降低了其溢出的频率。 数据包处理单元 103 ,用于根据数据包包含的虚拟序号对接收的数据包序 列重新排序。 实际应用中, 数据包处理单元还可以包括緩存模块以及排序模块; 緩存模块, 用于緩存数据包; 緩存模块緩存的大小可以根据实际需要进行设置, 緩存数据包后, 形成 緩存数据包队列, 排序模块, 用于根据当前数据包的虚拟序号进行排序, 将当前数据包插 入到緩存模块的数据包队列的相应位置。 该设备还可以进一步包括数据分片单元, 用于将当前数据包的打包间隔 与最小数据打包间隔相比得到当前数据包包含的数据分片数 N, 给当前数据 包的 N个分片分配从虚拟序号生成单元得到的当前数据包的虚拟序号开始的 连续 N个虚拟序号, 每个虚拟序号对应一个最小打包间隔时间的数据分片。 图 2为本发明实施例一种数据包序列接收的方法流程示意图。 参见图 2, 该流程包括: 步骤 201 , 记录接收到的数据包序列, 为接收的数据包分配虚拟序号; 本步骤中,设置接收到的数据包序列的第一个数据包的虚拟序号为 N,记 录接收到的数据包序列的第一个数据包的时戳信息及设置的虚拟序号。 实际应用中, N值可以根据实际需要进行设置, 其设置的初值, 即第一个 数据包的虚拟序号可以不受限制, 同样, 虚拟序号的位宽也可以不受限制。 设置接收的数据包作为当前数据包。 举例来说, 如果接收到数据包序列 的第一个数据包, 则第一个数据包为当前数据包; 当接收到数据包序列的第 二个数据包时, 第二个数据包为当前数据包, 第一个数据包为上一个数据包, 依此类推。 步骤 202 , 当接收的当前数据包是第一个分配虚拟序号的数据包以后的数 据包时, 根据上一个数据包虚拟序号及时戳信息、 当前数据包时戳信息以及 最小数据打包间隔获取当前数据包的虚拟序号; 本步骤中, 获取当前数据包的虚拟序号, 即虚拟序号算法可以是: 当前数据包的虚拟序号 =上一个数据包的虚拟序号 +M[ (当前数据包的时 戳-上一个数据包的时戳) /最小数据打包间隔]; 虚拟序号算法也可以是: 当前数据包的虚拟序号 =上一个数据包的虚拟序号 +M[ (当前数据包的时 戳-上一个数据包的时戳 +Delta ) /最小数据打包间隔]; 其中,
Delta为调度发包补偿时间, 是考虑调度数据包发包存在的时间误差所引 入的参数, 也就是说所述的调度发包补偿时间就是用于补偿数据包发包过程 中存在的时间抖动, 即对所述发包时间进行四舍五入。 如果数据包严格按打 包间隔进行调度, 则 Delta可以设置为零或不进行设置, Delta最大不超过最 小数据打包间隔。 实际应用中, 可以取最小数据打包间隔的一半, 单位与时 戳的单位一致; 当前数据包的时戳 -上一个数据包的时戳, 为当前数据包的打包间隔。 最小数据打包间隔, 与时戳的单位保持一致; M[] , 表示对 []进行取整运算的运算符。 举例来说, 例如实际最小数据打包间隔为 10ms, 时戳单位为 l/8ms, 则 公式中最小数据打包间隔与时戳的单位保持一致, 为 80 ( l/8ms ); 假设此时时戳之差是 160 ( l/8ms ), Delta取 40 ( l/8ms ), 贝' J 当前数据包的虚拟序号 =上一数据包的虚拟序号 + 2。 实际应用中, 也可以设定其它的算法计算数据包序列的虚拟序号, 并将 当前数据包的时戳信息及计算好的虚拟序号进行存储, 即用当前数据包的时 戳信息及计算好的虚拟序号替换存储的上一个时戳信息及虚拟序号。 对于虚 拟序号算法中的除以最小数据包打包间隔取值的运算, 也可以通过移位运算 来实现。 步骤 203 , 根据当前数据包的打包间隔与最小数据打包间隔, 计算得到当 前数据包包含的数据分片数, 重新排序; 本步骤中, 当前数据包的打包间隔=当前数据包的时戳-上一个数据包 的时戳。 举例来说, 假设数据包最小打包间隔为 10ms, 当前数据包的打包间 隔为 30ms, 时戳单位为 l/8ms, 上一数据包的虚拟序号为 97, 则依据算法: 当前数据包的虚拟序号 =上一个数据包的虚拟序号 +M[(当前数据包的时戳- 上一个数据包的时戳 +Delta ) /最小数据打包间隔]。 计算出当前数据包的虚拟序号为 100, 当前数据包打包间隔是最小数据打 包间隔单位的 3 倍, 则认为当前数据包中包含了虚拟序号为 100、 101、 102 的三个数据分片, 并将这三个数据分片按照虚拟序号顺序进行排序并插入到 緩存数据包队列的适当位置。 实际应用中, 如果根据上述算法计算得到当前数据包的虚拟序号是 L, 而 当前数据包中的数据(实际打包间隔)是最小数据打包间隔单位的 P倍, 即 计算得到当前数据包包含的数据分片数为 P,则可以认为当前数据包中包含了 虚拟序号为 L、 L + 1 L + P - 1的 P个数据分片, 每个虚拟序号对应一 个最小打包间隔时间的数据分片, 并将这 P个数据分片按虚拟序号的顺序进 行排序并插入到緩存数据包队列中。 实际应用中, 对于緩存数据包队列, 也可以不以数据分片为单位而直接 以数据包为单位进行管理: 即多个数据分片的数据包序列可以不分解成虚拟 序号不同的数据分片, 而直接以虚拟序号间隔为 P 的数据包为单位进行緩存 以及数据包队列的排序,举例来说,假设 P = 3 ,上一个数据包虚拟序号为 97, 则当前数据包虚拟序号为 100,按照虚拟序号间隔为 3对数据包进行緩存和排 序, 即不考虑数据包包含的的数据分片的虚拟序号, 在输出的时候再根据数 据包内包含的数据分片数决定该数据包持续播放的时间。 对于接收的数据包序列, 数据包的重复和乱序也可以基于虚拟序号进行 判断, 其判断的方法与基于序号的判断方法相类似, 在此不再赘述。 由上述实施例可见, 本发明实施例的一种数据包序列接收的方法及设备, 通过为数据包序列的第一个数据包分配虚拟序号并存储相应的虚拟序号和时 戳信息, 后续中根据上一个数据包虚拟序号及时戳信息、 当前数据包时戳信 息, 釆用设定的虚拟序号算法计算得到当前数据包的虚拟序号, 将数据包中 的时戳信息转换成位宽不受限的虚拟序号, 并根据虚拟序号对接收的数据包 序列进行重新排序, 并可以使用虚拟序号对接收的数据包序列以数据分片或 数据包为单位进行排序和输出管理。 由于虚拟序号的位宽和初值可以进行设 置, 大大拓宽了虚拟序号的范围, 降低了溢出的频率; 而且, 虚拟序号与时 戳及数据包打包时长相关, 其溢出的频率可以控制, 工作的确定性更高, 稳 定性更好, 可以自适应任意数据包打包时长, 提高了资源的利用率。 通过以上的实施方式的描述, 本领域普通技术人员可以理解: 实现上述 实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成, 所述的程序可以存储于一计算机可读取存储介质中, 该程序在执行时, 包括 如上述方法实施例的步骤, 所述的存储介质, 如: R0M/RAM、 磁碟、 光盘等。 以上举较佳实施例, 对本发明的目的、 技术方案和优点进行了进一步详 细说明, 所应理解的是, 以上所述仅为本发明的较佳实施例而已, 并不用以 限制本发明, 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权利 要 求 书
1. 一种数据包序列接收的方法, 其特征在于, 该方法包括: 接收数据包序列, 为接收的数据包分配虚拟序号; 当接收的当前数据包是第一个分配虚拟序号的数据包以后的数据包时,根据 上一个数据包虚拟序号及时戳信息、 所述当前数据包时戳信息以及最小数据打 包间隔获取所述当前数据包的虚拟序号; 根据虚拟序号对所述接收的数据包序列重新排序。
2. 如权利要求 1所述的数据包序列接收的方法, 其特征在于, 所述获取当 前数据包的虚拟序号包括: 根据当前数据包的时戳和上一个数据包的时戳获取当前数据包与上一个数 据包的打包间隔, 将所述打包间隔与所述最小数据打包间隔相比, 得到虚拟序 号增量, 将上一个数据包的虚拟序号加上所述虚拟序号增量获取所述当前数据 包的虚拟序号。
3. 如权利要求 1所述的数据包序列接收的方法, 其特征在于, 所述获取当 前数据包的虚拟序号包括: 设置调度发包补偿时间, 根据当前数据包的时戳和 上一个数据包的时戳获取当前数据包与上一个数据包的打包间隔, 将所述打包 间隔与所述设置的调度发包补偿时间相加后与最小数据打包间隔相比, 对相比 后的结果进行取整运算得到虚拟序号增量, 将上一个数据包的虚拟序号加上所 述虚拟序号增量获取所述当前数据包的虚拟序号。
4. 如权利要求 1至 3中任意一项所述的数据包序列接收的方法, 其特征在 于, 在为第一个数据包分配虚拟序号后, 所述方法进一步包括: 存储分配的虚 拟序号及数据包包含的时戳信息。
5. 如权利要求 4所述的数据包序列接收的方法, 其特征在于, 在所述获取 所述当前数据包的虚拟序号后, 所述方法进一步包括: 用所述当前数据包时戳 信息及获取的当前数据包虚拟序号分别替换存储的所述当前数据包的上一个包 的虚拟序号及时戳信息。
6. 如权利要求 1至 3中任意一项所述的数据包序列接收的方法, 其特征在 于, 所述获取当前数据包的虚拟序号进一步包括: 根据当前数据包的打包间隔 与最小数据打包间隔, 计算得到当前数据包包含的数据分片数 N, 分片数为 N 的数据包, 占用从计算得到的虚拟序号开始的连续 N个虚拟序号, 每个虚拟序 号对应一个最小打包间隔时间的数据分片。
7. 如权利要求 6所述的数据包序列接收的方法, 其特征在于, 所述根据虚 拟序号对接收的数据包序列重新排序包括: 根据获取的数据包包含的数据分片 按虚拟序号的顺序重新排序。
8. 如权利要求 1所述的数据包序列接收的方法, 其特征在于, 所述根据虚 拟序号对接收的数据包序列重新排序之后进一步包括: 根据数据包的打包间隔 与最小数据打包间隔, 计算得到数据包的数据分片数, 根据数据包内包含的数 据分片数决定该数据包持续播放的时间。
9. 一种数据包序列接收的设备, 其特征在于, 该设备包含: 数据包接收单元, 用于接收数据包序列; 虚拟序号生成单元 ,用于给所述数据包接收单元接收到的数据包分配虚拟序 号, 并在所述接收单元接收到的当前数据包是第一个分配虚拟序号的数据包以 后的数据包时, 根据上一个数据包虚拟序号及时戳信息、 所述当前数据包时戳 信息, 以及最小数据打包间隔获取所述当前数据包的虚拟序号; 数据包处理单元,用于根据数据包包含的虚拟序号对所述接收的数据包序列 重新排序。
10. 如权利要求 9所述的数据包序列接收的设备, 其特征在于, 所述虚拟序 号生成单元具体为第一虚拟序号生成单元, 用于根据当前数据包的时戳和上一 个数据包的时戳获取当前数据包与上一个数据包的打包间隔, 将所述打包间隔 与所述最小数据打包间隔相比, 得到虚拟序号增量, 将上一个数据包的虚拟序 号加上所述虚拟序号增量获取所述当前数据包的虚拟序号。
11. 如权利要求 9所述的数据包序列接收的设备, 其特征在于, 所述虚拟序 号生成单元具体为第二虚拟序号生成单元, 用于根据当前数据包的时戳和上一 个数据包的时戳获取当前数据包与上一个数据包的打包间隔, 将所述打包间隔 与设置的调度补偿时间相加后与最小数据打包间隔相比, 对相比后的结果进行 取整运算得到虚拟序号增量, 将上一个数据包的虚拟序号加上所述虚拟序号增 量获取所述当前数据包的虚拟序号。
12. 如权利要求 9所述的数据包序列接收的设备, 其特征在于, 所述虚拟序 号生成单元包括: 存储模块, 用于存储数据包的虚拟序号及时戳信息; 虚拟序号生成模块,用于给所述数据包接收单元接收到的数据包分配虚拟序 号, 将分配的虚拟序号及对应数据包的时戳信息存储至所述存储模块; 并在所 述接收单元接收到的当前数据包是第一个分配虚拟序号的数据包以后的数据包 时, 根据所述存储模块存储的上一个数据包虚拟序号及时戳信息、 当前数据包 时戳信息以及最小数据打包间隔获取所述当前数据包虚拟序号; 将获取的虚拟 序号及当前数据包的时戳信息更新至所述存储模块。
13. 如权利要求 9至 12中的任一项所述的数据包序列接收的设备, 其特征 在于, 所述设备还包括数据分片单元, 用于将当前数据包的打包间隔与最小数 据打包间隔相比得到当前数据包包含的数据分片数 N, 给当前数据包的 N个分 片分配从所述虚拟序号生成单元得到的当前数据包的虚拟序号开始的连续 N个 虚拟序号, 每个虚拟序号对应一个最小打包间隔时间的数据分片。
14. 如权利要求 9至 12中的任一项所述的数据包序列接收的设备, 其特征 在于, 所述数据包处理单元包括: 緩存模块, 用于緩存数据包; 排序模块,用于根据当前数据包的虚拟序号进行排序,将当前数据包插入到 所述緩存模块的数据包队列的相应位置。
PCT/CN2008/073666 2007-12-25 2008-12-24 Procédé et dispositif de réception d'une séquence de paquets de données WO2009082951A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2007103013802A CN101188477B (zh) 2007-12-25 2007-12-25 一种数据包序列接收的方法及设备
CN200710301380.2 2007-12-25

Publications (1)

Publication Number Publication Date
WO2009082951A1 true WO2009082951A1 (fr) 2009-07-09

Family

ID=39480688

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/073666 WO2009082951A1 (fr) 2007-12-25 2008-12-24 Procédé et dispositif de réception d'une séquence de paquets de données

Country Status (2)

Country Link
CN (1) CN101188477B (zh)
WO (1) WO2009082951A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113365098A (zh) * 2021-06-01 2021-09-07 平安国际智慧城市科技股份有限公司 视频帧组装方法、装置、电子设备及存储介质
CN113438176A (zh) * 2021-05-17 2021-09-24 翱捷科技股份有限公司 一种处理分片ip数据包的方法及装置

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188477B (zh) * 2007-12-25 2010-07-07 华为技术有限公司 一种数据包序列接收的方法及设备
JP2013511857A (ja) * 2009-09-23 2013-04-04 エアロバイロメント,インコーポレイテッド 性能監視を使用するマルチパスネットワーク常用冗長性
CN103428110B (zh) * 2012-05-24 2017-08-11 中兴通讯股份有限公司 实时传输协议数据包的接收处理方法及装置
CN103124412A (zh) * 2012-11-16 2013-05-29 佳都新太科技股份有限公司 一种基于rtp协议的网络抖动处理技术
CN104184659B (zh) * 2013-05-22 2017-08-25 上海贝尔股份有限公司 一种用于获取网络中数据包的方法与设备
CN103809982A (zh) * 2014-02-26 2014-05-21 能力天空科技(北京)有限公司 一种排列方法及系统
CN107135671A (zh) * 2015-06-17 2017-09-05 华为技术有限公司 车联网数据传输方法及装置
CN105721252B (zh) * 2016-03-24 2020-09-25 腾讯科技(深圳)有限公司 数据包乱序度的测量方法和系统
CN105848011A (zh) * 2016-03-31 2016-08-10 乐视控股(北京)有限公司 一种视频直播方法及装置
CN109491619A (zh) * 2018-11-21 2019-03-19 浙江中智达科技有限公司 缓存数据处理方法、装置和系统
CN109544161B (zh) * 2018-11-28 2021-05-28 连连银加信息技术有限公司 区块链数据处理方法、系统及设备和序列号生成方法
CN112422550A (zh) * 2020-11-16 2021-02-26 成都卓元科技有限公司 一种基于视频传输板卡的网络安全传输系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1684445A (zh) * 2004-04-15 2005-10-19 汤姆森许可贸易公司 在接收机设备中处理数据包的序列的方法和接收机设备
WO2007056908A1 (fr) * 2005-11-16 2007-05-24 Huawei Technologies Co., Ltd. Procede de remise en ordre de cellule, procede et dispositif pour le traitement de cellule reposant sur le procede de remise en ordre de cellule
CN101188477A (zh) * 2007-12-25 2008-05-28 华为技术有限公司 一种数据包序列接收的方法及设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1684445A (zh) * 2004-04-15 2005-10-19 汤姆森许可贸易公司 在接收机设备中处理数据包的序列的方法和接收机设备
WO2007056908A1 (fr) * 2005-11-16 2007-05-24 Huawei Technologies Co., Ltd. Procede de remise en ordre de cellule, procede et dispositif pour le traitement de cellule reposant sur le procede de remise en ordre de cellule
CN101188477A (zh) * 2007-12-25 2008-05-28 华为技术有限公司 一种数据包序列接收的方法及设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113438176A (zh) * 2021-05-17 2021-09-24 翱捷科技股份有限公司 一种处理分片ip数据包的方法及装置
CN113365098A (zh) * 2021-06-01 2021-09-07 平安国际智慧城市科技股份有限公司 视频帧组装方法、装置、电子设备及存储介质
CN113365098B (zh) * 2021-06-01 2022-07-22 平安国际智慧城市科技股份有限公司 视频帧组装方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN101188477B (zh) 2010-07-07
CN101188477A (zh) 2008-05-28

Similar Documents

Publication Publication Date Title
WO2009082951A1 (fr) Procédé et dispositif de réception d'une séquence de paquets de données
CN1981492B (zh) 用于多媒体流中速率适配的缓冲器水平信令
EP1457052B1 (en) System and method for streaming multimedia over packet networks
CN111586480B (zh) 低延迟流媒体
KR101449710B1 (ko) 데이터 통신시스템, 데이터 송신장치, 데이터 송신방법 및패킷 사이즈 및 용장도 결정방법
JP3739609B2 (ja) マルチメディアの再生システムにおけるディジタルのビデオおよびオーディオの再生の適応型同期化のための方法および装置
TWI419565B (zh) 緩衝媒體流之封包的方法、緩衝媒體流之系統、用於傳送之裝置與晶片組、伺服器、以及電腦程式產品
JP5847577B2 (ja) より低いレベルのパケット構造から導かれる記号識別子を用いた放送チャネル上の高品質ストリーム保護
US7584404B2 (en) Method and apparatus for multimedia communication over packet channels
US20060291468A1 (en) Selective re-transmission of lost multi-media data packets
US9601097B2 (en) Reliable real-time transmission of musical sound control data over wireless networks
TW201004206A (en) Hypothetical FEC decoder and signalling for decoding control
JP2009512280A (ja) 補完指示ファイルを用いた、rtpエグレスストリーミング装置及び方法
JP6516767B2 (ja) Mmtpデカプセル化バッファのシグナリング及び動作
GB2524349A (en) Adaptive span control
JP2003114845A (ja) メディア変換方法およびメディア変換装置
CN101394252A (zh) 一种基于rtp的数据传输方法
CN113573003B (zh) 一种基于弱网的音视频实时通信方法、装置以及设备
EP2070329B1 (en) Method and system for error robust audio playback time stamp reporting
CN110505494A (zh) 去除网络抖动的方法及装置
US10567852B2 (en) Transmission device, transmission method, reception device, reception method, and program
KR100865955B1 (ko) 멀티미디어 스트리밍의 속도 적응을 위한 버퍼 레벨시그널링
CN114500672A (zh) 数据传输方法及系统
CN116233421A (zh) 基于WebRtc的拉流方法及相关设备
KR100963411B1 (ko) 다중 멀티캐스트 채널로 전송되는 계층적 구조를 갖는 데이터 수신 장치 및 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08866455

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 08866455

Country of ref document: EP

Kind code of ref document: A1