CN103400013A - Reusable simulation model and development and using method thereof - Google Patents

Reusable simulation model and development and using method thereof Download PDF

Info

Publication number
CN103400013A
CN103400013A CN2013103537555A CN201310353755A CN103400013A CN 103400013 A CN103400013 A CN 103400013A CN 2013103537555 A CN2013103537555 A CN 2013103537555A CN 201310353755 A CN201310353755 A CN 201310353755A CN 103400013 A CN103400013 A CN 103400013A
Authority
CN
China
Prior art keywords
interface
model
state
simulation calculation
data
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.)
Granted
Application number
CN2013103537555A
Other languages
Chinese (zh)
Other versions
CN103400013B (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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201310353755.5A priority Critical patent/CN103400013B/en
Publication of CN103400013A publication Critical patent/CN103400013A/en
Application granted granted Critical
Publication of CN103400013B publication Critical patent/CN103400013B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a reusable simulation model and a development and a using method thereof. The reusable simulation model comprises a simulation computation module and seven categories of standard service interfaces, wherein the simulation computation module is the computer program realization of the simulated system, process or function; the seven categories of standard service interfaces comprises a model initialization interface, a model input interface, a model state recovery interface, a work parameter and state regulation interface, a model output interface, a model state acquisition interface, and a model solving interface; the reusable simulation model provides seven categories of standard service interfaces; as an independent service entity, the reusable simulation model exchange information with the outer environment only through the seven categories of standard service interfaces; degree of coupling among the models is small, the models are not bound with the simulation platform, and the reusing of the models among applications and among platforms and the fast development of the simulation application are promoted.

Description

A kind of reusable realistic model and exploitation and using method
Technical field
The present invention relates to the modeling and simulation technical field, be specifically related to a kind of reusable realistic model and exploitation and using method.
Background technology
Complication system emulation often comprises a large amount of entities; in entity, comprise again a plurality of models, and these models often relate to numerous specialties, need and numerous R&D institution cooperates; in order to protect the intellectual property, model is often submitted to the user with packaged actuating code form.Owing to lacking unified reusable Simulation Model Development standard and the guidance of development approach, interface disunity, the model coupling degree that causes the model of the exploitation of commensurate not outwards to provide be large, with the emulation platform binding closely, make the integrated difficulty of realistic model large, model reuses difficulty.Simultaneously, along with deepening continuously of Simulation Application, the complication system Solid simulation model presents that quantity is huge, of a great variety, the trend of mutual complexity; And, on the one hand, along with deepening continuously and the appearance of complication system ingredient new feature of people understanding, department pattern in the complication system Simulation Application often needs constantly perfect, even develop new model, this just requires the degree of coupling between the reduce model, reduces the impact of model modification on other model, to realize that zero of a large amount of other models are revised, reuses; On the other hand, people often wish that the Simulation model reuse that will develop has to other in analogue system that needs (as certain early warning radar model is applied in different operation simulating experimental systems), and this not only requires model coupling degree little, but also requires realistic model with emulation platform, not bind.
It is the important channel of improving Simulation Application system development efficiency that model is reused, after the Building of Simulation Model of Reuse-oriented, without or only need do a small amount of the modification and just can directly in new Simulation Application, reuse, thereby avoided the overlapping development of low level, improved the development efficiency of Simulation Application, in addition, the model of realizing based on the unified interface standard is also reused and will be brought following benefit [1]: (1) is encapsulated into the knowledge with domain-specific in Reusable Model, make in the process that builds Simulation Application, the application developer only need be integrated into these models in corresponding simulation frame, without the domain-specific knowledge that the concern model relates to, so just can reduce the exploitation threshold of Simulation Application; (2) by setting up corresponding model bank, Reusable Model is carried out to unified management, break the restriction of professional domain, realize sharing and reusing of each class model resource, reduce the development and maintenance cost of Simulation Application.
The research of reusing for model at present mainly comprises following direction:
1, based on the Reusable Model development approach of modeling language
Modeling language is special Simulation-Oriented Modeling and Design, its principle is normally modeling primitive by the copying modular design of specific area, the scheduling of emulation and control module are designed to emulator, bottom layer realization the automatic mapping function of modeling language to universal programming language.Modeling language has been realized separating of model and emulator, greatly reduces the modeling difficulty, has improved the reusability of realistic model.Yet, modeling language does not have field independence usually, as the ACSL language towards continuous system simulation, towards the GPSS language of discrete event system simulation, the Modelica language of multi-domain Oriented physical simulation etc., towards the multi-field Simulation Application of complication system the time, modeling language exists inborn deficiency [2].
2, based on the Reusable Model development approach of modeling standard
The simulation modeling standard is that realistic model has defined unified inner structure, behavior and external interface, makes realistic model after having developed, without or only need do a small amount of the modification and just can directly in new Simulation Application, reuse.Usually the simulation modeling standard does not limit concrete programming language and operation support platform, can build reusable realistic model be used to instructing.
Ou Hang office (ESA) has proposed the realistic model of Reuse-oriented and has described standard SMP2(Simulation ModelPortability Standards2 in 2004) [3].The purpose of SMP2 standard is to provide a model development framework, and, cross-platform reuse independent with the platform of realizing realistic model adopt the thought of component-based to support the modularization of realistic model and service of simulation to design.But SMP2 standard abstraction hierarchy is higher, is not suitable for the exploitation of guiding function level, low level realistic model.
Arizona State University Zeigler professor has proposed parallel discrete event system modularization modeling standard PDEVS(Parallel Discrete Event System Specifications in 2000) [4].PDEVS comprises atomic model and two normal forms of coupling model.The atomic model normal form stipulates how to grow out of nothing the structure minimodel, and how coupling model normal form regulation utilizes the larger model of structure of existing atomic model or coupling model hierarchy type.But because the PDEVS standard is too complicated, and the event handling logic of atomic model is too concentrated, and operational efficiency is undesirable, therefore up to the present by industry, is not accepted extensively.
3, based on the Reusable Model development approach of modeling environment
The simulation modeling environment provides operation support platform for reusable realistic model, and the modeling personnel can take full advantage of the characteristics of platform, builds the reusable realistic model of simulation modeling environment inside.Yet due to the binding of the platform with concrete, its scope of reusing is usually limited based on the Reusable Model of simulation modeling environment.
The JSIMS system of one of U.S. army's associative simulation three large projects provides a series of support facilities, and wherein, common component simulation engine CCSE provides the core support service for the comprehensive battlefield surroundings of JSIMS [5].CCSE has used for reference the assembly type idea about modeling, provides entity and assembly two kinds of base class, for the component model of User Exploitation oneself, in entity, assembly is assembled, and then is applied in the simulation frame of CCSE and goes.But there is efficiency in the communication mode that in the CCSE modeling framework, inter-module is announced the order formula, and its modeling pattern also with its emulation platform binding, the model between supporting platform is not reused.
HLA is proposed by modeling and simulating office of U.S. Department of Defense (DoD), is intended to solve the interoperability between numerous Heterogeneous simulation systems and reuses problem.But the practice effect of HLA aspect reusing is unsatisfactory, and main manifestations is as follows [6]:
(1) granularity of reusing is excessively thick.What HLA supported reuses granularity at analogue system or emulation member of an alliance level, is difficult to meet the demand that the level inner model is reused.
(2) HLA itself does not solve model reusability problem.For this reason, SISO has proposed basic object Model B OM, attempts to make up HLA in the deficiency of reusing in support.But BOM is mainly used in the modeling of facing assembly model, and the support on unified model interface specification and Reusable Model development approach still needs to strengthen.
In a word, aspect reusable Simulation Model Development, not yet forming unified standard both at home and abroad, and existing reusable Simulation Model Development method otherwise not between supporting platform model reuse, be not suitable for the exploitation of the grade simulated solid model of guiding function, be difficult to model between the distribution Efficient Development of implementation model and platform and reuse the fast Development with Simulation Application.Therefore, little in the urgent need to a kind of model coupling degree and do not deposit reusable realistic model and the development approach thereof of binding with emulation platform.
Above-mentioned each document source of quoting is as follows:
[1]Stewart?Robinson,Richard?E.Nance,Ray?J.Paul,Michael?Pidd,Simon?J.E.Taylor.Simulation?Model?Reuse:Definitions,Benefits?and?Obstacles[J].Simulation?Modeling?Practice?and?Theory12(2004)479-494.
[2] Wang Weiping, Lei Yonglin, Zhu Yifan. based on the reusable Simulation model representation method research of meta-model, Computer Simulation, 2007,24 (8): 93-97.
[3]ESA.SMP2.0Handbook[Z].Paris,France:European?Space?Agency,2005.
[4]B.P.Zeigler,H.Praehofer,and?T.G.Kim,Theory?of?Modeling?and?Simulation[M].San?Diego?USA:Academic?Press,2000.
[5]Maria?Valinski,Jonathan?Driscoll.Providing?a?Parallel?and?Distributed?Capability?for?JMASS?using?SPEEDES[C].Proceedings?of?SPIE2002.2002:88-98.
[6] Gong Jianxing, Wang Da, Qiu Xiaogang, the reusability research [J] of model in yellow Ke Di .HLA federal member. Journal of System Simulation, 2005.
Summary of the invention
Problem for the prior art existence, the object of the present invention is to provide a kind of reusable realistic model and development approach thereof, described reusable realistic model outwards provides seven class standard service interfaces, and described reusable realistic model is as a service entities independently, the sole mode that carries out information interaction with the external world is exactly to realize by described seven class standard service interfaces, thereby, model coupling degree is little and do not deposit binding with emulation platform, and then, promote between application and between platform model reuse the fast Development with Simulation Application.
A kind of reusable realistic model provided by the invention, is characterized in that, it comprises Simulation Calculation and seven class standard service interfaces, and wherein, described Simulation Calculation refers to the computer program realization of simulated system, process or function; Described seven class standard service interfaces comprise that specifically model initialization interface, model state restoration interface, running parameter and state adjustment interface, mode input interface, model resolve interface, model state obtains interface and model output interface, above-mentioned each interface consists of the interface function of one or more heavy duties respectively, the total interface function can call by SNNP, wherein
Described model initialization interface is according to the described Simulation Calculation of data initialization in corresponding interface parameters;
Described model state restoration interface is in order to the state of the recovering state by described Simulation Calculation to the interface parameters appointment;
Described running parameter and state are adjusted interface, according to the data in corresponding interface parameters, described Simulation Calculation running parameter and state are set;
Described mode input interface arranges the input parameter of described Simulation Calculation according to the data in corresponding interface parameters;
Described model resolves interface in order to call described Simulation Calculation, makes described Simulation Calculation according to given simulation time, resolve the value in the corresponding moment;
Described model state obtains interface in order to obtain the state of current described Simulation Calculation, and status data is kept in interface parameters;
Described model output interface is in order to from output buffer, to read the output data of Simulation Calculation, and is corresponding export structure element assignment;
Described reusable realistic model is as a service entities independently, and the sole mode that carries out information interaction with the external world is exactly to realize by described seven class standard service interfaces.
Particularly, the citation form of described model initialization interface is as follows:
Int CXXModel::Initialize (InitStructType1*pScenarioData1) or intCXXModel::Initialize (Vector<InitStructType2* > * pScenarioData2); Wherein, interface parameters is that model initialization data structure body pointer or element are the pointer of the Vector type of structure pointer, InitStructType1, InitStructType2 ... the self-defining structured data type in model development side, pScenarioData1, pScenarioData2 ... the value that has comprised initialized all state variables of Simulation Calculation needs and property parameters.
Particularly, the citation form of described model state restoration interface is as follows:
Int CXXModel::SetSimuStatus (string& SimuStatus); Wherein, interface parameters SimuStatus is the binary stream that the Simulation Calculation state is corresponding.
Particularly, described running parameter and state adjustment interface citation form are:
Int CXXModel::SetWorkingPara (WorkingStructType1*pWorking Data1) or int CXXModel::SetWorkingPara (Vector<WorkingStructType2* > * pWorkingData2); Wherein, interface parameters is the pointer of structured fingers or the Vector type that element is the structure pointer of model running parameter and status data, WorkingStructTypeX is the self-defining structured data type in model development side, and pWorkingDataX has comprised running parameter that Simulation Calculation need to arrange and the value of state variable.
Particularly, the citation form of described mode input interface is as follows:
Int CXXModel::SetInputData (InputStructType1*pInputData1) or int CXXModel::SetInputData (Vector<InputStructType2* > * pInputData2); Wherein, interface parameters is the structured fingers of input data or the pointer of the Vector type that element is the structure pointer, InputStructTypeX is the self-defining structured data type in model development side, and pInputDataX has comprised the input data that Simulation Calculation need to arrange.
Particularly, it is as follows that described model resolves the citation form of interface:
Int CXXModel::ModelProcess (double dSimuTime); Wherein, interface parameters is the given simulation time of dispatching party.
Particularly, it is as follows that described model state obtains the citation form of interface:
Int CXXModel::GetSimuStatus (string& SimuStatus); Wherein, interface parameters SimuStatus is the binary stream that the Simulation Calculation state is corresponding.
Particularly, the citation form of described model output interface is as follows:
Int CXXModel::GetOutputData (OutputStructType1*pOutputData1) or int CXXModel::GetOutputData (Vector<OutputStructType2* > * pOutputData2); Wherein, interface parameters is the structured fingers of output data or the pointer of the Vector type that element is the structure pointer, OutputStructTypeX is the self-defining structured data type in model development side, and pOutputDataX has comprised the data that Simulation Calculation need to be exported.
The present invention also provides a kind of development approach of reusable realistic model, and it comprises the following steps:
Step S91, Simulation Calculation are obtained: obtain the Simulation Calculation that model development side provides;
Step S92, model initialization interface encapsulation: described model initialization interface is according to the described Simulation Calculation of data initialization in corresponding interface parameters;
Step S93, the encapsulation of model state restoration interface: described model state restoration interface is by the state of the recovering state of described Simulation Calculation to the interface parameters appointment;
Step S94, running parameter and state are adjusted interface encapsulation: described running parameter and state are adjusted interface, according to the data in corresponding interface parameters, described Simulation Calculation running parameter and state are set;
Step S95, mode input interface encapsulation: described mode input interface arranges the input parameter of described Simulation Calculation according to the data in corresponding interface parameters;
Step S96, model resolve interface encapsulation: described model resolves interface in order to call described Simulation Calculation, makes described Simulation Calculation according to given simulation time, resolve the value in the corresponding moment;
Step S97, model state obtain interface encapsulation: described model state obtains interface in order to obtain the state of current described Simulation Calculation, and status data is kept in interface parameters;
The encapsulation of step S98, model output interface: described model output interface is in order to from output buffer, to read the output data of Simulation Calculation, and is corresponding export structure element assignment.
The present invention also provides a kind of using method of reusable realistic model, and it comprises the following steps:
Step S01, model initialization: described model initialization interface obtains the value of all elements in the structure that structure pointer that dispatching party imports into is corresponding, to attribute and the state variable initialize of described Simulation Calculation;
Step S02, model state setting: before the described Simulation Calculation of scheduling was resolved, described model state restoration interface recovered the state of the described Simulation Calculation under current simulation time;
Step S03, running parameter and state adjustment: for meeting the dynamic running parameter of described Simulation Calculation and the demand of state adjusted, before the described model solution of scheduling is calculated interface, described running parameter and state are adjusted interface according to adjusting instruction, and running parameter and the state of described Simulation Calculation are set according to the supplemental characteristic that dispatching party provides;
Step S04, mode input data arrange: described mode input interface carries out assignment according to the data in corresponding interface parameters to the input variable of Simulation Calculation;
Step S05, model resolve operation: after described mode input interface carried out assignment to the input variable of Simulation Calculation, described Simulation Calculation, according to the currency of variable and the simulation time of dispatching party appointment, was carried out corresponding model calculating;
Step S06, model state obtain: for meeting the needs of optimistic synchronization mechanism recovering state, after the described Simulation Calculation of scheduling is resolved, need to preserve the state of the described Simulation Calculation under current simulation time;
Step S07, model output data acquisition: after model resolved and is finished, various output data were kept in output buffer, call the model output interface and can read Simulation Calculation output data from output buffer.
Based on disclosing of above technical scheme, the present invention possesses following beneficial effect:
A kind of reusable realistic model provided by the invention, it comprises Simulation Calculation and seven class standard service interfaces, wherein, described Simulation Calculation refers to the computer program realization of simulated system, process or function; Described seven class standard service interfaces comprise that specifically model initialization interface, mode input interface, model state restoration interface, running parameter and state are adjusted interface, model output interface, model state obtains interface and model resolves interface; Described reusable realistic model outwards provides seven class standard service interfaces, and described reusable realistic model is as a service entities independently, the sole mode that carries out information interaction with the external world is exactly to realize by described seven class standard service interfaces, thereby, model coupling degree is little and with emulation platform, do not deposit the problems such as binding, and then, promote between application and between platform model reuse the fast Development with Simulation Application.
The accompanying drawing explanation
Fig. 1 is the structured flowchart of reusable realistic model provided by the invention;
Fig. 2 is the general flow chart of the using method of reusable realistic model provided by the invention.
The drawing reference numeral explanation
Reusable realistic model 100
Simulation Calculation 1
Model initialization interface 2
Model state restoration interface 3
Running parameter and state are adjusted interface 4
Mode input interface 5
Model resolves interface 6
Model state obtains interface 7
Model output interface 8
Embodiment
Below in conjunction with accompanying drawing and by embodiment, further illustrate technical scheme of the present invention:
Problem for the prior art existence, the object of the present invention is to provide a kind of reusable realistic model and development approach thereof, described reusable realistic model 100 outwards provides seven class standard service interfaces, and described reusable realistic model 100 is as a service entities independently, the sole mode that carries out information interaction with the external world is exactly to realize by described seven class standard service interfaces, thereby, model coupling degree is little and with emulation platform, do not deposit the problems such as binding, and then, promote between application and between platform model reuse the fast Development with Simulation Application.
Refer to Fig. 1, a kind of reusable realistic model 100 provided by the invention, it comprises Simulation Calculation 1 and seven class standard service interfaces, wherein, described Simulation Calculation 1 refers to the computer program realization of simulated system, process or function; Described seven class standard service interfaces comprise that specifically model initialization interface 2, model state restoration interface 3, running parameter and state adjustment interface 4, mode input interface 5, model resolve interface 6, model state obtains interface 7 and model output interface 8, each interface consists of the interface function of one or more heavy duties, and the total interface function can call by SNNP.
Described model initialization interface 2 carrys out the described Simulation Calculation 1 of initialization according to the data of obtaining in corresponding interface parameters, and its citation form is as follows:
Int CXXModel::Initialize (InitStructType1*pScenarioData1) or intCXXModel::Initialize (Vector<InitStructType2* > * pScenarioData2); Wherein, interface parameters is that model initialization data structure body pointer or element are the pointer of the Vector type of structure pointer, InitStructType1, InitStructType2 ... the self-defining structured data type in model development side, pScenarioData1, pScenarioData2 ... the value that has comprised initialized all state variables of Simulation Calculation needs and property parameters.
Before calling the Initialize function, by the dispatching party program, adopt InitStructTypeX* type or Vector<InitStructTypeX* > * type definition pScenarioDataX pointer variable, and apply for corresponding storage space, then resolve the simulation scenario file, obtaining the relevant data that prefer is structure element assignment corresponding to this pointer variable.Rreturn value represents the result that model initialization interface 2 is carried out, wherein 1 expression initialization success, 0 expression initialization failure.Dispatching party may need to dispatch Initialize many times with the structure to dissimilar (different parameter) initialize.
Described model state restoration interface 3 is in order to the state of the recovering state by described Simulation Calculation 1 to interface parameters (binary stream) appointment, and its citation form of tool is as follows:
Int CXXModel::SetSimuStatus (string& SimuStatus); Wherein, interface parameters SimuStatus is binary stream corresponding to Simulation Calculation 1 state.Rreturn value represents the result that model state restoration interface 3 is carried out, and 1 for running succeeded, and 0 for to carry out unsuccessfully.When content in SimuStatus is sky (calling for the first time), what SetSimuStatus operates and do not do, and returns immediately.
Described running parameter and state are adjusted interface 4, according to the data of corresponding interface parameters, described Simulation Calculation 1 running parameter and state are set, and its citation form of tool is as follows:
Int CXXModel::SetWorkingPara (WorkingStructType1*pWorking Data1) or int CXXModel::SetWorkingPara (Vector<WorkingStructType2* > * pWorkingData2); Wherein, interface parameters is the pointer of structured fingers or the Vector type that element is the structure pointer of model running parameter and status data, WorkingStructTypeX is the self-defining structured data type in model development side, and pWorkingDataX has comprised running parameter that model need to arrange and the value of state variable.
Before calling the SetWorkingPara function, by dispatching party, adopt WorkingStructTypeX* type or Vector<WorkingStructTypeX* > * type definition pointer variable pWorkingData X, and apply for being structure element assignment corresponding to these pointer variables by corresponding storage space.Rreturn value represents the execution result of running parameter and state adjustment interface 4, and 1 for running succeeded, and 0 for to carry out unsuccessfully.
Described mode input interface 5 arranges the input parameter of described Simulation Calculation 1 according to the data in corresponding interface parameters, its citation form is as follows:
Int CXXModel::SetInputData (InputStructType1*pInputData1) or int CXXModel::SetInputData (Vector<InputStructType2* > * pInputData2); Wherein, interface parameters is the structured fingers of input data or the pointer of the Vector type that element is the structure pointer, InputStructTypeX is the self-defining structured data type in model development side, and pInputDataX has comprised the input data that model need to arrange.
Before calling the SetInputData function, by dispatching party, adopt InputStructTypeX* type or Vector<InputStructTypeX* > * type definition pointer variable pInputDataX, and apply for being structure element assignment corresponding to these pointer variables by corresponding storage space.Rreturn value represents the execution result of mode input interface 5, and 1 for running succeeded, and 0 for to carry out unsuccessfully.Dispatching party may need to dispatch SetInputData many times with to different input parameter assignment.
Described model resolves interface 6 in order to call described Simulation Calculation 1, makes described Simulation Calculation 1 according to given simulation time, resolve the value in the corresponding moment, and its citation form is as follows:
Int CXXModel::ModelProcess (double dSimuTime); Wherein, interface parameters is the given simulation time of dispatching party.Rreturn value represents that model resolves the execution result of interface 6, and wherein 1 expression runs succeeded, and 0 expression is carried out unsuccessfully.Possible scheduling mode is: ModelProcess (dSimuTime+L).
Described model state obtains interface 7 in order to obtain the state of current described Simulation Calculation 1, and status data is kept in interface parameters (binary stream), and its citation form is as follows:
Int CXXModel::GetSimuStatus (string& SimuStatus); Wherein, interface parameters SimuStatus is the simulation status binary stream.Rreturn value is expressed as the execution result that model state obtains interface 7, and 1 for running succeeded, and 0 for to carry out unsuccessfully.
Described model output interface 8 is in order to from output buffer, to read the output data of Simulation Calculation, and is corresponding export structure element assignment, and its citation form is as follows:
Int CXXModel::GetOutputData (OutputStructType1*pOutputData1) or int CXXModel::GetOutputData (Vector<OutputStructType2* > * pOutputData2); Wherein, interface parameters is the structured fingers of output data or the pointer of the Vector type that element is the structure pointer, OutputStructTypeX is the self-defining structured data type in model development side, and pOutputDataX has comprised the data that Simulation Calculation need to be exported.
Before calling the GetOutputData function, by the dispatching party program, adopt OutputStruct TypeX* type or Vector<OutputStructTypeX* > * type definition pointer variable pOutput DataX.Rreturn value represents the execution result of model output interface 8, and wherein 1 expression has data, the countless certificates of 0 expression.The data that comprised the Simulation Calculation output of user's needs in pOutputDataX.Dispatching party may need to dispatch GetOutputData many times to obtain different output data.
Refer to Fig. 1, the invention provides a kind of development approach of reusable realistic model, it comprises the following steps:
Step S91, Simulation Calculation are obtained: obtain the Simulation Calculation that model development side provides;
Step S92, model initialization interface encapsulation: described model initialization interface is according to the described Simulation Calculation of data initialization in corresponding interface parameters;
Step S93, the encapsulation of model state restoration interface: described model state restoration interface is by the state of the recovering state of described Simulation Calculation to the interface parameters appointment;
Step S94, running parameter and state are adjusted interface encapsulation: described running parameter and state are adjusted interface, according to the data in corresponding interface parameters, described Simulation Calculation running parameter and state are set;
Step S95, mode input interface encapsulation: described mode input interface arranges the input parameter of described Simulation Calculation according to the data in corresponding interface parameters;
Step S96, model resolve interface encapsulation: described model resolves interface in order to call described Simulation Calculation, makes described Simulation Calculation according to given simulation time, resolve the value in the corresponding moment;
Step S97, model state obtain interface encapsulation: described model state obtains interface in order to obtain the state of current described Simulation Calculation, and status data is kept in interface parameters;
The encapsulation of step S98, model output interface: described model output interface is in order to from output buffer, to read the output data of Simulation Calculation, and is corresponding export structure element assignment.
Refer to Fig. 1 and Fig. 2, the development approach of a kind of reusable realistic model provided by the invention, it comprises the following steps:
Step S01, model initialization: described model initialization interface 2 obtains the value of all elements in the structure that structure pointer that dispatching party imports into is corresponding, to attribute and the state variable initialize of described Simulation Calculation 1;
Step S02, model state setting: before the described Simulation Calculation 1 of scheduling is resolved, described model state restoration interface 3 recovers the state of the described Simulation Calculation 1 under current simulation time, the status data of the binary stream form that namely provides according to dispatching party, by the state of the recovering state of described Simulation Calculation 1 to the binary stream appointment;
Step S03, running parameter and state adjustment: for meeting the dynamic running parameter of described Simulation Calculation 1 and the demand of state adjusted, before the described scheduling model of scheduling resolves interface 6, described running parameter and state are adjusted interface 4 according to adjusting instruction, and running parameter and the state of described Simulation Calculation 1 are set according to the supplemental characteristic that dispatching party provides;
Step S04, mode input data arrange: described mode input interface 5 carries out assignment according to the data in corresponding interface parameters to the input variable of Simulation Calculation 1;
Step S05, model resolve operation: after the input variable of 5 pairs of Simulation Calculation 1 of described mode input interface was carried out assignment, described Simulation Calculation 1, according to the currency of variable and the simulation time of dispatching party appointment, was carried out corresponding model calculating;
Step S06, model state obtain: for meeting the needs of optimistic synchronization mechanism recovering state, after the described Simulation Calculation 1 of scheduling is resolved, need to preserve the state of the described Simulation Calculation 1 under current simulation time;
Step S07, model output data acquisition: after model resolved and is finished, various output data were kept in output buffer, call model output interface 8 and can read the output data from output buffer.
In order to understand better the present invention, below in conjunction with specific embodiment, be described further.The present embodiment is based on standard C ++ and the reusable realistic model of the weaponry of language is example, has described performance history and the code structure of such reusable realistic model.Seven external service interface methods of the reusable realistic model definition of weaponry all are defined as empty method in base class CSimuModel, in concrete realistic model class CXXModel, rewrite and realize corresponding function, and the base class of reusable realistic model is described below:
Figure BDA00003666620700161
The reusable realistic model class of weaponry CXXModel inherits from emulation basic model class CSimuModel, user's heavily loaded service interface in the CXXModel class also defines the member variable of oneself, power function etc., with the auxiliary logical process function that realizes the external service interface, concrete realistic model class description example is as follows:
Figure BDA00003666620700171
Based on disclosing of above technical scheme, the present invention possesses following beneficial effect:
A kind of reusable realistic model 100 provided by the invention, it comprises Simulation Calculation 1 and seven class standard service interfaces, wherein, described Simulation Calculation 1 refers to the computer program realization of simulated system, process or function; Described seven class standard service interfaces comprise that specifically model initialization interface 2, mode input interface 5, model state restoration interface 3, running parameter and state are adjusted interface 4, model output interface 8, model state obtains interface 7 and model resolves interface 6; Described reusable realistic model 100 outwards provides seven class standard service interfaces, and described reusable realistic model 100 is as a service entities independently, the sole mode that carries out information interaction with the external world is exactly to realize by described seven class standard service interfaces, thereby, model coupling degree is little and with emulation platform, do not deposit the problems such as binding, and then, promote between application and between platform model repeat to call the fast Development with Simulation Application.
The above has carried out exemplary description to the present invention by reference to the accompanying drawings; obvious realization of the present invention is not subject to the restrictions described above; as long as the various improvement of having adopted method design of the present invention and technical scheme to carry out; or without improving, design of the present invention and technical scheme are directly applied to other occasion, all in protection scope of the present invention.

Claims (10)

1. a reusable realistic model, is characterized in that, it comprises Simulation Calculation and seven class standard service interfaces, and wherein, described Simulation Calculation refers to the computer program realization of simulated system, process or function; Described seven class standard service interfaces comprise that specifically model initialization interface, model state restoration interface, running parameter and state adjustment interface, mode input interface, model resolve interface, model state obtains interface and model output interface, above-mentioned each interface consists of the interface function of one or more heavy duties respectively, the total interface function can call by SNNP, wherein
Described model initialization interface is according to the described Simulation Calculation of data initialization in corresponding interface parameters;
Described model state restoration interface is in order to the state of the recovering state by described Simulation Calculation to the interface parameters appointment;
Described running parameter and state are adjusted interface, according to the data in corresponding interface parameters, described Simulation Calculation running parameter and state are set;
Described mode input interface arranges the input parameter of described Simulation Calculation according to the data in corresponding interface parameters;
Described model resolves interface in order to call described Simulation Calculation, makes described Simulation Calculation according to given simulation time, resolve the value in the corresponding moment;
Described model state obtains interface in order to obtain the state of current described Simulation Calculation, and status data is kept in interface parameters;
Described model output interface is in order to from output buffer, to read the output data of Simulation Calculation, and is corresponding export structure element assignment;
Described reusable realistic model is as a service entities independently, and the sole mode that carries out information interaction with the external world is exactly to realize by described seven class standard service interfaces.
2. reusable realistic model according to claim 1, is characterized in that, the citation form of described model initialization interface is as follows:
Int CXXModel::Initialize (InitStructType1*pScenarioData1) or intCXXModel::Initialize (Vector<InitStructType2* > * pScenarioData2); Wherein, interface parameters is that model initialization data structure body pointer or element are the pointer of the Vector type of structure pointer, InitStructType1, InitStructType2 are the self-defining structured data types in model development side, and pScenarioData1, pScenarioData2 have comprised the value of initialized all state variables of Simulation Calculation needs and property parameters.
3. reusable realistic model according to claim 1, is characterized in that, the citation form of described model state restoration interface is as follows:
Int CXXModel::SetSimuStatus (string& SimuStatus); Wherein, interface parameters SimuStatus is the binary stream that the Simulation Calculation state is corresponding.
4. reusable realistic model according to claim 1, is characterized in that, described running parameter and state are adjusted the interface citation form and be:
Int CXXModel::SetWorkingPara (WorkingStructType1*pWorking Data1) or int CXXModel::SetWorkingPara (Vector<WorkingStructType2* > * pWorkingData2); Wherein, interface parameters is the pointer of structured fingers or the Vector type that element is the structure pointer of model running parameter and status data, WorkingStructTypeX is the self-defining structured data type in model development side, and pWorkingDataX has comprised running parameter that Simulation Calculation need to arrange and the value of state variable.
5. reusable realistic model according to claim 1, is characterized in that, the citation form of described mode input interface is as follows:
Int CXXModel::SetInputData (InputStructType1*pInputData1) or int CXXModel::SetInputData (Vector<InputStructType2* > * pInputData2); Wherein, interface parameters is the structured fingers of input data or the pointer of the Vector type that element is the structure pointer, InputStructTypeX is the self-defining structured data type in model development side, and pInputDataX has comprised the input data that Simulation Calculation need to arrange.
6. reusable realistic model according to claim 1, is characterized in that, it is as follows that described model resolves the citation form of interface:
Int CXXModel::ModelProcess (double dSimuTime); Wherein, interface parameters is the given simulation time of dispatching party.
7. reusable realistic model according to claim 1, is characterized in that, it is as follows that described model state obtains the citation form of interface:
Int CXXModel::GetSimuStatus (string& SimuStatus); Wherein, interface parameters SimuStatus is the binary stream that the Simulation Calculation state is corresponding.
8. reusable realistic model according to claim 1, is characterized in that, the citation form of described model output interface is as follows:
Int CXXModel::GetOutputData (OutputStructType1*pOutputData1) or int CXXModel::GetOutputData (Vector<OutputStructType2* > * pOutputData2); Wherein, interface parameters is the structured fingers of output data or the pointer of the Vector type that element is the structure pointer, OutputStructTypeX is the self-defining structured data type in model development side, and pOutputDataX has comprised the data that Simulation Calculation need to be exported.
One kind as arbitrary as claim 1 to 8 as described in the development approach of reusable realistic model, it is characterized in that, it comprises the following steps:
Step S91, Simulation Calculation are obtained: obtain the Simulation Calculation that model development side provides;
Step S92, model initialization interface encapsulation: described model initialization interface is according to the described Simulation Calculation of data initialization in corresponding interface parameters;
Step S93, the encapsulation of model state restoration interface: described model state restoration interface is by the state of the recovering state of described Simulation Calculation to the interface parameters appointment;
Step S94, running parameter and state are adjusted interface encapsulation: described running parameter and state are adjusted interface, according to the data in corresponding interface parameters, described Simulation Calculation running parameter and state are set;
Step S95, mode input interface encapsulation: described mode input interface arranges the input parameter of described Simulation Calculation according to the data in corresponding interface parameters;
Step S96, model resolve interface encapsulation: described model resolves interface in order to call described Simulation Calculation, makes described Simulation Calculation according to given simulation time, resolve the value in the corresponding moment;
Step S97, model state obtain interface encapsulation: described model state obtains interface in order to obtain the state of current described Simulation Calculation, and status data is kept in interface parameters;
The encapsulation of step S98, model output interface: described model output interface is in order to from output buffer, to read the output data of Simulation Calculation, and is corresponding export structure element assignment.
One kind as arbitrary as claim 1 to 8 as described in the using method of reusable realistic model, it is characterized in that, it comprises the following steps:
Step S01, model initialization: described model initialization interface obtains the value of all elements in the structure that structure pointer that dispatching party imports into is corresponding, to attribute and the state variable initialize of described Simulation Calculation;
Step S02, model state setting: before the described Simulation Calculation of scheduling was resolved, described model state restoration interface recovered the state of the described Simulation Calculation under current simulation time;
Step S03, running parameter and state adjustment: for meeting the dynamic running parameter of described Simulation Calculation and the demand of state adjusted, before the described model solution of scheduling is calculated interface, described running parameter and state are adjusted interface according to adjusting instruction, and running parameter and the state of described Simulation Calculation are set according to the supplemental characteristic that dispatching party provides;
Step S04, mode input data arrange: described mode input interface carries out assignment according to the data in corresponding interface parameters to the input variable of Simulation Calculation;
Step S05, model resolve operation: after described mode input interface carried out assignment to the input variable of Simulation Calculation, described Simulation Calculation, according to the currency of variable and the simulation time of dispatching party appointment, was carried out corresponding model calculating;
Step S106, model state obtain: for meeting the needs of optimistic synchronization mechanism recovering state, after the described Simulation Calculation of scheduling is resolved, need to preserve the state of the described Simulation Calculation under current simulation time;
Step S07, model output data acquisition: after model resolved and is finished, various output data were kept in output buffer, call the model output interface and can read Simulation Calculation output data from output buffer.
CN201310353755.5A 2013-08-14 2013-08-14 A kind of reusable realistic model and exploitation thereof and using method Active CN103400013B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310353755.5A CN103400013B (en) 2013-08-14 2013-08-14 A kind of reusable realistic model and exploitation thereof and using method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310353755.5A CN103400013B (en) 2013-08-14 2013-08-14 A kind of reusable realistic model and exploitation thereof and using method

Publications (2)

Publication Number Publication Date
CN103400013A true CN103400013A (en) 2013-11-20
CN103400013B CN103400013B (en) 2016-01-13

Family

ID=49563641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310353755.5A Active CN103400013B (en) 2013-08-14 2013-08-14 A kind of reusable realistic model and exploitation thereof and using method

Country Status (1)

Country Link
CN (1) CN103400013B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268346A (en) * 2014-09-30 2015-01-07 中国人民解放军国防科学技术大学 Implementation method for simulation application of visual integrated environment on basis of object class interaction diagrams
CN105068858A (en) * 2015-07-29 2015-11-18 北京世冠金洋科技发展有限公司 Multi-source heterogeneous system emulation method and apparatus
CN106202681A (en) * 2016-07-04 2016-12-07 北京空间飞行器总体设计部 Reusable satellite power supply energy balance analogue system and modeling method thereof
CN106777450A (en) * 2016-11-04 2017-05-31 中软信息系统工程有限公司 A kind of model for supporting built-up pattern is described and generation method
CN107832551A (en) * 2017-11-24 2018-03-23 北京宇航系统工程研究所 A kind of modularization Architecture simulation system and method towards Space Equipment
CN108648086A (en) * 2018-05-22 2018-10-12 中国银行股份有限公司 A kind of finance quantization transaction processing method and device
CN109542827A (en) * 2019-01-25 2019-03-29 上海创景信息科技有限公司 General purpose simulation, system and medium based on model
CN109669671A (en) * 2018-12-07 2019-04-23 中国人民解放军国防科技大学 Multi-level self-adaptive method based on micro-service
CN111124790A (en) * 2019-12-06 2020-05-08 北京京航计算通讯研究所 Generation system of reusable simulation interface model
CN111124897A (en) * 2019-12-06 2020-05-08 北京京航计算通讯研究所 Method for generating reusable simulation interface model
CN112433806A (en) * 2020-10-19 2021-03-02 湖南和信智仿信息科技有限公司 Computing model structure and scheduling execution method for cloud simulation service
CN112559643A (en) * 2020-12-21 2021-03-26 北京仿真中心 Simulation entity model description method
CN112988147A (en) * 2021-03-17 2021-06-18 南京仁谷系统集成有限公司 Cross-platform simulation model development method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710361A (en) * 2009-11-13 2010-05-19 北京航空航天大学 Distributed traffic simulating platform based on Service-Oriented Architecture (SOA) and simulating method thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710361A (en) * 2009-11-13 2010-05-19 北京航空航天大学 Distributed traffic simulating platform based on Service-Oriented Architecture (SOA) and simulating method thereof

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
朱峰: "面向并行离散事件仿真组件的调试框架设计", 《计算机科学》 *
王维平等: "基于元模型的可重用仿真模型表示方法研究", 《计算机仿真》 *
雷永林: "支持虚拟样机的仿真模型重用方法研究", 《计算机集成制造系统》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268346A (en) * 2014-09-30 2015-01-07 中国人民解放军国防科学技术大学 Implementation method for simulation application of visual integrated environment on basis of object class interaction diagrams
CN104268346B (en) * 2014-09-30 2018-06-22 中国人民解放军国防科学技术大学 A kind of implementation method of the Simulation Application visualization the integration environment based on object class interaction figure
CN105068858A (en) * 2015-07-29 2015-11-18 北京世冠金洋科技发展有限公司 Multi-source heterogeneous system emulation method and apparatus
CN106202681A (en) * 2016-07-04 2016-12-07 北京空间飞行器总体设计部 Reusable satellite power supply energy balance analogue system and modeling method thereof
CN106777450A (en) * 2016-11-04 2017-05-31 中软信息系统工程有限公司 A kind of model for supporting built-up pattern is described and generation method
CN107832551A (en) * 2017-11-24 2018-03-23 北京宇航系统工程研究所 A kind of modularization Architecture simulation system and method towards Space Equipment
CN107832551B (en) * 2017-11-24 2021-10-01 北京宇航系统工程研究所 Modularized system simulation system and method for space equipment
CN108648086A (en) * 2018-05-22 2018-10-12 中国银行股份有限公司 A kind of finance quantization transaction processing method and device
CN109669671A (en) * 2018-12-07 2019-04-23 中国人民解放军国防科技大学 Multi-level self-adaptive method based on micro-service
CN109669671B (en) * 2018-12-07 2022-05-17 中国人民解放军国防科技大学 Multi-level self-adaptive method based on micro-service
CN109542827A (en) * 2019-01-25 2019-03-29 上海创景信息科技有限公司 General purpose simulation, system and medium based on model
CN111124790A (en) * 2019-12-06 2020-05-08 北京京航计算通讯研究所 Generation system of reusable simulation interface model
CN111124897A (en) * 2019-12-06 2020-05-08 北京京航计算通讯研究所 Method for generating reusable simulation interface model
CN111124897B (en) * 2019-12-06 2023-01-10 北京京航计算通讯研究所 Method for generating reusable simulation interface model
CN111124790B (en) * 2019-12-06 2023-01-10 北京京航计算通讯研究所 Generation system of reusable simulation interface model
CN112433806A (en) * 2020-10-19 2021-03-02 湖南和信智仿信息科技有限公司 Computing model structure and scheduling execution method for cloud simulation service
CN112559643A (en) * 2020-12-21 2021-03-26 北京仿真中心 Simulation entity model description method
CN112988147A (en) * 2021-03-17 2021-06-18 南京仁谷系统集成有限公司 Cross-platform simulation model development method

Also Published As

Publication number Publication date
CN103400013B (en) 2016-01-13

Similar Documents

Publication Publication Date Title
CN103400013A (en) Reusable simulation model and development and using method thereof
Pena et al. The internet of things: The role of reconfigurable platforms
CN104025049A (en) Generating compiled code that indicates register liveness
CN103092645A (en) Geographic spatial information application system and implement method thereof based on microkernel technology
CN103678815A (en) Mechanical product collaborative simulation platform system and simulation method thereof
CN109614093A (en) The processing method of visual intelligent contract system and intelligent contract
CN102662656A (en) Plug-in method and system for program structure
CN105094984A (en) Resource scheduling method and system
CN106873969A (en) A kind of development approach and development platform of J2EE projects
CN101789944A (en) Development system of communication protocol stack of multifunctional energy meter
Alti et al. Integrating software architecture concepts into the mda platform with uml profile
Schleipen et al. The CAEX tool suite-User assistance for the use of standardized plant engineering data exchange
Drath et al. The automationml component description in the context of the asset administration shell
CN111399829B (en) Waveform modeling method and terminal based on model driving
CN102929606A (en) Cloud-computing-based plug-in model of data mining system
CN109656635A (en) Development approach and system are assembled based on the electric analog application software of platform and plug-in unit
CN102624894A (en) Method and system for depacketize and message analysis
CN101620592A (en) Method for storing data by combination of PDF and XML
CN114218745A (en) Intelligent design method for model-driven autonomous evolution
CN102567002A (en) Method for converting codes in telecom value added service development environment
CN103473389A (en) Universal model applied to HLA (High Level Architecture) distributed simulation technology
CN102023866A (en) Map control based on Google Maps JavaScript API and production method thereof
CN104680429A (en) Interoperable conceptual model of smart power grid
CN1409217A (en) Development method for based on object-oriented distributive interactive stimulation application program based on faced objective
Farwer Comparing concepts of object Petri net formalisms

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