CN102111160B - 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
CN102111160B
CN102111160B CN 201010565997 CN201010565997A CN102111160B CN 102111160 B CN102111160 B CN 102111160B CN 201010565997 CN201010565997 CN 201010565997 CN 201010565997 A CN201010565997 A CN 201010565997A CN 102111160 B CN102111160 B CN 102111160B
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.)
Expired - Fee Related
Application number
CN 201010565997
Other languages
Chinese (zh)
Other versions
CN102111160A (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

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 for the reaction equation system testing.
Background technology
In the reaction equation system testing, conceptual data need to be changed into the code stream that system under test (SUT) can be identified, 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, test and the test control representation method 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 the DLs such as ASN.1, the design that translation obtains the intermediate representation DL also only is confined to the characteristics of these several language, can not well contain new type language, therefore 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 to platform, obtains the type and the value information that need encoding and decoding, carries out corresponding coding-decoding operation.Due to TCI interface corresponding to different compiling platform, so the code encoding/decoding mode of developing on a kind of platform more difficultly 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 with test platform, and have stronger extendible ability, comprise the expansion of new type language and the expansion of coded system, to adapt to the needs to following test service, it is a relatively urgent problems.
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 take the XML type specification as main other Languages to the TTCN-3 language converter, to use easily outside coding/decoding information 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, codec of general relatively independent with 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 present invention comprises: type transducer, described type transducer are used for the language-specific type conversion is the corresponding TTCN-3 language form of testing and test control representation method third edition TTCN-3 test platform is supported; And codec, described codec is used for carrying out the attribute information parsing according to the corresponding TTCN-3 language of conversion; And the coding/decoding mode specified according to the encoding and decoding control word in TTCN-3 linguistic property information carried out coding/decoding.
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, the type that needs coding/decoding and the value that generate to obtain specific T TCN-3 test platform; Intermediate form and value that the 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, and described encoding and decoding realize that code encoding/decoding mode corresponding to the module encoding and decoding control word Information Selection corresponding according to the intermediate form of described general coding/decoding is to carry out coding/decoding.
According to the present invention again one the step embodiment, the mapping relations table of the data type that described general code/decode type and value module are corresponding according to various TTCN-3 test platforms and the intermediate form of general coding/decoding is changed, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and data type corresponding to various TTCN-3 test platforms is mapped to a specific type of common type collection, to obtain described mapping relations table.
Wherein, when there was not corresponding mapping particular type in described mapping relations table, the string of binary characters of the data type generation that described general code/decode type and value module are corresponding according to this specific T TCN-3 test platform was as the type of its corresponding general coding/decoding when data type corresponding to this specific T TCN-3 test platform.
The further embodiment according to the present invention, described type transducer comprises the first modular converter, be TTCN-3 language form in order to change XML document logical construction Language XML Schema type, the type information that the XML Schema that described the first modular converter generates from the parsing of Schema document defines is concentrated and is obtained all component that the Schema document contains; The module information that the acquisition of information class of calling corresponding assembly concentrates acquisition to need separately from the type information of XML Schema definition; And call corresponding information and obtain translation class corresponding to class 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 the second modular converter, be TTCN-3 language form in order to change XML document type definition XML DTD type, the type information that the DTD that described the second modular converter generates from the parsing of DTD document defines is concentrated and is obtained all component that the DTD document contains; The module information that the acquisition of information class of calling corresponding assembly concentrates acquisition to need separately from the type information of DTD definition; And call corresponding information and obtain translation class corresponding to class 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 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 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 type and the value of described coding/decoding the general coding/decoding that has nothing to do with this specific T TCN-3 test platform; And
Encoding and decoding realize module, and described encoding and decoding realize the encoding and decoding control word that module is corresponding according to the intermediate form of described general coding/decoding, select corresponding code encoding/decoding mode to carry out coding/decoding.
The further embodiment according to the present invention, the mapping relations table of the data type that described general code/decode type and value module are corresponding according to various TTCN-3 test platforms and the intermediate form of general coding/decoding is changed, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and data type corresponding to various TTCN-3 test platforms is 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, as long as defined the data type of this test platform to the conversion mapping table of the intermediate form of general encoding and decoding, just still can use this general codec, realize being independent of the universal performance of test platform.
According to the present invention again one the step embodiment, when there was not corresponding mapping particular type in described mapping relations table, the string of binary characters of the data type generation that described general code/decode type and value module are corresponding according to this specific T TCN-3 test platform was as the type of its corresponding general coding/decoding when data type corresponding to this specific T TCN-3 test platform.
Coding/decoding system of the present invention can be realized the direct use of type definition (being mainly the XML type definition) in the TTCN-3 test macro of various language, and can support preferably template assignment and matching feature.
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 the needs to following test service.Support ASCII, BER, PER, BCD, TLV, SIP, the code encoding/decoding modes such as ISO8583 support to expand the newtype code encoding/decoding mode.
The 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 will become from the following description of the accompanying drawings of embodiments and obviously and easily understand, wherein:
Fig. 1 is the coding/decoding system structural representation that is used for the reaction equation system testing of the embodiment of the present invention;
Fig. 2 (a) and Fig. 2 (b) are respectively the structured flowchart of the type transducer of the embodiment of the present invention;
Fig. 3 (a) and Fig. 3 (b) are respectively the acquisition of information class of the embodiment of the present invention and the exemplary plot of translation class;
Fig. 4 is the structured flowchart of the general codec of the embodiment of the present invention;
Fig. 5 is that the general codec ASN.1 data type of the embodiment of the present invention is to the mapping relations schematic diagram of middle regulating style;
Fig. 6 and Fig. 7 are respectively the middle regulating style of general codec of the embodiment of the present invention and the inheritance hierarchy structure chart of middle normal value;
Fig. 8 is the interface schematic diagram as an example of the BER coding function example in the general codec of the embodiment of the present invention;
Fig. 9 is that the addressable port of the general codec of the embodiment of the present invention calls schematic diagram;
Figure 10 is the cataloged procedure flow chart of the general codec of the embodiment of the present invention;
Figure 11 is the decode procedure flow chart of the general codec of the embodiment of the present invention; And
Figure 12 is for using certain protocol test flow process of the general codec of the embodiment of the present invention.
Embodiment
The below describes embodiments of the invention in detail, and the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or the element with identical or similar functions from start to finish.Be exemplary below by the embodiment that is described with reference to the drawings, only be used for explaining 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 present invention.
As shown in the figure, the coding/decoding system of the embodiment of the present 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, be converted to the corresponding TTCN-3 language form that TTCN-3 (test and the test control representation method 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 the coding/decoding mode specified according to the encoding and decoding control word in TTCN-3 linguistic property information carried out coding/decoding.
Specifically, the DL of not supporting for the TTCN-3 test specification, various language such as ASN.1, if XML etc. want to use in the TTCN-3 test macro, and can support preferably template assignment and matching feature, at first be converted into corresponding TTCN-3 language form by type transducer 10, use these functions of TTCN-3 language.In order to solve the information dropout that occurs in transfer process, the information of losing need to be 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 present 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 present invention with XML DTD type conversion.
Realize that the dtd——data type definition of XML to the mapping of TTCN-3 type definition, comprises 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.Whole transfer process can be completed 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 realizes by X2TSchema, and the translation of DTD is realized by X2TDTD.On function, no matter be the translation of Schema or the translation of DTD, all formed by two parts, i.e. document resolver and translater.This Model Implement 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, as shown in Fig. 2 (a):
At first with XML Schema document through the parsing of Xerces-c, be kept in the syntactic information pond.The XSD information set is kept at the type information collection in grammer pond (grammar pool) after representing that the Schema document is resolved through the Xerces-c instrument.
If there is no syntax error in the document of resolving, call X2T controller 14, control whole translation flow by controller 14.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 acquisition of information class 16 of calling corresponding assembly obtains all information of 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, 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 class shown in Fig. 3 (b).
Translation class 18 obtains all information (parameter transmission) of assembly from acquisition of information class 16, and completes the generation of TTCN-3 code.
For being TTCN-3 language form with XML DTD type conversion, as shown in Fig. 2 (b), wherein differently from Fig. 2 (a) be, XSD information set corresponding to principal function 12 ' resolved by the DTD document and generated, correspondingly, X2T controller 14 ' and acquisition of information class 16 ', corresponding module information and the information translation of translation class 18 ' are to complete on the basis of the corresponding types information set that the parsing of DTD document obtains.
On the whole, after the XSD information set represents that Schema document or DTD document are resolved through the Xerces-c instrument, be kept at the type information collection in the grammer pond; 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 is assembly translation class hierarchy.
In translation process, need to obtain some important informations in translation, can guarantee that on the one hand the information of translation process do not lose, 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 in the present invention the variant attribute of with, 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 makes the important information of interior layer assembly be difficult to record just because of the restriction that can only modify type, must will be nested in the with attribute of assembly of internal layer at outer record.In the present invention, the expression mode of a kind of with attribute of designed, designed can meet the TTCN-3 standard syntax, can record again the information in translation process.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 relevant intermediate language type of this specific T TCN-3 test platform 20 by 20 compilings of TTCN-3 test platform, namely 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, 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 to 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 platform is corresponding different, the code encoding/decoding mode of developing on a kind of TTCN-3 test platform more difficultly 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 general codec 30 relatively independent with specific T TCN-3 test platform, can be with reference to the embodiment of figure 4 about the structure of this general codec 30.
As described in Figure 4, general codec 30 comprises that external interface module 32, general code/decode type and value module 34 and encoding and decoding realize 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, the type that needs coding/decoding and the value that generate to obtain specific T TCN-3 test platform;
Intermediate form and value that the 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 realize that code encoding/decoding mode corresponding to the module 36 encoding and decoding control word selection corresponding according to the intermediate form of general coding/decoding is to carry out 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 namely 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 operates general codec accordingly by calling external interface module 32, and then external interface module 32 obtains the type that needs coding/decoding and value information that specific T TCN-3 test platform generates, and inputs general code/decode type and process with value module 34.
The maximum that general code/decode type and value module 34 provide a cover to comprise existing common type (as TTCN-3, ASN.1, XML Schema), and have expansion capacity preferably.By using the type and value module 34, intermediate form and value that the 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.
The mapping relations table of the data type that general code/decode type and value module 34 are corresponding according to various TTCN-3 test platforms and the intermediate form of general coding/decoding is changed.Hereinafter, be called the intermediate form of general coding/decoding and value be respectively in the middle of regulating style and middle normal value.
Middle regulating style not only will comprise existing TTCN-3 type, and the functions such as data type language that expand other in the future need to 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, with a specific type of the corresponding one-tenth of each specific data type common type collection, to obtain described mapping relations table.And, access interior data member's function is provided by interface easily.The type that this centre regulating style comprises 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 data field of expansion, so that the compatible new data type of later common type collection.Using the design in C++ class storehouse, is all to encapsulate with class with type and the value of middle standard.The information of type and value is saved as the member variable of class, codec functions externally provides as the interface function of class.Design the parent CType of all middle regulating styles, the pure virtual function that the definition encoding and decoding realize in the CType class.Use the inheritance mechanism in C++, derive all middle regulating styles on CType, and the design class that realizes the design of normal value in the middle of the codec functions of corresponding types and middle regulating style by inheriting the coding/decoding function that comes seemingly, design the pure virtual base class CValue of all middle normal value, use the inheritance mechanism in C++, in the middle of making, normal value is inherited the class in CValue, and is inheriting the corresponding value of realization interface function on type.
The general codec ASN.1 data type of the embodiment of the present invention to the mapping relations of middle regulating style as shown in Figure 5, Fig. 6 and Fig. 7 are respectively the inheritance hierarchy structure chart of regulating style and middle normal value in the middle of the general codec of the embodiment of the present 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 in real time corresponding intermediate form, search otherwise directly use the intermediate form that obtains.
Wherein when data type corresponding to this specific T TCN-3 test platform when there is not corresponding mapping particular type in the mapping relations table, the string of binary characters of the data type generation that general code/decode type and value module 34 are corresponding according to this specific T TCN-3 test platform is as the type of its corresponding general coding/decoding.
General code/decode type and value module 34 are input to encoding and decoding with the type of general encoding and decoding needs and value information and realize in module 36, in with encode attribute in the external interface module 32 TTCN-3 linguistic property information corresponding according to the type of general coding/decoding, specified code encoding/decoding mode calls corresponding encoding and decoding interface function, claim that the encode attribute of TTCN-3 language is " encoding and decoding control word ", and realize that by encoding and decoding code encoding/decoding mode corresponding to the module 36 encoding and decoding control word corresponding according to the type of general coding/decoding is to carry out coding/decoding.Realize codec functions.
Encoding and decoding realize that the realization of the various encoding and decoding of module 36 all is based on middle regulating style and value, and codec functions provides with the response function interface by middle regulating style.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 then each centre standard subtype removes to realize the code encoding/decoding mode of its corresponding types.
Anticipate interface take the BER coding function as illustration as shown in Figure 8, and CType is base class, the abstract BER addressable port of base class statement, and base class is not realized this interface; Subclasses C Integer inherits the CType class, and subclass is concrete realizes this interface.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.
Encoding and decoding realize providing non-explicit the encoding and decoding interface Encode and the Decode that call coding and decoding scheme in the general encoding and decoding of 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 present invention realize that module 36 has realized various common code encoding/decoding modes, comprises the BER in 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, in connection with Figure 10 and Figure 11, the encoding and decoding principle of the general codec of the embodiment of the present invention is made detailed description, wherein Figure 10 is the cataloged procedure flow chart of the general codec of the embodiment of the present invention; And Figure 11 is the decode procedure flow chart of the general codec of the embodiment of the present 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 to encode to the object of send, therefore enter in external interface module 32, carry out TTCN-3 test platform external encode and call (step 102).And obtain type and the value of the needs coding of TTCN-3 test platform generation.
Then, need to be in step 104, the intermediate form and the value that first type and value with specific T TCN-3 test platform are transformed into general encoding and decoding in step 106 namely need the support of general code/decode type and value module 34, obtain the expression of 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, namely " encoding and decoding control word " selects corresponding codec to carry out encoding and decoding work (step 108), obtains the gained code stream of encoding accordingly.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 to construct the value of 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 memory headroom and the value of an initialized TciValue type only.Coding/decoding method is that external interface module 32 is according to the method for the TTCN-3 Custom Attributes information appointment of 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 to 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 module 36, select corresponding decoder to the code stream of external interface module 32 inputs decode (step 206).Then, whether success (step 210) of judgement decoding is if success of decoding shows that the carrying recorded decoding result is to user (step 212).Otherwise, can obtain the value representation of general encoding and decoding, general code/decode type becomes the value representation (step 214) of specific T TCN-3 test platform with the representation conversion that value module 34 will be worth again, 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 in various TTCN-3 test platforms with the form of dll.
Below, be exemplified below for the reaction equation system testing of using embodiment of the present invention coding/decoding system.
(1) for Figure 12 protocol test flow process, wherein for " notice is submitted the file that repays the bonus to " message in step 1, need to use the encoding and decoding of XML form according to code requirement, only need to specify " the encoding and decoding control word " of this type of message to get final product for XML.
Message need to be used TLV and BCD code encoding/decoding mode " to obtain the file that repays the bonus " in 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 complete, 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 the financial industry such as Unionpay's test, can use the ISO8583 encoding and decoding, and general codec is supported this code encoding/decoding mode, supports this class testing, only needs specify its " encoding and decoding control word " to be ISO8583 in test script.
(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 module in encoding and decoding, realize that under general codec framework NewEncode () and NewDecode () interface get final product, the holistic management process is completed 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 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 upward using this general codec at Telelogic instrument (Telelogic Tester is a TTCN-3 compiling developing instrument of IBM Corporation), only need to there be the type of a Telelogic and the translation interface of value and general code/decode type and value to get final product, and also only need to add a corresponding translation interface on other platform.Like this, the coding and decoding scheme with respect to directly realizing on existing TTCN-3 test platform has better portability and reusability.
(2) encoding and decoding realization and the integration environment are independent
The realization of encoding and decoding can be any language, and when a kind of code encoding/decoding mode was integrated in 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 the design that is worth module, exactly in order to realize that an internal data that has nothing to do with existing each TTCN-3 test platform represents, 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
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 to these embodiment, scope of the present invention is by claims and be equal to and limit.

Claims (8)

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 method 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 the coding/decoding mode specified according to the encoding and decoding control word in TTCN-3 linguistic property information carried out coding/decoding;
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, the type that needs coding/decoding and the value that generate to obtain specific T TCN-3 test platform;
Intermediate form and value that the 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, and described encoding and decoding realize that code encoding/decoding mode corresponding to the module encoding and decoding control word Information Selection corresponding according to the intermediate form of described general coding/decoding is to carry out coding/decoding.
2. coding/decoding system as claimed in claim 1, it is characterized in that, described type transducer comprises the first modular converter, be TTCN-3 language form in order to change XML document logical construction Language XML Schema type, the type information that the XMLSchema that described the first modular converter generates from the parsing of Schema document defines is concentrated and is obtained all component that the Schema document contains; The module information that the acquisition of information class of calling corresponding assembly concentrates acquisition to need separately from the type information of XML Schema definition; And call corresponding information and obtain translation class corresponding to class and translate according to the module information of correspondence, to generate the TTCN-3 code.
3. coding/decoding system as claimed in claim 1, it is characterized in that, described type transducer comprises the second modular converter, be TTCN-3 language form in order to change XML document type definition XML DTD type, the type information that the DTD that described the second modular converter generates from the parsing of DTD document defines is concentrated and is obtained all component that the DTD document contains; The module information that the acquisition of information class of calling corresponding assembly concentrates acquisition to need separately from the type information of DTD definition; And call corresponding information and obtain translation class corresponding to class 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, the mapping relations table of the data type that described general code/decode type and value module are corresponding according to various TTCN-3 test platforms and the intermediate form of general coding/decoding is changed, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and data type corresponding to various TTCN-3 test platforms is mapped to a specific type of common type collection, to obtain described mapping relations table.
5. coding/decoding system as claimed in claim 4, it is characterized in that, when there was not corresponding mapping particular type in described mapping relations table, the string of binary characters of the data type generation that described general code/decode type and value module are corresponding according to this specific T TCN-3 test platform was as the type of its corresponding general coding/decoding when data type corresponding to this specific T TCN-3 test platform.
6. 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 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 type and the value of described coding/decoding the general coding/decoding that has nothing to do with this specific T TCN-3 test platform; And
Encoding and decoding realize module, and described encoding and decoding realize the encoding and decoding control word that module is corresponding according to the intermediate form of described general coding/decoding, select corresponding code encoding/decoding mode to carry out coding/decoding.
7. codec as claimed in claim 6, it is characterized in that, the mapping relations table of the data type that described general code/decode type and value module are corresponding according to various TTCN-3 test platforms and the intermediate form of general coding/decoding is changed, wherein said general code/decode type passes through with reference to existing DDL with the value module, extract a public set of types, and data type corresponding to various TTCN-3 test platforms is mapped to a specific type of common type collection, to obtain described mapping relations table.
8. codec as claimed in claim 7, it is characterized in that, when there was not corresponding mapping particular type in described mapping relations table, the string of binary characters of the data type generation that described general code/decode type and value module are corresponding according to this specific T TCN-3 test platform was as the type of its corresponding general coding/decoding when data type corresponding to this specific T TCN-3 test platform.
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 CN102111160A (en) 2011-06-29
CN102111160B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473109B (en) * 2013-08-30 2017-01-04 北京中创信测科技股份有限公司 Method and system TTCN-3 being compiled based on System Verilog
CN104052575B (en) * 2014-05-22 2017-09-22 北京星河亮点技术股份有限公司 A kind of encoding and decoding communication means based on TTCN3
CN111382055B (en) * 2018-12-29 2023-09-15 贝壳技术有限公司 Automatic unit testing method and device based on unified description language
CN110472252B (en) * 2019-08-15 2022-12-13 昆明理工大学 Method for translating Hanyue neural machine based on transfer learning
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

Citations (2)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408849A (en) * 2008-12-01 2009-04-15 中国科学技术大学 Method and system for compiling and executing TTCN-3 language

Patent Citations (2)

* 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

Also Published As

Publication number Publication date
CN102111160A (en) 2011-06-29

Similar Documents

Publication Publication Date Title
CN102111160B (en) Coding and decoding system and codec for reactive system test
CN100483419C (en) Data format verification method and device
Wang et al. The Zephyr Abstract Syntax Description Language.
US8856732B2 (en) System and method for creating, managing, and reusing schema type definitions in services oriented architecture services, grouped in the form of libraries
US20040158820A1 (en) System for generating an application framework and components
CN101276279B (en) Unified development system and method
CN102566984B (en) Method and device for configuring parameters
EP2124419B1 (en) An object oriented management device for asn.1 message
JP2005018777A (en) Common query runtime system and application programming interface
CN102063324A (en) Method and system for implementing automatic programming
CN101996132A (en) Method and device for automatically testing common object request broker architecture (CORBA) interfaces
CN101185116A (en) Using strong data types to express speech recognition grammars in software programs
CN104407863A (en) Abstract control model programming device and method
CN103049251A (en) Database persistent layer device and database operation method
CN100561476C (en) A kind of code generating method based on the ASN type object
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
CN101158894B (en) Dynamically automatic adapting programming system and method in modular soft software system
CN116974620A (en) Application program generation method, operation method and corresponding device
CN104331288A (en) Method and system for showing dynamic page in configured manner
CN202143092U (en) Message processing system
CN101126985A (en) System and method for implementing geographical information service based on interpreter and resolver
CN103714035B (en) Multilayer software bus structure for integrated environment
CN103176830A (en) Method for generating C++code based on combination of class diagram and activity diagram
CN106815003A (en) The interactive system and exchange method of a kind of computer language

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