[go: up one dir, main page]

CN113890897B - Message processing method and related device - Google Patents

Message processing method and related device Download PDF

Info

Publication number
CN113890897B
CN113890897B CN202111300857.1A CN202111300857A CN113890897B CN 113890897 B CN113890897 B CN 113890897B CN 202111300857 A CN202111300857 A CN 202111300857A CN 113890897 B CN113890897 B CN 113890897B
Authority
CN
China
Prior art keywords
information
message
transmitted
message information
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111300857.1A
Other languages
Chinese (zh)
Other versions
CN113890897A (en
Inventor
孙云刚
段冶
王海龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Internet Network Information Center
Original Assignee
China Internet Network Information Center
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 China Internet Network Information Center filed Critical China Internet Network Information Center
Priority to CN202111300857.1A priority Critical patent/CN113890897B/en
Publication of CN113890897A publication Critical patent/CN113890897A/en
Application granted granted Critical
Publication of CN113890897B publication Critical patent/CN113890897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a message processing method and a related device, which can firstly determine necessary transmission information and unnecessary transmission information in message information to be transmitted, wherein the unnecessary transmission information is fixed value information corresponding to the information type of the message information to be transmitted, and information determined based on other information in the message information to be transmitted, and the necessary transmission information is other information. Only the necessary transmission information is required to be transmitted, and the receiver can complement unnecessary transmission information parts in the necessary transmission information according to the information type of the message information and the necessary transmission information. Therefore, the compressed message information corresponding to the message information to be transmitted can be determined according to the necessary transmission information, and then the compressed message information is transmitted to the target message node corresponding to the message information to be transmitted, so that the target message node is restored to obtain the message information to be transmitted based on the compressed message information, the information quantity required by message transmission is reduced, and the occupation of network bandwidth resources is reduced.

Description

一种报文处理方法和相关装置A message processing method and related devices

技术领域Technical field

本申请涉及互联网技术领域,特别是涉及一种报文处理方法和相关装置。The present application relates to the field of Internet technology, and in particular to a message processing method and related devices.

背景技术Background technique

隧道技术是一种封装技术,在VPN网络中广泛使用。隧道技术利用一种网络传输协议,将其他乘客协议产生的数据报文封装在它自己的报文中,然后在网络中传输。隧道技术在域名系统中的应用较为广泛,域名系统(Domain Name System,缩写:DNS)是互联网的一项基础服务。DNS作为将域名和IP地址相互映射的一个分布式数据库,能够使用户更方便地访问互联网。Tunnel technology is an encapsulation technology that is widely used in VPN networks. Tunneling technology uses a network transmission protocol to encapsulate data packets generated by other passenger protocols into its own packets and then transmit them across the network. Tunnel technology is widely used in the domain name system. The domain name system (Domain Name System, abbreviation: DNS) is a basic service of the Internet. DNS, as a distributed database that maps domain names and IP addresses to each other, can make it easier for users to access the Internet.

在相关技术中,DNS报文在一些场景下需要通过隧道在不同的DNS节点中进行传输,如果用传统隧道技术进行DNS报文传输,存在转发数据流量大,占用网络带宽较多的问题。In related technologies, DNS messages need to be transmitted through tunnels in different DNS nodes in some scenarios. If traditional tunnel technology is used to transmit DNS messages, there is a problem of large forwarding data traffic and occupying a lot of network bandwidth.

发明内容Contents of the invention

为了解决上述技术问题,本申请提供了一种报文处理方法,在传输报文之前可以对待传输报文信息进行压缩,只基于其中的必要传输信息生成压缩报文信息,只需将该压缩报文信息传输给目标报文节点,即可使该目标报文节点能够基于其中的必要传输信息解压得到该待传输报文信息,降低了报文传输时的信息量。In order to solve the above technical problems, this application provides a message processing method. Before transmitting the message, the message information to be transmitted can be compressed, and the compressed message information is generated based only on the necessary transmission information. The compressed message only needs to be By transmitting the message information to the target message node, the target message node can decompress the message information to be transmitted based on the necessary transmission information, thereby reducing the amount of information during message transmission.

本申请实施例公开了如下技术方案:The embodiments of this application disclose the following technical solutions:

第一方面,本申请实施例公开了一种报文处理方法,所述方法包括:In a first aspect, embodiments of the present application disclose a message processing method, which method includes:

获取待传输报文信息;Obtain message information to be transmitted;

确定所述待传输报文信息中的必要传输信息和非必要传输信息,所述非必要传输信息为所述待传输报文信息的信息类型对应的固定值信息,和基于所述待传输报文信息中的其它信息所确定的信息,所述必要传输信息包括所述待传输报文信息中除所述非必要传输信息之外的其它信息;Determine necessary transmission information and non-essential transmission information in the message information to be transmitted, where the non-essential transmission information is fixed value information corresponding to the information type of the message information to be transmitted, and based on the message to be transmitted Information determined by other information in the information, the necessary transmission information includes other information in the message information to be transmitted except the non-essential transmission information;

根据所述必要传输信息确定所述待传输报文信息对应的压缩报文信息;Determine the compressed message information corresponding to the message information to be transmitted according to the necessary transmission information;

向所述待传输报文信息对应的目标报文节点传输所述压缩报文信息,使所述目标报文节点基于所述压缩报文信息还原得到所述待传输报文信息。The compressed message information is transmitted to a target message node corresponding to the message information to be transmitted, so that the target message node restores the message information to be transmitted based on the compressed message information.

在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:

确定所述信息类型对应的压缩模板,所述压缩模板用于标识所述信息类型的信息中的各个信息部分是否必须传输;Determine a compression template corresponding to the information type, the compression template being used to identify whether each information part in the information of the information type must be transmitted;

所述确定所述待传输报文信息中的必要传输信息和非必要传输信息,包括:Determining the necessary transmission information and non-essential transmission information in the message information to be transmitted includes:

响应于所述待传输报文信息符合所述压缩模板,根据所述压缩模板确定所述待传输报文信息中的必要传输信息和非必要传输信息。In response to the message information to be transmitted complying with the compression template, necessary transmission information and unnecessary transmission information in the message information to be transmitted are determined according to the compression template.

在一种可能的实现方式中,所述确定所述待传输报文信息中的必要传输信息和非必要传输信息,包括:In a possible implementation, determining the necessary transmission information and non-essential transmission information in the message information to be transmitted includes:

响应于所述待传输报文信息不符合所述压缩模板,确定所述待传输报文信息中的封装信息,所述封装信息用于发送所述待传输报文信息;In response to the message information to be transmitted not complying with the compression template, determining the encapsulation information in the message information to be transmitted, the encapsulation information being used to send the message information to be transmitted;

将所述待传输报文信息中除所述封装信息外的信息部分确定为所述待传输报文信息对应的必要传输信息。The information part of the message information to be transmitted except the encapsulation information is determined as the necessary transmission information corresponding to the message information to be transmitted.

在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:

确定所述非必要传输信息中基于所述待传输报文信息中的其它信息所确定的可计算信息;Determine the computable information in the unnecessary transmission information that is determined based on other information in the message information to be transmitted;

所述根据所述必要传输信息确定所述待传输报文信息对应的压缩报文信息,包括:Determining the compressed message information corresponding to the message information to be transmitted based on the necessary transmission information includes:

根据所述可计算信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息。According to the computable information and the necessary transmission information, the compressed message information corresponding to the message information to be transmitted is determined.

在一种可能的实现方式中,所述根据所述可计算信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息,包括:In a possible implementation, determining the compressed message information corresponding to the message information to be transmitted based on the computable information and the necessary transmission information includes:

根据压缩字典,确定所述可计算信息中的不可压缩信息和可压缩信息,所述可压缩信息为在所述压缩字典中具有对应压缩内容的信息,所述不可压缩信息为在所述压缩字典中不具有对应压缩内容的信息;According to the compression dictionary, determine the incompressible information and the compressible information in the computable information, the compressible information is the information with corresponding compressed content in the compression dictionary, and the incompressible information is the information in the compression dictionary There is no information corresponding to the compressed content;

根据所述压缩字典将所述可压缩信息压缩为目标压缩信息;compress the compressible information into target compressed information according to the compression dictionary;

根据所述目标压缩信息、所述不可压缩信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息。According to the target compression information, the incompressible information and the necessary transmission information, the compressed message information corresponding to the message information to be transmitted is determined.

在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:

确定所述压缩报文信息对应的信息内容标识,所述信息内容标识用于标识所述可计算信息中的各个信息部分是否添加到所述压缩报文信息中,以及用于标识所述固定值信息中的各个信息部分是否添加到所述压缩报文信息中;Determine the information content identifier corresponding to the compressed message information, the information content identifier is used to identify whether each information part in the computable information is added to the compressed message information, and is used to identify the fixed value Whether each information part in the information is added to the compressed message information;

向所述目标报文节点传输所述信息内容标识。Transmit the information content identifier to the target message node.

在一种可能的实现方式中,所述待传输报文信息为多条待传输报文信息中的任意一条,所述多条待传输报文信息对应于相同的目标报文节点,所述方法还包括:In a possible implementation, the message information to be transmitted is any one of multiple pieces of message information to be transmitted, and the multiple pieces of message information to be transmitted correspond to the same target message node. The method Also includes:

确定所述多条待传输报文信息分别对应的压缩报文信息:Determine the compressed message information corresponding to the multiple pieces of message information to be transmitted:

将所述多条待传输报文信息分别对应的压缩报文信息进行拼接处理,得到综合报文信息,其中,一条所述综合报文信息对应于一套目标封装信息,所述目标封装信息用于将所述综合报文信息传输至所述目标报文节点;The compressed message information corresponding to the plurality of pieces of message information to be transmitted is spliced to obtain comprehensive message information, wherein one of the comprehensive message information corresponds to a set of target encapsulation information, and the target encapsulation information is represented by Transmitting the comprehensive message information to the target message node;

所述向所述待传输报文信息对应的目标报文节点传输所述压缩报文信息,包括:Transmitting the compressed message information to the target message node corresponding to the message information to be transmitted includes:

向所述目标报文节点传输所述综合报文信息,使所述目标报文节点基于所述综合报文信息还原得到所述多条待传输报文信息。The comprehensive message information is transmitted to the target message node, so that the target message node restores and obtains the plurality of message information to be transmitted based on the comprehensive message information.

在一种可能的实现方式中,所述将所述多条待传输报文信息分别对应的压缩报文信息进行拼接处理,得到综合报文信息,包括:In a possible implementation, the compressed message information corresponding to the multiple pieces of message information to be transmitted is spliced to obtain comprehensive message information, including:

确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间;Determine the total amount of information corresponding to the spliced compressed message information, and the time taken for splicing;

响应于所述总信息量未超过信息量发送阈值,且所述拼接所用时间未超过信息发送时间阈值,获取待拼接的目标压缩报文信息进行信息拼接;In response to the total amount of information not exceeding the information amount sending threshold and the time used for splicing not exceeding the information sending time threshold, obtaining the target compressed message information to be spliced for information splicing;

在所述目标压缩报文信息拼接完成后,重新执行所述确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间的步骤;After the splicing of the target compressed message information is completed, re-execute the step of determining the total amount of information corresponding to the spliced compressed message information and the time used for splicing;

响应于所述总信息量超过所述信息量发送阈值,或所述拼接所用时间超过所述信息发送时间阈值,将已拼接压缩报文信息确定为所述综合报文信息。In response to the total information amount exceeding the information amount sending threshold, or the splicing time exceeding the information sending time threshold, the spliced compressed message information is determined to be the comprehensive message information.

在一种可能的实现方式中,所述待传输报文信息为DNS报文信息。In a possible implementation manner, the message information to be transmitted is DNS message information.

第二方面,本申请实施例公开了一种报文处理装置,所述装置包括获取单元、第一确定单元、第二确定单元和第一传输单元:In a second aspect, embodiments of the present application disclose a message processing device, which includes an acquisition unit, a first determination unit, a second determination unit and a first transmission unit:

所述获取单元,用于获取待传输报文信息;The acquisition unit is used to acquire message information to be transmitted;

所述第一确定单元,用于确定所述待传输报文信息中的必要传输信息和非必要传输信息,所述非必要传输信息为所述待传输报文信息的信息类型对应的固定值信息,和基于所述待传输报文信息中的其它信息所确定的信息,所述必要传输信息包括所述待传输报文信息中除所述非必要传输信息之外的其它信息;The first determining unit is used to determine necessary transmission information and non-essential transmission information in the message information to be transmitted. The non-essential transmission information is fixed value information corresponding to the information type of the message information to be transmitted. , and information determined based on other information in the message information to be transmitted, where the necessary transmission information includes other information in the message information to be transmitted except for the non-essential transmission information;

所述第二确定单元,用于根据所述必要传输信息确定所述待传输报文信息对应的压缩报文信息;The second determination unit is configured to determine the compressed message information corresponding to the message information to be transmitted according to the necessary transmission information;

所述第一传输单元,用于向所述待传输报文信息对应的目标报文节点传输所述压缩报文信息,使所述目标报文节点基于所述压缩报文信息还原得到所述待传输报文信息。The first transmission unit is configured to transmit the compressed message information to a target message node corresponding to the message information to be transmitted, so that the target message node restores the message to be transmitted based on the compressed message information. Transmit message information.

在一种可能的实现方式中,所述装置还包括第三确定单元:In a possible implementation, the device further includes a third determining unit:

第三确定单元,用于确定所述信息类型对应的压缩模板,所述压缩模板用于标识所述信息类型的信息中的各个信息部分是否必须传输;The third determination unit is used to determine the compression template corresponding to the information type, and the compression template is used to identify whether each information part in the information of the information type must be transmitted;

第一确定单元,具体用于:The first determination unit is specifically used for:

响应于所述待传输报文信息符合所述压缩模板,根据所述压缩模板确定所述待传输报文信息中的必要传输信息和非必要传输信息。In response to the message information to be transmitted complying with the compression template, necessary transmission information and unnecessary transmission information in the message information to be transmitted are determined according to the compression template.

在一种可能的实现方式中,第一确定单元具体用于:In a possible implementation, the first determination unit is specifically used to:

响应于所述待传输报文信息不符合所述压缩模板,确定所述待传输报文信息中的封装信息,所述封装信息用于发送所述待传输报文信息;In response to the message information to be transmitted not complying with the compression template, determining the encapsulation information in the message information to be transmitted, the encapsulation information being used to send the message information to be transmitted;

将所述待传输报文信息中除所述封装信息外的信息部分确定为所述待传输报文信息对应的必要传输信息。The information part of the message information to be transmitted except the encapsulation information is determined as the necessary transmission information corresponding to the message information to be transmitted.

在一种可能的实现方式中,所述装置还包括第四确定单元:In a possible implementation, the device further includes a fourth determining unit:

第四确定单元,用于确定所述非必要传输信息中基于所述待传输报文信息中的其它信息所确定的可计算信息;A fourth determination unit, configured to determine the computable information in the unnecessary transmission information determined based on other information in the message information to be transmitted;

第二确定单元具体用于:The second determination unit is specifically used for:

根据所述可计算信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息。According to the computable information and the necessary transmission information, the compressed message information corresponding to the message information to be transmitted is determined.

在一种可能的实现方式中,第二确定单元具体用于:In a possible implementation, the second determination unit is specifically used to:

根据压缩字典,确定所述可计算信息中的不可压缩信息和可压缩信息,所述可压缩信息为在所述压缩字典中具有对应压缩内容的信息,所述不可压缩信息为在所述压缩字典中不具有对应压缩内容的信息;According to the compression dictionary, determine the incompressible information and the compressible information in the computable information, the compressible information is the information with corresponding compressed content in the compression dictionary, and the incompressible information is the information in the compression dictionary There is no information corresponding to the compressed content;

根据所述压缩字典将所述可压缩信息压缩为目标压缩信息;compress the compressible information into target compressed information according to the compression dictionary;

根据所述目标压缩信息、所述不可压缩信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息。According to the target compression information, the incompressible information and the necessary transmission information, the compressed message information corresponding to the message information to be transmitted is determined.

在一种可能的实现方式中,所述装置还包括第五确定单元和第二传输单元:In a possible implementation, the device further includes a fifth determination unit and a second transmission unit:

第五确定单元,用于确定所述压缩报文信息对应的信息内容标识,所述信息内容标识用于标识所述可计算信息中的各个信息部分是否添加到所述压缩报文信息中,以及用于标识所述固定值信息中的各个信息部分是否添加到所述压缩报文信息中;The fifth determination unit is used to determine the information content identifier corresponding to the compressed message information. The information content identifier is used to identify whether each information part in the computable information is added to the compressed message information, and Used to identify whether each information part in the fixed value information is added to the compressed message information;

第二传输单元,用于向所述目标报文节点传输所述信息内容标识。The second transmission unit is used to transmit the information content identifier to the target message node.

在一种可能的实现方式中,所述待传输报文信息为多条待传输报文信息中的任意一条,所述多条待传输报文信息对应于相同的目标报文节点,所述装置还包括第六确定单元和拼接单元:In a possible implementation, the message information to be transmitted is any one of multiple pieces of message information to be transmitted, and the multiple pieces of message information to be transmitted correspond to the same target message node, and the device Also includes a sixth determination unit and a splicing unit:

第六确定单元,用于确定所述多条待传输报文信息分别对应的压缩报文信息:The sixth determination unit is used to determine the compressed message information corresponding to the multiple pieces of message information to be transmitted:

拼接单元,用于将所述多条待传输报文信息分别对应的压缩报文信息进行拼接处理,得到综合报文信息,其中,一条所述综合报文信息对应于一套目标封装信息,所述目标封装信息用于将所述综合报文信息传输至所述目标报文节点;A splicing unit is used to splice the compressed message information corresponding to the plurality of pieces of message information to be transmitted to obtain comprehensive message information, wherein one piece of the comprehensive message information corresponds to a set of target encapsulation information, so The target encapsulation information is used to transmit the comprehensive message information to the target message node;

第一传输单元具体用于:The first transmission unit is specifically used for:

向所述目标报文节点传输所述综合报文信息,使所述目标报文节点基于所述综合报文信息还原得到所述多条待传输报文信息。The comprehensive message information is transmitted to the target message node, so that the target message node restores and obtains the plurality of message information to be transmitted based on the comprehensive message information.

在一种可能的实现方式中,拼接单元具体用于:In a possible implementation, the splicing unit is specifically used for:

确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间;Determine the total amount of information corresponding to the spliced compressed message information, and the time taken for splicing;

响应于所述总信息量未超过信息量发送阈值,且所述拼接所用时间未超过信息发送时间阈值,获取待拼接的目标压缩报文信息进行信息拼接;In response to the total amount of information not exceeding the information amount sending threshold and the time used for splicing not exceeding the information sending time threshold, obtaining the target compressed message information to be spliced for information splicing;

在所述目标压缩报文信息拼接完成后,重新执行所述确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间的步骤;After the splicing of the target compressed message information is completed, re-execute the step of determining the total amount of information corresponding to the spliced compressed message information and the time used for splicing;

响应于所述总信息量超过所述信息量发送阈值,或所述拼接所用时间超过所述信息发送时间阈值,将已拼接压缩报文信息确定为所述综合报文信息。In response to the total information amount exceeding the information amount sending threshold, or the splicing time exceeding the information sending time threshold, the spliced compressed message information is determined to be the comprehensive message information.

在一种可能的实现方式中,所述待传输报文信息为DNS报文信息。In a possible implementation manner, the message information to be transmitted is DNS message information.

由上述技术方案可以看出,在获取待传输报文信息后,为了降低传输报文时的信息量,可以先确定该待传输报文信息中的必要传输信息和非必要传输信息,该非必要传输信息为该待传输报文信息的信息类型对应的固定值信息,和基于该待传输报文信息中的其它信息所确定的信息,该必要传输信息包括该待传输报文信息中除该非必要传输信息之外的其它信息。由此可见,只需要传输该必要传输信息,接收到该必要传输信息的接收方即可根据该报文信息的信息类型以及该必要传输信息补全其中的非必要传输信息部分。从而,可以根据必要传输信息确定待传输报文信息对应的压缩报文信息,然后向该待传输报文信息对应的目标报文节点传输该压缩报文信息,使该目标报文节点基于该压缩报文信息还原得到该待传输报文信息,降低了报文传输所需的信息量,减少了对网络带宽资源的占用。It can be seen from the above technical solution that after obtaining the message information to be transmitted, in order to reduce the amount of information when transmitting the message, the necessary transmission information and the unnecessary transmission information in the message information to be transmitted can be determined first. The transmission information is fixed-value information corresponding to the information type of the message information to be transmitted, and information determined based on other information in the message information to be transmitted. The necessary transmission information includes information other than the information in the message information to be transmitted. Other information than necessary transmission information. It can be seen that only the necessary transmission information needs to be transmitted, and the recipient who receives the necessary transmission information can complete the non-essential transmission information part according to the information type of the message information and the necessary transmission information. Therefore, the compressed message information corresponding to the message information to be transmitted can be determined based on the necessary transmission information, and then the compressed message information is transmitted to the target message node corresponding to the message information to be transmitted, so that the target message node can The message information is restored to obtain the message information to be transmitted, which reduces the amount of information required for message transmission and reduces the occupation of network bandwidth resources.

附图说明Description of the drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.

图1为本申请实施例提供的一种报文处理方法的流程图;Figure 1 is a flow chart of a message processing method provided by an embodiment of the present application;

图2为本申请实施例提供的一种报文处理方法的示意图;Figure 2 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图3为本申请实施例提供的一种报文处理方法的示意图;Figure 3 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图4为本申请实施例提供的一种报文处理方法的示意图;Figure 4 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图5为本申请实施例提供的一种报文处理方法的示意图;Figure 5 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图6为本申请实施例提供的一种报文处理方法的示意图;Figure 6 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图7为本申请实施例提供的一种报文处理方法的示意图;Figure 7 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图8为本申请实施例提供的一种报文处理方法的示意图;Figure 8 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图9为本申请实施例提供的一种报文处理方法的示意图;Figure 9 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图10为本申请实施例提供的一种报文处理方法的示意图;Figure 10 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图11为本申请实施例提供的一种报文处理方法的示意图;Figure 11 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图12为本申请实施例提供的一种报文处理方法的示意图;Figure 12 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图13为本申请实施例提供的一种报文处理方法的流程图;Figure 13 is a flow chart of a message processing method provided by an embodiment of the present application;

图14为本申请实施例提供的一种报文处理方法的流程图;Figure 14 is a flow chart of a message processing method provided by an embodiment of the present application;

图15为本申请实施例提供的一种报文处理方法的示意图;Figure 15 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图16为本申请实施例提供的一种报文处理方法的示意图;Figure 16 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图17为本申请实施例提供的一种报文处理方法的示意图;Figure 17 is a schematic diagram of a message processing method provided by an embodiment of the present application;

图18为本申请实施例提供的一种报文处理装置的结构框图。Figure 18 is a structural block diagram of a message processing device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面结合附图,对本申请的实施例进行描述。The embodiments of the present application are described below with reference to the accompanying drawings.

报文节点之间的报文传输是网络通信中常见的技术场景,例如,在DNS报文的以下情况中需要在DNS节点之间进行报文转发:Message transmission between message nodes is a common technical scenario in network communication. For example, in the following situations of DNS messages, message forwarding between DNS nodes is required:

(1)DNS资源动态调度:实现当DNS节点A服务能力不足时,将DNS报文通过隧道转发到服务能力更强的DNS节点B,利用节点B的服务资源分担响应服务。(1) Dynamic scheduling of DNS resources: When DNS node A has insufficient service capabilities, it forwards DNS packets through the tunnel to DNS node B with stronger service capabilities, and uses the service resources of node B to share response services.

(2)DNS攻击缓解:当DNS节点A受到大流量攻击时,无法处理这部分攻击流量。这时DNS节点A将攻击流量部分或全部经隧道转发到抗攻击能力更强的DNS节点B,由节点B处理攻击流量,从而缓解节点A抗攻击压力。(2) DNS attack mitigation: When DNS node A is attacked by large traffic, it cannot handle this part of the attack traffic. At this time, DNS node A forwards part or all of the attack traffic through the tunnel to DNS node B, which is more resistant to attacks. Node B handles the attack traffic, thereby alleviating the pressure on node A to resist attacks.

然而,在传统的隧道技术中,传输报文时会将报文中的全部内容进行传输,这样就会使传输数据量增大,占用大量的网络带宽。However, in traditional tunnel technology, all the contents of the message are transmitted when transmitting the message, which increases the amount of transmitted data and occupies a large amount of network bandwidth.

为了解决上述技术问题,本申请提供了一种报文处理方法,在传输报文之前可以对待传输报文信息进行压缩,只基于其中的必要传输信息生成压缩报文信息,只需将该压缩报文信息传输给目标报文节点,即可使该目标报文节点能够基于其中的必要传输信息解压得到该待传输报文信息,降低了报文传输时的信息量。In order to solve the above technical problems, this application provides a message processing method. Before transmitting the message, the message information to be transmitted can be compressed, and the compressed message information is generated based only on the necessary transmission information. The compressed message only needs to be By transmitting the message information to the target message node, the target message node can decompress the message information to be transmitted based on the necessary transmission information, thereby reducing the amount of information during message transmission.

可以理解的是,该方法可以应用于处理设备上,该处理设备为能够进行报文处理的处理设备,例如可以为具有报文处理功能的终端设备或服务器。该方法可以通过终端设备或服务器独立执行,也可以应用于终端设备和服务器通信的网络场景,通过终端设备和服务器配合执行。其中,终端设备可以为计算机、手机等设备。服务器可以理解为是应用服务器,也可以为Web服务器,在实际部署时,该服务器可以为独立服务器,也可以为集群服务器。It can be understood that this method can be applied to a processing device, which is a processing device capable of packet processing, such as a terminal device or a server with a packet processing function. This method can be executed independently by the terminal device or the server, or can be applied to a network scenario in which the terminal device and the server communicate, and can be executed by the terminal device and the server in cooperation. Among them, the terminal device can be a computer, a mobile phone and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server.

接下来,将结合附图,对本申请实施例提供的一种报文处理方法进行介绍。Next, a message processing method provided by the embodiment of the present application will be introduced with reference to the accompanying drawings.

参见图1,图1为本申请实施例提供的一种报文处理方法的流程图,该方法包括:Referring to Figure 1, Figure 1 is a flow chart of a message processing method provided by an embodiment of the present application. The method includes:

S101:获取待传输报文信息。S101: Obtain message information to be transmitted.

该待传输报文信息为需要传输至其他报文节点的报文信息,该待传输报文信息对应的报文节点为目标报文节点,即该待传输报文信息需要发送至该目标报文节点处。The message information to be transmitted is the message information that needs to be transmitted to other message nodes. The message node corresponding to the message information to be transmitted is the target message node, that is, the message information to be transmitted needs to be sent to the target message node. node.

S102:确定待传输报文信息中的必要传输信息和非必要传输信息。S102: Determine the necessary transmission information and non-essential transmission information in the message information to be transmitted.

其中,非必要传输信息为该待传输报文信息的信息类型对应的固定值信息,以及基于该待传输报文信息中的其它信息所确定的信息,该必要传输信息包括该待传输报文信息中除非必要传输信息之外的其它信息,该固定值信息是指该信息类型下所有报文信息都具有的固定值。Among them, the non-essential transmission information is fixed value information corresponding to the information type of the message information to be transmitted, and information determined based on other information in the message information to be transmitted, and the necessary transmission information includes the message information to be transmitted. Among other information except necessary transmission information, the fixed value information refers to the fixed value that all message information under this information type has.

因此,即使作为接收方的报文节点没有接收到该非必要传输信息,也可以根据该报文信息的信息类型和所接收到的必要传输信息,还原得到该非必要传输信息。由此可见,在进行报文传输时,为了在不影响报文传输效果的同时,降低传输的报文信息量,可以减少对该非必要传输信息的传输。Therefore, even if the message node as the receiver does not receive the unnecessary transmission information, the unnecessary transmission information can be restored according to the information type of the message information and the received necessary transmission information. It can be seen that when transmitting messages, in order to reduce the amount of transmitted message information without affecting the message transmission effect, the transmission of unnecessary transmission information can be reduced.

S103:根据必要传输信息确定待传输报文信息对应的压缩报文信息。S103: Determine the compressed message information corresponding to the message information to be transmitted based on the necessary transmission information.

处理设备可以基于必要传输信息来生成该待传输报文信息对应的压缩报文信息,从而使该压缩报文信息只包括该必要传输信息,降低该压缩报文信息的报文信息量。The processing device can generate compressed message information corresponding to the message information to be transmitted based on the necessary transmission information, so that the compressed message information only includes the necessary transmission information, and the amount of message information of the compressed message information is reduced.

S104:向待传输报文信息对应的目标报文节点传输压缩报文信息,使目标报文节点基于压缩报文信息还原得到待传输报文信息。S104: Transmit the compressed message information to the target message node corresponding to the message information to be transmitted, so that the target message node restores the message information to be transmitted based on the compressed message information.

在接收到该压缩报文信息后,该目标报文节点可以基于该报文信息的信息类型,确定出该压缩报文信息对应的固定值;以及,可以基于该压缩报文信息,计算出缺失的信息部分,从而可以还原得到该待传输报文信息。After receiving the compressed message information, the target message node can determine the fixed value corresponding to the compressed message information based on the information type of the message information; and can calculate the missing value based on the compressed message information. information part, so that the information of the message to be transmitted can be restored.

由上述技术方案可以看出,在获取待传输报文信息后,为了降低传输报文时的信息量,可以先确定该待传输报文信息中的必要传输信息和非必要传输信息,该非必要传输信息为该待传输报文信息的信息类型对应的固定值信息,和基于该待传输报文信息中的其它信息所确定的信息,该必要传输信息包括该待传输报文信息中除该非必要传输信息之外的其它信息。由此可见,只需要传输该必要传输信息,接收到该必要传输信息的接收方即可根据该报文信息的信息类型以及该必要传输信息补全其中的非必要传输信息部分。从而,可以根据必要传输信息确定待传输报文信息对应的压缩报文信息,然后向该待传输报文信息对应的目标报文节点传输该压缩报文信息,使该目标报文节点基于该压缩报文信息还原得到该待传输报文信息,降低了报文传输所需的信息量,减少了对网络带宽资源的占用。It can be seen from the above technical solution that after obtaining the message information to be transmitted, in order to reduce the amount of information when transmitting the message, the necessary transmission information and the unnecessary transmission information in the message information to be transmitted can be determined first. The transmission information is fixed-value information corresponding to the information type of the message information to be transmitted, and information determined based on other information in the message information to be transmitted. The necessary transmission information includes information other than the information in the message information to be transmitted. Other information than necessary transmission information. It can be seen that only the necessary transmission information needs to be transmitted, and the recipient who receives the necessary transmission information can complete the non-essential transmission information part according to the information type of the message information and the necessary transmission information. Therefore, the compressed message information corresponding to the message information to be transmitted can be determined based on the necessary transmission information, and then the compressed message information is transmitted to the target message node corresponding to the message information to be transmitted, so that the target message node can The message information is restored to obtain the message information to be transmitted, which reduces the amount of information required for message transmission and reduces the occupation of network bandwidth resources.

可以理解的是,同一信息类型的报文信息通常具有较为固定的信息部分组成,因此,为了提高压缩报文信息的效率和准确度,在一种可能的实现方式中,在确定报文信息中的必要传输部分和非必要传输部分时,处理设备可以先确定该信息类型对应的压缩模板,该压缩模板用于标识该信息类型的信息中的各个信息部分是否必须传输。It can be understood that message information of the same information type usually has relatively fixed information parts. Therefore, in order to improve the efficiency and accuracy of compressing message information, in one possible implementation, in determining the message information When the necessary transmission part and the non-essential transmission part are determined, the processing device can first determine the compression template corresponding to the information type. The compression template is used to identify whether each information part in the information of this information type must be transmitted.

处理设备可以确定该待传输报文是否符合该压缩模板,即该待传输报文中的信息分布格式与该压缩模板一致,从而可以基于该压缩模板确定各个信息部分是否必须传输。响应于该待传输报文符合压缩模板,处理设备可以根据该压缩模板确定该待传输报文信息中的必要传输信息和非必要传输信息,从而只需对照模板即可对该待传输报文信息进行快速压缩,提高报文压缩的效率和准确度。The processing device can determine whether the message to be transmitted conforms to the compression template, that is, the information distribution format in the message to be transmitted is consistent with the compression template, so that it can determine whether each information part must be transmitted based on the compression template. In response to the message to be transmitted conforming to the compression template, the processing device can determine the necessary transmission information and the non-essential transmission information in the message to be transmitted according to the compression template, so that the message information to be transmitted can be processed by simply referring to the template. Perform fast compression to improve the efficiency and accuracy of message compression.

例如,在一种可能的实现方式中,该待传输报文信息可以为DNS报文信息,该信息类型对应的压缩模板可以如图2所示。For example, in one possible implementation, the message information to be transmitted may be DNS message information, and the compression template corresponding to this information type may be as shown in Figure 2.

其中,4h、5h、0h、11h、1h信息部分为该信息类型对应的固定值信息,TBC部分代表该信息类型对应的可以通过其它信息计算得到的信息部分,这些信息部分都为非必要传输部分;IP_ID、TTL、SIP、SPORT、DNSID信息部分为必要传输信息,DIP、DPORT、FLAG、QNAME、T/C、ADD_RR字段具有多样性,在部分DNS报文信息中为固定值,在部分DNS报文信息中也可以作为非固定值。在作为固定值时可以视为非必要传输部分,在作为非固定值时可以视为必要传输部分。参见图3,图3展示了通过该压缩模板得到的必要传输信息FP。Among them, the 4h, 5h, 0h, 11h, and 1h information parts are fixed value information corresponding to the information type, and the TBC part represents the information part corresponding to the information type that can be calculated through other information. These information parts are non-essential transmission parts. ;The IP_ID, TTL, SIP, SPORT, and DNSID information are necessary transmission information. The DIP, DPORT, FLAG, QNAME, T/C, and ADD_RR fields are diverse and are fixed values in some DNS message information. It can also be used as a non-fixed value in text information. It can be regarded as a non-essential transmission part when it is a fixed value, and it can be regarded as a necessary transmission part when it is a non-fixed value. Referring to Figure 3, Figure 3 shows the necessary transmission information FP obtained through the compression template.

此外,在一种可能的实现方式中,响应于该待传输报文信息不符合该压缩模板,为了防止其中的必要传输信息在没有准确进行分辨的情况下,在压缩过程中出现丢失的情况,处理设备可以先确定该待传输报文信息中的封装信息,该封装信息用于发送该待传输报文信息,即该封装信息为在向处理设备发送该待传输报文信息所必须添加的信息,通过该封装信息可以使该待传输报文信息在隧道里进行传输。可以理解的是,该封装信息可以视为该信息类型所对应的固定值信息,因此,处理设备可以将该待传输报文信息中除该封装信息外的信息部分确定为该待传输报文信息对应的必要传输信息,从而可能最大程度上避免必要传输信息的遗漏。如图4所示,nc为去掉封装信息的待传输报文信息,处理设备可以在nc信息上添加头部信息T和L生成压缩报文信息。In addition, in a possible implementation, in response to the message information to be transmitted not conforming to the compression template, in order to prevent the necessary transmission information from being lost during the compression process without accurate discrimination, The processing device can first determine the encapsulation information in the message information to be transmitted. The encapsulation information is used to send the message information to be transmitted. That is, the encapsulation information is the information that must be added when sending the message information to be transmitted to the processing device. , through this encapsulation information, the message information to be transmitted can be transmitted in the tunnel. It can be understood that the encapsulation information can be regarded as fixed value information corresponding to the information type. Therefore, the processing device can determine the information part of the message information to be transmitted except the encapsulation information as the message information to be transmitted. Corresponding necessary transmission information, thus possibly avoiding the omission of necessary transmission information to the greatest extent. As shown in Figure 4, nc is the message information to be transmitted with the encapsulation information removed. The processing device can add header information T and L to the nc information to generate compressed message information.

上已述及,该待传输报文信息中包括部分能够基于其他信息所确定的信息,这部分信息可以称为可计算信息,即信息的接收方能够基于得到的必要传输信息计算得到该可计算信息。可以理解的是,接收方在计算该可计算信息时需要耗费一定的计算时间,因此,在一种可能的实现方式中,为了使报文信息能够得到更加高效的处理,平衡发送报文和处理报文所需的资源和时间,处理设备可以先确定该非必要传输信息中基于待传输报文信息中的其它信息所确定的可计算信息,然后根据该可计算信息和必要传输信息,确定该待传输报文信息对应的压缩报文信息,从而可以将这部分可计算信息也发送给目标报文节点,使该目标报文节点无需重新计算其中的信息,节省了报文处理所需的时间;同时,由于固定值信息较为容易获取,不需要经过计算等步骤,因此在不发送该固定值信息的情况下,可以在对报文信息处理效率影响较小的前提下降低报文传输所需的网络带宽。As mentioned above, the message information to be transmitted includes part of the information that can be determined based on other information. This part of the information can be called computable information, that is, the recipient of the information can calculate the computable information based on the necessary transmission information. information. It is understandable that the receiver needs to spend a certain amount of calculation time when calculating the computable information. Therefore, in a possible implementation, in order to enable the message information to be processed more efficiently, a balance between sending messages and processing The resources and time required for the message. The processing device can first determine the computable information in the unnecessary transmission information based on other information in the message information to be transmitted, and then determine the computable information and the necessary transmission information based on the computable information and the necessary transmission information. Compressed message information corresponding to the message information to be transmitted, so that this part of the computable information can also be sent to the target message node, so that the target message node does not need to recalculate the information in it, saving the time required for message processing ;At the same time, since the fixed value information is relatively easy to obtain and does not require calculation and other steps, without sending the fixed value information, the message transmission requirements can be reduced with less impact on the message information processing efficiency. network bandwidth.

此外,为了进一步降低报文传输的信息量,处理设备可以针对在报文信息中常见的信息内容建议压缩字典,该压缩字典记录有压缩前的信息内容与对应的压缩后的压缩内容,该压缩内容的信息量要远小于压缩前的信息内容。在一种可能的实现方式中,处理设备可以根据压缩字典,确定可计算信息中的不可压缩信息和可压缩信息,其中可压缩信息为在该压缩字典中具有对应压缩内容的信息,不可压缩信息为在该压缩字典中不具有对应压缩内容的信息。处理设备可以根据该压缩字典将该可压缩信息压缩为目标压缩信息,并根据该目标压缩信息、不可压缩信息和必要传输信息,确定该待传输报文信息对应的压缩报文信息。可以理解的是,在一些情况下,部分必要传输信息同样可以进行压缩处理,在本申请实施例中,为了保障必要传输信息传输的准确性,避免在解压过程中出现信息错误,处理设备可以只对可计算信息进行压缩。In addition, in order to further reduce the amount of information transmitted by the message, the processing device can recommend a compression dictionary for common information content in the message information. The compression dictionary records the information content before compression and the corresponding compressed content after compression. The compression dictionary The information content of the content is much smaller than the information content before compression. In a possible implementation, the processing device can determine the incompressible information and the compressible information in the computable information according to the compression dictionary, where the compressible information is the information with corresponding compressed content in the compression dictionary, and the incompressible information It is information that does not have corresponding compressed content in the compression dictionary. The processing device can compress the compressible information into target compressed information according to the compression dictionary, and determine the compressed message information corresponding to the message information to be transmitted based on the target compressed information, incompressible information and necessary transmission information. It can be understood that in some cases, some necessary transmission information can also be compressed. In the embodiment of the present application, in order to ensure the accuracy of the transmission of necessary transmission information and avoid information errors during the decompression process, the processing device can only Compress computable information.

可以理解的是,由于处理设备并没有将全部的报文信息都发送给目标报文节点,因此,目标报文节点需要查找其中缺失的信息部分进行还原。在一种可能的实现方式中,为了使目标报文节点能够清楚的获知该待传输报文信息中的发送部分和未发送部分,处理设备可以确定该压缩报文信息对应的信息内容标识,该信息内容标识用于标识该可计算信息中的各个信息部分是否添加到该压缩报文信息中,以及可以用于标识该固定值信息中的各个信息部分是否添加到所述压缩报文信息中。处理设备可以向目标报文节点传输该信息内容标识,从而,在基于可计算信息和必要传输信息生成压缩报文信息时,该目标报文节点可以根据该信息内容标识获知该压缩报文信息中具有以及缺失的该待传输报文信息中的信息部分,从而能够做到有针对性的信息还原。It is understandable that since the processing device does not send all the message information to the target message node, the target message node needs to find the missing information part and restore it. In a possible implementation, in order for the target message node to clearly learn the sent part and the unsent part of the message information to be transmitted, the processing device can determine the information content identifier corresponding to the compressed message information, and the The information content identifier is used to identify whether each information part in the computable information is added to the compressed message information, and may be used to identify whether each information part in the fixed value information is added to the compressed message information. The processing device can transmit the information content identifier to the target message node, so that when generating compressed message information based on the computable information and necessary transmission information, the target message node can learn the content of the compressed message information based on the information content identifier. The existing and missing information parts in the message information to be transmitted can achieve targeted information restoration.

例如,如图5所示,图5为一种压缩报文信息的示意图,其中压缩报文信息(Packetblock,简称PB)包括头部信息T和L,必要传输信息FP以及部分必要传输信息VP(Variablepart)和信息内容标识BM(Bitmap)构成,其中,T和L所包括的信息具体如下:For example, as shown in Figure 5, Figure 5 is a schematic diagram of compressed packet information, in which the compressed packet information (Packetblock, PB for short) includes header information T and L, necessary transmission information FP and part of the necessary transmission information VP ( Variablepart) and information content identification BM (Bitmap), where the information included in T and L is as follows:

T:1B type标记PB类形,如按DNS请求对应的压缩模板压缩报文(T=0)、未压缩报文(T=1)等。T: 1B type marks the PB type, such as compressed packets according to the compression template corresponding to the DNS request (T=0), uncompressed packets (T=1), etc.

L:1~2B length字段,最高bit是字段结束标志,低7bit标记整个PB的byte长度,如图7所示。L包括从T开始,到最后一个非必要传输信息variable part(VP)结束的全部数据。PB较短时(1~2^7)L为1B:最高bit为1,低7bit标记整个PB的byte长度。PB较长时(2^7+1~2^14)L为2B:第一字节最高bit为0,低7bit标记整个PB的byte长度[13:7]。第二字节最高bit为1,低7bit标记整个PB的byte长度[6:0]。L字段的结构如图12所示。L: 1~2B length field, the highest bit is the field end flag, and the lower 7 bits mark the byte length of the entire PB, as shown in Figure 7. L includes all data starting from T and ending with the last non-essential transmission information variable part (VP). When PB is short (1~2^7), L is 1B: the highest bit is 1, and the lower 7 bits mark the byte length of the entire PB. When PB is long (2^7+1~2^14) L is 2B: the highest bit of the first byte is 0, and the lower 7 bits mark the byte length of the entire PB [13:7]. The highest bit of the second byte is 1, and the lower 7 bits mark the byte length of the entire PB [6:0]. The structure of the L field is shown in Figure 12.

在通过图2所示的压缩模板确定出其中的必要传输信息和非必要传输信息后,处理设备可以基于必要传输信息中的常规信息生成FP部分,该常规信息是指每一个DNS报文中都具有的必要传输信息。同时,处理设备可以选择其中的可计算信息以及必要传输信息中的非常规信息生成VP部分,该非常规信息是指并不是每一个DNS报文中都具有的必要传输信息,例如,当存在上述具有多样性的信息时,若信息为非固定值,则可以视为必要传输信息中的非常规信息来生成相应的VP字段。该BM部分如图6所示。其中,BM信息能够标识每一个VP部分对应的值,若VP部分的BM[X]=1,则说明压缩报文信息中具有这部分VP对应的非必要传输信息;若BM[X]=0,则说明压缩报文信息中不具有这部分VP对应的非必要传输信息。在图6所示的BM信息中,非必要传输信息中的固定值信息,例如DNS报文中的默认值等都对应于BM[X]=0,其他可计算信息对应于BM[X]=1。After determining the necessary transmission information and non-essential transmission information through the compression template shown in Figure 2, the processing device can generate the FP part based on the regular information in the necessary transmission information. The regular information refers to the FP part in each DNS message. Have the necessary transmission information. At the same time, the processing device can select the computable information and the non-conventional information in the necessary transmission information to generate the VP part. The non-conventional information refers to the necessary transmission information that is not included in every DNS message. For example, when there is the above When there is diversity of information, if the information is a non-fixed value, it can be regarded as non-conventional information in the necessary transmission information to generate the corresponding VP field. This BM part is shown in Figure 6. Among them, BM information can identify the value corresponding to each VP part. If BM[X]=1 in the VP part, it means that the compressed message information contains unnecessary transmission information corresponding to this part of VP; if BM[X]=0 , it means that the compressed message information does not contain the unnecessary transmission information corresponding to this part of VP. In the BM information shown in Figure 6, the fixed value information in the unnecessary transmission information, such as the default value in the DNS message, etc., corresponds to BM[X]=0, and other computable information corresponds to BM[X]= 1.

VP部分的结构如图7所示,一个VP中包括指针TK(token)和指针对应的数据DATA,其中,一个非必要传输信息部分可以对应于一个VP,也可以在信息内容较多时,拆分成多个VP进行传输。其中,TK部分的结构可以如图8所示,MT(MORE token)字段用于标识当前token所属的VP字段是否结束,即该VP字段是否是同一非必要传输信息中的部分信息;C字段用于标识该DATA字段是否为字典指针,即该DATA是否为压缩信息;LEN字段用于标识DATA的字节长度,1~64bit。在非必要传输信息没有基于压缩字典进行压缩时,该DATA字段包含该非必要传输信息的原文信息;在进行压缩时,该DATA字段包含该费非必要传输信息对应的压缩信息。The structure of the VP part is shown in Figure 7. A VP includes a pointer TK (token) and the data DATA corresponding to the pointer. Among them, an unnecessary transmission information part can correspond to a VP, or it can be split when the information content is large. into multiple VPs for transmission. Among them, the structure of the TK part can be shown in Figure 8. The MT (MORE token) field is used to identify whether the VP field to which the current token belongs has ended, that is, whether the VP field is part of the same non-essential transmission information; the C field is It is used to identify whether the DATA field is a dictionary pointer, that is, whether the DATA is compressed information; the LEN field is used to identify the byte length of the DATA, 1 to 64 bits. When the unnecessary transmission information is not compressed based on the compression dictionary, the DATA field contains the original text information of the unnecessary transmission information; when compression is performed, the DATA field contains the compression information corresponding to the unnecessary transmission information.

VP字段内存在部分非必要传输信息被压缩,以及同一非必要传输信息被拆分成多个VP字段的情况,如图9所示,其中VP0为经过压缩处理的非必要传输信息,VP1为原文传输的非必要传输信息,VP0和VP1为同一非必要传输信息“baidu.com”的两部分,有图可见,通过MT字段可以标识该VP0字段没有结束,且VP0中的DATA为字典指针,该字典指针可以用于对该DATA字段进行解压缩。In the VP field, some unnecessary transmission information is compressed, and the same unnecessary transmission information is split into multiple VP fields, as shown in Figure 9, where VP0 is the compressed unnecessary transmission information and VP1 is the original text. The non-essential transmission information transmitted, VP0 and VP1 are two parts of the same non-essential transmission information "baidu.com". As shown in the figure, the MT field can be used to identify that the VP0 field has not ended, and the DATA in VP0 is a dictionary pointer. Dictionary pointers can be used to decompress this DATA field.

除了能够对单条待传输报文信息进行压缩处理外,针对多条待传输报文信息的场景,处理设备还可以通过多条报文信息之间的组合来进一步降低报文信息传输所需的带宽资源。可以理解的是,为了在隧道中进行传输,报文信息中通常需要添加封装信息,例如为了将待传输报文信息发送到处理设备处,需要在该待传输报文信息中添加对应的封装信息。In addition to being able to compress a single piece of message information to be transmitted, for scenarios where multiple pieces of message information are to be transmitted, the processing device can also further reduce the bandwidth required for message information transmission through the combination of multiple pieces of message information. resource. It can be understood that in order to transmit in a tunnel, encapsulation information usually needs to be added to the message information. For example, in order to send the message information to be transmitted to the processing device, corresponding encapsulation information needs to be added to the message information to be transmitted. .

其中,每一条报文信息在发送时都需要添加对应的封装信息,因此,为了降低传输多条报文信息时占用的带宽资源,处理设备可以将多条待传输报文信息中需要传输的信息内容合并到一条报文信息中,从而只需要添加一次封装信息即可。Among them, each piece of message information needs to add corresponding encapsulation information when it is sent. Therefore, in order to reduce the bandwidth resources occupied when transmitting multiple message information, the processing device can combine the information that needs to be transmitted among the multiple pieces of message information to be transmitted. The content is merged into one message information, so that the encapsulation information only needs to be added once.

在一种可能的实现方式中,该待传输报文信息可以为多条待传输报文信息中的任意一条,该多条待传输报文信息对应于相同的目标报文节点,处理设备可以确定多条待传输报文信息分别对应的压缩报文信息,然后将多条待传输报文信息分别对应的压缩报文信息进行拼接处理,得到综合报文信息,其中,一条综合报文信息对应于一套目标封装信息,该目标封装信息用于将该综合报文信息传输至该目标报文节点。In a possible implementation, the message information to be transmitted can be any one of multiple pieces of message information to be transmitted. The multiple pieces of message information to be transmitted correspond to the same target message node, and the processing device can determine Compressed message information corresponding to multiple pieces of message information to be transmitted, and then splicing the compressed message information corresponding to multiple pieces of message information to be transmitted to obtain comprehensive message information, where one piece of comprehensive message information corresponds to A set of target encapsulation information used to transmit the comprehensive message information to the target message node.

处理设备可以向该目标报文节点传输该综合报文信息,使该目标报文节点可以基于该综合报文信息还原得到该多条待传输报文信息。例如,如图10所示,处理设备可以确定出多个原始报文对应的PB信息,然后将这些PB信息进行组合,随后添加上对应于DNS隧道传输的目标封装信息FH(frameheader,对应于图中的FRAM HD)、IP HD和ETHHD。其中,IP HD中Protocol字段为131,即采用私有IP封装协议。当然,除了非必要传输信息可以进行压缩外,PB部分内的必要传输信息同样可以基于压缩字典等方式进行压缩,此处不作限制。压缩隧道封装FH共8B,分成4部分内容,如图11所示。The processing device can transmit the comprehensive message information to the target message node, so that the target message node can restore and obtain the multiple pieces of message information to be transmitted based on the comprehensive message information. For example, as shown in Figure 10, the processing device can determine the PB information corresponding to multiple original messages, then combine these PB information, and then add the target encapsulation information FH (frameheader, corresponding to Figure 10) corresponding to the DNS tunnel transmission. FRAM HD), IP HD and ETHHD in . Among them, the Protocol field in IP HD is 131, which means a private IP encapsulation protocol is used. Of course, in addition to the non-essential transmission information that can be compressed, the necessary transmission information in the PB part can also be compressed based on compression dictionary and other methods, and there is no restriction here. The compressed tunnel encapsulation FH is 8B in total, divided into 4 parts, as shown in Figure 11.

可以理解的是,报文信息通常都具有一定的时效性,若在接收到报文信息后没有及时将该报文信息发送给对应的接收方,可能会造成报文信息失效等问题。此外,在隧道中传输报文信息时,隧道通常具有一定的信息量传输上限,若一条报文信息的信息量超过该上限则难以在该隧道中进行传输。基于此,在一种可能的实现方式中,处理设备可以先确定信息发送时间阈值和信息量发送阈值,然后确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间。It is understandable that message information usually has a certain timeliness. If the message information is not sent to the corresponding recipient in time after receiving the message information, it may cause problems such as invalidation of the message information. In addition, when transmitting message information in a tunnel, the tunnel usually has a certain upper limit for the amount of information transmitted. If the amount of information in a message exceeds the upper limit, it will be difficult to transmit it in the tunnel. Based on this, in a possible implementation, the processing device can first determine the information sending time threshold and the information amount sending threshold, and then determine the total information amount corresponding to the spliced compressed message information, and the splicing time.

响应于该总信息量未超过信息量发送阈值,且该拼接所用时间未超过信息发送时间阈值,说明已拼接压缩报文信息用时较短,且信息量较少,可以继续进行压缩报文信息拼接的步骤,此时处理设备可以获取待拼接的目标压缩报文信息进行信息拼接。同时,在该目标压缩报文信息拼接完成后,处理设备可以重新执行确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间的步骤。In response to the fact that the total amount of information does not exceed the information amount sending threshold, and the time used for splicing does not exceed the information sending time threshold, it means that the splicing of compressed message information takes a short time and the amount of information is small, and the compressed message information can be continued to be spliced. At this time, the processing device can obtain the target compressed message information to be spliced for information splicing. At the same time, after the splicing of the target compressed message information is completed, the processing device can re-execute the steps of determining the total amount of information corresponding to the spliced compressed message information and the time taken for splicing.

响应于总信息量超过该信息量发送阈值,或拼接所用时间超过信息发送时间阈值,处理设备可以直接将该已拼接压缩报文信息确定为该综合报文信息。基于上述技术方案,处理设备可以在进行报文拼接时实时对已拼接压缩报文信息的信息量和拼接所用时间进行监控,保障该综合报文信息的稳定传输。In response to the total amount of information exceeding the information amount sending threshold, or the time taken for splicing exceeding the information sending time threshold, the processing device may directly determine the spliced compressed message information as the comprehensive message information. Based on the above technical solution, the processing equipment can monitor the amount of information and the splicing time of the spliced compressed message information in real time when splicing messages to ensure the stable transmission of the comprehensive message information.

为了便于理解本申请提供的技术方案,接下来,将结合一种实际应用场景,对本申请实施例提供的一种报文处理方法进行介绍。In order to facilitate understanding of the technical solution provided by this application, next, a message processing method provided by the embodiment of this application will be introduced based on a practical application scenario.

参见图13,图13为本申请实施例提供的一种实际应用场景中报文处理方法的流程图。在开始处理后,处理设备首先可以接收待传输报文信息,然后判断待传输报文信息是否为DNS报文,若否,则丢弃报文并重新接收下一条报文信息;若是,则去掉其中的二层头(封装信息),并判断剩下的信息部分是否符合压缩模板,若否,则将剩余部分构造为NC字段,添加T和L字段,并判断报文处理是否超时,若否则判断报文长度是否达到MTU,未达到则继续处理下一条报文信息,若超时或报文长度达到MTU则添加封装信息生成压缩报文信息;若是,则根据压缩模板构造必要传输信息FP字段,然后判断剩余的非必要传输信息是否为固定值信息,若是则丢弃,若否则判断该信息是否可以压缩,可压缩的将其压缩后的信息确定为VP字段,不可压缩则直接根据原文信息构建VP字段。处理设备可以判断非固定值字段是否结束,若未结束则继续判断是否可以进行压缩,若结束,则判断报文是否结束,若是则添加T和L字段,然后判断拼装压缩报文信息的总时间是否超过时间阈值,若超过则添加封装信息,结束报文处理并发送;若未超过,则判断已拼装压缩信息的报文长度是否达到信息量阈值MTU,若是则同样添加封装信息结束处理,若否,则可以获取下一跳待传输报文信息进行处理。Referring to Figure 13, Figure 13 is a flow chart of a message processing method in an actual application scenario provided by an embodiment of the present application. After starting the processing, the processing device can first receive the message information to be transmitted, and then determine whether the message information to be transmitted is a DNS message. If not, discard the message and re-receive the next message information; if so, remove the message. Layer 2 header (encapsulated information), and determine whether the remaining information part conforms to the compression template. If not, construct the remaining part as the NC field, add T and L fields, and determine whether the message processing has timed out. If not, determine Whether the message length reaches the MTU, if not, continue processing the next message information. If it times out or the message length reaches the MTU, add encapsulation information to generate compressed message information; if so, construct the necessary transmission information FP field according to the compression template, and then Determine whether the remaining non-essential transmission information is fixed value information. If so, discard it. If not, determine whether the information can be compressed. If it is compressible, the compressed information will be determined as the VP field. If it is not compressible, the VP field will be constructed directly based on the original information. . The processing device can determine whether the non-fixed value field has ended. If it has not ended, it will continue to determine whether compression can be performed. If it has ended, it will determine whether the message has ended. If so, it will add the T and L fields, and then determine the total time to assemble the compressed message information. Whether it exceeds the time threshold, if so, add encapsulation information, end the message processing and send; if not, determine whether the length of the message with assembled compressed information reaches the information volume threshold MTU, if so, add encapsulation information to end the processing, if If not, the next hop message information to be transmitted can be obtained for processing.

在接收到经过上文处理的压缩报文信息后,目标报文节点可以如图14所示进行信息恢复。在接收信息后,可以先确定是否为DNS隧道转发报文,若是,则去掉封装信息,然后判断是否为压缩信息,若否则直接读取原文,结束此次报文处理;若是压缩信息,则处理设备可以对该信息进行恢复处理。参见图14,处理设备可以先去掉T和L字段,然后判断是否为基于压缩模板进行压缩,若否则原文恢复报文,然后添加二层头并判断报文是否结束;若是基于压缩模板进行压缩,则先恢复固定值信息,然后恢复必要传输信息FP,随后判断是否为可选压缩字段,若是则基于不同的DATA类型进行相应的恢复,若否则基于BM标识进行相应的恢复。具体如下:After receiving the compressed message information processed above, the target message node can restore the information as shown in Figure 14. After receiving the information, you can first determine whether it is a DNS tunnel forwarding message. If so, remove the encapsulation information, and then determine whether it is compressed information. If not, directly read the original text and end the message processing; if it is compressed information, process The device can recover this information. Referring to Figure 14, the processing device can first remove the T and L fields, and then determine whether the compression is based on the compression template. If not, restore the original text of the message, then add a layer 2 header and determine whether the message ends; if the compression is based on the compression template, Then restore the fixed value information first, then restore the necessary transmission information FP, and then determine whether it is an optional compression field. If so, perform corresponding restoration based on different DATA types. If not, perform corresponding restoration based on the BM identifier. details as follows:

如果对应BM位=0,用默认值恢复。If the corresponding BM bit = 0, restore it to the default value.

如果对应BM位=1,用VP恢复。If the corresponding BM bit = 1, use VP to restore.

如果token+data中data是原文,用data恢复报文;If data in token+data is the original text, use data to restore the message;

如果token+data中data是字典指针,用data去检索字典,用字典返回值恢复报文;If data in token+data is a dictionary pointer, use data to retrieve the dictionary, and use the dictionary return value to restore the message;

如果含有多个VP,将每个VP恢复报文拼接起来。If it contains multiple VPs, concatenate each VP recovery message.

将VP字段部分压缩例子:QNAME=baidu.com拆分成2个VP解压缩过程:Example of partially compressing the VP field: QNAME=baidu.com is split into 2 VP decompression processes:

a.先用字典指针VP0 data去检索字典,用字典返回值baidu恢复QNAME第一部分;a. First use the dictionary pointer VP0 data to retrieve the dictionary, and use the dictionary return value baidu to restore the first part of QNAME;

b.再用VP1 data原文恢复QNAME第二部分:.com;b. Then use the original VP1 data to restore the second part of QNAME: .com;

c.将baidu和.com拼接起来,恢复出QNAME=baidu.com。c. Splice baidu and .com together and restore QNAME=baidu.com.

针对信息中的可计算信息,处理设备可以按照协议定义进行计算和添加。For the computable information in the information, the processing device can calculate and add according to the protocol definition.

a.IP头里的total length是恢复模板的字节长度。a.The total length in the IP header is the byte length of the recovery template.

b.IP头添加header checksum:对整个IP头部进行二进制反码求和。b. Add header checksum to the IP header: perform binary complement summation of the entire IP header.

c.UDP头里的total length是恢复模板中UDP头加DNS部分的字节长度。c.The total length in the UDP header is the length in bytes of the UDP header plus the DNS part in the recovery template.

d.UDP头里添加checksum:对UDP伪首部,UDP头和UDP数据三部分进行二进制反码求和。d. Add checksum to the UDP header: perform a binary complement sum of the three parts of the UDP pseudo-header, UDP header and UDP data.

e.DNS部分添加附加资源记录的数量:计算恢复模板中ADD_RR含有多少个资源记录。e. Number of additional resource records added to the DNS part: Calculate how many resource records ADD_RR contains in the recovery template.

将模板压缩PB恢复出UDP格式DNS报文信息后,添加二层头,恢复原始DNS请求报文模板,如图16所示。二层头中lenth\type=0800h,表示是Ipv4报文。After compressing the template PB to recover the UDP format DNS message information, add a Layer 2 header and restore the original DNS request message template, as shown in Figure 16. Lenth\type=0800h in the Layer 2 header indicates an Ipv4 message.

对于非模板压缩报文,处理设备可以在nc前添加二层头,恢复原始DNS请求报文,如图17所示。二层头中lenth\type要根据nc前4bit(1st_4bits)填充。如果是Ipv4报文,即1st_4bits=4,lenth\type=0800h;如果是Ipv6报文,即1st_4bits=6,lenth\type=86ddh。For non-template compressed packets, the processing device can add a Layer 2 header before nc to restore the original DNS request packet, as shown in Figure 17. The lenth\type in the second-layer header should be filled according to the first 4 bits of nc (1st_4bits). If it is an Ipv4 message, 1st_4bits=4, lenth\type=0800h; if it is an Ipv6 message, 1st_4bits=6, lenth\type=86ddh.

针对上述实施例提供的一种报文处理方法,本申请实施例还提供了一种报文处理装置,参见图18,图18为本申请实施例提供的一种报文处理装置1800的结构框图,该装置1800包括获取单元1801、第一确定单元1802、第二确定单元1803和第一传输单元1804:Regarding the message processing method provided by the above embodiment, the embodiment of the present application also provides a message processing device. See Figure 18. Figure 18 is a structural block diagram of a message processing device 1800 provided by the embodiment of the present application. , the device 1800 includes an acquisition unit 1801, a first determination unit 1802, a second determination unit 1803 and a first transmission unit 1804:

获取单元1801,用于获取待传输报文信息;Obtaining unit 1801, used to obtain message information to be transmitted;

第一确定单元1802,用于确定所述待传输报文信息中的必要传输信息和非必要传输信息,所述非必要传输信息为所述待传输报文信息的信息类型对应的固定值信息,和基于所述待传输报文信息中的其它信息所确定的信息,所述必要传输信息包括所述待传输报文信息中除所述非必要传输信息之外的其它信息;The first determining unit 1802 is used to determine necessary transmission information and non-essential transmission information in the message information to be transmitted, where the non-essential transmission information is fixed value information corresponding to the information type of the message information to be transmitted, and information determined based on other information in the message information to be transmitted, where the necessary transmission information includes other information in the message information to be transmitted except for the non-essential transmission information;

第二确定单元1803,用于根据所述必要传输信息确定所述待传输报文信息对应的压缩报文信息;The second determining unit 1803 is configured to determine the compressed message information corresponding to the message information to be transmitted according to the necessary transmission information;

第一传输单元1804,用于向所述待传输报文信息对应的目标报文节点传输所述压缩报文信息,使所述目标报文节点基于所述压缩报文信息还原得到所述待传输报文信息。The first transmission unit 1804 is used to transmit the compressed message information to the target message node corresponding to the message information to be transmitted, so that the target message node restores the message to be transmitted based on the compressed message information. Message information.

在一种可能的实现方式中,所述装置还包括第三确定单元:In a possible implementation, the device further includes a third determining unit:

第三确定单元,用于确定所述信息类型对应的压缩模板,所述压缩模板用于标识所述信息类型的信息中的各个信息部分是否必须传输;The third determination unit is used to determine the compression template corresponding to the information type, and the compression template is used to identify whether each information part in the information of the information type must be transmitted;

第一确定单元1802,具体用于:The first determining unit 1802 is specifically used for:

响应于所述待传输报文信息符合所述压缩模板,根据所述压缩模板确定所述待传输报文信息中的必要传输信息和非必要传输信息。In response to the message information to be transmitted complying with the compression template, necessary transmission information and unnecessary transmission information in the message information to be transmitted are determined according to the compression template.

在一种可能的实现方式中,第一确定单元1802具体用于:In a possible implementation, the first determining unit 1802 is specifically used to:

响应于所述待传输报文信息不符合所述压缩模板,确定所述待传输报文信息中的封装信息,所述封装信息用于发送所述待传输报文信息;In response to the message information to be transmitted not complying with the compression template, determining the encapsulation information in the message information to be transmitted, the encapsulation information being used to send the message information to be transmitted;

将所述待传输报文信息中除所述封装信息外的信息部分确定为所述待传输报文信息对应的必要传输信息。The information part of the message information to be transmitted except the encapsulation information is determined as the necessary transmission information corresponding to the message information to be transmitted.

在一种可能的实现方式中,所述装置还包括第四确定单元:In a possible implementation, the device further includes a fourth determining unit:

第四确定单元,用于确定所述非必要传输信息中基于所述待传输报文信息中的其它信息所确定的可计算信息;A fourth determination unit, configured to determine the computable information in the unnecessary transmission information determined based on other information in the message information to be transmitted;

第二确定单元1803具体用于:The second determination unit 1803 is specifically used to:

根据所述可计算信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息。According to the computable information and the necessary transmission information, the compressed message information corresponding to the message information to be transmitted is determined.

在一种可能的实现方式中,第二确定单元1803具体用于:In a possible implementation, the second determining unit 1803 is specifically used to:

根据压缩字典,确定所述可计算信息中的不可压缩信息和可压缩信息,所述可压缩信息为在所述压缩字典中具有对应压缩内容的信息,所述不可压缩信息为在所述压缩字典中不具有对应压缩内容的信息;According to the compression dictionary, determine the incompressible information and the compressible information in the computable information, the compressible information is the information with corresponding compressed content in the compression dictionary, and the incompressible information is the information in the compression dictionary There is no information corresponding to the compressed content;

根据所述压缩字典将所述可压缩信息压缩为目标压缩信息;compress the compressible information into target compressed information according to the compression dictionary;

根据所述目标压缩信息、所述不可压缩信息和所述必要传输信息,确定所述待传输报文信息对应的压缩报文信息。According to the target compression information, the incompressible information and the necessary transmission information, the compressed message information corresponding to the message information to be transmitted is determined.

在一种可能的实现方式中,所述装置还包括第五确定单元和第二传输单元:In a possible implementation, the device further includes a fifth determination unit and a second transmission unit:

第五确定单元,用于确定所述压缩报文信息对应的信息内容标识,所述信息内容标识用于标识所述可计算信息中的各个信息部分是否添加到所述压缩报文信息中,以及用于标识所述固定值信息中的各个信息部分是否添加到所述压缩报文信息中;The fifth determination unit is used to determine the information content identifier corresponding to the compressed message information. The information content identifier is used to identify whether each information part in the computable information is added to the compressed message information, and Used to identify whether each information part in the fixed value information is added to the compressed message information;

第二传输单元,用于向所述目标报文节点传输所述信息内容标识。The second transmission unit is used to transmit the information content identifier to the target message node.

在一种可能的实现方式中,所述待传输报文信息为多条待传输报文信息中的任意一条,所述多条待传输报文信息对应于相同的目标报文节点,所述装置还包括第六确定单元和拼接单元:In a possible implementation, the message information to be transmitted is any one of multiple pieces of message information to be transmitted, and the multiple pieces of message information to be transmitted correspond to the same target message node, and the device Also includes a sixth determination unit and a splicing unit:

第六确定单元,用于确定所述多条待传输报文信息分别对应的压缩报文信息:The sixth determination unit is used to determine the compressed message information corresponding to the multiple pieces of message information to be transmitted:

拼接单元,用于将所述多条待传输报文信息分别对应的压缩报文信息进行拼接处理,得到综合报文信息,其中,一条所述综合报文信息对应于一套目标封装信息,所述目标封装信息用于将所述综合报文信息传输至所述目标报文节点;A splicing unit is used to splice the compressed message information corresponding to the plurality of pieces of message information to be transmitted to obtain comprehensive message information, wherein one piece of the comprehensive message information corresponds to a set of target encapsulation information, so The target encapsulation information is used to transmit the comprehensive message information to the target message node;

第一传输单元1804具体用于:The first transmission unit 1804 is specifically used for:

向所述目标报文节点传输所述综合报文信息,使所述目标报文节点基于所述综合报文信息还原得到所述多条待传输报文信息。The comprehensive message information is transmitted to the target message node, so that the target message node restores and obtains the plurality of message information to be transmitted based on the comprehensive message information.

在一种可能的实现方式中,拼接单元具体用于:In a possible implementation, the splicing unit is specifically used for:

确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间;Determine the total amount of information corresponding to the spliced compressed message information, and the time taken for splicing;

响应于所述总信息量未超过信息量发送阈值,且所述拼接所用时间未超过信息发送时间阈值,获取待拼接的目标压缩报文信息进行信息拼接;In response to the total amount of information not exceeding the information amount sending threshold and the time used for splicing not exceeding the information sending time threshold, obtaining the target compressed message information to be spliced for information splicing;

在所述目标压缩报文信息拼接完成后,重新执行所述确定已拼接压缩报文信息对应的总信息量,以及拼接所用时间的步骤;After the splicing of the target compressed message information is completed, re-execute the step of determining the total amount of information corresponding to the spliced compressed message information and the time used for splicing;

响应于所述总信息量超过所述信息量发送阈值,或所述拼接所用时间超过所述信息发送时间阈值,将已拼接压缩报文信息确定为所述综合报文信息。In response to the total information amount exceeding the information amount sending threshold, or the splicing time exceeding the information sending time threshold, the spliced compressed message information is determined to be the comprehensive message information.

在一种可能的实现方式中,所述待传输报文信息为DNS报文信息。In a possible implementation manner, the message information to be transmitted is DNS message information.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:只读存储器(英文:read-only memory,缩写:ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed through hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, the execution includes: The steps of the above method embodiment; and the aforementioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviation: ROM), RAM, magnetic disk or optical disk, etc., which can store The medium for program code.

需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. at. In particular, the device and system embodiments are described simply because they are basically similar to the method embodiments. For relevant details, please refer to the partial description of the method embodiments. The device and system embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Persons of ordinary skill in the art can understand and implement the method without any creative effort.

以上所述,仅为本申请的一种具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。The above is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or modifications within the technical scope disclosed in the present application. Replacements shall be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (9)

1. A method for processing a message, the method comprising:
acquiring message information to be transmitted;
determining a compression template corresponding to an information type, wherein the compression template is used for identifying whether each information part in the information of the information type must be transmitted or not;
responding to the message information to be transmitted to conform to the compression template, determining necessary transmission information and unnecessary transmission information in the message information to be transmitted according to the compression template, wherein the unnecessary transmission information is fixed value information corresponding to the information type of the message information to be transmitted and information determined based on other information in the message information to be transmitted, and the necessary transmission information comprises other information except the unnecessary transmission information in the message information to be transmitted;
determining compressed message information corresponding to the message information to be transmitted according to the necessary transmission information;
transmitting the compressed message information to the target message node corresponding to the message information to be transmitted, and enabling the target message node to restore the message information to be transmitted based on the compressed message information.
2. The method according to claim 1, wherein the method further comprises:
Determining encapsulation information in the message information to be transmitted in response to the message information to be transmitted not conforming to the compression template, wherein the encapsulation information is used for sending the message information to be transmitted;
and determining the information parts except the encapsulation information in the message information to be transmitted as necessary transmission information corresponding to the message information to be transmitted.
3. The method according to claim 1, wherein the method further comprises:
determining the calculable information which is determined based on other information in the message information to be transmitted in the unnecessary transmission information;
the determining compressed message information corresponding to the message information to be transmitted according to the necessary transmission information includes:
and determining compressed message information corresponding to the message information to be transmitted according to the computable information and the necessary transmission information.
4. The method according to claim 3, wherein determining compressed message information corresponding to the message information to be transmitted according to the calculable information and the necessary transmission information includes:
according to a compression dictionary, determining incompressible information and compressible information in the computable information, wherein the compressible information is information with corresponding compression content in the compression dictionary, and the incompressible information is information without corresponding compression content in the compression dictionary;
Compressing the compressible information into target compressed information according to the compression dictionary;
and determining compressed message information corresponding to the message information to be transmitted according to the target compressed information, the incompressible information and the necessary transmission information.
5. A method according to claim 3, characterized in that the method further comprises:
determining an information content identifier corresponding to the compressed message information, wherein the information content identifier is used for identifying whether each information part in the calculable information is added to the compressed message information or not and identifying whether each information part in the fixed value information is added to the compressed message information or not;
and transmitting the information content identification to the target message node.
6. The method of claim 1, wherein the message information to be transmitted is any one of a plurality of pieces of message information to be transmitted, the plurality of pieces of message information to be transmitted corresponding to the same target message node, the method further comprising:
determining compressed message information corresponding to the message information to be transmitted respectively:
splicing the compressed message information respectively corresponding to the message information to be transmitted to obtain comprehensive message information, wherein one piece of the comprehensive message information corresponds to a set of target encapsulation information, and the target encapsulation information is used for transmitting the comprehensive message information to the target message node;
The transmitting the compressed message information to the target message node corresponding to the message information to be transmitted comprises the following steps:
and transmitting the comprehensive message information to the target message node, and enabling the target message node to restore the plurality of pieces of message information to be transmitted based on the comprehensive message information.
7. The method of claim 6, wherein the splicing the compressed message information corresponding to each of the plurality of pieces of message information to be transmitted to obtain the integrated message information includes:
determining the total information quantity corresponding to the spliced compressed message information and the time used for splicing;
responding to the total information quantity not exceeding the information quantity sending threshold value and the time used for splicing not exceeding the information sending time threshold value, acquiring target compressed message information to be spliced and carrying out information splicing;
after the target compressed message information is spliced, re-executing the step of determining the total information quantity corresponding to the spliced compressed message information and the time for splicing;
and determining the spliced compressed message information as the comprehensive message information in response to the total information amount exceeding the information amount sending threshold or the time used for splicing exceeding the information sending time threshold.
8. The method of claim 1, wherein the message information to be transmitted is DNS message information.
9. The device for processing the message is characterized by comprising an acquisition unit, a third determination unit, a first determination unit, a second determination unit and a first transmission unit:
the acquisition unit is used for acquiring the message information to be transmitted;
a third determining unit, configured to determine a compression template corresponding to an information type, where the compression template is used to identify whether each information part in information of the information type must be transmitted;
the first determining unit is configured to determine, according to the compression template, necessary transmission information and unnecessary transmission information in the to-be-transmitted message information in response to the to-be-transmitted message information conforming to the compression template, where the unnecessary transmission information is fixed value information corresponding to an information type of the to-be-transmitted message information, and information determined based on other information in the to-be-transmitted message information, and the necessary transmission information includes other information except the unnecessary transmission information in the to-be-transmitted message information;
the second determining unit is configured to determine compressed message information corresponding to the message information to be transmitted according to the necessary transmission information;
The first transmission unit is configured to transmit the compressed message information to a target message node corresponding to the message information to be transmitted, so that the target message node restores the compressed message information to obtain the message information to be transmitted.
CN202111300857.1A 2021-11-04 2021-11-04 Message processing method and related device Active CN113890897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111300857.1A CN113890897B (en) 2021-11-04 2021-11-04 Message processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111300857.1A CN113890897B (en) 2021-11-04 2021-11-04 Message processing method and related device

Publications (2)

Publication Number Publication Date
CN113890897A CN113890897A (en) 2022-01-04
CN113890897B true CN113890897B (en) 2023-11-17

Family

ID=79016913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111300857.1A Active CN113890897B (en) 2021-11-04 2021-11-04 Message processing method and related device

Country Status (1)

Country Link
CN (1) CN113890897B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567608B (en) * 2022-03-31 2024-02-02 中国工商银行股份有限公司 Mirror image message transmission method and system
CN115002835A (en) * 2022-06-30 2022-09-02 商飞软件有限公司 Compression and transmission method of aircraft position information based on Beidou system

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2353263A1 (en) * 2000-09-07 2002-03-07 Carsten Burmeister Method and apparatus for transmitting data packets
CN1471282A (en) * 2002-07-24 2004-01-28 华为技术有限公司 A message transmission method based on multi-protocol label switching network
CN101163095A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 IP packet compression method for terminal-to-terminal link transmission
CN101170487A (en) * 2006-10-25 2008-04-30 华为技术有限公司 Compression method, compression system and compression equipment in data stream multiplexing
CN101621472A (en) * 2009-07-30 2010-01-06 杭州华三通信技术有限公司 Message transmission method and router
WO2014135038A1 (en) * 2013-03-04 2014-09-12 华为技术有限公司 Packet transmission method and device based on pcie bus
CN106506331A (en) * 2016-10-26 2017-03-15 宁波菊风系统软件有限公司 A kind of text message transmission method of low latency
CN106993311A (en) * 2017-05-19 2017-07-28 京信通信系统(中国)有限公司 Base station data optimized transmission method and system
CN107820327A (en) * 2017-10-27 2018-03-20 京信通信系统(中国)有限公司 Data uplink, the method and system of downlink transfer and LTE network Transmission system
CN108696899A (en) * 2017-04-07 2018-10-23 北京京东尚科信息技术有限公司 Sip message transmits and method of reseptance and transmission and reception device
CN108880875A (en) * 2018-06-06 2018-11-23 新华三技术有限公司 The transmission method and device of log message
CN109936492A (en) * 2017-12-15 2019-06-25 华为技术有限公司 A method, device and system for transmitting message through tunnel
CN111107051A (en) * 2019-11-01 2020-05-05 京信通信系统(中国)有限公司 Message transmission method and device, computer equipment and storage medium
CN111510155A (en) * 2020-04-17 2020-08-07 深圳市科思科技股份有限公司 Data compression method, data decompression method, electronic device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102300256B (en) * 2010-06-22 2014-06-18 电信科学技术研究院 Method and device for feeding back header compression and feedback information
US9769701B2 (en) * 2013-06-14 2017-09-19 Texas Instruments Incorporated Header compression for wireless backhaul systems

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2353263A1 (en) * 2000-09-07 2002-03-07 Carsten Burmeister Method and apparatus for transmitting data packets
CN1471282A (en) * 2002-07-24 2004-01-28 华为技术有限公司 A message transmission method based on multi-protocol label switching network
CN101163095A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 IP packet compression method for terminal-to-terminal link transmission
CN101170487A (en) * 2006-10-25 2008-04-30 华为技术有限公司 Compression method, compression system and compression equipment in data stream multiplexing
CN101621472A (en) * 2009-07-30 2010-01-06 杭州华三通信技术有限公司 Message transmission method and router
WO2014135038A1 (en) * 2013-03-04 2014-09-12 华为技术有限公司 Packet transmission method and device based on pcie bus
CN106506331A (en) * 2016-10-26 2017-03-15 宁波菊风系统软件有限公司 A kind of text message transmission method of low latency
CN108696899A (en) * 2017-04-07 2018-10-23 北京京东尚科信息技术有限公司 Sip message transmits and method of reseptance and transmission and reception device
CN106993311A (en) * 2017-05-19 2017-07-28 京信通信系统(中国)有限公司 Base station data optimized transmission method and system
CN107820327A (en) * 2017-10-27 2018-03-20 京信通信系统(中国)有限公司 Data uplink, the method and system of downlink transfer and LTE network Transmission system
CN109936492A (en) * 2017-12-15 2019-06-25 华为技术有限公司 A method, device and system for transmitting message through tunnel
CN108880875A (en) * 2018-06-06 2018-11-23 新华三技术有限公司 The transmission method and device of log message
CN111107051A (en) * 2019-11-01 2020-05-05 京信通信系统(中国)有限公司 Message transmission method and device, computer equipment and storage medium
CN111510155A (en) * 2020-04-17 2020-08-07 深圳市科思科技股份有限公司 Data compression method, data decompression method, electronic device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Optimising the Use of Robust Header Compression Profiles in NEMO Networks";Priyanka Rawat;《IEEE》;全文 *
聂绍迪等."基于STL的头压缩算法的实现".《铁路计算机应用》.2008,第17卷(第3期),全文. *

Also Published As

Publication number Publication date
CN113890897A (en) 2022-01-04

Similar Documents

Publication Publication Date Title
CN113890897B (en) Message processing method and related device
US20030051045A1 (en) Methods and apparatus for reducing frame overhead on local area networks
CN112311789A (en) Deep packet processing method and device, electronic device and storage medium
CN1937541B (en) Network performance test method
CN101360046B (en) Bandwidth resource saving method
CN111371887B (en) Internet of things log transmission method, client, server, equipment and storage medium
CN107231269B (en) Accurate cluster speed limiting method and device
EP4057576A1 (en) Packet encapsulating method and apparatus, and packet decapsulating method and apparatus
CN112436998A (en) Data transmission method and electronic equipment
US10834179B2 (en) Load balancing
CN114157716B (en) Block chain-based data processing method and device and electronic equipment
CN100454900C (en) Method and system for quickly responding to IP fragmentation packets
US6963568B2 (en) Method for transmitting data packets, method for receiving data packets, data packet transmitter device, data packet receiver device and network including such devices
WO2002051077A1 (en) A method and system for distinguishing higher layer protocols of the internet traffic
CN108737347B (en) Data communication method, device and equipment
JP2005252855A (en) Apparatus and method of handling header-compressed packet
JP3017217B1 (en) IPv4-IPv6 conversion device
JP2019193201A (en) Device, method and program for packet acquisition
CN114979090A (en) IPv6 data packet processing method, device, computer equipment and storage medium
CN114205425A (en) A message transmission method, device, device and readable storage medium
US20240259307A1 (en) Stateless proxy gateway for segment routing
EP3829134B1 (en) Method for transferring large amounts of data through a telematic network in an efficient and reliable manner and at high-speed
CN110650079B (en) Information transmission method, device, terminal, system and storage medium
CN111064791B (en) Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message
CN116668551A (en) Data transmission method and device in data transmission network

Legal Events

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