WO2005057873A1 - The implementing method of universal message explainer - Google Patents

The implementing method of universal message explainer Download PDF

Info

Publication number
WO2005057873A1
WO2005057873A1 PCT/CN2004/001424 CN2004001424W WO2005057873A1 WO 2005057873 A1 WO2005057873 A1 WO 2005057873A1 CN 2004001424 W CN2004001424 W CN 2004001424W WO 2005057873 A1 WO2005057873 A1 WO 2005057873A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
decoding
encoding
protocol
type
Prior art date
Application number
PCT/CN2004/001424
Other languages
French (fr)
Chinese (zh)
Inventor
Ni Huang
Hao Wang
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2005057873A1 publication Critical patent/WO2005057873A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Definitions

  • the present invention relates to communication technologies, and in particular, to a method for implementing a universal message interpreter in a communication system.
  • Protocols in the field of communications or telecommunications are generally more complex. In the maintenance and testing of communication systems, it is necessary to understand the interaction on the communication interface. Directly observing the binary code stream on the communication interface is often difficult to know its meaning, so the message interpretation function is generally provided on the network management system or signaling tester of the communication system. Form and explain its meaning, as shown in Figure 1.
  • the key technologies of the message interpreter are the analysis and decoding functions of the message, and the data expression ability of the descriptive language.
  • ASN explained the protocol data from two aspects.
  • One aspect is the abstract representation of protocol data, which is described by X.680, X.681, X.682, and X.683, respectively.
  • X.680 specifies the basic techniques of ASN. It clearly states the notation of basic types, the construction method of basic types and composite types, the notation of composite types and the notation of simple type constraints.
  • X.681 describes the construction method of the class, the notation of the class, the notation of the object, the notation of the set of objects, the notation of the value and the set of values. It also gives a more friendly representation when type objects.
  • X.682 focuses on the notation of high-level constraints on types and classes.
  • X.683 gives some standard notation for parameterization, so that the protocol description can be more abstract, and the scope and generality of the protocol description can be improved.
  • ASN.1 Another aspect of ASN.1 is the method of specifying the transmission of abstract protocol data.
  • the essence here includes two aspects, which correspond to the sender and receiver of the communication, respectively.
  • For the sender it specifies the encoding method of the transmission code stream; for the receiver, it specifies how to decode the transmission code stream into abstract data.
  • ASN encoding methods there are currently two widely used ASN encoding methods: one is BER (basic encoding rule) and PER (compression encoding rule). These two coding rules are given in ITU standards X.690 and X.691, respectively.
  • Most protocols developed with ASN.1 use BER or PER coding.
  • the format of the BER code is relatively simple. It is stipulated that each code usually consists of three parts: identifier, length and content. As shown below:
  • the BER identifier is determined by the type itself or specified by the user. Identifiers usually have single-byte and multi-byte encodings. The single-byte encoding is shown in the figure:
  • the category number of the identifier occupies two Bits and is given by the BER standard. 00 indicates the Universal class and 1 J, 01 indicates the Application class, 10 indicates the Context-specific class, and 11 indicates the Private class. Encoding method. It is 1 when the following content encoding is encoded using the construction method, otherwise it is 0.
  • the identifier can range from 0-30.
  • the identifier value part is all set to 1, which is 11111.
  • the extension byte encodes the actual identifier value, but only the lower 7 bits of a byte are used for encoding, and the 8th bit is used to indicate whether the extension byte ends. This bit is set to indicate that there is an extended byte after it; set to 0 indicates that this byte is the last byte of the extension.
  • the first extended byte encodes the highest bit code of the identifier value, and the subsequent extended byte encodes the next lowest code of the identifier value, until the last extended byte encodes the lowest bit of the code.
  • the number of extended bytes is the minimum number of bytes for the encoding identifier value.
  • the BER length is used to encode the actual number of bytes occupied by the content portion.
  • the short format is used to encode the length value of 127 or less. Long-form coded encodings whose length values exceed 127.
  • the short format length encoding occupies one byte.
  • the lower 7 bits are used for encoding, the most significant bit is not used and is set to 0.
  • Long format length encoding occupies multiple bytes. ⁇ A byte is the initial byte. Its highest bit (eighth bit) is set to 1, and the lower 7 bits are used to indicate the number of bytes used for length encoding. The subsequent bytes are used to encode the actual length. When encoding, if the encoding byte exceeds 1 byte, the 8 bits of the first byte represent the highest weight bits of the length encoding, the subsequent bytes represent the next highest weight bits, and so on until the last byte Represents the least weighted bit of the length encoding. However, only 7 for the initial byte is used to indicate the number of bytes occupied by the length encoding, so it limits the actual number of bytes occupied by the long format length encoding to not exceed 127 bytes.
  • the indeterminate format is usually used by the user when the encoding cannot determine the length of the content part in advance.
  • the length part takes one byte, and the value of this byte is set to 0x80 (binary 10000000). Then immediately after it code the content part. After encoding the entire content part, two bytes with a value of 0 are appended at the end. Call these two bytes EOC (End Of Contents) 0 so that the actual length of the content part is the number of bytes occupied by the encoded stream between 0x80 and E0C.
  • EOC End Of Contents
  • the BER content is used to encode the ASN abstract value. These values can be of any type specified in ASN.1.
  • the encoding of each type value is determined by the type itself, but its format is composed of the three parts described above, namely the identifier part, the length part, and the content part.
  • the protocol data of a protocol can be described using the ASN.1 abstract class or abstract type.
  • a template representing the protocol data is formed.
  • a protocol template starts with a composite type, and this composite type is called a Gen type in the following description. If this protocol data template is instantiated using abstract data, a communication message often used in communication protocols is formed.
  • each abstract value constituting the communication message. How each abstract value is encoded depends entirely on the ASN type corresponding to this abstract value.
  • Each type of encoding method is specified by ITU-T standard X.690. However, the encoding format consists of the three parts described above.
  • BER coding technology starts coding from a root-type abstract data. First encode its identifier part, then the length part, then the content part. The content part encodes its various components according to the rules of the root type. For each component, the identifier part is still encoded first, then the length part, and finally the content part. If the components are still abstract data of the composite type, the coding process continues until the entire coding is completed.
  • BER coding is to start from the root type, and repeat the identifier, length, and content, and then the identifier, length, and content are nested in the content, and then the indicator, length, and content are nested in the content ... ., Until the end of the simple type identifier, length, content. Then backtrack, then nest, backtrack ... Until the entire root type abstract value components have become the form of identifier, length, content.
  • a PER coding scheme is proposed. It solves the shortcomings of the BER code stream being too long, and also largely gets rid of the impact of the identifier (TAG). Most of the type encoding does not depend on TAG, and TAG is not encoded when encoding.
  • PER coding The general idea of PER coding is this: The coding mode of identifier, length, and content is no longer used. When encoding, you only care about this part of the content, and try to compress the encoding as much as possible to minimize the number of bits in the resulting code stream.
  • the method of compression is to use the least number of bits to convey the information on the basis of effectively expressing the information.
  • the Boolean type requires three fields of identifier, length, and content, that is, three bytes to encode, and the resulting code stream has 24 bits.
  • PER coding a Boolean type, which has only two values, can be completed by only one bit. Because a type is essentially a collection of values. The various types of constraints are to narrow the scope of this set, so that it can more accurately express the required information. Compression coding (PER) is based on this essence.
  • each value in the value set is encoded using the number of bits that represent the least amount of this range, taking into account the appropriate increase in transmission requirements This number of bits is preferably a multiple of eight.
  • the type does not give a specific upper and lower bound on the set value. Special treatment is given to these two special cases.
  • the offset of the lower bound is still used to encode the value, but the number of bits used for encoding is a multiple of at least 8 bits required to encode this offset.
  • the value of the element itself in the value set is encoded.
  • the number of bits required for encoding is a multiple of at least 8 bits required to encode this value, which is the same as the content part of the BER. .
  • the coding depends on the specific situation. For things like strings, upper and lower bounds of sequences, and so on. No lower bound is equivalent to zero, so use zero as the lower bound. Otherwise, when the lower bound cannot be determined in actual application, it is treated the same as the case where there is neither the upper bound nor the lower bound.
  • each type of encoding also has an optional length part. But it only needs to be coded into the code stream to indicate the length of the value encoding only when the exact length of the value encoding cannot be determined through constraints and actual encoding rules.
  • PER also has a part similar to the BER identifier, but here is a new name called preamble (preamble d, its appearance is still optional, only when some component types of the composite type are optional)
  • preamble preamble d, its appearance is still optional, only when some component types of the composite type are optional
  • the header is used only if it has a default value, or if the composite type has special extended attributes, and it is encoded.
  • Method 1 Responsible for the decoding of a protocol through a dedicated piece of program code; however, this method has the following disadvantages:
  • Method 2 A message interpreter using a custom description language provides a protocol description description file for each supported protocol.
  • the description language uses the standard ASN.1, and the encoding method uses basic encoding rules (BER) and compression encoding rules (PER), the message interpreter only needs to write a new protocol description file when adding support for a new protocol.
  • BER basic encoding rules
  • PER compression encoding rules
  • the custom description language requires extra learning time, and lacks materials and development tools.
  • An object of the present invention is to provide a method for implementing a universal message interpreter, so as to solve the problem of poor generality and scalability in the prior art.
  • the present invention provides the following technical solutions:.
  • a method for decoding a communication interface message includes the following steps:
  • each node of the message value tree corresponds to one cell of the message, where:
  • codec control word of the cell is expressed as a compression coding rule (PER), then the decoding function of the PER is called for decoding; If the codec control word of the cell is represented as type-length-value notation (TLV), then the decoding function of the TLV is called for decoding;
  • PER compression coding rule
  • TLV type-length-value notation
  • the codec control word of a cell is expressed as a combination of multiple items in BER, PER, and TLV, the corresponding decoding function is called for decoding;
  • the abstract syntax mark 1 (ASN.1) is combined with the encoding and decoding control word to describe the protocol to be interpreted and form protocol message structure description information, and then generate the protocol dynamic library for the description information to be called;
  • the codec control word is added to the type definition in the ASN.1 text.
  • the encoding and decoding control word may be one of BER, PER, and TLV, or multiple combinations of BER, PER, and TLV.
  • a C language program that implements the constraint relationship between cells is embedded in the ASN.1 text and is included in the generated protocol dynamic library; the program is executed after decoding is completed to complete the custom constraint limit.
  • Figure 1 is a schematic diagram of the interface message interpretation result
  • FIG. 2A is a block diagram of a message interpreter system according to the present invention.
  • FIG. 2B is a main flowchart of the present invention.
  • FIG. 3 is a schematic diagram showing a graphic interface displaying a message code stream and interpreting a message
  • FIG. 4 is a schematic diagram of encoding and decoding
  • FIG. 5 is a schematic diagram of communication equipment networking
  • FIG. 6 is a schematic diagram of a description structure of a protocol message
  • Figure 7 is a protocol message type tree
  • FIG. 8 is a decoding flowchart.
  • TLV type-length-value
  • T Control of type identification, similar to the identifier (TAG) in BER, but its type value has nothing to do with BER type value.
  • L Represents the control of the length part, similar to the length in the BER, but not only the length of the content part, but also various length-related coding controls.
  • V Indicates the encoding control of the value part. This part has various control settings for the BER content part and the PER compression encoding method and value part.
  • TLV code control provided to users is as follows:
  • General Encoding Control Gives the overall encoding rules and encoding constraints and controls.
  • the expression in this section is "A
  • the value of A can be BER, PER, SCCP, T, TV, V, TLV, LTV, LV, etc.
  • the value of B is various related to encoding. Controls and constraints. Its values can be big and small: ENDIAN, alignment: BOUNDARY, PER alignment: PERALIGN, construction or tube coding: CONSTRUCTED / SIMPLE.
  • a and b are optional parameters. For example, alignment requires a parameter Indicates whether to perform alignment. ⁇ TV
  • Subcontrol Further explanation of the overall control.
  • the representation in this section is the same as the representation of the overall coding control. "The wide left side represents the control name, and the right side of T is separated by"-".
  • the first part represents the control item, and the second and subsequent parts represent the first parameter of the control item, the second parameter, in that order.
  • control items of each part of TLV are as follows:
  • the LEN control item takes a parameter to indicate how many bits the T part uses for encoding. Such as TLEN-8.
  • the ENDIAN control item has a parameter with values BIG and LITTLE, indicating whether this part is big-endian or little-endian.
  • the LEN control item takes a parameter to indicate how many bits the L part uses for encoding.
  • the ENDIAN control item has a parameter with values BIG and LITTLE, indicating whether this part is big-endian or little-endian.
  • SCALE control with a parameter specifying the scale of the L-part values. This breaks the limit of the L-part value in bytes.
  • the number of parameters is the number of bits on the L scale. For example, SCALE-2, the value of L part is 3, so its meaning is 3 2 bits.
  • the parameter can also take special values, such as CMPNT, which indicates that the length scale is a logical unit of the current type encoding. For example, using it to modify a character string means that the number of characters is taken on a scale, regardless of how many bits the character itself is encoded with.
  • the ADD / SUB control item takes a parameter, which indicates that the value of L should increase / decrease the number given by the parameter.
  • the SELF control has no parameters, indicating that the value of L needs to increase the number of bytes occupied by the L part itself.
  • the SCCPLEN control item has no parameters, which means that when the length is less than 255, one byte is used for encoding. When it is greater than 255, three bytes are used for encoding, the first byte is encoded as Oxff, and the next two bytes are used for length encoding.
  • the TO control item takes two parameters, the first parameter represents the control sub-item, and the second represents the length that needs to be filled when completing.
  • VALIGN indicates that the value encoding is aligned according to its scale. The shortcomings are complemented by the bit value given by the parameter.
  • the ALIGN value is encoded to the byte boundary, and the insufficient part is completed using the bit value given by the parameter.
  • the value control item is relatively special. Its form is TO-16-0, which indicates that the encoding of the value needs to occupy a fixed 16 bytes. If the encoding is less than 16 bytes, the value is less than 0 to 16 bytes.
  • the LEN control item takes a parameter to indicate how many bits the V part uses for encoding.
  • the ENDIAN control item has a parameter with values BIG and LITTLE, indicating whether this part is big-endian or little-endian.
  • This parameter mainly deals with the problem that one component encoding is divided by multiple components in the composite type.
  • the first parameter indicates the number of bits of the first part of the code that is divided, and the second parameter indicates the number of components of the original code.
  • EBIT control with one parameter.
  • the leftmost bit of each byte determines whether the next byte represents the code stream. The leftmost bit is set with the given parameter, which indicates that the following bytes also belong to the code stream. If it is the last byte, the left bit sets the value of the inverted parameter.
  • the BCD of the control telephone number indicates that if the encoding is not on a byte boundary, the use parameter is insufficient to the byte boundary.
  • the M1 control item encodes a bit parity bit according to the number of phone numbers before encoding the phone number. When the phone number is even, it is set to 0, otherwise it is set to 1. When the entire encoding is not on a byte boundary, the value given using the parameter is not sufficient on the byte boundary.
  • TRAIL control with one parameter. After encoding, use the value specified by the parameter as the encoding terminator.
  • the PERALIGN control has no parameters, indicating that the codes are aligned according to the alignment of the PER.
  • V itself modifies the control effect of the CHOICE type, using the index to select the components of the CHOICE.
  • the TV itself modifies the control of the CHOICE type, using the tag value to select the CHOICE component.
  • the UNION control takes a parameter that controls the encoding length of the CHOICE component.
  • the maximum length of the component type is used as the length of the entire encoding, which is similar to C language UNION. If the actual encoding is insufficient for the maximum length, the value given by the parameter is used to fill the maximum length.
  • the values are BIG and LITTLE, indicating whether it is big-endian or little-endian encoding.
  • BOUNDARY control with a parameter, the values are ALIGN and NONALIGN, indicating whether the encoding starts from an entire byte boundary.
  • PERALIGN control Takes a parameter with values of ALIGN and NONALIGN, indicating whether to perform encoding in PER alignment or encoding in non-alignment. Only valid for PER. It has no effect on other BER, TLV, SCCP, etc.
  • WHEN control Modifies the component of the composite type, which is used to execute a C-style expression to complete the selection control.
  • EMBED EXEC control item It is defined in any blank part described in the protocol ASN.
  • the content is the embedded C language program or function library, which can be used in WHEN calculation expression.
  • EXPORT control Outputs the value of the current component to an external C variable.
  • IMPORT control The value of an external C variable is introduced into the current ASN description, which is used to dynamically calculate certain constraints.
  • the message interpreter of the present invention is mainly composed of a codec engine and a graphical interface (GUI):
  • Encoding and decoding engine Responsible for decoding the input code stream according to the selected protocol dynamic library, and constructing formatted text that outputs the interpretation information of the decoded message.
  • GUI The main function is to analyze the formatted text, display the format of the message interpretation content, and complete the human-computer interaction function.
  • the ASN.1 file is compiled into a C file by the ASN conversion program.
  • the C file is compiled and linked into A protocol dynamic library of protocol characteristic information. For protocols not defined by ASN.1, the combination of ASN.1 and the aforementioned TLV coded control word is used for description.
  • the protocol dynamic library is composed of ASN.1 text input by the user, and contains information such as the structure information of all messages in the protocol, and the relationship between the cells.
  • the protocol used by the user to enter a message stream to be interpreted is interpreted.
  • the encoding and decoding engine decodes the message stream to be interpreted according to the protocol dynamic library to form a message value tree. Each node on the tree is a cell of the message. Wherein during decoding: if the protocol codec control word of the cell is expressed as a basic coding rule (BER), then call
  • the decoding function of BE performs decoding; if the codec control word of the cell is expressed as a compression coding rule (PER), the decoding function of the PER is called for decoding; if the codec control word of the cell is expressed as type-length-value notation (TLV), calling the decoding function of the TLV for decoding; if the codec control word of the cell is expressed as a combination of multiple items in BER, PER, and TLV, the corresponding decoding functions are respectively called for decoding.
  • PER compression coding rule
  • TLV type-length-value notation
  • the encoding and decoding engine traverses the value tree to generate hierarchical formatted text
  • the GUI interface analyzes the output text stream of the codec engine and forms an interpretation relation tree, and displays this relation tree and code stream on the interface to complete the entire message interpretation process.
  • the display interface is shown in Figure 3.
  • the ASN compiler supports encoding and decoding control such as TLV, and the encoding and decoding control words can be mixed with BER and PER ⁇ .
  • the standard ASN.1 specification only supports the use of BER or PER encoding rules for the entire file or module. The following is part of the ASN text of the ITU-T H.248 protocol. In practice, either the BER rule or the PER rule is used. As follows:
  • ThreeByte ⁇ V, V
  • HexString :: VisibleString (FROM (48..57
  • 65..70))- ⁇ '. ⁇ .'9', ' ⁇ '. HexStringl :: VisibleString (FROM (48..57))
  • Dtmfstring "VisibleString (FROM (48..57
  • 65..70))-Printablestring:: ⁇ V, V
  • the ASN compiler When the ASN compiler compiles ASN text, it generates a Ttype structure for each type.
  • the Ttype structure contains the encoding and decoding control rules for each type. That is, the part in the " ⁇ >" in the ASN text in the above example can be BER, PER or custom TLV.
  • the user does not display the defined type and will automatically calculate his codec control word based on the inheritance relationship.
  • the codec public function library a set of codec functions are implemented for the BER, PER, and TLV rules.
  • the codec library provides users with a unified codec function interface. Its implementation principle is to call the encoding and decoding function of the corresponding encoding rule for encoding and decoding according to the records of the encoding rules in the type Ttype to be decoded. For example, when decoding the link-select-code cell in the example, the decoding function of the PER rule is called to decode, and when the circuit-identification-code is decoded, the decoding function of the BER rule is called to decode. When the decoding reaches the originating-point-code cell, the cell of the TLV rule is automatically called for decoding. In this way, a variety of encoding and decoding rules are mixed in one module. At the same time, it ensures that when new coding and decoding rules appear, it is very easy to expand, as shown in Figure 4 below.
  • the implementation of the present invention separates the compiler and the codec.
  • the compiler and codec are relatively independent, and any extension to the codec will not have any impact on the compiler.
  • the compiler translates the abstract description of ASN.1 into the abstract type intermediate form of the target programming language, and the user instantiates this abstract type intermediate form to form an abstract value intermediate form.
  • the intermediate form of the abstract value is the intermediate form of the abstract type, it has the same tree structure hierarchy.
  • each node of the value (tree) corresponds to each node of the type (tree), and each node in the value tree is an instantiation of a node of the corresponding type tree. It is because of this relationship that in the unified interface of all codec functions, there is no need to specify the abstract type intermediate form, because the abstract value intermediate form can refer to the corresponding abstract type intermediate form.
  • the decoding process reconstructs the intermediate form of the abstract value according to the code stream, that is, the abstract value tree.
  • the intermediate form of the abstract type must be specified as the basis for decoding.
  • the abstract value intermediate form and the abstract value tree have the same meaning
  • the abstract type intermediate form and the abstract type tree have the same meaning.
  • the unified interface of the encoding function is given by five parameters: a buffer pointer for storing the result code stream; the buffer size indicating the buffer storage capacity; the starting position of the encoding (relative to the buffer Start position); the actual encoding length returned to the user; an abstract value tree pointer representing abstract data.
  • the unified interface of the decoding function is composed of six parameters: a buffer pointer that stores the stream to be decoded; the length of the stream; the starting position of the decoding start (relative to the starting position of the buffer); The decoding length of the user; an abstract type tree pointer representing the decoding basis, which can be a subtree of the overall abstract type tree; and finally, an abstract value tree representing the decoding result returned to the user.
  • the core of the entire codec process is the codec engine, which is essentially a scheduler, and the scheduling is based on the abstract type intermediate form (abstract type tree) generated by the ASN compiler.
  • the abstract type tree contains encoding control information, which is specified by the user when writing the ASN description file.
  • the codec engine completes the codec control specified by the user on the one hand, and calls the specific codec function in the codec library on the other hand to complete the codec.
  • the codec engine checks whether the user has embedded the target language program code that implements the constraint relationship between the cells. If so, run the user-defined program to complete the custom constraint restrictions.
  • the codec engine has four main tasks: initialize the engine, create a running environment in which the user embeds the target program code; search for a suitable encoding function to complete the encoding; retrieve a suitable decoding function, complete the decoding; for each abstract value node Find and run user embed code.
  • initialize the engine creates a running environment in which the user embeds the target program code
  • search for a suitable encoding function to complete the encoding
  • retrieve a suitable decoding function complete the decoding
  • the user sends an encoding request to the codec module through an API function.
  • the API encoding function obtains the abstract value tree provided by the user, and then allocates a data buffer for the resulting code stream. After preparing the encoding relative position and storing the parameters of the actual encoding length and the abstract value tree, control is passed to the codec engine.
  • the codec engine refers to each node of the abstract value, references its corresponding abstract type node, takes its encoding control, analyzes it, and sets various encoding control parameters. Obtain appropriate 'codec functions in the decoding library (PER library, BER ⁇ , TLV library, etc.) for encoding. Because the abstract value is a tree-like structure in nature, the search engine will call each codec function recursively according to the instructions of the codec control to complete the encoding of the entire message.
  • the decoding library PER library, BER ⁇ , TLV library, etc.
  • the user sends a decoding request to the codec module through the API function.
  • the API decoding function searches the protocol database according to the protocol name provided by the user to find the abstract type tree that needs to be decoded. Then prepare other decoding standard interface parameters, and finally give control to the decoding engine.
  • the decoding engine extracts the encoding control according to the description of the abstract type tree, sets the corresponding control parameters, and according to the type tree, calls the decoding function in the corresponding decoding library recursively to complete the decoding of the entire code stream. The actual decoded length and an abstract value tree reflecting the decoded result are then returned to the user.
  • the codec engine Before the codec engine works, it always initializes the codec engine. This initialization work mainly completes the allocation of the storage space of the user-defined export encoding, so that it is convenient for the codec engine to perform the corresponding import and export and the operation of the functional relationship in the future. Initialization is performed only once in each API codec.
  • the codec engine always completes the above encoding or decoding process when iterative encoding and decoding, and then executes the user-defined codec control program of the abstract type tree. After the codec engine completes the entire codec process, it returns control to the codec's API functions, and finally returns to the user program for execution.
  • the compiler compiles the ASN description file into an intermediate form of the ASN abstract type (the abstract form TType of the target language and a small number of values TValue). This form is exactly the same for all ASN types.
  • the compiler also compiles the intermediate form of the abstract value (the abstract form form of the target language TValue) for the values that exist in the ASN description file such as the default value, object identifier, and so on, and then the compiler types the TType and TValue that exist at this time. Connected. But at this time, the abstract type intermediate form (TType) is conceptually only the target language version of the ASN abstract description, and it is not a form that is actually applied to actual applications.
  • the encoding process of the codec module is like this.
  • the abstract type instantiation module completes the process of TValue construction, and also completes the matching of the abstract value TValue (tree) and the abstract type TType (tree).
  • This matching process ensures that each node in the TValue (tree) is associated with the corresponding node in the TType (tree), that is, each value node has a type node corresponding to it.
  • the parameters of all encoding functions become extremely simple, requiring only four parameters: a pointer to the TValue abstract value (tree), an encoding buffer, the starting position of the encoding, and the size of the encoding buffer.
  • the decoding process is similar to the encoding process. Its decoding function implements a decoding function for each ASN abstract type for each encoding rule. And the parameters of all decoding functions are exactly the same: a TType type that indicates the type of code stream, a TValue that stores the message instance, a buffer containing the code stream, an actual decoding length that is output to the user, and an indication of the code stream The parameter of the buffer size.
  • the decoding engine searches for the decoding function of the corresponding ASN abstract type, completes the decoding of this abstract type, and stores the decoded data in TValue.
  • the LEN control is introduced for the T part to specify the length of the T part.
  • Part T uses this length for encoding. It can take all the values that this bit length can represent, thus breaking the limit of one byte (8 bits) that can only represent 0-30.
  • Each component of the protocol can specify their overall encoding control, so, you can Realize mixed encoding of BER, PER, SCCP, TLV, TV, V, LV, LTV, T, etc., greatly increasing the flexibility of encoding.
  • SCCP can be individually coded after overall coding control, SCCP special needs coding can be completed.
  • the arbitrary selection of the coding control of T, L, and V can meet the requirement that the user can only need one, two, or all three of the TLVs for dynamic combination coding.
  • PER can perform alignment and non-alignment encoding of PER through its own encoding control. By specifying different PER alignment methods for different parts, PER can even achieve mixed encoding of different alignment types of PER.
  • each part has ENDIAN encoding control, so it can realize mixed endianness control.
  • Control functions such as the identifier part, length part, content part alignment, big and small end, encoding bit number control, length field encoding meaning setting, length field numerical scale, etc. can be completed by setting each control item.
  • control items controlled by C language functions can be added to the protocol description, in this way, the relationship between components can be described by C language relational expressions, thereby completing the function of constraint control between components.
  • Each value can be output through EXPORT, and then the function in EMBED C is called for processing. Finally, it can be set to the value through IMPORT, so that the relevant value can be calculated from one or more known values.
  • communication device A is connected to device B and device C, and communication between devices A and B is performed according to a communication protocol Protocol AB, and communication between devices A and C is performed according to a communication protocol Protocol AC.
  • the message interpretation process is as follows:
  • the message interpreter uses a common decoding function library to decode the message code stream according to the message structure defined in the protocol dynamic library to form a decoded message value tree.
  • the message interpreter follows the class of each node in the value tree. Type the corresponding string, and the interpreter traverses each node of the value tree, so as to generate and output the formatted text with hierarchical structure for the entire message content; in order to observe the message graphically, analyze the output formatted text stream to form Interpret the relationship tree and graphically display the relationship tree and message code stream.
  • the protocol is described as follows:
  • the message structure of the protocol contained in the converted protocol dynamic library is a table that records the various types of definitions in the protocol and a protocol message type that reflects the various types of relationships in the protocol and the composition of the messages in the protocol. Tree, see Figure 7 and the table below.
  • INT8 is generated by the basic type INTEGER V, VLEN-8 0--255
  • UINT8 is generated by the basic type INTEGER V, V
  • Blue T16 is generated by the basic type INTEGER V, VLen-16 0-65535
  • the code stream is: 0x80 0xf5 0x00 0xF4, and the protocol is ab. Refer to FIG. 7 and FIG. 8.
  • the decoding process is as follows:
  • the message interpreter loads the protocol ab.dll into the memory, and the structure of the message of the protocol ab and various types of definition information used in the structure are put into the memory and can be queried.
  • node encoding and decoding control words (BER, PER, TLV) and the subtypes of the combined type, find the node whose first type is the basic type from its children or grandchildren.
  • the root node of the protocol message found from ab.dll is Msg, which is a conforming type, and the encoding control word is V.
  • the V composite type node itself does not generate a code stream, so the root node can be constructed based on the information of the type tree directly on the value tree generated by the encoding, and then the information from the code stream should correspond His son decodes it.
  • ⁇ A son is al and the type is INT8. It can be found from the type table that INT8 is INTERGER and the encoding control word is V.
  • the cells bl, a, and b are solved in turn, and the value tree of the message is gradually generated, and the message decoding process is completed.
  • the decoded message is as follows:
  • the interface message interpreter of the present invention works on the basis of a general description of the protocol. In this way, when the protocol changes, as long as the description of the protocol is changed, there is no need to modify the program of the interface message interpreter itself, so that it has the greatest general Sex. Due to the widespread use of ASN.1, many standard interface protocols are described in ASN.1 language, which can save a lot of protocol description workload. In order to solve the problem of not describing the protocol formulated by ASN.1, the encoding control word of TLV is extended on ASN.1, the protocol is expressed by an extensible notation, and the C code can be embedded in the description file Processing the code stream makes it possible to describe these protocols with ASN.1 and is more convenient.
  • the invention solves the shortcomings of existing message interpreters, such as poor generality and difficult expansion, adopts the ASN.1 standard in the description file, and extends the encoding and decoding methods supported by the ASN.1 standard so that it can well support It is not a protocol that uses ASN.1 to describe the message structure, which makes the application of this scheme wider.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a method of decoding and explaining communication interface message, the invention is: first, depicting the message structure in the communication protocol by combining the ASN.1 and encoding decoding control word notation, generating protocol dynamic library; sending the message code flow and protocol dynamic library corresponding to message code flow to message explamer, the message explamer decodes by using function in the public decode function library, in course of decoding, searching whether the type, encode decode control work of cell in the protocol dynamic library is BER, PER or TLV, and using corresponding decoding function to decode and generating message value tree according the celi control word representation; ransacking each node of the value tree, thereby generating formatting text having layered structure and outputting; analyzing output formatting text flow, generating explain relation tree and displaying the relation tree and message code flow in manner of graph.

Description

通用消息解释器的实现方法  Implementation method of universal message interpreter
技术领域 Technical field
本发明涉及通信技术, 尤其涉及通信系统中通用消息解释器的实现方 法。  The present invention relates to communication technologies, and in particular, to a method for implementing a universal message interpreter in a communication system.
背景技术 Background technique
通信或电信领域的协议一般都较为复杂, 在通信系统的维护和测试中, 需要了解通信接口上的交互情况。直接观察通信接口上的二进制码流往往艮 难知道其含义,因此在通信系统的网管系统或信令测试仪等系统上一般都提 供消息解释功能,.把需要观察的码流转换成易理解的形式并解释其含义, 如 图 1所示。  Protocols in the field of communications or telecommunications are generally more complex. In the maintenance and testing of communication systems, it is necessary to understand the interaction on the communication interface. Directly observing the binary code stream on the communication interface is often difficult to know its meaning, so the message interpretation function is generally provided on the network management system or signaling tester of the communication system. Form and explain its meaning, as shown in Figure 1.
最初的消息解释器都是专用型的,一种消息解释器只能解释一种协议或 者相类似的一些协议。 随着通信协议的逐渐增多, 为每一种协议编写一个新 的解释器就显得效率很低了,而且协议的修改和升级也会导致消息解释器的 修改。  The original message interpreters were specialized. A message interpreter can only interpret one protocol or similar protocols. With the gradual increase of communication protocols, writing a new interpreter for each protocol appears to be inefficient, and modification and upgrade of the protocol will also lead to modification of the message interpreter.
在 ASN.1 出现以前, 大部分消息解释器都是采用自己定义的描述语言 来进行协议的描述的。 随着电信协议采用 ASN.1 越来越多, 消息解释器基 于 ASN.1 就成为一种自然的选择。  Before the advent of ASN.1, most message interpreters used a self-defined description language to describe the protocol. With the increasing adoption of ASN.1 in telecommunication protocols, message interpreters have become a natural choice based on ASN.1.
消息解释器的关键技术就是消息的分析和解码功能, 以及描述性语言的 数据表达能力。  The key technologies of the message interpreter are the analysis and decoding functions of the message, and the data expression ability of the descriptive language.
随着信息技术的发展, 在电信领域和计算机技术领域出现了很多通信协 议。 这些协议的目的是使得通信的双方对它们将要进行的活动能够规范化的 进行。 协议保证了对活动认知的明确性和一致性。  With the development of information technology, many communication protocols have appeared in the field of telecommunications and computer technology. The purpose of these agreements is to enable the communicating parties to standardize their activities. The agreement guarantees a clear and consistent understanding of the activity.
这种协议的描述, 在以前通常都是以一种文本化的格式通过标准的形式 提供给用户。 通过这样的协议文本和文本中包含的图示, 用户可以清晰的了 解协议通信的交互过程, 以及交互过程中使用的协议数据类型和协议数据格 式。 这些协议数据类型和协议数据格式虽然使得用户可以清晰的认识到通信 双方或者多方之间交互的数据形式和内容, 但是用户却难以使用一种有效的 简单的机制去检查和验证这些数据。 即使为了解决工程实际当中的问题, 用 户自发研制出了相应的技术, 但是缺乏统一的技术使用标准, 使得各个不同 用户之间交互变得更加困难。 于是, 国际电联(ITU-T )提出了标准的协议 数据描述抽象记法以及抽象协议数据的传输表达方法。 这就是抽象语法记法 1 ( ASN.1 - Abstract Syntax Notation One )。 Descriptions of such protocols were previously provided to users in a standard format in a textual format. Through such protocol text and the diagrams contained in the text, users can clearly understand the interactive process of protocol communication, and the protocol data type and protocol data format used in the interactive process. Although these protocol data types and protocol data formats allow users to clearly understand the data form and content of communication between two or more communication parties, it is difficult for users to use an effective Simple mechanism to check and verify this data. Even though users have developed the corresponding technology spontaneously in order to solve the problems in the actual project, the lack of a unified standard for the use of technology makes interaction between different users more difficult. Therefore, the International Telecommunication Union (ITU-T) proposed a standard protocol data description abstract notation and an abstract protocol data transmission expression method. This is Abstract Syntax Notation One (ASN.1-Abstract Syntax Notation One).
ASN从两个方面对协议数据进行了说明。一个方面是协议数据的抽象表 达方法, 分别由 X.680, X.681 , X.682和 X.683进行说明。 X.680规定了 ASN 的基本技法。 它明确的说明了基本类型记法, 基本类型构造复合类型的构造 方法以及复合类型的记法和简单类型约束的记法。 X.681 说明了类的构造方 法、 类的记法、 对象的记法, 对象集合记法, 值以及值集合的记法。 它还给 出了类型对象化时一种较为友好的表示方法。 X.682 则集中考虑如何对类型 和类进行高级约束的记法, 它的目的是尽量缩小原类型和原类的值和对象的 涵盖范围, 目的在于更加具体化原类型和类。 X.683 给出了参数化的一些标 准记法, 这样使得协议描述能够更加抽象化, 进而提高协议描述的适用范围 和通用性。  ASN explained the protocol data from two aspects. One aspect is the abstract representation of protocol data, which is described by X.680, X.681, X.682, and X.683, respectively. X.680 specifies the basic techniques of ASN. It clearly states the notation of basic types, the construction method of basic types and composite types, the notation of composite types and the notation of simple type constraints. X.681 describes the construction method of the class, the notation of the class, the notation of the object, the notation of the set of objects, the notation of the value and the set of values. It also gives a more friendly representation when type objects. X.682 focuses on the notation of high-level constraints on types and classes. Its purpose is to minimize the coverage of the values and objects of the original type and the original class. The purpose is to specify the original types and classes. X.683 gives some standard notation for parameterization, so that the protocol description can be more abstract, and the scope and generality of the protocol description can be improved.
ASN.1的另一方面是规定抽象协议数据的传输表达方法。 这里的实质包 含两个方面, 分别对应着通信的发送方和接收方。 对于发送方, 它规定了传 输码流的编码方法; 而对于接收方, 它规定了如何将传输码流解码成抽象数 据的方法。在电信领域, 目前得到广泛的 ASN编码方法有两种: 一种是 BER (基本编码规则)和 PER (压缩编码规则)。 这两种编码规则分别在国际电 联标准的 X.690和 X.691中给出。 用 ASN.1制定的协议大都采用了 BER或 者 PER编码方式。  Another aspect of ASN.1 is the method of specifying the transmission of abstract protocol data. The essence here includes two aspects, which correspond to the sender and receiver of the communication, respectively. For the sender, it specifies the encoding method of the transmission code stream; for the receiver, it specifies how to decode the transmission code stream into abstract data. In the field of telecommunications, there are currently two widely used ASN encoding methods: one is BER (basic encoding rule) and PER (compression encoding rule). These two coding rules are given in ITU standards X.690 and X.691, respectively. Most protocols developed with ASN.1 use BER or PER coding.
BER编码的格式比较筒单, 规定通常每一种编码都由三部分组成: 标识 符、 长度和内容组成。 如下图所示:  The format of the BER code is relatively simple. It is stipulated that each code usually consists of three parts: identifier, length and content. As shown below:
BER标识符由类型自身决定或者由用户指定得到。标识符通常有单字节 方式和多字节两种编码方式。 单字节的编码方式如图所示:  The BER identifier is determined by the type itself or specified by the user. Identifiers usually have single-byte and multi-byte encodings. The single-byte encoding is shown in the figure:
标识符的类别号占用两个 Bits, 由 BER标准给出。 00表示 Universal类 另1 J , 01表示 Application类别, 10表示 Context-specific类别, 11表示 Private 类别。 编码方式, 当后边的内容编码使用构造方式编码时为 1 , 否则为 0。 标识符的取值范围为 0 - 30。 The category number of the identifier occupies two Bits and is given by the BER standard. 00 indicates the Universal class and 1 J, 01 indicates the Application class, 10 indicates the Context-specific class, and 11 indicates the Private class. Encoding method. It is 1 when the following content encoding is encoded using the construction method, otherwise it is 0. The identifier can range from 0-30.
当标识符值超过 30 时, 需要对上边的标识符编码做扩展。 扩展的方法 时将标识符值部分全置为 1 , 也就是 11111。 扩展字节对实际的标识符值进行 编码, 但是编码时只使用一个字节的低 7位, 而第 8位用来说明扩展字节是 否结束。 该位置 1 , 表示后面还有扩展字节; 置 0表示本字节是扩展的最后 一个字节。 在编码时, 第一个扩展字节编码标识符值的最高位码子, 后续扩 展字节编码标识符值的次低位码子, 直到最后一个扩展字节编码最低位的码 子。 扩展字节的个数为编码标识符值的最小字节数。  When the identifier value exceeds 30, the above identifier encoding needs to be extended. In the extended method, the identifier value part is all set to 1, which is 11111. The extension byte encodes the actual identifier value, but only the lower 7 bits of a byte are used for encoding, and the 8th bit is used to indicate whether the extension byte ends. This bit is set to indicate that there is an extended byte after it; set to 0 indicates that this byte is the last byte of the extension. During encoding, the first extended byte encodes the highest bit code of the identifier value, and the subsequent extended byte encodes the next lowest code of the identifier value, until the last extended byte encodes the lowest bit of the code. The number of extended bytes is the minimum number of bytes for the encoding identifier value.
BER长度用来编码内容部分占用的实际字节个数。长度的编码有确定格 式和不确定格式两种。 确定格式有长格式和短格式两种。 短格式用来编码长 度值小于等于 127的编码形式。 长格式编码长度值超过 127的编码形式。  The BER length is used to encode the actual number of bytes occupied by the content portion. There are two types of length encoding: definite format and indeterminate format. Make sure there are two formats, long format and short format. The short format is used to encode the length value of 127 or less. Long-form coded encodings whose length values exceed 127.
短格式长度编码占用一个字节。 编码时使用低 7位, 最高位不被使用, 并且被置为 0。  The short format length encoding occupies one byte. The lower 7 bits are used for encoding, the most significant bit is not used and is set to 0.
长格式长度编码占用多个字节。笫一个字节为初始字节,它的最高位(第 8位)置为 1, 低 7位用来表示长度编码使用的字节数。 后续字节用来编码实 际的长度。 在编码时, 如果编码字节超过 1个字节, 则第一个字节的 8位表 示长度编码的最高权值位, 后续字节表示次高权值位, 依次类推, 直到最后 一个字节表示长度编码最低权值位。 但是用于初始字节只有 7为用来表示长 度编码占用的字节数, 所以它就限制了长格式长度编码占用的实际字节数不 能超过 127个字节。  Long format length encoding occupies multiple bytes.笫 A byte is the initial byte. Its highest bit (eighth bit) is set to 1, and the lower 7 bits are used to indicate the number of bytes used for length encoding. The subsequent bytes are used to encode the actual length. When encoding, if the encoding byte exceeds 1 byte, the 8 bits of the first byte represent the highest weight bits of the length encoding, the subsequent bytes represent the next highest weight bits, and so on until the last byte Represents the least weighted bit of the length encoding. However, only 7 for the initial byte is used to indicate the number of bytes occupied by the length encoding, so it limits the actual number of bytes occupied by the long format length encoding to not exceed 127 bytes.
不确定格式通常被用户用在编码事先不能确定内容部分长度的场合。 长 度部分占用一个字节, 这个字节的值被置为 0x80 (二进制 10000000 )。 然后 紧接着它的后面编码内容部分。 整个内容部分编码完成后, 最后附加两个值 为 0的字节。 将这两个字节叫做 EOC ( End Of Contents )0 这样内容部分实际 的长度就是处于 0x80和 E0C之间的编码流占用的字节数。 The indeterminate format is usually used by the user when the encoding cannot determine the length of the content part in advance. The length part takes one byte, and the value of this byte is set to 0x80 (binary 10000000). Then immediately after it code the content part. After encoding the entire content part, two bytes with a value of 0 are appended at the end. Call these two bytes EOC (End Of Contents) 0 so that the actual length of the content part is the number of bytes occupied by the encoded stream between 0x80 and E0C.
BER内容用来编码 ASN抽象值。这些值可以是 ASN.1规定的任意类型。 每一个类型值的编码都是由类型本身决定, 但是它的格式都是由上面叙述的 三部分构成, 即标识符部分、 长度部分和内容部分。  The BER content is used to encode the ASN abstract value. These values can be of any type specified in ASN.1. The encoding of each type value is determined by the type itself, but its format is composed of the three parts described above, namely the identifier part, the length part, and the content part.
一个协议的协议数据可以使用 ASN.1抽象类或者抽象类型进行描述,从 而形成一个表示协议数据的模板。 在实际协议数据的描述中, 一个协议模板 都是由一个复合类型开始, 而这个复合类型, 在以后的描述中叫做艮类型。 如果使用抽象数据实例化这个协议数据模板, 就形成了通信协议种经常使用 的通信消息。 The protocol data of a protocol can be described using the ASN.1 abstract class or abstract type. A template representing the protocol data is formed. In the description of actual protocol data, a protocol template starts with a composite type, and this composite type is called a Gen type in the following description. If this protocol data template is instantiated using abstract data, a communication message often used in communication protocols is formed.
如果在工程实际当中, 需要对通信消息进行 BER编码,那么就对构成通 信消息的每一个抽象值进行 BER编码。 而每一个抽象值如何编码,这完全决 定于和这个抽象值对应的 ASN类型。 每一种类型的编码方法由 ITU-T的标 准 X.690规定。 但编码的格式由前面叙述的三部分构成。  If in the engineering practice, it is necessary to perform BER encoding on the communication message, then perform BER encoding on each abstract value constituting the communication message. How each abstract value is encoded depends entirely on the ASN type corresponding to this abstract value. Each type of encoding method is specified by ITU-T standard X.690. However, the encoding format consists of the three parts described above.
从这里可以得知, BER编码技术就是从一个根类型的抽象数据开始进行 编码。 首先编码它的标识符部分, 然后是长度部分, 接着是内容部分。 内容 部分, 按照根类型的规定, 编码它的各个组成部分。 对于各个组成部分, 仍 然是先编码标识符部分, 然后是长度部分, 最后是内容部分。 如果组成部分 仍然是复合类型的抽象数据, 则继续递规上边的编码过程, 直到完成整个编 码。  It can be known from this that BER coding technology starts coding from a root-type abstract data. First encode its identifier part, then the length part, then the content part. The content part encodes its various components according to the rules of the root type. For each component, the identifier part is still encoded first, then the length part, and finally the content part. If the components are still abstract data of the composite type, the coding process continues until the entire coding is completed.
BER编码从形式上看就是从根类型开始, 不断重复标识符、长度、 内容, 内容中再嵌套标识符、长度、内容,然后内容再嵌套表示符、长度、内容, ......, 直到最后简单类型的标识符、 长度、 内容。 然后回溯, 然后再嵌套, 再回 溯 ......。 直到整个根类型抽象值的成分都变成了标识符、 长度、 内容这种形 式。  In terms of form, BER coding is to start from the root type, and repeat the identifier, length, and content, and then the identifier, length, and content are nested in the content, and then the indicator, length, and content are nested in the content ... ., Until the end of the simple type identifier, length, content. Then backtrack, then nest, backtrack ... Until the entire root type abstract value components have become the form of identifier, length, content.
在 BER基础上提 PER编码方案。 它解决了 BER编码流过长的缺点, 也 从很大程度上摆脱了标识符(TAG ) 的影响, 主要是大部分的类型编码不依 赖于 TAG, 并且编码时, 并不对 TAG进行编码。  On the basis of BER, a PER coding scheme is proposed. It solves the shortcomings of the BER code stream being too long, and also largely gets rid of the impact of the identifier (TAG). Most of the type encoding does not depend on TAG, and TAG is not encoded when encoding.
PER编码的大体思想是这样的: 不再使用标识符、 长度、 内容这样的编 码的模式。 在编码的时候仅仅关心内容这一个部分, 而且在具体编码时尽量 对编码进行压缩, 使得结果码流的比特数最少。  The general idea of PER coding is this: The coding mode of identifier, length, and content is no longer used. When encoding, you only care about this part of the content, and try to compress the encoding as much as possible to minimize the number of bits in the resulting code stream.
压缩的方法是在有效表达信息的基础上, 尽量使用最少的比特数传达信 息。 比如在 BER中, 布尔类型需要标识符、 长度、 内容三个域即三个字节编 码, 结果码流就有 24个比特。 而在 PER编码中, 表达布尔类型这种只含有 两个值的类型, 只需要 1个比特就可以完成任务。 由于类型从本质上讲就是值的集合。 类型的各种约束就是缩小这种集合 的范围, 使之更能准确的表达所需的信息。 压缩编码(PER ) 就是利用这个 本质进行, 对这些值集合(包括类型和约束类型) 不在使用原来值集合每一 元素的本身的值, 而是使用集合元素相对于集合小值边界的偏移进行编码。 当值集合的上界和下界都存在, 而且在一个适当的范围比如 64K, 则值集合 中的每一个值都使用表示这个范围最少的比特数进行编码, 同时考虑到传输 的要求适当的增大这个比特数, 使之最好是 8的倍数。 当然有时类型并没有 给出具体的集合值的上界和下界。 对于这两种特殊情况进行特殊的处理。 The method of compression is to use the least number of bits to convey the information on the basis of effectively expressing the information. For example, in BER, the Boolean type requires three fields of identifier, length, and content, that is, three bytes to encode, and the resulting code stream has 24 bits. In PER coding, a Boolean type, which has only two values, can be completed by only one bit. Because a type is essentially a collection of values. The various types of constraints are to narrow the scope of this set, so that it can more accurately express the required information. Compression coding (PER) is based on this essence. For these value sets (including types and constraint types), instead of using the original value of each element of the original value set, the offset of the set element relative to the small value boundary of the set is used. coding. When both the upper and lower bounds of the value set exist, and in an appropriate range, such as 64K, each value in the value set is encoded using the number of bits that represent the least amount of this range, taking into account the appropriate increase in transmission requirements This number of bits is preferably a multiple of eight. Of course, sometimes the type does not give a specific upper and lower bound on the set value. Special treatment is given to these two special cases.
对于没有只有下界没有上界, 仍然使用对下界的偏移对值进行编码, 但 是编码使用的比特位数是编码这个偏移所需的最少 8比特的倍数。  For no lower bound and no upper bound, the offset of the lower bound is still used to encode the value, but the number of bits used for encoding is a multiple of at least 8 bits required to encode this offset.
对于既没有上界也没有下界的情况, 对值集合中元素本身的值进行编 码, 同样编码所需的位数是编码这个值所需的最少 8比特的倍数, 也就是和 BER的内容部分相同。  For the case where there is neither an upper bound nor a lower bound, the value of the element itself in the value set is encoded. Similarly, the number of bits required for encoding is a multiple of at least 8 bits required to encode this value, which is the same as the content part of the BER. .
对于只有上界没有下界的情况,编码视具体的情况而定。对于像字符串、 序列的上下界等等。 没有下界和下界为零是等效的, 则使用零作为下界。 否 则, 在实际应用中也不能确定下界时, 就和既没有上界也没有下界的情况等 同对待。  For the case where there is only an upper bound and no lower bound, the coding depends on the specific situation. For things like strings, upper and lower bounds of sequences, and so on. No lower bound is equivalent to zero, so use zero as the lower bound. Otherwise, when the lower bound cannot be determined in actual application, it is treated the same as the case where there is neither the upper bound nor the lower bound.
在 PER编码中, 每一种类型的编码也有可选的长度部分。但它仅仅在通 过约束和实际的编码规则无法断定值编码确切长度时, 才需要编入码流中, 指示值编码的长度。  In PER encoding, each type of encoding also has an optional length part. But it only needs to be coded into the code stream to indicate the length of the value encoding only when the exact length of the value encoding cannot be determined through constraints and actual encoding rules.
和长度部分有些类似, PER也有类似于 BER标识符的部分, 但是这里 有一个新的名字叫做报头(preamble d 它的出现仍然是可选的, 仅仅当复合 类型的某些成分类型是可选的或者具有缺省值, 或者这个复合类型具有特殊 的扩展属性时, 才使用报头, 并且对它进行编码。  Similar to the length part, PER also has a part similar to the BER identifier, but here is a new name called preamble (preamble d, its appearance is still optional, only when some component types of the composite type are optional) The header is used only if it has a default value, or if the composite type has special extended attributes, and it is encoded.
在现有技术中, 对通信接口的消息解释主要有两种方法:  In the prior art, there are two main methods for message interpretation of a communication interface:
方法一、 通过专用的一段程序代码来负责一种协议的解码; 但该方法存 在以下不足:  Method 1: Responsible for the decoding of a protocol through a dedicated piece of program code; however, this method has the following disadvantages:
1、 对用户的要求高, 用户不仅需要了解协议的细节, 还需要实现协议 中所有消息的分析过程。 2、 维护困难, 协议修改都需要重新修改、 编译代码。 1. High requirements for users. Users not only need to understand the details of the protocol, but also need to implement the analysis process of all messages in the protocol. 2. Maintenance is difficult. Modification of the protocol requires re-modification and code compilation.
3、 扩展性差, 新增加协议需要新写代码。  3. Poor scalability. New protocols need to be written.
方法二、 采用自定义描述语言的消息解释器, 对每一个支持的协议都提 供一个协议描述描述文件, 描述语言采用标准的 ASN.1 , 编码方式用基本编 码规则 (BER )和压缩编码规则 (PER ), 消息解释器增加对新协议支持时只 需要编写新的协议描述文件。 虽然采用方法二使得消息解释器的公共部分可 以得到 艮好的重用, 但仍存在以下缺点:  Method 2: A message interpreter using a custom description language provides a protocol description description file for each supported protocol. The description language uses the standard ASN.1, and the encoding method uses basic encoding rules (BER) and compression encoding rules ( PER), the message interpreter only needs to write a new protocol description file when adding support for a new protocol. Although the second method is adopted to make the common part of the message interpreter reusable, it still has the following disadvantages:
1、 自定义描述语言的数据表达能力有限,不能直接处理大量提供 ASN.1 描述的协议 , 需要提供额外的转换功能来辅助实现。  1. The data description ability of the custom description language is limited, and it cannot directly handle a large number of protocols that provide ASN.1 descriptions. It needs to provide additional conversion functions to assist implementation.
2、 自定义的描述语言需要付出额外的学习时间, 而且资料和开发工具 缺乏。  2. The custom description language requires extra learning time, and lacks materials and development tools.
3、描述语言采用标准 ASN.1 , 目前 ASN.1标准中使用的只有 BER, PER 两种常用编码方式, 而用纯 ASN.1不能对没有采用 ASN.1协议的消息码流 进行解码, 通用性差。  3. The description language adopts the standard ASN.1. Currently, only two commonly used encoding methods: BER and PER are used in the ASN.1 standard. Pure ASN.1 cannot decode the message stream without the ASN.1 protocol. Poor sex.
发明内容 Summary of the invention
本发明的目的在于提供一种通用消息解释器的实现方法, 以解决现有 技术存在通用性和扩展性差的问题。  An object of the present invention is to provide a method for implementing a universal message interpreter, so as to solve the problem of poor generality and scalability in the prior art.
为解决上述问题, 本发明提供下述技术方案: .  To solve the above problems, the present invention provides the following technical solutions:.
一种通讯接口消息的解码方法, 该方法包括步骤:  A method for decoding a communication interface message includes the following steps:
A、 从通讯接口获取消息码流;  A. Obtain the message code stream from the communication interface;
B、调用消息码流采用的协议所对应的协议消息结构描述信息,根据该 描述信息中各信元的编码解码控制字调用相应的解码函数对所述消息码流 进行逐段解码, 形成消息值树, 该消息值树的每个节点对应消息的一个信 元, 其中:  B. Call the protocol message structure description information corresponding to the protocol used by the message code stream, and call the corresponding decoding function to decode the message code stream segment by segment according to the encoding and decoding control word of each cell in the description information to form the message value Tree, each node of the message value tree corresponds to one cell of the message, where:
如果信元的协议编解码控制字表示为基本编码规则 (BER ) , 则调用 If the protocol codec control word of a cell is expressed as a basic encoding rule (BER), then call
BER的解码函数进行解码; BER decoding function to decode;
如果信元的编解码控制字表示为压缩编码规则 (PER ) , 则调用 PER 的解码函数进行解码; 如果信元的编解码控制字表示为类型-长度-值记法 (TLV ) , 则调用 TLV的解码函数进行解码; If the codec control word of the cell is expressed as a compression coding rule (PER), then the decoding function of the PER is called for decoding; If the codec control word of the cell is represented as type-length-value notation (TLV), then the decoding function of the TLV is called for decoding;
如果信元的编解码控制字表示为 BER、 PER和 TLV中多项的组合,则 分别调用对应的解码函数进行解码;  If the codec control word of a cell is expressed as a combination of multiple items in BER, PER, and TLV, the corresponding decoding function is called for decoding;
C、 遍历所述消息值树, 对每个信元按其格式输出解码后的字符串。 根据上述方法:  C. Traverse the message value tree, and output a decoded character string for each cell according to its format. According to the above method:
还包括步骤: 将字符串生成具有层次结构的格式化文本后输出。 通过图形界面 (GUI )分析输出的文本流, 形成解释关系树, 并在该 图形界面上将关系树和消息码流显示出来。  It also includes the steps: Output the string into hierarchical formatted text. The output text stream is analyzed through a graphical interface (GUI) to form an explanatory relation tree, and the relation tree and the message code stream are displayed on the graphical interface.
在进行步骤 A之前, 将抽象语法记号 1 ( ASN.1 )与编码解码控制字结 合对需要解释的协议进行描述并形成协议消息结构描述信息, 再将该描述 信息生成协议动态库供调用; 所述编码解码控制字添加在 ASN.1文本中的 类型定义处。  Before performing step A, the abstract syntax mark 1 (ASN.1) is combined with the encoding and decoding control word to describe the protocol to be interpreted and form protocol message structure description information, and then generate the protocol dynamic library for the description information to be called; The codec control word is added to the type definition in the ASN.1 text.
所述的编码解码控制字可为 BER、 PER和 TLV之一, 或者为 BER、 PER和 TLV的多项组合。  The encoding and decoding control word may be one of BER, PER, and TLV, or multiple combinations of BER, PER, and TLV.
所述 ASN.1文本中嵌入有实现信元间约束关系的 C语言程序并包含在 生成的协议动态库中; 当完成解码后执行该程序, 完成自定义约束限制。  A C language program that implements the constraint relationship between cells is embedded in the ASN.1 text and is included in the generated protocol dynamic library; the program is executed after decoding is completed to complete the custom constraint limit.
本发明具有以下有益效果:  The invention has the following beneficial effects:
1、 大大降低了电信网管系统, 电信系统测试工具, 测试仪器支持多种 协议解释的开发工作量。  1. It greatly reduces the development workload of telecommunication network management systems, telecommunication system test tools, and test instruments supporting multiple protocol interpretations.
2、 提高了消息解释器的通用性和可扩展性, 其中的 GUI、 编码解码引 擎等都可以保持稳定, 增加一个协议的支持只用提供协议对应的 ASN.1文 件即可。  2. The versatility and scalability of the message interpreter have been improved. The GUI and the encoding and decoding engine can be kept stable. To add a protocol support, you only need to provide the ASN.1 file corresponding to the protocol.
附图说明 BRIEF DESCRIPTION OF THE DRAWINGS
图 1为接口消息解释结果示意图;  Figure 1 is a schematic diagram of the interface message interpretation result;
图 2A为本发明的消息解释器系统框图;  2A is a block diagram of a message interpreter system according to the present invention;
图 2B为本发明的主要流程图;  FIG. 2B is a main flowchart of the present invention;
图 3为图形界面显示消息码流和解释消息的示意图;  FIG. 3 is a schematic diagram showing a graphic interface displaying a message code stream and interpreting a message; FIG.
图 4为编解码示意图; 图 5为通信设备组网示意图; FIG. 4 is a schematic diagram of encoding and decoding; FIG. 5 is a schematic diagram of communication equipment networking;
图 6为协议消息描述结构示意图;  FIG. 6 is a schematic diagram of a description structure of a protocol message;
图 7为一颗协议消息类型树;  Figure 7 is a protocol message type tree;
图 8为解码流程图。  Figure 8 is a decoding flowchart.
具体实施方式 detailed description
本发明通过采用类型-长度-值 (TLV ) 编码控制方法来解决用 ASN.1 描述非 ASN.1定义的协议, 对 TLV编码控制方法说明如下:  In the present invention, a type-length-value (TLV) coding control method is adopted to solve a protocol that is not defined by ASN.1 using ASN.1, and the TLV coding control method is described as follows:
T: 表示类型标识的控制, 类似于 BER中的标识符(TAG ), 但是它的 类型取值却与 BER类型取值毫无关系。  T: Control of type identification, similar to the identifier (TAG) in BER, but its type value has nothing to do with BER type value.
L: 表示长度部分的控制, 类似于 BER中的长度, 但是不仅仅表示内 容部分的长度, 而且标示着各种与长度有关的编码控制。  L: Represents the control of the length part, similar to the length in the BER, but not only the length of the content part, but also various length-related coding controls.
V: 表示值部分的编码控制, 这部分兼有 BER内容部分和 PER压缩编 码的方法和值部分各种控制设置。  V: Indicates the encoding control of the value part. This part has various control settings for the BER content part and the PER compression encoding method and value part.
TLV编码控制提供给用户使用的形式如下:  The form of TLV code control provided to users is as follows:
"<总体编码控制, 子控制〉"  "<Overall coding control, sub-control>"
整个控制用 "<>"括起来, 各个控制之间用 "," 隔开。  Enclose the entire control with "<>" and separate each control with ",".
总体编码控制 (General Control ): 给出总的编码规则和编码约束和控 制。 本部分的表示形式是 "A|B-a-b,,。 A的取值可以为 BER、 PER, SCCP、 T、 TV、 V、 TLV、 LTV, LV等等。 B 的取值是各种与编码有关的控制和 约束。 它的取值可以为大小端: ENDIAN, 对齐: BOUNDARY, PER方式 对齐: PERALIGN, 构造或者筒单编码: CONSTRUCTED/SIMPLE。 a、 b 分别为可选的参数。 比如对齐需要一个参数指示是否进行对齐。 <TV|BOUNDARY-ALIGN>表示 TV形式的编码, 编码时采取对齐方式。  General Encoding Control (General Control): Gives the overall encoding rules and encoding constraints and controls. The expression in this section is "A | Bab ,,". The value of A can be BER, PER, SCCP, T, TV, V, TLV, LTV, LV, etc. The value of B is various related to encoding. Controls and constraints. Its values can be big and small: ENDIAN, alignment: BOUNDARY, PER alignment: PERALIGN, construction or tube coding: CONSTRUCTED / SIMPLE. A and b are optional parameters. For example, alignment requires a parameter Indicates whether to perform alignment. <TV | BOUNDARY-ALIGN> represents TV-type encoding, and the alignment is adopted during encoding.
子控制 ( Subcontrol ): 对总体的控制进行进一步的说明。 本部分的表 示形式和总体编码控制的表示形式相同。 "广 的左边表示控制名, T 右边 用 "-" 隔开的每个部分, 第一部分表示控制项, 第二个部分以及以后的部 分表示控制项的第一个参数, 第二个参数, 依次类推。  Subcontrol: Further explanation of the overall control. The representation in this section is the same as the representation of the overall coding control. "The wide left side represents the control name, and the right side of T is separated by"-". The first part represents the control item, and the second and subsequent parts represent the first parameter of the control item, the second parameter, in that order. By analogy.
例如, 在协议中某一个类型描述前, 看到下面的形式:  For example, before a type description in the protocol, you see the following form:
<TLV|E DIAN-BIG, T|LEN-8, L|LEN-16|SCALE-3 , V|CHECKSUM-XOR> 这表示被修饰类型将来采用 TLV规则进行编码。 T部分使用 8个比特 进行编码; L部分使用 16个比特进行编码, 它的值尺度是 3个比特, 就是 说如果 L部分的值是 5, 则长度部分占用的总的比特是 5x3 = 15比特; 对 本类型的值进行完编码后, 需要使用异或 (XOR )进行检臉和计算。 <TLV | E DIAN-BIG, T | LEN-8, L | LEN-16 | SCALE-3, V | CHECKSUM-XOR> This means that the modified type will be encoded using TLV rules in the future. The T part uses 8 bits for encoding; the L part uses 16 bits for encoding, and its value scale is 3 bits, that is, if the value of the L part is 5, the total bits occupied by the length part are 5x3 = 15 bits After encoding this type of value, you need to use XOR to perform face detection and calculation.
TLV各个部分的控制项如下:  The control items of each part of TLV are as follows:
T部分:  Part T:
LEN控制项,带一个参数,用来指示 T部分使用多少个比特进行编码。 如 TLEN-8。  The LEN control item takes a parameter to indicate how many bits the T part uses for encoding. Such as TLEN-8.
ENDIAN控制项, 带有一个参数, 取值为 BIG和 LITTLE, 表示本部 分是大端编码还是小端编码。  The ENDIAN control item has a parameter with values BIG and LITTLE, indicating whether this part is big-endian or little-endian.
L部分:  Part L:
LEN控制项,带一个参数,用来指示 L部分使用多少个比特进行编码。 ENDIAN控制项, 带有一个参数, 取值为 BIG和 LITTLE, 表示本部 分是大端编码还是小端编码。  The LEN control item takes a parameter to indicate how many bits the L part uses for encoding. The ENDIAN control item has a parameter with values BIG and LITTLE, indicating whether this part is big-endian or little-endian.
SCALE控制项, 带有一个参数指定 L部分值的尺度。 这样可以打破 L 部分值的尺度是字节的限制。 参数是多少, L尺度就是多少个比特。 比如 SCALE-2, L部分的值是 3, 那么它的含义就是 3个 2比特。 参数还可以取 特殊值, 比如 CMPNT, 表示长度的尺度是当前类型编码的逻辑单位。 比如 用它修饰字符串, 就表示尺度取字符的个数, 而不管字符本身是用多少个 比特编码。  SCALE control with a parameter specifying the scale of the L-part values. This breaks the limit of the L-part value in bytes. The number of parameters is the number of bits on the L scale. For example, SCALE-2, the value of L part is 3, so its meaning is 3 2 bits. The parameter can also take special values, such as CMPNT, which indicates that the length scale is a logical unit of the current type encoding. For example, using it to modify a character string means that the number of characters is taken on a scale, regardless of how many bits the character itself is encoded with.
ADD/SUB控制项, 带一个参数, 表示 L的值在原来的基础上还要增 加 /减少参数给定的数量。  The ADD / SUB control item takes a parameter, which indicates that the value of L should increase / decrease the number given by the parameter.
SELF控制项, 没有参数, 表示 L的值需要增加 L部分本身编码占用 的字节数。  The SELF control has no parameters, indicating that the value of L needs to increase the number of bytes occupied by the L part itself.
SCCPLEN控制项, 没有参数, 表示当长度小于 255时, 使用一个字节 进行编码。 大于 255时使用三个字节进行编码, 第一个字节编码为 Oxff, 后边两个字节进行长度编码。  The SCCPLEN control item has no parameters, which means that when the length is less than 255, one byte is used for encoding. When it is greater than 255, three bytes are used for encoding, the first byte is encoded as Oxff, and the next two bytes are used for length encoding.
TO控制项, 带两个参数, 第一个参数表示控制子项, 第二个表示补齐 时需要填充的长度。 总共有三个控制子项: VALIGN、 ALIGN, 值控制项。 VALIGN指值编码按照它的尺度进行对齐, 不足部分, 用参数给定的比特 值补齐。 ALIGN值编码要补齐到字节边界上, 不足部分使用参数给定的比 特值补齐。值控制项比较特殊, 它的形式为 TO-16-0, 表示值的编码需要占 用固定 16个字节, 如果编码不足 16个字节, 则用 0不足到 16个字节。 The TO control item takes two parameters, the first parameter represents the control sub-item, and the second represents the length that needs to be filled when completing. There are three control items: VALIGN, ALIGN, value control. VALIGN indicates that the value encoding is aligned according to its scale. The shortcomings are complemented by the bit value given by the parameter. The ALIGN value is encoded to the byte boundary, and the insufficient part is completed using the bit value given by the parameter. The value control item is relatively special. Its form is TO-16-0, which indicates that the encoding of the value needs to occupy a fixed 16 bytes. If the encoding is less than 16 bytes, the value is less than 0 to 16 bytes.
V部分:  Part V:
LEN控制项,带一个参数,用来指示 V部分使用多少个比特进行编码。 The LEN control item takes a parameter to indicate how many bits the V part uses for encoding.
ENDIAN控制项, 带有一个参数, 取值为 BIG和 LITTLE, 表示本部 分是大端编码还是小端编码。 The ENDIAN control item has a parameter with values BIG and LITTLE, indicating whether this part is big-endian or little-endian.
Dummy控制项, 带有两个参数。 这个参数主要处理复合类型中一个成 分编码被多个成分完整编码分割的问题。 第一个参数表示被分割的第一部 分编码的比特数, 第二个参数表示分割本称分编码的成分个数。  Dummy control with two parameters. This parameter mainly deals with the problem that one component encoding is divided by multiple components in the composite type. The first parameter indicates the number of bits of the first part of the code that is divided, and the second parameter indicates the number of components of the original code.
EBIT控制项, 带一个参数。 当编码的码流有多个字节长度时, 每一个 字节最左边一位决定下一个字节是否表示码流。用给定的参数设定最左位, 表示后边的字节还属于码流。 如果是最后一个字节, 则左位设定参数取反 后的值。  EBIT control with one parameter. When the coded code stream has multiple bytes, the leftmost bit of each byte determines whether the next byte represents the code stream. The leftmost bit is set with the given parameter, which indicates that the following bytes also belong to the code stream. If it is the last byte, the left bit sets the value of the inverted parameter.
DN控制项, 带一个参数。 控制电话号码的 BCD表示, 如果编码没有 在字节边界上, 使用参数不足到字节边界上。  DN control with one parameter. The BCD of the control telephone number indicates that if the encoding is not on a byte boundary, the use parameter is insufficient to the byte boundary.
Ml控制项, 在编码电话号码之前, 先根据电话号码个数的编码一个比 特的奇偶位, 当电话号码为偶数, 置为 0, 否则置为 1。 当整个编码不在字 节边界时, 使用参数给定的值不足到字节边界上。  The M1 control item encodes a bit parity bit according to the number of phone numbers before encoding the phone number. When the phone number is even, it is set to 0, otherwise it is set to 1. When the entire encoding is not on a byte boundary, the value given using the parameter is not sufficient on the byte boundary.
TRAIL控制项, 带一个参数。 进行完编码后, 使用参数指定的值作为 编码的结束符。  TRAIL control with one parameter. After encoding, use the value specified by the parameter as the encoding terminator.
PERALIGN控制项, 没有参数, 表示编码按照 PER的对齐方式进行对 齐。  The PERALIGN control has no parameters, indicating that the codes are aligned according to the alignment of the PER.
CHOICE类型控制项:  CHOICE type control:
V自身修饰 CHOICE类型的控制作用,使用索引选择 CHOICE的成分。 TV本身修饰 CHOICE类型的控制作用, 使用标签值选择 CHOICE成 分。  V itself modifies the control effect of the CHOICE type, using the index to select the components of the CHOICE. The TV itself modifies the control of the CHOICE type, using the tag value to select the CHOICE component.
WHEN控制项, 带有一个条件表达式, 根据已知成分的值, 计算表达 式, 选取表达式为真的成分。 WHEN control with a conditional expression that calculates the expression based on the value of a known component Expression, select the component whose expression is true.
UNION控制项, 带一个参数,控制 CHOICE成分的编码长度使用成分 类型中最大长度作为整个编码的长度,有点类似于 C语言的 UNION。如果 实际的编码不足最大长度, 使用参数给定的值填充到最大长度。  The UNION control takes a parameter that controls the encoding length of the CHOICE component. The maximum length of the component type is used as the length of the entire encoding, which is similar to C language UNION. If the actual encoding is insufficient for the maximum length, the value given by the parameter is used to fill the maximum length.
总体编码控制:  Overall coding control:
ENDIAN控制项, 带有一个参数, 取值为 BIG和 LITTLE, 表示是大 端还是小端编码。  ENDIAN control, with a parameter, the values are BIG and LITTLE, indicating whether it is big-endian or little-endian encoding.
BOUNDARY控制项, 带有一个参数, 取值为 ALIGN和 NONALIGN, 表示编码是否从整字节边界开始。  BOUNDARY control, with a parameter, the values are ALIGN and NONALIGN, indicating whether the encoding starts from an entire byte boundary.
PERALIGN控制项: 带一个参数, 取值为 ALIGN和 NONALIGN, 表 示是执行 PER对齐方式的编码,还是非对齐方式的编码。仅仅对于 PER有 效。 对其他 BER、 TLV、 SCCP等等无效。  PERALIGN control: Takes a parameter with values of ALIGN and NONALIGN, indicating whether to perform encoding in PER alignment or encoding in non-alignment. Only valid for PER. It has no effect on other BER, TLV, SCCP, etc.
C语言函数控制:  C language function control:
WHEN控制项: 修饰复合类型的成分, 用来执行一个 C语言风格的表 达式, 完成选择控制。  WHEN control: Modifies the component of the composite type, which is used to execute a C-style expression to complete the selection control.
EMBED EXEC控制项: 定义在协议 ASN描述的任何空白部分, 内容 是内嵌的 C语言程序或者函数库, 可以在 WHEN计算表达式时使用。  EMBED EXEC control item: It is defined in any blank part described in the protocol ASN. The content is the embedded C language program or function library, which can be used in WHEN calculation expression.
EXPORT控制项: 将当前成分的值输出到一个外部 C变量中。  EXPORT control: Outputs the value of the current component to an external C variable.
IMPORT控制项: 将外部 C变量的值引入到当前的 ASN描述中, 用于 动态计算某些约束。  IMPORT control: The value of an external C variable is introduced into the current ASN description, which is used to dynamically calculate certain constraints.
参阅图 2所示, 本发明的消息解释器主要由编码解码引擎和图形界面 ( GUI ) 两部分組成:  Referring to FIG. 2, the message interpreter of the present invention is mainly composed of a codec engine and a graphical interface (GUI):
编码解码引擎: 负责根据选取的协议动态库对输入的码流进行解码, 并构造输出解码后消息的解释信息的格式化文本。  Encoding and decoding engine: Responsible for decoding the input code stream according to the selected protocol dynamic library, and constructing formatted text that outputs the interpretation information of the decoded message.
GUI: 主要功能是对格式化文本进行分析, 并将消息解释内容的格式 显示出来, 并完成人机交互功能。  GUI: The main function is to analyze the formatted text, display the format of the message interpretation content, and complete the human-computer interaction function.
消息解释器解码的主要处理过程如下:  The main process of message interpreter decoding is as follows:
1、 获取协议对应的协议动态库和从通信接口获取需解释的消息码流。 在解释消息码流前, 用户用 ASN.1文本描述其需要解释的协议, 通过 ASN转换程序将 ASN.1文件编译成 C文件; 用 C语言编译器和链接器将 C文 件编译, 链接成含有该协议特征信息的协议动态库。 对于非 ASN.1定义的 协议, 采用 ASN.1与前述的 TLV编码控制字相结合的方式进行描述。 1. Obtain the protocol dynamic library corresponding to the protocol and the message code stream to be interpreted from the communication interface. Before interpreting the message stream, the user uses ASN.1 text to describe the protocol they need to interpret. The ASN.1 file is compiled into a C file by the ASN conversion program. The C file is compiled and linked into A protocol dynamic library of protocol characteristic information. For protocols not defined by ASN.1, the combination of ASN.1 and the aforementioned TLV coded control word is used for description.
协议动态库由用户输入的 ASN.1文本构成, 包含了协议中所有消息的 结构信息, 以及信元之间的相互关系等信息。  The protocol dynamic library is composed of ASN.1 text input by the user, and contains information such as the structure information of all messages in the protocol, and the relationship between the cells.
由用户输入需要解释的消息码流所采用的协议。  The protocol used by the user to enter a message stream to be interpreted.
2、 编码解码引擎根据协议动态库对需解释的消息码流进行解码, 形成 一棵消息的值树, 树上的每一个节点就是消息的一个信元。 其中在解码时: 如果信元的协议编解码控制字表示为基本编码规则 (BER ), 则调用 2. The encoding and decoding engine decodes the message stream to be interpreted according to the protocol dynamic library to form a message value tree. Each node on the tree is a cell of the message. Wherein during decoding: if the protocol codec control word of the cell is expressed as a basic coding rule (BER), then call
BE 的解码函数进行解码; 如果信元的编解码控制字表示为压缩编码规则 ( PER ), 则调用 PER的解码函数进行解码; 如果信元的编解码控制字表示 为类型-长度-值记法(TLV ), 则调用 TLV的解码函数进行解码; 如果信元 的编解码控制字表示为 BER、 PER和 TLV中多项的組合, 则分别调用对应 的解码函数进行解码。 The decoding function of BE performs decoding; if the codec control word of the cell is expressed as a compression coding rule (PER), the decoding function of the PER is called for decoding; if the codec control word of the cell is expressed as type-length-value notation (TLV), calling the decoding function of the TLV for decoding; if the codec control word of the cell is expressed as a combination of multiple items in BER, PER, and TLV, the corresponding decoding functions are respectively called for decoding.
3、 编码解码引擎遍历值树, 生成有层次的格式化文本;  3. The encoding and decoding engine traverses the value tree to generate hierarchical formatted text;
下面是一个例子  Below is an example
SysMsg  SysMsg
0> 00 00000000 ..sender mid: 0x0 (0)  0> 00 00000000 ..sender mid: 0x0 (0)
1> 00 00000000 ..sender pid: 0x0 (0)  1> 00 00000000: sender pid: 0x0 (0)
2> 00 00000000 ..receiver mid: 0x0 (0)  2> 00 00000000: receiver mid: 0x0 (0)
3> 00 00000000 ..receiver pid: 0x0 (0)  3> 00 00000000: receiver pid: 0x0 (0)
4> 00 00000000  4> 00 00000000
5> 0C 00001100 L ..msg  5> 0C 00001100 L: msg
6> 00 0000—― .. ..protocol discrimator: 0, group call control  6> 00 0000—― .. .protocol discrimator: 0, group call control
—― 0000 . ...transaction identifier: 0x0 (0)  --― 0000. ... transaction identifier: 0x0 (0)
» Layer3  »Layer3
7> 17 00010111 T . • ..cmServiceRequest  7> 17 00010111 T. • ..cmServiceRequest
8〉 C1 1100--—T cm service type —0001 1, mobile origin call estab or packet mode connection 8> C1 1100 ---- T cm service type —0001 1, mobile origin call estab or packet mode connection
9> DO 1101—- T ciphering key sequence  9> DO 1101—- T ciphering key sequence
- -— 0000 : 0, through Possible values for the ciphering key  --— 0000: 0, through Possible values for the ciphering key
10> 03 00000011 L ...... mobile station  10> 03 00000011 L ...... mobile station
11> 00 0- . spare 1 : 0x0 (0)  11> 00 0-. Spare 1: 0x0 (0)
..revision level: 0, reserved for phase 1 ..revision level: 0, reserved for phase 1
Figure imgf000015_0001
..es ind: 0, controlled Early Classmark Sending option is
Figure imgf000015_0001
..es ind: 0, controlled Early Classmark Sending option is
—- 0- .a51: 0, encryption algorithm A51 available  —- 0- .a51: 0, encryption algorithm A51 available
-000 rf power capability: 0, class 1  -000 rf power capability: 0, class 1
12> 00 0- …… spare2: 0x0 (0)  12> 00 0- …… spare2: 0x0 (0)
-0—— ps capa: 0, ps capability not present  -0 ---- ps capa: 0, ps capability not present
--00— - ss Screen Indicator: 0, defined in 0408 0 — -0— sm capa: 0, mobile station does not support mobile 0- vbs: 0, no VBS capability or no notifications wanted  --00—-ss Screen Indicator: 0, defined in 0408 0 — -0— sm capa: 0, mobile station does not support mobile 0- vbs: 0, no VBS capability or no notifications wanted
-0- vgcs: 0, no VGCS capability or no notifications wanted  -0- vgcs: 0, no VGCS capability or no notifications wanted
—0 fc: 0, the MS does not support the E GSM or R —0 fc: 0, the MS does not support the E GSM or R
GSM band GSM band
13> 00 0 cm3: 0, the MS does not support any options that are -000—― spare3: 0x0 (0)  13> 00 0 cm3: 0, the MS does not support any options that are -000—― spare3: 0x0 (0)
-—- 0 -— soLSA: 0, the ME does not support SoLSA  -—- 0 -— soLSA: 0, the ME does not support SoLSA
0— cmsp: 0, cmsp not supported  0— cmsp: 0, cmsp not supported
0- a53: 0, encryption algorithm A53 not available 0 a52: 0, encryption algorithm A52 not available 0- a53: 0, encryption algorithm A53 not available 0 a52: 0, encryption algorithm A52 not available
14〉 03 00000011 L ...... mobile identity 4、 GUI界面对编解码引擎的输出文本流分析并形成解释关系树, 并在 界面上将此关系树和码流显示出来, 完成整个消息解释过程。 显示界面如 图 3所示。 14〉 03 00000011 L ...... mobile identity 4. The GUI interface analyzes the output text stream of the codec engine and forms an interpretation relation tree, and displays this relation tree and code stream on the interface to complete the entire message interpretation process. The display interface is shown in Figure 3.
在本发明中, ASN编译器中支持 TLV等编解码控制, 且编码解码控制 字可同 BER、 PER^见则混用。 标准的 ASN.1规范中是只支持对整个文件或者 模块选定使用 BER或者 PER编码规则的, 下面是 ITU-T H.248协议的 ASN文 本的一部分。 实际使用时要么使用 BER见则, 要么使用 PER规则。 如下所 示:  In the present invention, the ASN compiler supports encoding and decoding control such as TLV, and the encoding and decoding control words can be mixed with BER and PER ^. The standard ASN.1 specification only supports the use of BER or PER encoding rules for the entire file or module. The following is part of the ASN text of the ITU-T H.248 protocol. In practice, either the BER rule or the PER rule is used. As follows:
MEDIA-GATEWAY-CONTROL DEFINITIONS AUTOMATIC TAGS::= BEGIN  MEDIA-GATEWAY-CONTROL DEFINITIONS AUTOMATIC TAGS :: = BEGIN
MegacoMessage:: = SEQUENCE  MegacoMessage :: = SEQUENCE
{  {
authHeader [0] IMPLICIT AuthenticationHeader authHeader [0] IMPLICIT AuthenticationHeader
OPTIONAL, OPTIONAL,
mess [1] IMPLICIT Message  mess [1] IMPLICIT Message
}  }
AuthenticationHeader:: = SEQUENCE  AuthenticationHeader: = SEQUENCE
{  {
secParmlndex [0] IMPLICIT S ecurityParmlndex,  secParmlndex [0] IMPLICIT S ecurityParmlndex,
seqNum [1] IMPLICIT SequenceNum, ad [2] IMPLICIT AuthData  seqNum [1] IMPLICIT SequenceNum, ad [2] IMPLICIT AuthData
}  }
SecurityParmlndex:: = OCTET STRING(SIZE(4)) SequenceNum : := OCTET STRING(SIZE(4)) SecurityParmlndex :: = OCTET STRING (SIZE (4)) SequenceNum:: = OCTET STRING (SIZE (4))
AuthData := OCTET STRING (SIZE (12..32)) Message ::= SEQUENCE AuthData: = OCTET STRING (SIZE (12..32)) Message :: = SEQUENCE
{  {
version [0] IMPLICIT INTEGER(0..99), version [0] IMPLICIT INTEGER (0..99),
-- The version of the protocol defined here is equal to 1. -The version of the protocol defined here is equal to 1.
mid [1] EXPLICIT Mid, -- Name/address of message originator  mid [1] EXPLICIT Mid,-Name / address of message originator
messageBody [2] EXPLICIT CHOICE  messageBody [2] EXPLICIT CHOICE
{  {
messageEiTor [0] IMPLICIT ErrorDescriptor, transactions [1] EXPLICIT SEQUENCE OF messageEiTor [0] IMPLICIT ErrorDescriptor, transactions [1] EXPLICIT SEQUENCE OF
Transaction Transaction
},  },
} }
显然只用 BER、 PER两种规则是无法满足实际应用中多种多样的编码 解码需求的。  Obviously, using only two rules, BER and PER, cannot meet various coding and decoding requirements in practical applications.
通过在 ASN文本中每个类型定义处加入括号 "< >,,, 在括号中放入用 户希望的编码解码控制字。 通过编码控制字的自动继承, 如果用户希望在 一个模块中用统一的一种编码规则, 只需要在其父类型中指定编码规则, 子类型就会自动继承父类型的编码规则, 在子类型处显示的指定编码规则 会覆盖调继承来的编码规则, 这样用户就可以指定每种类型的编码解码规 则, 同时又不需要对 ASN语法做大的改动。 下面是一个在 ASN文本中指定 各个类型的编解码规则的例子,其中 "<〉"中的部分就是编码解码控制字。 如下所示:  By adding parentheses "<>" in each type definition in the ASN text, put the encoding and decoding control word you want in the brackets. Through automatic inheritance of encoding control words, if you want to use a uniform one in a module This type of encoding rules only needs to specify the encoding rules in its parent type, and the child type will automatically inherit the encoding rules of the parent type. The specified encoding rules displayed at the child type will override the inherited encoding rules, so that the user can specify Each type of encoding and decoding rules does not require major changes to the ASN syntax. The following is an example of specifying each type of encoding and decoding rules in ASN text, where the part in "<>" is the encoding and decoding control word . As follows:
Bitl :: = <V, V|LEN- 1 >INTEGER ( 0..1 )  Bitl: = <V, V | LEN- 1> INTEGER (0..1)
Bit2 ::= <V,V|LEN-2>INTEGER ( 0..3 )  Bit2 :: = <V, V | LEN-2> INTEGER (0..3)
Short ::= <V, V|LEN- 16>INTEGER ( 0..0xf ff)  Short :: = <V, V | LEN- 16> INTEGER (0..0xf ff)
ThreeByte: :=<V,V|LEN-24>INTEGER ( 0..0xffffff)  ThreeByte:: = <V, V | LEN-24> INTEGER (0..0xffffff)
INT ::= <V,V|LEN-32>INTEGER ( 0..0xffffffff ) SevenByte ::=<V,V|LEN-56〉INTEGER ( O..Oxffffffffffffff ) INT :: = <V, V | LEN-32> INTEGER (0..0xffffffff) SevenByte :: = <V, V | LEN-56> INTEGER (O..Oxffffffffffffff)
HexString :: = VisibleString ( FROM ( 48..57|65..70 ) ) -- Ό'.·.'9', 'Α'. HexStringl :: = VisibleString ( FROM ( 48..57 ) ) HexString :: = VisibleString (FROM (48..57 | 65..70))-Ό '. · .'9', 'Α'. HexStringl :: = VisibleString (FROM (48..57))
Dtmfstring: " VisibleString ( FROM ( 48..57|65..70 ) ) -- Printablestring: :=<V,V|LEN-8>PrintableString Dtmfstring: "VisibleString (FROM (48..57 | 65..70))-Printablestring:: = <V, V | LEN-8> PrintableString
Valuea ::=Byte ( OxAl ) Valuea :: = Byte (OxAl)
Valuef ::=Bit4 ( 15 ) Valuef :: = Bit4 (15)
、 、 、 小 ·!·  , , , small ·!·
-- Sytem Message -Sytem Message
 ,
MsgEnter:- <V>SEQUENCE MsgEnter:-<V> SEQUENCE
{ {
mtpLeveBHead MTPLeveBHead,  mtpLeveBHead MTPLeveBHead,
label Label,  label Label,
msg-type Msg-type  msg-type Msg-type
MTPLeveBHead:: =<V〉SEQUENCE MTPLeveBHead :: = <V> SEQUENCE
{ {
servicelndicator <V5V|LEN-4>ENUMERATED servicelndicator <V 5 V | LEN-4> ENUMERATED
{  {
isup ( 5 )  isup (5)
}  }
,spare 1 Bit2  , spare 1 Bit2
,networkIndicator <V,V|LEN-2>ENUMERATED  , networkIndicator <V, V | LEN-2> ENUMERATED
{  {
nationalNetwork ( 2 )  nationalNetwork (2)
} 一 1.7— } One 1.7—
}  }
Label ::=<V>SEQUENCE Label :: = <V> SEQUENCE
{  {
destination-point-code <V5V|LEN-24>INTEGER ( 0..0xFFFFFF ), destination-point-code <V 5 V | LEN-24> INTEGER (0..0xFFFFFF),
originating-point-code <V,V|LEN-24>INTEGER ( COxFFFFFF ),  originating-point-code <V, V | LEN-24> INTEGER (COxFFFFFF),
link-select-code <PER>INTEGER ( 0..0xFF ), circuit-identification-code <BER>INTEGER ( 0..0xFFFF ) link-select-code <PER> INTEGER (0..0xFF), circuit-identification-code <BER> INTEGER (0..0xFFFF)
} }
ASN编译器对 ASN文本进行编译时, 对每个类型都生成一个 Ttype结 构, Ttype结构中就包含每个类型的编码解码控制规则, 即上面例子 ASN文 本中 " < >" 里的部分, 可以是 BER, PER或者自定义的 TLV。 用户没有显 示定义的类型也会根据继承关系自动计算出他的编解码控制字。  When the ASN compiler compiles ASN text, it generates a Ttype structure for each type. The Ttype structure contains the encoding and decoding control rules for each type. That is, the part in the "<>" in the ASN text in the above example can be BER, PER or custom TLV. The user does not display the defined type and will automatically calculate his codec control word based on the inheritance relationship.
在编码解码公共函数库内部, 对 BER, PER, TLV规则都分别实现了一 套编码解码函数。 编码解码库中为用户提供统一的编码解码函数接口。 其 实现原理是根据需解码的类型 Ttype中的编码规则的记录, 调用所对应的编 码规则的编码解码函数进行编码解码。 如对例子中的 link-select-code信元 进行解码时会调用 PER规则 的解码函数进行解码 , 而对 circuit-identification-code 进行解码时会调用 BER规则的解码函数进行解 码。 解码进行到 originating-point-code信元时又会自动调用 TLV规则的信元 进行解码。 这样就实现多种编码解码规则在一个模块中的混用。 同时又保 证了出现新的编码解码规则时, 扩充起来非常容易, 如下图 4所示。  Within the codec public function library, a set of codec functions are implemented for the BER, PER, and TLV rules. The codec library provides users with a unified codec function interface. Its implementation principle is to call the encoding and decoding function of the corresponding encoding rule for encoding and decoding according to the records of the encoding rules in the type Ttype to be decoded. For example, when decoding the link-select-code cell in the example, the decoding function of the PER rule is called to decode, and when the circuit-identification-code is decoded, the decoding function of the BER rule is called to decode. When the decoding reaches the originating-point-code cell, the cell of the TLV rule is automatically called for decoding. In this way, a variety of encoding and decoding rules are mixed in one module. At the same time, it ensures that when new coding and decoding rules appear, it is very easy to expand, as shown in Figure 4 below.
与传统的实现方式相比, 本发明的实现是将编译器和编解码进行了分 离。 这样, 编译器和编解码相对独立, 对于编解码的任何扩充, 对于编译 器不会产生任何影响。 编译器将 ASN.1的抽象描述, 翻译成目标编程语言 的抽象类型中间形式, 用户将这个抽象类型中间形式进行实例化, 形成抽 象值中间形式。 由于抽象值中间形式是抽象类型的中间形式具有相同的树状结构层 次。 同时值(树) 的每一个节点和类型 (树) 中的每一个节点一一对应, 值树中的每一个节点都是相应类型树节点的实例化。 正是有这样的关系, 所有编解码函数的统一接口中, 不需要说明抽象类型中间形式, 因为通过 抽象值中间形式, 可以引用到相应的抽象类型中间形式。 Compared with the traditional implementation, the implementation of the present invention separates the compiler and the codec. In this way, the compiler and codec are relatively independent, and any extension to the codec will not have any impact on the compiler. The compiler translates the abstract description of ASN.1 into the abstract type intermediate form of the target programming language, and the user instantiates this abstract type intermediate form to form an abstract value intermediate form. Because the intermediate form of the abstract value is the intermediate form of the abstract type, it has the same tree structure hierarchy. At the same time, each node of the value (tree) corresponds to each node of the type (tree), and each node in the value tree is an instantiation of a node of the corresponding type tree. It is because of this relationship that in the unified interface of all codec functions, there is no need to specify the abstract type intermediate form, because the abstract value intermediate form can refer to the corresponding abstract type intermediate form.
但是对于解码过程来说, 它是根据码流重新构造抽象值中间形式, 也 就是抽象值树的。 这样, 在解码函数的统一接口中必须说明抽象类型中间 形式作为解码的依据。 在后面的描述中, 抽象值中间形式和抽象值树具有 相同意义, 抽象类型中间形式和抽象类型树具有相同意义。  But for the decoding process, it reconstructs the intermediate form of the abstract value according to the code stream, that is, the abstract value tree. In this way, in the unified interface of the decoding function, the intermediate form of the abstract type must be specified as the basis for decoding. In the following description, the abstract value intermediate form and the abstract value tree have the same meaning, and the abstract type intermediate form and the abstract type tree have the same meaning.
编码函数的统一接口由五个参数给出: 一个用于存储结果码流的緩冲 区指针; 表示缓冲区存储能力的缓沖区大小; 表示本次编码起始位置 (相 对于緩冲区起始位置); 返回给用户的实际编码长度; 代表抽象数据的抽象 值树指针。  The unified interface of the encoding function is given by five parameters: a buffer pointer for storing the result code stream; the buffer size indicating the buffer storage capacity; the starting position of the encoding (relative to the buffer Start position); the actual encoding length returned to the user; an abstract value tree pointer representing abstract data.
解码函数的统一接口由六个参数构成: 一个存储这待解码码流的缓冲 区指针; 码流长度; 表示本次解码开始的起始位置 (相对于緩冲区的起始 位置); 返回给用户的解码长度; 表示解码依据的抽象类型树指针, 它可以 是总体抽象类型树的一个子树; 最后是返回给用户的表示解码结果的抽象 值树。  The unified interface of the decoding function is composed of six parameters: a buffer pointer that stores the stream to be decoded; the length of the stream; the starting position of the decoding start (relative to the starting position of the buffer); The decoding length of the user; an abstract type tree pointer representing the decoding basis, which can be a subtree of the overall abstract type tree; and finally, an abstract value tree representing the decoding result returned to the user.
整个编解码过程的核心是编解码引擎, 它本质上是一个调度器, 调度 的依据是由的 ASN编译器产生的抽象类型中间形式(抽象类型树)。 抽象类 型树中包含有编码控制信息, 这个控制信息由用户在书写 ASN描述文件时 指定。 依赖于这些编解码控制信息, 编解码引擎一方面完成用户指定的编 解码控制, 一方面调用编解码库中具体的编解码函数, 完成编解码。 在完 成了编解码以后, 编解码引擎检查用户有没有嵌入实现信元间约束关系的 目标语言程序代码。 如果有, 运行用户定义程序, 完成自定义约束限制。 这样, 编解码引擎就有四项主要的任务: 初始化引擎, 创建用户嵌入目标 程序代码的运行环境; 搜索合适的编码函数, 完成编码; 检索合适的解码 函数, 完成解码; 为每一个抽象值节点, 查找并运行用户嵌入代码。 编码时, 用户通过 API函数向编解码模块发出编码请求。 API编码函数 获取用户提供的抽象值树, 接着为结果码流分配一个数据緩冲区。 在准备 好编码相对位置和存储实际编码长度的参数以及抽象值树以后, 将控制权 交给编解码引擎。 编解码引擎, 针对于抽象值的每一个节点, 引用和它对 应的抽象类型节点, 取它的编码控制, 进行分析, 设置了各种编码控制参 数后, 根据编码控制中的编码指示, 从编解码库 (PER库、 BER庠、 TLV 库等等) 中获取合适的 '编解码函数进行编码。 由于抽象值从本质上是树状 的结构, 所以搜索引擎会才艮据这个特点, 按照编解码控制的指示, 递规调 用各个编解码函数, 完成整个消息的编码。 The core of the entire codec process is the codec engine, which is essentially a scheduler, and the scheduling is based on the abstract type intermediate form (abstract type tree) generated by the ASN compiler. The abstract type tree contains encoding control information, which is specified by the user when writing the ASN description file. Depending on the codec control information, the codec engine completes the codec control specified by the user on the one hand, and calls the specific codec function in the codec library on the other hand to complete the codec. After the codec is completed, the codec engine checks whether the user has embedded the target language program code that implements the constraint relationship between the cells. If so, run the user-defined program to complete the custom constraint restrictions. In this way, the codec engine has four main tasks: initialize the engine, create a running environment in which the user embeds the target program code; search for a suitable encoding function to complete the encoding; retrieve a suitable decoding function, complete the decoding; for each abstract value node Find and run user embed code. When encoding, the user sends an encoding request to the codec module through an API function. The API encoding function obtains the abstract value tree provided by the user, and then allocates a data buffer for the resulting code stream. After preparing the encoding relative position and storing the parameters of the actual encoding length and the abstract value tree, control is passed to the codec engine. The codec engine refers to each node of the abstract value, references its corresponding abstract type node, takes its encoding control, analyzes it, and sets various encoding control parameters. Obtain appropriate 'codec functions in the decoding library (PER library, BER 庠, TLV library, etc.) for encoding. Because the abstract value is a tree-like structure in nature, the search engine will call each codec function recursively according to the instructions of the codec control to complete the encoding of the entire message.
解码时, 用户通过 API函数向编解码模块发出解码请求。 API解码函数 根据用户提供的协议名, 搜索协议数据库, 找到需要解码码流的抽象类型 树。 然后准备好其他的解码标准接口参数, 最后将控制权交给解码引擎。 解码引擎根据抽象类型树的说明, 提取编码控制, 设置完相应的控制参数, 依据类型树, 递规调用相应解码库中的解码函数, 完成整个码流的解码工 作。 然后将实际解码长度和反映解码结果的抽象值树返回给用户。  When decoding, the user sends a decoding request to the codec module through the API function. The API decoding function searches the protocol database according to the protocol name provided by the user to find the abstract type tree that needs to be decoded. Then prepare other decoding standard interface parameters, and finally give control to the decoding engine. The decoding engine extracts the encoding control according to the description of the abstract type tree, sets the corresponding control parameters, and according to the type tree, calls the decoding function in the corresponding decoding library recursively to complete the decoding of the entire code stream. The actual decoded length and an abstract value tree reflecting the decoded result are then returned to the user.
编解码引擎在工作前, 总是先初始化编解码引擎。 这个初始化工作, 主要完成用户自定义导出编码的存储空间的分配工作, 这样, 便于以后编 解码引擎执行相应的导入导出以及函数关系式的运行工作。 初始化工作, 在每一 API编解码中只进行一次。 编解码引擎在递规编解码时, 总是先完成 上面的编码或者解码过程, 然后执行抽象类型树用户自定义的编解码控制 程序。 当编解码引擎完成整个的编解码过程后, 将控制权重新交给编解码 的 API函数, 最终返回到用户程序中执行。  Before the codec engine works, it always initializes the codec engine. This initialization work mainly completes the allocation of the storage space of the user-defined export encoding, so that it is convenient for the codec engine to perform the corresponding import and export and the operation of the functional relationship in the future. Initialization is performed only once in each API codec. The codec engine always completes the above encoding or decoding process when iterative encoding and decoding, and then executes the user-defined codec control program of the abstract type tree. After the codec engine completes the entire codec process, it returns control to the codec's API functions, and finally returns to the user program for execution.
首先编译器将 ASN描述文件编译成 ASN抽象类型的中间形式(目标语 言的抽象形式 TType和少量值 TValue )。 这种形式对所有的 ASN类型来说, 形式上完全相同。 同时编译器还为缺省值、 对象标识符等等在 ASN描述文 件中存在的值,编译抽象值的中间形式(目标语言的抽象形式形式 TValue ), 然后编译器将此时存在的 TType和 TValue关联起来。但是此时的抽象类型中 间形式( TType )在概念上仅仅是 ASN抽象描述的目标语言版本, 还不是实 实在在运用到实际应用中的形式。 为了能从这种消息模板格式的描述中得 到消息, 就必须对这个 ASN抽象类型的中间格式进行数据实例化。 完成数 据实例化的任务是由抽象类型实例化模块完成。 用户通过这个模块可以完 成消息的制作, 而它加工后的结果就是抽象值的中间形式。 这种中间形式 在构成上也是所有类型都是一样的。 First, the compiler compiles the ASN description file into an intermediate form of the ASN abstract type (the abstract form TType of the target language and a small number of values TValue). This form is exactly the same for all ASN types. At the same time, the compiler also compiles the intermediate form of the abstract value (the abstract form form of the target language TValue) for the values that exist in the ASN description file such as the default value, object identifier, and so on, and then the compiler types the TType and TValue that exist at this time. Connected. But at this time, the abstract type intermediate form (TType) is conceptually only the target language version of the ASN abstract description, and it is not a form that is actually applied to actual applications. In order to get from the description of this message template format To the message, data instantiation must be performed on the intermediate format of this ASN abstract type. The task of completing data instantiation is accomplished by the abstract type instantiation module. The user can complete the production of the message through this module, and the processed result is the intermediate form of the abstract value. This intermediate form is also structurally the same for all types.
编解码模块的编码过程是这样的。 抽象类型实例化模块完成 TValue构 造的过程, 同时也完成抽象值 TValue (树)与抽象类型 TType (树)的匹配 工作。 这个匹配过程保证 TValue (树) 中的每一个节点与 TType (树) 中的 相应节点关联, 即每一个值节点均有一个类型节点与之对应。 这样处理以 后, 所有编码函数的参数就变得极为简单, 只需四个参数: 一个 TValue抽 象值(树) 的指针, 一个编码緩冲区, 编码的起始位置, 和编码缓冲的大 小。 由于所有的编码函数都是这样统一的接口, 所以就可以非常独立地为 每一个 ASN抽象类型实现一个特定编码规则的编码函数。也就是对于 BER, 为每一个 ASN抽象类型实现个 BER编码函数, 对于 PER, 为每一个抽象类 型实现一个编码函数, 当然也可以为其他如 TLV (自创的编码规则)、 XER ( XML编码规则)创建编码函数。 每一套编码规则模块的建立都不会影响 其他现有的编码模块, 而且只要的编码引擎能够通过编码控制找到相应的 编码规则模块即可。 编码模块中的编码引擎, 通过编码控制的指导, 递规 调用相应编码规则模块中相应的 ASN抽象类型的编码函数,完成编码过程。  The encoding process of the codec module is like this. The abstract type instantiation module completes the process of TValue construction, and also completes the matching of the abstract value TValue (tree) and the abstract type TType (tree). This matching process ensures that each node in the TValue (tree) is associated with the corresponding node in the TType (tree), that is, each value node has a type node corresponding to it. After processing in this way, the parameters of all encoding functions become extremely simple, requiring only four parameters: a pointer to the TValue abstract value (tree), an encoding buffer, the starting position of the encoding, and the size of the encoding buffer. Since all encoding functions are such a unified interface, it is possible to implement a specific encoding rule encoding function for each ASN abstract type very independently. That is, for BER, implement a BER encoding function for each ASN abstract type, and for PER, implement an encoding function for each abstract type. Of course, it can also be used for other such as TLV (original encoding rules), XER (XML encoding rules) ) Create an encoding function. The establishment of each set of encoding rule modules will not affect other existing encoding modules, and as long as the encoding engine can find the corresponding encoding rule module through encoding control. The coding engine in the coding module, through the guidance of coding control, recursively calls the coding function of the corresponding ASN abstract type in the corresponding coding rule module to complete the coding process.
解码过程和编码过程类似。 它的解码函数针对每一个编码规则为每一 个 ASN抽象类型实现一个解码函数。 而且所有解码函数的参数完全一样: 一个表示码流类型的 TType类型, 一个用来存储消息实例的 TValue, —个包 含由码流的缓冲区, 一个输出给用户的实际解码长度, 和指示码流緩冲区 大小的参数。 依赖于 TType中的编码控制, 解码引擎, 搜索相应 ASN抽象类 型的解码函数, 完成本抽象类型的解码, 将解码后的数据存储到 TValue中。  The decoding process is similar to the encoding process. Its decoding function implements a decoding function for each ASN abstract type for each encoding rule. And the parameters of all decoding functions are exactly the same: a TType type that indicates the type of code stream, a TValue that stores the message instance, a buffer containing the code stream, an actual decoding length that is output to the user, and an indication of the code stream The parameter of the buffer size. Depending on the encoding control in the TType, the decoding engine searches for the decoding function of the corresponding ASN abstract type, completes the decoding of this abstract type, and stores the decoded data in TValue.
从上述描述可知:  From the above description:
为 T部分引入 LEN控制项, 用来指定 T部分的长度。 T部分使用这个 长度进行编码, 它可以取这个比特长度所能表示的所有的值, 从而突破一 个字节 ( 8个比特)只能表示 0 - 30的限制。  The LEN control is introduced for the T part to specify the length of the T part. Part T uses this length for encoding. It can take all the values that this bit length can represent, thus breaking the limit of one byte (8 bits) that can only represent 0-30.
协议中每一个组成部分都可以指定它们的总体编码控制, 所以, 可以 实现 BER、 PER, SCCP、 TLV、 TV、 V、 LV、 LTV, T等等混合编码, 大 大增加编码的灵活性。 因为进行总体编码控制以后, 可以对 SCCP进行单 独的编码, 所以可以完成 SCCP特殊需求编码。 同时 T、 L、 V的编码控制 的任意取舍性, 可以满足用户可以只需要 TLV三者中的一个、 两个、 或三 者都有的动态组合编码。 PER通过它自己的编码控制可以完成 PER的对齐、 非对齐编码, 通过为不同的部分指定不同的 PER对齐方式, 甚至可以实现 PER不同对齐类型的混合编码。 Each component of the protocol can specify their overall encoding control, so, you can Realize mixed encoding of BER, PER, SCCP, TLV, TV, V, LV, LTV, T, etc., greatly increasing the flexibility of encoding. Because SCCP can be individually coded after overall coding control, SCCP special needs coding can be completed. At the same time, the arbitrary selection of the coding control of T, L, and V can meet the requirement that the user can only need one, two, or all three of the TLVs for dynamic combination coding. PER can perform alignment and non-alignment encoding of PER through its own encoding control. By specifying different PER alignment methods for different parts, PER can even achieve mixed encoding of different alignment types of PER.
同时每一个部分都有 ENDIAN编码控制, 因此可以实现混合的大小端 控制。 BER的标识符部分、 长度部分、 内容部分的对齐、 大小端、 编码位 数控制、 长度域编码含义设置、 长度域数值尺度等等控制功能可以通过设 置各个控制项来完成。  At the same time, each part has ENDIAN encoding control, so it can realize mixed endianness control. Control functions such as the identifier part, length part, content part alignment, big and small end, encoding bit number control, length field encoding meaning setting, length field numerical scale, etc. can be completed by setting each control item.
最后, 由于在协议描述可以添加 C语言函数控制的控制项, 这样, 可 以将成分之间的关系通过 C语言的关系表达式进行描述, 从而完成成分之 间的约束控制的功能。 每一个值都可以通过 EXPORT进行输出, 然后调用 EMBED C中函数进行处理, 最后可以通过 IMPORT设置到值中, 这样可 以通过一个或者多个已知值计算相关值。  Finally, since control items controlled by C language functions can be added to the protocol description, in this way, the relationship between components can be described by C language relational expressions, thereby completing the function of constraint control between components. Each value can be output through EXPORT, and then the function in EMBED C is called for processing. Finally, it can be set to the value through IMPORT, so that the relevant value can be calculated from one or more known values.
下面结合具体实例对解码进行说明:  The following describes the decoding with specific examples:
参阅图 6所示, 通信设备 A与设备 B和设备 C相连, 设备 A和 B之 间按照通信协议 Protocol AB进行通信, 设备 A和 C之间按照通信协议 Protocol AC 进行通信。 消息解释过程如下:  Referring to FIG. 6, communication device A is connected to device B and device C, and communication between devices A and B is performed according to a communication protocol Protocol AB, and communication between devices A and C is performed according to a communication protocol Protocol AC. The message interpretation process is as follows:
1、 在 ASN.1 文本中加入编码解码控制字描述协议 AB和协议 AC的 消息的结构。  1. Add encoding and decoding control words to the ASN.1 text to describe the message structure of the protocol AB and protocol AC.
利用编译器将 ASN.1 文本信息转换成解码库函数可以识别的协议消 息结构描述信息 (协议动态库) : ab.dll , ac.dll  Use the compiler to convert ASN.1 text information into protocol message structure description information (protocol dynamic library) that can be recognized by the decoding library function: ab.dll, ac.dll
2、在使用时, 捕获设备人、 B之间和设备 A、 C之间通信的消息码流, 将消息码流和其对应的协议动态库传递给消息解释器。  2. When in use, capture the message code stream of communication between device people, B and devices A and C, and pass the message code stream and its corresponding protocol dynamic library to the message interpreter.
3、 消息解释器利用公共的解码函数库, 按照协议动态库中定义的消息 结构对消息码流进行解码, 构成一个解码后的消息值树。  3. The message interpreter uses a common decoding function library to decode the message code stream according to the message structure defined in the protocol dynamic library to form a decoded message value tree.
4、 为了方便人阅读消息的信息, 消息解释器按照值树上各个节点的类 型输出相应的字符串, 解释器遍历值树的每个节点, 从而把整个消息的内 容生成具有层次结构的格式化文本并输出; 为了图形化的观察消息, 分析 输出的格式化文本流, 形成解释关系树并将该关系树和消息码流以图形化 的方式显示出来。 4. In order to facilitate people to read the information of the message, the message interpreter follows the class of each node in the value tree. Type the corresponding string, and the interpreter traverses each node of the value tree, so as to generate and output the formatted text with hierarchical structure for the entire message content; in order to observe the message graphically, analyze the output formatted text stream to form Interpret the relationship tree and graphically display the relationship tree and message code stream.
如, 协议描述如下:  For example, the protocol is described as follows:
UINT8 : := <V,V|LEN-8>INTEGER(0..255)  UINT8:: = <V, V | LEN-8> INTEGER (0..255)
INT8 ::= <V,V|LEN-8>INTEGER(-128..127)  INT8 :: = <V, V | LEN-8> INTEGER (-128..127)
UINT16:: = <V,V|LEN-16>INTEGER(0..65535)  UINT16 :: = <V, V | LEN-16> INTEGER (0..65535)
Msg ::= <V> SEQUENCE  Msg :: = <V> SEQUENCE
{  {
al INT8,  al INT8,
bl Strua  bl Strua
}  }
Strua:: = <V> SEQUENCE  Strua :: = <V> SEQUENCE
{  {
a UINT8,  a UINT8,
b UINT16  b UINT16
}  }
转换后的协议动态库中含有的协议的消息结构是一个记录协议中各种 类型定义的一个表格和一个反映协议中各种类型的相互关系和协议中消息 的組成关系的一棵协议消息的类型树, 参阅图 7和下表所示。  The message structure of the protocol contained in the converted protocol dynamic library is a table that records the various types of definitions in the protocol and a protocol message type that reflects the various types of relationships in the protocol and the composition of the messages in the protocol. Tree, see Figure 7 and the table below.
类型 类型信息 编码解码控制 约束 其他 Type type information codec control constraint other
INT8 由基本类型 INTEGER生成 V,V|LEN-8 0 - -255 INT8 is generated by the basic type INTEGER V, VLEN-8 0--255
UINT8 由基本类型 INTEGER生成 V,V|LEN-8 -128—127  UINT8 is generated by the basic type INTEGER V, V | LEN-8 -128—127
蘭 T16 由基本类型 INTEGER生成 V,V|LEN-16 0-65535  Blue T16 is generated by the basic type INTEGER V, VLen-16 0-65535
Msg 复合类型由 {UINT8 UNIT16} V 无  Msg composite type by {UINT8 UNIT16} V None
两个类型生成  Two type generation
Strua 复合类型由 {I T8 Strua} V 无  Strua composite type by {I T8 Strua} V None
两个类型生成 以上面的结构为例子, 码流为: 0x80 0xf5 0x00 0xF4, 协议为 ab, 参 阅图 7、 图 8, 解码过程如下: Two type generation Taking the above structure as an example, the code stream is: 0x80 0xf5 0x00 0xF4, and the protocol is ab. Refer to FIG. 7 and FIG. 8. The decoding process is as follows:
1、 装入协议动态库, 找到协议动态库中记录的消息的根节点、 从根节 点开始构造解码后消息的值树。  1. Load the protocol dynamic library, find the root node of the message recorded in the protocol dynamic library, and construct the decoded message value tree from the root node.
消息解释器将协议 ab.dll装入到内存中, 协议 ab的消息的结构和结构 中所用到的各种类型定义的信息就放到内存中 , 可以查询到。  The message interpreter loads the protocol ab.dll into the memory, and the structure of the message of the protocol ab and various types of definition information used in the structure are put into the memory and can be queried.
2、 根据节点编码解码控制字 ( BER, PER, TLV ) 以及该组合类型的子 类型,往其儿子节点或者孙子节点中查找到第一个类型是基本类型的节点。  2. According to the node encoding and decoding control words (BER, PER, TLV) and the subtypes of the combined type, find the node whose first type is the basic type from its children or grandchildren.
从 ab.dll 中发现协议的消息的根节点是 Msg,其是符合类型, 编码控制 字是 V。 根据 TLV的解码规则, V复合类型节点本身不产生码流, 因此可 以在编码产生的值树上直接才艮据类型树的信息构造出这个根节点, 然后在 从码流中取信息对应该对其儿子进行解码, 笫一个儿子是 al,类型是 INT8, 从类型表中可以查到是 INT8 就是 INTERGER , 编码控制字为 V , The root node of the protocol message found from ab.dll is Msg, which is a conforming type, and the encoding control word is V. According to the decoding rules of the TLV, the V composite type node itself does not generate a code stream, so the root node can be constructed based on the information of the type tree directly on the value tree generated by the encoding, and then the information from the code stream should correspond His son decodes it. 笫 A son is al and the type is INT8. It can be found from the type table that INT8 is INTERGER and the encoding control word is V.
V|LEN-8, 约束是 -128..127, 可以对 al进行解码。 V | LEN-8, the constraint is -128..127, can decode al.
3、 调用该基本类型的对应的解码函数, 解码成该信元的值树上的一个 节点, 并记录输入码流已经解码到的位置。  3. Call the corresponding decoding function of the basic type, decode it into a node on the value tree of the cell, and record the position where the input code stream has been decoded.
从 LEN-8控制字得知, 这个信元编码后占用一个字节, 因此从码流中 取出一个字节 0X80, 做过 al这个信元的值, 并记录解码已经进行到码流 的第二个字节。  It is learned from the LEN-8 control word that this cell occupies one byte after encoding, so a byte 0X80 is taken from the code stream, the value of this cell has been done, and the decoding has been recorded to the second of the code stream. Bytes.
4、 从上到下、 从左到右递归着依次完成值树上各个节点的构造。 已经 解码的码流长度, 不断增加。 到解码完成时, 已经解码的码流长度正好等 于码流长度, 整棵值树构造完成。  4. Recursively complete the construction of each node on the value tree from top to bottom and from left to right. The length of the decoded code stream is increasing. By the time the decoding is completed, the length of the decoded code stream is exactly equal to the code stream length, and the entire value tree is constructed.
依次下去解出信元 bl , a, b, 逐步生成了消息的值树, 就完成了消息 的解码过程。  The cells bl, a, and b are solved in turn, and the value tree of the message is gradually generated, and the message decoding process is completed.
解码后的消息如下:  The decoded message is as follows:
Msg  Msg
0〉 80 10000000 ....al: -0x80 (-128)  0〉 80 10000000 .... al: -0x80 (-128)
....bl  .... bl
1> F5 11110101 ...... a: 0xf5 (245) 2> 00 00000000 1> F5 11110101 ...... a: 0xf5 (245) 2> 00 00000000
3〉 F4 11110100 ...... b: 0xf4 (244)  3> F4 11110100 ...... b: 0xf4 (244)
本发明的接口消息解释器是在协议通用描述的基础上工作的, 这样当 协议变化的时候, 只要更改协议的描述, 而不必去修改接口消息解释器本 身的程序, 使其具有最大限度的通用性。 由于 ASN.1的广泛使用, 很多标 准接口协议都釆用 ASN.1语言做了描述, 可以节省大量协议描述工作量。 为了解决不是釆用 ASN.1 制定的协议的描述问题, 在 ASN.1 的上扩展了 TLV的编码控制字, 用一种可扩展的记法来表示协议的, 在描述文件中可 嵌入 C代码对码流进行处理, 使得用 ASN.1来描述这些协议成为可能, 并 且较为方便。 本发明解决了已有消息解释器通用性差, 扩展较困难的缺点, 在描述文件上采用 ASN.1标准,并对 ASN.1标准所支持的编码解码方式进 行了扩充使其可以很好的支持不是采用 ASN.1描述消息结构的协议, 使得 此方案的应用范围更广。  The interface message interpreter of the present invention works on the basis of a general description of the protocol. In this way, when the protocol changes, as long as the description of the protocol is changed, there is no need to modify the program of the interface message interpreter itself, so that it has the greatest general Sex. Due to the widespread use of ASN.1, many standard interface protocols are described in ASN.1 language, which can save a lot of protocol description workload. In order to solve the problem of not describing the protocol formulated by ASN.1, the encoding control word of TLV is extended on ASN.1, the protocol is expressed by an extensible notation, and the C code can be embedded in the description file Processing the code stream makes it possible to describe these protocols with ASN.1 and is more convenient. The invention solves the shortcomings of existing message interpreters, such as poor generality and difficult expansion, adopts the ASN.1 standard in the description file, and extends the encoding and decoding methods supported by the ASN.1 standard so that it can well support It is not a protocol that uses ASN.1 to describe the message structure, which makes the application of this scheme wider.

Claims

权 利 要 求 Rights request
1、 一种通用消息解释器的实现方法, 其特征在于包括步骤:  1. A method for implementing a universal message interpreter, which is characterized by including steps:
A、 从通讯接口获取消息码流;  A. Obtain the message code stream from the communication interface;
B、 调用消息码流采用的协议所对应的协议消息结构描述信息, 根据 该描述信息中各信元的编码解码控制字调用相应的解码函数对所述消息 码流进行逐段解码, 形成消息值树, 该消息值树的每个节点对应消息的一 个信元, 其中:  B. Call the protocol message structure description information corresponding to the protocol used by the message code stream, and call the corresponding decoding function to decode the message code stream piece by piece according to the encoding and decoding control word of each cell in the description information to form the message value Tree, each node of the message value tree corresponds to one cell of the message, where:
如果信元的协议编解码控制字表示为基本编码规则 BER,则调用 BER 的解码函数进行解码;  If the cell's protocol codec control word is expressed as the basic coding rule BER, the decoding function of the BER is called for decoding;
如果信元的编解码控制字表示为压缩编码规则 PER, 则调用 PER的 解码函数进行解码;  If the codec control word of the cell is expressed as the compression coding rule PER, then the decoding function of the PER is called for decoding;
如果信元的编解码控制字表示为类型-长度-值记法 TLV, 则调用 TLV 的解码函数进行解码;  If the codec control word of a cell is represented as a type-length-value notation TLV, the decoding function of the TLV is called for decoding;
如果信元的编解码控制字表示为 BER、 PER和 TLV中多项的組合, 则分别调用对应的解码函数进行解码;  If the codec control word of a cell is expressed as a combination of multiple items in BER, PER, and TLV, then the corresponding decoding functions are called for decoding;
C、 遍历所述消息值树, 对每个信元按其格式输出解码后的字符串。 C. Traverse the message value tree, and output a decoded character string for each cell according to its format.
2、 如权利要求 1所述的方法, 其特征在于, 步骤 C中, 将字符串生 成具有层次结构的格式化文本流后输出。 2. The method according to claim 1, wherein in step C, a character string is generated into a formatted text stream with a hierarchical structure and output.
3、 如权利要求 2所述的方法, 其特征在于, 所述的方法还包括: E: 通过图形界面 GUI分析输出的文本流,形成解释关系树, 并在该图形界面 上将关系树和消息码流显示出来。  3. The method according to claim 2, further comprising: E: analyzing the output text stream through a graphical interface GUI to form an explanatory relation tree, and combining the relation tree and the message on the graphical interface The code stream is displayed.
4、 如权利要求 1、 2或 3所述的方法, 其特征在于,步驟 B中解码包 括步骤:  4. The method according to claim 1, 2 or 3, wherein the decoding in step B comprises the steps:
从协议消息结构描述信息中找到消息的根节点, 并从根节点开始构造 解码后消息的值树;  Find the root node of the message from the description information of the protocol message structure, and construct a value tree of the decoded message starting from the root node;
才艮据节点编码解码控制字以及该组合类型的子类型, 往其儿子节点或 者孙子节点中查找到第一个类型是基本类型的节点;  According to the node encoding and decoding control word and the subtype of the combined type, find the node whose first type is the basic type from its child node or grandchild node;
调用该基本类型的编解码控制字对应的解码函数, 解码成该信元的值 树上的一个节点, 并记录输入码流已经解码到的位置; 依次完成值树上各个节点的构造, 构成整棵值树。 Call the decoding function corresponding to the basic type of codec control word, decode it into a node on the value tree of the cell, and record the position where the input code stream has been decoded; The construction of each node on the value tree is completed in turn to form the entire value tree.
5、 如权利要求 1所述的方法, 其特征在于, 在进行步骤 A之前, 还 包括步據: 将抽象语法记号 1 ( ASN.1 ) 与编码解码控制字结合对需要解 释的协议进行描述并形成协议消息结构描述信息, 再将该描述信息生成协 议动态库供调用。  5. The method according to claim 1, further comprising the step of: before performing step A, combining the abstract syntax mark 1 (ASN.1) with the encoding and decoding control word to describe the protocol to be interpreted and The protocol message structure description information is formed, and then the description information is used to generate a protocol dynamic library for invocation.
6、 如权利要求 5所述的方法, 其特征在于, 所述编码解码控制字添 加在 ASN.1文本中的类型定义处。  6. The method according to claim 5, wherein the codec control word is added to a type definition in the ASN.1 text.
7、 如权利要求 5或 6所述的方法, 其特征在于,所述的编码解码控制 字可为 BER、 PER和 TLV之一, 或者为 BER、 PER和 TLV的多项组合。  7. The method according to claim 5 or 6, wherein the encoding and decoding control word is one of BER, PER, and TLV, or multiple combinations of BER, PER, and TLV.
8、 如权利要求 5或 6所述的方法, 其特征在于: 所述 ASN.1文本中 嵌入有实现信元间约束关系的 C语言程序并包含在生成的协议动态库中; 当完成解码后执行该程序, 完成自定义约束限制。  8. The method according to claim 5 or 6, characterized in that: the C language program that implements the constraint relationship between cells is embedded in the ASN.1 text and is included in the generated protocol dynamic library; Execute this procedure to complete the custom constraint restrictions.
PCT/CN2004/001424 2003-12-12 2004-12-07 The implementing method of universal message explainer WO2005057873A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200310123617 CN100505743C (en) 2003-12-12 2003-12-12 Method for realizing general message interpreter
CN200310123617.4 2003-12-12

Publications (1)

Publication Number Publication Date
WO2005057873A1 true WO2005057873A1 (en) 2005-06-23

Family

ID=34661437

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2004/001424 WO2005057873A1 (en) 2003-12-12 2004-12-07 The implementing method of universal message explainer

Country Status (2)

Country Link
CN (1) CN100505743C (en)
WO (1) WO2005057873A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2473180C2 (en) * 2008-07-02 2013-01-20 Зте Корпарейшн Method to process communication data of tlv format
EP3257235A4 (en) * 2015-02-10 2018-02-21 Telefonaktiebolaget LM Ericsson (publ) A method and apparatus for data mediation
CN111817727A (en) * 2020-06-28 2020-10-23 积成电子股份有限公司 PER encoder implementation method suitable for DL/T860 standard

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859359B (en) * 2005-07-12 2010-08-25 上海华为技术有限公司 Realizing method and its device for communication protocol described by abstract grammar rule
CN100579120C (en) * 2005-12-31 2010-01-06 中兴通讯股份有限公司 Implementation method for automatic generation of PDU coding/decoding code based on ASN.1 definition
CN101370003B (en) * 2007-08-14 2012-08-08 大唐移动通信设备有限公司 Method and apparatus for customizing communication protocol, method and apparatus for converting communication protocol description
CN101179580B (en) * 2007-12-12 2010-08-11 北京北方烽火科技有限公司 Method for implementing encoding/decoding of WiMAX system information
CN102281259B (en) * 2010-06-11 2014-01-29 深圳市金蝶中间件有限公司 Method and device for decoding request information
CN102270223B (en) * 2011-06-22 2017-03-29 中兴通讯股份有限公司 The generation method in source codec storehouse, device and source codec method, device
CN104142816B (en) * 2013-05-10 2018-05-15 中国电信股份有限公司 User's card and its CDMA short message analytic methods
CN105740292B (en) * 2014-12-12 2019-06-28 深圳市中兴微电子技术有限公司 A kind of coding/decoding method and device
CN105139053B (en) * 2015-10-15 2018-01-30 江苏本能科技有限公司 Radio-frequency identification reader/writer interface protocol debugging apparatus and method
CN111131403A (en) * 2019-12-06 2020-05-08 深圳猛犸电动科技有限公司 Message coding and decoding method and device for Internet of things equipment
CN113742294A (en) * 2021-08-23 2021-12-03 宜通世纪科技股份有限公司 Method, system, device and medium for decoding ASN.1-PER signaling message
CN115190184B (en) * 2022-06-14 2023-06-23 深圳市圣麾科技有限公司 Binary message cell editing method, system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0520708A2 (en) * 1991-06-28 1992-12-30 Digital Equipment Corporation Method and apparatus for converting high level form abstract syntaxes into an intermediate form
JPH08106424A (en) * 1994-10-06 1996-04-23 Nec Corp Data loading system for mib of osi management system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0520708A2 (en) * 1991-06-28 1992-12-30 Digital Equipment Corporation Method and apparatus for converting high level form abstract syntaxes into an intermediate form
JPH08106424A (en) * 1994-10-06 1996-04-23 Nec Corp Data loading system for mib of osi management system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2473180C2 (en) * 2008-07-02 2013-01-20 Зте Корпарейшн Method to process communication data of tlv format
EP3257235A4 (en) * 2015-02-10 2018-02-21 Telefonaktiebolaget LM Ericsson (publ) A method and apparatus for data mediation
US10511720B2 (en) 2015-02-10 2019-12-17 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for data mediation
CN111817727A (en) * 2020-06-28 2020-10-23 积成电子股份有限公司 PER encoder implementation method suitable for DL/T860 standard
CN111817727B (en) * 2020-06-28 2024-04-09 积成电子股份有限公司 PER encoder realization method suitable for DL/T860 standard

Also Published As

Publication number Publication date
CN100505743C (en) 2009-06-24
CN1627757A (en) 2005-06-15

Similar Documents

Publication Publication Date Title
WO2005057873A1 (en) The implementing method of universal message explainer
US7219328B2 (en) Model-based composable code generation
CA2244918C (en) A management interworking unit and a method for producing such a unit
EP2124419B1 (en) An object oriented management device for asn.1 message
US7353296B2 (en) Method for performing data structure conversions
ES2659396T3 (en) Method for processing TLV format of communication data
US20050278693A1 (en) Distribution adaptor for network management application development
CN103513976B (en) Service flowpath modelling approach and device
CN101197818A (en) ASN.1 packet object oriented processing method
Käbisch et al. Efficient and flexible XML-based data-exchange in microcontroller-based sensor actor networks
CN109683873A (en) Utilize the coding method of aerospace information interface and system architecture of ASN1 rule
CN104077414B (en) A kind of decoding apparatus and its coding/decoding method applied to LTE network signal
CN107832046A (en) Data creation method and device
CN113742294A (en) Method, system, device and medium for decoding ASN.1-PER signaling message
Deri et al. An object-oriented approach to the implementation of OSI management
CN111913714B (en) Method and device for mapping substation control layer communication service of transformer substation based on Thrift
US5907537A (en) OA&amp;M system
Lee Translation of GDMO/ASN. 1 to Java objects for network management
US7941452B2 (en) Apparatus and method for efficient encoding of application definition using contiguous arrays
Cleghorn et al. ASNST: An abstract syntax notation-one support tool
CN114661955A (en) Configured XML message analysis method, system, device and memory
Horowitz Bringing java to TMN
Hall Generation of Restful API Proxy Service from Soap Service
Yuen et al. Simplified message transformation for optimization of message processing in 3G-324M control protocol
CN116016691A (en) Communication protocol coding method and system

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): BW GH GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LT LU MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
122 Ep: pct application non-entry in european phase