One kind beats unpacking program creating method and device
Technical field
The application is related to system test technical field, and more particularly to one kind beats unpacking program creating method and device.
Background technology
In system test field, system under test (SUT) is often made up of multiple equipment being cross-linked with each other, and we claim these equipment
For the equipment of participating in the experiment.Each in system under test (SUT) to be participated in the experiment needed between equipment and communicated, in order that each is participated in the experiment between equipment
Communication information recognized by other side, each in system under test (SUT) participate in the experiment interface type between equipment, communication logic, communication modes,
The communications parameter such as communications protocol and/or data standard should be unified, and ICD is mainly passed through in system under test (SUT)(Interface
Control Document, ICD) in message unifying to above-mentioned each communications parameter.
Test system mainly carries out message and data by the information beaten unpacking program to participate in the experiment each and transmit between equipment
Mutual conversion, prior art beats unpacking program on stream, it is necessary first to obtains the ICD of system under test (SUT), then just may be used
According to the ICD of the system under test (SUT), to write beat unpacking program for the specific system under test (SUT) ICD manually, and then realize beating solution
Packet function.
Therefore, prior art often leads to following problem:
1), need for different system under test (SUT) ICD develop it is different beat unpacking program, cause different systems under test (SUT) without
Method is realized general beating unpacking program.
2), when system under test (SUT) ICD is changed, it is corresponding with the system under test (SUT) to beat after unpacking program needed according to change
ICD is redesigned, it is impossible to adapt to change in time.
3), when in order to ensure the safety of the ICD of system under test (SUT), when needing to carry out secrecy to system under test (SUT) ICD, exploit person
Member cannot be designed generation and beat unpacking program accordingly according to system under test (SUT) ICD.
The content of the invention
In view of this, the embodiment of the present application provides one kind and beats unpacking program creating method and device, automatically generates and reception
The ICD that arrives it is corresponding beat unpacking program so that on the basis of system under test (SUT) ICD safeties are ensured, satisfaction beats unpacking program
Versatility, raising beat unpacking program instant adaptation change ability.
To achieve these goals, the technical scheme that the embodiment of the present application is provided is as follows:
One kind beats unpacking program creating method, including:
The ICD for including at least one message of receiving user's input;
Respectively bit field structure is defined to every message in the ICD;
Unpacking function create-rule is beaten using what is pre-set, is generated respectively corresponding with bit field structure each described
Beat and unpack function;
Using bit field structure each described, corresponding with bit field structure each described respectively unpacking is played to what is generated
Function is compiled, and unpacking program is beaten in generation.
Preferably, it is described the every message definition bit field structure in the ICD is included respectively:
Every message in the respectively ICD distributes a unique bit field structure title;
Respectively per each variable-definition structure member in message described in bar, per each variable in message described in bar
The structure member Name of definition is unique, the variable institute of the type of each structure member by corresponding to structure member
Determine in the message total length of message, the variable of the length of each structure member and variable corresponding to structure member
Length is identical.
Preferably, also include:Variable in per message described in bar is not taken region definition structure body member respectively.
Preferably, the unpacking function create-rule of beating for pre-setting includes:The packing function for pre-setting generates rule
Then and the unpacking function create-rule that pre-sets.
Preferably, the packing function create-rule for pre-setting includes:
Create the bit field structure variable corresponding with bit field structure;
Each variate-value to be packed for receiving is assigned to into respectively the knot in the corresponding bit field structure variable
Structure body member;
By the bit field structure variable memory copying to message pointer;
Return the message pointer.
Preferably, the unpacking function create-rule for pre-setting includes:
Create the bit field structure variable corresponding with bit field structure;
By in the message memory copying of the packet voice to be solved for receiving in place domain structure body variable;
The value of each structure member in the bit field structure variable is assigned to respectively relative with structure member
The argument pointer answered;
Return each argument pointer.
Preferably, the ICD for including at least one message of the receiving user's input, including:
Receive user by the ICD for including at least one message of the ICD definition interfaces that pre-set input or,
The ICD for including at least one message that receive user is input into by way of importing ICD.
Preferably, also include:The ICD of the user input to receiving is stored.
Preferably, also include:By the ICD definition interfaces for pre-setting the ICD for storing is shown and/or repaiied
Change.
One kind beats unpacking program creating device, including:ICD receiving units, bit field structure definition unit, beat unpacking function
Signal generating unit and beat unpacking Program Generating unit, wherein,
The ICD receiving units are used for the ICD for including at least one message of receiving user's input;
The bit field structure definition unit is connected with the ICD receiving units, for respectively to the ICD in per bar
Message defines bit field structure;
The unpacking function generation unit of beating is connected with the bit field structure definition unit, pre-sets for utilizing
Beat unpacking function create-rule, corresponding with bit field structure each described beating is generated respectively and unpacks function;
Described beating unpacks one end of Program Generating unit and is connected with the bit field structure definition unit, the other end and institute
State to beat and unpack function generation unit and be connected, for using bit field structure each described, to generate respectively with described in each
The corresponding unpacking function of beating of bit field structure is compiled, and unpacking program is beaten in generation.
The present invention provides one kind and beats and unpack program creating method and device, and receiving user's input first includes at least one
The ICD of bar message, then respectively to the every message definition bit field structure in ICD, and plays unpacking letter using what is pre-set
Number create-rule, generates respectively beat corresponding with each bit field structure and unpacks function, finally using each bit field structure,
Unpacking function of beating corresponding with each bit field structure respectively to generating is compiled, and unpacking program is beaten in generation, in the mistake
Bit field structure, and the final position according to definition are defined by each message in the ICD to the user input for receiving in journey
Domain structure body and beating of pre-setting unpack function create-rule automatically generate it is corresponding with the ICD beat unpacking program, make
Obtain on the basis of system under test (SUT) ICD safeties are ensured, satisfaction is beaten the versatility of unpacking program, raising and beats the instant of unpacking program
Adapt to change ability.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present application or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments described in application, for those of ordinary skill in the art, on the premise of not paying creative work,
Can be with according to these other accompanying drawings of accompanying drawings acquisition.
Fig. 1 is a kind of flow chart for beating unpacking program creating method that the embodiment of the present application one is provided;
Fig. 2 is a kind of side for defining bit field structure to every message in ICD respectively that the embodiment of the present application two is provided
Method flow chart;
Fig. 3 is a kind of structural representation for beating unpacking program creating device that the embodiment of the present application three is provided.
Specific embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, below in conjunction with the application reality
The accompanying drawing in example is applied, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described enforcement
Example is only some embodiments of the present application, rather than the embodiment of whole.Based on the embodiment in the application, this area is common
The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to the application protection
Scope.
Embodiment one:
Fig. 1 is a kind of flow chart for beating unpacking program creating method that the embodiment of the present application one is provided.
As shown in figure 1, the method includes:
The ICD for including at least one message of S101, receiving user's input.
In the embodiment of the present application, it is preferred that the ICD of the user input for receiving includes:At least one message and
The variable that includes in message total length, every message corresponding with every message respectively and corresponding with each variable respectively
Variable-length, types of variables, variable unit etc..
Beat in unpacking program creating method what the embodiment of the present application was provided, it is preferred that be previously provided with ICD interfaces, use
Family can utilize the ICD interfaces, and by way of importing ICD the ICD for including at least one message is introduced directly into, or,
It is previously provided with the basis of ICD interfaces and is also previously provided with ICD definition interfaces, user can utilizes the ICD interfaces, by handss
The mode of dynamic input is input into the ICD for including at least one message in ICD definition interfaces.
Below it is only the optimal way of the embodiment of the present application, inventor can be arbitrarily arranging use according to the demand of oneself
Family is input into the mode of ICD, and here is not limited.
S102, respectively in the ICD every message define bit field structure.
In the embodiment of the present application, when receive user input include at least one message ICD after, need difference
Bit field structure is defined to every message in the ICD, wherein, it is preferred that every message in respectively ICD defines bit field knot
The process of structure body refers to embodiment two.
What S103, utilization pre-set beats unpacking function create-rule, generates respectively corresponding with each bit field structure
Beat unpacking function.
In the embodiment of the present application, be previously provided with beat unpack function create-rule, in the ICD for receiving per bar
Message is defined after bit field structure, in addition it is also necessary to is beaten unpacking function create-rule using what this pre-set, is generated respectively and each
Corresponding the beating of bit field structure unpacks function.Wherein, what this pre-set beats unpacking function create-rule includes:Pre-set
Packing function create-rule and the unpacking function create-rule that pre-sets.
Preferably, in the embodiment of the present application, the packing function create-rule for pre-setting is:Create and bit field structure
Corresponding bit field structure variable;Each variate-value to be packed for receiving is assigned to into respectively corresponding bit field structure
Structure member in variable;By bit field structure variable memory copying to message pointer, and return the message pointer.
Preferably, in the embodiment of the present application, the unpacking function create-rule for pre-setting is:Create and bit field structure
Corresponding bit field structure variable;By in the message memory copying of the packet voice to be solved for receiving in place domain structure body variable,
The value of each structure member in bit field structure variable is assigned to into respectively the argument pointer corresponding with structure member,
And return each argument pointer.
More than be only the optimal way for beating unpacking function create-rule that the embodiment of the present application is provided, inventor can be with
Arbitrarily arranged according to the demand of oneself and beat the create-rule for unpacking function, here is not limited.
S104, using each bit field structure, corresponding with each bit field structure respectively the beating to generating unpacks letter
Number is compiled, and unpacking program is beaten in generation.
In the embodiment of the present application, when unpacking function create-rule is beaten according to what is pre-set, generate and each position respectively
Domain structure body phase is corresponding to beat after unpacking function, in addition it is also necessary to unpacks function to beating of generating and is compiled and just can generate computer
The language that can be recognized, i.e.,:Beat unpacking program.
Preferably, in the embodiment of the present application, during air exercise unpacking function is compiled, need to utilize and this dozen
Unpacking the corresponding bit field structure of function can just realize compilation process, wherein, air exercise unpacks function in the embodiment of the present application
The detailed process being compiled is same as the prior art, and detailed description refer to prior art, and here is not described in detail.
Further, beat in unpacking program creating method in one kind that the embodiment of the present application is provided, also include:
The ICD of the user input to receiving is stored.
Further, beat in unpacking program creating method in one kind that the embodiment of the present application is provided, also include:
By the ICD definition interfaces for pre-setting the ICD for storing is shown and/or changed.
In the embodiment of the present application, ICD definition interfaces are previously provided with, the ICD definition interfaces pre-set by this can
With show storage ICD, and user can also in the ICD definition interfaces show ICD modify, and then generate with
Amended ICD it is corresponding beat unpacking program.
The present invention provides one kind and beats and unpacks program creating method, and receiving user's input first includes at least one message
ICD, then respectively in ICD every message define bit field structure, and using pre-set beat unpacking function generation
Rule, generates respectively beat corresponding with each bit field structure and unpacks function, finally using each bit field structure, to generating
Corresponding with each bit field structure respectively unpacking function of beating be compiled, unpacking program is beaten in generation, is led in this process
Each message crossed in the ICD to the user input for receiving defines bit field structure, and the final bit field structure according to definition
Body and beating of pre-setting unpack function create-rule and automatically generate corresponding with the ICD beats unpacking program so that in guarantor
On the basis of card system under test (SUT) ICD safeties, satisfaction plays the instant adaptation change that the versatility of unpacking program, raising beat unpacking program
More ability.
Embodiment two:
Fig. 2 is a kind of side for defining bit field structure to every message in ICD respectively that the embodiment of the present application two is provided
Method flow chart.
As shown in Fig. 2 the method includes:
S201, every message being respectively in ICD distribute a unique bit field structure title.
In the embodiment of the present application, during bit field structure is defined to every message in ICD respectively, need first
It is respectively the every message included in the ICD and distributes a unique bit field structure title, it is preferred that the user input
The title of the every message included in ICD is unique, the bit field structure title of respectively every message distribution with corresponding to it
The title of message is identical.
S202, each variable-definition structure member being respectively in every message.
In the embodiment of the present application, when every message in respectively ICD distributes a unique bit field structure title
Afterwards, in addition it is also necessary to included each variable-definition structure member in respectively every message, it is each in and to every message
The structure member Name of individual variable-definition is unique, the variable of the type of each structure member by corresponding to structure member
The message total length of place message determines that the length of each structure member is long with the variable of variable corresponding to structure member
Degree is identical.
In the embodiment of the present application, it is preferred that the title of every message in the ICD of the user input for receiving is unique,
And the title of each variable in every message is unique, the structure member name of each variable-definition in respectively every message
Claim, be the combination of the title with the name variable of the variable place message.It is only above the optimal way of the embodiment of the present application,
Inventor can be being embodied as the knot of each variable-definition in every message according to the demand of oneself by other any modes
The unique process of structure body title.
In the embodiment of the present application, it is preferred that when the message total length of certain message in the ICD for receiving is less than or equal to
During 8 bit, the type of structure member defined in each variable respectively in the message is char types;When certain message
Message total length is more than 8 bits, and during less than or equal to 16 bit, structure defined in each variable respectively in the message
The type of member is short types;When the message total length of certain message is more than 16 bits, and during less than or equal to 32 bit, respectively
The type of structure member defined in each variable in the message is long types;When the message total length of certain message it is big
When 32 bit, the type of structure member defined in each variable respectively in the message be long long types, the above
The only optimal way of the embodiment of the present application, inventor can with the demand according to oneself it is arbitrarily devised as message in variable
Relation between the type of the structure member of definition and the message total length of the message.
In a kind of method flow diagram for defining bit field structure to every message in ICD respectively for providing as shown in Figure 2,
Further include:
S203, variable in every message is not taken region definition structure body member respectively.
In the embodiment of the present application, there may be in the message in the message included by ICD that the user for receiving sends
The region that do not take of variable, when there is the region that variable does not take in certain message(I.e.:There is white space in the message)
When, then the region each variable in the message not taken respectively(I.e.:Each white space in message)Definition structure body
Member, wherein, it is preferred that the structure member Name of the region definition not taken for variable is null-n, wherein, n represents this
The region that variable does not take is the region which variable in the message does not take;The knot of the region definition not taken for variable
The message total length of the region place message that the type of structure body member is not taken by the variable is determined;For the region that variable does not take
The length of the structure member of definition is identical with the length in the region that the variable does not take.
The embodiment of the present application provides a kind of method for defining bit field structure to every message in ICD respectively, by right
Respectively to the detailed description of the method for every message definition bit field structure and introduction in ICD so that what the application was provided beats solution
The method that every message in ICD defines bit field structure is become apparent from, completely in bag program creating method.
Embodiment three:
Fig. 3 is a kind of structural representation for beating unpacking program creating device that the embodiment of the present application three is provided.
As shown in figure 3, the device includes:ICD receiving units 1, bit field structure definition unit 2, beat unpacking function generate
Unit 3 and unpacking Program Generating unit 4 is beaten, wherein, ICD receiving units 1, bit field structure definition unit 2, beat and unpack function
Signal generating unit 3 and beat unpacking Program Generating unit 4 and be sequentially connected and connect.
ICD receiving units 1 are mainly used in the ICD for including at least one message of receiving user's input.
Bit field structure definition unit 2 is connected with ICD receiving units 1, and the bit field structure definition unit 2 is used to distinguish
Bit field structure is defined to every message in the ICD.
Beat unpacking function generation unit 3 to be connected with bit field structure definition unit 2, this dozen unpacks function generation unit 3
For beating unpacking function create-rule using what is pre-set, beat corresponding with each bit field structure is generated respectively and unpacks letter
Number.
The one end for beating unpacking Program Generating unit 4 is connected with bit field structure definition unit 2, and the other end unpacks letter with beating
Number signal generating unit 3 is connected, and this dozen unpacks Program Generating unit 4 to be used to utilize each bit field structure, to generate respectively with
The corresponding unpacking function of beating of each bit field structure is compiled, and unpacking program is beaten in generation.
The present invention provide one kind beat unpack program creating device, including ICD receiving units, bit field structure definition unit,
Beat and unpack function generation unit and beat unpacking Program Generating unit, first by the bag of ICD receiving unit receiving user's inputs
ICD containing at least one message, then defines bit field to every message in ICD respectively by bit field structure definition unit
Structure, and by beat unpack function generation unit using pre-set beat unpack function create-rule, generate respectively with respectively
Corresponding the beating of individual bit field structure unpacks function, and Program Generating unit is unpacked using each bit field structure finally by beating,
Unpacking function of beating corresponding with each bit field structure respectively to generating is compiled, and unpacking program is beaten in generation, the device
Bit field structure is defined by each message in the ICD to receiving, and it is final according to the bit field structure for defining and pre-
Beating of first arranging unpacks function create-rule and automatically generate corresponding with the ICD beats unpacking program so that in the tested system of guarantee
On the basis of system ICD safeties, satisfaction beats the instant adaptation change ability that the versatility of unpacking program, raising beat unpacking program.
Each embodiment is described by the way of progressive in this specification, and what each embodiment was stressed is and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
The above is only the preferred implementation of the application, make skilled artisans appreciate that or realizing the application.It is right
Various modifications of these embodiments will be apparent to one skilled in the art, general original as defined herein
Reason can in other embodiments be realized in the case of without departing from spirit herein or scope.Therefore, the application will not
Be intended to be limited to the embodiments shown herein, and be to fit to it is consistent with principles disclosed herein and features of novelty most
Wide scope.