CN103514331B - A kind of method from Simulink model conversion to uml model - Google Patents
A kind of method from Simulink model conversion to uml model Download PDFInfo
- Publication number
- CN103514331B CN103514331B CN201310466291.9A CN201310466291A CN103514331B CN 103514331 B CN103514331 B CN 103514331B CN 201310466291 A CN201310466291 A CN 201310466291A CN 103514331 B CN103514331 B CN 103514331B
- Authority
- CN
- China
- Prior art keywords
- model
- port
- class
- simulink
- conversion
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Abstract
The invention provides a kind of method from Simulink model conversion to uml model, by setting up the corresponding relation between model element and the model element of uml model of Simulink model, set up Simulink source meta-model framework and UML target element model framework, thus determine that Simulink model conversion is to the conversion method of uml model according to Simulink source meta-model and UML target element model.Present invention determine that the corresponding relation of Simulink model element and uml model element, simplify the complexity of model conversion, solve in CPS system, the problem that general modeling process area refinement problem and the process of calculating and physical process merge, solve Simulink weak tendency on Requirements Modeling and uml model and express control, the defect in terms of algorithm modeling, both have complementary advantages, maximize favourable factors and minimize unfavourable ones, improve the efficiency of model development.
Description
Technical field
The present invention relates to a kind of information physical emerging system, a kind of method of model conversion.
Background technology
Information physical emerging system (Cyber-Physical System, CPS) refers on the basis of environment sensing, deeply
Degree has merged the networking physical equipment system of 3C, and it is followed by the interactional feedback of calculating process and physical process
Ring realizes depth integration and real-time, interactive, monitors or control physics in fact in the way of safe, reliable, efficient and real-time
Body, its objective is to realize the depth integration of information world and physical world.Divide according to function and system property, CPS
Integrated Model can be divided into physical entity, computational entity and interworking entity.Physical entity refer to physical process and
The physical environment that the degree of depth embeds, its process is predominantly represented as the physical rules followed at continuous-time domain, use based on
Physical entity is portrayed by the dynamic continuous simulation model of time stepping method;Computational entity refers mainly to the computing unit of CPS
And control unit, its process is predominantly represented as data and processes and logic control, uses based on event driven dynamic discrete
Computational entity is portrayed by simulation model;Interworking entity is often made up of physical feature or calculating component, mainly describes
Combinations thereof characteristic, interactive interface rule, syncretic relation and behavioral trait.
Model driving development method (Model Driven Development, be called for short MDD) can stage pair in early days
System is analyzed and verifies, helps to ensure that the qualitative attribute of system, and effectively controls development time and cost.Mould
Type is converted to model-driven and relates to the core of development approach, and it refers to the model conversion that a kind of language describes is become other one
Plant the model that language describes.It is considered as complicated embedded real time system based on model-driven design and the base realized
Plinth.
Simulink model is mainly used to portray continuous dynamic process based on time stepping method, and uml model is mainly used to carve
Draw based on event driven discrete action process.Use UML to the static structure simulation modeling of computational entity and based on
The dynamic behaviour simulation modeling of discrete event control system, and use Simulink that the dynamic Continuous behavior of physical entity is imitated
True modeling has become the main flow of engineering test.But the isomerism of CPS, shows the isomery of Simulink and UML
Property so that the fusion of CPS physical entity and computational entity is in the face of the biggest challenge.
The most existing a lot of collaborative simulation modeling method based on Simulink and UML.Germany's Fraunhofer research
Mechanism realizes UML and the Simulink collaborative simulation at embedded real-time domain by extensible SQL Profile, Holland
Nijmegen university by extensible SQL upon execution between the ability to express of aspect realize UML and Simulink embedding
Entering the synchronization simulation of formula real-time domain, UML and Simulink model code is integrated into by EXTESSY mechanism of Germany
One unified system architecture realizes the collaborative simulation of Simulink and UML at code level.
But these integrated approaches the most fundamentally solve the fusion problem of Simulink and UML, CPS physics
Entity and the isomerism of computational entity, show as Simulink and the difference substantially of uml model element so that this
A little synergy emulation methods can not meet the requirement that CPS system depth merges.
Summary of the invention
In order to overcome the deficiencies in the prior art, for problem above, the present invention proposes with Simulink model physics
Entity carries out simulation modeling, with uml model, computational entity is carried out simulation modeling, uses model between two-layer model
Conversion method, uses model transformation tools to realize the conversion to UML computation model of the Simulink physical model, completes CPS
The collaborative simulation of system-computed-physical entity integration.
The invention solves the problems that above-mentioned Simulink model and the Heterogeneity of uml model, it is provided that a kind of from Simulink model
Change the conversion method to uml model.
The technical solution adopted for the present invention to solve the technical problems, comprises the steps:
1) corresponding relation between model element and the model element of uml model of Simulink model is set up
For the basic model Elements Atom module Primitive Block in Simulink model, subsystem module
SubSystem Block, line Line/Branch and port Port, between ATL transformation rule implementation model element
Change one to one, respectively by model element class Class that its corresponding conversion is uml model, class containing submodule
Class Contained Blocks, connector Connector, flow port Flowport;
2) Simulink source meta-model framework and UML target element model framework are set up
Setting up Simulink source meta-model framework, Simulink source meta-model includes atom module and the unit containing subsystem module
Model E Block, the meta-model EPort of port, the meta-model ELine of line, the meta-model EParameter of parameter and letter
The meta-model EFunction of number, sets up Simulink source meta-model framework, uses polymerization between EBlock and EParameter
Relation, an EBlock can comprise multiple EParameter;Paradigmatic relation is used between EBlock and EFunction,
One EBlock can comprise multiple EFunction;Paradigmatic relation, an EBlock is used between EBlock and EPort
Multiple EPort can be comprised;Using paradigmatic relation between ELine and EPort, an ELine can comprise multiple EPort;
Setting up UML target element model framework, UML target element model includes class and the meta-model of the class containing submodule
EClass, the meta-model EConnector of connector, the meta-model EFlowport of flow port, the meta-model of attribute
The meta-model EOperation of EAttribute and operation;Set up UML target element model framework, EClass and EAttribute
Between use paradigmatic relation, an EClass can comprise multiple EAttribute;Use between EClass and EOperation
Paradigmatic relation, an EClass can comprise multiple EOperation;Polymerization is used between EConnector and EFlowport
Relation, an EConnector can comprise multiple EFlowport;
Set up the ecore structure of Simulink basic element meta-model: according to Simulink source meta-model framework, define ecore
Structure comprises five classes, is Block, Parameter, Function, Port, Line respectively;Change in class Block
Amount has function functions, input parameter srcBlkParams, output parameter dstBlkParams, flows into port srcBlkPorts
With outflow port dstBlkPorts, the type of functions is the type of Function, srcBlkParams and dstBlkParams
Type for Parameter, srcBlkPorts and dstBlkPorts is Port;The variable of class Parameter has Parameter institute
In module blockParameter, the type of blockParameter is Block, when Parameter is input data,
BlockParameter represents data source module srcBlockParameter, when Parameter is output data,
BlockParameter represents that data arrive module dstBlockParameter;Variable in class Function has Function institute
In module blockFunction, the type of blockFunction is Block;Variable in class Port comprises Port place module
The type of line linePort, blockPort associated by blockPort and Port is Block, when Port is input data,
BlockPort is input module srcBlockPort, when Port is output data, and blockPort is output module
The type of dstBlockPort, linePort is Line, when Port is input data, and line is input link srcLinePort,
When Port is output data, line is output line dstLinePort;Variable in Line has the port that line is associated
The type of portLine, portLine is that Port, Line two ends connect two ports, according to data input or data output,
Input port srcLnPorts and output port dstLnPorts can be divided into;
Set up the ecore structure of UML basic element meta-model: according to UML target element model framework, definition ecore knot
Structure comprises five classes, is Class, Attribute, Operation, Flowport and Connector respectively;Class Class
In variable have parameter, operation, port, the type of parameter is Attribute, and the type of operation is Operation, end
The type of mouth is Flowport;Variable in class Arrtibute has attribute place class classAttribute, classAttribute
Type be Class;Variable in class Operation has operation place class classOperation, the class of classOperation
Type is Operation;The company that variable ports having place class classFlowport in class Flowport and Flowport are associated
Meeting device conncetorFlowport, the type of classFlowport is that the type of Class, conncetorFlowport is
The type in Connector, Flowport direction is EString, and when Flowport is input port, Flowport direction is
" IN ", when Flowport is output port, Flowport direction is " OUT ";Variable in class Connector has
The type of port flowportConnector, flowportConnector that Connector is associated is Flowport;
3) determine that Simulink model conversion is to UML according to Simulink source meta-model and UML target element model
The conversion method of model
ATL transformation rule is used to be converted to the Class in UML, when Simulink mould the Block in Simulink model
When there is ring in type, will look around is a Block, by the parameter in Block, function, port and Block's thereof itself
Name and type information, the name of attribute, operation, flow port and Class during corresponding conversion is Class respectively and type
Information;Wherein, Simulink parameter to the conversion of UML attribute, including the class that the conversion of parameter name is corresponding with parameter
The conversion of information, including the conversion of srcBlockParameter and dstBlockParameter to classAttribute;
The conversion that Simulink function operates to UML, including the conversion of operation operation name, the information of the class corresponding with operation
Conversion, including the conversion of blockFunction to classOperation;Simulink port turning to UML flow port
Changing, including conversion and the conversion of port direction of port name, wherein, flow port direction corresponding for srcBlkPorts is
" IN ", flow port direction corresponding for dstBlkPorts is " OUT ";Determine Simulink model element Line to UML
The conversion of model element Connector, including the conversion of Line name, and the port srcLnPorts that connects of Line and
The conversion of dstLnPorts, the conversion of srcLnPorts and dstLnPorts includes the conversion of port name and turning of port direction
Changing, flow port direction corresponding for srcLnPorts is " IN ", and flow port direction corresponding for dstLnPorts is " OUT ",
Achieve the conversion to uml model of the Simulink model at this, solve CPS field calculating process and physical process is melted
The problem closed.
The invention has the beneficial effects as follows the model element owing to analyzing Simulink model and uml model, it is determined that
The corresponding relation of Simulink model element and uml model element, simplifies the analysis to complex model:
1. the present invention analyzes Simulink meta-model and the structure of UML meta-model, devise Simulink source meta-model and
The framework of UML target element model, simplifies the complexity of model conversion;
2. the object module of the model conversion strategy in the present invention is uml model, due to Simulink be good at description based on
The continuous process of time stepping method, UML is then used for describing process based on discrete event control system, this model conversion strategy
Occur, solve in CPS system, the problem of general modeling process area refinement and the process of calculating and physical process
The problem merged.
Solving Simulink weak tendency on Requirements Modeling the most simultaneously, and uml model is expressing control, algorithm is built
Both are had complementary advantages, maximize favourable factors and minimize unfavourable ones, to improve the efficiency of model development by the defect in terms of mould.
Accompanying drawing explanation
Fig. 1 is the overall framework of model conversion.
Fig. 2 is Simulink basic element metamodel structure definition figure.
Fig. 3 is UML basic element metamodel structure definition figure.
Fig. 4 is Simulink model illustration, and wherein, In1, In2 represent that input port, Out1 represent output port, Line1,
Line2, Line3, Line4, Line5 represent that line, Integrator represent integrator module, Integrator, Line2,
Line4 and adder composition subsystem module SubSystem, Add represents atom module, is used for realizing add operation.
Fig. 5 is uml model illustration, and itsSubSystem:SubSystem, itsSum:Sum represent class, inAttribute1,
InAttribute2, inAttribute3, outAttribute1, outAttribute2 represent attribute, and double is the type of attribute,
In1, In2, In3, Out1, Out2 represent that flow port, Line2 represent connector.
Fig. 6 is the state diagram of class in uml model.The state diagram of SubSystem during wherein (a) is uml model illustration,
Active is the name of state, and tm (100) represents time-event, and every 100ms triggers once, SubSystemFunction ()
Representing operation, (b) is the state diagram of Sum in uml model illustration, and Active represents the name of state, tm (100) table
Showing time-event, every 100ms triggers once, and SumFunction () represents operation.
Detailed description of the invention
The present invention is further described with embodiment below in conjunction with the accompanying drawings.
The present invention relates to the model transformation tools of Simulink a to UML, this model transformation tools is to arbitrarily
Simulink model, can convert it to corresponding uml model automatically.The overall framework of model conversion such as Fig. 1
Shown in.
The step of conversion method is:
1) corresponding relation between model element and the model element of uml model of Simulink model is set up
For the basic model Elements Atom module Primitive Block in Simulink model, subsystem module
SubSystem Block, line Line/Branch and port Port, by ATL transformation rule implementation model element it
Between change one to one, respectively by model element class Class that its corresponding conversion is uml model, containing submodule
Class Class Contained Blocks, connector Connector, flow port Flowport;
The meta-model of definition original language Simulink and object language UML, meta-model is to retouch with OO thought
State the syntactic structure of a kind of language, so that during model conversion, can carry out corresponding according to its corresponding syntactic element
Conversion.For the feature of model conversion, employ KM3 and redescribed the meta-model language of Simulink and UML
Method structure.
2) Simulink source meta-model framework and UML target element model framework are set up
Setting up Simulink source meta-model framework, Simulink source meta-model includes atom module and containing subsystem module
Meta-model EBlock, the meta-model EPort of port, the meta-model ELine of line, the meta-model EParameter of parameter
With the meta-model EFunction of function, set up Simulink source meta-model framework, between EBlock and EParameter
Using paradigmatic relation, an EBlock can comprise multiple EParameter;Use between EBlock and EFunction
Paradigmatic relation, an EBlock can comprise multiple EFunction;Paradigmatic relation is used between EBlock and EPort,
One EBlock can comprise multiple EPort;Using paradigmatic relation between ELine and EPort, an ELine is permissible
Comprise multiple EPort;Paradigmatic relation is as shown in Figure 2.
Setting up UML target element model framework, UML target element model includes class and the meta-model of the class containing submodule
EClass, the meta-model EConnector of connector, the meta-model EFlowport of flow port, the meta-model of attribute
The meta-model EOperation of EAttribute and operation;Set up UML target element model framework, EClass and EAttribute
Between use paradigmatic relation, an EClass can comprise multiple EAttribute;Between EClass and EOperation
Using paradigmatic relation, an EClass can comprise multiple EOperation;Between EConnector and EFlowport
Using paradigmatic relation, an EConnector can comprise multiple EFlowport;Paradigmatic relation is as shown in Figure 3.
Set up the ecore structure of Simulink basic element meta-model: according to Simulink source meta-model framework, definition
Ecore structure comprises five classes, is Block, Parameter, Function, Port, Line respectively;Class Block
In variable have function functions, input parameter srcBlkParams, output parameter dstBlkParams, flow into end
Mouthful srcBlkPorts and flow out port dstBlkPorts, the type of functions be Function, srcBlkParams and
The type of dstBlkParams be the type of Parameter, srcBlkPorts and dstBlkPorts be Port;Class Parameter
Variable have Parameter place module blockParameter, the type of blockParameter is Block, when
When Parameter is input data, blockParameter represents data source module srcBlockParameter, when
When Parameter is output data, blockParameter represents that data arrive module dstBlockParameter;Class
Variable in Function has Function place module blockFunction, and the type of blockFunction is Block;
Variable in class Port comprises line linePort, blockPort associated by Port place module blockPort and Port
Type be Block, when Port be input data, blockPort is input module srcBlockPort, when Port is
Output data, blockPort be the type of output module dstBlockPort, linePort be Line, when Port be input
Data, line is input link srcLinePort, and when Port is output data, line is output line dstLinePort;
Variable in Line has the type of the port portLine, portLine that line is associated to be that Port, Line two ends connect two
Individual port, according to data input or data output, can be divided into input port srcLnPorts and output port
dstLnPorts;
Set up the ecore structure of UML basic element meta-model: according to UML target element model framework, define ecore
Structure comprises five classes, is Class, Attribute, Operation, Flowport and Connector respectively;Class
Variable in Class has parameter, operation, port, and the type of parameter is Attribute, and the type of operation is Operation,
The type of port is Flowport;Variable in class Arrtibute has attribute place class classAttribute, classAttribute
Type be Class;Variable in class Operation has operation place class classOperation, classOperation's
Type is Operation;Variable ports having place class classFlowport in class Flowport is relevant with Flowport
The type that type is Class, conncetorFlowport of the connector conncetorFlowport, classFlowport of connection
Type for Connector, Flowport direction is EString, when Flowport is input port, and Flowport
Direction is " IN ", and when Flowport is output port, Flowport direction is " OUT ";In class Connector
Variable have the type of port flowportConnector, flowportConnector that Connector is associated to be
Flowport;
3) determine that Simulink model conversion is to UML according to Simulink source meta-model and UML target element model
The conversion method of model
Use ATL transformation rule to be converted to the Class in UML the Block in Simulink model, work as Simulink
When there is ring in model, will look around is a Block, by the parameter in Block, function, port and Block thereof originally
The name of body and type information, the name of attribute, operation, flow port and Class during corresponding conversion is Class respectively
And type information.Wherein, Simulink parameter to the conversion of UML attribute, including conversion and the parameter of parameter name
The conversion of the information of corresponding class, including srcBlockParameter and dstBlockParameter to classAttribute
Conversion;The conversion that Simulink function operates to UML, including the conversion of operation operation name, corresponding with operation
The conversion of information of class, including the conversion of blockFunction to classOperation;Simulink port is to UML
The conversion of flow port, including conversion and the conversion of port direction of port name, wherein, the stream that srcBlkPorts is corresponding
Port direction is ' flow port direction that IN ', dstBlkPorts are corresponding be ' OUT '.Determine Simulink model element Line
To the conversion of uml model Elements C onnector, including the conversion of Line name, and the port that Line connects
The conversion of srcLnPorts and dstLnPorts, the conversion of srcLnPorts and dstLnPorts includes the conversion of port name
With the conversion of port direction, flow port direction corresponding for srcLnPorts is " IN ", the flow port that dstLnPorts is corresponding
Direction is " OUT ", achieves the conversion to uml model of the Simulink model at this, solves CPS field meter
The problem that calculation process and physical process merge.
As a example by Simulink model in Fig. 4, concrete conversion method is:
A, define the title of known Simulink model uml model to be transformed into.
B, determine the module information at Simulink parameter place, the name of acquisition module.
Judging whether to define srcBlockParameter, if defining, then it is right to be obtained by srcBlockParameter
Answering the name of Block, if not having, then being obtained the name of corresponding Block by dstBlockParameter;Otherwise,
Need oneself to define;According to Simulink embodiment, sub-Block SubSystem defines srcBlockParameter
InAttribute2, then the name of corresponding for InAttribute2 module is SubSystem, as it is shown in figure 5, similar,
The name of the module that InAttribute1 is corresponding is Sum.
C, determine the module information at Simulink function place, the name of acquisition module.
Judging whether to define blockFunction, if defining, then obtaining corresponding Block by blockFunction
Name, if not having, the most do not carry out any operation;Otherwise, need oneself to define;According to Simulink embodiment,
Sub-Block SubSystem defines blockFunction SubSystemFunction, then SubSystemFunction
The name of corresponding module is SubSystem, as shown in Figure 5.
D, the Class be converted to by the Block in Simulink model in UML, when going out in Simulink model
During existing ring, will look around is a block.
Obtain all parameters, function, port and the Block self-information (name, type) thereof in Block, respectively
Be converted to the information (name, type) of the attribute in Class, operation, flow port and Class;As Simulink is real
Executing in example, Block SubSystem is converted to uml class SubSystem, and Sum is converted to uml class Sum, type
For Add.Wherein, Simulink parameter to the conversion of UML attribute, including parameter information (parameter name etc.)
Conversion, the conversion of the information of the class corresponding with parameter, arrive including srcBlockParameter and dstBlockParameter
The conversion of classAttribute;As in Simulink Block SubSystem srcBlkParams inAttribute2 and
DstBlkParams outAttribute2 be converted to attributes inAttribute2 in UML Class Subsystem and
outAttribute2.The conversion that Simulink function operates to UML, including turning of operation information (operation name etc.)
Changing, the conversion of the information of the class corresponding with operation, including the conversion of blockFunction to classOperation;As
Operations during functions SumFunction is converted to UML Class Sum in Simulink Block Sum
SumFunction.Simulink port is to the conversion of UML flow port, including conversion and the port direction of port information
Conversion, wherein, flow port direction corresponding for srcBlkPorts is " IN ", the flow port side that dstBlkPorts is corresponding
To for " OUT ";As the srcBlkPorts In1 of Simulink Block Sum is converted to UML Class Sum's
ClassFlowports In1, and flowportDirection is " IN ".Determine that Simulink model element Line arrives
The conversion of uml model Elements C onnector, including the conversion of Line information, and the port srcLnPorts that Line connects
With the conversion of dstLnPorts, the conversion of srcLnPorts and dstLnPorts includes conversion and the port direction of port information
Conversion, flow port direction corresponding for srcLnPorts is " IN ", and flow port direction corresponding for dstLnPorts is " OUT ",
As the Line2 in Simulink is converted to UML Connector Line2, its dstLnPorts In3 is converted to UML
Flowports In3, flowportDirection in Class are " OUT ".
E, by the meta-model of Simulink model and step 2) defined in Simulink ecore model, UML ecore
Model and by step 3) in the transformation rule write of conversion method be loaded in model transformer, configuration operation environment,
Generate the meta-model of corresponding uml model.
The meta-model of Simulink model is obtained by Simulink model.The data of Simulink model are at project folder
Under preserve with XML file form, so needing, by processing XML file, to be reduced to become and meet
The .xmi file of Simulink source meta-model framework.The meta-model of uml model is to meet UML target element model framework
.xmi model file is described.
For uml model binding state figure, according to the Simulink model data information setting sampling time, extract by
In the C/C++ code of the Simulink model that Simulink/RTW (Real-Time Workshop, real-time tool) generates
Function SimulinkFunction (), adds in UML state diagram, extracts Simulink embodiment mould respectively such as Fig. 6
Function SubSystemFunction () in the C/C++ code of type and SumFunction ().
Claims (1)
1. the method from Simulink model conversion to uml model, it is characterised in that comprise the steps:
1) corresponding relation between model element and the model element of uml model of Simulink model is set up
For the basic model Elements Atom module Primitive Block in Simulink model, subsystem module
SubSystem Block, line Line/Branch and port Port, between ATL transformation rule implementation model element
Change one to one, respectively by model element class Class that its corresponding conversion is uml model, class containing submodule
Class Contained Blocks, connector Connector, flow port Flowport;
2) Simulink source meta-model framework and UML target element model framework are set up
Setting up Simulink source meta-model framework, Simulink source meta-model includes atom module and the unit containing subsystem module
Model E Block, the meta-model EPort of port, the meta-model ELine of line, the meta-model EParameter of parameter and letter
The meta-model EFunction of number, sets up Simulink source meta-model framework, uses polymerization between EBlock and EParameter
Relation, an EBlock can comprise multiple EParameter;Paradigmatic relation is used between EBlock and EFunction,
One EBlock can comprise multiple EFunction;Paradigmatic relation, an EBlock is used between EBlock and EPort
Multiple EPort can be comprised;Using paradigmatic relation between ELine and EPort, an ELine can comprise multiple EPort;
Setting up UML target element model framework, UML target element model includes class and the meta-model of the class containing submodule
EClass, the meta-model EConnector of connector, the meta-model EFlowport of flow port, the meta-model of attribute
The meta-model EOperation of EAttribute and operation;Set up UML target element model framework, EClass and EAttribute
Between use paradigmatic relation, an EClass can comprise multiple EAttribute;Use between EClass and EOperation
Paradigmatic relation, an EClass can comprise multiple EOperation;Polymerization is used between EConnector and EFlowport
Relation, an EConnector can comprise multiple EFlowport;
Set up the ecore structure of Simulink basic element meta-model: according to Simulink source meta-model framework, define ecore
Structure comprises five classes, is Block, Parameter, Function, Port, Line respectively;Change in class Block
Amount has function functions, input parameter srcBlkParams, output parameter dstBlkParams, flows into port srcBlkPorts
With outflow port dstBlkPorts, the type of functions is the type of Function, srcBlkParams and dstBlkParams
Type for Parameter, srcBlkPorts and dstBlkPorts is Port;The variable of class Parameter has Parameter institute
In module blockParameter, the type of blockParameter is Block, when Parameter is input data,
BlockParameter represents data source module srcBlockParameter, when Parameter is output data,
BlockParameter represents that data arrive module dstBlockParameter;Variable in class Function has Function institute
In module blockFunction, the type of blockFunction is Block;Variable in class Port comprises Port place module
The type of line linePort, blockPort associated by blockPort and Port is Block, when Port is input data,
BlockPort is input module srcBlockPort, when Port is output data, and blockPort is output module
The type of dstBlockPort, linePort is Line, when Port is input data, and line is input link srcLinePort,
When Port is output data, line is output line dstLinePort;Variable in Line has the port that line is associated
The type of portLine, portLine is that Port, Line two ends connect two ports, according to data input or data output,
Input port srcLnPorts and output port dstLnPorts can be divided into;
Set up the ecore structure of UML basic element meta-model: according to UML target element model framework, definition ecore knot
Structure comprises five classes, is Class, Attribute, Operation, Flowport and Connector respectively;Class Class
In variable have parameter, operation, port, the type of parameter is Attribute, and the type of operation is Operation, end
The type of mouth is Flowport;Variable in class Arrtibute has attribute place class classAttribute, classAttribute
Type be Class;Variable in class Operation has operation place class classOperation, the class of classOperation
Type is Operation;The company that variable ports having place class classFlowport in class Flowport and Flowport are associated
Meeting device conncetorFlowport, the type of classFlowport is that the type of Class, conncetorFlowport is
The type in Connector, Flowport direction is EString, and when Flowport is input port, Flowport direction is
" IN ", when Flowport is output port, Flowport direction is " OUT ";Variable in class Connector has
The type of port flowportConnector, flowportConnector that Connector is associated is Flowport;
3) determine that Simulink model conversion is to UML according to Simulink source meta-model and UML target element model
The conversion method of model
Use ATL transformation rule to be converted to the Class in UML the Block in Simulink model, work as Simulink
When there is ring in model, will look around is a Block, by the parameter in Block, function, port and Block thereof originally
The name of body and type information, the name of attribute, operation, flow port and Class during corresponding conversion is Class respectively
And type information;Wherein, Simulink parameter to the conversion of UML attribute, including conversion and the parameter of parameter name
The conversion of the information of corresponding class, including srcBlockParameter and dstBlockParameter to classAttribute
Conversion;The conversion that Simulink function operates to UML, including the conversion of operation operation name, corresponding with operation
The conversion of information of class, including the conversion of blockFunction to classOperation;Simulink port is to UML
The conversion of flow port, including conversion and the conversion of port direction of port name, wherein, the stream that srcBlkPorts is corresponding
Port direction is " IN ", and flow port direction corresponding for dstBlkPorts is " OUT ";Determine Simulink model element
Element Line is to the conversion of uml model Elements C onnector, including the conversion of Line name, and the end that Line connects
The conversion of mouth srcLnPorts and dstLnPorts, the conversion of srcLnPorts and dstLnPorts includes turning of port name
Changing the conversion with port direction, flow port direction corresponding for srcLnPorts is " IN ", stream end corresponding for dstLnPorts
Mouth direction is " OUT ", achieves the conversion to uml model of the Simulink model at this, solves CPS field
The problem that calculating process and physical process merge.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310466291.9A CN103514331B (en) | 2013-09-30 | 2013-09-30 | A kind of method from Simulink model conversion to uml model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310466291.9A CN103514331B (en) | 2013-09-30 | 2013-09-30 | A kind of method from Simulink model conversion to uml model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103514331A CN103514331A (en) | 2014-01-15 |
CN103514331B true CN103514331B (en) | 2016-08-31 |
Family
ID=49897047
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310466291.9A Expired - Fee Related CN103514331B (en) | 2013-09-30 | 2013-09-30 | A kind of method from Simulink model conversion to uml model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103514331B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106096126B (en) * | 2016-06-08 | 2019-06-25 | 华东师范大学 | A kind of modeling method of the information physical emerging system based on SysML/MARTE |
CN107766943A (en) * | 2016-08-15 | 2018-03-06 | 中国科学院软件研究所 | A kind of Knowledge Component automation exchange method under CPS environment |
CN108664241B (en) * | 2018-04-23 | 2021-05-07 | 华东师范大学 | Method for carrying out simulation verification on SysML model |
CN115686503A (en) * | 2022-11-03 | 2023-02-03 | 北京世冠金洋科技发展有限公司 | Engineering conversion method and system |
CN117648833A (en) * | 2024-01-30 | 2024-03-05 | 浙江大学 | Simulink-to-SysML model generation method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102227714A (en) * | 2008-11-28 | 2011-10-26 | 英科伦有限责任公司 | Method system and simulation or analysis model for data processing |
CN102436375A (en) * | 2011-10-28 | 2012-05-02 | 东南大学 | Characters per second (CPS) Modeling and verification method based on model transformation |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8046207B2 (en) * | 2005-12-27 | 2011-10-25 | The Mathworks, Inc. | Digital effects analysis in modeling environments |
US7882462B2 (en) * | 2006-09-11 | 2011-02-01 | The Mathworks, Inc. | Hardware definition language generation for frame-based processing |
-
2013
- 2013-09-30 CN CN201310466291.9A patent/CN103514331B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102227714A (en) * | 2008-11-28 | 2011-10-26 | 英科伦有限责任公司 | Method system and simulation or analysis model for data processing |
CN102436375A (en) * | 2011-10-28 | 2012-05-02 | 东南大学 | Characters per second (CPS) Modeling and verification method based on model transformation |
Non-Patent Citations (4)
Title |
---|
Addressing Modeling Challenges in Cyber-Physical Systems;Patricia Derler etal.;《Technical Report No.UCB/EECS-2011-17》;20110304;全文 * |
信息-物理融合系统若干关键问题综述;李仁发 等;《计算机研究与发展》;20120630;第49卷;第1149-1161页 * |
模型转换中特性保持的描述与验证;刘辉 等;《软件学报》;20071031;第18卷(第10期);第2369-2379页 * |
面向CPS系统仿真的建模方法研究与设计;刘厦 等;《计算机科学》;20120731;第39卷(第7期);第32-35页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103514331A (en) | 2014-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103514331B (en) | A kind of method from Simulink model conversion to uml model | |
CN106021816B (en) | A kind of implementation method of the distributed system behavior simulation analysis tool of Behavior-based control tree | |
CN101504688B (en) | HLA based simulation software interaction method | |
CN107766042A (en) | A kind of visual data manager and device of the model file based on CSAR | |
CN106096145B (en) | A kind of complication system mathematics library and analysis system based on state space | |
Karsai et al. | Specifying graphical modeling systems using constraint-based meta models | |
CN106681726A (en) | Method for converting Python model to Modelica model | |
CN105183987B (en) | A kind of complex engineering multidisciplinary synthesis design optimization software platform system | |
Zeigler et al. | Service-oriented model engineering and simulation for system of systems engineering | |
CN102722601B (en) | Implementation method of formal semantic integration framework for model transformation of numerical control system | |
Sanchez et al. | Bigraphical modelling of architectural patterns | |
CN106682323B (en) | A kind of converting system and its method that framework model is converted to Dynamic Simulation Model | |
CN106372359B (en) | A kind of equipment virtual prototype system | |
Aurisicchio et al. | The function analysis diagram | |
CN102890740A (en) | Multi-domain system design and optimization method | |
CN111191327A (en) | Parametric automatic modeling system of five-joint welding robot | |
CN109033720A (en) | A kind of multidisciplinary associative simulation and optimization method based on unified Modeling environment | |
CN103324776A (en) | Linear hybrid system invariance generating method based on abstract interpretation | |
CN106022944B (en) | Data volume conversion method and device for conventional and streamline models in numerical reservoir simulation | |
Li et al. | A system for 3D digital assembly process planning and simulation in airplane manufacturing enterprises | |
Braun et al. | An open-source framework for efficient co-simulation of fluid power systems | |
Wang et al. | Study on integrated modeling methods toward co-simulation of cyber-physical system | |
Karsai et al. | Towards Two-Level Formal Modeling of Computer-Based Systems. | |
Wang et al. | Collaborative simulation environment framework based on SOA | |
CN107704650A (en) | Using the ASIP design methods of ADL executable specifications |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160831 Termination date: 20180930 |