CN102111160A - Coding and decoding system and codec for reactive system test - Google Patents

Coding and decoding system and codec for reactive system test Download PDF

Info

Publication number
CN102111160A
CN102111160A CN2010105659977A CN201010565997A CN102111160A CN 102111160 A CN102111160 A CN 102111160A CN 2010105659977 A CN2010105659977 A CN 2010105659977A CN 201010565997 A CN201010565997 A CN 201010565997A CN 102111160 A CN102111160 A CN 102111160A
Authority
CN
China
Prior art keywords
decoding
type
coding
ttcn
encoding
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.)
Granted
Application number
CN2010105659977A
Other languages
Chinese (zh)
Other versions
CN102111160B (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.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
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 University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN 201010565997 priority Critical patent/CN102111160B/en
Publication of CN102111160A publication Critical patent/CN102111160A/en
Application granted granted Critical
Publication of CN102111160B publication Critical patent/CN102111160B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a coding and decoding system for a reactive system test. The coding and decoding system comprises a type converter and a codec, wherein the type converter is used for converting specific language types into corresponding tree and tabular combined notation (TTCN-3) language types supported by a third edition TTCN-3 test platform of a test and a test control representation notation; the codec is used for performing attribute information analysis according to converted corresponding TTCN-3 languages, and coding/decoding in a coding/decoding mode specified by a coding and decoding control word in TTCN-3 language attribute information. The coding and decoding system can support various kinds of data type description, particularly support direct use of extensive makeup language (XML) type description in the TTCN-3 test, and can realize general coding and decoding of various TTCN-3 test platforms.

Description

The coding/decoding system and the codec thereof that are used for the reaction equation system testing
Technical field
The present invention relates to encoding and decoding technique, relate in particular to a kind of codec that is used for the reaction equation system testing.
Background technology
In the reaction equation system testing, conceptual data need be changed into the code stream that system under test (SUT) can be discerned, this just needs codec.Reaction equation system testing is at present taken as the leading factor with TTCN-3 (Testing and Test Control Notation version 3, the test and the test control representation third edition) language, and the TTCN-3 language is widely used in fields such as telecommunications.But the TTCN-3 test specification is only supported TTCN-3, the direct use of DLs such as ASN.1, the design that translation obtains the intermediate representation DL also only is confined to these several language characteristic, can not well contain new type language, so can easily not expand the support to new type language.
In addition, the realization in present various encoding and decoding storehouse all is closely related with specific TTCN-3 test platform, their implementation method is normally called the TCI interface (terminal control interface) relevant with platform, obtains the type and the value information that need encoding and decoding, carries out corresponding coding-decoding operation.Because the TCI interface that different compiling platforms is corresponding different, so the code encoding/decoding mode of developing on a kind of platform, difficulty is transplanted to another kind of compiler platform.If the compiler translation scheme often needs to remodify the encoding and decoding storehouse of having realized after occurring changing.
Therefore, how to realize a general coding/decoding system relatively independent, and have stronger extendible ability, comprise the expansion of new type language and the expansion of coded system with test platform, to adapt to needs, be a more urgent problem to following test service.
Summary of the invention
Purpose of the present invention is intended to one of solve the aforementioned problems in the prior at least.
For this reason, embodiments of the invention have proposed a kind of other Languages based on the XML type specification to the TTCN-3 language converter, to use outside coding/decoding information easily in the TTCN-3 test platform.The XML Schema standard definition document of some specific code/decode type just can directly be used in the TTCN-3 test platform.
In addition, embodiments of the invention have also proposed a kind of and relatively independent, the general codec of test platform.
According to an aspect of the present invention, the coding/decoding system that is used for the reaction equation system testing of the embodiment of the invention comprises: type transducer, described type transducer are used for the corresponding TTCN-3 language form of language-specific type conversion for test and the support of test control representation third edition TTCN-3 test platform; And codec, described codec is used for carrying out the attribute information parsing according to the corresponding TTCN-3 language of conversion; And carry out coding/decoding according to the specified coding/decoding mode of the encoding and decoding control word in the TTCN-3 linguistic property information.
The further embodiment according to the present invention, described codec comprises: the external interface module, described external interface module is carried out the outside encoding and decoding of specific T TCN-3 test platform and is called, to obtain type that needs coding/decoding and the value that specific T TCN-3 test platform generates; Intermediate form and value that type that needs coding/decoding that general code/decode type and value module, described general code/decode type and value module generate described specific T TCN-3 test platform and value are converted to the general coding/decoding that has nothing to do with this specific T TCN-3 test platform; And encoding and decoding realize module, described encoding and decoding realize module according to the code encoding/decoding mode of the encoding and decoding control word Information Selection correspondence of the intermediate form correspondence of described general coding/decoding to carry out coding/decoding.
According to the present invention again one the step embodiment, described general code/decode type is changed according to the mapping relations table of the intermediate form of various TTCN-3 test platform corresponding data types and general coding/decoding with the value module, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and various TTCN-3 test platform corresponding data types are mapped to a specific type of common type collection, to obtain described mapping relations table.
Wherein, when this specific T TCN-3 test platform corresponding data types when there is not corresponding mapping particular type in described mapping relations table, described general code/decode type and value module are according to the string of binary characters of this specific T TCN-3 test platform corresponding data types generation type as its corresponding general coding/decoding.
The further embodiment according to the present invention, described type transducer comprises first modular converter, in order to conversion XML document logical construction Language XML Schema type is TTCN-3 language form, and the type information that the XML Schema that described first modular converter generates from the parsing of Schema document defines is concentrated and obtained all component that the Schema document contains; Call the information of corresponding assembly and obtain the module information that class concentrates acquisition to need separately from the type information of XML Schema definition; And call the translation class that corresponding information obtains the class correspondence and translate according to the module information of correspondence, to generate the TTCN-3 code.
The further embodiment according to the present invention, described type transducer comprises second modular converter, in order to conversion XML document type definition XML DTD type is TTCN-3 language form, and the type information that the DTD that described second modular converter generates from the parsing of DTD document defines is concentrated and obtained all component that the DTD document contains; Call the information of corresponding assembly and obtain the module information that class concentrates acquisition to need separately from the type information of DTD definition; And call the translation class that corresponding information obtains the class correspondence and translate according to the module information of correspondence, to generate the TTCN-3 code.
According to a further aspect in the invention, embodiments of the invention propose a kind of codec that is used for the reaction equation system testing, and described codec comprises:
External interface module, described external interface module are carried out the outside encoding and decoding of specific T TCN-3 test platform and are called, to obtain the type and the value of the coding/decoding that specific T TCN-3 test platform generates;
General code/decode type and value module, intermediate form and value that described general code/decode type and value module are converted to the general coding/decoding that has nothing to do with this specific T TCN-3 test platform with the type and the value of described coding/decoding; And
Encoding and decoding realize module, and described encoding and decoding realize the encoding and decoding control word of module according to the intermediate form correspondence of described general coding/decoding, select corresponding code encoding/decoding mode to carry out coding/decoding.
The further embodiment according to the present invention, described general code/decode type is changed according to the mapping relations table of the intermediate form of various TTCN-3 test platform corresponding data types and general coding/decoding with the value module, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and various TTCN-3 test platform corresponding data types are mapped to a specific type of common type collection, to obtain described mapping relations table.
In addition, on the test platform of non-TTCN-3 language,, just still can use this general codec, realize being independent of the universal performance of test platform as long as defined the conversion mapping table of the data type of this test platform to the intermediate form of general encoding and decoding.
According to the present invention again one the step embodiment, when this specific T TCN-3 test platform corresponding data types when there is not corresponding mapping particular type in described mapping relations table, described general code/decode type and value module are according to the string of binary characters of this specific T TCN-3 test platform corresponding data types generation type as its corresponding general coding/decoding.
Coding/decoding system of the present invention can be realized the direct use of type definition (mainly being the XML type definition) in the TTCN-3 test macro of various language, and can support template assignment and matching feature preferably.
Can also realize and relatively independent general of test platform in conjunction with general codec, and have stronger extendible ability, comprise the expansion of new type language and the expansion of coded system, to adapt to needs to following test service.Support ASCII, BER, PER, BCD, TLV, SIP, code encoding/decoding modes such as ISO8583 support to expand the newtype code encoding/decoding mode.
Aspect that the present invention adds and advantage part in the following description provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Description of drawings
Above-mentioned and/or additional aspect of the present invention and advantage are from obviously and easily understanding becoming the description of embodiment below in conjunction with accompanying drawing, wherein:
Fig. 1 is the coding/decoding system structural representation that is used for the reaction equation system testing of the embodiment of the invention;
Fig. 2 (a) and Fig. 2 (b) are respectively the structured flowchart of the type transducer of the embodiment of the invention;
Fig. 3 (a) and Fig. 3 (b) are respectively the information of the embodiment of the invention and obtain class and the exemplary plot of translating class;
Fig. 4 is the structured flowchart of the general codec of the embodiment of the invention;
Fig. 5 is the mapping relations schematic diagram of the general codec ASN.1 data type of the embodiment of the invention to middle standard type;
Fig. 6 and Fig. 7 are respectively the middle standard type of general codec of the embodiment of the invention and the inheritance hierarchy structure chart of middle normal value;
Fig. 8 is for being the interface schematic diagram of example with the BER coding function in the general codec of the embodiment of the invention;
Fig. 9 calls schematic diagram for the addressable port of the general codec of the embodiment of the invention;
Figure 10 is the cataloged procedure flow chart of the general codec of the embodiment of the invention;
Figure 11 is the decode procedure flow chart of the general codec of the embodiment of the invention; And
Figure 12 is for using certain protocol test flow process of the general codec of the embodiment of the invention.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein identical from start to finish or similar label is represented identical or similar elements or the element with identical or similar functions.Below by the embodiment that is described with reference to the drawings is exemplary, only is used to explain the present invention, and can not be interpreted as limitation of the present invention.
With reference to figure 1, this figure is the coding/decoding system structural representation that is used for the reaction equation system testing of the embodiment of the invention.
As shown in the figure, the coding/decoding system of the embodiment of the invention comprises type transducer 10 and codec 30, wherein type transducer 10 is used for the language-specific type, for example XML (extensible Markup Language) (XML) document logical structure (XML Schema) type, XML document type definition (XML DTD) type and/or other type language are converted to the corresponding TTCN-3 language form that TTCN-3 (test and the test control representation third edition) test platform is supported.
Codec 30 is used for carrying out the attribute information parsing according to the corresponding TTCN-3 language of conversion; And carry out coding/decoding according to the specified coding/decoding mode of the encoding and decoding control word in the TTCN-3 linguistic property information.
Specifically, for the unsupported DL of TTCN-3 test specification, various language such as ASN.1, XML etc. are if want to use in the TTCN-3 test macro, and can support template assignment and matching feature preferably, at first be converted into corresponding TTCN-3 language form, use these functions of TTCN-3 language by type transducer 10.In order to solve the information dropout that occurs in the transfer process, the information that needs to lose is saved in the Custom Attributes of corresponding TTCN-3 type.
Operation principle about type transducer 10 can be with reference to figure 2 (a) and Fig. 2 (b), and wherein Fig. 2 (a) is the structured flowchart of TTCN-3 language form for the type transducer of the embodiment of the invention with XML Schema type conversion; Fig. 2 (b) is the structured flowchart of TTCN-3 language form for the type transducer of the embodiment of the invention with XML DTD type conversion.
Realize of the mapping of the dtd of XML, comprise XMLSchema and DTD, can be referred to as the XML to TTCN-3 module of type transducer 10, be called for short the X2T module to the TTCN-3 type definition.Whole transfer process can be finished automatically, by the X2T module, the type definition of XML is converted to the type definition of TTCN-3, thereby can realize the type of message that XML describes is carried out various encoding and decoding on the TTCN-3 test platform.
The X2T module comprises the translation of Schema and the translation of DTD, and the translation of Schema is realized that by X2TSchema the translation of DTD is then realized by X2TDTD.On function, no matter be the translation of Schema or the translation of DTD, all form, i.e. document resolver and translater by two parts.The realization of this module is resolved Scheme and DTD by means of the XML analytical tool Xerces-c that increases income (Xerces-c is an XML resolver of increasing income, the c language compilation).
For example, for XML Schema language form is converted to TTCN-3 language form, shown in Fig. 2 (a):
At first, be kept in the syntactic information pond of the parsing of XML Schema document through Xerces-c.The XSD information set is kept at the type information collection in the grammer pond (grammar pool) after representing the Schema document to resolve through the Xerces-c instrument.
If do not have syntax error in the document of resolving, then call X2T controller 14, by the whole translation flow of controller 14 controls.Above-mentioned document is resolved and controller calls by principal function 12 execution.
Controller 14 is concentrated from type information and is obtained all component that the Schema document contains, and the information of calling corresponding assembly is obtained all information that class 16 obtains this assembly.
For example for the class in the XSDItem class formation, wherein XSDItem class 16 can be a kind of in the class shown in Fig. 3 (a), is referred to as Item1...n here.
These Item classes are concentrated all information of obtaining the component definition that needs separately from the XSD type information, and each class is only obtained the module information that oneself needs, and these information are passed to TTCN maker class 18.TTCN maker class 18 has a lot, and for example illustrated Item1..n translation class can be a kind of in the class shown in Fig. 3 (b).
Translation class 18 is obtained class 16 from information and is obtained all information (parameter transmission) of assembly, and finishes the generation of TTCN-3 code.
For being TTCN-3 language form with XML DTD type conversion, shown in Fig. 2 (b), wherein different with Fig. 2 (a) is, principal function 12 ' corresponding XSD information set is resolved by the DTD document and is generated, correspondingly, X2T controller 14 ' and information are obtained class 16 ', 18 ' corresponding module information and the information translation of translation class is to finish on the basis of the corresponding types information set that the parsing of DTD document obtains.
On the whole, the XSD information set is kept at the type information collection in the grammer pond after representing Schema document or DTD document to resolve through the Xerces-c instrument; XSDItem is that module information is obtained class hierarchy; The X2T controller is connecting the type information collection and module information is obtained class; The TTCN maker then is assembly translation class hierarchy.
In translation process, need obtain some important informations in the translation, can guarantee that on the one hand the information of translation process do not lose, then these information can be used for encoding and decoding on the other hand, it is necessary therefore adding necessary with attribute in translation.Mainly use the variant attribute of with in the present invention, and according to the TTCN-3 language standard, the with attribute can only be modified type, group and module.
The difficult point of With attribute design is just because of the restriction that can only modify type, and the important information of layer assembly is difficult to record in making, the with attribute of assembly that must will be nested in internal layer is at outer record.Among the present invention, design a kind of expression mode of with attribute voluntarily, can meet the TTCN-3 standard syntax, can write down the information in the translation process again.This design is distinguished and is treated various assemblies, be divided into being translated outer layer assembly and interior layer assembly, and interior layer assembly is divided into internal layer Nesting Module and internal layer non-nesting assembly are arranged.
Return now with reference to figure 1, TTCN-3 type language for type transducer 10 conversions, the perhaps TTCN-3 test platform ASN.1 type language that can directly use, after introducing TTCN-3 test platform 20, generate the intermediate language type that this specific T TCN-3 test platform 20 is correlated with by 20 compilings of TTCN-3 test platform, promptly specific T TCN-3 test platform 20 generates type and the value that needs coding/decoding.
For specific T TCN-3 test platform 20, as existing code encoding/decoding mode, the type and the value of the needs encoding and decoding that codec 30 will provide according to test platform 20 generate intermediate form and value, again middle type is carried out attribute information and resolve, median is carried out coding/decoding.
But as stated in the Background Art, the realization in present various encoding and decoding storehouse all is closely related with specific TTCN-3 test platform, their implementation method is normally called the TCI interface relevant with platform, obtains the type and the value information that need encoding and decoding, carries out corresponding coding-decoding operation.The TCI interface that different compiling platforms is corresponding different, the code encoding/decoding mode of on a kind of TTCN-3 test platform, developing, difficulty is transplanted to another kind of compiler platform.Therefore, present codec depends on specific TTCN-3 test platform, can't realize the versatility of encoding and decoding.
Therefore in order to address the above problem, the present invention proposes a kind of and the relatively independent general codec 30 of specific T TCN-3 test platform, can be about the structure of this general codec 30 with reference to the embodiment of figure 4.
As described in Figure 4, general codec 30 comprises external interface module 32, general code/decode type and value module 34 and encoding and decoding realization module 36.
Wherein, external interface module 32 is carried out the outside encoding and decoding of specific T TCN-3 test platform and is called, to obtain type that needs coding/decoding and the value that specific T TCN-3 test platform generates;
Intermediate form and value that type that needs coding/decoding that general code/decode type and value module 34 generate specific T TCN-3 test platform and value are converted to the general coding/decoding that has nothing to do with this specific T TCN-3 test platform; And
Encoding and decoding realization module 36 selects corresponding code encoding/decoding mode to carry out coding/decoding according to the encoding and decoding control word of the intermediate form correspondence of general coding/decoding.
Specifically, general encoding and decoding are supported the storehouse as one, and by extraneous platform, the specific T TCN-3 test platform that promptly has the different target language calls when needs carry out coding-decoding operation.The calling interface that external interface module 32 outwards provides outside platform to need.Thereby outside platform is operated general codec accordingly by calling external interface module 32, and then external interface module 32 obtains type that needs coding/decoding and value information that specific T TCN-3 test platform generates, and imports general code/decode type and handle with value module 34.
General code/decode type provides a cover to comprise the maximum of existing common type (as TTCN-3, ASN.1, XML Schema) with value module 34, and has expansion capacity preferably.By using the type and value module 34, intermediate form and value that type that needs coding/decoding that specific T TCN-3 test platform is generated and value are converted to the general coding/decoding that has nothing to do with this specific T TCN-3 test platform, thus general codec can be realized and its integration environment between independence.
General code/decode type is changed according to the mapping relations table of the intermediate form of various TTCN-3 test platform corresponding data types and general coding/decoding with value module 34.Hereinafter, be called the intermediate form of general coding/decoding and value be respectively in the middle of standard type and middle normal value.
Middle standard type not only will comprise existing TTCN-3 type, and the functions such as data type language that expand other in the future need be provided.General code/decode type passes through with reference to existing DDL such as TTCN-3 with value module 34, ASN.1, XML Schema/DTD, extract a public set of types, and the design of type of service value, a specific type of the corresponding one-tenth of the data type that each is specific common type collection is to obtain described mapping relations table.And, visit interior data member's function is provided by interface easily.The type that this centre standard type is comprised is mainly as follows for example:
1) boolean type
2) integer type
3) float type
4) bitstring type
5) charstring type
6) hexstring type
7) octetstring type
8) universalcstring type
9) enumerated type
10) field type
11) objid type
12) null type
13) struct type
14) choice type
15) sequence type
16) struct of type
17) sequence of type
The type that common type is concentrated all will provide some can supply the expanded data territory, so that the compatible new data type of later common type collection.Using the design in C++ class storehouse, all is to encapsulate with class with the type and the value of middle standard.The information of type and value is saved as the member variable of class, and codec functions externally provides as the interface function of class.Design the parent CType of all middle standard types, the pure virtual function that the definition encoding and decoding realize in the CType class.Use the inheritance mechanism among the C++, on CType, derive all middle standard types, and by inheriting design class that the coding/decoding function that comes realizes the design of normal value in the middle of the codec functions of corresponding types and middle standard type seemingly, design the pure virtual base class CValue of all middle normal value, use the inheritance mechanism among the C++, normal value is inherited the class in CValue in the middle of making, and is inheriting the corresponding value of realization interface function on the type.
The general codec ASN.1 data type of the embodiment of the invention to the mapping relations of middle standard type as shown in Figure 5, Fig. 6 and Fig. 7 are respectively the inheritance hierarchy structure chart of standard type and middle normal value in the middle of the general codec of the embodiment of the invention.
General code/decode type and value module 34 are according to the mapping relations table of the existing outside platform data type of wherein preserving to intermediate form, when coding-decoding operation according to the data type of outside platform, search the mapping relations table, if do not find corresponding intermediate form, generate corresponding intermediate form in real time, search the intermediate form that obtains otherwise directly use.
Wherein when this specific T TCN-3 test platform corresponding data types when there is not corresponding mapping particular type in the mapping relations table, general code/decode type and value module 34 are according to the string of binary characters of this specific T TCN-3 test platform corresponding data types generation type as its corresponding general coding/decoding.
General code/decode type is input to type and the value information that general encoding and decoding need in the encoding and decoding realization module 36 with value module 34, external interface module 32 is called corresponding encoding and decoding interface function according to specified code encoding/decoding mode in the with encode attribute in the TTCN-3 linguistic property information of the type correspondence of general coding/decoding, claim that the encode attribute of TTCN-3 language be " an encoding and decoding control word ", and by encoding and decoding realization module 36 according to the code encoding/decoding mode of the encoding and decoding control word correspondence of the type correspondence of general coding/decoding to carry out coding/decoding.Realize codec functions.
The realization of the various encoding and decoding of encoding and decoding realization module 36 all is based on middle standard type and value, and codec functions provides with the response function interface by middle standard type.The code encoding/decoding mode that provides at present mainly comprises BER, PER, XER, TLV, HTTP, ISO8583, SIP etc.The method of Virtual Function and succession realize is adopted in encoding and decoding, provides a unified interface by the base type of middle standard, and each centre standard subtype removes to realize the code encoding/decoding mode of its corresponding types then.
With the BER coding function is that illustration is anticipated interface as shown in Figure 8, and CType is a base class, and base class is stated abstract BER addressable port, and base class is not realized this interface; Subclasses C Integer inherits CType class, this interface of realization that subclass is concrete.Like this, by a kind of general method of calling: " calling the BER addressable port of base class CType " can determine the particular B ER addressable port of the actual subclass of calling in real time.
Provide non-explicit the encoding and decoding interface Encode and the Decode that call coding and decoding scheme in the general encoding and decoding of encoding and decoding realization module 36, at this moment, encoding and decoding realize that module 36 can be that " encoding and decoding control word " selects corresponding coding and decoding scheme according to the encode attribute of type.Call schematic diagram as shown in Figure 9.
The encoding and decoding of the embodiment of the invention realize that module 36 has realized various common code encoding/decoding modes, comprise the BER among the ASN.1, PER and XER, and ISO8583, BCD, Http, TLV etc. also have SIP etc., and support to expand easily on its basis future other code encoding/decoding modes.
After encoding and decoding realized that module 36 obtains general encoding and decoding value information, external interface module 32 will this general encoding and decoding value information (being code stream) externally offers the outside specific T TCN-3 test platform of its connection.
Below, will make detailed description to the encoding and decoding principle of the general codec of the embodiment of the invention in conjunction with Figure 10 and Figure 11, wherein Figure 10 is the cataloged procedure flow chart of the general codec of the embodiment of the invention; And Figure 11 is the decode procedure flow chart of the general codec of the embodiment of the invention.
With reference to Figure 10, at first be that actuator in the TTCN-3 test platform is being carried out executable protos test suite PROTOS (ETS, when the send Executable Test Suite) operates, need encode to the object of send, so enter in the external interface module 32, carry out TTCN-3 test platform external encode and call (step 102).And obtain the type and the value of the needs coding of TTCN-3 test platform generation.
Then, need be in step 104, the intermediate form and the value that earlier type and value with specific T TCN-3 test platform are transformed into general encoding and decoding in the step 106 promptly need the support of general code/decode type and value module 34, obtain the expression of the intermediate form and the value of general encoding and decoding.
Then, can call encoding and decoding and realize module 36, according to the encoding mode of type, promptly " encoding and decoding control word " selects corresponding codec to carry out encoding and decoding work (step 108), obtains respective coding gained code stream.Before carrying out encoding and decoding, the type of the message that is encoded is all changed into TTCN-3 language form by the X2T module.
The gained code stream can be used as the current of record coding result and is shown to user's (step 110), and/or external interface module 32 is submitted to corresponding TTCN-3 test platform with the required form of calling platform with code stream.
With reference now to Figure 11,, decoding process is exactly the value of constructing the type according to known type and code stream, initiates decoding Decode (TciValue ﹠amp at specific T TCN-3 test platform; Value, TriMessage msg) during the calling of operation, value just has been assigned with the value of a memory headroom and an only initialized TciValue type.Coding/decoding method is the TTCN-3 Custom Attributes information appointed method of external interface module 32 according to specific T TCN-3 test platform.
When decoding, external interface module 32 is carried out TTCN-3 test platform external decoder and is called (step 202).And obtain the type of the needs decoding of TTCN-3 test platform generation.
Then, the type of value is carried out the conversion operations relevant with concrete TTCN-3 test platform under the support of general code/decode type and value module 34, thereby be converted to the intermediate form (step 204) of the general encoding and decoding that have nothing to do with concrete TTCN-3 test platform, obtain general code/decode type and represent.
Then, call encoding and decoding according to the encoding attribute and realize corresponding code encoding/decoding mode in the module 36, select corresponding decoder the code stream of external interface module 32 inputs decode (step 206).Then, judge whether success (step 210) of decoding, if success of decoding, the displayed record decoded result is given user's (step 212).Otherwise, then can obtain the value representation of general encoding and decoding, the expression that general code/decode type and value module 34 will be worth again converts the value representation (step 214) of specific T TCN-3 test platform to, and offers specific T TCN-3 test platform by external interface module 32.
For Fig. 1, the type transducer 10 of coding/decoding system and codec 30 these two parts are separate, and the contact between them is that the TTCN-3 attribute information that type transducer 10 generates can correctly be resolved when encoding and decoding.Wherein type transducer 10 will be realized an exe program to each other language form, and codec 30 parts will embed with the form of dll in the various TTCN-3 test platforms.
Below, be exemplified below for the reaction equation system testing of using embodiment of the invention coding/decoding system.
(1) for Figure 12 protocol test flow process, wherein, need use the encoding and decoding of XML form according to code requirement for " notice is submitted the file that repays the bonus to " message in the step 1, only need to specify " the encoding and decoding control word " of this type of message to get final product for XML.
Message need be used TLV and BCD code encoding/decoding mode " to obtain the file that repays the bonus " in the step 2, specify " the encoding and decoding control word " of its type of message to get final product for TLV and BCD, as length is had specific (special) requirements, can also refer to be decided to be BCD-6 and represent that this territory takies 6 bytes and uses the BCD coding.Its encoding-decoding process will be given general codec and finish, and use any code encoding/decoding mode with respect to traditional needs and just load the scheme of its dll, and performance cost reduces a lot.
(2) protocol test of financial industry such as Unionpay's test can be used the ISO8583 encoding and decoding, and general codec is supported this code encoding/decoding mode, supports this class testing, only needs specify in test script its " encoding and decoding control word " to be ISO8583.
(3) the Web test waits use Http agreement and XML code encoding/decoding mode, general codec supports Http message to fill and the XML code encoding/decoding mode, can support this class testing, only needing to specify " encoding and decoding control word " when using corresponding encoding and decoding is Http or XER.
(4) provide BER, PER, BCD, TLV, the SIP code encoding/decoding mode when using this code encoding/decoding mode, only needs to specify in test script its " encoding and decoding control word ".
(5) when the new code encoding/decoding mode of needs, general codec support expansion, can realize corresponding encoding and decoding implementation procedure of expansion in the module in encoding and decoding, realize that under general codec framework NewEncode () and NewDecode () interface get final product, the holistic management process is finished by general codec.
The present invention has the following advantages and good effect:
(1) do not rely on outside TTCN test platform
Encoding and decoding in the general codec realize that module is independent of the TTCN test platform, when the TTCN platform uses general coder-decoder, only need to add corresponding translation interface, such as going up and use this general codec at Telelogic instrument (Telelogic Tester is a TTCN-3 compiling developing instrument of IBM Corporation), only need the type of a Telelogic and the translation interface of value and general code/decode type and value and get final product, and on other platform, also only need to add a corresponding translation interface.Like this, the coding and decoding scheme with respect to directly realizing on existing TTCN-3 test platform has more excellent portability and reusability.
(2) encoding and decoding realization and the integration environment are independent
The realization of encoding and decoding can be an any language, and when a kind of code encoding/decoding mode was integrated in the codec, the realization that only needs to call these encoding and decoding in corresponding codec interface is realized got final product.For example the XML decoding realizes, in the realization of the XMLDecode of codec () interface, calls the XML resolver of increasing income and gets final product.
Type and value Module Design, exactly in order to realize that one is represented with the irrelevant internal data of existing each TTCN-3 test platform, based on general codec own type and value module, the realization of various encoding and decoding just can be independent with the integration environment, realizes the versatility of range of application.
(3) provide the management of intermediate form
The internal memory establishment and the destruction of general codec self-management intermediate form are because share intermediate form information, so manage intermediate form internal memory highly effective and safe more by general codec in each encoding-decoding process.
Although illustrated and described embodiments of the invention, for the ordinary skill in the art, be appreciated that without departing from the principles and spirit of the present invention and can carry out multiple variation, modification, replacement and modification that scope of the present invention is by claims and be equal to and limit to these embodiment.

Claims (9)

1. a coding/decoding system that is used for the reaction equation system testing is characterized in that, described coding/decoding system comprises:
Type transducer, described type transducer are used for the corresponding TTCN-3 language form of language-specific type conversion for test and the support of test control representation third edition TTCN-3 test platform; With
Codec, described codec are used for carrying out the attribute information parsing according to the corresponding TTCN-3 language of conversion; And carry out coding/decoding according to the specified coding/decoding mode of the encoding and decoding control word in the TTCN-3 linguistic property information.
2. coding/decoding system as claimed in claim 1 is characterized in that, described codec comprises:
External interface module, described external interface module are carried out the outside encoding and decoding of specific T TCN-3 test platform and are called, to obtain type that needs coding/decoding and the value that specific T TCN-3 test platform generates;
Intermediate form and value that type that needs coding/decoding that general code/decode type and value module, described general code/decode type and value module generate described specific T TCN-3 test platform and value are converted to the general coding/decoding that has nothing to do with this specific T TCN-3 test platform; And
Encoding and decoding realize module, described encoding and decoding realize module according to the code encoding/decoding mode of the encoding and decoding control word Information Selection correspondence of the intermediate form correspondence of described general coding/decoding to carry out coding/decoding.
3. coding/decoding system as claimed in claim 1, it is characterized in that, described type transducer comprises first modular converter, in order to conversion XML document logical construction Language XML Schema type is TTCN-3 language form, and the type information that the XMLSchema that described first modular converter generates from the parsing of Schema document defines is concentrated and obtained all component that the Schema document contains; Call the information of corresponding assembly and obtain the module information that class concentrates acquisition to need separately from the type information of XML Schema definition; And call the translation class that corresponding information obtains the class correspondence and translate according to the module information of correspondence, to generate the TTCN-3 code.
4. coding/decoding system as claimed in claim 1, it is characterized in that, described type transducer comprises second modular converter, in order to conversion XML document type definition XML DTD type is TTCN-3 language form, and the type information that the DTD that described second modular converter generates from the parsing of DTD document defines is concentrated and obtained all component that the DTD document contains; Call the information of corresponding assembly and obtain the module information that class concentrates acquisition to need separately from the type information of DTD definition; And call the translation class that corresponding information obtains the class correspondence and translate according to the module information of correspondence, to generate the TTCN-3 code.
5. coding/decoding system as claimed in claim 2, it is characterized in that, described general code/decode type is changed according to the mapping relations table of the intermediate form of various TTCN-3 test platform corresponding data types and general coding/decoding with the value module, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and various TTCN-3 test platform corresponding data types are mapped to a specific type of common type collection, to obtain described mapping relations table.
6. coding/decoding system as claimed in claim 5, it is characterized in that, when this specific T TCN-3 test platform corresponding data types when there is not corresponding mapping particular type in described mapping relations table, described general code/decode type and value module are according to the string of binary characters of this specific T TCN-3 test platform corresponding data types generation type as its corresponding general coding/decoding.
7. a codec that is used for the reaction equation system testing is characterized in that, described codec comprises:
External interface module, described external interface module are carried out the outside encoding and decoding of specific T TCN-3 test platform and are called, to obtain the type and the value of the coding/decoding that specific T TCN-3 test platform generates;
General code/decode type and value module, intermediate form and value that described general code/decode type and value module are converted to the general coding/decoding that has nothing to do with this specific T TCN-3 test platform with the type and the value of described coding/decoding; And
Encoding and decoding realize module, and described encoding and decoding realize the encoding and decoding control word of module according to the intermediate form correspondence of described general coding/decoding, select corresponding code encoding/decoding mode to carry out coding/decoding.
8. codec as claimed in claim 7, it is characterized in that, described general code/decode type is changed according to the mapping relations table of the intermediate form of various TTCN-3 test platform corresponding data types and general coding/decoding with the value module, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and various TTCN-3 test platform corresponding data types are mapped to a specific type of common type collection, to obtain described mapping relations table.
9. codec as claimed in claim 8, it is characterized in that, when this specific T TCN-3 test platform corresponding data types when there is not corresponding mapping particular type in described mapping relations table, described general code/decode type and value module are according to the string of binary characters of this specific T TCN-3 test platform corresponding data types generation type as its corresponding general coding/decoding.
CN 201010565997 2010-11-23 2010-11-23 Coding and decoding system and codec for reactive system test Expired - Fee Related CN102111160B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010565997 CN102111160B (en) 2010-11-23 2010-11-23 Coding and decoding system and codec for reactive system test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010565997 CN102111160B (en) 2010-11-23 2010-11-23 Coding and decoding system and codec for reactive system test

Publications (2)

Publication Number Publication Date
CN102111160A true CN102111160A (en) 2011-06-29
CN102111160B CN102111160B (en) 2013-06-26

Family

ID=44175205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010565997 Expired - Fee Related CN102111160B (en) 2010-11-23 2010-11-23 Coding and decoding system and codec for reactive system test

Country Status (1)

Country Link
CN (1) CN102111160B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473109A (en) * 2013-08-30 2013-12-25 北京中创信测科技股份有限公司 Method and system for compiling TTCN-3 (testing and test control notation 3) based on System Verilog
CN104052575A (en) * 2014-05-22 2014-09-17 北京星河亮点技术股份有限公司 Communication method for achieving coding and decoding based on TTCN3
CN110472252A (en) * 2019-08-15 2019-11-19 昆明理工大学 The method of the more neural machine translation of the Chinese based on transfer learning
CN111176657A (en) * 2019-12-12 2020-05-19 上海微波技术研究所(中国电子科技集团公司第五十研究所) Method and system for realizing C language codec based on TTCN-3 test platform
CN111382055A (en) * 2018-12-29 2020-07-07 贝壳技术有限公司 Automatic unit testing method and device based on unified description language
CN113676270A (en) * 2021-08-25 2021-11-19 深圳市广和通无线股份有限公司 5G wireless module signal noise detection method and device supporting multi-chip platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN85103579A (en) * 1985-05-08 1986-11-05 索尼公司 The interpretation method of error correcting code and system
US5359606A (en) * 1992-02-12 1994-10-25 Storage Technology Corporation Data quality analysis in a data signal processing channel
CN101408849A (en) * 2008-12-01 2009-04-15 中国科学技术大学 Method and system for compiling and executing TTCN-3 language

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN85103579A (en) * 1985-05-08 1986-11-05 索尼公司 The interpretation method of error correcting code and system
US5359606A (en) * 1992-02-12 1994-10-25 Storage Technology Corporation Data quality analysis in a data signal processing channel
CN101408849A (en) * 2008-12-01 2009-04-15 中国科学技术大学 Method and system for compiling and executing TTCN-3 language

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473109A (en) * 2013-08-30 2013-12-25 北京中创信测科技股份有限公司 Method and system for compiling TTCN-3 (testing and test control notation 3) based on System Verilog
CN103473109B (en) * 2013-08-30 2017-01-04 北京中创信测科技股份有限公司 Method and system TTCN-3 being compiled based on System Verilog
CN104052575A (en) * 2014-05-22 2014-09-17 北京星河亮点技术股份有限公司 Communication method for achieving coding and decoding based on TTCN3
CN104052575B (en) * 2014-05-22 2017-09-22 北京星河亮点技术股份有限公司 A kind of encoding and decoding communication means based on TTCN3
CN111382055A (en) * 2018-12-29 2020-07-07 贝壳技术有限公司 Automatic unit testing method and device based on unified description language
CN111382055B (en) * 2018-12-29 2023-09-15 贝壳技术有限公司 Automatic unit testing method and device based on unified description language
CN110472252A (en) * 2019-08-15 2019-11-19 昆明理工大学 The method of the more neural machine translation of the Chinese based on transfer learning
CN110472252B (en) * 2019-08-15 2022-12-13 昆明理工大学 Method for translating Hanyue neural machine based on transfer learning
CN111176657A (en) * 2019-12-12 2020-05-19 上海微波技术研究所(中国电子科技集团公司第五十研究所) Method and system for realizing C language codec based on TTCN-3 test platform
CN111176657B (en) * 2019-12-12 2023-04-28 上海微波技术研究所(中国电子科技集团公司第五十研究所) C language codec implementation method and system based on TTCN-3 test platform
CN113676270A (en) * 2021-08-25 2021-11-19 深圳市广和通无线股份有限公司 5G wireless module signal noise detection method and device supporting multi-chip platform

Also Published As

Publication number Publication date
CN102111160B (en) 2013-06-26

Similar Documents

Publication Publication Date Title
CN102111160B (en) Coding and decoding system and codec for reactive system test
CN101841515B (en) Target variable protocol data unit codec code automatic generation implementation method
CN100483419C (en) Data format verification method and device
CN100487652C (en) Automaton method for script language
US20050071347A1 (en) System and method for conversion between graph-based representations and structural text-based representations of business processes
EP1492033A2 (en) Common query runtime system and application programming interface
EP2124419B1 (en) An object oriented management device for asn.1 message
CN101996132A (en) Method and device for automatically testing common object request broker architecture (CORBA) interfaces
CN102053860A (en) CORBA-based OSGi distributed extensible system and method
CN102253984A (en) Query sentence processing device and query sentence processing method
CN101261579A (en) Method for accomplishing VBScript language trans-platform uses
CN103049251A (en) Database persistent layer device and database operation method
CN103186455B (en) Page automatic test script generates method and system
CN109582391B (en) XML-based equipment tree configuration method
CN101158894B (en) Dynamically automatic adapting programming system and method in modular soft software system
CN105630563A (en) Dynamic model configuration method of relay protection device specification based on XML (Extensible Markup Language)
CN102520963B (en) Method and system for realizing service logic processing based on strongly-typed relation mapping
CN101202736A (en) Method for realizing encoding-decoding in communication network
CN104331288A (en) Method and system for showing dynamic page in configured manner
CN100470472C (en) System and method for implementing geographical information service based on interpreter and resolver
CN111176657B (en) C language codec implementation method and system based on TTCN-3 test platform
CN103984539A (en) Operation method and operation system for household appliance
CN103593188A (en) System and method for managing what-you-see-is-what-you-get menus of instrument
CN103577380A (en) Automatic generation method for dynamic routing service
CN116841559A (en) Transcoding method, device, apparatus, medium and program product

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130626

Termination date: 20151123