CN101321177B - Flat code stream node and flat code stream encoding/decoding method of message - Google Patents

Flat code stream node and flat code stream encoding/decoding method of message Download PDF

Info

Publication number
CN101321177B
CN101321177B CN2008101416409A CN200810141640A CN101321177B CN 101321177 B CN101321177 B CN 101321177B CN 2008101416409 A CN2008101416409 A CN 2008101416409A CN 200810141640 A CN200810141640 A CN 200810141640A CN 101321177 B CN101321177 B CN 101321177B
Authority
CN
China
Prior art keywords
code stream
data
flat code
stream node
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2008101416409A
Other languages
Chinese (zh)
Other versions
CN101321177A (en
Inventor
马征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN2008101416409A priority Critical patent/CN101321177B/en
Publication of CN101321177A publication Critical patent/CN101321177A/en
Application granted granted Critical
Publication of CN101321177B publication Critical patent/CN101321177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a flattened bit stream node and an encoding/decoding method for the flattened bit stream of a message. The flattened bit stream node comprises a name, a type, an index, a member number and data fields which are spaced by the preset first identifiers; the flattened bit stream node starts and ends with marking by the preset second identifiers. The technical solution of the invention makes a network management system to be compatible with messages in different versions.

Description

The flat code stream decoding method of a kind of flat code stream node and message
Technical field
The present invention relates to the decoding method of a kind of code stream node and message, the flat code stream decoding method of especially a kind of flat code stream node and message.
Background technology
In the network management system, the transmission of ASN.1 (Abstract Syntax Notation One, Abstract Syntax Notation) message has the process of a coding and decoding.During coding, different ASN.1 data type or structure are compiled into binary code stream; During decoding, binary code stream is reduced into concrete ASN.1 data type or structure.
To the encoding and decoding of ASN.1 message, industry generally adopts BER (BasicEncoding Rules, the Basic Encoding Rules) mode of standard at present.A remarkable defective of BER mode be exactly can not compatible different editions message, simultaneously, extensibility is also relatively poor.In the practical application, ASN.1 message version changes along with the continuous variation of user's request, and this just needs the different editions that network management system can compatible message, but the BER mode of standard can't realize.
Summary of the invention
The technical problem to be solved in the present invention provides the flat code stream decoding method of a kind of flat code stream node and message, has realized the compatibility of network management system to the different editions message.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of flat code stream node comprises title, type, index, number of members and data field, and each interfield is separated by the first default identifier, and the initial and end of described flat code stream node indicates by the second default identifier.
In the such scheme, described data field comprises message length field and message data field, and described message length field is 4 bytes; When described flat code stream node types was BitString, described message data field also comprised the significance bit field of 4 bytes.
A kind of flat code stream coding method of message may further comprise the steps:
A, message is compiled into flat code stream coding source data;
The flat code stream node of the structure correspondence in the described source data is constructed in b, the coding method of employing structure;
C, construct the flat code stream node of each data member correspondence of described structure successively, when described data member is structure, adopt described structure coding method to construct its corresponding flat code stream node, and the number of members of the flat code stream node of each structure correspondence under it is increased progressively 1; When described data member is the basic data type data, adopt the basic data type data-encoding scheme to construct its corresponding flat code stream node, and the number of members of the flat code stream node of each structure correspondence under it is increased progressively 1.
In the such scheme, described structure coding method is as follows: construct a flat code stream node, the name of described flat code stream node is called the title of described structure; Type is empty; When described structure was the data member of other structure, index was its positional value in described other structure data member, otherwise index is a negative integer; Number of members is 0; Message data in the data field is empty, and message length is 0; Separate by the first default identifier between described title, type, index, number of members and the data field, the initial and end of described flat code stream node indicates by the second default identifier.
In the such scheme, described basic data type data-encoding scheme is as follows: construct a flat code stream node, the name of described flat code stream node is called the name variable of described basic data type data; Type is empty or described basic data type; When described basic data type data were the data member of structure, index was its positional value in described structure data member, otherwise index is a negative integer; Number of members is 0; Message data in the data field is the business datum of described basic data type data, and message length is the shared byte number of described message data; Separate by the first default identifier between described title, type, index, number of members and the data field, the initial and end of described flat code stream node indicates by the second default identifier.
In the such scheme, when described basic data type was Bit String, described flat code stream node types was Bit String, and there is effective bit field in described data field, and its value is the shared number of bits of described message data.
A kind of flat code stream coding/decoding method of message may further comprise the steps:
Relation between A, the structure of determining the flat code stream correspondence and the basic data type data;
B, described flat code stream node is reduced into corresponding structure or basic data type data, and organizes described structure and basic data type data according to described relation.
In the such scheme, among the described step B, when reducing described flat code stream node,, directly it is reduced into the structure of same title if the number of members of described flat code stream node is not 0; If the number of members of described flat code stream node is 0, obtains business datum according to the message data in its data field, and it is reduced into the basic data type data of same title.
In the such scheme, described steps A specifically may further comprise the steps:
A1, determine the flat code stream node that described flat code stream comprises;
A2, the structure data of determining described flat code stream correspondence according to the index and the number of members of described flat code stream node and the relation between the basic data type data.
In the such scheme, in the described steps A 1, determine described flat code stream node according to default first identifier and second identifier.
Beneficial effect of the present invention mainly shows: the flat code stream coding method of message provided by the invention is compressed into tree-shaped code flow structure the flat code stream that comprises flat code stream node of the present invention, the flat code stream coding/decoding method of message provided by the invention is by the strictness coupling of code stream nodename, above-mentioned flat code stream is reverted to tree-shaped code flow structure, thereby realized the compatibility of network management system, and the extensibility of code stream node when having strengthened encoding and decoding to the different editions message.
Description of drawings
Fig. 1 is the structural representation of flat code stream node of the present invention;
Fig. 2 is the flat code stream coding flow chart of message of the present invention;
Fig. 3 is the flat code stream decoding process figure of message of the present invention.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
With reference to Fig. 1, a kind of flat code stream node, comprise title, type, index, number of members and data field, each interfield is by the first default identifier, separate as " 0 ", and initial and second identifier that finishes by presetting of this flat code stream node indicates, as adopts corresponding " { " and " } " to indicate the initial of this flat code stream node and end respectively; The data field of flat code stream node further comprises message length field and message data field, the message length field is 4 bytes, and when the flat code stream node types was BitString, the message data field also comprised the significance bit field of 4 bytes.
The flat code stream node is the basic element of message flat code stream, can not be in data field other field appearance in addition as the symbol of first identifier and second identifier.The flat code stream coding method of the message that describes below and the flat code stream coding/decoding method of message all are based on the flat code stream node of said structure.
With reference to Fig. 2, a kind of flat code stream coding method of message may further comprise the steps:
S201: message is compiled into flat code stream coding source data; For the ease of trace debug, can simultaneously the compiling result be printed;
S202: the flat code stream node that adopts structure coding method structure source data root architecture body correspondence; The root architecture body is the root node of the tree-shaped code flow structure of source data;
S203: the flat code stream node of constructing each data member correspondence of this structure successively, when data member is structure, adopt the structure coding method to construct its corresponding flat code stream node, and the number of members of the flat code stream node of each structure correspondence under it is increased progressively 1; When data member is the basic data type data, adopt the basic data type data-encoding scheme to construct its corresponding flat code stream node, and the number of members of the flat code stream node of each structure correspondence under it is increased progressively 1.Wherein, the basic data type data comprise data types such as Interger, Bit String, Boolean, long.
Structure coding method described in the above-mentioned flow process is as follows:
Construct a flat code stream node, the name of this flat code stream node is called the title of structure; Type is empty; When structure was the data member of other structure, index was its positional value in described other structure data member, otherwise index is a negative integer, can get-1; Number of members is 0; Message data in the data field is empty, and message length is 0; Separate by first identifier between title, type, index, number of members and the data field, the initial and end of this flat code stream node indicates by second identifier.
Basic data type data-encoding scheme described in the above-mentioned flow process is as follows: construct a flat code stream node, the name of this flat code stream node is called the name variable of these basic data type data; Type is empty or this basic data type; When these basic data type data were the data member of structure data, index was its positional value in the structure data member, otherwise index is a negative integer, can get-1; Number of members is 0; Message data in the data field is the business datum of described basic data type data, and message length is the shared byte number of described message data; Separate by first identifier between title, type, index, number of members and the data field, the initial and end of this flat code stream node indicates by second identifier.
Further, when this basic data type was Bit String, flat code stream node types field can not be sky, was Bit String, and there is effective bit field in its data field, was worth to be the shared number of bits of message data.
With reference to Fig. 3, a kind of flat code stream coding/decoding method of message may further comprise the steps:
S301: determine the flat code stream node that it comprises according to default first identifier and second identifier;
S302: the structure of determining the flat code stream correspondence according to the index and the number of members of flat code stream node and the relation between the basic data type data;
S303: the flat code stream node is reduced into corresponding structure or basic data type data, and concerns institutional framework body and basic data type data according to what determine; Wherein, during reduction flat code stream node, if the number of members of this flat code stream node is not 0, i.e. this flat code stream node enantiomorph, the business datum of itself be a sky, therefore, directly it is reduced into the structure of same title; If the number of members of this flat code stream node is 0, promptly the corresponding basic data type data of this flat code stream node are then obtained business datum according to the message data in its data field, and it are reduced into the basic data type data of same title.
From foregoing description as can be seen, the title of structure that the flat code stream node is corresponding with it in the decode procedure or basic data type data is strict couplings, so the situation of dislocation of decoding can not occur, thereby realize the compatibility of network management system to different editions ASN.1 message.
Be source data with structure A below, the flat code stream decoding method of message of the present invention is further described that wherein, first data member of structure A is Interger data i, second data member is structure B; First data member of structure B is Interger data m, and second data member is structure C; First data member of structure C is the Interger data n, and second data member is Bit String data p.
During coding, carry out following operation successively:
1, structure A is encoded, the name of the flat code stream node that it is corresponding is called A; Type is empty; Index is-1; Number of members is 0; The message data of data field is empty, and message length is 0; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 ";
2, to structure A first data member---Interger data i encodes, the name of the flat code stream node that it is corresponding is called i; Type is Interger; Index is 0 (expression i is first data member of structure A, promptly since the positional value of 0 each data member of indicating arrangement body A); Number of members is 0; The message data of data field is the integer coding of its business datum, and message length is the shared byte number of message data; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 "; In the time of the flat code stream node of structure i correspondence, the number of members of the flat code stream node of the structure A correspondence under it is increased progressively 1;
3, to structure A second data member---structure B is encoded, the name of the flat code stream node that it is corresponding is called B; Type is empty; Index is 1 (the expression structure B is second data member of structure A); Number of members is 0; The message data of data field is empty, and message length is 0; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 "; In the time of the flat code stream node of structural texture body B correspondence, the number of members of the flat code stream node of the structure A correspondence under it is increased progressively 1;
4, to structure B first data member---Interger data m encodes, the name of the flat code stream node that it is corresponding is called m; Type is Interger; Index is 0 (expression m is first data member of structure B, promptly since the positional value of 0 each data member of indicating arrangement body B); Number of members is 0; The message data of data field is the integer coding of its business datum, and message length is the shared byte number of message data; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 "; In the time of the flat code stream node of structure m correspondence, the number of members of the flat code stream node of structure A under it and structure B correspondence is increased progressively 1 respectively;
5, to structure B second data member---structure C encodes, the name of the flat code stream node that it is corresponding is called C; Type is empty; Index is 1 (expression structure C is second data member of structure B); Number of members is 0; The message data of data field is empty, and message length is 0; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 "; In the time of the flat code stream node of structural texture body C correspondence, the number of members of the flat code stream node of structure A under it and structure B correspondence is increased progressively 1 respectively;
6, to structure C first data member---the Interger data n is encoded, the name of the flat code stream node that it is corresponding is called n; Type is Interger; Index is 0 (expression n is first data member of structure C, promptly since the positional value of 0 each data member of indicating arrangement body C); Number of members is 0; The message data of data field is the integer coding of its business datum, and message length is the shared byte number of message data; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 "; In the time of the flat code stream node of structure n correspondence, the number of members of the flat code stream node of the structure A under it, structure B and structure C correspondence is increased progressively 1 respectively;
7, to structure C second data member---Bit String data p encodes, the name of the flat code stream node that it is corresponding is called p; Type is Bit String; Index is 1 (expression p is second data member of structure C); Number of members is 0; The message data of data field is the byte code of its business datum, and message length is the shared byte number of message data, and significance bit is the shared number of bits of message data; Separate this flat code stream node initial and finish to indicate respectively between title, type, index, number of members and the data field with corresponding " { " " } " by " 0 "; In the time of the flat code stream node of structure p correspondence, the number of members of the flat code stream node of the structure A under it, structure B and structure C correspondence is increased progressively 1 respectively.
So far the flat code stream end-of-encode of this source data, at this moment, the number of members of the flat code stream node of structure A, structure B and structure C correspondence is respectively 6,4 and 2.
In the process that it is decoded, to carry out according to flow process shown in Figure 3, the strictness coupling by to flat code stream node structure corresponding with it or basic data type data name has realized the compatibility of network management system to the different editions message.
The above is embodiments of the invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within the claim scope of the present invention.

Claims (4)

1. the flat code stream coding method of a message is characterized in that, may further comprise the steps:
A, message is compiled into flat code stream coding source data;
The flat code stream node of described source data root architecture body correspondence is constructed in b, the coding method of employing structure; Described structure coding method is as follows: construct a flat code stream node, the name of described flat code stream node is called the title of described structure; Type is empty; When described structure was the data member of other structure, index was its positional value in described other structure data member, otherwise index is a negative integer; Number of members is 0; Message data in the data field is empty, and message length is 0; Separate by the first default identifier between described title, type, index, number of members and the data field, the initial and end of described flat code stream node indicates by the second default identifier;
C, construct the flat code stream node of each data member correspondence of described structure successively, when described data member is structure, adopt described structure coding method to construct its corresponding flat code stream node, and the number of members of the flat code stream node of each structure correspondence under it is increased progressively 1; When described data member is the basic data type data, adopt the basic data type data-encoding scheme to construct its corresponding flat code stream node, and the number of members of the flat code stream node of each structure correspondence under it is increased progressively 1; Described basic data type data-encoding scheme is as follows: construct a flat code stream node, the name of described flat code stream node is called the name variable of described basic data type data; Type is empty or described basic data type; When described basic data type data were the data member of structure, index was its positional value in described structure data member, otherwise index is a negative integer; Number of members is 0; Message data in the data field is the business datum of described basic data type data, and message length is the shared byte number of described message data; Separate by the first default identifier between described title, type, index, number of members and the data field, the initial and end of described flat code stream node indicates by the second default identifier.
2. the flat code stream coding method of message as claimed in claim 1, it is characterized in that: when described basic data type is Bit String, described flat code stream node types is Bit String, and, there is effective bit field in described data field, and its value is the shared number of bits of described message data.
3. the flat code stream coding/decoding method of a message is characterized in that, may further comprise the steps:
Relation between A, the structure of determining the flat code stream correspondence and the basic data type data; Described steps A specifically may further comprise the steps:
A1, determine the flat code stream node that described flat code stream comprises;
A2, the structure data of determining described flat code stream correspondence according to the index and the number of members of described flat code stream node and the relation between the basic data type data;
B, described flat code stream node is reduced into corresponding structure or basic data type data, and organizes described structure and basic data type data according to described relation; Among the described step B, when reducing described flat code stream node,, directly it is reduced into the structure of same title if the number of members of described flat code stream node is not 0; If the number of members of described flat code stream node is 0, obtains business datum according to the message data in its data field, and it is reduced into the basic data type data of same title.
4. the flat code stream coding/decoding method of message as claimed in claim 3 is characterized in that: in the described steps A 1, determine described flat code stream node according to default first identifier and second identifier.
CN2008101416409A 2008-07-18 2008-07-18 Flat code stream node and flat code stream encoding/decoding method of message Active CN101321177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101416409A CN101321177B (en) 2008-07-18 2008-07-18 Flat code stream node and flat code stream encoding/decoding method of message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101416409A CN101321177B (en) 2008-07-18 2008-07-18 Flat code stream node and flat code stream encoding/decoding method of message

Publications (2)

Publication Number Publication Date
CN101321177A CN101321177A (en) 2008-12-10
CN101321177B true CN101321177B (en) 2011-06-22

Family

ID=40180995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101416409A Active CN101321177B (en) 2008-07-18 2008-07-18 Flat code stream node and flat code stream encoding/decoding method of message

Country Status (1)

Country Link
CN (1) CN101321177B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717032B (en) * 2013-12-14 2018-05-08 中国航空工业集团公司第六三一研究所 A kind of decoding method suitable for AFDX network data transparent transmissions

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1635763A (en) * 2003-12-26 2005-07-06 中国电子科技集团公司第三十研究所 General coding decoding method for high layer application of abstract syntax representation
WO2006041259A1 (en) * 2004-10-13 2006-04-20 Electronics And Telecommunications Research Institute Method and apparatus for encoding/decoding point sequences on laser binary representation
CN1851701A (en) * 2005-11-29 2006-10-25 华为技术有限公司 Binary data access method
CN101001160A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Cooling method and coder

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1635763A (en) * 2003-12-26 2005-07-06 中国电子科技集团公司第三十研究所 General coding decoding method for high layer application of abstract syntax representation
WO2006041259A1 (en) * 2004-10-13 2006-04-20 Electronics And Telecommunications Research Institute Method and apparatus for encoding/decoding point sequences on laser binary representation
CN1851701A (en) * 2005-11-29 2006-10-25 华为技术有限公司 Binary data access method
CN101001160A (en) * 2006-12-30 2007-07-18 华为技术有限公司 Cooling method and coder

Also Published As

Publication number Publication date
CN101321177A (en) 2008-12-10

Similar Documents

Publication Publication Date Title
CN101316241B (en) TLV format processing method for communication data
RU2595916C1 (en) Encoder, decoder and method
JP2006279958A (en) Method and system for information processing
US8683320B2 (en) Processing module, a device, and a method for processing of XML data
CN101179580B (en) Method for implementing encoding/decoding of WiMAX system information
CN101651683A (en) Method for generating analysis source code of signaling message
CN113794778B (en) Internet of things equipment description method based on functional attribute
CN102761543B (en) A kind of method and apparatus realizing the general encoding and decoding of Session Initiation Protocol
CN101321177B (en) Flat code stream node and flat code stream encoding/decoding method of message
WO2017157023A1 (en) Method and system for transmitting soap message
CN100518171C (en) General coding decoding method for high layer application of abstract syntax representation
CN104767710B (en) The transmission payload extracting method of HTTP block transmissions coding based on DFA
CN100456753C (en) Message matching method and system
CN116208667B (en) Variable-length high-compression bit message coding and decoding method
WO2014029081A1 (en) Compression method and apparatus
CN103595503B (en) A kind of frequency encoding and decoding communication system based on serial port device
CN103716127B (en) TTCN-3 based compression coding and decoding method and system
CN104717032A (en) Coding and decoding method suitable for AFDX network data transparent transmission
US20140337522A1 (en) Method and Device for Filtering Network Traffic
CN102844988B (en) The method of line coding and device
CN105099571B (en) A kind of audio communication method
CN107079158B (en) System and method for for transcoded data
US6111660A (en) Efficient digital data encoding in a data processing system
CN103597448A (en) Method and apparatuses for interchanging data
CN109510627A (en) A kind of integer coding method, apparatus and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant