Summary of the invention
In view of this, the embodiment of the present application provides a kind of beating to unpack program creating method and device, automatically generate the program of unpacking of beating corresponding with the ICD receiving, make guaranteeing on the basis of system under test (SUT) ICD security, the instant adaptation change ability of the program of unpacking is beaten in satisfied versatility, raising of beating the program of unpacking.
To achieve these goals, the technical scheme that the embodiment of the present application provides is as follows:
Beat and unpack a program creating method, comprising:
Receive the ICD that includes at least one message of user's input;
Respectively to every message definition bit field structure in this ICD;
Beating that utilization sets in advance unpacks function create-rule, generates and unpacks function with corresponding the beating of bit field structure described in each respectively;
Utilize bit field structure described in each, to what generate, unpack function respectively compile with corresponding the beating of bit field structure described in each, the program of unpacking is beaten in generation.
Preferably, describedly respectively every message definition bit field structure in this ICD is comprised:
Every the message being respectively in this ICD distributes a unique bit field structure title;
Be respectively each variable-definition structure member in every described message, the structure member Name of each variable-definition in every described message is unique, described in each, structure member's type is determined by the message total length of the corresponding variable of this structure member place message, and described in each, structure member's length is identical to the variable-length of dependent variable with this structure members.
Preferably, also comprise: the zone definitions structure member who respectively variable in message every described is not taken.
Preferably, beating of setting in advance described in unpacks function create-rule and comprises: the packing function create-rule setting in advance and set in advance unpack function create-rule.
Preferably, the packing function create-rule setting in advance described in comprises:
Create the bit field structure variable corresponding with bit field structure;
Each variate-value to be packed receiving is distinguished to assignment to the structure member in corresponding described bit field structure variable;
By described bit field structure variable memory copying to message pointer;
Return to described message pointer.
Preferably, the function create-rule that unpacks setting in advance described in comprises:
Create the bit field structure variable corresponding with bit field structure;
The message memory copying of the packet voice to be separated receiving is put in place in domain structure body variable;
By the value difference assignment of each structure member in described bit field structure variable, give the argument pointer corresponding with this structure member;
Return to argument pointer described in each.
Preferably, the ICD that includes at least one message of described reception user input, comprising:
Receive user by the ICD that includes at least one message of the ICD definition interfaces input that sets in advance or,
Receive the ICD that includes at least one message that user inputs by importing the mode of ICD.
Preferably, also comprise: the ICD to the user's input receiving stores.
Preferably, also comprise: by the described ICD definition interfaces setting in advance, the ICD of storage is shown and/or revised.
Beat and unpack a program creating device, comprising: ICD receiving element, bit field structure definition unit, beat to unpack function generation unit and beat and unpack program generation unit, wherein,
Described ICD receiving element is for receiving the ICD that includes at least one message of user's input;
Described bit field structure definition unit is connected with described ICD receiving element, for every message definition bit field structure to this ICD respectively;
Described beating unpacks function generation unit and is connected with described bit field structure definition unit, for utilizing beating of setting in advance to unpack function create-rule, generates and unpacks function with corresponding the beating of bit field structure described in each respectively;
The described one end that unpacks program generation unit of beating is connected with described bit field structure definition unit, the other end unpacks function generation unit and is connected with described beating, be used for utilizing bit field structure described in each, to what generate, unpack function respectively compile with corresponding the beating of bit field structure described in each, the program of unpacking is beaten in generation.
The invention provides a kind of beating and unpack program creating method and device, first receive the ICD that includes at least one message of user's input, then respectively to every message definition bit field structure in ICD, and utilize beating of setting in advance to unpack function create-rule, generate and unpack function with corresponding the beating of each bit field structure respectively, finally utilize each bit field structure, to what generate, unpack function with corresponding the beating of each bit field structure respectively and compile, generate the program of unpacking of beating, in this process, by each message in the ICD of the user's input to receiving, define bit field structure, and finally according to the bit field structure of definition and beating of setting in advance unpack function create-rule automatically generation corresponding with this ICD beat the program of unpacking, make guaranteeing on the basis of system under test (SUT) ICD security, meet the versatility of beating the program of unpacking, improve the instant adaptation change ability of beating the program of unpacking.
Embodiment
In order to make those skilled in the art person understand better the technical scheme in the application, below in conjunction with the accompanying drawing in the embodiment of the present application, technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is only the application's part embodiment, rather than whole embodiment.Embodiment based in the application, those of ordinary skills are not making the every other embodiment obtaining under creative work prerequisite, all should belong to the scope of the application's protection.
Embodiment mono-:
A kind of process flow diagram that unpacks program creating method of beating that Fig. 1 provides for the embodiment of the present application one.
As shown in Figure 1, the method comprises:
The ICD that includes at least one message of S101, reception user input.
In the embodiment of the present application, the ICD of the user input preferably, receiving comprises: the variable comprising at least one message and respectively the message total length corresponding with every message, every message and respectively with the corresponding variable-length of each variable, types of variables, variable unit etc.
Beating of providing in the embodiment of the present application unpacks in program creating method, preferably, set in advance ICD interface, user can utilize this ICD interface, by importing the mode of ICD, directly import the ICD that includes at least one message, or, on the basis that sets in advance ICD interface, also set in advance ICD definition interfaces, user can utilize this ICD interface, by the mode of manual input, inputs the ICD that includes at least one message in ICD definition interfaces.
Below be only the optimal way of the embodiment of the present application, inventor can also arrange arbitrarily the mode that user inputs ICD according to the demand of oneself, at this, does not limit.
S102, respectively to every message definition bit field structure in this ICD.
In the embodiment of the present application, after receiving the ICD that includes at least one message of user's input, need respectively to every message definition bit field structure in this ICD, wherein, preferably, the process that is respectively every message definition bit field structure in ICD refers to embodiment bis-.
Beating that S103, utilization set in advance unpacks function create-rule, generates and unpacks function with corresponding the beating of each bit field structure respectively.
In the embodiment of the present application, set in advance to beat and unpacked function create-rule, after every message definition bit field structure in the ICD receiving, also need to utilize beating that this sets in advance to unpack function create-rule, generation unpacks function with corresponding the beating of each bit field structure respectively.Wherein, this sets in advance beats and unpacks function create-rule and comprise: the packing function create-rule setting in advance and set in advance unpack function create-rule.
Preferably, in the embodiment of the present application, the packing function create-rule setting in advance is: create the bit field structure variable corresponding with bit field structure; Each variate-value to be packed receiving is distinguished to assignment to the structure member in corresponding bit field structure variable; Bit field structure variable memory copying, to message pointer, and is returned to this message pointer.
Preferably, in the embodiment of the present application, the function create-rule that unpacks setting in advance is: create the bit field structure variable corresponding with bit field structure; The message memory copying of the packet voice to be separated receiving is put in place in domain structure body variable, by the value difference assignment of each structure member in bit field structure variable, give the argument pointer corresponding with this structure member, and return to each argument pointer.
Below be only the embodiment of the present application provide beat the optimal way that unpacks function create-rule, inventor can also according to own demand arbitrarily setting beat the create-rule that unpacks function, at this, do not limit.
S104, utilize each bit field structure, to what generate, unpack function respectively compile with corresponding the beating of each bit field structure, the program of unpacking is beaten in generation.
In the embodiment of the present application, when unpacking function create-rule according to beating of setting in advance, generate respectively and unpack after function with corresponding the beating of each bit field structure, also need that beating of generation unpacked to function and compile just and can generate the language that computing machine can be identified, that is: beat the program of unpacking.
Preferably, in the embodiment of the present application, in air exercise, unpack in the process that function compiles, need utilization to unpack the corresponding bit field structure of function with this dozen and just can realize compilation process, wherein, it is same as the prior art that in the embodiment of the present application, air exercise unpacks the detailed process that function compiles, and describes in detail and please refer to prior art, at this, do not describe in detail.
Further, a kind of the beating providing in the embodiment of the present application unpacks in program creating method, also comprises:
ICD to the user's input receiving stores.
Further, a kind of the beating providing in the embodiment of the present application unpacks in program creating method, also comprises:
By the ICD definition interfaces setting in advance, the ICD of storage is shown and/or revised.
In the embodiment of the present application, set in advance ICD definition interfaces, the ICD definition interfaces setting in advance by this, can show the ICD of storage, and user can also modify to the ICD showing in this ICD definition interfaces, so generation corresponding with amended ICD beat the program of unpacking.
The invention provides a kind of beating and unpack program creating method, first receive the ICD that includes at least one message of user's input, then respectively to every message definition bit field structure in ICD, and utilize beating of setting in advance to unpack function create-rule, generate and unpack function with corresponding the beating of each bit field structure respectively, finally utilize each bit field structure, to what generate, unpack function with corresponding the beating of each bit field structure respectively and compile, generate the program of unpacking of beating, in this process, by each message in the ICD of the user's input to receiving, define bit field structure, and finally according to the bit field structure of definition and beating of setting in advance unpack function create-rule automatically generation corresponding with this ICD beat the program of unpacking, make guaranteeing on the basis of system under test (SUT) ICD security, meet the versatility of beating the program of unpacking, improve the instant adaptation change ability of beating the program of unpacking.
Embodiment bis-:
A kind of method flow diagram to every message definition bit field structure in ICD respectively that Fig. 2 provides for the embodiment of the present application two.
As shown in Figure 2, the method comprises:
S201, every the message being respectively in ICD distribute a unique bit field structure title.
In the embodiment of the present application, in respectively to the process of every message definition bit field structure in ICD, first need to be respectively every the message comprising in this ICD and distribute a unique bit field structure title, preferably, the title of every the message comprising in the ICD of this user's input is unique, and the bit field structure title that is respectively every message distribution is identical with the title of its corresponding message.
S202, be respectively each variable-definition structure member in every message.
In the embodiment of the present application, every message in being respectively ICD distributes after a unique bit field structure title, also need to be respectively each variable-definition structure member included in every message, and the structure member Name to each variable-definition in every message is unique, each structure member's type determines by the message total length of the corresponding variable of this structure member place message, and each structure member's length is identical to the variable-length of dependent variable with this structure members.
In the embodiment of the present application, preferably, the title of every message in the ICD of the user's input receiving is unique, and the title of each variable in every message is unique, being respectively the structure member Name of each variable-definition in every message, is the title of this variable place message and the combination of this name variable.Below be only the optimal way of the embodiment of the present application, inventor can also be embodied as the unique process of structure title of each variable-definition in every message according to the demand of oneself by other any modes.
In the embodiment of the present application, preferred, when the message total length of certain message in the ICD receiving is less than or equal to 8 bit, the type that is respectively the defined structure member of each variable in this message is char type; When the message total length of certain message is greater than 8 bits, and while being less than or equal to 16 bit, the type that is respectively the defined structure member of each variable in this message is short type; When the message total length of certain message is greater than 16 bits, and while being less than or equal to 32 bit, the type that is respectively the defined structure member of each variable in this message is long type; When the message total length of certain message is greater than 32 bit, the type that is respectively the defined structure member of each variable in this message is long long type, below be only the optimal way of the embodiment of the present application, inventor can also be designed to arbitrarily structure member's the type of the variable-definition in message and the relation between the message total length of this message according to the demand of oneself.
What provide as shown in Figure 2 is a kind of respectively in the method flow diagram of every message definition bit field structure in ICD, further comprises:
S203, the zone definitions structure member who respectively variable in every message is not taken.
In the embodiment of the present application, the region that may exist the variable in this message not take in the included message of ICD that the user that receives sends, while there is the region (that is: having white space in this message) that variable do not take in certain message, the region respectively each variable in this message not being taken (that is: the white space of each in message) definition structure body member, wherein, preferably, the structure member Name of the zone definitions not taking for variable is null-n, wherein, n represents that the region that this variable does not take is the region which variable in this message does not take, the message total length of place, the region message that the structure member's of the zone definitions not taking for variable type is not taken by this variable determines, the length in the region that the structure member's of the zone definitions not taking for variable length does not take with this variable is identical.
The embodiment of the present application provides a kind of method to every message definition bit field structure in ICD respectively, by to detailed description and the introduction to the method for every message definition bit field structure in ICD respectively, to define the method for bit field structure more clear, complete for every the message in ICD unpacking in program creating method of beating that makes that the application provides.
Embodiment tri-:
A kind of structural representation that unpacks program creating device of beating that Fig. 3 provides for the embodiment of the present application three.
As shown in Figure 3, this device comprises: ICD receiving element 1, bit field structure definition unit 2, beat to unpack function generation unit 3 and beat and unpack program generation unit 4, wherein, ICD receiving element 1, bit field structure definition unit 2, beat to unpack function generation unit 3 and beat and unpack program generation unit 4 and be connected successively.
ICD receiving element 1 is mainly used in receiving the ICD that includes at least one message of user's input.
Bit field structure definition unit 2 is connected with ICD receiving element 1, and this bit field structure definition unit 2 is for every message definition bit field structure to this ICD respectively.
Beat and to unpack function generation unit 3 and be connected with bit field structure definition unit 2, this dozen unpacks function generation unit 3 for utilizing beating of setting in advance to unpack function create-rule, and generation unpacks function with corresponding the beating of each bit field structure respectively.
Beating the one end unpack program generation unit 4 is connected with bit field structure definition unit 2, the other end unpacks function generation unit 3 and is connected with beating, this dozen unpacks program generation unit 4 for utilizing each bit field structure, to what generate, unpack function respectively compile with corresponding the beating of each bit field structure, the program of unpacking is beaten in generation.
The invention provides a kind of beating and unpack program creating device, comprise ICD receiving element, bit field structure definition unit, beat to unpack function generation unit and beat and unpack program generation unit, first by ICD receiving element, receive the ICD that includes at least one message of user's input, then by bit field structure definition unit, respectively every message in ICD is defined to bit field structure, and unpack beating that the utilization of function generation unit sets in advance and unpack function create-rule by beating, generate and unpack function with corresponding the beating of each bit field structure respectively, finally by beating the program generation unit of unpacking, utilize each bit field structure, to what generate, unpack function with corresponding the beating of each bit field structure respectively and compile, generate the program of unpacking of beating, this device is by each message definition bit field structure in the ICD receiving, and finally according to the bit field structure of definition and beating of setting in advance unpack function create-rule automatically generation corresponding with this ICD beat the program of unpacking, make guaranteeing on the basis of system under test (SUT) ICD security, meet the versatility of beating the program of unpacking, improve the instant adaptation change ability of beating the program of unpacking.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part partly illustrates referring to method.
Below be only the application's preferred implementation, make those skilled in the art can understand or realize the application.To the multiple modification of these embodiment, will be apparent to one skilled in the art, General Principle as defined herein can be in the situation that do not depart from the application's spirit or scope, realization in other embodiments.Therefore, the application will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.