[go: up one dir, main page]

CN101957742B - Method for realizing definite software operating time in single task operating environment - Google Patents

Method for realizing definite software operating time in single task operating environment Download PDF

Info

Publication number
CN101957742B
CN101957742B CN 201010500287 CN201010500287A CN101957742B CN 101957742 B CN101957742 B CN 101957742B CN 201010500287 CN201010500287 CN 201010500287 CN 201010500287 A CN201010500287 A CN 201010500287A CN 101957742 B CN101957742 B CN 101957742B
Authority
CN
China
Prior art keywords
branch
output
local
external output
function
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 201010500287
Other languages
Chinese (zh)
Other versions
CN101957742A (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.)
Nanjing Enruite Industrial Co Ltd
Original Assignee
Nanjing Enruite Industrial Co Ltd
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 Nanjing Enruite Industrial Co Ltd filed Critical Nanjing Enruite Industrial Co Ltd
Priority to CN 201010500287 priority Critical patent/CN101957742B/en
Publication of CN101957742A publication Critical patent/CN101957742A/en
Application granted granted Critical
Publication of CN101957742B publication Critical patent/CN101957742B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

一种单任务运行环境下实现软件运行时间确定的方法,其特征是它包括(1)利用通用的编程方法编写符合功能要求的函数;(2)明确划分函数的外部输入、外部输出和算法;(3)为外部输出建立局部变量;(4)找到函数中所有的分支语句;(5)为所有分支语句的输出建立局部变量;(6)剪切所有分支的程序到分支外,将分支语句的输出均修改为分支输出的局部变量;(7)在分支中添加分支输出的局部变量到分支运算结果输出的赋值语句和对全局变量的赋值语句;(8)将分支运算结果加入后续程序运算;(9)最后将外部输出局部变量赋值到外部输出;(10)修改程序中调用到的函数即可。本发明能保证在输入不同路径不同的前提下同一个函数的运行时间确定不变。A method for determining the running time of software in a single-task operating environment, which is characterized in that it includes (1) using a general programming method to write a function that meets the functional requirements; (2) clearly dividing the external input, external output and algorithm of the function; (3) Create local variables for external output; (4) Find all branch statements in the function; (5) Create local variables for the output of all branch statements; (6) Cut all branch programs out of the branch, and branch statement The output of the branch is modified to the local variable of the branch output; (7) Add the local variable of the branch output to the assignment statement output by the branch operation result and the assignment statement to the global variable in the branch; (8) Add the branch operation result to the subsequent program operation ; (9) Finally, assign the external output local variable to the external output; (10) Modify the function called in the program. The invention can ensure that the running time of the same function is determined and unchanged under the premise of different input paths.

Description

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.

Claims (3)

1.一种单任务运行环境下实现软件运行时间确定的方法,其特征是它包括以下步骤: 1. A method for realizing software runtime determination under a single-task operating environment is characterized in that it comprises the following steps: (1)利用通用的编程方法编写符合功能要求的函数; (1) Use general programming methods to write functions that meet the functional requirements; (2)明确划分函数的外部输入、外部输出和算法; (2) Clearly divide the external input, external output and algorithm of the function; (3)为外部输出建立局部变量,并对外部输出局部变量进行赋值; (3) Create local variables for external output and assign values to external output local variables; (4)找到函数中所有的分支语句; (4) Find all branch statements in the function; (5)为所有分支语句的输出建立局部变量; (5) Create local variables for the output of all branch statements; (6)剪切所有分支的程序到分支外,将分支语句的输出均修改为分支输出的局部变量; (6) Cut the program of all branches to the outside of the branch, and modify the output of the branch statement to the local variable of the branch output; (7)在分支中添加分支输出的局部变量到分支运算结果输出的赋值语句,并添加将全局变量对应的局部变量的最终结果赋值到全局变量的赋值语句; (7) Add an assignment statement from the local variable output by the branch to the output of the branch operation result in the branch, and add an assignment statement that assigns the final result of the local variable corresponding to the global variable to the global variable; (8)将分支运算结果加入后续程序运算; (8) Add the branch operation result to the follow-up program operation; (9)最后将外部输出局部变量赋值到外部输出; (9) Finally, assign the external output local variable to the external output; (10)按照步骤(2)至(9)修改程序中所有调用到的函数即可达到软件运行时间确定的效果。 (10) Follow steps (2) to (9) to modify all the functions called in the program to achieve the effect of determining the running time of the software. 2.根据权利要求1所述的方法,其特征是所述的外部输出包括可能修改的全局变量。 2. The method according to claim 1, characterized in that said external output includes possibly modifiable global variables. 3.根据权利要求1所述的方法,其特征是所述的分支语句包括if…else,switch case。 3. The method according to claim 1, characterized in that said branch statement comprises if...else, switch case.
CN 201010500287 2010-10-09 2010-10-09 Method for realizing definite software operating time in single task operating environment Expired - Fee Related CN101957742B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010500287 CN101957742B (en) 2010-10-09 2010-10-09 Method for realizing definite software operating time in single task operating environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010500287 CN101957742B (en) 2010-10-09 2010-10-09 Method for realizing definite software operating time in single task operating environment

Publications (2)

Publication Number Publication Date
CN101957742A CN101957742A (en) 2011-01-26
CN101957742B true CN101957742B (en) 2013-01-09

Family

ID=43485087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010500287 Expired - Fee Related CN101957742B (en) 2010-10-09 2010-10-09 Method for realizing definite software operating time in single task operating environment

Country Status (1)

Country Link
CN (1) CN101957742B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933665B (en) * 2017-03-09 2020-06-26 中国科学技术大学 Methods for Predicting Running Time of MPI Programs

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5805894A (en) * 1995-02-13 1998-09-08 Kuck & Associates, Inc. Method inside an optimizing compiler for analyzing assertions and redirecting control flow in programs
US6834383B2 (en) * 2001-11-26 2004-12-21 Microsoft Corporation Method for binary-level branch reversal on computer architectures supporting predicated execution
CN1752934A (en) * 2004-09-22 2006-03-29 松下电器产业株式会社 Compiler, compiling method and compiling program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5805894A (en) * 1995-02-13 1998-09-08 Kuck & Associates, Inc. Method inside an optimizing compiler for analyzing assertions and redirecting control flow in programs
US6834383B2 (en) * 2001-11-26 2004-12-21 Microsoft Corporation Method for binary-level branch reversal on computer architectures supporting predicated execution
CN1752934A (en) * 2004-09-22 2006-03-29 松下电器产业株式会社 Compiler, compiling method and compiling program

Also Published As

Publication number Publication date
CN101957742A (en) 2011-01-26

Similar Documents

Publication Publication Date Title
Huber et al. The automated mapping of plans for plan recognition
Wang et al. {MAZE}: Towards automated heap feng shui
Zhu et al. Know the unknowns: Addressing disturbances and uncertainties in autonomous systems
RU2660614C2 (en) Method for executing tasks in critical real-time system
WO2009085118A3 (en) System and method for architecture-adaptable automatic parallelization of computing code
US8959498B2 (en) Parallelization method, system and program
ATE409326T1 (en) METHOD FOR OPTIMIZING THE LOGGING AND PLAYBACK OF MULTITASK APPLICATIONS IN A SINGLE-PROCESSOR OR MULTI-PROCESSOR COMPUTER SYSTEM
CN112487092B (en) Intelligent contract calling method and device based on blockchain
US8458679B2 (en) May-constant propagation
CN105607937B (en) A kind of hot patch method and apparatus
Pranger et al. TEMPEST-synthesis tool for reactive systems and shields in probabilistic environments
CN101957742B (en) Method for realizing definite software operating time in single task operating environment
CN113254068B (en) Control flow planarization automatic detection method and device
Tuncali et al. Automatic parallelization of Simulink models for multi-core architectures
Kim et al. Execution of natural language requirements using State Machines synthesised from Behavior Trees
US20240354221A1 (en) Build process for application performance
CN104299170A (en) Intermittent energy mass data processing method
Gall et al. Exchanging conflict resolution in an adaptable implementation of ACT-R
Beuche et al. Managing flexibility: Modeling binding-times in simulink
Dennis et al. Using agent JPF to build models for other model checkers
CN101615158A (en) A method for debugging a computer program
CN119902446B (en) Robot cluster scheduling method, device and equipment
Kubovy et al. A formal description of the ITIL change management process using abstract state machines
CN114217594B (en) Method, device, medium and equipment for testing robot scheduling system
Li et al. Research on Virtualization-Based and Intelligently Guided Fuzzing Method for Industrial Control Systems Abstract

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

Granted publication date: 20130109