CN101197818A - ASN.1 packet object oriented processing method - Google Patents

ASN.1 packet object oriented processing method Download PDF

Info

Publication number
CN101197818A
CN101197818A CNA200610161964XA CN200610161964A CN101197818A CN 101197818 A CN101197818 A CN 101197818A CN A200610161964X A CNA200610161964X A CN A200610161964XA CN 200610161964 A CN200610161964 A CN 200610161964A CN 101197818 A CN101197818 A CN 101197818A
Authority
CN
China
Prior art keywords
message
class
asn
code
processing method
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.)
Pending
Application number
CNA200610161964XA
Other languages
Chinese (zh)
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 CNA200610161964XA priority Critical patent/CN101197818A/en
Publication of CN101197818A publication Critical patent/CN101197818A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses an object-oriented processing method for an ASN.1 messages, comprising the following steps of: using an ASN.1 complier to compile an ASN.1 message into a program langue example code; modifying the generated program language example code and by means of a virtual function, complementing attribute descriptions including attribute structure descriptions and a function for creating an attribute example; providing attribute example operation to support the generated code; and establishing in the generated code TopClass ( top attribute) description including the corresponding relationship between a TopClass attribute name and the attribute descriptions. The invention solves the problem of resetting message structural example after permanent storage of the message, overcomes the drawbacks that decoding can be carried out only when the code flow data type is known, reduces the difficulty in the structure of the message, and greatly reduce the development and maintenance work of the message.

Description

The OO processing method of a kind of ASN.1 message
Technical field
The present invention relates to a kind of ASN.1 protocol massages treatment technology, the OO processing method of particularly a kind of ASN.1 message.
Background technology
ASN.1 (abstract grammar mark standard, Abstract Syntax Notation 1) is the standard criterion that is described in the transmission over networks information format of ITU definition, for internodal data transaction provides reference format.Each node only is concerned about from ASN.1 translation and is come or translate into ASN.1 and needn't know that data are stored in any form of network.It has two parts: data, data type and Format Series Lines in first part (ISO 8824/ITU X.208) descriptor, the just grammer of data; Second portion (ISO8825/ITU X.209) describes how the each several part data are formed message, and just the Basic Encoding Rules of data is originally as a part X.409 and develops, and just becomes a standard afterwards independently.First generation PKI (being public key architecture Public Key Infrastructure) standard mainly is based on ASN.1's, it is used to define the form of snmp protocol data cell and object in SNMP (Simple Network Management Protocol), is widely used in communicating by letter and the other field of computer.
Use the communication of ASN.1 message format also just to become the modal communication mode of telecom network management system.
The ASN.1 message has following special nature:
1. message is tree, and it is nested to define more multi-level message as required.
2. certain node types is varied in the message, may be for a simple data type, such as INTEGER, GRAPHICSTRING, ENUM or the like; Also might be for comprising again the composite data type SET of downstream site, SEQUENCE, SET OF, SEQUENCE OF.
3. at SET, in the SEQUENCE structure, certain node might not exist, because corresponding message node allows to be set to OPTIONAL, represents not essential.
4. when using the ASN.1 file,, become the interlude language construction by the compiler compiling then at first in ASN.1 document definition ASN.1 structure, such as Java, C Plus Plus.By using corresponding program language structure, reach the purpose of communication then.
5.ASN.1 support BER (Basic Encoding Rules, Basic Encoding Rules), DER (distinguishes coding rule, Distinguished Encoding Rules), VAL (value coding rule, ASN.1 valuenotation) coding such as, the intermediate language structure example can be encoded to code stream, but when being the intermediate language structure example, code stream decoding having problem, at first to know the structure of code stream correspondence, then could be with the decoding of the coding/decoding method of this structure, if comprise ANY type (referring to uncertain type) in this structure, the type data also will determine that its particular type could further decode again by other member's field.
About ASN.1 message general method commonly used in C/S type software be:
1. set up being connected of client and server end;
2. client and server end carry out protocol interaction:.
A) message transmitting party is filled in ASN.1 heading and message body, and heading comprises command code, and the message body adopts the ANY type, and its True Data type is different because of command code;
B) the message transmitting party coding message is a byte stream, sends to the message reciever;
C) the message reciever receives the message byte stream, and the decoding heading is then according to wherein command code, with specific data type decoding message body;
D) the message reciever is done response accordingly according to content of message;
3. mutual the end closed connection.
Often need analog message in the interface testing instrument at message, analog message has two kinds of sources, and a kind of is to create by explanatory script, and another kind is to create the message structure example by perdurable data, and further also requirement can be revised this example.And in application program, require the message persistence is saved as file or is saved in database, and from the persistence message, reproduce message sometimes.And wish that the data in the file are readable, can revise data wherein.
Usually adopt the BER coding transmission in nms subsystem, the BER code stream can not be read owing to it, and to also having ANY member's data type, can't directly restore, and this form is not suitable for persistence and preserves message; DER is a kind of unique BER that encodes, and is not suitable for persistence by the same token and preserves message.And VAL (ASN.1 VALue notation) form is a kind of for the readable name value sign form of people, utilizes " { ", " } " to carry out the nested tree-shaped mark structure of layer, has following characteristics:
1. adopt the form of " name value " for non-outermost layer node, adopt the form of " type of data structure name-value " for the outermost layer root node.
2. for SET, The data in the value of SEQUENCE " { ", " } " brackets, and adopts between the member ", " separate.
3. for SET OF, array data adopts " { ", " } " to bracket in the value of SEQUENCE OF, adopts ", " to separate between the array element.
4. for data in the value of ANY,, adopt 16 systems of byte serial to show if data are byte serials among the ANY. if specific ASN.1 data type, the then form of employing " specific data structure typonym value ".
These mark characteristics of VAL form make it have an opportunity directly to restore fully from code stream to be ASN.1 message example.And existing ASN.1 compiling platform comprises that DSET and ESNACC do not support to restore fully the function of ASN.1 message example.
Summary of the invention
The technical problem to be solved in the present invention just provides the OO processing method of a kind of ASN.1 message, solve the message persistence and preserve the problem that back message structure example restores establishment again, overcome and to know the shortcoming that the bit stream data type could be decoded in advance, reduced the structure difficulty of message, the workload that greatly alleviates the message exploitation and safeguard.
In order to solve the problems of the technologies described above, the invention provides the OO processing method of a kind of ASN.1 message, comprise the steps:
(1) with the ASN.1 compiler ASN.1 message is compiled into the program language example code;
(2) the program language example code that generates of modify steps (1) is replenished the descriptor of class in the mode of Virtual Function, comprises the class formation descriptor and creates the function of class example;
(3) code that step (2) is generated increases the support to the class example operation;
(4) set up TopClass class description table in the code that step (3) generates, comprise the corresponding relation of this TopClass class title and class description, described TopClass class refers to the top layer class, rather than subclass.
Further, the program language example code in the described step (1) is C++ or JAVA program code.
Further, in the described step (2), the descriptor of described additional class comprises the steps: for simple data type, composite data type, replenishes typonym and integer value, the class example of this data type and creates function; For SET, SEQUENCE data type, whether be not essential optional type, and the correspondence table of additional member's descriptor if replenishing each member Name, being provided with; For the ENUM data type, replenish the correspondence table between its member's symbolic representation and the digital value.
Further, in the described step (2), increase the class description table, the descriptor of class is represented with the form of class description table, be called keyword, sort or make Hash table with the class title and be convenient to retrieval with class name.
Further, in the described step (3), for simple data type, the support that increases the class example operation comprises:
Increase the support of Virtual Function, and can obtain data value, data value is set;
For composite data type, the support that increases the class example operation comprises:
(a) increase is to the support in point-marker path;
(b) increase is provided with the sign whether member among SEQUENSE, the SET exists;
(c) increase for SQUENSE OF, SET OF array class obtains array length, array length is set, the support of traversal array element;
(d) increase is for the support of CHOICE data type selection operation;
(e) increase the support that is provided with for the Any data type, the variable of its actual type or the variable of acquisition actual type can be set;
(f) increase the support that obtains the object of corresponding child node by the point-marker path.
After described step (5) is carried out,, be card i/f with the class description table with the code generation message collection plug-in unit of step (4).
Further, after described step (5) is carried out, with the code generation message collection plug-in unit of step (4).
Further, after described step (4) is carried out, use AsnTreeObject tree chained list to represent the ASN.1 message structure.
Further, after described step (4) is carried out, with the code generation VAL formatted data of step (4).
Further, the VAL formatted data is reverted to program language message example.
Further, convert the VAL formatted data to the XML formatted data.
Further, use the ASN.1 graphic editor, by revising the content of AsnTreeObject tree chained list in the code, further generator language message example; After perhaps revising the content of AsnTreeObject tree chained list in the code, convert the VAL formatted data to, regeneration program language message example.
Further, use script, revise the content of AsnTreeObject tree chained list in the code, further generator language message example; After perhaps revising the content of AsnTreeObject tree chained list in the code, convert the VAL formatted data to, regeneration program language message example.
The present invention has following beneficial effect:
1. the ASN.1 message can persistence be preserved, and the data that persistence is preserved can recover to be created as data structure instance fully, and ANY type is wherein also decoded.
2. message can adopt the operation of name value character string symbol, and the convenient message of revising supports script to create the ASN.1 message.
3. the definition of message forming method and message is independent, and ASN.1 message collection can adopt the plug-in unit mode, and plug-in unit generates automatically by MAKEFILE compiling ASN.1 file, makes things convenient for the change and the renewal of message, has saved the workload of safeguarding.
4. method itself is general, does not rely on specific ASN.1 structure type and ASN.1 compiler.
Description of drawings
Fig. 1 is the transfer process schematic diagram of message;
Fig. 2 message processing module (MPM) adduction relationship figure;
The basic class formation of Fig. 3 ESNACC C++ is inherited system;
The basic class formation of Fig. 4 DSET C++ is inherited system.
Embodiment
The present invention is described in detail below in conjunction with drawings and the specific embodiments.
Fig. 1 has described the mutual conversion between the message that ASN.1 is correlated with, ASN.1 organization definition, the corresponding class formation of C++, the code stream form.Data that ASN.1 script operation, ASN.1 graphics edition are operated and the conversion process that forms the message related data.C.2, special method of inventing by this paper can revert to the C++ class structure example fully with the VAL message of forever preserving, and further carries out various codings.Method provided herein can also be supported G and two kinds of application of H.
Steps A. the ASN.1 file can generate the class formation of C++ by the C++ compiler of ASN.1, can further create the class formation example by class formation.
Step B.1 C++ class structure example can be encoded and generated BER, the DER code stream.
Step is BER B.2, and the DER code stream can be decoded into concrete C++ class structure example.
Step C.1 C++ class structure example can generate the VAL data format.
Step C.2 VAL data format can revert to the C++ structure example fully by this paper method.
Step D C++ class structure example can be resolved and be generated a kind of tree AsnTreeObject.
Step e AsnTreeObject can generate the VAL formatted data.
Other form of step F can transform with the VAL form mutually such as the XML form.
Step G Asn.1 script operation can further generate the C++ class structure example by revising AsnTreeObject.
Step H.1 AsnTreeObject can show in graphic editor.
Step H.2 Asn.1 graphic editor can generate AsnTreeObject.
Fig. 2 is the functional module hierarchy that the present invention is correlated with, ASN.1 basic-level support module, and the ASN.1 structure of application is made the message plug-in unit, makes some public operations based on the message plug-in unit, can make figure editor message based on this again, and message is revised in script operation.The message public operation comprises the encapsulation of various basic application such as the establishment of particular type message, modification, the generation of VAL file, encoding and decoding.
The ASN.1 support module that compiler provides: the ASN.1 compiler provides compiler and basic-level support module usually, and compiler generates the specific program language codes with the compiling of ASN.1 file, as C++, Java.The structure of ASN.1 is compiled into the class of program language.The basic-level support module is carried out for the code that generates and is provided support.As among the C++, provide a plurality of storehouses to supporting the function of operation comprising base class and some of ASN.1 language-specific to the code call that generates.
The message plug-in unit: for unified processing is enough carried out in the energy collecting of ASN.1 message, with the program code that the report of ASN.1 generates through the ASN.1 compiler, after requiring to improve according to certain interface function, compiling generates the storehouse through CompilerTools.Can be employed the program dynamic load.Plug-in unit generates the storehouse through CompilerTools after can handling the program code that generates with scanning imaging system again.Other application module docking port has dependence like this, and need not change with the variation of message collection.Can generate the dynamic base of special interface as C++; JAVA can make bag to the java class of supporting special interface, loads bag during operation, creates the JAVA class to support special interface by the class reflection.
Public operation module: based on support module and message card i/f, message is done some unified operations of handling with convenient support message application module,, revise the class data member as creating the class example, generate message by the VAL formatted data, two messages compare etc.
The interface graphics package: the interface figure kit that the third party provides can make things convenient for user's development graph interface.
Figure message editing module: utilize graphics package and ASN.1 public operation module, the user is provided convenient friendly graphical interfaces message editing function, can create editor ASN.1 message in tree table mode, the length that comprises the title of field name, type and integer value, data member in the tree table, row such as the value of data member.Can open and preserve the VAL form.
The script support package: Run Script and the bag that expansion is supported to script, as PYTHON, TCL etc., explanation is carried out, and general efficient is lower, but cross-platform easily, can expand it with language such as C++.
Message script operation module: utilize the script expansion to support and ASN.1 public operation module, script is increased ASN.1 message operating function, make things convenient for the user to visit message in the mode of script.
Example below in conjunction with a webmaster test platform, describe the message building method in detail, this paper is at compiling platform at DSET ASN.1 compiling platform and ESNACC ASN.1, realize message editing device and script establishment method of message, the present invention goes for any object-oriented program language and realizes, this paper mainly discusses in conjunction with C++, also can use other OO program language, realizes as the JAVA language.
Container Description:
The message nodal information that the present invention utilizes container to come buffer memory to compare.Specifically implement, container can be formation (deque), also can be chained list (list) or stack (stack).Hereinafter be that example illustrates comparative approach of the present invention with the formation.A kind of processing thought is made a general reference in formation, can self-definedly realize, the STD::list of queue type that provides among the STL (STL) also can be provided.The character string type ansistring that the present invention uses can be std::string, also can be the CString of MFC, also can oneself define.
The test packet source
The message that the present invention uses derives from the subsystem communication message of tested a plurality of webmaster projects, each webmaster is because the version difference, and there are certain additions and deletions in the message of redaction, requires the test platform can analog message, can can quote or create message by script by message editing device message.
ESNACC platform embodiment:
(1) compiling platform
ESNACC is the ASN.1 compiler of open source code, supports BER, the PER coding, can only output class like the data of VAL form, can not be the C++ structure example from the VAL formats.SEQUENCE OF and SET OF adopt template class, do not have unified base class member function to support operation of number of support group length and array node traversal.The ESNACC type of message is inherited system.The top layer base class of AsnType.Its basic class formation succession system is seen Fig. 3, the basic class inheritance of ESNACC hierarchy chart, and the basic base class of ESNACC is AsnType, AsnType is an abstract base class.On this, inherit some simple types and supported basic ASN.1 data type such as AsnInt, AsnReal, AsnRelativeOid, AsnAny, AsnOcts, AsnBool, AsnNull, asnString, wherein AsnInt is also derived from by PERGgeneral, AsnEnum is derived from by AsnInt, and AsnOid is derived from by AsnRelativeOid; AsnList is that the intermediate form, AsnSetOf, the AsnSeqOf that realize other Asn.1 class are derived from by AsnList; Used std::string, the std::list of STL further to support SEQUENCE OF, SET OF etc.The character string type of some application is to be derived from by base character string type AsnString as VisibleString, GraphicString, Ia5String, PrintableString, NumericString.Wherein GeneralizedTime, UTCTime are derived from by VisibleString.
(2) message handling process
When making the interface testing instrument, handle message based on ASN.1, the editing machine of an ASN.1 message need be provided, can create message by graphical interfaces; Testing tool is supported the script operation message, comprises modification value or data length etc.If begin to do from the bottom encoding and decoding of ASN.1 message, workload is just very big, so requirement can utilize existing ASN.1 compiler.On the basis of compiler, the compiler ASN.1 message C++ code that will generate of making amendment is maybe carried out the C++ program code that rescan is handled to be needed to generate.This mainly is the processing method that needs in order to generate the message plug-in unit.
1.ESNACC basic class had class description information, establishment function comprising corresponding types, the descriptor imperfection of the C++ structure type that part generates as this type of INTEGER (1..200), needs to replenish its descriptor by revising compiler.
2. can carry out the basic operation of C++ class example, but support point marker character path not, and the Virtual Function that does not also have obtains data value, data value is set; Also ununified array length operation to SEQUENCE OF and SET OF.Increase the point-marker path and support function, support to obtain the object of corresponding child node, select to create non-existent member by parameter by path, point-marker path; In AsnType, increase member function and can in AsnType, define Virtual Function interface acquisition size, size is set, obtain the function of all son's member node.Realize that in template class AsnList Virtual Function obtains size, size is set, obtain the function of all son's member node;
3.TOPCLASS the foundation of class description table, ESNACC supports META information to compile and generates class description table const AsnModuleDesc *AsnModuleDescs[].For by the quick searching element of class description table, can further this table be converted into name is the map or the subordinate ordered array of keyword.
4. the code with step 1-3 generates a DLL, by function AsnModuleDesc *GetMoudleDescs () can derive the asnMoudleDescs variable, and all TOPCLASS classes can be selected whether to derive as required.So just become a plug-in unit, the interface of plug-in unit is exactly GetMoudleDescs, can obtain the description of all TOPCLASS by this structure, creates and revise their example.The asnMoudleDescs pointer can be registered when loading of plug-in, perhaps also can explicit registration after having loaded plug-in unit.Realize the steps A among Fig. 1.Above step 1-4 realizes in the message plug-in unit of Fig. 2.
5.AsnTreeObject can be defined as
class?AsnTreeObject{
public:
ansistring?nodename;
ansistring?nodeVALue;
int?asnltype;
ansistring?typename;
AsnType *pParent;
AsnTreeObjectList?childrenlist;
};
AsnTreeObjectList is the chained list of type AsnTreeObject pointer, and this structure can increase other extra data as required certainly.This structure is convenient to the traversal demonstration or is revised.Step D and E among related realization Fig. 1 therewith.This partial content is realized in the public operation module of Fig. 2.
6.ASN.1 C++ message structure example and VAL formatted data generate mutually, the PrintVAL that generates the VAL formatted data can become an one member function in AsnType; Also can be used as one is the independently function of parameter with the AsnType pointer.From the VAL formatted data generate to generate the function of ASN.1C++ message structure example can one function independently, be parameter with the VAL formatted data, with the parameter that is cited as of AsnType pointer, be return value with the error code.It also can be static member's function of the AsnType of same function form.As static member's function, this part of functions will realize in plug-in unit, if independent function can other module be realized outside plug-in unit.Realize among Fig. 1 step C.1, C.2.C.1, step can be utilized the operation in above-mentioned 1,2, C.2 needs to utilize operation in above-mentioned 1,2,3 in step.This partial content is realized in the message plug-in unit of Fig. 2.
7. in order in graphic editor, to realize editor to a message, want to list all ASN.1 structure type titles, at first obtain example from asnMoudleDescs and create function according to type of message, utilize above-mentioned steps 5 AsnTreeObject that message is shown then, constraint information by the message class description is edited AsnTreeObject, further generate the VAL formatted data, generate ASN.1 C++ message structure example by the VAL formatted data.Adopt the VAL formatted data to generate C++ message structure example, rather than directly generate C++ message structure example by AsnTreeObject, main purpose is that generation VAL form is simple, and the basic class formation system of compiling platform is relied on minimizing, and is further better to the transplantability of compiling platform.Utilize above-mentioned mode, can create and revise message by script equally.With the VAL formatted data message being carried out persistence preserves.
8. use the PYTHON script, expand by script and support the operation of ASN.1 message, in testing tool, just realize by the script establishment and used message like this.
DSET platform embodiment:
In order to further specify technical solution of the present invention, be elaborated again with accompanying drawing in conjunction with the embodiments with compiling platform DSET below.
(1) compiling platform
With DSET is the compiling platform, this is a not commercial ASN.1 compiler of open source code, support BER, PER, multiple coding such as DER, can export the data of VAL form, can revise wherein data member by the VAL formatted data having existing C++ class type example, to the true type nonrecognition of wherein ANY categorical data.The descriptor of ENUM type a little less than, can not directly obtain the correspondence table of symbolic name word string and digital value.There is not TOPCLASS class description table.Its basic class formation succession system is seen Fig. 4, the basic class inheritance of DSET hierarchy chart, and its basic base class is AbstractData, AbstractData is an abstract base class.Fundamental type such as CHOICE, AbstractReal, EUNMERATED, Integer, BOOLEAN and uncertain type Any are from its direct succession; StructData, D_array, D_SeqOfVal, D_SeqOfObj are the intermediate forms that realizes other Asn.1 class, and D_SeqOfVal, D_SeqOfObj derive from by D_Array; AbstractString is derived from by D_SeqOfVal, and UTCTime, GeneralizedTime, PrintableString, IA5String, GraphicString, VisibleString are derived from by AbstractString.
(2) message handling process
Do based on ASN.1 message interface testing tool, the editing machine of an ASN.1 message need be provided, can create message by graphical interfaces; Testing tool is supported the script operation message, comprises modification value or data length etc.If begin to do from the bottom encoding and decoding of ASN.1 message, workload is just very big, so requirement can utilize existing ASN.1 compiler.On the basis of compiler, the C++ code that compiling ASN.1 message is generated carries out the C++ program code that rescan is handled to be needed to generate.This mainly is the processing method that needs in order to generate the message plug-in unit.
1.DSET basic class had class description information, type is D_AdType, the corresponding D_AdType overall situation of each type class description variable is comprising the establishment function of corresponding types.The descriptor of the C++ structure type that part generates is imperfect, as the ENUM type, need obtain the correspondence table of its symbolic name word string and digital value by additional method.
2. the basic operation to the C++ class example has, and can pass through constD_AdType in the class example *Get_adType () obtains class description information, but not exclusively supports for the point-marker path, does not have unified function to obtain data value, data value is set; Increase the point-marker path and support function, these two parts also can other module outside the message plug-in unit be realized.
3.TOPCLASS the foundation of class description table, DSET compiling platform is not supported the class description table, and this can generate the class description table then by obtaining all TOPCLASS classes to ASN.1 file rescan or to the C++ code scans that generates.Can pass through script AWK in MAKE FILE, SED scanning generates the class description table, also can scan by other program and generate the class description table.
4. the code with step 1~3 generates a DLL, by derivative function AdTypeEntry *The length of getAD_TypeTbl () class description table and table, all TOPCLASS classes can be selected whether to derive as required, can regenerate the C++ header file by scanning once more.So just become a plug-in unit, the interface of plug-in unit is exactly getAD_TypeTbl (), can obtain the description of all TOPCLASS by this structure, creates and revise their example.Can be after having loaded plug-in unit explicit registration class description list.Realize the steps A among Fig. 1.Above step 1~4 contents realize in the message plug-in unit of Fig. 2, the realizing in the public operation module about the ENUM partial content of step 1.
5.AsnTreeObject can be defined as
class?AsnTreeObject{
public:
ansistring?nodename;
ansistring?nodeVALue;
int?asnltype;
ansistring?typename;
AbstractData *pParent;
AbstractDataList?childrenlist;
};
Certainly this structure can increase other extra data as required.This structure is convenient to the traversal demonstration or is revised.Step D and E among related realization Fig. 1 therewith.
6.ASN.1 C++ message structure example and VAL formatted data generate mutually, the function that generates the VAL formatted data has been member function of AbstractData; The function that generates ASN.1 C++ message structure example from the VAL formatted data is an independently function, is parameter with the VAL formatted data, with the parameter that is cited as of AbstractData pointer, is return value with the error code.This part of functions is owing to the program that can not revise the DSET foundation class, so can only can other module realize outside plug-in unit by independent function.Realize among Fig. 1 step C.1, C.2.C.1, step can be utilized the operation in above-mentioned 1,2, C.2 needs to utilize operation in above-mentioned 1,2,3 in step.This partial content is realized in the public operation module of figure .2.
7. in order in graphic editor, to realize editor to a message, want to list all ASN.1 structure type titles, at first obtain example from the class description table and create function according to type of message, utilize above-mentioned steps 5 AsnTreeObject that message is shown then, constraint information by the message class description is edited AsnTreeObject, further generate the VAL formatted data, generate ASN.1 C++ message structure example by the VAL formatted data.Adopt the VAL formatted data to generate C++ message structure example, rather than directly generate C++ message structure example by AsnTreeObject, main purpose is that generation VAL form is simple, and the basic class formation system of compiling platform is relied on minimizing, and is further better to the transplantability of compiling platform.Utilize above-mentioned mode, can create and revise message by script equally.With the VAL formatted data message being carried out persistence preserves.
8. further because the rise of XML form, the XML of ASN.1 message represents all information that can comprise that the VAL form is included, and promptly the name-value symbol is to the actual type of, layer structure type, ANY.Can transform mutually on the basis of plug-in unit descriptor with the VAL form as long as comprised other data format of VAL format information like this, further the XML file can be replaced the VAL formatted data.
Should be understood that, for those of ordinary skills, can make various possible changes or replacement according to the explanation and the embodiment of technical scheme of the present invention, all these changes or replacement all belong to the protection range of claim of the present invention.As: because the rise of XML form, the XML of ASN.1 message represents all information that can comprise that the VAL form is included, and promptly the name-value symbol is to the actual type of, layer structure type, ANY.Can transform mutually on the basis of plug-in unit descriptor with the VAL form as long as comprised other data format of VAL format information like this, further the XML file can be replaced the VAL formatted data in patent.
The invention solves the message persistence and preserve the problem that back message structure example restores establishment again, overcome and to have known the shortcoming that the bit stream data type could be decoded in advance, and the ANY type can be decoded as specific data type, message can further be revised its member's data after creating, and revising is the operation that can create mode by character, can realize like this revising script message structure example by explaining to create, further we can make plug-in unit with the ASN.1 message, realize that the definition of message forming method and message is independent, utilize existing ASN.1 compiler, support graphical interfaces ASN.1 message editing device and script visit ASN.1 message simultaneously.If variation has taken place in the message definition, generate plug-in unit as long as recompilate, and the generation method is constant, has reduced the structure difficulty of message, the workload that greatly alleviates the message exploitation and safeguard.

Claims (12)

1. the OO processing method of ASN.1 message comprises the steps:
(1) with the ASN.1 compiler ASN.1 message is compiled into the program language example code;
(2) the program language example code that generates of modify steps (1) is replenished the descriptor of class in the mode of Virtual Function, comprises the class formation descriptor and creates the function of class example;
(3) code that step (2) is generated increases the support to the class example operation;
(4) set up TopClass class description table in the code that step (3) generates, comprise the corresponding relation of this TopClass class title and class description, described TopClass class refers to the top layer class, rather than subclass.
2. processing method according to claim 1 is characterized in that: the program language example code in the described step (1) is C++ or JAVA program code.
3. processing method according to claim 1, it is characterized in that: in the described step (2), the descriptor of described additional class comprises the steps: for simple data type, composite data type, replenishes typonym and integer value, the class example of this data type and creates function; For SET, SEQUENCE data type, whether be not essential optional type, and the correspondence table of additional member's descriptor if replenishing each member Name, being provided with; For the ENUM data type, replenish the correspondence table between its member's symbolic representation and the digital value.
4. processing method according to claim 1 is characterized in that: in the described step (2), increase the class description table, the descriptor of class is represented with the form of class description table, be called keyword with class name, sort or make Hash table with the class title and be convenient to retrieval.
5. processing method according to claim 1 is characterized in that: in the described step (3), for simple data type, the support that increases the class example operation comprises:
Increase the support of Virtual Function, and can obtain data value, data value is set;
For composite data type, the support that increases the class example operation comprises:
(a) increase is to the support in point-marker path;
(b) increase is provided with the sign whether member among SEQUENSE, the SET exists;
(c) increase for SQUENSE OF, SET OF array class obtains array length, array length is set, the support of traversal array element;
(d) increase is for the support of CHOICE data type selection operation;
(e) increase the support that is provided with for the Any data type, the variable of its actual type or the variable of acquisition actual type can be set;
(f) increase the support that obtains the object of corresponding child node by the point-marker path.
6. processing method according to claim 1 is characterized in that: after described step (5) is carried out, with the code generation message collection plug-in unit of step (4), be card i/f with the class description table.
7. according to any described processing method in the claim 1~6, it is characterized in that: after described step (4) is carried out, use AsnTreeObject tree chained list to represent the ASN.1 message structure.
8. processing method according to claim 1 is characterized in that: after described step (4) is carried out, with the code generation VAL formatted data of step (4).
9. processing method according to claim 8 is characterized in that: the VAL formatted data is reverted to program language message example.
10. processing method according to claim 8 is characterized in that: convert the VAL formatted data to the XML formatted data.
11. processing method according to claim 7 is characterized in that: use the ASN.1 graphic editor, by revising the content of AsnTreeObject tree chained list in the code, further generator language message example; After perhaps revising the content of AsnTreeObject tree chained list in the code, convert the VAL formatted data to, regeneration program language message example.
12. processing method according to claim 7 is characterized in that: use script, revise the content of AsnTreeObject tree chained list in the code, further generator language message example; After perhaps revising the content of AsnTreeObject tree chained list in the code, convert the VAL formatted data to, regeneration program language message example.
CNA200610161964XA 2006-12-08 2006-12-08 ASN.1 packet object oriented processing method Pending CN101197818A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA200610161964XA CN101197818A (en) 2006-12-08 2006-12-08 ASN.1 packet object oriented processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA200610161964XA CN101197818A (en) 2006-12-08 2006-12-08 ASN.1 packet object oriented processing method

Publications (1)

Publication Number Publication Date
CN101197818A true CN101197818A (en) 2008-06-11

Family

ID=39547968

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA200610161964XA Pending CN101197818A (en) 2006-12-08 2006-12-08 ASN.1 packet object oriented processing method

Country Status (1)

Country Link
CN (1) CN101197818A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571541A (en) * 2010-12-24 2012-07-11 中兴通讯股份有限公司 Message encoding-decoding method and device
CN102609293A (en) * 2012-01-17 2012-07-25 深圳天源迪科信息技术股份有限公司 Method for instantiating C/C++ dynamically
CN103036877A (en) * 2012-12-10 2013-04-10 北京中创信测科技股份有限公司 Device and method for code generation of coding and decoding based on threshold limit value (TLV) form protocol
CN101316241B (en) * 2008-07-02 2013-05-01 中兴通讯股份有限公司 TLV format processing method for communication data
CN103246671A (en) * 2012-02-09 2013-08-14 中兴通讯股份有限公司 Processing method and device for abstract syntax notation files
WO2015154444A1 (en) * 2014-08-01 2015-10-15 中兴通讯股份有限公司 Network operation and maintenance system and method for same to be compatible with change in packet of network management system
CN110601794A (en) * 2019-08-20 2019-12-20 浙江合众新能源汽车有限公司 ASN.1 coding and decoding module and message data coding and decoding method
CN113688136A (en) * 2021-08-25 2021-11-23 傲拓科技股份有限公司 MVC model-based PLC variable table grouping method and system
CN113742294A (en) * 2021-08-23 2021-12-03 宜通世纪科技股份有限公司 Method, system, device and medium for decoding ASN.1-PER signaling message
CN114741131A (en) * 2022-04-02 2022-07-12 深圳软牛科技有限公司 Hiding method, device and equipment of dynamic library derived symbols and storage medium
CN115190183A (en) * 2022-05-30 2022-10-14 深圳市科陆电子科技股份有限公司 Data structure construction, coding and decoding method of ASN.1 message
CN115190184A (en) * 2022-06-14 2022-10-14 深圳市圣麾科技有限公司 Method, system and storage medium for editing binary message cell

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101316241B (en) * 2008-07-02 2013-05-01 中兴通讯股份有限公司 TLV format processing method for communication data
CN102571541A (en) * 2010-12-24 2012-07-11 中兴通讯股份有限公司 Message encoding-decoding method and device
CN102609293A (en) * 2012-01-17 2012-07-25 深圳天源迪科信息技术股份有限公司 Method for instantiating C/C++ dynamically
CN102609293B (en) * 2012-01-17 2015-03-04 深圳天源迪科信息技术股份有限公司 Method for instantiating C/C++ dynamically
CN103246671A (en) * 2012-02-09 2013-08-14 中兴通讯股份有限公司 Processing method and device for abstract syntax notation files
CN103036877A (en) * 2012-12-10 2013-04-10 北京中创信测科技股份有限公司 Device and method for code generation of coding and decoding based on threshold limit value (TLV) form protocol
WO2015154444A1 (en) * 2014-08-01 2015-10-15 中兴通讯股份有限公司 Network operation and maintenance system and method for same to be compatible with change in packet of network management system
CN105323103A (en) * 2014-08-01 2016-02-10 中兴通讯股份有限公司 Network operation and maintenance system and method for making network operation and maintenance system be compatible with message change of network management system
CN110601794A (en) * 2019-08-20 2019-12-20 浙江合众新能源汽车有限公司 ASN.1 coding and decoding module and message data coding and decoding method
CN110601794B (en) * 2019-08-20 2022-05-24 浙江合众新能源汽车有限公司 ASN.1 coding and decoding module and message data coding and decoding method
CN113742294A (en) * 2021-08-23 2021-12-03 宜通世纪科技股份有限公司 Method, system, device and medium for decoding ASN.1-PER signaling message
CN113688136A (en) * 2021-08-25 2021-11-23 傲拓科技股份有限公司 MVC model-based PLC variable table grouping method and system
CN113688136B (en) * 2021-08-25 2023-04-28 傲拓科技股份有限公司 PLC variable table grouping method and system based on MVC model
CN114741131A (en) * 2022-04-02 2022-07-12 深圳软牛科技有限公司 Hiding method, device and equipment of dynamic library derived symbols and storage medium
CN114741131B (en) * 2022-04-02 2023-08-15 深圳软牛科技有限公司 Hiding method, device, equipment and storage medium for dynamic library derived symbol
CN115190183A (en) * 2022-05-30 2022-10-14 深圳市科陆电子科技股份有限公司 Data structure construction, coding and decoding method of ASN.1 message
CN115190184A (en) * 2022-06-14 2022-10-14 深圳市圣麾科技有限公司 Method, system and storage medium for editing binary message cell
CN115190184B (en) * 2022-06-14 2023-06-23 深圳市圣麾科技有限公司 Binary message cell editing method, system and storage medium

Similar Documents

Publication Publication Date Title
CN101197818A (en) ASN.1 packet object oriented processing method
CN101202739A (en) Device for processing ASN.1 message OO
JP3272014B2 (en) Method and apparatus for creating a data processing dictionary including hierarchical data processing information
CN101840334B (en) Software component service packaging method
US7020666B2 (en) System and method for unknown type serialization
CN105760534B (en) Data structure, hadoop cluster, server and its application method of customized serializability
CN101222365B (en) Similar C structure interface packet processing method
EP2618268A1 (en) Method and device for data storage
US20030122867A1 (en) Method and apparatus for assembling enterprise javabeans components
CN101316241A (en) TLV format processing method for communication data
CN100561476C (en) A kind of code generating method based on the ASN type object
US20040059802A1 (en) Modeling states and/or transitions in a computer system
CN115994141A (en) Tree-shaped coding method and system
CN101355448B (en) Method and apparatus for comparing upload
US7912984B2 (en) System and method for generating a wireless application from a web service definition
Riedel et al. A model driven internet of things
JP2004252973A (en) Storage medium recorded with object-oriented program
US20100269104A1 (en) System and Methods for Generic Data Marshalling without Object Modification
KR20050031954A (en) Method and system for using multiple data type representations to deliver data objects to components in a distributed system
JPH1049408A (en) Method and device for converting data schema
Lee Translation of GDMO/ASN. 1 to Java objects for network management
CN114661955A (en) Configured XML message analysis method, system, device and memory
US20100023923A1 (en) Method for medeling objects in a hetrogenious computing environment
CN113656010A (en) Method, system, equipment and medium for automatically creating code warehouse by microservice
CN116800866A (en) Method and system for analyzing XML support platform multi-format message based on stream mechanism

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20080611