Realize the method that the running software time is determined under the single task running environment
Technical field
The present invention relates to a kind of weather data analysis treatment technology, especially a kind of data of utilizing wind profile radar to obtain are carried out the method that a series of processing obtain the high dimensional wind of accuracy rate afterwards, specifically a kind of method of utilizing wind profile radar to obtain dimensional wind.
Background technology
As everyone knows, in most software application field, it is the working time of coming metric software according to the poorest working time of the index of software.But at some the field of high reliability high security requirement is arranged, such as the control software in the fields such as Aero-Space, track traffic, nuclear power, more wish software under any normal service condition, the time of each run is a determined value.Cause the factor of running software time uncertainty to have a lot, seeing it mainly is that to walk the impact of different branched programs in when operation larger from the software angle, is the key of assurance equipment normal operation on software by the impact of the time operation of determining so overcome the branched program operation.
Summary of the invention
The objective of the invention is for being subject to branched program impact in the existing software running process so that equipment is difficult to all the time by the problem of the time operation of determining, invent and a kind ofly realize realizing the method that the running software time is definite under the single task running environment that master routine determines working time by branched program is controlled.
Technical scheme of the present invention is:
Realize the method that the running software time is determined under a kind of single task running environment, it is characterized in that it may further comprise the steps:
(1). write the function that meets functional requirement according to general programmed method;
(2). the outside input of clear and definite partition function, outside output (comprising the rewriting to global variable) and algorithm;
(3). for local variable is set up in outside output (comprising the global variable that may revise);
(4). find branch statements all in the function, such as if ... else, switch case etc.;
(5). for local variable is set up in the output of all branch statements;
(6). shear the program of all branches outside branch, but output all is revised as the local variable of branch's output;
(7). in branch, add branch's output local to the assignment statement of branch's operation result output with to the assignment statement of global variable;
(8). branch's operation result is added the down-stream computing;
(9). program is exported outside output local assignment at last to outside;
(10). by the function that calls in the step update routine of (2) to (9).
Beneficial effect of the present invention:
1. the present invention can make amended master routine in the situation that the target machine instruction set is determined, compiler is determined, do not used compile optimization, and the instruction number of running software is determined.
2. the inventive method is simple, is easy to realize, it can be independently or in conjunction with other the determinacy of programmed method assurance running software time.
3, as transmitting deterministic carrier, need not increase other passage will pass to target machine the working time of determining with function code in the present invention.In the situation that the target machine instruction set is determined, compiler is determined, do not used compile optimization, the instruction number of running software is determined; Instruction number in definite target machine MIPS(per second operation) also determine the working time of software after the index.
Embodiment
The present invention is further illustrated below in conjunction with embodiment.
Realize the method that the running software time is determined under a kind of single task running environment, it may further comprise the steps:
(1) writes the function that meets functional requirement and need to move by the time of determining according to general programmed method;
(2) outside of clear and definite partition function program input, outside output (comprising the rewriting to global variable) and algorithm;
(3) set up corresponding local variable for all outside outputs (comprising the global variable that to revise);
(4) find branch statements all in the program, such as if ... else, switch case etc.;
(5) be the local variable corresponding to output foundation of all branch statements;
(6) program of shearing all branches all is revised as the output of branched program the local variable of branched program output simultaneously outside branch;
(7) in branched program, add branch's output local to the assignment statement of branch's operation result output with to the assignment statement of global variable;
(8) branch's operation result is joined in the down-stream;
(9) program is exported outside output local assignment at last to outside;
(10) revise the function program that calls in the master routine by the step of (2) to (9).
The invention will be further described for following object lesson by a false code.
At first write out false code 1 according to functional requirement, determine that secondly the input in the false code 1 has Input1 and Input2, output that the global variable GlobalVar of Output and rewriting is arranged; The 3rd, for Output and GlobalVar set up local variable Local_Output and Local_GlobalVar; The 4th, find the branch statement if in the function ... else The 5th, for branch statement is set up output local Branch_Output1 and Branch_Output2; The 6th, shear the program of all branches outside branch and to branch's output variable assignment; The 7th, in branch, add local variable to the assignment statement of branch's operation result output with to the assignment statement of global variable; The 8th, add at last the assignment statement that branch's operation result outputs to outside output in program, revise the function ComplicatedOperate () that calls according to above step at last.With respect to false code 1 when the Input1 difference is walked different branch working time uncertain situation, the time of the software each run that false code 2 generates is determined.
False code 1:
int?GlobalVar;
void?Operator2(int?Input1,int?Input2,int?*Output)
{
int?localvar;
Code; // with the irrelevant code segment that does not also have branch of output
if?(Input1?==?55)
{
*Output?=?Input2;
GlobalVar?=?Input2;
}
else
{
ComplicatedOperate(Input2,?&localvar);
*Output?=?localvar;
}
}
False code 2:
int?GlobalVar;
void?Operator2(int?Input1,?int?Input2,?int?*Output)
{
int?Local_Output;
int?Local_GlobalVar;
int?Branch_Output1;
int?Branch_Output2;
int?localvar;
Code; // with the irrelevant code segment that does not also have branch of output
Branch_Output1?=?Input2;
Local_GlobalVar?=?Input2;
ComplicatedOperate(Input2,?&localvar);
Branch_Output2?=?localvar;
if?(Input1?==?55)
{
Local_Output?=?Branch_Output1;
GlobalVar?=?Local_GlobalVar;
}
else
{
Local_Output?=?Branch_Output2;
}
*Output?=?Local_Output;
}
The part that the present invention does not relate to all prior art that maybe can adopt same as the prior art is realized.