WO2015192452A1 - Header compression method, decompression method and device - Google Patents

Header compression method, decompression method and device Download PDF

Info

Publication number
WO2015192452A1
WO2015192452A1 PCT/CN2014/084315 CN2014084315W WO2015192452A1 WO 2015192452 A1 WO2015192452 A1 WO 2015192452A1 CN 2014084315 W CN2014084315 W CN 2014084315W WO 2015192452 A1 WO2015192452 A1 WO 2015192452A1
Authority
WO
WIPO (PCT)
Prior art keywords
index
list item
compressed
list
compression
Prior art date
Application number
PCT/CN2014/084315
Other languages
French (fr)
Chinese (zh)
Inventor
杨飞飞
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2015192452A1 publication Critical patent/WO2015192452A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a header compression method, a decompression method, and an apparatus.
  • Background Art Due to limitations of physical conditions, a wireless link in a mobile communication system has a lower transmission rate and a higher bit error rate than a wired link.
  • Robust Header Compress (ROHC) technology has been introduced.
  • the core of ROHC is to transparently compress and decompress the information in the packet header between directly connected nodes by using information redundancy between packets of the traffic flow.
  • the ROHC technology is described by the Internet Engineering Task Force (IETF) RFC 3095 document, but the compression and decompression of the IP header is not defined in this document, so in June 2004, the ROHC working group had to be IP alone in RFC 3843.
  • the header compression decompression defines a framework, and in February 2007 the IETF revised the ROHC documentation, which is RFC 4815.
  • the Profile 0 identifies the IP packet flow using the uncompressed method.
  • the Profile 1 identifies the Real-time Transport Protocol (RTP).
  • the User Data Protocol User Data Protocol, UDP for short).
  • IP Internet Protocol
  • Profile 2 identifies the UDP/IP packet flow
  • Profile 3 identifies the ESP/IP (IP Encapsulated Security Payload ESP) packet flow.
  • the Profile 4 identifier compresses the IP packet stream.
  • CSRC Contributing Source
  • the basic principle of list compression is that the compressor allocates a unique index for each list item, maintains a translation table with all list items, and uses the list item index to identify each list item.
  • the list item index and the corresponding list item are simultaneously sent in the compressed list.
  • the compressor determines that the decompressor has obtained the mapping relationship between the index and the list item, the compressor can separately send the list index in the compressed package to represent Corresponding list items achieve the purpose of reducing the amount of data for compression.
  • RTP list compression is more complicated. In a real RTP packet stream compression transmission, there are thousands of list entries to be processed, so it takes a lot of memory space to maintain the correspondence between list items and indexes.
  • the embodiments of the present invention provide a method for compressing a header, a method and a device for decompressing, to solve at least the problem that the compression memory of the header is large, the compression speed is slow, and the compression efficiency is low.
  • the present invention provides a method for compressing a header, including: determining, if a corresponding index is configured for a list item to be compressed, whether there is an available idle index; in the case where there is no idle index, And selecting an index whose frequency is lower than the preset threshold from the index that has been configured for the list item, and replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is replaced by The index is compressed.
  • the method further includes: determining whether a corresponding index needs to be configured for the list item to be compressed before determining whether there is an available idle index.
  • the determining whether to configure the corresponding index for the list item to be compressed includes: determining whether the list item to be compressed has been recorded in a translation table; wherein the translation table is used to record a list item Corresponding relationship with the index; in the case that the list item to be compressed has been recorded in the translation table, it is determined that the corresponding index is not required to be configured for the list item to be compressed; If the list item is not recorded in the translation table, it is determined that the corresponding index needs to be configured for the list item to be compressed.
  • the determining whether there is an available idle index includes: determining whether there is an idle index in the translation table that does not specify a corresponding list item.
  • the selecting, from the index configured for the list item, the index whose usage frequency is lower than the preset threshold includes: determining, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately; If the ratio of the number of individual uses to the total number of uses is lower than the preset threshold, determining that the frequency of use of the index corresponding to the number of individual uses is lower than the preset threshold.
  • the present invention further provides a method for decompressing a header, including: determining whether a received index is configured to be sequentially configured to a different list item; and the same index is sequentially configured to a different list item.
  • the present invention further provides a header compression apparatus, including: a compression determining unit, configured to determine whether there is an available idle index in a case where a corresponding index needs to be configured for a list item to be compressed; a unit, configured to: when the compression determining unit determines that there is no idle index, select an index whose usage frequency is lower than a preset threshold from an index that has been configured with the list item, and replace the list item corresponding to the index with the Compressing the list item to be compressed, so that the list item to be compressed is compressed by using the replaced index.
  • the compression determining unit is further configured to determine whether a corresponding index needs to be configured for the list item to be compressed before determining whether there is an available idle index.
  • the replacing unit is configured to: determine, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately; if the ratio of the single use times to the total usage times is low Determining, by the preset threshold, that the frequency of use of the index corresponding to the number of times of use is lower than a preset threshold, and replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is The compression is performed using the replaced index.
  • the present invention provides a header decompression apparatus, including: a decompression determining unit, configured to determine whether a same index is sequentially configured to a different list item in a received compressed packet; and the decompression unit is configured to be in the When the decompression determining unit determines that the same index is sequentially configured to different list items, the compressed package is decompressed with the correspondence between the last configured list item and the index.
  • the header compression method, the decompression method, and the device provided by the embodiment of the present invention can select a usage frequency lower than a preset from an index that has been configured for a list item, if an index needs to be configured for the list item but no idle index exists.
  • FIG. 1 is a flow chart of a method for compressing a header according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for decompressing a header according to an embodiment of the present invention
  • FIG. 4 is a detailed flowchart of a step in FIG. 3;
  • FIG. 1 is a flow chart of a method for compressing a header according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for decompressing a header according to an embodiment of the present invention
  • FIG. 4 is a detailed flowchart of a step in FIG. 3
  • FIG. 5 is a schematic structural diagram of a header compression device according to an embodiment of the present invention. It is a schematic structural diagram of the meter decompression device provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION The present invention will be described in detail below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
  • an embodiment of the present invention provides a method for compressing a header, including: S11. If a corresponding index needs to be configured for a list item to be compressed, determining whether there is an available idle index;
  • S12 in the case that there is no idle index, select an index whose frequency is lower than a preset threshold from the index that has been configured for the list item, and replace the list item corresponding to the index with the list item to be compressed,
  • the list item to be compressed is compressed by using the replaced index.
  • the header compression method provided by the embodiment of the present invention can select an index whose frequency is lower than a preset threshold from an index that has been configured for a list item, if an index needs to be configured for the list item but no idle index exists.
  • the list item corresponding to the index whose usage frequency is lower than the preset threshold is replaced with the list item to be compressed, so that the list item to be compressed is compressed by using the replaced index.
  • the reuse of the index can significantly reduce the memory space usage of the compression end, shortening the time taken for searching the translation table, thereby effectively improving the compression efficiency.
  • the header of each data packet may also be compressed and sent to the decompression end.
  • the method of the header compression can be used for the compression of the RTP data packet, and can also be used for other types of data packets that support the method of the header compression. The embodiment of the present invention does not limit this.
  • the correspondence between the list item and the index may be established first, and then the simple index is used to represent the more complicated list item data, so as to reduce the compression of the data amount.
  • the mapping relationship between the list item and the index may be established by using various methods, such as maintaining a mapping relationship table, or by using a certain mapping relationship function, etc., which is not limited by the embodiment of the present invention. .
  • the following describes the header compression method provided by the present invention in detail by taking the maintenance mapping table in the RTP packet compression process as an example.
  • a correspondence table between a list item and an index is maintained at the compression end, which is called a translation table.
  • the step S11 may further include determining whether a corresponding index needs to be configured for the list item to be compressed, which may be specifically implemented by the following steps: Determining whether a list item to be compressed in the data packet has been recorded in the translation table, wherein the translation table is configured to record a correspondence between the list item and the index; and the list item to be compressed is already in the If there is a record in the translation table, it is determined that the corresponding index is not configured for the list item to be compressed; if the list item to be compressed has no record in the translation table, it is determined that the The compressed list item is configured with the corresponding index.
  • the translation table has a limited capacity, and the number of packets sent is huge, so it is very possible to translate all the indexes in the table when the index items need to be configured for the list items to be compressed.
  • the corresponding list item has been configured. Therefore, in the case that the corresponding index is to be configured for the list item to be compressed, it is also required to determine whether there is an available idle index. Whether there is an idle index in the translation table that does not specify a corresponding list item. If there is such an idle index, the idle index may be configured to the list item to be compressed. For example, the list item may be written into an item in the translation table corresponding to the idle index.
  • the embodiment of the present invention further provides an index reusing mechanism, which removes the index that is not used for a long time or the index of the recently used frequency that is too low, and the original list item. And configure the index to the new list item to be compressed.
  • an index reusing mechanism which removes the index that is not used for a long time or the index of the recently used frequency that is too low, and the original list item. And configure the index to the new list item to be compressed.
  • selecting an index that uses the frequency lower than the preset threshold from the index that has been configured for the list item may specifically include: determining, in the process of compressing the list, respectively The total number of uses of all indexes and the number of times of use of each index; if the ratio of the number of individual uses to the total number of uses is lower than the preset threshold, determining that the index corresponding to the number of times of use is used less frequently The preset threshold.
  • an embodiment of the present invention further provides a method for decompressing a header. As shown in FIG. 2, the method includes:
  • the compressed package is decompressed by the correspondence between the last configured list item and the index.
  • the method for decompressing the header provided by the embodiment of the present invention can determine whether the same index is configured to be configured to different list items in the received compressed package, and in the case that the same index is sequentially configured to different list items, The compressed package can be decompressed by the correspondence between the last configured list item and the index, so that the use of the index can significantly reduce the use of the memory space on the decompression end, shortening the time taken for searching the translation table, thereby effectively improving the efficiency of the compression. .
  • a mapping table between the list item and the index may also be maintained on the decompression end, which is also called a translation table.
  • a data packet is sent, if the data packet includes only the index and there is no corresponding list item, it indicates that the list item has appeared before, and the corresponding record is already in the translation table, so The correspondence in the table is decompressed. If the data packet includes not only the index but also the list item corresponding to the index, it can be checked whether the index has been recorded in the translation table, and if so, the index and the list item sent this time are reused for the index.
  • the header compression method and the decompression method provided by the present invention will be described in detail below by way of specific embodiments. As shown in FIG. 3, the header compression method and the decompression method provided by the present invention include the following steps:
  • the compression end sets a storage list of the index of the list entry of the moderate size (for example, between 20 and 50); after receiving the data packet, analyzing whether the list item to be compressed in the data packet needs to be compressed by the profilel type, If yes, analyze whether the number of lists in the RTP domain is 0. If not, perform list compression. S302.
  • the list item to be sent is sequentially read. If the list item already exists in the translation table, it is not necessary to create a new mapping item in the translation table to configure an index for the list item, and use the translation table. The corresponding index compresses the list item; otherwise, S303 is performed.
  • the sequence number may be The index is configured to the latest list item to be compressed.
  • the list items in the subsequent data packets are compressed using the correspondence in the translation table in the subsequent compression process.
  • searching for a list entry stored in the compression end to find an index corresponding to the list item that has not been used for a long time (for example, the frequency of use is less than 1/3), and replacing the list item corresponding to the index with the latest list item to be compressed. ;
  • the decompression end decompresses according to the corresponding relationship in the translation table. If the data packet includes not only the index but also the list item corresponding to the index, it is checked whether the index has been recorded in the translation table; if yes, execute S308, if no, execute S309.
  • step S305 searching for a list item that has not been used for a long time can be performed as follows:
  • 5401 defines a global variable, which is used to mark the total number of times of all index indexes in the compression of the list item of the packet stream, and defines a single variable for each list item index, and respectively marks the number of times each index is used alone.
  • the traversal list sequentially acquires the number of times of using the index corresponding to each list item, and if the ratio of the number of used times to the total number of used times is lower than the preset threshold, determining the If the frequency of use of the index corresponding to the number of times of use is lower than the preset threshold, the eligible condition may be reused.
  • an embodiment of the present invention further provides a header compression apparatus, including: a compression determining unit 50, configured to configure a corresponding index for the list item to be compressed, Determining whether there is an available idle index; the replacing unit 52 is configured to, when the compression determining unit determines that there is no idle index, select an index whose usage frequency is lower than a preset threshold from an index that has been configured with the list item And replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is compressed by using the replaced index.
  • a header compression apparatus including: a compression determining unit 50, configured to configure a corresponding index for the list item to be compressed, Determining whether there is an available idle index; the replacing unit 52 is configured to, when the compression determining unit determines that there is no idle index, select an index whose usage frequency is lower than a preset threshold from an index that has been configured with the list item And replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is
  • the compression determining unit 50 can determine whether a corresponding index needs to be configured for the list item to be compressed, and if the index needs to be configured but there is no idle index, the replacement unit 52 can Selecting an index whose frequency is lower than the preset threshold from the index that has been configured with the list item, and replacing the list item corresponding to the index whose usage frequency is lower than the preset threshold with the list item to be compressed, so that the The list item to be compressed is compressed using the replaced index.
  • the reuse of the index can significantly reduce the memory space usage of the compression end, shortening the time taken for searching the translation table, thereby effectively improving the compression efficiency.
  • the compression determining unit 50 is further configured to determine whether it is necessary to configure a corresponding index for the list item to be compressed before determining whether there is an available idle index.
  • the compression determining unit 50 including a list item determining module, is configured to: determine whether the list item to be compressed has been recorded in a translation table; wherein the translation table is used to record a list item and an index Corresponding relationship; in the case that the list item to be compressed has been recorded in the translation table, it is determined that the corresponding index is not required to be configured for the list item to be compressed; In the case that there is no record in the translation table, it is determined that the corresponding index needs to be configured for the list item to be compressed.
  • the compression determining unit 50 further includes an index determining module, configured to determine, if the corresponding index is configured for the list item to be compressed, whether there is an idle index of the unspecified corresponding list item in the translation table.
  • the replacing unit 52 is configured to: determine, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately; if the ratio of the number of individual uses to the total number of uses is lower than a preset threshold, determining that the frequency of use of the index corresponding to the number of times of use is lower than a preset threshold, and replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is utilized The replaced index is compressed.
  • the embodiment of the present invention further provides a header decompression apparatus, including: a decompression determining unit 60, configured to determine whether the same index exists in the received compressed packet and is configured to different list items in sequence. ;
  • the decompression unit 62 is configured to decompress the compressed package with the correspondence between the last configured list item and the index, in a case where the decompression determining unit determines that the same index is sequentially configured to different list items.
  • the decompression determining unit 60 can determine whether the same index in the received compressed packet is configured to be different to the list item, and the same index is sequentially configured to different list items.
  • the decompressing unit 62 can decompress the compressed package by using the mapping relationship between the last configured list item and the index, so that the use of the index can significantly reduce the memory space usage of the decompressing end, thereby shortening the time taken for searching the translation table. Effectively improve the efficiency of understanding pressure.
  • a correspondence table between list items and indexes can also be maintained, which is also called a translation table.
  • the data packet includes not only the index but also the list item corresponding to the index, it can be checked whether the index has been recorded in the translation table, and if so, the index and the list item sent this time are reused for the index.
  • the corresponding relationship between the newly transmitted index and the list item should be replaced with the corresponding relationship already recorded in the translation table, and the subsequent data packet is decompressed with the new corresponding relationship until a new index and list item are added. Send it together and update the new index correspondence.
  • a header compression method, a decompression method, and an apparatus provided by an embodiment of the present invention have the following beneficial effects:
  • the reuse of an index can significantly reduce the memory space usage of the compression end, and shorten the cost of searching for a translation table.

Abstract

The present invention relates to the technical field of communications. Disclosed are a header compression method, decompression method and device, for solving the problems in the prior art of high memory consumption by header compression, low compression speed and low compression efficiency; the header compression method comprising: configuring a corresponding index for a list item to be compressed by determining whether optional idle indexes exist; and if not, then selecting, from the indexes configured for the list items, an index with frequency of use lower than a preset threshold, and replacing the list item corresponding to the index with the list item to be compressed, such that the list item to be compressed is compressed by employing the replaced index.

Description

一种表头压缩方法、 解压方法及装置 技术领域 本发明涉及通信技术领域, 特别是涉及一种表头压缩方法、 解压方法及装置。 背景技术 由于物理条件的限制, 移动通信系统中的无线链路与有线链路相比传输 速率较 低, 误码率较高。 为了能有效利用有限的无线信道带宽资源, 引入了鲁棒性头压缩技 术(Robust Header Compress, 简称为 ROHC ) 。 ROHC的核心是利用业务流的分组之 间的信息冗余来透明地压缩和解压直接相连节点间的分组头中的信息。 ROHC技术由 互联网工程任务组(IETF )的 RFC 3095 文档进行描述, 但在该文档中并没有定义 IP 头的压缩和解压, 因此在 2004 年 6月, ROHC工作组不得不在 RFC 3843中单独 为 IP头的压缩解压定义了一个框架, 并且在 2007年 2月份 IETF对 ROHC的相关 文档进行了修订, 修订文档是 RFC 4815。  TECHNICAL FIELD The present invention relates to the field of communications technologies, and in particular, to a header compression method, a decompression method, and an apparatus. Background Art Due to limitations of physical conditions, a wireless link in a mobile communication system has a lower transmission rate and a higher bit error rate than a wired link. In order to effectively utilize limited wireless channel bandwidth resources, Robust Header Compress (ROHC) technology has been introduced. The core of ROHC is to transparently compress and decompress the information in the packet header between directly connected nodes by using information redundancy between packets of the traffic flow. The ROHC technology is described by the Internet Engineering Task Force (IETF) RFC 3095 document, but the compression and decompression of the IP header is not defined in this document, so in June 2004, the ROHC working group had to be IP alone in RFC 3843. The header compression decompression defines a framework, and in February 2007 the IETF revised the ROHC documentation, which is RFC 4815.
ROHC头压缩中, 使用不同 Profile来标识不同的数据包流, 以便对其使 用相应 的数据压缩解压框架。 如: 其中 Profile 0标识使用未压缩的方法对 IP数据包流进 行传输, Profile 1 标识对实时传输协议 (Real-time Transport Protocol , 简称为 RTP) I 用户数据报协议 (User Data Protocol , 简称为 UDP ) /互联网协议 (IP ) 数据包流进行 压缩处理, Profile 2标识对 UDP/IP数据包流进行压缩处理 , Profile 3标识对 ESP/IP ( IP封装安全有效载荷 ESP )数据包流进行压缩处理, Profile 4标识对 IP数据包流 进行压缩处理。 其中, 在 Profilel对 RTP头部进行压缩的时候, 也需要对 RTP头部包 含的作用源 (Contributing Source,简称为 CSRC ) 列表进行压缩。 列表压缩基本原理是由压缩器为每个列表项分配唯一的索引, 同时维护一个具有 所有列表项的翻译表, 并使用列表项索引对各个列表项进行标识。 列表项索引与对应 的列表项在压缩列表中同时被发送, 当压缩器确定解压器已经获取到了索引和列表项 之间的映射关系时,压缩器即可以在压缩包中单独发送列表索引来代表对应的列表项, 达到减小数据量实现压缩的目的。 然而, RTP列表压缩比较复杂, 在一个真实的 RTP包流压缩发送中, 需要处理的 列表表项有成千上万, 因此需要耗费大量的内存空间来维护列表项和索引间的对应关 系, 并花费较长时间才能查找到对应的索引, 因此压缩速度缓慢, 压缩效率较低。 发明内容 本发明实施例提供了一种表头压缩方法、 解压方法及装置, 以至少解决现有技术 中表头压缩内存占用大, 压缩速度缓慢, 压缩效率低下的问题。 一方面, 本发明提供一种表头压缩方法, 包括: 在需要为待压缩的列表项配置对 应的索引的情况下,确定是否存在可供选择的闲置索引;在不存在闲置索引的情况下, 从已经为列表项配置的索引中选择使用频率低于预设阈值的索引, 并将该索引对应的 列表项替换为所述待压缩的列表项, 以使所述待压缩的列表项利用替换后的所述索引 进行压缩。 可选的, 所述方法还包括: 在确定是否存在可供选择的闲置索引之前, 确定是否 需要为待压缩的列表项配置对应的索引。 可选的, 所述确定是否需要为待压缩的列表项配置对应的索引包括: 确定所述待 压缩的列表项是否已在翻译表中有所记录; 其中, 所述翻译表用于记录列表项与索引 的对应关系; 在所述待压缩的列表项已在所述翻译表中有所记录的情况下, 确定不需 要为所述待压缩的列表项配置对应的索引; 在所述待压缩的列表项在翻译表中没有记 录的情况下, 确定需要为所述待压缩的列表项配置对应的索引。 可选的, 所述确定是否存在可供选择的闲置索引包括: 确定所述翻译表中是否存 在未指定对应列表项的闲置索引。 可选的, 所述从已经为列表项配置的索引中选择使用频率低于预设阈值的索引包 括: 在压缩列表的过程中, 分别确定所有索引的总共使用次数以及各个索引的单独使 用次数; 如果所述单独使用次数与所述总共使用次数之比低于所述预设阈值, 确定所 述单独使用次数对应的索引的使用频率低于所述预设阈值。 另一方面, 本发明还提供一种表头解压方法, 包括: 确定接收的压缩包中是否存 在同一索引被先后配置给不同的列表项的情况; 在存在同一索引被先后配置给不同的 列表项的情况下, 以最后配置的列表项和索引的对应关系解压所述压缩包。 另一方面, 本发明还提供一种表头压缩装置, 包括: 压缩确定单元, 设置为在需 要为待压缩的列表项配置对应的索引的情况下, 确定是否存在可供选择的闲置索引; 替换单元, 设置为在所述压缩确定单元确定不存在闲置索引的情况下, 从已经配置了 列表项的索引中选择使用频率低于预设阈值的索引, 并将该索引对应的列表项替换为 所述待压缩的列表项, 以使所述待压缩的列表项利用替换后的所述索引进行压缩。 可选的,所述压缩确定单元,还设置为在确定是否存在可供选择的闲置索引之前, 确定是否需要为待压缩的列表项配置对应的索引。 可选的, 所述替换单元, 设置为: 在压缩列表的过程中, 分别确定所有索引的总 共使用次数以及各个索引的单独使用次数; 如果所述单独使用次数与所述总共使用次 数之比低于预设阈值, 确定所述单独使用次数对应的索引的使用频率低于预设阈值, 并将该索引对应的列表项替换为所述待压缩的列表项, 以使所述待压缩的列表项利用 替换后的所述索引进行压缩。 另一方面, 本发明还提供一种表头解压装置, 包括: 解压确定单元, 设置为确定 接收的压缩包中是否存在同一索引被先后配置给不同的列表项; 解压单元, 设置为在 所述解压确定单元确定存在同一索引被先后配置给不同的列表项的情况下, 以最后配 置的列表项和索引的对应关系解压所述压缩包。 本发明实施例提供的表头压缩方法、 解压方法及装置, 在需要为列表项配置索引 但却不存在闲置索引的情况下, 能够从已经为列表项配置的索引中选择使用频率低于 预设阈值的索引, 并将该使用频率低于预设阈值的索引所对应的列表项替换为所述待 压缩的列表项, 以使所述待压缩的列表项利用替换后的索引进行压缩。 这样, 通过索 引的重复利用即能明显减轻压缩端的内存空间使用, 缩短搜索翻译表所耗费的时间, 从而有效提高了压缩效率。 附图说明 图 1是本发明实施例提供的表头压缩方法的一种流程图; 图 2是本发明实施例提供的表头解压方法的一种流程图; 图 3是本发明实施例提供的表头压缩方法和解压方法的一种详细流程图; 图 4是图 3中的一个步骤的一个具体流程图; 图 5是本发明实施例提供的表头压缩装置的一种结构示意图; 图 6是本发明实施例提供的表头解压装置的一种结构示意图。 具体实施方式 以下结合附图对本发明进行详细说明。 应当理解, 此处所描述的具体实施例仅仅 用以解释本发明, 并不限定本发明。 如图 1所示, 本发明的实施例提供一种表头压缩方法, 包括: S11 ,在需要为待压缩的列表项配置对应的索引的情况下,确定是否存在可供选择 的闲置索引; In ROHC header compression, different profiles are used to identify different packet flows in order to use the corresponding data compression decompression framework. For example, the Profile 0 identifies the IP packet flow using the uncompressed method. The Profile 1 identifies the Real-time Transport Protocol (RTP). The User Data Protocol (User Data Protocol, UDP for short). / Internet Protocol (IP) packet flow is compressed, Profile 2 identifies the UDP/IP packet flow, and Profile 3 identifies the ESP/IP (IP Encapsulated Security Payload ESP) packet flow. The Profile 4 identifier compresses the IP packet stream. When Profilel compresses the RTP header, it also needs to compress the list of the Contributing Source (CSRC) contained in the RTP header. The basic principle of list compression is that the compressor allocates a unique index for each list item, maintains a translation table with all list items, and uses the list item index to identify each list item. The list item index and the corresponding list item are simultaneously sent in the compressed list. When the compressor determines that the decompressor has obtained the mapping relationship between the index and the list item, the compressor can separately send the list index in the compressed package to represent Corresponding list items achieve the purpose of reducing the amount of data for compression. However, RTP list compression is more complicated. In a real RTP packet stream compression transmission, there are thousands of list entries to be processed, so it takes a lot of memory space to maintain the correspondence between list items and indexes. It takes a long time to find the corresponding index, so the compression speed is slow and the compression efficiency is low. SUMMARY OF THE INVENTION The embodiments of the present invention provide a method for compressing a header, a method and a device for decompressing, to solve at least the problem that the compression memory of the header is large, the compression speed is slow, and the compression efficiency is low. In one aspect, the present invention provides a method for compressing a header, including: determining, if a corresponding index is configured for a list item to be compressed, whether there is an available idle index; in the case where there is no idle index, And selecting an index whose frequency is lower than the preset threshold from the index that has been configured for the list item, and replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is replaced by The index is compressed. Optionally, the method further includes: determining whether a corresponding index needs to be configured for the list item to be compressed before determining whether there is an available idle index. Optionally, the determining whether to configure the corresponding index for the list item to be compressed includes: determining whether the list item to be compressed has been recorded in a translation table; wherein the translation table is used to record a list item Corresponding relationship with the index; in the case that the list item to be compressed has been recorded in the translation table, it is determined that the corresponding index is not required to be configured for the list item to be compressed; If the list item is not recorded in the translation table, it is determined that the corresponding index needs to be configured for the list item to be compressed. Optionally, the determining whether there is an available idle index includes: determining whether there is an idle index in the translation table that does not specify a corresponding list item. Optionally, the selecting, from the index configured for the list item, the index whose usage frequency is lower than the preset threshold includes: determining, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately; If the ratio of the number of individual uses to the total number of uses is lower than the preset threshold, determining that the frequency of use of the index corresponding to the number of individual uses is lower than the preset threshold. In another aspect, the present invention further provides a method for decompressing a header, including: determining whether a received index is configured to be sequentially configured to a different list item; and the same index is sequentially configured to a different list item. In the case, the compressed package is decompressed with the correspondence between the last configured list item and the index. In another aspect, the present invention further provides a header compression apparatus, including: a compression determining unit, configured to determine whether there is an available idle index in a case where a corresponding index needs to be configured for a list item to be compressed; a unit, configured to: when the compression determining unit determines that there is no idle index, select an index whose usage frequency is lower than a preset threshold from an index that has been configured with the list item, and replace the list item corresponding to the index with the Compressing the list item to be compressed, so that the list item to be compressed is compressed by using the replaced index. Optionally, the compression determining unit is further configured to determine whether a corresponding index needs to be configured for the list item to be compressed before determining whether there is an available idle index. Optionally, the replacing unit is configured to: determine, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately; if the ratio of the single use times to the total usage times is low Determining, by the preset threshold, that the frequency of use of the index corresponding to the number of times of use is lower than a preset threshold, and replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is The compression is performed using the replaced index. In another aspect, the present invention provides a header decompression apparatus, including: a decompression determining unit, configured to determine whether a same index is sequentially configured to a different list item in a received compressed packet; and the decompression unit is configured to be in the When the decompression determining unit determines that the same index is sequentially configured to different list items, the compressed package is decompressed with the correspondence between the last configured list item and the index. The header compression method, the decompression method, and the device provided by the embodiment of the present invention can select a usage frequency lower than a preset from an index that has been configured for a list item, if an index needs to be configured for the list item but no idle index exists. The index of the threshold is replaced with the list item corresponding to the index whose usage frequency is lower than the preset threshold, so that the list item to be compressed is compressed by using the replaced index. In this way, the reuse of the index can significantly reduce the memory space usage of the compression end, shortening the time taken for searching the translation table, thereby effectively improving the compression efficiency. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flow chart of a method for compressing a header according to an embodiment of the present invention; FIG. 2 is a flowchart of a method for decompressing a header according to an embodiment of the present invention; FIG. 4 is a detailed flowchart of a step in FIG. 3; FIG. 5 is a schematic structural diagram of a header compression device according to an embodiment of the present invention; It is a schematic structural diagram of the meter decompression device provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION The present invention will be described in detail below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. As shown in FIG. 1 , an embodiment of the present invention provides a method for compressing a header, including: S11. If a corresponding index needs to be configured for a list item to be compressed, determining whether there is an available idle index;
S12,在不存在闲置索引的情况下,从已经为列表项配置的索引中选择使用频率低 于预设阈值的索引, 并将该索引对应的列表项替换为所述待压缩的列表项, 以使所述 待压缩的列表项利用替换后的所述索引进行压缩。 本发明实施例提供的表头压缩方法, 在需要为列表项配置索引但却不存在闲置索 引的情况下, 能够从已经为列表项配置的索引中选择使用频率低于预设阈值的索引, 并将该使用频率低于预设阈值的索引所对应的列表项替换为所述待压缩的列表项, 以 使所述待压缩的列表项利用替换后的索引进行压缩。 这样, 通过索引的重复利用即能 明显减轻压缩端的内存空间使用, 缩短搜索翻译表所耗费的时间, 从而有效提高了压 缩效率。 需要说明的是, 当数据流以数据包的形式从压缩端向解压端传送时, 各个数据包 的表头也可以被压缩后向解压端发送。这种表头压缩的方法可以用于 RTP数据包的压 缩, 当然也可以用于支持这种表头压缩方法的其他种类的数据包中, 本发明的实施例 对此不做限制。 具体的, 在数据包的表头压缩中, 可以先建立列表项和索引的对应关系, 然后利 用简单的索引代表较复杂的列表项数据, 从而实现减小数据量的压缩。 可选的, 本发 明的实施例中, 可以通过各种方法建立列表项与索引的对应关系, 如维护一个映射关 系表, 或者通过一定的映射关系函数等, 本发明的实施例对此不作限制。 下面以 RTP数据包压缩过程中维护映射关系表为例,对本发明提供的表头压缩方 法进行详细的说明。 在本发明的一个实施例中, 在压缩端维护着一个列表项与索引的 对应关系表, 称为翻译表。 在该翻译表中, 存储着所有索引, 既包括已经被配置了列 表项的索引, 也包括尚未被配置列表项的闲置索引。 每当开始要压缩一个新的数据包 时, 步骤 S11之前还可包括确定是否需要为待压缩的列表项配置对应的索引,可选的, 具体可通过以下步骤实现: 确定该数据包中待压缩的列表项是否已经在该翻译表中有所记录, 其中, 所述翻 译表用于记录列表项与索引的对应关系; 在所述待压缩的列表项已在所述翻译表中有所记录的情况下, 确定不需要为所述 待压缩的列表项配置对应的索引; 在所述待压缩的列表项在翻译表中没有记录的情况下, 确定需要为所述待压缩的 列表项配置对应的索引。 然而, 由于所有的索引都存储在翻译表中, 翻译表容量有限, 而发送的数据包数 量巨大, 因此很有可能在需要为待压缩的列表项配置索引项时, 翻译表中所有的索引 都已经被配置了相应的列表项, 因此, 在需要为待压缩的列表项配置对应的索引的情 况下, 还需要确定是否存在可供选择的闲置索引, 本实施例中具体可以为: 确定所述 翻译表中是否存在未指定对应列表项的闲置索引。 如果存在这样的闲置索引, 则可以 将该闲置索引配置给该待压缩的列表项, 例如, 可以将该列表项写入翻译表中与该闲 置索引对应的项目中。 如果不存在这样的闲置索引, 则本发明的实施例还提供了一种 索引的重用机制, 将很长时间不用的索引或者最近使用频率过低的索引与原有的列表 项的对应关系解除, 并将该索引配置给新的待压缩的列表项。 这样, 虽然发送的数据 包数量巨大, 例如成千上万个, 但翻译表中的索引却不需要很大, 例如 200个, 通过 索引的重复利用即能明显减轻压缩端的内存空间使用,缩短搜索翻译表所耗费的时间, 从而大大加快了发送速度, 有效提高了压缩效率。 可选的, 在步骤 S12中, 在不存在闲置索引的情况下, 从已经为列表项配置的索 引中选择使用频率低于预设阈值的索引可具体包括: 在压缩列表的过程中, 分别确定所有索引的总共使用次数以及各个索引的单独使 用次数; 如果所述单独使用次数与所述总共使用次数之比低于所述预设阈值, 确定所述单 独使用次数对应的索引的使用频率低于所述预设阈值。 相应的, 本发明的实施例还提供一种表头解压方法, 如图 2所示, 该方法包括: S12, in the case that there is no idle index, select an index whose frequency is lower than a preset threshold from the index that has been configured for the list item, and replace the list item corresponding to the index with the list item to be compressed, The list item to be compressed is compressed by using the replaced index. The header compression method provided by the embodiment of the present invention can select an index whose frequency is lower than a preset threshold from an index that has been configured for a list item, if an index needs to be configured for the list item but no idle index exists. The list item corresponding to the index whose usage frequency is lower than the preset threshold is replaced with the list item to be compressed, so that the list item to be compressed is compressed by using the replaced index. In this way, the reuse of the index can significantly reduce the memory space usage of the compression end, shortening the time taken for searching the translation table, thereby effectively improving the compression efficiency. It should be noted that when the data stream is transmitted from the compression end to the decompression end in the form of data packets, the header of each data packet may also be compressed and sent to the decompression end. The method of the header compression can be used for the compression of the RTP data packet, and can also be used for other types of data packets that support the method of the header compression. The embodiment of the present invention does not limit this. Specifically, in the header compression of the data packet, the correspondence between the list item and the index may be established first, and then the simple index is used to represent the more complicated list item data, so as to reduce the compression of the data amount. Optionally, in the embodiment of the present invention, the mapping relationship between the list item and the index may be established by using various methods, such as maintaining a mapping relationship table, or by using a certain mapping relationship function, etc., which is not limited by the embodiment of the present invention. . The following describes the header compression method provided by the present invention in detail by taking the maintenance mapping table in the RTP packet compression process as an example. In an embodiment of the present invention, a correspondence table between a list item and an index is maintained at the compression end, which is called a translation table. In the translation table, all indexes are stored, including both the index of the list item that has been configured, and the idle index of the list item that has not yet been configured. Whenever a new data packet is to be compressed, the step S11 may further include determining whether a corresponding index needs to be configured for the list item to be compressed, which may be specifically implemented by the following steps: Determining whether a list item to be compressed in the data packet has been recorded in the translation table, wherein the translation table is configured to record a correspondence between the list item and the index; and the list item to be compressed is already in the If there is a record in the translation table, it is determined that the corresponding index is not configured for the list item to be compressed; if the list item to be compressed has no record in the translation table, it is determined that the The compressed list item is configured with the corresponding index. However, since all indexes are stored in the translation table, the translation table has a limited capacity, and the number of packets sent is huge, so it is very possible to translate all the indexes in the table when the index items need to be configured for the list items to be compressed. The corresponding list item has been configured. Therefore, in the case that the corresponding index is to be configured for the list item to be compressed, it is also required to determine whether there is an available idle index. Whether there is an idle index in the translation table that does not specify a corresponding list item. If there is such an idle index, the idle index may be configured to the list item to be compressed. For example, the list item may be written into an item in the translation table corresponding to the idle index. If there is no such idle index, the embodiment of the present invention further provides an index reusing mechanism, which removes the index that is not used for a long time or the index of the recently used frequency that is too low, and the original list item. And configure the index to the new list item to be compressed. Thus, although the number of packets sent is huge, for example, tens of thousands, but the index in the translation table does not need to be large, for example, 200, through the reuse of the index can significantly reduce the memory space of the compressed end, shorten the search The time spent in translating the table greatly speeds up the transmission and effectively improves the compression efficiency. Optionally, in the step S12, in the case that the idle index is not present, selecting an index that uses the frequency lower than the preset threshold from the index that has been configured for the list item may specifically include: determining, in the process of compressing the list, respectively The total number of uses of all indexes and the number of times of use of each index; if the ratio of the number of individual uses to the total number of uses is lower than the preset threshold, determining that the index corresponding to the number of times of use is used less frequently The preset threshold. Correspondingly, an embodiment of the present invention further provides a method for decompressing a header. As shown in FIG. 2, the method includes:
521 , 确定接收的压缩包中是否存在同一索引被先后配置给不同的列表项的情况; 521. Determine whether, in the received compressed packet, the same index is sequentially configured to different list items;
522,在存在同一索引被先后配置给不同的列表项的情况下, 以最后配置的列表项 和索引的对应关系解压所述压缩包。 本发明实施例提供的表头解压方法, 能够确定接收的压缩包中是否存在同一索引 被先后配置给不同的列表项的情况, 并且在存在同一索引被先后配置给不同的列表项 的情况下, 能够以最后配置的列表项和索引的对应关系解压所述压缩包, 这样, 通过 索引的重复利用即能明显减轻解压端的内存空间使用,缩短搜索翻译表所耗费的时间, 从而有效提高了解压效率。 可选的, 在解压端也可以维护着一个列表项与索引的对应关系表, 也称翻译表。 当有数据包发送过来后, 如果该数据包中只包括索引而没有对应的列表项, 则说明该 列表项之前已经出现过, 并且在翻译表中也已经有了相应的记录, 因此可以根据翻译 表中的对应关系进行解压缩。 如果数据包中不但包括索引还包括与该索引对应的列表 项, 那么可以查看翻译表中是否已经记录过该索引, 如果是, 则说明此次发送的索引 和列表项为对该索引的重用, 相应的, 应该用新发送来的索引与列表项的对应关系去 替换翻译表中已经记录的对应关系, 并且用新的对应关系去解压缩后面的数据包, 直 到又有新的索引和列表项一起发送过来为止, 再更新新的索引对应关系。 下面通过具体实施例来对本发明提供的表头压缩方法和解压方法进行详细说明。 如图 3所示, 本发明提供的表头压缩方法和解压方法包括如下步骤: 522. In a case where the same index is sequentially configured to different list items, the compressed package is decompressed by the correspondence between the last configured list item and the index. The method for decompressing the header provided by the embodiment of the present invention can determine whether the same index is configured to be configured to different list items in the received compressed package, and in the case that the same index is sequentially configured to different list items, The compressed package can be decompressed by the correspondence between the last configured list item and the index, so that the use of the index can significantly reduce the use of the memory space on the decompression end, shortening the time taken for searching the translation table, thereby effectively improving the efficiency of the compression. . Optionally, a mapping table between the list item and the index may also be maintained on the decompression end, which is also called a translation table. When a data packet is sent, if the data packet includes only the index and there is no corresponding list item, it indicates that the list item has appeared before, and the corresponding record is already in the translation table, so The correspondence in the table is decompressed. If the data packet includes not only the index but also the list item corresponding to the index, it can be checked whether the index has been recorded in the translation table, and if so, the index and the list item sent this time are reused for the index. Correspondingly, the corresponding relationship between the newly transmitted index and the list item should be replaced with the corresponding relationship already recorded in the translation table, and the subsequent data packet is decompressed with the new corresponding relationship until a new index and list item are added. Send it together and update the new index correspondence. The header compression method and the decompression method provided by the present invention will be described in detail below by way of specific embodiments. As shown in FIG. 3, the header compression method and the decompression method provided by the present invention include the following steps:
S301 , 压缩端设定一个大小适中 (如 20-50之间) 的列表表项索引的存放列表; 收到数据包后, 分析该数据包中待压缩的列表项是否需要进行 profilel 类型的压 缩, 如果是的话, 分析 RTP域的列表个数是否为 0, 如果不为 0的话, 则进行列表压 缩。 S302, 列表项压缩时, 依次读取需要发送的列表项, 如果该列表项在翻译表中已 经存在, 则不需要在翻译表中新建一个映射项来为该列表项配置索引, 使用翻译表中 对应的索引压缩所述列表项; 否则执行 S303。 S301, the compression end sets a storage list of the index of the list entry of the moderate size (for example, between 20 and 50); after receiving the data packet, analyzing whether the list item to be compressed in the data packet needs to be compressed by the profilel type, If yes, analyze whether the number of lists in the RTP domain is 0. If not, perform list compression. S302. When the list item is compressed, the list item to be sent is sequentially read. If the list item already exists in the translation table, it is not necessary to create a new mapping item in the translation table to configure an index for the list item, and use the translation table. The corresponding index compresses the list item; otherwise, S303 is performed.
5303 , 在需要为所述待压缩的列表项配置对应的索引的情况下, 确定压缩侧的翻 译表中是否存在可供选择的闲置索引; 如果存在的话, 执行 S304, 如果不存在的话, 执行 S305 ;  S303, if it is required to configure a corresponding index for the list item to be compressed, determine whether there is an available idle index in the translation table on the compression side; if yes, execute S304, if not, execute S305. ;
5304, 将其中一个闲置索引配置给该待压缩列表项; 例如, 一个翻译表中共有 50个索引, 其中序号为 0-27的索引已经被配置了对应 的列表项, 那么此时可以将序号为索引配置给最新的待压缩列表项。 并且, 在随后的 压缩过程中使用翻译表中的对应关系对后面的数据包中的列表项进行压缩。 5305 , 寻找压缩端存放的列表表项中寻找一个很久没有使用的 (如使用频率低于 1/3 ) 列表项对应的索引, 将该索引对应的列表项的替换为最新的待压缩的列表项; 5304, configuring one of the idle indexes to the list item to be compressed; for example, a translation table has a total of 50 indexes, wherein the index with the sequence number 0-27 has been configured with the corresponding list item, then the sequence number may be The index is configured to the latest list item to be compressed. And, the list items in the subsequent data packets are compressed using the correspondence in the translation table in the subsequent compression process. 5305, searching for a list entry stored in the compression end to find an index corresponding to the list item that has not been used for a long time (for example, the frequency of use is less than 1/3), and replacing the list item corresponding to the index with the latest list item to be compressed. ;
5306, 将压缩好的列表项发送到解压端; 5306, sending the compressed list item to the decompression end;
5307, 如果数据包中只包括索引而没有对应的列表项, 解压端根据翻译表中的对 应关系进行解压缩。 如果数据包中不但包括索引还包括与该索引对应的列表项, 查看 翻译表中是否已经记录过该索引; 如果是, 执行 S308, 如果否, 执行 S309。 5307. If the data packet includes only the index and there is no corresponding list item, the decompression end decompresses according to the corresponding relationship in the translation table. If the data packet includes not only the index but also the list item corresponding to the index, it is checked whether the index has been recorded in the translation table; if yes, execute S308, if no, execute S309.
5308, 用新发送来的索引与列表项的对应关系去替换翻译表中已经记录的对应关 系, 并且用新的对应关系去解压缩后面的数据包, 直到又有新的索引和列表项一起发 送过来为止, 再更新新的索引对应关系。 S309, 在解压端的翻译表中建立列表项与索引的对应关系。 具体的, 如图 4所示, 步骤 S305中, 寻找很久没有使用的列表项的可按照如下步 骤进行:  5308. Replace the corresponding relationship recorded in the translation table with the newly sent index and the corresponding relationship of the list item, and decompress the subsequent data packet with the new correspondence, until a new index is sent together with the list item. When you come over, update the new index correspondence. S309. Establish a correspondence between the list item and the index in the translation table of the decompression end. Specifically, as shown in FIG. 4, in step S305, searching for a list item that has not been used for a long time can be performed as follows:
5401 , 定义一个全局变量, 用来标记数据包流的列表项压缩过程中所有索引的总 共使用次数, 为每个列表项的索引定义一个单独变量, 分别标记各个索引的单独使用 次数。 5401, defines a global variable, which is used to mark the total number of times of all index indexes in the compression of the list item of the packet stream, and defines a single variable for each list item index, and respectively marks the number of times each index is used alone.
5402, 每次压缩使用翻译表中的索引, 将该全局变量递增 1。 每次使用一个索引, 就将该索引对应的的单独使用次数加 1 ; 5402, using the index in the translation table for each compression, incrementing the global variable by one. Each time an index is used, the number of individual uses corresponding to the index is increased by one;
5403 , 当需要寻找很久没有使用的列表项时, 遍历列表依次获取各列表项对应的 索引的单独使用次数,如果其中单独使用次数与总共使用次数之比低于所述预设阈值, 确定所述单独使用次数对应的索引的使用频率低于所述预设阈值, 则该符合条件可以 重用。 相应的, 如图 5所示, 本发明的实施例还提供一种表头压缩装置, 包括: 压缩确定单元 50, 设置为在需要为所述待压缩的列表项配置对应的索引的情况 下, 确定是否存在可供选择的闲置索引; 替换单元 52, 设置为在所述压缩确定单元确定不存在闲置索引的情况下, 从已经 配置了列表项的索引中选择使用频率低于预设阈值的索引, 并将该索引对应的列表项 替换为所述待压缩的列表项, 以使所述待压缩的列表项利用替换后的所述索引进行压 缩。 本发明实施例提供的表头压缩装置,压缩确定单元 50能够确定是否需要给待压缩 的列表项配置对应的索引, 在需要为其配置索引但却不存在闲置索引的情况下, 替换 单元 52能够从已经配置了列表项的索引中选择使用频率低于预设阈值的索引,并将该 使用频率低于预设阈值的索引所对应的列表项替换为所述待压缩的列表项, 以使所述 待压缩的列表项利用替换后的索引进行压缩。 这样, 通过索引的重复利用即能明显减 轻压缩端的内存空间使用,缩短搜索翻译表所耗费的时间,从而有效提高了压缩效率。 进一步的,压缩确定单元 50,还设置为在确定是否存在可供选择的闲置索引之前, 确定是否需要为待压缩的列表项配置对应的索引。 可选的, 压缩确定单元 50, 包括列 表项确定模块, 设置为: 确定所述待压缩的列表项是否已在翻译表中有所记录; 其中, 所述翻译表用于记 录列表项与索引的对应关系; 在所述待压缩的列表项已在所述翻译表中有所记录的情况下, 确定不需要为所述 待压缩的列表项配置对应的索引; 在所述待压缩的列表项在翻译表中没有记录的情况下, 确定需要为所述待压缩的 列表项配置对应的索引。 可选的,压缩确定单元 50还包括索引确定模块,设置为在需要为所述待压缩的列 表项配置对应的索引的情况下, 确定所述翻译表中是否存在未指定对应列表项的闲置 索引。 可选的, 替换单元 52, 设置为: 在压缩列表的过程中, 分别确定所有索引的总共使用次数以及各个索引的单独使 用次数; 如果所述单独使用次数与所述总共使用次数之比低于预设阈值, 确定所述单独使 用次数对应的索引的使用频率低于预设阈值, 并将该索引对应的列表项替换为所述待 压缩的列表项, 以使所述待压缩的列表项利用替换后的所述索引进行压缩。 相应的, 如图 6所示, 本发明的实施例还提供一种表头解压装置, 包括: 解压确定单元 60, 设置为确定接收的压缩包中是否存在同一索引被先后配置给不 同的列表项; 解压单元 62, 设置为在所述解压确定单元确定存在同一索引被先后配置给不同的 列表项的情况下, 以最后配置的列表项和索引的对应关系解压所述压缩包。 本发明实施例提供的表头解压装置,解压确定单元 60能够确定接收的压缩包中是 否存在同一索引被先后配置给不同的列表项, 并且在存在同一索引被先后配置给不同 的列表项的情况下,解压单元 62能够以最后配置的列表项和索引的对应关系解压所述 压缩包, 这样, 通过索引的重复利用即能明显减轻解压端的内存空间使用, 缩短搜索 翻译表所耗费的时间, 从而有效提高了解压效率。 需要说明的是, 在解压端也可以维护着一个列表项与索引的对应关系表, 也称翻 译表。 当有数据包发送过来后, 如果该数据包中只包括索引而没有对应的列表项, 则 说明该列表项之前已经出现过, 并且在翻译表中也已经有了相应的记录, 因此可以根 据翻译表中的对应关系进行解压缩。 如果数据包中不但包括索引还包括与该索引对应 的列表项, 那么可以查看翻译表中是否已经记录过该索引, 如果是, 则说明此次发送 的索引和列表项为对该索引的重用, 相应的, 应该用新发送来的索引与列表项的对应 关系去替换翻译表中已经记录的对应关系, 并且用新的对应关系去解压缩后面的数据 包, 直到又有新的索引和列表项一起发送过来为止, 再更新新的索引对应关系。 尽管为示例目的, 已经公开了本发明的优选实施例, 本领域的技术人员将意识到 各种改进、 增加和取代也是可能的, 因此, 本发明的范围应当不限于上述实施例。 工业实用性 如上所述, 本发明实施例提供的一种表头压缩方法、 解压方法及装置具有以下有 益效果: 通过索引的重复利用即能明显减轻压缩端的内存空间使用, 缩短搜索翻译表 所耗费的时间, 从而有效提高了压缩效率。 5403, when it is necessary to find a list item that has not been used for a long time, the traversal list sequentially acquires the number of times of using the index corresponding to each list item, and if the ratio of the number of used times to the total number of used times is lower than the preset threshold, determining the If the frequency of use of the index corresponding to the number of times of use is lower than the preset threshold, the eligible condition may be reused. Correspondingly, as shown in FIG. 5, an embodiment of the present invention further provides a header compression apparatus, including: a compression determining unit 50, configured to configure a corresponding index for the list item to be compressed, Determining whether there is an available idle index; the replacing unit 52 is configured to, when the compression determining unit determines that there is no idle index, select an index whose usage frequency is lower than a preset threshold from an index that has been configured with the list item And replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is compressed by using the replaced index. In the header compression device provided by the embodiment of the present invention, the compression determining unit 50 can determine whether a corresponding index needs to be configured for the list item to be compressed, and if the index needs to be configured but there is no idle index, the replacement unit 52 can Selecting an index whose frequency is lower than the preset threshold from the index that has been configured with the list item, and replacing the list item corresponding to the index whose usage frequency is lower than the preset threshold with the list item to be compressed, so that the The list item to be compressed is compressed using the replaced index. In this way, the reuse of the index can significantly reduce the memory space usage of the compression end, shortening the time taken for searching the translation table, thereby effectively improving the compression efficiency. Further, the compression determining unit 50 is further configured to determine whether it is necessary to configure a corresponding index for the list item to be compressed before determining whether there is an available idle index. Optionally, the compression determining unit 50, including a list item determining module, is configured to: determine whether the list item to be compressed has been recorded in a translation table; wherein the translation table is used to record a list item and an index Corresponding relationship; in the case that the list item to be compressed has been recorded in the translation table, it is determined that the corresponding index is not required to be configured for the list item to be compressed; In the case that there is no record in the translation table, it is determined that the corresponding index needs to be configured for the list item to be compressed. Optionally, the compression determining unit 50 further includes an index determining module, configured to determine, if the corresponding index is configured for the list item to be compressed, whether there is an idle index of the unspecified corresponding list item in the translation table. . Optionally, the replacing unit 52 is configured to: determine, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately; if the ratio of the number of individual uses to the total number of uses is lower than a preset threshold, determining that the frequency of use of the index corresponding to the number of times of use is lower than a preset threshold, and replacing the list item corresponding to the index with the list item to be compressed, so that the list item to be compressed is utilized The replaced index is compressed. Correspondingly, as shown in FIG. 6, the embodiment of the present invention further provides a header decompression apparatus, including: a decompression determining unit 60, configured to determine whether the same index exists in the received compressed packet and is configured to different list items in sequence. ; The decompression unit 62 is configured to decompress the compressed package with the correspondence between the last configured list item and the index, in a case where the decompression determining unit determines that the same index is sequentially configured to different list items. In the header decompression device provided by the embodiment of the present invention, the decompression determining unit 60 can determine whether the same index in the received compressed packet is configured to be different to the list item, and the same index is sequentially configured to different list items. The decompressing unit 62 can decompress the compressed package by using the mapping relationship between the last configured list item and the index, so that the use of the index can significantly reduce the memory space usage of the decompressing end, thereby shortening the time taken for searching the translation table. Effectively improve the efficiency of understanding pressure. It should be noted that, at the decompression end, a correspondence table between list items and indexes can also be maintained, which is also called a translation table. When a data packet is sent, if the data packet includes only the index and there is no corresponding list item, it indicates that the list item has appeared before, and the corresponding record is already in the translation table, so The correspondence in the table is decompressed. If the data packet includes not only the index but also the list item corresponding to the index, it can be checked whether the index has been recorded in the translation table, and if so, the index and the list item sent this time are reused for the index. Correspondingly, the corresponding relationship between the newly transmitted index and the list item should be replaced with the corresponding relationship already recorded in the translation table, and the subsequent data packet is decompressed with the new corresponding relationship until a new index and list item are added. Send it together and update the new index correspondence. While the preferred embodiments of the present invention have been disclosed for purposes of illustration, those skilled in the art will recognize that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above. INDUSTRIAL APPLICABILITY As described above, a header compression method, a decompression method, and an apparatus provided by an embodiment of the present invention have the following beneficial effects: The reuse of an index can significantly reduce the memory space usage of the compression end, and shorten the cost of searching for a translation table. The time, which effectively improves the compression efficiency.

Claims

权 利 要 求 书 、 一种表头压缩方法, 包括: 在需要为待压缩的列表项配置对应的索引的情况下, 确定是否存在可供选 择的闲置索引; The claim method and the method for compressing the header include: determining whether there is an available idle index when the corresponding index needs to be configured for the list item to be compressed;
在不存在闲置索引的情况下, 从已经为列表项配置的索引中选择使用频率 低于预设阈值的索引, 并将该索引对应的列表项替换为所述待压缩的列表项, 以使所述待压缩的列表项利用替换后的所述索引进行压缩。 、 根据权利要求 1所述的方法, 其中, 所述方法还包括: 在确定是否存在可供选 择的闲置索引之前, 确定是否需要为待压缩的列表项配置对应的索引。 、 根据权利要求 2所述的方法, 其中, 所述确定是否需要为待压缩的列表项配置 对应的索引包括:  In the case that there is no idle index, an index whose frequency is lower than a preset threshold is selected from the index that has been configured for the list item, and the list item corresponding to the index is replaced with the list item to be compressed, so that the The list item to be compressed is compressed using the replaced index. The method according to claim 1, wherein the method further comprises: determining whether a corresponding index needs to be configured for the list item to be compressed before determining whether there is an available idle index. The method according to claim 2, wherein the determining whether the corresponding index needs to be configured for the list item to be compressed comprises:
确定所述待压缩的列表项是否已在翻译表中有所记录; 其中, 所述翻译表 用于记录列表项与索引的对应关系; 在所述待压缩的列表项已在所述翻译表中有所记录的情况下, 确定不需要 为所述待压缩的列表项配置对应的索引; 在所述待压缩的列表项在翻译表中没有记录的情况下, 确定需要为所述待 压缩的列表项配置对应的索引。 、 根据权利要求 3所述的方法, 其中, 所述确定是否存在可供选择的闲置索引包 括: 确定所述翻译表中是否存在未指定对应列表项的闲置索引。 、 根据权利要求 1所述的方法, 其中, 所述从已经为列表项配置的索引中选择使 用频率低于预设阈值的索引包括:  Determining whether the list item to be compressed has been recorded in the translation table; wherein the translation table is used to record a correspondence between the list item and the index; and the list item to be compressed is already in the translation table If there is a record, it is determined that the corresponding index is not configured for the list item to be compressed; if the list item to be compressed has no record in the translation table, it is determined that the list to be compressed needs to be The index corresponding to the item configuration. The method according to claim 3, wherein the determining whether there is an available idle index comprises: determining whether there is an idle index in the translation table that does not specify a corresponding list item. The method according to claim 1, wherein the selecting an index from the index that has been configured for the list item to use the frequency below a preset threshold comprises:
在压缩列表的过程中, 分别确定所有索引的总共使用次数以及各个索引的 单独使用次数;  During the compression of the list, the total number of uses of all indexes and the number of individual uses of each index are determined separately;
如果所述单独使用次数与所述总共使用次数之比低于所述预设阈值, 确定 所述单独使用次数对应的索引的使用频率低于所述预设阈值。 、 一种表头解压方法, 包括: 确定接收的压缩包中是否存在同一索引被先后配置给不同的列表项的情 况; If the ratio of the number of individual uses to the total number of uses is lower than the preset threshold, determining that the frequency of use of the index corresponding to the number of individual uses is lower than the preset threshold. And a method for decompressing the header, comprising: determining whether the same index is configured to be sent to different list items in the received compressed package;
在存在同一索引被先后配置给不同的列表项的情况下, 以最后配置的列表 项和索引的对应关系解压所述压缩包。 、 一种表头压缩装置, 包括: 压缩确定单元,设置为在需要为待压缩的列表项配置对应的索引的情况下, 确定是否存在可供选择的闲置索引;  In the case where the same index is sequentially configured to different list items, the compressed package is decompressed with the correspondence between the last configured list item and the index. And a header compression device, comprising: a compression determining unit, configured to determine whether there is an available idle index if a corresponding index needs to be configured for the list item to be compressed;
替换单元, 设置为在所述压缩确定单元确定不存在闲置索引的情况下, 从 已经配置了列表项的索引中选择使用频率低于预设阈值的索引, 并将该索引对 应的列表项替换为所述待压缩的列表项, 以使所述待压缩的列表项利用替换后 的所述索引进行压缩。 、 根据权利要求 7所述的装置, 其中, 所述压缩确定单元, 还设置为在确定是否 存在可供选择的闲置索引之前, 确定是否需要为待压缩的列表项配置对应的索 引。 、 根据权利要求 7所述的装置, 其中, 所述替换单元, 设置为: 在压缩列表的过程中, 分别确定所有索引的总共使用次数以及各个索引的 单独使用次数;  a replacement unit, configured to: when the compression determining unit determines that there is no idle index, select an index whose usage frequency is lower than a preset threshold from an index that has been configured with the list item, and replace the list item corresponding to the index with The list item to be compressed, so that the list item to be compressed is compressed by using the replaced index. The apparatus according to claim 7, wherein the compression determining unit is further configured to determine whether it is necessary to configure a corresponding index for the list item to be compressed before determining whether there is an available idle index. The device according to claim 7, wherein the replacing unit is configured to: determine, in the process of compressing the list, the total number of uses of all indexes and the number of times of using each index separately;
如果所述单独使用次数与所述总共使用次数之比低于预设阈值, 确定所述 单独使用次数对应的索引的使用频率低于预设阈值, 并将该索引对应的列表项 替换为所述待压缩的列表项, 以使所述待压缩的列表项利用替换后的所述索引 进行压缩。 0、 一种表头解压装置, 包括: 解压确定单元, 设置为确定接收的压缩包中是否存在同一索引被先后配置 给不同的列表项;  If the ratio of the number of times of use and the total number of times of use is lower than a preset threshold, determining that the frequency of use of the index corresponding to the number of times of use is lower than a preset threshold, and replacing the list item corresponding to the index with the a list item to be compressed, so that the list item to be compressed is compressed by using the replaced index. 0. A meter decompression device, comprising: a decompression determining unit, configured to determine whether the same index exists in the received compressed packet is configured to be different list items;
解压单元, 设置为在所述解压确定单元确定存在同一索引被先后配置给不 同的列表项的情况下,以最后配置的列表项和索引的对应关系解压所述压缩包。  The decompression unit is configured to decompress the compressed package with the correspondence between the last configured list item and the index, in a case where the decompression determining unit determines that the same index is sequentially configured to different list items.
PCT/CN2014/084315 2014-06-17 2014-08-13 Header compression method, decompression method and device WO2015192452A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410270492.6 2014-06-17
CN201410270492.6A CN105208596A (en) 2014-06-17 2014-06-17 Header compression method, decompression method and device

Publications (1)

Publication Number Publication Date
WO2015192452A1 true WO2015192452A1 (en) 2015-12-23

Family

ID=54934746

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/084315 WO2015192452A1 (en) 2014-06-17 2014-08-13 Header compression method, decompression method and device

Country Status (2)

Country Link
CN (1) CN105208596A (en)
WO (1) WO2015192452A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257772A (en) * 2017-07-13 2019-01-22 普天信息技术有限公司 A kind of sending, receiving method and user equipment of RTP data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156727A (en) * 2011-04-01 2011-08-17 华中科技大学 Method for deleting repeated data by using double-fingerprint hash check
CN102508784A (en) * 2011-11-02 2012-06-20 杭州海康威视数字技术股份有限公司 Data storage method of flash memory card in video monitoring equipment, and system thereof
CN102683149A (en) * 2011-02-16 2012-09-19 株式会社岛津制作所 Mass analysis data processing method and mass analysis data processing system
CN103260187A (en) * 2012-02-20 2013-08-21 华为技术有限公司 Content-encoding pre-synchronization method, content-encoding pre-synchronization device and content-encoding pre-synchronization system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778427A (en) * 1995-07-07 1998-07-07 Sun Microsystems, Inc. Method and apparatus for selecting a way of a multi-way associative cache by storing waylets in a translation structure
CN100589441C (en) * 2006-10-13 2010-02-10 中兴通讯股份有限公司 IP packet compression method for terminal-to-terminal link transmission
CN101984621B (en) * 2010-10-25 2014-09-10 中兴通讯股份有限公司 Method and device for improving list compression efficiency in robustness header compression
CN102024047B (en) * 2010-12-14 2013-05-29 青岛普加智能信息有限公司 Data searching method and device thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102683149A (en) * 2011-02-16 2012-09-19 株式会社岛津制作所 Mass analysis data processing method and mass analysis data processing system
CN102156727A (en) * 2011-04-01 2011-08-17 华中科技大学 Method for deleting repeated data by using double-fingerprint hash check
CN102508784A (en) * 2011-11-02 2012-06-20 杭州海康威视数字技术股份有限公司 Data storage method of flash memory card in video monitoring equipment, and system thereof
CN103260187A (en) * 2012-02-20 2013-08-21 华为技术有限公司 Content-encoding pre-synchronization method, content-encoding pre-synchronization device and content-encoding pre-synchronization system

Also Published As

Publication number Publication date
CN105208596A (en) 2015-12-30

Similar Documents

Publication Publication Date Title
CN103825869A (en) Compression and decompression method for Ethernet message header, and compression and decompression device thereof
CN102882879B (en) A kind of IP data compression transmission method being applicable to satellite channel
JP4317403B2 (en) Header compression apparatus and header compression method
US9900259B2 (en) Data transmission method and related apparatus to compress data to be transmitted on a network
EP2472813B1 (en) Method and device for user datagram protocol packet compression and decompression
CN102118792B (en) Method and device for transmitting data packets
US20170078916A1 (en) Data processing method and apparatus
CN100433841C (en) Robustness header compression/decompression method for MIPv6
US9392082B2 (en) Communication interface and method for robust header compression of data flows
US20200187052A1 (en) Systems and methods for segmentation and reassembly of data frames in 802.11 wireless local area networks
WO2012051883A1 (en) Method and device for reusing context in robust header compression
US20100205497A1 (en) Method and device for decoding by using window-based least significant bits in robust header compression
US10171634B2 (en) State transition method and apparatus based on ROHC, and storage medium
CN102694730B (en) Method and device for parallel processing
WO2015192452A1 (en) Header compression method, decompression method and device
JP2005124077A (en) Wireless lan system, its communication control method, transmitting station, and receiving station
WO2015101152A1 (en) Method for extracting transmission payload of dfa-based http chunked transfer encoding
EP2190163B1 (en) A method for repairing the window-based least significant bits decoding in the robust header compression
WO2017118273A1 (en) Method and device for transmitting and receiving timestamp information
CN103428181A (en) UDP message transmission optimizing method applied to IP over DVB
CN112335203B (en) Processing local area network diagnostic data
WO2013102336A1 (en) Rohc channel configuration method and device
Woo et al. Performance analysis of robust header compression over mobile wimax
CN103746930B (en) A kind of improved method of arrowband serial link TCP message header suppression
JP2016174287A (en) Tcp control device, and control method and program therefor

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: 14895124

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: 14895124

Country of ref document: EP

Kind code of ref document: A1