CN102346681A - General-purpose simulator - Google Patents

General-purpose simulator Download PDF

Info

Publication number
CN102346681A
CN102346681A CN2010102824563A CN201010282456A CN102346681A CN 102346681 A CN102346681 A CN 102346681A CN 2010102824563 A CN2010102824563 A CN 2010102824563A CN 201010282456 A CN201010282456 A CN 201010282456A CN 102346681 A CN102346681 A CN 102346681A
Authority
CN
China
Prior art keywords
entity
module
incident
simulation
resource
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
CN2010102824563A
Other languages
Chinese (zh)
Other versions
CN102346681B (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 CN201010282456.3A priority Critical patent/CN102346681B/en
Publication of CN102346681A publication Critical patent/CN102346681A/en
Application granted granted Critical
Publication of CN102346681B publication Critical patent/CN102346681B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a general-purpose simulator. The general-purpose simulator comprises a model-derived entity module, an interactive support module, a multithreaded concurrent execution module, a distributed support module and a virtual host module, wherein, the model-derived entity module comprises a plurality of simulation groups, each simulation group comprises a plurality of simulation nodes, and each simulation node comprises resource-based entities formed by packaging functional units of a target system to be simulated; the interactive support module realizes interaction among simulation entities in the model-derived entity module; the distributed support module realizes migration of the transferable entities in the model-derived entity module to different hosts; the multithreaded concurrent execution module realizes multithreaded concurrent processing on coincident events on the host where the general-purpose simulator is located; and the virtual host module is used in an abstract physical host and is used for accommodating various entities in the general-purpose simulator and assisting the distributed support module in realizing transparent support on distribution.

Description

A kind of universal simulator
Technical field
The present invention relates to the Computer Simulation field, particularly a kind of universal simulator.
Background technology
System emulation is that a kind of system model that utilizes experimentizes to real system or hypothetical system; Through experimental result is analyzed; Research system running state and process over time thereof; Obtain the emulation output parameter and the fundamental characteristics of system; Estimate characteristic and performance with inference system with this, and then an experimental and comprehensive subject that makes a policy.System emulation is based on system model, and system model can be divided into two big types according to characteristic, and one type is continuous system, and another kind of is discrete event system.The key distinction of two type systematic models is system state rule over time, and the former changes in time continuously, and the latter only changes on some discrete time point.In discrete event system model, the variation of its state only occurs on some discrete time points, and any variation does not take place state between adjacent two time points.The behavior that causes system state change is called as incident, and it is the core and the driving force of discrete event system, and the generation of incident and processing are promoting the operation of discrete event system one by one just.
Along with development of computer, utilize computer implemented system emulation to obtain widespread usage and popularization, this system emulation that realizes on computers is called as computer simulation.Yun Hang the computer software that is used for a certain system of emulation is called as simulator on computers, since nineteen fifty-five, first numerical integration simulation software came out, a large amount of, polytype simulator have occurred.But existing simulator for example carries out the SimScalor of Computer Architecture simulation mostly to specific goal systems or field, carries out the NS2 of computer network simulation, the GPSS of the system simulation of ranking.These simulators are optimized to field that it was directed against, make it can be in its territory simulated target system preferably, but then be difficult to simulate for the goal systems in other field.There is following problem thus: 1, increased the user learning burden, when the user need simulate the system in the different field, needed the simulator in the study different field; 2, when the goal systems that will simulate when cross-cutting, be difficult to integrate different simulators and simulate.
Summary of the invention
The objective of the invention is to overcome existing simulator and can only simulate the goal systems of specific area, the defective of versatility difference, thus provide a kind of versatility good universal simulator.
To achieve these goals, the invention provides a kind of universal simulator, comprise that model derives from entity module, mutual support module, multi-thread concurrent execution module, distribution support module and fictitious host computer module; Wherein,
Described model derives from entity module and comprises a plurality of simulating groups, and each described simulating groups includes a plurality of simulation nodes, comprises in the said simulation node that the functional unit of the goal systems that will be simulated by institute encapsulates the resource-type entity that forms; Said simulating groups, simulation node and resource-type entity all are called as the simulation entity;
Said mutual support module has realized that said model derives from the mutual of the inter-entity of simulation described in the entity module; The mutual representations of events of using of said simulation inter-entity;
Said distribution support module has been realized said model is derived from the migration of transportable entity on different main frames in the entity module;
Said multi-course concurrency execution module has realized that a plurality of threads on the main frame of said universal simulator place are to the concurrent processing of incident takes place simultaneously;
Said fictitious host computer module is used for abstract physical host, holds the various entities in the said universal simulator, and auxiliary said distribution support module is realized the transparent support to distributing.
In the technique scheme; Described model derive from entity module also include be used for to the goal systems that will the simulate system entity monitoring and control; Said system entity comprises the probe that is used to monitor said simulation entity inner case, and the controller that is used to control said universal simulator;
Said mutual support module has also been realized between said system entity and said system entity and said simulation inter-entity mutual; This uses representations of events alternately.
In the technique scheme; Said mutual support module is when the alternative events of treatment of simulated inter-entity; Destination address according to said incident is distributed to the resource-type entity in the simulation entity with this incident, and said resource-type entity invokes events corresponding processor is handled this incident.
In the technique scheme, said mutual support module is distributed to the invoke function of the respective objects that has realized interface Invokable with this incident when the alternative events of disposal system inter-entity or system entity and simulation inter-entity, handled by this function.
In the technique scheme, said mutual support module also comprises taking turns doing by name assembling and by the name chain through the incident that said resource-type entity is sent and fetches the dependence between the decoupling zero resource entity; Wherein,
Saidly comprise the target of specifying the incident that said resource-type entity sends and specify the incident another name of this target when receiving by name assembling; The said link by name comprises that the incident that said resource-type entity is sent sends to the analog node at target resource type entity place.
In the technique scheme, said mutual support module comprises that also the event source of managing the incident of sending with the incident object set is to the linking relationship between the event target of reception incident; Said event target collection comprises the description to said linking relationship, and concerns according to the event link that strategy generated.
In the technique scheme, said mutual support module adopts synchronous event interactive mode processing events.
In the technique scheme, described distribution support module adopts based on the object broker method of simplifying and realizes the migration of transportable entity on different main frames; Wherein,
The object broker method of described simplification adopts the class of a counterfoil by name; Such is that described transportable entity generates corresponding object stub on another main frame, and described object stub is compared with pairing transportable entity has same simulation node, same simulating groups; Can be forwarded to the corresponding transportable entity that is distributed on other main frame to calling of said object stub.
In the technique scheme, preserve the entity list that is used to write down the transportable entity that is positioned at this locality on the said fictitious host computer module, and the counterfoil table that is used to write down all used object stubs of this locality; Transportable entity is created, obtained, destroys to said fictitious host computer module according to said entity list and counterfoil table.
In the technique scheme, described multi-course concurrency execution module realizes that through token distribution and reclaim mechanism multithreading is to the concurrent processing of incident takes place simultaneously.
The invention has the advantages that: versatility is good, and is applied widely, can simulate the goal systems of different field.
Description of drawings
Fig. 1 is a universal simulator of the present invention structural representation in one embodiment;
Fig. 2 is the synoptic diagram of system's abstract model related among the present invention;
Fig. 3 is the type map of alternative events related among the present invention;
Fig. 4 is the synoptic diagram of transportable entity and the pairing Stub object of transportable entity;
Fig. 5 is the synoptic diagram of service distribution between different main frames;
Fig. 6 is token distribution and the process synoptic diagram that reclaims.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is illustrated.
Simulator the work that will accomplish be the emulation that realizes on computers goal systems.Though goal systems has different types, through analyzing, dissimilar goal systems can take out following key element:
1, entity.Entity is meant to have internal logic and can carry out mutual independent existence, for example CPU, RAM, main frame, software module etc. with the outside.
2, the interactive mode of inter-entity is like shared bus, network channel, message passing mechanism etc.
3, the membership credentials of inter-entity for example are divided into group with entity by physical region, form new bigger entity with a plurality of entities, form a computer entity like entity CPU, RAM etc.
Simulator needs to embody above-mentioned element in the process of simulated target system.In addition, consider the needs of user to simulator distributivity, concurrency and the property monitored, simulator also should have following characteristic:
4, the distribution of entity and concurrency, the entity of being simulated in the simulator should be able to be distributed in the different computing machines with certain granularity, and is simulated concurrently.
5, the entity of being simulated should be able to be detected and control.
Foregoing is the fundamental characteristics that each simulator all should possess.The present invention will realize a kind of universal simulator that can be applicable to polytype goal systems, therefore in universal simulator of the present invention, also should possess above-mentioned characteristic.What need particularly point out is; Universal simulator of the present invention can be accomplished the basic function of simulator; But, then also on the basis of said universal simulator, add a spot of technology contents according to said goal systems if this universal simulator will be applied to a certain concrete goal systems.Basic structure in the face of universal simulator of the present invention illustrates down.
Universal simulator of the present invention comprises that model derives from entity module, mutual support module, multi-thread concurrent execution module, distribution support module and fictitious host computer module.Wherein, Model derives from entity module and links to each other with mutual support module, multi-thread concurrent execution module respectively; Described mutual support module, multi-thread concurrent execution module are connected respectively on the distribution support module; Fictitious host computer module through on this module and other main frame communicates, and other module in the universal simulator is all moved on the fictitious host computer module.To do bright specifically hereinafter respectively to the function of each module.
Fictitious host computer module (Virtual Host)
The fictitious host computer module is used for abstract physical host, and this module comprises two functions at least, and the one, hold the various entities in the simulator as container, the 2nd, auxiliary distribution support module is realized the transparent support to distributing.When after starting a fictitious host computer module on each main frame, can generate various entities therein.When generating transportable entity, the fictitious host computer module is informed the distribution support module with it, enables to keep the consistance of system view.When the transportable entity of visit, not in this fictitious host computer module, then the fictitious host computer module can will ask to be transmitted to the distribution support module accordingly as if target entity, and final the completion should request.The aforesaid operations process relevant with the fictitious host computer module done further explanation in the description of correlation module hereinafter.
The realization of fictitious host computer module is relevant with the programmed environment that universal simulator is adopted, and in one embodiment of the invention, as shown in Figure 1, uses JavaMachine as the fictitious host computer module.The function of JavaMachine and fictitious host computer module noted earlier do not have big difference, and just this module can only be applied in the Java Virtual Machine.
Model derives from entity module
Model derives from entity module and is used for describing all kinds of entities that universal simulator of the present invention comprises.Kind, the contents such as annexation between different entities of contained entity are relevant with concrete goal systems in the model derivation entity module; And all kinds of entities are obtained by system's abstract model derivation; Therefore, for convenience of description, at first the related content of system's abstract model is described.
Described system abstract model is used to realize abstract to goal systems and universal simulator.Fig. 2 is system's abstract model synoptic diagram in one embodiment.In this embodiment; System's abstract model adopts the Java programming language to describe; But in other embodiments; Also can abstract model be described with the programming language of other type; Described abstract model with compare with the described abstract model of Java language; Except because of the programming language difference that characteristics caused separately, do not have difference in essence.
In preamble, mention, include entity in the goal systems, and in simulator, also include entity, for all entities, in abstract model, all be conceptualized as the interface IEntity among the Java, each IEntity has an ID that the overall situation is unique.As shown in Figure 2; In abstract model; IEntity is divided into two types: one type for being used for expressing ISimEntity (the Simulation Entity of goal systems entity; The simulation entity); Another kind of for being used for expressing the ISysEntity (System Entity, system entity) of simulator self system entity.Illustrate respectively in the face of these two types of IEntity down.
1, simulation entity
Simulation entity ISimEntity is used for the entity of simulated target system; Obviously; One must include the entity of polytype, a plurality of quantity in the goal systems that will be simulated, therefore in the process of simulation, to represent these entities with a plurality of simulation entities.Investigate the relation of the inter-entity in the goal systems, can be divided into three kinds:
The paradigmatic relation of a, composite type;
The paradigmatic relation of b, share type;
The subject and object of c, behavior, promptly common incidence relation.
Above-mentioned three kinds of relations of simulation inter-entity will have further description hereinafter.The simulation entity can be divided into ISimStructure (structural type entity) and ISimResource (resource-type entity) according to its content.Described resource-type entity ISimResource is used for encapsulating the unit that goal systems has logic function, for example RAM, ROM, CPU etc.Described structural type entity ISimStructure organizes resource-type entity ISimResource, to obtain the more functional unit of coarsegrain.
Described structural type entity ISimStructure can further be divided into ISimNode (the Simulation Node that is used to express composite types of polymerization relation; Simulate node) and be used to express the ISimGroup (Simulation Group, simulating groups) that the share types of polymerization concerns.Can comprise a plurality of resource-type entity ISimResource among the analog node ISimNode, a simulating groups ISimGroup then can comprise a plurality of structural type entity ISimStructure.Need to prove that for analog node and simulating groups, their involved implications that comprises are also inequality, analog node ISimNode is kept at said resource-type entity in self, and simulating groups ISimGroup has only write down the ID of structural type entity.
In preamble, mention between the entity in the goal systems and have interactive relation, this interactive relation is presented as mutual between simulation entity ISimEntity in simulator.Be commonly referred to as mutual between the resource-type entity ISimResource alternately between simulation entity ISimEntity; In fact show as the incident in the discrete event system, participating in mutual resource-type entity ISimResource is respectively the transmit leg and reception processing side of incident.Described incident can be used SimEvent (Simulation Event, modeling event) expression.
According to goal systems; Some simulation entity should be transportable; Some simulation entity should call; For these simulation entities are distinguished with other simulation entity mutually; With reference to Fig. 2; In abstract model, adopt interface IPortable to identify transportable simulation entity, adopt interface Invokable to identify the entity that can call.Abstract model has also adopted interface IEventTargetSet to simplify the event target collection to complicated event transmitting-receiving relation management.
2, system entity
In order to support monitoring and control to goal systems; Abstract model derives from system entity ISysEntity and is responsible for monitoring simulation entity inner case; And receive the simulation entity and initiatively send the IProber (probe) of information, and be used for being responsible for the user the directly actuated IMonitor of simulator (controller).
Each simulation entity ISimEntity can set a probe I Prober.On the one hand, probe I Prober can detect the variation that takes place among the simulation entity ISimEntiy, has for example received an incident SimEvent; On the other hand, simulation entity ISimEntity can initiatively send to probe I Prober with some information of self.In Java, the IProbable interface is used to identify an entity and whether can inserts probe I Prober and monitor.Because ISimEntity realized IProbable, so all simulation entity ISimEntity and subclass thereof all can be monitored.In addition, because simulator comes down to comprise the simulation entity ISimEntity of a plurality of simulation entity ISimEntity.Therefore, in Fig. 2, represent that the ISimulator of special simulating groups inherits from described simulating groups ISimGroup.Each simulating groups ISimulator needs controller IMonitor cooperating with it, and this IMonitor must be ISimMonitor (Simulator Monitor, a simulator watch-dog).
System entity ISysEntity also comprises being used to simplify the IEventTargetSet to the management of complicated event transmitting-receiving relation except the top content of mentioning.These system entitys can and use by customization.
In preamble, mention, the generation that model derives from entity module is except outside the Pass having with the system abstract model, and is also relevant with concrete goal systems.Deriving from the process of entity module, the functional unit in the goal systems need be embodied as resource-type entity ISimResource, and reuse described structural type entity ISimStructure and system entity ISysEntity by the goal systems generation model.Carry out special control and detection like need, then customizable required controller IMonitor, simulator watch-dog ISimMonitor and probe I Prober.In order to simplify setting and management, go back the required EventTargetSet of definable (promptly realizing IEventTargetSet) hereinafter to be referred as ETS to interactive relation between resource.
Above be to system's abstract model and the description of how being derived from entity module by the goal systems generation model, the basic structure that derives from entity module in the face of model illustrates down.As shown in Figure 1, described model derives from entity module and comprises a special simulating groups ISimulator, and this simulating groups ISimulator has a controller IMonitor of cooperating with it.In described ISimulator, can insert a plurality of simulating groups ISimGroup.These simulating groups ISimGroup possibly be arranged in other JavaMachine module, but to its access mode of user with identical to the visit of this locality group.Can insert a plurality of simulation node ISimNode among each simulating groups ISimGroup, the simulation node possibly be arranged in other JavaMachine module equally.Can put into a plurality of resource-type entity ISimResource in each simulation node.The resource-type entity must with simulation node under it in same JavaMachine module.In addition, the user can put into probe I Prober with simulating in the node in simulating groups, also can in the JavaMachine module, put into controller IMonitor.According to the definition of abstract model, transportable entity can make it to move on other JavaMachine module through the JavaMachine module.
Mutual support module
Mutual support module is used for implementation model and derives from mutual between each entity that entity module comprised.From a plurality of angles mutual support module is illustrated below.
A, to the processing of dissimilar incidents
Inter-entity can be divided into following two kinds alternately, can use dissimilar representations of events alternately for different types of inter-entity.
1, mutual between simulation entity ISimEntity, promptly between resource-type entity ISimResource through transmitting-receiving modeling event SimEvent carry out mutual.
2, mutual that system entity ISysEntity participates in arranged, this comprises mutual between the system entity ISysEntity, and between system entity ISysEntity and the simulation entity ISimEntity alternately.
First kind is the behavior in the goal systems alternately.For example, when resource-type entity ISimResourceRi needs to carry out when mutual with resource-type entity ISimResource Rj, it sends a modeling event SimEvent to Rj, thereby initiation is once mutual.Can be subdivided into two types alternately between simulation entity ISimEntity: synchronous interaction and asynchronous interactive.Synchronous interaction needs target entity synchronously to return interaction results, is similar to linear function and calls.Asynchronous interactive then need not return any result, is similar to a message and sends.
Second kind is actually simulation entity ISimEntity or simulator user in the goal systems alternately to the adjustment of simulator.For example, the simulator user hopes to change the report manner of data among the probe I Prober, or a network node in the goal systems is revised its own IP address.StarSim is treated to the behavior outside the goal systems with this interbehavior, uses IInvokable to represent to carry out this type of mutual entity IEntity.Need to prove,, promptly can not cause simulated clock simulation clock to be pushed ahead using Invocation to carry out not influencing simulated clock simulation clock when mutual.
In Fig. 3, to distinguish being used for mutual incident, the SimEvent representative is used to represent the modeling event of first kind of type of interaction, Invocation then represents the incident of calling that is used to represent second kind of type of interaction.These two types of incidents all have following key element:
1, event name is used to distinguish different interbehaviors, is similar to the function name in the method call;
2, event data is used to transmit parameter and possible result when mutual.
The incident of which kind of type no matter, the event data that is used for presentation of events all is the tabulation of a key-value pair, each data all has a title that is used to distinguish.
Mutual support module based on incident has different disposal routes for dissimilar incidents.
A), the modeling event SimEvent that sends out for resource entity, mutual support module will be distributed to incident in the resource of appointment according to the event target of setting in this resource entity.All there are some event handlers that are used for processing events (IEventHandler) in each resource.The user need write some event handlers for the resource entity of oneself according to the form of event handler.After modeling event SimEvent was distributed to the resource of appointment, simulator at first obtained to handle the event handler of this modeling event SimEvent, calls event handler then modeling event is handled.
B), for calling incident Invocation, mutual support module is handled its invoke function that directly is distributed to the respective objects that has realized interface Invokable by this function.
Dependence between B, decoupling zero resource entity
Except the classification processing that preamble is mentioned, also has other function based on the mutual support module of incident to incident.
In the process of creating simulator, run into such problem: when the user defines a resource-type entity in simulator, be difficult to confirm to carry out with it the particular type of other mutual resource-type entity usually through regular meeting.For example, during definition CPU this resource-type entity, although know its data in will the access stored space, and that do not know data are provided is resource-type entity RAM/ROM or resource-type entity Cache.This obviously is unfavorable for the successful establishment of simulator.As a kind of preferred implementation, can overcome this problem through the dependence between the decoupling zero resource entity based on the mutual support module of incident.
With the above-mentioned example that is defined as, when definition CPU, confirm that it needs to read and write data through the incident of " READ_MEM " by name and the incident of " WRITE_MEM " respectively to resource-type entity CPU.In definition during RAM, confirm the incident of reading that it can response data and write incident, and with these two incidents called afters " DATA_READ " and " DATA_WRITE " respectively.When in simulator, CPU and RAM being combined; Only need be with the event handling unit of the READ_MEM event link of CPU DATA_READ incident in the RAM; Make the incident of the READ_MEM by name that CPU sends to be distributed to RAM by simulator; As the incident of READ_MEM by name among the RAM, this process also is called as the link assembling of event name.In like manner; When needs are connected to Cache earlier with CPU; When being connected to RAM by Cache again; Only need be when the link assembling with the READ_MEM event link of CPU CACHE_READ incident to Cache; And the DATA_READ incident that the MISS_MEM_READ incident (when cache was miss, the internal memory of being initiated read incident) of Cache is linked among the RAM got final product.Through the link assembling of event name, both guaranteed the reusability of resource-type entity, increased the dirigibility of system again.
Above just the link assembling process of event name has been done simple explanation, illustrated in the face of concrete implementation procedure down based on the dependence between the mutual support module decoupling zero resource entity of incident.
At first, the incident that the resource-type entity is sent is done by name and is assembled.Described target and the incident another name of target when receiving that is meant the incident that the allocated resource entity is sent by the name assembling.
Described by the object listing realization of name assembling through the establishment incident.The object listing of each incident is to be realized by the Key-Values mapping of an event name to a plurality of target informations.Each target information in the object listing has been described the following content of respective objects: the ID of target resource entity, the ID of target resource entity place analog node ISimNode, the another name of the incident when the target resource entity receives.
Secondly, incident links by name.Said being meant by name link sends to the incident of target resource entity ISimResource as AliasEventName by name at the incident of the EventName by name that resource-type entity ISimResource is sent.
In process by the name link; When the resource-type entity ISimResource as mutual promoter sends modeling event SimEvent; Simulator by the object listing of being created in the name distribution process, obtains the following information of target according to the name lookup of incident: the ID of target resource entity, the ID of target resource entity place analog node ISimNode, the another name of the incident when the target resource entity receives.After obtaining the above-mentioned information of target; Just can according to relevant information incident be sent to the analog node ISimNode at target resource place by simulator; Constantly from target resource type entity, obtain handling the event handler of this incident another name by it at correct simulator, and transfer to this event handler and handle.In process,, can also before the incident distribution, carry out filter operation for fear of the extraneous events overhead that end (being the transmitting terminal of incident) is brought to the unnecessary transmission of destination from the source by the name link.Said filter operation is realized by event filter whether event filter inspection current event need deliver to destination end, if need, just carries out follow-up distribution operation.Owing to whether need event filter and adopt which kind of event filter may be different on different target, so the relevant information of event filter also can be kept in the object listing in advance.
The assembling of C, complicated event chain
More than be description, no matter include what resource-type entities in the goal systems the link of incident assembling basic process, simulator can utilize this link assembling process accomplish the resource-type inter-entity alternately.Even so; Incident transmitting-receiving relation between resource entity is not simple single source single goal or single source multiple goal; But during complicated multi-source multi-target, the event link that relies on the transmission target in allocate event source one by one to accomplish resource entity merely will make assembly work become loaded down with trivial details.For example in to a room in the simulation of WiFi network, the WiFi network interface card on each main frame of being simulated all need link to each other with other WiFi network interface card in the room---and be that the incident that its produces need send to the WiFi network interface card in other all effective ranges.If assembly chaining one by one, need N * N link (N is the network interface card number), and to safeguard this link the cost that will spend bigger.The for example adding of certain node and withdraw from the linking relationship that all need revise on other all nodes.In order under this type of situation, to reduce the link number of times, reduce maintenance cost, as a kind of preferred implementation, (IEventTargetSet ETS) comes the Admin Events source to the linking relationship between the event target to adopt " event target collection " in another embodiment.Described ETS at first comprises the description to these linking relationships, generates the event link relation automatically according to predetermined strategy then, and is distributed to the event source node.When the event link relation needs change, directly notify ETS, upgrade getting final product by ETS.For example, can define the ETS of a WiFi in advance, then all network interface cards and position thereof put into ETS, confirm its event link relation according to the coverage and the position of each network interface card by ETS.When the site position changes, only need to revise ETS, the event link relation of being upgraded automatically between the node that relates to by ETS gets final product.Like this, no matter be initialization or renewal, the user only needs 1 setting.
D, synchronous event interactive mode
In the typical discrete event system of prior art, incident from produce to send and whole process that the side of being received handles normally asynchronous, i.e. wait for no longer after the transmit leg transmission incident that the take over party disposes and continues down to carry out.This asynchronous incident interactive mode can increase the complexity of entity internal event response logic.For example; When the CPU entity need read in the RAM entity data; Because asynchronous event interactive mode; Make that accomplishing this operation must send a READ incident by CPU; Wait for that then the RAM entity sends the READ_ACK incident of returning; Have only after receiving the READ_ACK incident, read operation is just calculated completion.This deficiency in view of the asynchronous event interactive mode; Internal logic when simplifying entity interaction; In a preferred embodiment of the invention, based on the mutual support module employing synchronous event interactive mode of incident, this interactive mode also is called as CallByEvent mechanism.In the synchronous event interactive mode, transmit leg need wait for that the take over party finishes event handling, and the take over party need explicitly inform that event handling finishes.Under the support of synchronous event, CPU is in waiting status after sending the READ incident automatically, data are put into the READ incident and returns up to RAM; And RAM need explicitly inform that event handling finishes in sense data and after putting into the READ incident.When the transmission action of CPU is returned, had the data of reading among the RAM in the READ incident.Compare alternately with asynchronous event; In synchronous event reciprocal process; The take over party does not need one of explicit transmission to reply incident; The initiator need not write to handle yet and reply the IEventHandler of incident; Reduce the assembling synchronous event interactive mode (or CallByEvent mechanism) of an event link simultaneously, therefore simplified the mutual of inter-entity.
The distribution support module
In preamble, mention, some the simulation entity in the simulator is transportable, and adopts interface IPortable to identify and support transportable simulation entity.Migration to the simulation entity is realized down the auxiliary of aforementioned fictitious host computer module by described distribution support module.
In one embodiment of the invention, the distribution support module is based on simplification ORB realization.Described ORB is an object broker, and typical object broker method comprises CORBA, DCOM, J2EE etc.Since these typical methods need the dealing with complicated network environment, cross-platform, stride many difficult problems such as language, therefore all very complicated usually.Seeing that the running environment that simulator faced is comparatively simple, for example, there is not the problem of striding programming language, so can adopts the object broker method after the simplification through LAN (Local Area Network) TCP/IP is interconnected reliably at a high speed.Object broker method after the described simplification only comprises three functions: 1, the relation between the maintenance host, and promptly there is which main frame to participate in simulation, how to visit them; 2, the location management of transportable object promptly is positioned at which main frame (computing machine of operation simulator); 3, to the visit of transportable object.Relating generally to the ORB that how to utilize after the simplification among the present invention realizes the distribution of transportable object on different main frames and follow-up interactive access.
Realize the support of transportable entity on different main frames, need to adopt the class of one type of counterfoil by name (Stub), the Stub class is that transportable entity generates corresponding Stub object.The Stub object is compared with its pairing transportable entity; Have identical simulating groups ISimGroup, special simulating groups ISimulator and simulation node ISimNode; Therefore the user need not distinguish entity itself or its corresponding Stub object when using described transportable entity.The Stub object will be guaranteed can be forwarded to the correspondent entity that is distributed on other main frame to calling of it, and return results, thereby make the user can visit the entity that is distributed on the different main frames, and need not be concerned about how bottom realizes this remote request.As far as the user, be distributed in entity on the different main frames just as on a main frame, moving.Fig. 4 is the synoptic diagram of transportable entity and the pairing Stub object of transportable entity, and described Stub object has been represented on right side wherein.The Stub object is sightless for the user, and the dotted line among the figure representes to realize relation, the transportable object that the realization of Stub object links to each other with its dotted line.Solid line among the figure is represented inheritance, and the Stub object is inherited the transportable object that links to each other with its solid line.Can guarantee that through aforesaid operations user transparent ground uses Stub, but think that what use is corresponding transportable object.
Handle each main frame in the compartment system for the ease of the user, in described fictitious host computer module, preserved two tables, one is to be used to write down the entity list that is positioned at local transportable entity, and another is the counterfoil table that is used to write down all used Stub of this locality.In addition, the IJVMORB object of the ORB after the fictitious host computer module has also used to be used to realize simplifying carries out with the fictitious host computer module on other main frame alternately.Visit to the remote dummy host module can be carried out through obtaining its Stub.But the startup of fictitious host computer module can not be carried out through Stub, must on main frame, start and move a fictitious host computer module by hand.After the fictitious host computer module starts, will seek other fictitious host computer module according to predetermined strategy, and accomplish necessary information synchronization work.
In preamble to Stub and fictitious host computer module done describe after, below just can the management process of transportable entity be illustrated.The management process of transportable entity comprises establishment, destroys and migration.State in realization in the management process, the fictitious host computer module provides the calling interface of migration, and these calling interfaces are transferred to the distribution support module in inside with the action of reality and carried out.So just realized the transparency of distribution support module, thereby different distribution support modules can according to circumstances be provided the user.Concrete implementation procedure is following.
When the user creates a transportable entity, at first generate this entity, and put into said entity list by the fictitious host computer module; Then, the fictitious host computer module generates the corresponding Stub of this entity, puts into described counterfoil table; Then, the fictitious host computer module re-uses the notifyAddMobile method that being used among the IJVMORB notify the fictitious host computer module on other main frame to add a transportable entity; The user that last fictitious host computer module is created transportable entity to needs returns the Stub of generation.
When the user obtained transportable entity according to ID, the fictitious host computer module was at first searched the Stub whether this ID is arranged in the said counterfoil table, had and then directly returned this Stub, did not have and then created a Stub, and the Stub that is created is put into the counterfoil table, and return this Stub.
When the user will destroy a transportable entity; The fictitious host computer module judges that whether this entity is in this locality; If then deletion and destruction from said entity list in this locality; Call being used among the IJVMORB then and notify the fictitious host computer module on other main frame to delete the notifyRemoveMobile method of a transportable entity, and then delete the Stub of this object that possibly exist in the counterfoil table.If the getHostJVM method that the entity that will delete of institute not in this locality, then uses the requirement among the IJVMORB to return designated entities place fictitious host computer module numbering obtains the Stub of the fictitious host computer module at this entity place, transmit then to destroy and ask.
It all is Stub that the user calls the transportable entity that method obtains in the fictitious host computer module.When the user initiates to call to Stub, call and to be intercepted and captured by Stub.Stub at first according to the ID of the entity of self acting on behalf of, searches this entity in the local virtual host module, if entity in the entity list of fictitious host computer module, then will call and be transmitted to this entity.Otherwise will call the nrmi method that is transmitted to the local virtual host module.In the nrmi method, the getHostJVM method of fictitious host computer module invokes IJVMORB obtains the Stub of the fictitious host computer module at this entity place, calls the remoteCalled method among the Stub of fictitious host computer module then.Because the Stub of fictitious host computer module is by the IJVMORB management, so in fact StarSim incorporates the basic-level support of distribution into IJVMORB and manages.Therefore, to the host computer system of different characteristics, can improve the performance that bottom distributes through using different IJVMORB to realize.
Fig. 5 has provided an instance under the Java environment, in the figure, the transportable entity of the circular expression of solid line, dashed circle is represented Stub, ellipse representation JavaMachine module.When the transportable entity B of user capture in the JavaMachine module 1, the visit of B is intercepted and captured by the pairing Stub b of transportable entity B, and be forwarded to the nrmi method of JavaMachine module 1 by it.The nrmi of JavaMachine module 1 calls the Stub j2 that IJVMORB1 obtains JavaMachine module 2.Create because j2 is IJVMORB1,, thereby request can be forwarded to JavaMachine module 2 and return results so it possibly comprise the information such as the network address of JavaMachine module 2.
The multi-thread concurrent execution module
In the simulation of discrete event, the unified propelling of the complete parallel processing of incident and simulated clock simulation clock is a problem that does not solve theoretically as yet.Concurrency runs into " causal sequence " problem on the simulated time inevitably completely, and the unified concurrency that can reduce event handling greatly that advances of clock.Therefore, adopt the multi-thread concurrent execution module to carry out the concurrent processing of multithreading among the present invention to incident (promptly occurring in the incident on the same simulator clock) taking place a large amount of the existence time in the large scale system.
The multi-thread concurrent execution module uses the parallel processing of multithreading to incident through token distribution and the mechanism support of reclaiming, and guarantees that simultaneously the unified of clock advances.As shown in Figure 6, at simulation Ti constantly, structural solid (ISimStructure) N is last to have k concurrent E1; ..., Ek, then the clock by N advances function (advance) to create k thread; And the Token that the thread that will call advance is held is divided into k part, is distributed to this k thread.Start this k thread then and handle these incidents respectively.After the thread that calls advance starts all sub-threads, wait for and collect k the sub-Token that has distributed, collect and to continue after neat.After each sub-thread execution finishes, give back the sub-Token that is held to main thread.All repeat this process on each structural solid, make that the processing procedure on each structural solid is roughly the same.Because structural solid can be distributed on the different main frames, so distributivity can supported and utilize to concurrent thread.This concurrent mechanism need not the participation of the defined resource entity of user, thereby is transparent to the user.
In preamble, mention, in a kind of preferred implementation of the present invention, can adopt synchronous event interactive mode (CallByEvent) to realize processing incident.The multi-thread concurrent treatment mechanism is equally applicable to CallByEvent.Specifically; Event sending party S calls and is used to the callByEvent function of realizing that synchronous event is mutual; This function at first calls dispatchEvent incident is sent to target entity D; Token token with self gives back main thread then; And realize to the sleep of the obstruction of current sub-thread T, with returning of waiting event through calling waitForACKEvent.After target entity D handles incident, call the returnEvent function.This function will wake the thread T that is sleeping up, makes the callByEvent function call to continue execution.After it obtained the incident that target entity returns, completion was withdrawed from.
It more than is detailed description to universal simulator of the present invention.Can find out from detailed description each module of universal simulator; The present invention sets up general, simple model for the goal systems of being simulated; Make universal simulator can be used for the simulation of most of event system, and reduce the difficulty that the objectives system is simulated.
In addition; Universal simulator of the present invention provides the inter-entity interaction mechanism based on incident; Decoupling zero between this mechanism support entity is to improve the reusability of entity; And synchronous event interaction mechanism (CallByEvent) can be simplified the inner event handling logic of entity, and event target collection ETS can also simplify the assembling of complicated event transmitting-receiving relation.
Universal simulator of the present invention also supports to simulate the distribution of entity.The present invention is based on ORB (Object Request Broker) thought of simplification, the simulation entity is distributed to different main frames simulates, the not enough problem of unit performance is also hidden the bottom details when distributing when solving the simulator operation, and the control that the simulation entity is distributed is provided.
Universal simulator of the present invention is also supported the parallel processing of simultaneous events: use token distribution and multithreading, make the modeling event that the same simulation of parallel processing that a plurality of threads in a plurality of main frames and the same main frame can be transparent takes place constantly.
Universal simulator support of the present invention is to the customizable monitoring and the control of simulation system, through customizable monitoring and control method are provided, make the user can monitor flexibly with the controlled target system in entity.
It should be noted last that above embodiment is only unrestricted in order to technical scheme of the present invention to be described.Although the present invention is described in detail with reference to embodiment; Those of ordinary skill in the art is to be understood that; Technical scheme of the present invention is made amendment or is equal to replacement, do not break away from the spirit and scope of technical scheme of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (10)

1. a universal simulator is characterized in that, comprises that model derives from entity module, mutual support module, multi-thread concurrent execution module, distribution support module and fictitious host computer module; Wherein,
Described model derives from entity module and comprises a plurality of simulating groups, and each described simulating groups includes a plurality of simulation nodes, comprises in the said simulation node that the functional unit of the goal systems that will be simulated by institute encapsulates the resource-type entity that forms; Said simulating groups, simulation node and resource-type entity all are called as the simulation entity;
Said mutual support module has realized that said model derives from the mutual of the inter-entity of simulation described in the entity module; The mutual representations of events of using of said simulation inter-entity;
Said distribution support module has been realized said model is derived from the migration of transportable entity on different main frames in the entity module;
Said multi-course concurrency execution module has realized that a plurality of threads on the main frame of said universal simulator place are to the concurrent processing of incident takes place simultaneously;
Said fictitious host computer module is used for abstract physical host, holds the various entities in the said universal simulator, and auxiliary said distribution support module is realized the transparent support to distributing.
2. universal simulator according to claim 1; It is characterized in that; Described model derive from entity module also include be used for to the goal systems that will the simulate system entity monitoring and control; Said system entity comprises the probe that is used to monitor said simulation entity inner case, and the controller that is used to control said universal simulator;
Said mutual support module has also been realized between said system entity and said system entity and said simulation inter-entity mutual; This uses representations of events alternately.
3. universal simulator according to claim 2; It is characterized in that; Said mutual support module is when the alternative events of treatment of simulated inter-entity; Destination address according to said incident is distributed to the resource-type entity in the simulation entity with this incident, and said resource-type entity invokes events corresponding processor is handled this incident.
4. universal simulator according to claim 2; It is characterized in that; Said mutual support module is when the alternative events of disposal system inter-entity or system entity and simulation inter-entity; This incident is distributed to the invoke function of the respective objects that has realized interface Invokable, handles by this function.
5. universal simulator according to claim 2 is characterized in that, said mutual support module also comprises taking turns doing by name assembling and by the name chain through the incident that said resource-type entity is sent and fetches the dependence between the decoupling zero resource entity; Wherein,
Saidly comprise the target of specifying the incident that said resource-type entity sends and specify the incident another name of this target when receiving by name assembling; The said link by name comprises that the incident that said resource-type entity is sent sends to the analog node at target resource type entity place.
6. according to claim 2 or 5 described universal simulators, it is characterized in that said mutual support module comprises that also the event source of managing the incident of sending with the incident object set is to the linking relationship between the event target of reception incident; Said event target collection comprises the description to said linking relationship, and concerns according to the event link that strategy generated.
7. according to claim 2 or 5 or 6 described universal simulators, it is characterized in that said mutual support module adopts synchronous event interactive mode processing events.
8. universal simulator according to claim 2 is characterized in that, described distribution support module adopts based on the object broker method of simplifying and realizes the migration of transportable entity on different main frames; Wherein,
The object broker method of described simplification adopts a kind of name to be called the class of counterfoil; Such is that described transportable entity generates corresponding object stub on another main frame, and described object stub is compared with pairing transportable entity has same simulation node, same simulating groups; Can be forwarded to the corresponding transportable entity that is distributed on other main frame to calling of said object stub.
9. universal simulator according to claim 8 is characterized in that, preserves on the said fictitious host computer module to be used to write down the entity list that is positioned at local transportable entity, and the counterfoil table that is used to write down all used object stubs of this locality; Transportable entity is created, obtained, destroys to said fictitious host computer module according to said entity list and counterfoil table.
10. universal simulator according to claim 2 is characterized in that, described multi-course concurrency execution module realizes that through token distribution and reclaim mechanism multithreading is to the concurrent processing of incident takes place simultaneously.
CN201010282456.3A 2010-07-26 2010-09-10 General-purpose simulator Expired - Fee Related CN102346681B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010282456.3A CN102346681B (en) 2010-07-26 2010-09-10 General-purpose simulator

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201010239352.4 2010-07-26
CN201010239352 2010-07-26
CN201010282456.3A CN102346681B (en) 2010-07-26 2010-09-10 General-purpose simulator

Publications (2)

Publication Number Publication Date
CN102346681A true CN102346681A (en) 2012-02-08
CN102346681B CN102346681B (en) 2014-11-26

Family

ID=45545384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010282456.3A Expired - Fee Related CN102346681B (en) 2010-07-26 2010-09-10 General-purpose simulator

Country Status (1)

Country Link
CN (1) CN102346681B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743668A (en) * 2014-12-09 2016-07-06 中兴通讯股份有限公司 Method and device for achieving function of package transmitting and receiving
CN109412834A (en) * 2018-09-11 2019-03-01 叮联信息技术有限公司 Event is uninterruptedly transmitted at random and shared information methods of exhibiting

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040059557A1 (en) * 2002-09-24 2004-03-25 Institute For Information Industry Flexible system simulation architecture, its interface and operating method
CN1805424A (en) * 2005-12-31 2006-07-19 华中科技大学 Gridding emulation method and its emulator
CN101309186A (en) * 2008-06-23 2008-11-19 南京大学 Design method of expandable general purpose type P2P network simulator

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040059557A1 (en) * 2002-09-24 2004-03-25 Institute For Information Industry Flexible system simulation architecture, its interface and operating method
CN1805424A (en) * 2005-12-31 2006-07-19 华中科技大学 Gridding emulation method and its emulator
CN101309186A (en) * 2008-06-23 2008-11-19 南京大学 Design method of expandable general purpose type P2P network simulator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曾鸿,李旭晖,何炎祥: "《一个通用移动agent仿真平台的设计与实现》", 《计算机应用研究》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743668A (en) * 2014-12-09 2016-07-06 中兴通讯股份有限公司 Method and device for achieving function of package transmitting and receiving
CN109412834A (en) * 2018-09-11 2019-03-01 叮联信息技术有限公司 Event is uninterruptedly transmitted at random and shared information methods of exhibiting

Also Published As

Publication number Publication date
CN102346681B (en) 2014-11-26

Similar Documents

Publication Publication Date Title
CN101529391B (en) Performing diagnostic operations upon an asymmetric multiprocessor apparatus
Pokahr et al. The active components approach for distributed systems development
CN110083455B (en) Graph calculation processing method, graph calculation processing device, graph calculation processing medium and electronic equipment
Abuseta et al. Design patterns for self adaptive systems engineering
Diaconescu et al. Automatic performance management in component based software systems
CN104980525B (en) A kind of universality mobile computing system based on state middleware
CN103262064A (en) Distributed computing architecture
CN111198739B (en) Application view rendering method, device, equipment and storage medium
Sorici et al. CONSERT: Applying semantic web technologies to context modeling in ambient intelligence
Farahbod et al. An abstract machine architecture for web service based business process management
Lee et al. Lightweight end-to-end blockchain for IoT applications
Zhang et al. On-demand deployment for IoT applications
CN102346681B (en) General-purpose simulator
Qasim et al. Formal specification and verification of real-time multiagent systems using timed-arc petri nets
CN105892957B (en) A kind of distributed transaction execution method based on Dynamic Program Slicing
Spiess et al. Integrating sensor networks with business processes
Al Maghayreh et al. A framework for monitoring the execution of distributed multi-agent programs
Dragoni et al. An object based algebra for specifying a fault tolerant software architecture
Moreland Jr Experimental Research and Future Approach on Evaluating Service‐Oriented Architecture (SOA) Challenges in a Hard Real‐Time Combat System Environment
THOMAS et al. Internet of things
Schlatow Enabling in-field integration in critical embedded systems
Hunkin Distributed Operating Systems on Wireless Sensor Networks
Camacho et al. Software and performance measures for evaluating multi-agent frameworks
Mariani et al. TuCSoN Coordination for MAS Situatedness: Towards a Methodology.
Viola et al. Performance Evaluation Suite for Semantic Publish-Subscribe Message-oriented Middlewares

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: 20141126

Termination date: 20180910

CF01 Termination of patent right due to non-payment of annual fee