CN114090185A - Method and system for visually displaying simulation execution - Google Patents
Method and system for visually displaying simulation execution Download PDFInfo
- Publication number
- CN114090185A CN114090185A CN202111419488.8A CN202111419488A CN114090185A CN 114090185 A CN114090185 A CN 114090185A CN 202111419488 A CN202111419488 A CN 202111419488A CN 114090185 A CN114090185 A CN 114090185A
- Authority
- CN
- China
- Prior art keywords
- state
- scxml
- instance
- simulation
- event
- 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
Links
- 238000004088 simulation Methods 0.000 title claims abstract description 84
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000010586 diagram Methods 0.000 claims abstract description 35
- 230000000007 visual effect Effects 0.000 claims abstract description 6
- 230000007704 transition Effects 0.000 claims description 20
- 238000006243 chemical reaction Methods 0.000 claims description 19
- 239000003086 colorant Substances 0.000 claims description 7
- 230000000694 effects Effects 0.000 claims description 5
- 238000013461 design Methods 0.000 abstract description 6
- 238000012795 verification Methods 0.000 abstract description 3
- 238000004891 communication Methods 0.000 abstract description 2
- 238000012360 testing method Methods 0.000 abstract description 2
- 230000006399 behavior Effects 0.000 description 12
- 230000005540 biological transmission Effects 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000005094 computer simulation Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
- G06F9/45508—Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4418—Suspend and resume; Hibernate and awake
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Processing Or Creating Images (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method and a system for visually displaying simulation execution.A model converter receives a simulation model provided by a SysML state machine, and generates the simulation model into a standard SCXML file by taking a state diagram as a generating unit; the file parser receives the SCXML file for the simulation engine and the instance scheduler to read; when the simulation of the state machine model is initiated, all SCXML instances of the model are managed by an instance scheduler, and meanwhile, an event transceiver also starts to work; and the animation display is used for carrying out animation display through the received action notification simulation animation interface. The invention ensures the consistency of modeling data and simulation data, realizes the automatic generation of an executable model of a system design scheme, displays dynamic scenes in a visual manner, and carries out formal test and verification on the logic of the model; the invention visually displays the system, improves the communication efficiency with the stakeholders, and solves the problem of adding simulation execution and animation display on the current SysML state machine model.
Description
Technical Field
The invention belongs to the field of simulation, relates to state machine simulation, and particularly relates to a method and a system for visually displaying simulation execution.
Background
In most industrial system fields, MBSE has been applied to system design, although a system model based on the SysML standard is introduced at the time of system design, and system design and functional logic can be expressed by a state machine; however, in order to verify the requirements and ensure the accuracy of the model, the operation condition of the system cannot be visually displayed when the static model is involved, which is not beneficial to communicating with the stakeholders and cannot verify the requirements in the early stage of design.
SCXML, an event-based state machine language. It is the product of the combination of CCXML and Harel State Tables. The CCXML1.0 specification defines a state machine and event processing syntax as well as a series of call control elements. The State machine notation proposed by David Harel in 1987 for the Harel State Table was followed later by the State machine in UML. The Harel State Tables provides a compact, semantically good, and functionally powerful control structure. The SCXML standard may use XML syntax and the Harel State Table semantic to describe the logical concept of State and event transitions in CCXML.
Disclosure of Invention
The invention solves the technical problem of providing a method and a system for displaying simulation execution visually, which realize the simulation execution and animation display of a SysML state machine model through a simulation execution engine of the state machine model semantics and provide a visual simulation verification environment.
The invention is realized by the following technical scheme:
a method of visually displaying a simulated execution, comprising the operations of:
1) the model converter receives a simulation model provided by a SysML state machine, and generates the simulation model into a standard SCXML file by taking a state diagram as a generating unit;
when the SCXML file is generated, the SCXML file is converted into a standard executable SCXML code based on the internal attributes of the graphic primitives of the state diagram and the source and the target of the phase connecting line in the graphic primitives;
2) the file parser receives the SCXML file, and the semantics of the SCXML file are parsed by an Xmlreader method and attributes to generate an SCXML instance and assign a value for the simulation engine and the instance scheduler to read;
3) when the simulation of the state machine model is initiated, all SCXML instances of the model are managed by an instance scheduler, and meanwhile, an event transceiver also starts to work;
the event transceiver responds to internal/external events or processes internal trigger events;
when the state instance in the SCXML instance is executed, if the internal attribute of the state instance contains a calling event, the calling event is sent through the event transceiver, and then the event transceiver informs the instance scheduler to start the corresponding SCXML instance;
4) when the SCXML instance started by the instance scheduler runs to an internal signal sending action, the event transceiver immediately sends a signal, the FireEvents are called to inform all state machine instances, the event transceiver of each state machine instance can receive the signal event, and then whether the signal event needs to be responded or not is judged according to the current state and the service requirement of the event transceiver;
when the event transceiver receives an event, judging whether the current event state is suspended or not, and if so, adding the current event state into an event queue according to business requirements; if the current state is not the suspended state, executing an EventStep method to calculate the next state and the next transition of the current state, and then informing the animation display according to actions including exiting of the current state, executing of the next transition and entering of the next state;
5) and the animation display is used for carrying out animation display through the received action notification simulation animation interface.
Further, when generating the SCXML file, generating an SCXML file by a state diagram;
converting all the primitives in the state diagram into elements in the SCXML file, wherein the state primitives generate state elements of the SCXML file; the SCXML file is an XmlDocument class, and the element is XmlElement.
Further, when generating the SCXML file, the internal attributes of the primitive are abstracted into a trigger, a condition and a target end, and then the following correspondence is adopted when converting into the SCXML file: and the trigger attribute in the graphic primitive corresponds to the event, the condition attribute corresponds to the cond, and the target end attribute corresponds to the target.
When the SCXML file is analyzed, reading each attribute of the SCXML file by a GetAttribute method of an XmlReader class, and after the attribute is read, performing data reading line by judging the type of the current node; judging the name of the current node in the process of reading line by line to organize various attributes of the SCXML class; then, by calling the UpdateSCXML method, operating each attribute including state, conversion, action and historical connector to generate an SCXML instance with complete attribute; the operations include initializing, assigning and ordering attributes.
And the instance scheduler sends calling events to other state machines through target attributes of the send node on the entrance behavior, the Do behavior, the exit behavior and the conversion action behavior comprising the state instances.
The event transceiver receives and responds to internal/external events through a TruggerEvents method, and processes internal trigger events through a FireEvents method.
Further, when animation is displayed, if the simulation animation interface receives an entering or exiting notification, according to the ID of the current state in the SCXML instance, finding a corresponding primitive in a graphic display area of the simulation animation interface, setting the border of the primitive to a corresponding color, and simultaneously outputting a corresponding log entering or exiting a certain state in a log area;
if the simulation animation interface receives the conversion notice, finding corresponding source primitives and target primitives in a graphic display area of the simulation animation interface according to the source and target of the SCXML instance which is currently converted; then finding out a series of primitives of a specified path between the source and the target according to the currently converted cond and the event, and setting the borders of the primitives into the entering colors and then setting the borders into the exiting colors according to the sequence from the source to the target so as to realize the animation effect; and simultaneously, outputting a log of the transition from one state to another state in the log area.
Further, during animation display, if the current entering primitive is the initial state of the state diagram, firstly setting the default conversion source and the conversion line before the state as the entering color; if the current incoming primitive is a child state machine primitive, the child state machine instance of the instance scheduler is invoked to start the instance.
Further, the animation display is also provided with an interval time setter for adjusting the animation speed, and when the graphic elements are set to enter colors, a system.
Correspondingly, the invention also provides a system for visually displaying simulation execution, which comprises:
the model converter is used for receiving the simulation model provided by the SysML state machine, converting the primitive into an executable SCXML code based on the primitive internal attribute of the state diagram in the simulation model, and generating the simulation model into a standard SCXML file by taking the state diagram as a generating unit;
the file parser receives the SCXML file and parses the SCXML file by an XmlReader method and attributes to generate an SCXML instance with complete attributes and assign values to the SCXML instance for the simulation engine and the instance scheduler to read;
the instance scheduler manages all generated SCXML instances, and starts a corresponding state machine instance when simulation is initiated; sending a calling event through the node on the state behavior;
an event transceiver for responding to an internal or external event and notifying the animation display according to exit of a current state, execution of a next transition, and a next state; when the event transceiver needs to send signals, all state machine instances are informed, and each state machine instance judges whether the signal event needs to be responded according to the current state and the service requirement of the state machine instance;
and the animation display is used for informing the simulation animation interface through the entering, exiting and converting actions of the state instance in the SCXML instance so as to display the animation.
Compared with the prior art, the invention has the following beneficial technical effects:
according to the method and the system for visually displaying simulation execution, simulation is executed on a state machine diagram based on the W3C SCXML standard, and after SysML modeling is completed in a system modeling tool, the operation logic of the system is demonstrated through a functional logic simulation means based on SCXML; the invention ensures the consistency of modeling data and simulation data, realizes the automatic generation of an executable model of a system design scheme, displays dynamic scenes in a visual manner, and carries out formal test and verification on the logic of the model. The invention improves the condition that the system can not be visually displayed based on the form of the document, improves the communication efficiency with the stakeholders, and solves the problem of adding simulation execution and animation display on the current SysML state machine model.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention.
FIG. 2 is a schematic flow diagram of the present invention.
Fig. 3 is a diagram of the SysML state diagram.
Fig. 4 is a schematic diagram of the generated SCXML file.
FIG. 5 is a schematic diagram of a simulated animation.
Detailed Description
The present invention will now be described in further detail with reference to the following examples, which are intended to be illustrative, but not limiting, of the invention.
Referring to fig. 1 and 2, a method for visually displaying simulation execution includes the following operations:
1) the model converter receives a simulation model provided by a SysML state machine, and generates the simulation model into a standard SCXML file by taking a state diagram as a generating unit;
when the SCXML file is generated, the SCXML file is converted into a standard executable SCXML code based on the internal attributes of the graphic primitives of the state diagram and the source and the target of the phase connecting line in the graphic primitives;
2) the file parser receives the SCXML file, and the semantics of the SCXML file are parsed by an Xmlreader method and attributes to generate an SCXML instance and assign a value for the simulation engine and the instance scheduler to read;
3) when the simulation of the state machine model is initiated, all SCXML instances are managed by the instance scheduler, and the event transceiver starts to work; when a state instance in an SCXML instance is executed, if the internal attribute of the state instance contains a calling event, the calling event is sent through an event transceiver, and then the event transceiver responds to the calling event and informs an instance scheduler to start the corresponding SCXML instance;
when the state machine example started by the example scheduler runs to the internal signal sending action, the event transceiver must send signals immediately, FireEvents are called to inform all the state machine examples, the event transceiver of each state machine example receives the signal event, and then whether the signal event needs to be responded is judged according to the current state and the service requirement of the event transceiver;
4) the event transceiver responds to internal/external events or processes internal trigger events;
when the event transceiver receives an event, judging whether the current event state is suspended or not, and if so, adding the current event state into an event queue according to business requirements; if the current state is not the suspended state, executing an EventStep method to calculate the next state and the next transition of the current state, and then informing the animation display according to actions including exiting of the current state, executing of the next transition and entering of the next state;
5) and the animation display is used for carrying out animation display through the received action notification simulation animation interface.
Further, when the SCXML file is analyzed, reading each attribute of the SCXML file by a GetAttribute method of an Xmlreader class, and after the attribute is read, performing data reading line by judging the type of the current node; judging the name of the current node in the process of reading line by line to organize various attributes of the SCXML class; then, by calling the UpdateSCXML method, operating each attribute including state, conversion, action and historical connector to generate an SCXML instance with complete attribute; the operations include initializing, assigning and ordering attributes.
When animation is displayed, if the current entering primitive is the initial state of the state diagram, firstly setting the default conversion source and the conversion line before the state as the entering color; if the current incoming primitive is a child state machine primitive, the child state machine instance of the instance scheduler is invoked to start the instance.
Further, when animation is displayed, if the simulation animation interface receives an entering or exiting notification, according to the ID of the current state in the SCXML instance, finding a corresponding primitive in a graphic display area of the simulation animation interface, setting the border of the primitive to a corresponding color, and simultaneously outputting a corresponding log entering or exiting a certain state in a log area;
if the simulation animation interface receives the conversion notice, finding corresponding source primitives and target primitives in a graphic display area of the simulation animation interface according to the source and target of the SCXML instance which is currently converted; then finding out a series of primitives of a specified path between the source and the target according to the currently converted cond and the event, and setting the borders of the primitives into the entering colors and then setting the borders into the exiting colors according to the sequence from the source to the target so as to realize the animation effect; and simultaneously, outputting a log of the transition from one state to another state in the log area.
Accordingly, referring to fig. 1, the present invention provides a system for visually displaying simulation execution, including:
the model converter is used for receiving the simulation model provided by the SysML state machine, converting the primitive into an executable SCXML code based on the primitive internal attribute of the state diagram in the simulation model, and generating the simulation model into a standard SCXML file by taking the state diagram as a generating unit;
the file parser receives the SCXML file and parses the SCXML file by an XmlReader method and attributes to generate an SCXML instance with complete attributes and assign values to the SCXML instance for the simulation engine and the instance scheduler to read;
the instance scheduler manages all generated SCXML instances, and starts a corresponding state machine instance when simulation is initiated; sending a calling event through the node on the state behavior;
an event transceiver for responding to an internal or external event and notifying the animation display according to exit of a current state, execution of a next transition, and a next state; when the event transceiver needs to send signals, all state machine instances are informed, and each state machine instance judges whether the signal event needs to be responded according to the current state and the service requirement of the state machine instance;
and the animation display is used for informing the simulation animation interface through the entering, exiting and converting actions of the state instance in the SCXML instance so as to display the animation.
The individual modules and their operation are explained below.
The model converter generates the SysML state machine model as a standard SCXML file to support further analysis and conversion, and a state diagram generates an SCXML file. When the SCXML is generated, the internal attributes of the primitives and the source and the target of the connecting line are analyzed based on the primitives of the state diagram, the primitives are converted into standard and executable SCXML codes, and different types of primitives correspondingly generate different elements of the SCXML.
The state graphic element can generate a state element of the SCXML file, such as < state id ═ s > < state >, and finally all graphic elements in the state graph are converted into elements in the SCXML file; the SCXML file is an XmlDocument class, and the element is XmlElement.
Taking the state primitive as an example, the related rule for converting the state diagram primitive into the SCXML code is given:
for the example where state s can jump to the s1 and s2 states under the triggers of e1 and e2, respectively, the code of the generated SCXML file is as follows:
the converted trigger attribute corresponds to the event, the condition attribute corresponds to the cond, and the target attribute corresponds to the target.
The file parser is supported by the SCXML file, and is used for the simulation engine to read and parse the semantics of the SCXML file, and the SCXML file is read by the XmlReader method and the attribute. Specifically, various attributes of the SCXML file are read through a GetAttribute method, and are assigned to the SCXML instance class. After the attribute is read, the data is read line by judging the value of the NodeType (the type of the current node). Judging the name of the current node (NodeName such as 'state', 'transition', 'entry', 'final' etc.) in the process of reading line by line to organize various attributes of SCXML class, then realizing the operations of initialization, assignment, sequencing and the like of the attributes of state, conversion, historical connectors and the like by calling the UpdateSCXML method of the file parser, finally generating an SCXML instance with complete attributes, and providing the SCXML instance for the instance scheduler.
The instance scheduler manages all SCXML instances (state machine instances) and starts the corresponding state machine instances. And sending calling events to other state machines through target attributes of the send nodes on the entrance behaviors, the Do behaviors, the exit behaviors and the conversion action behaviors of the states.
By way of example of an entry behavior primitive for a state, a description of an SCXML instance called for a child state machine is given.
And calling another state machine aiming at the entry behavior of the shutdown state, wherein the generated SCXML code is as follows:
the attribute of the called object Type (Statemochine) corresponds to Type, the attribute of the called object corresponds to event, and the attribute of the state diagram of the called object corresponds to target.
The event transceiver may respond to internal or external events, or may trigger events internally. The use of the TruggerEvents method is responsible for receiving events, while the FireEvents method is responsible for triggering events.
When the event transceiver receives an event, whether the current state is suspended or not is judged firstly, and if the current state is suspended, whether the current state needs to be added into an event queue or not is judged according to business requirements so as to facilitate later processing; if the state is not the suspend state, executing the EventStep method, calculating the information of the next state and the next transition of the current state, and then informing the animation display according to the actions of exiting the current state, executing the next transition and entering the next state.
When the event transceiver needs to send a signal (for example, execute to send a signal primitive), all state machine instances are notified by calling the FireEvents method, and each state machine instance judges whether to respond to the signal event according to the current state and the service requirement of the state machine instance.
The animation display is used for displaying animation by informing the simulation animation interface of actions such as entering, exiting, converting and the like of states.
When the simulation animation interface receives the notice of entering or exiting the event state, the corresponding primitive is found in the graphic display area of the simulation animation interface according to the ID of the current state, the frame of the primitive is set to be the corresponding color, and meanwhile, the log of entering or exiting a certain state is output in the log area.
If the current entering primitive is the initial state of the state diagram, firstly setting the default conversion source and the conversion line before the state as the entering color; if the current incoming primitive is a child state machine primitive, the child state machine instance of the instance scheduler is invoked to start the instance.
When the simulation animation interface receives the conversion notice, corresponding source primitives and target primitives are found in a graphic display area of the simulation animation interface according to the currently converted source and target, then a series of primitives of a specified path between the source and the target are found according to the currently converted cond and the currently converted event, and the border of the primitive is firstly set to be an entering color and then set to be an exiting color according to the sequence from the source to the target, so that the animation effect is achieved. And meanwhile, the log of the transition from one state to another state is output in the log area.
The animation display can also adjust the animation speed, specifically, an interval time (unit: millisecond) can be set, when the primitive is set to enter the color, a system.
Specific examples are given below.
The transmission control unit of a vehicle is a typical industrial system. And the transmission control unit receives a gear shifting command of a driver and controls gear shifting of the gearbox. In this case, a dynamic simulation based on the SCXML standard is implemented for the SysML state machine model of the transmission control unit.
A transmission control unit SysML state machine model of the car is created as shown in figure 3.
The SCXML file is generated based on the transmission control unit state machine model, and is converted into the SCXML file and elements in fig. 4 according to the state diagram and the primitives of fig. 3.
For the SCXML file into which the state diagram is converted, the following is shown:
<?xml version="1.0"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"version="1.0"
initial="339aded6-d0a1-429e-8f3c-d395a1da39dc@@P">
</scxml>
then, for the state (name P) primitive, the elements in the SCXML file are generated as follows:
according to the same rule, all the primitives in the state diagram of fig. 3 can be converted into an SCXML file.
And (3) initiating simulation, simulation execution process and animation display on the state machine of the transmission control unit, as shown in FIG. 5.
Fig. 5 shows this shift process in animation by shifting the R range to the N range during driving of the vehicle. Firstly, the state machine is currently in an R state, at the moment, an R state primitive is displayed in red, when external trigger N is received, the state machine is switched to an N state through conversion, at the moment, the R state and a conversion line are set to be green to represent an executed path, and the N state is set to be red to represent the current state.
The embodiments given above are preferable examples for implementing the present invention, and the present invention is not limited to the above-described embodiments. Any non-essential addition and replacement made by the technical characteristics of the technical scheme of the invention by a person skilled in the art belong to the protection scope of the invention.
Claims (10)
1. A method for visually displaying simulation execution, comprising the operations of:
1) the model converter receives a simulation model provided by a SysML state machine, and generates the simulation model into a standard SCXML file by taking a state diagram as a generating unit;
when the SCXML file is generated, the SCXML file is converted into a standard executable SCXML code based on the internal attributes of the graphic primitives of the state diagram and the source and the target of the phase connecting line in the graphic primitives;
2) the file parser receives the SCXML file, and the semantics of the SCXML file are parsed by an Xmlreader method and attributes to generate an SCXML instance and assign a value for the simulation engine and the instance scheduler to read;
3) when the simulation of the state machine model is initiated, all SCXML instances of the model are managed by an instance scheduler, and meanwhile, an event transceiver also starts to work;
the event transceiver responds to internal/external events or processes internal trigger events;
when the state instance in the SCXML instance is executed, if the internal attribute of the state instance contains a calling event, the calling event is sent through the event transceiver, and then the event transceiver informs the instance scheduler to start the corresponding SCXML instance;
4) when the SCXML instance started by the instance scheduler runs to an internal signal sending action, the event transceiver immediately sends a signal, the FireEvents are called to inform all state machine instances, the event transceiver of each state machine instance can receive the signal event, and then whether the signal event needs to be responded or not is judged according to the current state and the service requirement of the event transceiver;
when the event transceiver receives an event, judging whether the current event state is suspended or not, and if so, adding the current event state into an event queue according to business requirements; if the current state is not the suspended state, executing an EventStep method to calculate the next state and the next transition of the current state, and then informing the animation display according to actions including exiting of the current state, executing of the next transition and entering of the next state;
5) and the animation display is used for carrying out animation display through the received action notification simulation animation interface.
2. The method of claim 1, wherein in generating the SCXML file, a state diagram generates an SCXML file;
converting all the primitives in the state diagram into elements in the SCXML file, wherein the state primitives generate state elements of the SCXML file; the SCXML file is an XmlDocument class, and the element is XmlElement.
3. The method of claim 1, wherein when generating the SCXML file, abstracting the attributes inside the primitive into triggers, conditions, and targets, the following correspondence is adopted when converting into the SCXML file: and the trigger attribute in the graphic primitive corresponds to the event, the condition attribute corresponds to the cond, and the target end attribute corresponds to the target.
4. The method for simulation execution of visual display according to claim 1, wherein when parsing the SCXML file, reading each attribute of the SCXML file by using a gemtatribute method of XmlReader class, and after reading the attribute, reading data line by judging the type of the current node; judging the name of the current node in the process of reading line by line to organize various attributes of the SCXML class; then, by calling the UpdateSCXML method, operating each attribute including state, conversion, action and historical connector to generate an SCXML instance with complete attribute; the operations include initializing, assigning and ordering attributes.
5. The method for visually displaying simulation execution according to claim 1, wherein the instance scheduler sends call events to other state machines through target properties of send nodes on the entry behavior, Do behavior, exit behavior, transition action behavior including state instances.
6. A method for simulation execution of a visual display according to claim 1, wherein the event transceiver receives and responds to internal/external events by a TruggerEvents method, and processes internal trigger events by a FireEvents method.
7. The method according to claim 1, wherein during animation display, if the simulation animation interface receives an entry or exit notification, finding a corresponding primitive in a graphic display area of the simulation animation interface according to an ID of a current state in an SCXML instance, setting a border of the primitive to a corresponding color, and outputting a log corresponding to the entry or exit state in a log area;
if the simulation animation interface receives the conversion notice, finding corresponding source primitives and target primitives in a graphic display area of the simulation animation interface according to the source and target of the SCXML instance which is currently converted; then finding out a series of primitives of a specified path between the source and the target according to the currently converted cond and the event, and setting the borders of the primitives into the entering colors and then setting the borders into the exiting colors according to the sequence from the source to the target so as to realize the animation effect; and simultaneously, outputting a log of the transition from one state to another state in the log area.
8. The method of claim 1, wherein in animation display, if the current primitive is in the initial state of the state diagram, the default transition source and transition line before the state are set to the entered color; if the current incoming primitive is a child state machine primitive, the child state machine instance of the instance scheduler is invoked to start the instance.
9. A method for simulation execution of a visual display according to claim 1, wherein the animation display is further provided with an interval time setter for adjusting the animation speed, and when the primitive is set to enter the color, the system.
10. A system for visually displaying execution of a simulation, comprising:
the model converter is used for receiving the simulation model provided by the SysML state machine, converting the primitive into an executable SCXML code based on the primitive internal attribute of the state diagram in the simulation model, and generating the simulation model into a standard SCXML file by taking the state diagram as a generating unit;
the file parser receives the SCXML file and parses the SCXML file by an XmlReader method and attributes to generate an SCXML instance with complete attributes and assign values to the SCXML instance for the simulation engine and the instance scheduler to read;
the instance scheduler manages all generated SCXML instances, and starts a corresponding state machine instance when simulation is initiated; sending a calling event through the node on the state behavior;
an event transceiver for responding to an internal or external event and notifying the animation display according to exit of a current state, execution of a next transition, and a next state; when the event transceiver needs to send signals, all state machine instances are informed, and each state machine instance judges whether the signal event needs to be responded according to the current state and the service requirement of the state machine instance;
and the animation display is used for informing the simulation animation interface through the entering, exiting and converting actions of the state instance in the SCXML instance so as to display the animation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111419488.8A CN114090185B (en) | 2021-11-26 | 2021-11-26 | Method and system for performing visual display simulation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111419488.8A CN114090185B (en) | 2021-11-26 | 2021-11-26 | Method and system for performing visual display simulation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114090185A true CN114090185A (en) | 2022-02-25 |
CN114090185B CN114090185B (en) | 2024-08-30 |
Family
ID=80304896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111419488.8A Active CN114090185B (en) | 2021-11-26 | 2021-11-26 | Method and system for performing visual display simulation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114090185B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115454590A (en) * | 2022-08-09 | 2022-12-09 | 北京机电工程研究所 | Activity graph-oriented simulation scheduling method and system |
CN115827121A (en) * | 2023-01-16 | 2023-03-21 | 南京国睿信维软件有限公司 | Asynchronous simulation execution engine system and method based on graph elements |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050091672A1 (en) * | 2003-10-24 | 2005-04-28 | Microsoft Corporation | Facilitating presentation functionality through a programming interface media namespace |
CN110956570A (en) * | 2018-09-27 | 2020-04-03 | 英特尔公司 | Graphics engine reset and recovery in a multi-graphics context execution environment |
CN112558929A (en) * | 2019-09-26 | 2021-03-26 | 罗克韦尔自动化技术公司 | Artificial intelligence design analysis and recommendation |
CN113409434A (en) * | 2020-03-16 | 2021-09-17 | 英特尔公司 | Apparatus and method for throttling a ray tracing pipeline |
-
2021
- 2021-11-26 CN CN202111419488.8A patent/CN114090185B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050091672A1 (en) * | 2003-10-24 | 2005-04-28 | Microsoft Corporation | Facilitating presentation functionality through a programming interface media namespace |
CN110956570A (en) * | 2018-09-27 | 2020-04-03 | 英特尔公司 | Graphics engine reset and recovery in a multi-graphics context execution environment |
CN112558929A (en) * | 2019-09-26 | 2021-03-26 | 罗克韦尔自动化技术公司 | Artificial intelligence design analysis and recommendation |
CN113409434A (en) * | 2020-03-16 | 2021-09-17 | 英特尔公司 | Apparatus and method for throttling a ray tracing pipeline |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115454590A (en) * | 2022-08-09 | 2022-12-09 | 北京机电工程研究所 | Activity graph-oriented simulation scheduling method and system |
CN115827121A (en) * | 2023-01-16 | 2023-03-21 | 南京国睿信维软件有限公司 | Asynchronous simulation execution engine system and method based on graph elements |
CN115827121B (en) * | 2023-01-16 | 2023-05-16 | 南京国睿信维软件有限公司 | Asynchronous simulation execution engine system and method based on graph elements |
Also Published As
Publication number | Publication date |
---|---|
CN114090185B (en) | 2024-08-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114090185A (en) | Method and system for visually displaying simulation execution | |
CN113065656B (en) | Rule engine configuration method and device, server and readable storage medium | |
Heckel et al. | Towards model-driven testing | |
CN103198009B (en) | A kind of universal testing method, system and related device | |
CN111507020B (en) | Graphical display method for distributed simulation results of electromechanical systems of multi-electric aircraft | |
CN112799968B (en) | Test drive modeling system and method based on script | |
CN114218052A (en) | Service interaction graph generation method, device, equipment and storage medium | |
US20030106042A1 (en) | System and method for animating state diagram through debug connection | |
CN109086044B (en) | Simulation model development method based on components | |
Broy et al. | Interaction Interfaces-Towards a scientific foundation of a methodological usage of Message Sequence Charts | |
CN113590297A (en) | Method and equipment for transmitting process parameters back and forth | |
CN100419711C (en) | Emitter for service debug command, and processing method | |
CN112685039A (en) | Configuration method and device of low-code development platform | |
KR101965732B1 (en) | the method for controling motion platform using the authoring tool | |
CN103312552A (en) | Data simulation method, data simulation machine and communication system of data simulation machine | |
CN112199928A (en) | Report system based on machine learning and report generation method | |
CN111274055B (en) | Method, device, equipment and medium for processing block chain message | |
CN113672206B (en) | X language hybrid modeling platform and modeling method | |
JP2015138356A (en) | Software structure visualization device | |
CN116132214B (en) | Event transmission method, device, equipment and medium based on event bus model | |
CN114647429B (en) | Terminal function updating method based on AI intelligent assistant scene action protocol | |
WO2023164835A1 (en) | Workflow execution method and apparatus, storage medium, and program product | |
CN114968005A (en) | Equipment virtual training modeling method and device, terminal equipment and system | |
Goldsby et al. | Enabling a roundtrip engineering process for the modeling and analysis of embedded systems | |
CN114661280A (en) | Model simulation cloud and terminal interaction method, server, terminal and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |