WO2011015089A1 - Method and apparatus for self-adaptive coding and decoding - Google Patents

Method and apparatus for self-adaptive coding and decoding Download PDF

Info

Publication number
WO2011015089A1
WO2011015089A1 PCT/CN2010/074029 CN2010074029W WO2011015089A1 WO 2011015089 A1 WO2011015089 A1 WO 2011015089A1 CN 2010074029 W CN2010074029 W CN 2010074029W WO 2011015089 A1 WO2011015089 A1 WO 2011015089A1
Authority
WO
WIPO (PCT)
Prior art keywords
avp
information
message
code stream
related information
Prior art date
Application number
PCT/CN2010/074029
Other languages
French (fr)
Chinese (zh)
Inventor
陈刚
甘斌
杨红梅
徐键
何飞
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011015089A1 publication Critical patent/WO2011015089A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Definitions

  • the present invention relates to adaptive coding/decoding techniques, and more particularly to a method and apparatus for adaptive coding/decoding. Background technique
  • Diameter protocol Based on the Radius (Remote Authentication Dial In User Service) protocol, the Diameter protocol has evolved into a next-generation authentication, authorization, and accounting (AAA, Authentication, Authorization 3 ⁇ 4 Accounting, ) protocol standard. widely used.
  • AAA Authentication, Authorization 3 ⁇ 4 Accounting
  • the Diameter protocol family includes the Diameter basic protocol and some extended application protocols, such as the Network Access Service (NAS) protocol, the Extensible Authentication Protocol (EAP), the Mobile IP (MIP, Mobile IP) protocol, and the password. CMS (Cryptographic Message Syntax) protocol, Session Initiation Protocol (SIP) application protocol. In addition, vendors are allowed to extend the protocol AVP as needed.
  • NAS Network Access Service
  • EAP Extensible Authentication Protocol
  • MIP Mobile IP
  • CMS Session Initiation Protocol
  • SIP Session Initiation Protocol
  • vendors are allowed to extend the protocol AVP as needed.
  • Diameter messages in each specific scenario have different composition structures, and even the same interface Diameter messages are slightly different in different applications, which gives version compatibility and products. Docking has an impact.
  • Diameter message includes different attribute value pairs (AVPs), which are generally differentiated according to applications, and provide codec solutions corresponding to message structures according to different message structures, such as Figure 1 shows.
  • AVPs attribute value pairs
  • this processing method can satisfy the processing requirements of the Diameter message for the upper layer application, but for the codec part, this part
  • the code needs to be updated according to the extension of the new application, which is not conducive to the expansion of the Diameter message by the new application, does not have reusability, and the message structure of multiple identical Diameter messages exists in different applications at the same time, which is easy to cause confusion and error.
  • the present invention provides an adaptive encoding/decoding method and apparatus for solving the problem that the codec process in the prior art cannot adapt to different applications, different interfaces, different Diameter messages, different vendor definitions, different versions, etc., thereby resulting in message definition. Inflexible and prone to conflicts.
  • An adaptive coding method provided by the present invention includes:
  • the Diameter message code stream is generated according to the application related information and the AVP related information.
  • the application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and start location information;
  • the runtime coding configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
  • the coding method provided by the invention further has the following features:
  • the runtime encoding configuration table is generated as follows:
  • Reading the document to be encoded selecting the message of each interface application and related AVP information according to the extended Bacchus formula rule of the Diameter protocol, and converting the application message and related AVP information into a standard file;
  • Diameter protocol data configuration management process to read the binary code stream in the memory area, and converting the binary code stream into an encoding configuration table according to a message composition format
  • the data read from the encoding configuration table is reorganized into a runtime encoding configuration table by the Diameter protocol process according to the application supported by the project.
  • the network management system When the AMS adjustment command is received by the foreground, the network management system notifies the Diameter protocol data configuration management process to modify the coding configuration table, and after the modification of the coding configuration table is completed, the related modification is performed by using the Diameter protocol process. Partially synchronized to the runtime encoding configuration table.
  • the generating the Diameter message code stream according to the application related information and the AVP related information is specifically:
  • the invention also provides an adaptive decoding method, comprising:
  • the AVP information calculated by the configuration information and the relevant parameters required for decoding is stored in an absolute position.
  • the relevant parameters required for the decoding include: an application ID, a Diameter message code, a Diameter message length information, a Diameter message code stream start position information, and a decoded message structure. Start location information.
  • runtime decoding configuration table is generated by:
  • Reading the document to be decoded selecting the message of each interface application and related AVP information according to the extended Bacchus formula rule of the Diameter protocol, and converting the application message and related AVP information into a standard file;
  • Diameter protocol data configuration management process to read the binary code stream in the memory area, and converting the binary code stream into a decoding configuration table according to a message composition format
  • the data read from the decoding configuration table is reorganized into a runtime decoding configuration table according to the application supported by the project using the Diameter protocol process.
  • the network management system When the AMS adjustment command is received by the foreground, the network management system notifies the Diameter protocol data configuration management process to modify the decoding configuration table, and after the modification of the decoding configuration table is completed, the related modification is performed by using the Diameter protocol process. Partial synchronization to the runtime decoding configuration table.
  • the invention also provides an apparatus for adaptive coding, comprising:
  • An encoding message receiving unit configured to receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP;
  • a first AVP configuration information acquiring unit configured to search a pre-generated runtime coding configuration table according to the AVP related information acquired by the encoding message receiving unit, and obtain AVP configuration information corresponding to the AVP related information;
  • a coding unit configured to perform legality verification on the AVP related information according to the AVP configuration information, and when the related information of the AVP is legal, organize a Diameter message code according to the application related information and the AVP related information. flow.
  • the invention also provides an apparatus for adaptive decoding, comprising: a decoding message receiving unit, configured to receive a Diameter message code stream to be decoded, and parse the code stream header information to obtain a related parameter required for decoding;
  • a second AVP configuration information acquiring unit configured to search a pre-generated runtime decoding configuration table according to the related parameters acquired by the decoding message receiving unit, to obtain AVP configuration information
  • a decoding unit configured to perform validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information, and fill in the AVP related information corresponding to the AVP code stream when the AVP code stream is legal
  • the AVP information calculated according to the AVP configuration information and the relevant parameters required for decoding is stored in an absolute position.
  • the present invention has the following advantages:
  • the method provided by the invention can flexibly generate a runtime codec configuration table according to an existing standard document, and the configuration table can adapt different application requirements in codec processing according to different items, avoiding conflicts of applications, and improving the editing.
  • the reusability of the core components of the decoding process facilitates the expansion of new Diameter applications.
  • the present invention also solves the problem of distinguishing between the message structures without causing confusion between message structures in the case of supporting multiple applications with the same Diameter message code.
  • FIG. 1 is a schematic diagram of a codec working principle of simultaneously supporting the same Diameter message in multiple applications in the prior art
  • FIG. 2A is a flowchart of an adaptive coding method provided by the present invention.
  • 2B is a flowchart of an adaptive decoding method provided by the present invention.
  • FIG. 3 is a flowchart of acquiring a codec configuration table in a runtime according to an embodiment of the present invention
  • 4 is a flowchart of dynamically adjusting a codec configuration table in a running manner according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of an operation principle of an adaptive codec according to an embodiment of the present invention
  • FIG. 6 is a flowchart of adaptive coding in an embodiment of the present invention.
  • FIG. 8 is a structural diagram of an adaptive coding apparatus according to the present invention.
  • FIG. 9 is a structural diagram of an adaptive decoding apparatus according to the present invention. detailed description
  • the codec process cannot adapt to different applications, different interfaces, different Diameter messages, different vendor definitions, different versions, and the like, thereby resulting in inflexible message definition and conflicts.
  • the core idea of the coding/decoding method and device is to define a corresponding runtime codec configuration table according to the requirements of each application.
  • the configuration table can be dynamically acquired and dynamically adjusted, and the codec configuration data and the specific application interface are effectively realized.
  • the codec is automatically separated.
  • an adaptive coding method provided by the present invention specifically includes the following steps:
  • Step S2A01 Receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP.
  • the application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and a start location information.
  • Step S2A02 Search for a pre-generated runtime code according to the obtained information about the AVP.
  • the configuration table obtains the AVP configuration information corresponding to the AVP related information.
  • the runtime coding configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
  • runtime coding configuration table is specifically generated by:
  • the Diameter protocol data configuration management process is notified to modify the coding configuration table, and after the modification of the coding configuration table is completed, the related modification part is synchronized to the operation by using the Diameter protocol process. Time code configuration table.
  • Step S2A03 Perform legality verification on the AVP related information according to the AVP configuration information.
  • the AVP related information is legal
  • the Diameter message code stream is generated according to the application related information and the AVP related information.
  • the generating the Diameter message code stream according to the application related information and the AVP related information is specifically implemented by: generating a Diameter message header code stream according to the application related information, and generating an AVP code stream according to the AVP related information, and the Diameter is generated.
  • the message header stream and all AVP streams are combined into a Diameter message stream.
  • the present invention further provides an adaptive decoding method. As shown in FIG. 2B, the method includes the following steps: Step S2B01: After receiving a Diameter message code stream to be decoded, parsing the code stream header signal Information, get the relevant parameters required for decoding.
  • the relevant parameters required for decoding include: an application ID, a Diameter message code, a Diameter message length information, a Diameter message code stream start position information, and a decoded message structure storage start position information.
  • Step S2B02 Search for a pre-generated runtime decoding configuration table according to the obtained related parameters, and obtain AVP configuration information.
  • the runtime decoding configuration table is specifically generated by:
  • the Diameter protocol data configuration management process is notified to modify the decoding configuration table. After the modification of the decoding configuration table is completed, the Diameter protocol process synchronizes the relevant modification part to the runtime decoding configuration table. .
  • Step S2B03 Perform validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information.
  • the AVP code stream is legal, fill in the AVP related information corresponding to the AVP code stream to the AVP configuration information according to the AVP configuration information.
  • the AVP information calculated by the parameter stores the absolute position.
  • the codec method provided by the invention can flexibly generate a runtime codec configuration table according to an existing standard document, and the configuration table can adapt to different coding and decoding processes according to different items. With the requirement, the conflicts of various applications are avoided, the reusability of the core components of the codec processing is improved, and the new Diameter application is facilitated. At the same time, the present invention also solves the problem of distinguishing between the message structures without causing confusion between message structures in the case of supporting multiple applications with the same Diameter message code.
  • a method for generating a runtime codec configuration table used in the adaptive codec process is described in detail. As shown in FIG. 3, a runtime codec is generated according to an embodiment of the present invention.
  • the configuration table flowchart includes the following steps:
  • Step S301 Scan an RFC/3GPP document that needs to be codec according to an extended Bacchus paradigm (ABNF) rule of the Diameter protocol, and convert an application message conforming to the rule into a standard file, such as an Extensible Markup Language (XML). )file.
  • ABNF extended Bacchus paradigm
  • XML Extensible Markup Language
  • Step S302 Continue scanning the document, and convert related AVP information conforming to the ABNF rule into a standard file, such as an XML file.
  • Step S303 The Operations Maintenance Center (OMC) performs the Diameter protocol validity check according to the generated XML format file. If the validity check is passed, the process continues to step S305; otherwise, step S304 is performed. .
  • OMC Operations Maintenance Center
  • Step S304 When the validity check fails, there may be some AVP definitions that have been defined in other documents that the protocol depends on. At this time, the XML implementation file of the AVP definition is already existing by reference or the AVP definition is manually added, and then returned. Step S303.
  • step S305 the OMC transmits the XML file to the version running in the foreground of the network management system.
  • the XML file is transmitted to the foreground version in two ways. First, if the front board restarts, the OMC is not required to perform data transmission. In this case, the database needs to be able to record the XML configuration.
  • the file at this point, the step is specifically performed as follows: (1) OMC stores the XML file in a binary format into the network management system database;
  • the network management system database synchronizes the XML binary code stream to the foreground data receiving process
  • the foreground Diameter protocol process reads the XML binary code stream from the foreground data receiving process, and stores the XML binary code stream in the foreground memory area.
  • the OMC synchronizes the XML binary stream to the foreground data receiving process.
  • the foreground Diameter protocol process reads all the packets of the XML binary stream from the foreground data receiving process, reassembles the XML binary stream, and stores the XML binary stream in the foreground memory area.
  • Step S306 The Diameter protocol data configuration management process reads the XML binary code stream in the foreground memory area and converts it into a codec configuration table according to the message composition format.
  • Step S307 The Diameter protocol process re-organizes the data from the codec configuration table into a runtime codec configuration table according to the application supported by the project. It should be noted that the runtime codec configuration table is used as a configuration source for protocol check, encoding, and decoding in subsequent codec.
  • the foregoing running codec configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
  • the configuration information of the application includes a Diameter message type included in the application;
  • the configuration information of the Diameter message includes: the header information of the Diameter message, the application, the project information, and the AVP type, number, relative location, whether it is mandatory, and whether it is optional.
  • the configuration information of the AVP includes: the header information of the AVP, the application, the item information, and the vendor identifier. If the AVP is a combination type, it also includes its sub-AVP type, number, relative position, whether it is mandatory, or whether it is available. Select information.
  • the above is the acquisition process of the runtime codec configuration table of the adaptive codec of the present invention
  • the configuration table can be customized according to the actual needs of each operator, each application interface, and the project, and the foreground running program does not need to be modified or adapted, effectively meeting the needs of the actual application without losing flexibility.
  • the runtime codec configuration table provided by the embodiment of the present invention can also be dynamically adjusted according to the actual environment needs, mainly according to the actual needs of different central offices of specific projects.
  • the OMC performs related messages.
  • the dynamic adjustment process is as shown in FIG. 4, and includes the following steps:
  • Step S401 The OMC performs related messages.
  • the adjustment operation command is transmitted to the foreground Diameter protocol process, and the foreground Diameter protocol process notifies the Diameter protocol data configuration management process to perform AVP adjustment.
  • the OMC saves the operation process and data changes to the database process, including:
  • the OMC saves the operation process and data changes to the NMS.
  • the database sends the operation process to the foreground Diameter protocol process to inform the AVP to adjust the situation;
  • the OMC When the AVP is dynamically added, modified, or deleted, the OMC sends the operation directly to the foreground.
  • the details include: When the AVP is dynamically added, modified, or deleted, the OMC sends the operation directly to the foreground Diameter protocol to notify the AVP. Adjust the situation.
  • Step S402 The Diameter protocol data configuration management process modifies the codec configuration table according to the specific content of the AVP adjustment notification.
  • Step S403 The Diameter protocol process synchronizes the relevant modification part to the runtime codec configuration table according to the needs of the specific application item.
  • the above is an implementation step of adjusting the runtime codec configuration table of the adaptive codec of the present invention.
  • the runtime codec configuration table can be obtained, it is necessary to perform small-scale message AVP adjustment according to the actual application requirements of different central offices, so that the application requirements of different operators can be flexibly met.
  • the invention is a powerful codec configuration table for the running codec configuration table of the adaptive codec.
  • the configuration data is automatically separated from the codec of the specific application interface, so that the present invention can implement different operators, different application interfaces, and different actualities according to the dynamic codec configuration.
  • the application needs of the project.
  • the codec process of the adaptive codec provided by the present invention is described in detail below.
  • the working principle of the adaptive codec method provided in this embodiment is shown in FIG. 5, wherein the message structure used by each application is as shown in FIG.
  • the structure includes specific AVPs according to business requirements. These AVPs are organized according to the agreed rules, and the information of an AVP has a fixed offset from the start position of the message header. Before encoding, the relevant AVP information is applied to the relative offset position of the AVP.
  • the adaptive coding process provided by the embodiment of the present invention includes the following steps:
  • Step S601 The application process invokes the encoding interface, and transmits the application related information to be encoded to the codec core component.
  • the application related information includes an application ID number, a Diameter message code, a message structure to be encoded, and a starting position of the message structure.
  • Step S602 The codec core component extracts the AVP from the message structure to be encoded, and obtains related information of the AVP.
  • Step S603 The codec core component searches for a corresponding AVP configuration information in the runtime codec configuration table according to the obtained AVP related information.
  • Step S604 the codec core component 4 checks the legality of the AVP related information acquired in step S602 according to the found AVP configuration information.
  • the legality check includes: Whether the mandatory AVP is assigned; Whether the AVP value is within the specified range;
  • Step S605 the codec core component generates a Diameter message header code stream according to the incoming parameter in step S601; generates an AVP code stream according to the AVP related information acquired in step S602, and finally merges the Diameter message header code stream and all AVP code streams. Divided into a Diameter message stream.
  • the above is the implementation of the adaptive coding in the embodiment of the present invention. Since the query configuration table is included, the AVP related information is obtained from the relative location according to the configuration table, and the message structure of the specific application does not need to be understood, and the extension of the new application is easier.
  • the adaptive decoding process provided by the embodiment of the present invention includes the following steps:
  • Step S701 The application process receives the Diameter message code stream to be decoded, and invokes a message header decoding function provided by the codec core component, and obtains information such as an application ID, a Diameter message code, and a Diameter message length from the Diameter message stream message header.
  • Step S702 The application process invokes the decoding interface, and transmits information about the related information acquired in step S701 and the start position of the Diameter message code stream and the start position of the decoded message structure to the codec core component.
  • Step S703 The codec core component searches the runtime codec configuration table according to the related information, and obtains the AVP configuration information included in the application ID and the Diameter message code, where the configuration information includes:
  • Step S704 The codec core component obtains each AVP code stream from the Diameter message code stream, and performs a legality check according to the AVP configuration information acquired in step S703. Among them, the legality check includes:
  • Step S705 The codec core component calculates the offset n of the relative position of the AVP information according to the AVP configuration information acquired in step S703, and calculates the absolute location of the AVP information storage according to the message structure storage start position m after the parameter decoding in step S702. m+n;
  • the codec core component analyzes each AVP code stream obtained in step S704, obtains the AVP value and the flag bit information, and then fills the obtained message into the absolute position of the calculated AVP information, thereby completing the decoding process.
  • the adaptive decoding implementation step of the present invention Since the query configuration table is included, the relative position of the decoded AVP value is calculated according to the AVP related information in the configuration table, and the message structure of the specific application does not need to be understood, which is easy to extend the new application.
  • the adaptive encoding/decoding method separates the codec configuration data from the codec of the specific application interface, increases the scalability of the protocol implementation, and can perform runtime coding.
  • the dynamic acquisition and dynamic adjustment of the decoding configuration table meet the application requirements of different operators, different application interfaces, and different actual projects.
  • the codec core component By querying the runtime codec configuration table, the codec core component automatically converts between the Diameter message stream and the Diameter application message structure without having to understand the Diameter application message structure.
  • This method of automatic adaptation through query configuration not only increases the reusability of the codec core components, but also improves the scalability of the diameter application message. In the case of supporting multiple applications with the same Diameter message code at the same time, Differentiating according to the configuration does not cause confusion between message structures.
  • the present invention also provides an apparatus for adaptive coding, as shown in FIG. 8, comprising:
  • the coded message receiving unit 810 is configured to receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP;
  • the first AVP configuration information acquiring unit 820 is configured to search the pre-generated runtime coding configuration table according to the information about the AVP obtained by the encoding message receiving unit 810, and obtain the AVP configuration information corresponding to the AVP related information.
  • the coding unit 830 is configured to perform validity verification on the AVP related information according to the AVP configuration information, and organize the Diameter message code stream according to the application related information and the AVP related information when the AVP related information is legal.
  • the application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and a start location information.
  • the present invention also provides an apparatus for adaptive decoding, as shown in FIG. 9, including:
  • the decoding message receiving unit 910 is configured to receive a Diameter message code stream to be decoded, and parse the code stream header information to obtain related parameters required for decoding.
  • the second AVP configuration information acquiring unit 920 is configured to search the pre-generated runtime decoding configuration table according to the related parameters acquired by the decoding message receiving unit 910, and obtain the AVP configuration information.
  • the decoding unit 930 is configured to use the AVP configuration information to the Diameter message.
  • the AVP code stream in the code stream is verified for validity.
  • the AVP information corresponding to the AVP code stream is filled in to the absolute position of the AVP information stored according to the AVP configuration information and the relevant parameters required for decoding.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present invention provides a method for self-adaptive coding, which includes: receiving application-related information to be coded, reading the message structure of the application-related information, and obtaining Attribute Value Pair (AVP)-related information; according to the AVP-related information, searching the pre-generated runtime coding configuration table, and obtaining the AVP configuration information corresponding to the AVP-related information; according to the AVP configuration information, performing validity authentication for the AVP-related information, if the AVP-related information is legal, according to the application-related information and the AVP-related information, organizing and generating a Diameter message code stream. The present invention also provides a decoding method corresponding to the above coding manner and an apparatus for implementing the above method. The present invention improves the reusability of the core component for coding and decoding processing, and facilitates the extension of new Diameter applications. Under the condition of supporting multiple applications with the same Diameter message code, differentiation is performed according to the configuration, so that the confusion problem among the message structures will not occur.

Description

一种自适应编码 /解码方法和装置 技术领域  Adaptive coding/decoding method and device
本发明涉及自适应编码 /解码技术, 尤其涉及一种自适应编码 /解码的方 法和装置。 背景技术  The present invention relates to adaptive coding/decoding techniques, and more particularly to a method and apparatus for adaptive coding/decoding. Background technique
Diameter协议在远程用户拨号认证系统 ( Radius , Remote Authentication Dial In User Service )协议的基础上发展成为下一代身份验证、 授权、 统计 ( AAA, Authentication、 Authorization ¾ Accounting, )协议标准, 正在被越 来越广泛的使用。 Based on the Radius (Remote Authentication Dial In User Service) protocol, the Diameter protocol has evolved into a next-generation authentication, authorization, and accounting (AAA, Authentication, Authorization 3⁄4 Accounting, ) protocol standard. widely used.
Diameter协议族包含 Diameter基本协议和一些扩展应用协议, 如网络 接入服务( NAS, Network Access Server )协议、可扩展鉴别( EAP, Extensible Authentication Protocol )协议、 移动 IP ( MIP, Mobile IP )协议、 密码消息 语法(CMS, Cryptographic Message Syntax )协议、 会话发起协议(SIP, session initiation protocol )应用协议等。 此外, 还允许各厂商根据需要对协 议 AVP进行扩展。  The Diameter protocol family includes the Diameter basic protocol and some extended application protocols, such as the Network Access Service (NAS) protocol, the Extensible Authentication Protocol (EAP), the Mobile IP (MIP, Mobile IP) protocol, and the password. CMS (Cryptographic Message Syntax) protocol, Session Initiation Protocol (SIP) application protocol. In addition, vendors are allowed to extend the protocol AVP as needed.
由于各种扩展应用的存在以及各厂商对协议的扩展, 使得每一种特定 场景下 Diameter消息组成结构不同, 甚至相同接口相同 Diameter消息在不 同应用下也略有差别, 这就给版本兼容以及产品对接造成影响。  Due to the existence of various extended applications and the extension of protocols by various vendors, the Diameter messages in each specific scenario have different composition structures, and even the same interface Diameter messages are slightly different in different applications, which gives version compatibility and products. Docking has an impact.
当前技术中, 对于不同应用下相同 Diameter 消息包含不同属性值对 ( AVP, Attribute Value Pair )的情况, 一般釆取按照应用进行区分, 根据消 息结构不同、 提供与消息结构对应的编解码方案, 如图 1所示。  In the current technology, for different applications, the same Diameter message includes different attribute value pairs (AVPs), which are generally differentiated according to applications, and provide codec solutions corresponding to message structures according to different message structures, such as Figure 1 shows.
根据以上分析可以看出, 这种处理方法虽然对于上层应用来说, 可以 满足自身对 Diameter消息的处理需要, 但是对于编解码部分来说, 这部分 代码需要根据新应用的扩展不断加以更新, 不利于新应用对 Diameter消息 的扩展需要, 不具有复用性, 而且不同应用下多个相同 Diameter消息的消 息结构同时存在, 容易造成混淆, 出现错误。 发明内容 According to the above analysis, this processing method can satisfy the processing requirements of the Diameter message for the upper layer application, but for the codec part, this part The code needs to be updated according to the extension of the new application, which is not conducive to the expansion of the Diameter message by the new application, does not have reusability, and the message structure of multiple identical Diameter messages exists in different applications at the same time, which is easy to cause confusion and error. Summary of the invention
本发明提供一种自适应编码 /解码方法和装置, 用以解决现有技术中编 解码过程不能自适应不同应用、 不同接口、 不同 Diameter消息、 不同厂商 定义、 不同版本等条件, 从而导致消息定义不灵活、 易产生冲突的问题。  The present invention provides an adaptive encoding/decoding method and apparatus for solving the problem that the codec process in the prior art cannot adapt to different applications, different interfaces, different Diameter messages, different vendor definitions, different versions, etc., thereby resulting in message definition. Inflexible and prone to conflicts.
本发明提供的一种自适应编码方法, 包括:  An adaptive coding method provided by the present invention includes:
接收待编码的应用相关信息, 读取所述应用相关信息的消息结构, 获 取 AVP的相关信息;  Receiving application related information to be encoded, reading a message structure of the application related information, and obtaining related information of the AVP;
根据所述 AVP的相关信息查找预先生成的运行时编码配置表, 获取与 所述 AVP相关信息对应的 AVP配置信息;  And searching for a pre-generated runtime coding configuration table according to the AVP related information, and acquiring AVP configuration information corresponding to the AVP related information;
根据所述 AVP配置信息,对所述 AVP的相关信息进行合法性验证, 在 所述 AVP的相关信息合法时,根据所述应用相关信息和 AVP的相关信息组 织生成 Diameter消息码流。  And validating the validity information of the AVP according to the AVP configuration information. When the related information of the AVP is legal, the Diameter message code stream is generated according to the application related information and the AVP related information.
其中, 所述应用相关信息包括: 应用 ID号、 Diameter消息码、 Diameter 消息长度、 待编码的消息结构和开始位置信息;  The application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and start location information;
所述运行时编码配置表包括: 应用的配置信息、 Diameter 消息的配置 信息和 AVP的配置信息。  The runtime coding configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
本发明提供的编码方法进一步具有以下特点:  The coding method provided by the invention further has the following features:
所述运行时编码配置表通过如下方式生成:  The runtime encoding configuration table is generated as follows:
读取需要编码的文档, 根据 Diameter协议的扩展巴克斯范式规则选取 各接口应用的消息和相关 AVP信息,并将所述应用的消息和相关 AVP信息 转化为标准文件;  Reading the document to be encoded, selecting the message of each interface application and related AVP information according to the extended Bacchus formula rule of the Diameter protocol, and converting the application message and related AVP information into a standard file;
将所述标准文件传输到网管系统前台, 通过前台相关进程将所述标准 文件转化为二进制码流后存储在前台内存区中; Transfer the standard file to the front end of the network management system, and pass the standard through the foreground process The file is converted into a binary stream and stored in the foreground memory area;
利用 Diameter协议数据配置管理进程读取所述内存区中的二进制码 流, 并按照消息组成格式将所述二进制码流转化为编码配置表;  Using the Diameter protocol data configuration management process to read the binary code stream in the memory area, and converting the binary code stream into an encoding configuration table according to a message composition format;
利用 Diameter协议进程根据项目支持的应用从所述编码配置表中读取 数据重新组织为运行时编码配置表。  The data read from the encoding configuration table is reorganized into a runtime encoding configuration table by the Diameter protocol process according to the application supported by the project.
其中, 所述网管系统前台接收到 AVP调整命令时 , 通知所述 Diameter 协议数据配置管理进程修改所述编码配置表, 并在所述编码配置表修改完 成后, 利用所述 Diameter协议进程将相关修改部分同步到所述运行时编码 配置表。  When the AMS adjustment command is received by the foreground, the network management system notifies the Diameter protocol data configuration management process to modify the coding configuration table, and after the modification of the coding configuration table is completed, the related modification is performed by using the Diameter protocol process. Partially synchronized to the runtime encoding configuration table.
具体的, 所述编码方法中, 根据所述应用相关信息和 AVP的相关信息 组织生成 Diameter消息码流具体为:  Specifically, in the encoding method, the generating the Diameter message code stream according to the application related information and the AVP related information is specifically:
根据所述应用相关信息生成 Diameter消息头码流,根据所述 AVP的相 关信息, 生成 AVP码流, 将所述 Diameter消息头码流和所有 AVP码流合 并组织成 Diameter消息码流。  Generating a Diameter message header code stream according to the application related information, generating an AVP code stream according to the AVP related information, and combining the Diameter message header code stream and all AVP code streams into a Diameter message code stream.
本发明还提供一种自适应解码方法, 包括:  The invention also provides an adaptive decoding method, comprising:
接收待解码的 Diameter消息码流后, 解析所述码流头部信息, 获取解 码所需相关参数;  After receiving the Diameter message code stream to be decoded, parsing the code stream header information to obtain related parameters required for decoding;
根据所述获取的相关参数查找预先生成的运行时解码配置表, 获取 AVP配置信息;  Searching the pre-generated runtime decoding configuration table according to the obtained related parameters to obtain AVP configuration information;
根据所述 AVP配置信息, 对所述 Diameter消息码流中的 AVP码流进 行合法性验证, 在所述 AVP码流合法时, 将所述 AVP码流对应的 AVP相 关信息填写到根据所述 AVP配置信息和解码所需相关参数计算出的 AVP信 息存放绝对位置。  Performing validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information, and filling in the AVP related information corresponding to the AVP code stream to the AVP according to the AVP when the AVP code stream is legal The AVP information calculated by the configuration information and the relevant parameters required for decoding is stored in an absolute position.
其中,所述解码所需相关参数包括:应用 ID、 Diameter消息码、 Diameter 消息长度信息、 Diameter 消息码流开始位置信息和解码后消息结构存放开 始位置信息。 The relevant parameters required for the decoding include: an application ID, a Diameter message code, a Diameter message length information, a Diameter message code stream start position information, and a decoded message structure. Start location information.
进一步的, 所述运行时解码配置表通过如下方式生成:  Further, the runtime decoding configuration table is generated by:
读取需要解码的文档, 根据 Diameter协议的扩展巴克斯范式规则选取 各接口应用的消息和相关 AVP信息,并将所述应用的消息和相关 AVP信息 转化为标准文件;  Reading the document to be decoded, selecting the message of each interface application and related AVP information according to the extended Bacchus formula rule of the Diameter protocol, and converting the application message and related AVP information into a standard file;
将所述标准文件传输到网管系统前台, 通过前台相关进程将所述标准 文件转化为二进制码流后存储在前台内存区中;  Transmitting the standard file to the foreground of the network management system, and converting the standard file into a binary code stream through a foreground related process, and storing the standard file in a foreground memory area;
利用 Diameter协议数据配置管理进程读取所述内存区中的二进制码 流, 并按照消息组成格式将所述二进制码流转化为解码配置表;  Using the Diameter protocol data configuration management process to read the binary code stream in the memory area, and converting the binary code stream into a decoding configuration table according to a message composition format;
利用 Diameter协议进程根据项目支持的应用从所述解码配置表中读取 数据重新组织为运行时解码配置表。  The data read from the decoding configuration table is reorganized into a runtime decoding configuration table according to the application supported by the project using the Diameter protocol process.
其中, 所述网管系统前台接收到 AVP调整命令时 , 通知所述 Diameter 协议数据配置管理进程修改所述解码配置表, 并在所述解码配置表修改完 成后, 利用所述 Diameter协议进程将相关修改部分同步到所述运行时解码 配置表。  When the AMS adjustment command is received by the foreground, the network management system notifies the Diameter protocol data configuration management process to modify the decoding configuration table, and after the modification of the decoding configuration table is completed, the related modification is performed by using the Diameter protocol process. Partial synchronization to the runtime decoding configuration table.
本发明还提供一种自适应编码的装置, 包括:  The invention also provides an apparatus for adaptive coding, comprising:
编码消息接收单元, 用于接收待编码的应用相关信息, 读取所述应用 相关信息的消息结构, 获取 AVP的相关信息;  An encoding message receiving unit, configured to receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP;
第一 AVP配置信息获取单元, 用于根据所述编码消息接收单元获取的 AVP的相关信息查找预先生成的运行时编码配置表, 获取与所述 AVP相关 信息对应的 AVP配置信息;  a first AVP configuration information acquiring unit, configured to search a pre-generated runtime coding configuration table according to the AVP related information acquired by the encoding message receiving unit, and obtain AVP configuration information corresponding to the AVP related information;
编码单元, 用于根据所述 AVP配置信息,对所述 AVP的相关信息进行 合法性验证,在所述 AVP的相关信息合法时,根据所述应用相关信息和 AVP 的相关信息组织生成 Diameter消息码流。  a coding unit, configured to perform legality verification on the AVP related information according to the AVP configuration information, and when the related information of the AVP is legal, organize a Diameter message code according to the application related information and the AVP related information. flow.
本发明还提供一种自适应解码的装置, 包括: 解码消息接收单元, 用于接收待解码的 Diameter消息码流, 并解析所 述码流头部信息, 获取解码所需相关参数; The invention also provides an apparatus for adaptive decoding, comprising: a decoding message receiving unit, configured to receive a Diameter message code stream to be decoded, and parse the code stream header information to obtain a related parameter required for decoding;
第二 AVP配置信息获取单元, 用于根据所述解码消息接收单元获取的 相关参数查找预先生成的运行时解码配置表, 获取 AVP配置信息;  a second AVP configuration information acquiring unit, configured to search a pre-generated runtime decoding configuration table according to the related parameters acquired by the decoding message receiving unit, to obtain AVP configuration information;
解码单元, 用于根据所述 AVP配置信息, 对所述 Diameter消息码流中 的 AVP码流进行合法性验证, 在所述 AVP码流合法时, 将所述 AVP码流 对应的 AVP相关信息填写到根据所述 AVP配置信息和解码所需相关参数计 算出的 AVP信息存放绝对位置。  a decoding unit, configured to perform validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information, and fill in the AVP related information corresponding to the AVP code stream when the AVP code stream is legal The AVP information calculated according to the AVP configuration information and the relevant parameters required for decoding is stored in an absolute position.
与现有技术相比, 本发明具有以下优点:  Compared with the prior art, the present invention has the following advantages:
本发明提供的方法, 能够灵活根据现有的标准文档生成运行时编解码 配置表, 该配置表能够根据不同项目在编解码处理时自适应不同应用需求, 避免了各应用的冲突, 提高了编解码处理核心部件的复用性, 有利于扩展 新的 Diameter应用。 同时, 本发明还解决了在支持多个应用相同 Diameter 消息码的情况下, 根据配置进行区分, 不至于造成消息结构间的混淆问题。 附图说明  The method provided by the invention can flexibly generate a runtime codec configuration table according to an existing standard document, and the configuration table can adapt different application requirements in codec processing according to different items, avoiding conflicts of applications, and improving the editing. The reusability of the core components of the decoding process facilitates the expansion of new Diameter applications. At the same time, the present invention also solves the problem of distinguishing between the message structures without causing confusion between message structures in the case of supporting multiple applications with the same Diameter message code. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图进行简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附 图。  In order to more clearly illustrate the embodiments of the present invention or the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1为现有技术中同时支持多个应用下相同 Diameter消息的编解码工 作原理示意图;  FIG. 1 is a schematic diagram of a codec working principle of simultaneously supporting the same Diameter message in multiple applications in the prior art; FIG.
图 2A为本发明提供的一种自适应编码方法流程图;  2A is a flowchart of an adaptive coding method provided by the present invention;
图 2B为本发明提供的一种自适应解码方法流程图;  2B is a flowchart of an adaptive decoding method provided by the present invention;
图 3为本发明实施例中运行时编解码配置表获取流程图; 图 4为本发明实施例中运行时编解码配置表动态调整流程图; 图 5为本发明实施例中自适应编解码工作原理示意图; 3 is a flowchart of acquiring a codec configuration table in a runtime according to an embodiment of the present invention; 4 is a flowchart of dynamically adjusting a codec configuration table in a running manner according to an embodiment of the present invention; FIG. 5 is a schematic diagram of an operation principle of an adaptive codec according to an embodiment of the present invention;
图 6为本发明实施例中自适应编码流程图;  6 is a flowchart of adaptive coding in an embodiment of the present invention;
图 7为本发明实施例中自适应解码流程图;  7 is a flowchart of adaptive decoding in an embodiment of the present invention;
图 8为本发明提供的一种自适应编码装置的结构图;  FIG. 8 is a structural diagram of an adaptive coding apparatus according to the present invention; FIG.
图 9为本发明提供的一种自适应解码装置的结构图。 具体实施方式  FIG. 9 is a structural diagram of an adaptive decoding apparatus according to the present invention. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进 行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没 有作出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的 范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
基于现有技术中, 编解码过程不能自适应不同应用、 不同接口、 不同 Diameter 消息、 不同厂商定义、 不同版本等条件, 从而导致消息定义不灵 活、 易产生冲突的问题, 本发明提供一种自适应编码 /解码方法和装置, 其 核心思想是根据各应用的需求定义了对应的运行时编解码配置表, 该配置 表可以动态获取、 动态调整, 有效地实现了编解码配置数据与具体应用接 口的编解码自动分离。  Based on the prior art, the codec process cannot adapt to different applications, different interfaces, different Diameter messages, different vendor definitions, different versions, and the like, thereby resulting in inflexible message definition and conflicts. The core idea of the coding/decoding method and device is to define a corresponding runtime codec configuration table according to the requirements of each application. The configuration table can be dynamically acquired and dynamically adjusted, and the codec configuration data and the specific application interface are effectively realized. The codec is automatically separated.
具体的, 本发明提供的一种自适应编码方法, 如图 2A所示, 具体包括 以下步骤:  Specifically, an adaptive coding method provided by the present invention, as shown in FIG. 2A, specifically includes the following steps:
步骤 S2A01、 接收待编码的应用相关信息, 读取该应用相关信息的消 息结构, 获取 AVP的相关信息。  Step S2A01: Receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP.
其中, 应用相关信息包括: 应用 ID号、 Diameter消息码、 Diameter消 息长度、 待编码的消息结构和开始位置信息。  The application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and a start location information.
步骤 S2A02、 根据获取的 AVP的相关信息查找预先生成的运行时编码 配置表, 获取与 AVP相关信息对应的 AVP配置信息。 Step S2A02: Search for a pre-generated runtime code according to the obtained information about the AVP. The configuration table obtains the AVP configuration information corresponding to the AVP related information.
其中, 运行时编码配置表包括: 应用的配置信息、 Diameter 消息的配 置信息和 AVP的配置信息。  The runtime coding configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
具体的, 该运行时编码配置表具体通过下述方式生成:  Specifically, the runtime coding configuration table is specifically generated by:
( 1 )读取需要编码的文档, 根据 Diameter协议的扩展巴克斯范式规则 选取各接口应用的消息和相关 AVP信息,并将应用的消息和相关 AVP信息 转化为标准文件;  (1) reading the document to be encoded, selecting the message of the application of each interface and the related AVP information according to the extended Bacchus paradigm rule of the Diameter protocol, and converting the applied message and the related AVP information into a standard file;
( 2 )将标准文件传输到网管系统前台, 通过前台相关进程将标准文件 转化为二进制码流后存储在前台内存区中;  (2) Transfer the standard file to the foreground of the network management system, and convert the standard file into a binary code stream through the relevant process in the foreground, and store it in the foreground memory area;
( 3 )利用 Diameter协议数据配置管理进程读取所述内存区中的二进制 码流, 并按照消息组成格式将二进制码流转化为编码配置表;  (3) using the Diameter protocol data configuration management process to read the binary code stream in the memory area, and converting the binary code stream into an encoding configuration table according to the message composition format;
( 4 )利用 Diameter协议进程根据项目支持的应用从编码配置表中读取 数据重新组织为运行时编码配置表。  (4) Using the Diameter protocol process to read data from the code configuration table according to the application supported by the project and reorganize it into a runtime coding configuration table.
需要说明的是,当网管系统前台接收到 AVP调整命令时,通知 Diameter 协议数据配置管理进程修改编码配置表, 并在编码配置表修改完成后, 利 用 Diameter协议进程将相关修改部分同步到所述运行时编码配置表。  It should be noted that when the network management system receives the AVP adjustment command in the foreground, the Diameter protocol data configuration management process is notified to modify the coding configuration table, and after the modification of the coding configuration table is completed, the related modification part is synchronized to the operation by using the Diameter protocol process. Time code configuration table.
步骤 S2A03、根据 AVP配置信息,对 AVP的相关信息进行合法性验证, 在 AVP的相关信息合法时,根据应用相关信息和 AVP的相关信息组织生成 Diameter消息码流。  Step S2A03: Perform legality verification on the AVP related information according to the AVP configuration information. When the AVP related information is legal, the Diameter message code stream is generated according to the application related information and the AVP related information.
该步骤中,根据应用相关信息和 AVP的相关信息组织生成 Diameter消 息码流具体通过下述方式实现: 根据应用相关信息生成 Diameter消息头码 流, 根据 AVP的相关信息, 生成 AVP码流, 将 Diameter消息头码流和所 有 AVP码流合并组织成 Diameter消息码流。  In this step, the generating the Diameter message code stream according to the application related information and the AVP related information is specifically implemented by: generating a Diameter message header code stream according to the application related information, and generating an AVP code stream according to the AVP related information, and the Diameter is generated. The message header stream and all AVP streams are combined into a Diameter message stream.
本发明还提供一种自适应解码方法, 如图 2B所示, 包括以下步骤: 步骤 S2B01、 接收待解码的 Diameter消息码流后, 解析该码流头部信 息, 获取解码所需相关参数。 The present invention further provides an adaptive decoding method. As shown in FIG. 2B, the method includes the following steps: Step S2B01: After receiving a Diameter message code stream to be decoded, parsing the code stream header signal Information, get the relevant parameters required for decoding.
其中, 解码所需相关参数包括: 应用 ID、 Diameter消息码、 Diameter 消息长度信息、 Diameter 消息码流开始位置信息和解码后消息结构存放开 始位置信息。  The relevant parameters required for decoding include: an application ID, a Diameter message code, a Diameter message length information, a Diameter message code stream start position information, and a decoded message structure storage start position information.
步骤 S2B02、 根据获取的相关参数查找预先生成的运行时解码配置表, 获取 AVP配置信息。  Step S2B02: Search for a pre-generated runtime decoding configuration table according to the obtained related parameters, and obtain AVP configuration information.
其中, 该运行时解码配置表具体通过下述方式生成:  The runtime decoding configuration table is specifically generated by:
( 1 )读取需要解码的文档, 根据 Diameter协议的扩展巴克斯范式规则 选取各接口应用的消息和相关 AVP信息,并将应用的消息和相关 AVP信息 转化为标准文件;  (1) reading the document to be decoded, selecting the message of the application of each interface and the related AVP information according to the extended Bacchus paradigm rule of the Diameter protocol, and converting the applied message and the related AVP information into a standard file;
( 2 )将标准文件传输到网管系统前台, 通过前台相关进程将标准文件 转化为二进制码流后存储在前台内存区中;  (2) Transfer the standard file to the foreground of the network management system, and convert the standard file into a binary code stream through the relevant process in the foreground, and store it in the foreground memory area;
( 3 )利用 Diameter协议数据配置管理进程读取所述内存区中的二进制 码流, 并按照消息组成格式将二进制码流转化为解码配置表;  (3) using the Diameter protocol data configuration management process to read the binary code stream in the memory area, and converting the binary code stream into a decoding configuration table according to the message composition format;
( 4 )利用 Diameter协议进程根据项目支持的应用从解码配置表中读取 数据重新组织为运行时解码配置表。  (4) Using the Diameter protocol process to read data from the decoding configuration table according to the application supported by the project and reorganize into a runtime decoding configuration table.
需要说明的是,在网管系统前台接收到 AVP调整命令时,通知 Diameter 协议数据配置管理进程修改解码配置表; Diameter协议进程在解码配置表 修改完成后, 将相关修改部分同步到运行时解码配置表。  It should be noted that, when the AVP adjustment command is received in the foreground of the network management system, the Diameter protocol data configuration management process is notified to modify the decoding configuration table. After the modification of the decoding configuration table is completed, the Diameter protocol process synchronizes the relevant modification part to the runtime decoding configuration table. .
步骤 S2B03、 根据 AVP配置信息, 对 Diameter消息码流中的 AVP码 流进行合法性验证, 在 AVP码流合法时, 将 AVP码流对应的 AVP相关信 息填写到根据 AVP配置信息和解码所需相关参数计算出的 AVP信息存放绝 对位置。  Step S2B03: Perform validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information. When the AVP code stream is legal, fill in the AVP related information corresponding to the AVP code stream to the AVP configuration information according to the AVP configuration information. The AVP information calculated by the parameter stores the absolute position.
本发明提供的编解码方法, 能够灵活根据现有的标准文档生成运行时 编解码配置表, 该配置表能够根据不同项目在编解码处理时自适应不同应 用需求, 避免了各应用的冲突, 提高了编解码处理核心部件的复用性, 有 利于扩展新的 Diameter应用。 同时, 本发明还解决了在支持多个应用相同 Diameter 消息码的情况下, 根据配置进行区分, 不至于造成消息结构间的 混淆问题。 The codec method provided by the invention can flexibly generate a runtime codec configuration table according to an existing standard document, and the configuration table can adapt to different coding and decoding processes according to different items. With the requirement, the conflicts of various applications are avoided, the reusability of the core components of the codec processing is improved, and the new Diameter application is facilitated. At the same time, the present invention also solves the problem of distinguishing between the message structures without causing confusion between message structures in the case of supporting multiple applications with the same Diameter message code.
下面通过一个较佳的实施例来详细阐述本发明提供的自适应编解码的 过程。  The process of adaptive codec provided by the present invention is explained in detail below by means of a preferred embodiment.
为了清楚地说明本发明的具体实现过程, 首先对自适应编解码过程中 运用的运行时编解码配置表的生成方式作详细介绍, 如图 3 所示, 为本发 明实施例生成运行时编解码配置表流程图, 具体包括以下步骤:  In order to clearly illustrate the specific implementation process of the present invention, a method for generating a runtime codec configuration table used in the adaptive codec process is described in detail. As shown in FIG. 3, a runtime codec is generated according to an embodiment of the present invention. The configuration table flowchart includes the following steps:
步骤 S301、 根据 Diameter协议的扩展巴克斯范式(ABNF )规则对需 要编解码的 RFC/3GPP文档进行扫描, 将符合此规则的应用消息转换为标 准文件, 例如可扩展标记语言(XML, Extensible Markup Language )文件。  Step S301: Scan an RFC/3GPP document that needs to be codec according to an extended Bacchus paradigm (ABNF) rule of the Diameter protocol, and convert an application message conforming to the rule into a standard file, such as an Extensible Markup Language (XML). )file.
步骤 S302、继续扫描文档,将符合 ABNF规则的相关 AVP信息转换为 标准文件, 例如 XML文件。  Step S302: Continue scanning the document, and convert related AVP information conforming to the ABNF rule into a standard file, such as an XML file.
步骤 S303、 操作维护中心 (OMC, Operations Maintenance Center, 也 即网管系统)根据生成的 XML格式的文件, 进行 Diameter协议合法性检 查, 若合法性校验通过, 则执行续步骤 S305; 否则执行步骤 S304。  Step S303: The Operations Maintenance Center (OMC) performs the Diameter protocol validity check according to the generated XML format file. If the validity check is passed, the process continues to step S305; otherwise, step S304 is performed. .
步骤 S304、 合法性校验未通过时, 可能存在某些 AVP定义已在该协议 依赖的其它文档定义过, 此时通过引用已存在该 AVP定义的 XML实现文 件或手动增加该 AVP定义, 然后返回步骤 S303。  Step S304: When the validity check fails, there may be some AVP definitions that have been defined in other documents that the protocol depends on. At this time, the XML implementation file of the AVP definition is already existing by reference or the AVP definition is manually added, and then returned. Step S303.
步骤 S305、 OMC将 XML文件传输到网管系统前台运行的版本中。 具体的, 根据实际应用的情况, XML文件传输到前台版本可通过两种 方式完成,其一,如果前台单板重启时,不需要 OMC再进行数据传输工作, 此时需要数据库能够记录此 XML配置文件, 此时, 该步骤具体按下述方式 执行: ( 1 ) OMC将 XML文件以二进制格式存入网管系统数据库; In step S305, the OMC transmits the XML file to the version running in the foreground of the network management system. Specifically, according to the actual application, the XML file is transmitted to the foreground version in two ways. First, if the front board restarts, the OMC is not required to perform data transmission. In this case, the database needs to be able to record the XML configuration. The file, at this point, the step is specifically performed as follows: (1) OMC stores the XML file in a binary format into the network management system database;
( 2 ) 网管系统数据库将 XML二进制码流同步到前台数据接收进程; (2) The network management system database synchronizes the XML binary code stream to the foreground data receiving process;
( 3 )前台 Diameter协议进程从前台数据接收进程读取 XML二进制码 流, 并将该 XML二进制码流存储在前台内存区中。 (3) The foreground Diameter protocol process reads the XML binary code stream from the foreground data receiving process, and stores the XML binary code stream in the foreground memory area.
其二,如果不考虑前台单板重启时,通过 OMC再次进行数据传输工作, 此时, 该步骤具体按下述方式执行:  Second, if the data transfer operation is performed again through the OMC when the front panel is restarted, the step is specifically performed as follows:
( 1 ) OMC将 XML二进制码流分包同步到前台数据接收进程。  (1) The OMC synchronizes the XML binary stream to the foreground data receiving process.
( 2 )前台 Diameter协议进程从前台数据接收进程读取 XML二进制码 流的所有包后, 重组成 XML二进制码流, 并将该 XML二进制码流存储在 前台内存区中。  (2) The foreground Diameter protocol process reads all the packets of the XML binary stream from the foreground data receiving process, reassembles the XML binary stream, and stores the XML binary stream in the foreground memory area.
步骤 S306、 Diameter协议数据配置管理进程读取前台内存区中的 XML 二进制码流并按照消息组成格式转化为编解码配置表。  Step S306: The Diameter protocol data configuration management process reads the XML binary code stream in the foreground memory area and converts it into a codec configuration table according to the message composition format.
步骤 S307、 Diameter协议进程根据项目支持的应用从编解码配置表读 取数据重新组织为运行时编解码配置表。 需要说明的是, 后续进行编解码 时以运行时编解码配置表作为协议检查、 编码、 解码的配置来源。  Step S307: The Diameter protocol process re-organizes the data from the codec configuration table into a runtime codec configuration table according to the application supported by the project. It should be noted that the runtime codec configuration table is used as a configuration source for protocol check, encoding, and decoding in subsequent codec.
具体的, 上述运行时编解码配置表包括: 应用的配置信息, Diameter 消息的配置信息和 AVP的配置信息。  Specifically, the foregoing running codec configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
其中, 应用的配置信息包括该应用包含的 Diameter消息类型;  The configuration information of the application includes a Diameter message type included in the application;
Diameter 消息的配置信息包括: Diameter 消息的头部标志信息、 所属 应用、 项目信息以及其内包含的 AVP类型、 数目、 相对位置、 是否必选、 是否可选等信息。  The configuration information of the Diameter message includes: the header information of the Diameter message, the application, the project information, and the AVP type, number, relative location, whether it is mandatory, and whether it is optional.
AVP的配置信息包括: 该 AVP的头部标志信息、 所属应用、 项目信息 以及厂商标识等,如果该 AVP为组合类型,则还包括其子 AVP类型、数目、 相对位置、 是否必选、 是否可选等信息。  The configuration information of the AVP includes: the header information of the AVP, the application, the item information, and the vendor identifier. If the AVP is a combination type, it also includes its sub-AVP type, number, relative position, whether it is mandatory, or whether it is available. Select information.
以上为本发明自适应编解码器的运行时编解码配置表获取流程, 由于 该配置表可以根据各运营商、 各应用接口、 项目实际需要进行定制, 并且 前台运行程序不需要作任何修改、 适配, 有效地满足了实际应用的需要, 又不失灵活性。 The above is the acquisition process of the runtime codec configuration table of the adaptive codec of the present invention, The configuration table can be customized according to the actual needs of each operator, each application interface, and the project, and the foreground running program does not need to be modified or adapted, effectively meeting the needs of the actual application without losing flexibility.
同时, 本发明实施例提供的运行时编解码配置表还可以依据实际环境 需要进行动态调整, 主要是根据具体项目的不同局端的实际需要, 通过 At the same time, the runtime codec configuration table provided by the embodiment of the present invention can also be dynamically adjusted according to the actual environment needs, mainly according to the actual needs of different central offices of specific projects.
OMC进行相关消息 AVP的动态增加、 修改、 删除。 具体的, 动态调整流 程如图 4所示, 包括以下步骤: The OMC performs related messages. The dynamic addition, modification, and deletion of the AVP. Specifically, the dynamic adjustment process is as shown in FIG. 4, and includes the following steps:
步骤 S401、 OMC进行相关消息 AVP的动态增加、 修改、 删除时, 将 调整操作命令传到前台 Diameter协议进程, 该前台 Diameter协议进程通知 Diameter协议数据配置管理进程进行 AVP调整。  Step S401: The OMC performs related messages. When the AVP is dynamically added, modified, or deleted, the adjustment operation command is transmitted to the foreground Diameter protocol process, and the foreground Diameter protocol process notifies the Diameter protocol data configuration management process to perform AVP adjustment.
具体的, 根据实际应用的情况, 在版本升级或前台单板重启的情况下, 某些项目要求能够记录已有的 AVP修改信息, 某些项目不需要记录原有的 修改记录。 此时, 该步骤在具体执行过程中略有差别, 主要表现为:  Specifically, depending on the actual application, in the case of version upgrade or front-end board restart, some items require the ability to record existing AVP modification information, and some items do not need to record the original modification record. At this point, this step is slightly different in the specific implementation process, mainly as follows:
相关消息 AVP的动态增加、 修改、 删除时, OMC将操作过程和数据 变化保存到数据库的处理过程, 包括: 相关消息 AVP的动态增加、 修改、 删除时, OMC将操作过程和数据变化保存到网管系统数据库中, 数据库将 该操作过程发送消息到前台 Diameter协议进程, 告知 AVP调整情况;  When the dynamic message is added, modified, or deleted, the OMC saves the operation process and data changes to the database process, including: When the AVP is dynamically added, modified, or deleted, the OMC saves the operation process and data changes to the NMS. In the system database, the database sends the operation process to the foreground Diameter protocol process to inform the AVP to adjust the situation;
相关消息 AVP的动态增加、 修改、 删除时, OMC将操作过程直接发 送给前台, 具体包括: 相关消息 AVP 的动态增加、 修改、 删除时, OMC 将操作过程直接发送给前台 Diameter协议进程, 告知 AVP调整情况。  When the AVP is dynamically added, modified, or deleted, the OMC sends the operation directly to the foreground. The details include: When the AVP is dynamically added, modified, or deleted, the OMC sends the operation directly to the foreground Diameter protocol to notify the AVP. Adjust the situation.
步骤 S402、 Diameter协议数据配置管理进程根据 AVP调整通知的具体 内容, 修改编解码配置表。  Step S402: The Diameter protocol data configuration management process modifies the codec configuration table according to the specific content of the AVP adjustment notification.
步骤 S403、 Diameter协议进程根据具体应用项目的需要, 将相关修改 部分同步到运行时编解码配置表。  Step S403: The Diameter protocol process synchronizes the relevant modification part to the runtime codec configuration table according to the needs of the specific application item.
以上为本发明自适应编解码的运行时编解码配置表调整的实施步骤, 在能获取运行时编解码配置表的前提下, 能根据不同局端的实际应用需求 进行小范围的消息 AVP调整是非常必要的, 这样就可以灵活满足不同运营 商的应用需求。 本发明是自适应编解码器的运行编解码配置表获取发明的 有力^卜充。 The above is an implementation step of adjusting the runtime codec configuration table of the adaptive codec of the present invention. On the premise that the runtime codec configuration table can be obtained, it is necessary to perform small-scale message AVP adjustment according to the actual application requirements of different central offices, so that the application requirements of different operators can be flexibly met. The invention is a powerful codec configuration table for the running codec configuration table of the adaptive codec.
通过运行时编解码配置表的动态获取、 动态调整, 有效实现了配置数 据与具体应用接口的编解码实现自动分离, 从而本发明能够根据动态编解 码配置实现不同运营商、 不同应用接口、 不同实际项目的应用需求。  Through the dynamic acquisition and dynamic adjustment of the runtime codec configuration table, the configuration data is automatically separated from the codec of the specific application interface, so that the present invention can implement different operators, different application interfaces, and different actualities according to the dynamic codec configuration. The application needs of the project.
下面详细阐述本发明提供的自适应编解码器的编解码流程, 具体的, 本实施例提供的自适应编解码方法的工作原理示意图如图 5 所示, 其中, 各应用使用的消息结构如图所示, 该结构按照业务需求包含特定的 AVP, 这些 AVP按照约定规则进行组织,某个 AVP的信息相对消息头开始位置有 固定的偏移量。 编码前, 将应用相关的 AVP信息填入该 AVP的相对偏移位 置。  The codec process of the adaptive codec provided by the present invention is described in detail below. Specifically, the working principle of the adaptive codec method provided in this embodiment is shown in FIG. 5, wherein the message structure used by each application is as shown in FIG. As shown, the structure includes specific AVPs according to business requirements. These AVPs are organized according to the agreed rules, and the information of an AVP has a fixed offset from the start position of the message header. Before encoding, the relevant AVP information is applied to the relative offset position of the AVP.
具体的, 本发明实施例提供的自适应编码流程, 如图 6所示, 包括以 下步骤:  Specifically, the adaptive coding process provided by the embodiment of the present invention, as shown in FIG. 6, includes the following steps:
步骤 S601、 应用进程调用编码接口, 将待编码的应用相关信息传送至 编解码核心部件。 其中, 应用相关信息包含应用 ID号、 Diameter消息码、 待编码的消息结构及该消息结构的开始位置等参数。  Step S601: The application process invokes the encoding interface, and transmits the application related information to be encoded to the codec core component. The application related information includes an application ID number, a Diameter message code, a message structure to be encoded, and a starting position of the message structure.
步骤 S602、 编解码核心部件从待编码的消息结构中取出 AVP, 并获取 该 AVP的相关信息。  Step S602: The codec core component extracts the AVP from the message structure to be encoded, and obtains related information of the AVP.
步骤 S603、 编解码核心部件根据获取的 AVP相关信息, 在运行时编解 码配置表中查找相应的 AVP配置信息。  Step S603: The codec core component searches for a corresponding AVP configuration information in the runtime codec configuration table according to the obtained AVP related information.
步骤 S604、 编解码核心部件 4艮据查找到的 AVP 配置信息, 对在步骤 S602中获取的 AVP相关信息作合法性检查。 其中, 合法性检查包括: 必选的 AVP是否被赋值; AVP值是否在规定范围内; Step S604, the codec core component 4 checks the legality of the AVP related information acquired in step S602 according to the found AVP configuration information. Among them, the legality check includes: Whether the mandatory AVP is assigned; Whether the AVP value is within the specified range;
AVP出现次数是否满足限定范围;  Whether the number of AVP occurrences meets the limited range;
如果以上检查均通过, 则进入下一个步骤 S605 , 否则编码流程结束, 编码失败。  If the above checks are all passed, the process proceeds to the next step S605, otherwise the encoding process ends and the encoding fails.
步骤 S605、 编解码核心部件根据步骤 S601 中传入参数生成 Diameter 消息头码流; 根据步骤 S602中获取的 AVP相关信息, 生成 AVP码流, 最 后将 Diameter消息头码流和所有 AVP码流合并组织成 Diameter消息码流。  Step S605, the codec core component generates a Diameter message header code stream according to the incoming parameter in step S601; generates an AVP code stream according to the AVP related information acquired in step S602, and finally merges the Diameter message header code stream and all AVP code streams. Divided into a Diameter message stream.
以上为本发明实施例自适应编码实施步骤, 由于其中包含查询配置表, 根据配置表从相对位置中获取 AVP相关信息, 不需要理解具体应用的消息 结构, 更易于新应用的扩展。  The above is the implementation of the adaptive coding in the embodiment of the present invention. Since the query configuration table is included, the AVP related information is obtained from the relative location according to the configuration table, and the message structure of the specific application does not need to be understood, and the extension of the new application is easier.
具体的, 本发明实施例提供的自适应解码流程, 如图 7 所示, 包括以 下步骤:  Specifically, the adaptive decoding process provided by the embodiment of the present invention, as shown in FIG. 7, includes the following steps:
步骤 S701、 应用进程接收待解码的 Diameter消息码流, 并调用编解码 核心部件提供的消息头部解码函数, 从 Diameter消息码流消息头中获取应 用 ID、 Diameter消息码、 Diameter消息长度等信息。  Step S701: The application process receives the Diameter message code stream to be decoded, and invokes a message header decoding function provided by the codec core component, and obtains information such as an application ID, a Diameter message code, and a Diameter message length from the Diameter message stream message header.
需要说明的是, 上述信息的位置相对 Diameter消息码流开始位置而言 均是固定的, 不存在技术问题。  It should be noted that the location of the above information is fixed relative to the start position of the Diameter message stream, and there is no technical problem.
步骤 S702、应用进程调用解码接口,将步骤 S701中获取的相关信息以 及 Diameter消息码流开始位置、 解码后消息结构存放开始位置等信息传送 到编解码核心部件。  Step S702: The application process invokes the decoding interface, and transmits information about the related information acquired in step S701 and the start position of the Diameter message code stream and the start position of the decoded message structure to the codec core component.
步骤 S703、 编解码核心部件根据传入的相关信息, 查找运行时编解码 配置表, 获取应用 ID和 Diameter消息码包含的 AVP配置信息, 该配置信 息包括:  Step S703: The codec core component searches the runtime codec configuration table according to the related information, and obtains the AVP configuration information included in the application ID and the Diameter message code, where the configuration information includes:
AVP的类型、 AVP的个数限制、 AVP的标志位设置和 AVP的值范围限 制。 步骤 S704、 编解码核心部件从 Diameter消息码流中获取每个 AVP码 流, 并根据步骤 S703中获取的 AVP配置信息做合法性检查。 其中, 合法 性检查包括: The type of AVP, the number of AVPs, the AVP flag setting, and the AVP value range limit. Step S704: The codec core component obtains each AVP code stream from the Diameter message code stream, and performs a legality check according to the AVP configuration information acquired in step S703. Among them, the legality check includes:
必选的 AVP是否被赋值;  Whether the required AVP is assigned;
AVP值是否在规定范围内;  Whether the AVP value is within the specified range;
AVP出现次数是否满足限定范围。  Whether the number of AVP occurrences meets the limited range.
对码流中的所有 AVP,如果以上检查均通过,则进入下一个步骤 S705, 否则解码流程结束, 解码失败。  For all AVPs in the code stream, if the above checks pass, the process proceeds to the next step S705, otherwise the decoding process ends and the decoding fails.
步骤 S705、 编解码核心部件根据步骤 S703中获取的 AVP配置信息计 算 AVP信息相对开始位置的偏移量 n,才艮据步骤 S702中参数解码后消息结 构存放开始位置 m计算 AVP信息存放的绝对位置 m+n;  Step S705: The codec core component calculates the offset n of the relative position of the AVP information according to the AVP configuration information acquired in step S703, and calculates the absolute location of the AVP information storage according to the message structure storage start position m after the parameter decoding in step S702. m+n;
编解码核心部件对步骤 S704中获取的每个 AVP码流进行分析, 获取 AVP值和标志位信息后,分别将获取的消息填写到计算的 AVP信息绝对位 置处, 从而完成解码过程。  The codec core component analyzes each AVP code stream obtained in step S704, obtains the AVP value and the flag bit information, and then fills the obtained message into the absolute position of the calculated AVP information, thereby completing the decoding process.
以上为本发明自适应解码实施步骤, 由于其中包含查询配置表, 根据 配置表中 AVP相关信息计算解码后 AVP值存放的相对位置,不需要理解具 体应用的消息结构, 易于新应用的扩展。  The above is the adaptive decoding implementation step of the present invention. Since the query configuration table is included, the relative position of the decoded AVP value is calculated according to the AVP related information in the configuration table, and the message structure of the specific application does not need to be understood, which is easy to extend the new application.
综上所述, 釆用本发明实施例提供的自适应编码 /解码方法, 通过编解 码配置数据与具体应用接口的编解码实现分离, 增加了协议实现的可扩展 性, 同时可以进行运行时编解码配置表的动态获取、 动态调整, 满足不同 运营商、 不同应用接口、 不同实际项目的应用需求。 通过查询运行时编解 码配置表, 编解码核心部件自动在 Diameter消息码流和 Diameter应用消息 结构之间进行转换, 而无须理解 Diameter应用消息结构。 这种通过查询配 置自动适应的方法, 既增加了编解码核心部件的复用性, 又提高了 diameter 应用消息的可扩展性。在同时支持多个应用相同 Diameter消息码的情况下, 根据配置进行区分, 不至于造成消息结构间的混淆问题。 In summary, the adaptive encoding/decoding method provided by the embodiment of the present invention separates the codec configuration data from the codec of the specific application interface, increases the scalability of the protocol implementation, and can perform runtime coding. The dynamic acquisition and dynamic adjustment of the decoding configuration table meet the application requirements of different operators, different application interfaces, and different actual projects. By querying the runtime codec configuration table, the codec core component automatically converts between the Diameter message stream and the Diameter application message structure without having to understand the Diameter application message structure. This method of automatic adaptation through query configuration not only increases the reusability of the codec core components, but also improves the scalability of the diameter application message. In the case of supporting multiple applications with the same Diameter message code at the same time, Differentiating according to the configuration does not cause confusion between message structures.
本发明还提供一种自适应编码的装置, 如图 8所示, 包括:  The present invention also provides an apparatus for adaptive coding, as shown in FIG. 8, comprising:
编码消息接收单元 810, 用于接收待编码的应用相关信息,读取应用相 关信息的消息结构, 获取 AVP的相关信息;  The coded message receiving unit 810 is configured to receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP;
第一 AVP配置信息获取单元 820, 用于根据编码消息接收单元 810获 取的 AVP的相关信息查找预先生成的运行时编码配置表,获取与 AVP相关 信息对应的 AVP配置信息;  The first AVP configuration information acquiring unit 820 is configured to search the pre-generated runtime coding configuration table according to the information about the AVP obtained by the encoding message receiving unit 810, and obtain the AVP configuration information corresponding to the AVP related information.
编码单元 830, 用于根据 AVP配置信息, 对 AVP的相关信息进行合法 性验证, 在 AVP的相关信息合法时,根据应用相关信息和 AVP的相关信息 组织生成 Diameter消息码流。  The coding unit 830 is configured to perform validity verification on the AVP related information according to the AVP configuration information, and organize the Diameter message code stream according to the application related information and the AVP related information when the AVP related information is legal.
其中, 应用相关信息包括: 应用 ID号、 Diameter消息码、 Diameter消 息长度、 待编码的消息结构和开始位置信息。  The application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and a start location information.
本发明还提供一种自适应解码的装置, 如图 9所示, 包括:  The present invention also provides an apparatus for adaptive decoding, as shown in FIG. 9, including:
解码消息接收单元 910, 用于接收待解码的 Diameter消息码流, 并解 析该码流头部信息, 获取解码所需相关参数;  The decoding message receiving unit 910 is configured to receive a Diameter message code stream to be decoded, and parse the code stream header information to obtain related parameters required for decoding.
第二 AVP配置信息获取单元 920, 用于根据解码消息接收单元 910获 取的相关参数查找预先生成的运行时解码配置表, 获取 AVP配置信息; 解码单元 930,用于根据 AVP配置信息,对 Diameter消息码流中的 AVP 码流进行合法性验证, 在 AVP码流合法时, 将 AVP码流对应的 AVP相关 信息填写到根据 AVP配置信息和解码所需相关参数计算出的 AVP信息存放 绝对位置。 本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在 内。  The second AVP configuration information acquiring unit 920 is configured to search the pre-generated runtime decoding configuration table according to the related parameters acquired by the decoding message receiving unit 910, and obtain the AVP configuration information. The decoding unit 930 is configured to use the AVP configuration information to the Diameter message. The AVP code stream in the code stream is verified for validity. When the AVP code stream is legal, the AVP information corresponding to the AVP code stream is filled in to the absolute position of the AVP information stored according to the AVP configuration information and the relevant parameters required for decoding. The spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims

权利要求书 Claim
1、 一种自适应编码方法, 其特征在于, 所述方法包括:  An adaptive coding method, the method comprising:
接收待编码的应用相关信息, 读取所述应用相关信息的消息结构, 获 取属性值对 AVP的相关信息;  Receiving application related information to be encoded, reading a message structure of the application related information, and obtaining related information of the attribute value pair AVP;
根据所述 AVP的相关信息查找预先生成的运行时编码配置表, 获取与 所述 AVP相关信息对应的 AVP配置信息;  And searching for a pre-generated runtime coding configuration table according to the AVP related information, and acquiring AVP configuration information corresponding to the AVP related information;
根据所述 AVP配置信息,对所述 AVP的相关信息进行合法性验证, 在 所述 AVP的相关信息合法时,根据所述应用相关信息和 AVP的相关信息组 织生成 Diameter消息码流。  And validating the validity information of the AVP according to the AVP configuration information. When the related information of the AVP is legal, the Diameter message code stream is generated according to the application related information and the AVP related information.
2、 根据权利要求 1所述的方法, 其特征在于,  2. The method of claim 1 wherein
所述应用相关信息包括: 应用 ID号、 Diameter消息码、 Diameter消息 长度、 待编码的消息结构和开始位置信息;  The application related information includes: an application ID number, a Diameter message code, a Diameter message length, a message structure to be encoded, and start location information;
所述运行时编码配置表包括: 应用的配置信息、 Diameter 消息的配置 信息和 AVP的配置信息。  The runtime coding configuration table includes: configuration information of the application, configuration information of the Diameter message, and configuration information of the AVP.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述运行时编码配 置表通过如下方式生成:  3. The method according to claim 1 or 2, wherein the runtime coding configuration table is generated as follows:
读取需要编码的文档, 根据 Diameter协议的扩展巴克斯范式规则选取 各接口应用的消息和相关 AVP信息,并将所述应用的消息和相关 AVP信息 转化为标准文件;  Reading the document to be encoded, selecting the message of each interface application and related AVP information according to the extended Bacchus formula rule of the Diameter protocol, and converting the application message and related AVP information into a standard file;
将所述标准文件传输到网管系统前台, 通过网管系统前台相关进程将 所述标准文件转化为二进制码流后存储在网管系统前台内存区中;  Transmitting the standard file to the foreground of the network management system, and converting the standard file into a binary code stream through the foreground process of the network management system, and storing the standard file in the foreground memory area of the network management system;
利用 Diameter协议的数据配置管理进程读取所述内存区中的二进制码 流, 并按照消息组成格式将所述二进制码流转化为编码配置表;  The data configuration management process of the Diameter protocol reads the binary code stream in the memory area, and converts the binary code stream into an encoding configuration table according to a message composition format;
利用 Diameter协议进程, 根据 Diameter协议涉及的接口支持的应用从 所述编码配置表中读取数据, 重新组织为运行时编码配置表。 Using the Diameter protocol process, the application supported by the interface involved in the Diameter protocol reads data from the encoding configuration table and reorganizes it into a runtime encoding configuration table.
4、 根据权利要求 3所述的方法, 其特征在于, 所述方法还包括: 所述网管系统前台接收到 AVP调整命令时 ,通知所述 Diameter协议的 数据配置管理进程修改所述编码配置表, 并在所述编码配置表修改完成后 , 利用所述 Diameter 协议进程将相关修改部分同步到所述运行时编码配置 表。 The method according to claim 3, wherein the method further comprises: when the network management system receives the AVP adjustment command, notifying the data configuration management process of the Diameter protocol to modify the coding configuration table, And after the modification of the encoding configuration table is completed, the related modified portion is synchronized to the runtime encoding configuration table by using the Diameter protocol process.
5、 根据权利要求 1或 2所述的方法, 其特征在于, 根据所述应用相关 信息和 AVP的相关信息组织生成 Diameter消息码流具体为:  The method according to claim 1 or 2, wherein the generating the Diameter message code stream according to the application related information and the AVP related information is specifically:
根据所述应用相关信息生成 Diameter消息头码流,根据所述 AVP的相 关信息, 生成 AVP码流, 将所述 Diameter消息头码流和所有 AVP码流合 并, 组织成 Diameter消息码流。  Generating a Diameter message header code stream according to the application related information, generating an AVP code stream according to the AVP related information, and combining the Diameter message header code stream and all AVP code streams to form a Diameter message code stream.
6、 一种自适应解码方法, 其特征在于, 所述方法包括:  6. An adaptive decoding method, the method comprising:
接收到待解码的 Diameter消息码流后, 解析所述码流头部信息, 获取 解码所需相关参数;  After receiving the Diameter message code stream to be decoded, parsing the code stream header information to obtain related parameters required for decoding;
根据所获取的相关参数查找预先生成的运行时解码配置表, 获取 AVP 配置信息;  Finding a pre-generated runtime decoding configuration table according to the obtained related parameters, and acquiring AVP configuration information;
根据所述 AVP配置信息, 对所述 Diameter消息码流中的 AVP码流进 行合法性验证, 在所述 AVP码流合法时, 将所述 AVP码流对应的 AVP相 关信息填写到根据所述 AVP配置信息和解码所需相关参数计算出的 AVP信 息存放绝对位置。  Performing validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information, and filling in the AVP related information corresponding to the AVP code stream to the AVP according to the AVP when the AVP code stream is legal The AVP information calculated by the configuration information and the relevant parameters required for decoding is stored in an absolute position.
7、 根据权利要求 6所述的方法, 其特征在于,  7. The method of claim 6 wherein:
所述解码所需相关参数包括: 应用 ID、 Diameter消息码、 Diameter消 息长度信息、 Diameter 消息码流开始位置信息和解码后消息结构存放开始 位置信息。  The parameters required for the decoding include: an application ID, a Diameter message code, a Diameter message length information, a Diameter message code stream start position information, and a decoded message structure storage start position information.
8、 根据权利要求 6所述的方法, 其特征在于, 所述运行时解码配置表 通过 ^。下方式生成: 读取需要解码的文档, 根据 Diameter协议的扩展巴克斯范式规则选取 各接口应用的消息和相关 AVP信息,并将所述应用的消息和相关 AVP信息 转化为标准文件; 8. The method according to claim 6, wherein the runtime decoding configuration table passes through ^. The following way to generate: Reading the document to be decoded, selecting the message of each interface application and related AVP information according to the extended Bacchus formula rule of the Diameter protocol, and converting the application message and related AVP information into a standard file;
将所述标准文件传输到网管系统前台, 通过网管系统前台相关进程将 所述标准文件转化为二进制码流后存储在网管系统前台内存区中;  Transmitting the standard file to the foreground of the network management system, and converting the standard file into a binary code stream through the foreground process of the network management system, and storing the standard file in the foreground memory area of the network management system;
利用 Diameter协议的数据配置管理进程读取所述内存区中的二进制码 流, 并按照消息组成格式将所述二进制码流转化为解码配置表;  The data configuration management process of the Diameter protocol reads the binary code stream in the memory area, and converts the binary code stream into a decoding configuration table according to a message composition format;
利用 Diameter协议进程, 根据 Diameter协议涉及的接口支持的应用从 所述解码配置表中读取数据, 重新组织为运行时解码配置表。  The Diameter protocol process is used to read data from the decoding configuration table according to an application supported by the interface involved in the Diameter protocol, and reorganize into a runtime decoding configuration table.
9、 根据权利要求 8所述的方法, 其特征在于, 所述方法还包括: 所述网管系统前台接收到 AVP调整命令时 ,通知所述 Diameter协议的 数据配置管理进程修改所述解码配置表, 并在所述解码配置表修改完成后, 利用所述 Diameter 协议进程将相关修改部分同步到所述运行时解码配置 表。  The method according to claim 8, wherein the method further comprises: when the network management system receives the AVP adjustment command, notifying the data configuration management process of the Diameter protocol to modify the decoding configuration table, And after the modification of the decoding configuration table is completed, the related modified portion is synchronized to the runtime decoding configuration table by using the Diameter protocol process.
10、 一种自适应编码装置, 其特征在于, 所述装置包括编码消息接收 单元、 第一 AVP配置信息获取单元和编码单元; 其中,  An adaptive coding apparatus, wherein the apparatus includes an encoded message receiving unit, a first AVP configuration information acquiring unit, and an encoding unit;
编码消息接收单元, 用于接收待编码的应用相关信息, 读取所述应用 相关信息的消息结构, 获取 AVP的相关信息;  An encoding message receiving unit, configured to receive application related information to be encoded, read a message structure of the application related information, and acquire related information of the AVP;
第一 AVP配置信息获取单元, 用于根据所述编码消息接收单元获取的 AVP的相关信息查找预先生成的运行时编码配置表, 获取与所述 AVP相关 信息对应的 AVP配置信息;  a first AVP configuration information acquiring unit, configured to search a pre-generated runtime coding configuration table according to the AVP related information acquired by the encoding message receiving unit, and obtain AVP configuration information corresponding to the AVP related information;
编码单元, 用于根据所述 AVP配置信息,对所述 AVP的相关信息进行 合法性验证,在所述 AVP的相关信息合法时,根据所述应用相关信息和 AVP 的相关信息组织生成 Diameter消息码流。  a coding unit, configured to perform legality verification on the AVP related information according to the AVP configuration information, and when the related information of the AVP is legal, organize a Diameter message code according to the application related information and the AVP related information. flow.
11、 一种自适应解码的装置, 其特征在于, 所述装置包括解码消息接 收单元、 第二 AVP配置信息获取单元和解码单元; 其中, 11. An apparatus for adaptive decoding, characterized in that the apparatus comprises a decoded message interface a receiving unit, a second AVP configuration information acquiring unit, and a decoding unit; wherein
解码消息接收单元, 用于接收待解码的 Diameter消息码流, 并解析所 述码流头部信息, 获取解码所需相关参数;  a decoding message receiving unit, configured to receive a Diameter message code stream to be decoded, and parse the code stream header information to obtain related parameters required for decoding;
第二 AVP配置信息获取单元, 用于根据所述解码消息接收单元获取的 相关参数查找预先生成的运行时解码配置表, 获取 AVP配置信息;  a second AVP configuration information acquiring unit, configured to search a pre-generated runtime decoding configuration table according to the related parameters acquired by the decoding message receiving unit, to obtain AVP configuration information;
解码单元, 用于根据所述 AVP配置信息, 对所述 Diameter消息码流中 的 AVP码流进行合法性验证, 在所述 AVP码流合法时, 将所述 AVP码流 对应的 AVP相关信息填写到根据所述 AVP配置信息和解码所需相关参数计 算出的 AVP信息存放绝对位置。  a decoding unit, configured to perform validity verification on the AVP code stream in the Diameter message code stream according to the AVP configuration information, and fill in the AVP related information corresponding to the AVP code stream when the AVP code stream is legal The AVP information calculated according to the AVP configuration information and the relevant parameters required for decoding is stored in an absolute position.
PCT/CN2010/074029 2009-08-06 2010-06-17 Method and apparatus for self-adaptive coding and decoding WO2011015089A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910162474A CN101631126B (en) 2009-08-06 2009-08-06 Self-adaptive coding/decoding method and self-adaptive coding/decoding device
CN200910162474.5 2009-08-06

Publications (1)

Publication Number Publication Date
WO2011015089A1 true WO2011015089A1 (en) 2011-02-10

Family

ID=41576071

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/074029 WO2011015089A1 (en) 2009-08-06 2010-06-17 Method and apparatus for self-adaptive coding and decoding

Country Status (2)

Country Link
CN (1) CN101631126B (en)
WO (1) WO2011015089A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171879A (en) * 2016-03-07 2017-09-15 中国移动(深圳)有限公司 A kind of detection method and device of online charging interface message

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101631126B (en) * 2009-08-06 2012-09-05 中兴通讯股份有限公司 Self-adaptive coding/decoding method and self-adaptive coding/decoding device
CN102904862B (en) * 2011-07-28 2017-12-08 中兴通讯股份有限公司 The coding/decoding method and device of a kind of code stream
CN102611530A (en) * 2012-03-08 2012-07-25 北京神州数码思特奇信息技术股份有限公司 Telecommunication data encoding method and telecommunication data decoding method
CN102761543B (en) * 2012-06-27 2016-03-16 北京中创信测科技股份有限公司 A kind of method and apparatus realizing the general encoding and decoding of Session Initiation Protocol
CN102929608A (en) * 2012-10-09 2013-02-13 大唐移动通信设备有限公司 Interface encoding/decoding method and system
CN103813306B (en) * 2012-11-08 2017-12-19 中兴通讯股份有限公司 Attribute carries method and device
CN109309670B (en) * 2018-09-07 2021-02-12 深圳市网心科技有限公司 Data stream decoding method and system, electronic device and computer readable storage medium
CN111625244B (en) * 2020-05-29 2023-04-25 华畅科技(大连)股份有限公司 ASN.1-PER dynamic and static coding and decoding method based on 3GPP protocol

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471260A (en) * 2002-07-22 2004-01-28 华为技术有限公司 Encoding and decoding method for realizing user business remote verification dialing protocol
CN101001160A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Cooling method and coder
CN101001159A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Decoding method and decoder
CN101237383A (en) * 2007-01-31 2008-08-06 华为技术有限公司 A method and system for transmitting multicast information and authorized multicast service
CN101631126A (en) * 2009-08-06 2010-01-20 中兴通讯股份有限公司 Self-adaptive coding/decoding method and self-adaptive coding/decoding device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471260A (en) * 2002-07-22 2004-01-28 华为技术有限公司 Encoding and decoding method for realizing user business remote verification dialing protocol
CN101001160A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Cooling method and coder
CN101001159A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Decoding method and decoder
CN101237383A (en) * 2007-01-31 2008-08-06 华为技术有限公司 A method and system for transmitting multicast information and authorized multicast service
CN101631126A (en) * 2009-08-06 2010-01-20 中兴通讯股份有限公司 Self-adaptive coding/decoding method and self-adaptive coding/decoding device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171879A (en) * 2016-03-07 2017-09-15 中国移动(深圳)有限公司 A kind of detection method and device of online charging interface message
CN107171879B (en) * 2016-03-07 2020-01-07 中移信息技术有限公司 Method and device for detecting online charging interface message

Also Published As

Publication number Publication date
CN101631126B (en) 2012-09-05
CN101631126A (en) 2010-01-20

Similar Documents

Publication Publication Date Title
WO2011015089A1 (en) Method and apparatus for self-adaptive coding and decoding
JP6526289B2 (en) Packet transmitting apparatus supporting downloading and streaming
EP3056014B1 (en) Method and apparatus for content delivery
EP3073712B1 (en) Url parameter insertion and addition in adaptive streaming
US6970935B1 (en) Conversational networking via transport, coding and control conversational protocols
US8868788B2 (en) Optimizing static dictionary usage for signal compression and for hypertext transfer protocol compression in a wireless network
KR20060011963A (en) Omnimodal messaging system
WO2008003257A1 (en) Method, system and device of converting information in transaction managing interface
EP1901481B1 (en) Method, system and entity for realizing an application service
WO2013170818A2 (en) Error code conversion method and system, pppoe server and mobile terminal
CN101159757B (en) Dual-home synchronous data transmission method
CN101754002A (en) Video monitoring system and realization method for dual-stream monitoring front end thereof
CN109905490B (en) Virtual simulation experiment sharing platform architecture
CN108810475B (en) Android video monitoring device based on Onvif standard and Sip protocol
KR100724940B1 (en) Contents update method of dms in dlna system
KR101104860B1 (en) Optimized trnasmitting method between media player and service using protocol converting for android mobile terminal
CN101471954A (en) Method for implementing network service, network service entity and intelligent network system
EP1361698B1 (en) Information distribution system, information processing apparatus and method
CN102045330A (en) IMS soft terminal and communication method thereof
KR101276205B1 (en) Collaborative service system using mobile device and method for providing collaborative service using mobile device in smart TV of the system
JP5940990B2 (en) APL-SCM-FE and application linkage method
CN104754400A (en) Envelope information sharing method and device based on mobile terminal
KR100844361B1 (en) Gateway system for data synchronization
CN101465861A (en) System, method and computer programming product for transmitting and/or receiving medium current
WO2014094476A1 (en) Multimedia message transmission method and device

Legal Events

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

Ref document number: 10805993

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10805993

Country of ref document: EP

Kind code of ref document: A1