CN102681855A - Model-to-code converting method facing wireless sensor network - Google Patents

Model-to-code converting method facing wireless sensor network Download PDF

Info

Publication number
CN102681855A
CN102681855A CN2012101651655A CN201210165165A CN102681855A CN 102681855 A CN102681855 A CN 102681855A CN 2012101651655 A CN2012101651655 A CN 2012101651655A CN 201210165165 A CN201210165165 A CN 201210165165A CN 102681855 A CN102681855 A CN 102681855A
Authority
CN
China
Prior art keywords
code
attribute
transformation
class
mapping ruler
Prior art date
Application number
CN2012101651655A
Other languages
Chinese (zh)
Inventor
陈志�
岳书珍
岳文静
杨萌
张亚萍
孙万兴
Original Assignee
南京邮电大学
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 南京邮电大学 filed Critical 南京邮电大学
Priority to CN2012101651655A priority Critical patent/CN102681855A/en
Publication of CN102681855A publication Critical patent/CN102681855A/en

Links

Abstract

The invention relates to a model-to-code converting method facing a wireless sensor network; a used unified modeling language-to-code converting method is a converting method based a visitor; a specific mapping rule of a model and a target code is defined according to the relationship between the model and the code; then the visitor is set to access the model; the mapping rule is embedded into the visitor; the visitor reads the model according to the mapping rule while converting a target language frame model according to the mapping rule when accessing the model to obtain a target language program code, and finish conversion from the model to the target language, so that the problem of conversion from the model to the code in the wireless sensor network can be effectively solved, and the application development efficiency is greatly increased.

Description

A kind of model towards wireless sense network is to the method for transformation of code

Technical field

The present invention relates to the method for transformation of a kind of model towards wireless sense network to code; Mainly be to set up the mapping ruler of model to code; Utilize the visitor to visit model and realize transforming, belong to wireless sense network, soft project, model-driven and code and generate the interleaving techniques application.

Background technology

Wireless sense network is made up of the sensor node that is deployed in the monitored area; The ad hoc network system of a multi-hop that forms through communication; Purpose is an object information in cooperation ground perception, collection, the processing network's coverage area, and sends to the observer.Sensor node is made up of sensor assembly, processor module, wireless communication module and energy supply module four parts, and sensor assembly is responsible for the collection and the data-switching of monitored area internal information; Processor module is responsible for controlling the operation of whole sensor node, data and other node data sent that storage and processing itself are gathered; Wireless communication module is responsible for carrying out radio communication with other sensor nodes, exchange control messages and transmitting-receiving image data; The energy supply module is that sensor node provides the operation energy needed, uses minicell usually.Wireless sense network is brand-new developing direction in the information science field, simultaneously also is new branch of science and traditional subject carries out the result of intersecting between the field.Wireless sense network then is incorporated into network technology in the wireless intelligence sensor; Make that sensor no longer is single perception unit; But can exchange message, coordinate the organic combination of control; Realize the interconnected of thing and thing, go deep into each corner, the world to the perception feeler, will become the important component part of Next Generation Internet.

Based on the characteristics and the application demand of wireless sense network, it is an event driven operating system that designs for sensor network nodes that the TinyOS of Berkeley University's exploitation is one, and sensor network nodes has very Limited resources.For satisfying the requirement of wireless sense network, the researchist introduces 4 kinds of technology in TinyOS: light thread, active message, event-driven and modularization programming.Light thread mainly is possibly compare frequently to the node concurrent operations, and thread is shorter, and the problem that traditional process/thread scheduling can't be satisfied proposes.It designs based on the structuring notion that embodies TinyOS and execution model.Its adopts the framework mode of assembly, structure height modularization, and can break through the various restrictions of sensor node, and the various application of Rapid Realization are fit to the application of wireless sense network very much, thereby are widely used and become the reference design of a lot of systems.The Component Gallery of TinyOS comprises procotol, Distributed Services, sensor drive and data acquisition tools etc., and no assembly can not be introduced into, thereby reaches the purpose that reduces memory requirements.TinyOS has adopted event-based model, can in very little space, handle high concurrent event like this, and can reach purpose of energy saving.TinyOS is the operating system that designs to the sensor network characteristics specially.TinyOS uses efficiently based on the executive mode of incident, comprises the establishment model through particular design, thereby becomes high efficiency modularization and the assembly type application software that is easy to construct.

In TinyOS, the Application developer can be through the incident/command interface between NesC language performance assembly and the assembly.NesC mainly is used among the TinyOS, and TinyOS also writes completion by NesC.NesC is the expansion to C, is mainly used in the programming development of sensor network.TinyOS operating system provides an excellent user interface for the user exactly.Assembly is divided into configuration file and module, and the flow process of program is that the connection through interface in the configuration file realizes making up up, and the logic function of concrete realization is accomplished through module.Each module is made up of Management Information Base and incident, and these orders and incident become the interface of this module.In general, upper component says the word to lower layer components, the generation of lower layer components signaling incident, and the assembly of the bottom is direct and hardware is mutual, thereby forms a kind of tree structure from top to bottom.

Simultaneously, UML also is widely used in the wireless sense network exploitation very much.UML, UML can provide a kind of language of visual modeling for software systems.In development system product process, can furnish an explanation for system product, function such as visual and Edit Document.The UML modeling method is a kind of standard modeling of having summed up the experience of modeling technique in the past and having absorbed current outstanding achievement.UML comprises semanteme, representation and the explanation of notion, provide static, dynamically, the model of system environments and institutional framework.It is for supporting most of existing object-oriented development process to design.UML has been described the static structure and the dynamic behaviour of a system, and it is some discrete interactional objects and the final model structure that certain function is provided for external user with system description.Static structure has defined the attribute of important object and the mutual relationship between operation and these objects in the system; Dynamic behaviour defined object the time ask that characteristic and object are for accomplishing the mechanism that target communicates each other.UML also comprises the construction package that can model be resolved into bag, so that software group becomes easy-to-handle block structure with big system decomposition, and understands and controls the dependence between each bag, administrative model unit in the development environment of complicacy.It also comprises the assembly that is used for display system realization and operation.In the wireless sense network exploitation, extensively adopt the NesC language, and NesC is mainly used in also among the TinyOS, on stream, popular a kind of mode is converted into object code with related software with model then for setting up model earlier.

Model has extensively been sent out to the transformation technology of code and has been applied in the project exploitation, and the model-driven exploitation is a kind of development approach very important in the software development methodology, has plurality of advantages, is well suited for the sensor network Development of Software.The platform of a good model-driven exploitation has determined whether this development model can be promoted and can provide the development efficiency of sensor network.By the UML UML that has reached its maturity, the entire software development process is with reference to OO software development methodology.Comprise processes such as demand analysis, summary design, detailed design.In conjunction with the characteristics of sensing net software development, the advantage of sensing net software development methodology is analysis modeling sensing net preferably, auxiliary large-scale sensing net software development.This model can be analyzed the sensing net activity that foundation is unit with the group, clearly makes up the architectural model of extensive sensing net software.This intelligence body can self-organization set up the sensing net, independent arbitration decision factum, participating in the group is the various intelligent body group activity of unit.This sensing net software development methodology makes and sensing net software development modelization has improved sensing net software development efficiency, reduced the difficulty of sensing net software development.

The automatic generation technique of code has become an indispensable technical ability of project exploitation, and it reduces the development amount and prevent that defective from producing through generating the mode of text automatically.Code generation based on model is the key areas of current soft project research.Be directly changed into the unitarity that source code can make this maintenance of exploitation design a model and realize from model, reduce the workload of writing code, improve the speed and the quality of software development.

Traditional code generates, and the repeated code that at first often occurs in the recognition application source code generates the object code that these repeating parts replace hand-coding then automatically; So-called object code is meant and uses relevant a series of products, for example document; Script, defined file etc.If there is not the code Core Generator, the developer can obtain the dirigibility high product although it is so with all codes of Hand writing, still, uses the automatic generation of code to reduce cost, and reduces error rate, makes reliability stronger.

Summary of the invention

Technical matters:The objective of the invention is to propose a kind of towards wireless sense network by the conversion method of UML model to code; Solve the current model that faces to the ineffective activity of code method for transformation and the problems such as complicacy that in the sensing net is used, transform, improved application and development efficient.

Technical scheme:The UML that the present invention adopted is based on visitor's method for transformation to the conversion method of code, according to the relation between model and the code, and the concrete mapping ruler of definition model and object code; A visitor is set then visits this model, mapping ruler is embedded in the visitor, arrive the code mapping ruler according to model; The visitor is in the visit to model, and model is read on the limit, and the limit is according to mapping ruler; With object code model is resolved; Be implemented to the conversion of target language frame model, obtain the object language program code thus, accomplish the conversion of model to target language.

This method comprises the steps:

Step 1, establishment UML model

Creating the UML model, at first is that the logic data model from total system begins, and comes all master data entity and mutual relationships thereof in the illustrative system through global information demand view then, progressively constructs The model at last; The described modeling process to system object of this method thinks that the node in wireless sense network is static;

The correctness of step 2, inspection UML model

At first through pattern checking setting in the modeling tool; Be used for checking access problem; From the model menu item, find out problem and inconsistency in the model, seek the problem that has generation when concerning between different two classes of wrapping then, the mistake of finding the most at last writes Log Report.The mistake of being found comprises that sequence block diagram or the message of cooperation in the block diagram do not shine upon with operation, and the object in sequence block diagram or the cooperation block diagram with type do not shine upon;

Step 3, the visitor is set, the definition mapping ruler

Step 4, Access Model

Visit model with the visitor, the contrast mapping ruler proceeds to the conversion of code while visiting, and finally obtains the target language frame model;

Step 5, code generate

The process that code generates is: Accessor Access's model at first, the limit is read the model limit and is transformed according to mapping ruler then, finally generates the object code framework.

Visitor's access method is set, and the mode that is based on the visitor of employing is changed; The visitor mainly is responsible for the inside of Access Model, in Access Model, writes code to the text output stream, and implementation model is to the conversion of code; The visitor at first utilizes a series of class to set up the UML model of system; The internal representation of a model is provided then and adds that some control the defined function in advance of model; Realize OO framework, produce code through defined function in advance and access mechanism of controlling model at last.

Model is to the mapping ruler of code, and the notion of the class of describing in the UML model, attribute, operation is directly corresponding with the corresponding concepts in the object code, and the method for transformation of association wherein, gathering, dependence, extensive relation difference correspondence is following:

31) method for transformation that the incidence relation in the said mapping ruler is corresponding is: at first with the associated end of two classes in the UML model and the related attribute that produces as source object; Destination object is exactly class, attribute and the method in the code model, the association between the object that the realization UML is represented; Then with incidence relation and attribute assignment thereof in the class that is associated; Said incidence relation type of being meant and type between relation, the attribute that is produced by association is as the attribute in the respective class, and each class also comprises and quote attribute, can visit the class that is associated through this attribute;

32) the corresponding method for transformation of the relation of the gathering in the said mapping ruler is: at first be mapped as the class of assembling two ends respectively the code word object of correspondence, in the object code model, express whole type then and add quoting the part class;

33) the corresponding method for transformation of extensive relation in the said mapping ruler is: the property transformation with parent when conversion is the attribute of target subclass; The source object of conversion is the attribute of parent; Destination object is the attribute of subclass, and the concrete implication of said extensive relation is for inheriting, and subclass is inherited all properties of parent; The conversion starting condition is to have inheritance between subclass and the parent, and content transformed is the attribute that becomes the property transformation of source object destination object;

34) method for transformation of the correspondence of the dependence in the said mapping ruler is: with the attribute of dependence type of being expressed as in the model, quote attribute to converted into the dependence object by the object of dependence class one simultaneously.

4, the model language towards wireless sense network according to claim 1 is characterized in that described Access Model to the code method for transformation, and the step of its visit is:

41), select one group of rule of Satisfying Matching Conditions according to current model state and mapping ruler;

42) from the one group of rule that satisfies condition, select a rule by scheduling mechanism, find out the rule of carrying out in next step;

43) Accessor Access carries out mapping ruler, generates the object code element, changes corresponding model and object code state, and selects matching rules in next step;

44) repeat above three steps until stopping;

45) generate complete object code, preserve the conversion record, switch process and error message in the record transfer process.

Beneficial effect:The present invention proposes a kind of UML model and the method for transformation that arrives code towards wireless sense network, through the visitor is set, implementation model is to the conversion of destination code.Method of the present invention has following beneficial effect:

(1) accuracy of generating code is high.Through being set, the visitor realized the conversion of model to code.The code that generates can the code quality consistent with system requirements, and the code of generation only relies on template, file and the model of code generation.

(2) synchronism of code and model.Code Generation is safeguarded the consistance of code and data model automatically, and the visitor is through Access Model again, can be reflected to automatically in the code the modification of model, effectively realizes the synchronism of code and model.

(3) simplicity of code reparation.Change in a large number under the situation of code at needs especially, only need the change template and again Access Model get final product.For repairing software Bug, only need the Bug of recovery template to rerun the Bug that Access Model just can be repaired all spanned files then.

(4) improve application and development efficient.The present invention can spend in more time professional relevant design and realize when concrete the application, thereby can improve application and development efficient and product quality greatly.

Description of drawings

Fig. 1 is the model driven method procedure chart,

Fig. 2 is that model is to code conversion process synoptic diagram.

Embodiment

1, creates the UML model

Creating the UML model, at first is that the logic data model from total system begins, and comes all master data entity and mutual relationships thereof in the illustrative system through global information demand view then, progressively constructs The model at last.The described modeling process to system object of this method thinks that the node in wireless sense network is static.

(1) creates the illustration of using of system

With the use case in the illustration display system and role and mutual relationship thereof; The role is and the object (people or thing) of building system interaction that using case is the Premium Features module that system provides, and has demonstrated people and how to have used case; At first create main use-case block diagram, the general view of display system.

(2) logical view of establishment system

At first in logical view, create sequence block diagram and cooperation block diagram.Mutual block diagram shows the flow process of using case step by step.Comprise and need what object in the flow process; Object sends any message each other; What role Qi Liu; What message send by in proper order.

(3) in logical view, create class, bag and type block diagram

(4) component view of establishment system.The practical structures of component view major concern system.Assembly be exactly with system to related file, can be source code, executable file or dll file.Assembly is the physical module of code.Before the generating code, with each File mapping corresponding assembly.

(5) the deployment view of establishment system

Dispose view and comprise being connected between processor, equipment, process and processor and the equipment.Everything all is presented at disposes on the block diagram, and each system has only one to dispose block diagram, so also have only one to dispose block diagram in the The model.

2, the correctness of inspection UML model

At first through pattern checking setting in the modeling tool; Be used for checking access problem; From the model menu item, find out problem and inconsistency in the model, seek the problem that has generation when concerning between different two classes of wrapping then, the mistake of finding the most at last writes Log Report.The mistake of being found comprises that sequence block diagram or the message of cooperation in the block diagram do not shine upon with operation, and the object in sequence block diagram or the cooperation block diagram and class are not shone upon etc.

3, definition UML model is to the mapping ruler of NesC code

At first the visitor sets up the UML model of system through a series of class; The internal representation of a model is provided then and adds that some control the API of model; Thereby realize OO framework, produce code through API and access mechanism of controlling model at last.

Mapping ruler is: notions such as the class of describing in the UML model, attribute, operation are directly corresponding with the corresponding concepts in the object code, and notions such as association, gathering, dependence have produced inconsistency with expression-form in the code.The present invention comes association, dependence, extensive and gathering relation between the indicated object with the method that produces attribute, and its corresponding respectively method for transformation is following:

1) method for transformation that the incidence relation in the said mapping ruler is corresponding is: at first with the associated end of two classes in the UML model and the related attribute that produces as source object; Destination object is exactly class, attribute and the method in the code model, the association between the object that the realization UML is represented.Then with incidence relation and attribute assignment thereof in the class that is associated.Said incidence relation type of being meant and type between relation, the attribute that is produced by association is as the attribute in the respective class, and each class also comprises and quote attribute, can visit the class that is associated through this attribute.

2) the corresponding method for transformation of the relation of the gathering in the said mapping ruler is: at first be mapped as the class of assembling two ends respectively the code word object of correspondence, in the object code model, express whole type then and add quoting the part class.

3) the corresponding method for transformation of extensive relation in the said mapping ruler is: the property transformation with parent when conversion is the attribute of target subclass, and the source object of conversion is the attribute of parent, and destination object is the attribute of subclass.The concrete implication of said extensive relation is for inheriting, and subclass is inherited all properties of parent, and the conversion starting condition is to have inheritance between subclass and the parent, and content transformed is the attribute that becomes the property transformation of source object destination object.

4) method for transformation of the correspondence of the dependence in the said mapping ruler is: with the attribute of dependence type of being expressed as in the model, quote attribute to converted into the dependence object by the object of dependence class one simultaneously.

The mapping ruler of UML model and NesC is following:

(1) each module among type figure, the object diagram-NesC, the attribute respective modules attribute of class, method respective modules interface definition,

(2) with the flow process of program among illustration-NesC, the module flow process difference that different participants are corresponding, all behavioral functions of a participant are exactly the function that respective modules realizes,

(3) service condition that constitutional diagram-each function realizes, promptly corresponding judgement statement, and the execution under the corresponding conditions,

(4) the concrete realization of sequence chart-respective modules, the function that need call when realizing like functions of modules, the step of calling, the definition that each interface need be done etc.,

(5) concrete function of activity diagram-function, i.e. the concrete definition of function,

4, Access Model

At first, according to current model state and mapping ruler, select one group of rule of Satisfying Matching Conditions;

Secondly, from the one group of rule that satisfies condition, select a rule, find out the rule of carrying out in next step by scheduling mechanism;

Then, the Accessor Access carries out mapping ruler, generates the object code element, changes corresponding model and object code state, and selects matching rules in next step;

At last, generate complete object module, preserve the conversion record, the relevant information in the record transfer process.

5, code generates

The process that code generates is: Accessor Access's model at first, the limit is read the model limit and is transformed according to mapping ruler then, finally generates the object code framework.

One, architecture

Model of the present invention comprises model module and the method for transformation based on the visitor on this basis to the conversion of code.

1, model module

This module mainly is responsible for the modeling of wireless sense network system object, provide static, dynamically, the model of system environments and institutional framework, system is generated as some discrete interactional objects and certain functional structure is provided for external user.Static structure in the said model mainly is responsible for the attribute of important object in the system and the mutual relationship between operation and these objects, and the time response of dynamic behaviour definition object and object are for accomplishing the mechanism that target communicates each other; Dynamic structure in the said model mainly is responsible for the function and the behavior of illustrative system.

2, based on visitor's method for transformation

Method for transformation based on the visitor is: at first defines the mapping ruler of model, then mapping ruler is embedded in the visitor to code, and last Accessor Access's model, final implementation model is to the conversion of code.Method for transformation is made up of two modules:

(1) mapping ruler

The main effect of mapping ruler is to define the concrete transforming relationship of model to code.

(2) visitor's module

This module mainly is responsible for the inside of Access Model, and the visitor writes code to the text output stream in Access Model, and implementation model is to the conversion of code.Concrete module contents is: the visitor at first utilizes a series of class to set up the UML model of system; The internal representation of a model is provided then and adds that some control the API of model; Realize OO framework, produce code through API and access mechanism of controlling model at last.

Two, method flow

This method comprises the steps:

Step 1, establishment UML model

Creating the UML model, at first is that the logic data model from total system begins, and comes all master data entity and mutual relationships thereof in the illustrative system through global information demand view then, progressively constructs The model at last; The described modeling process to system object of this method thinks that the node in wireless sense network is static;

The correctness of step 2, inspection UML model

At first through pattern checking setting in the modeling tool; Be used for checking access problem; From the model menu item, find out problem and inconsistency in the model, seek the problem that has generation when concerning between different two classes of wrapping then, the mistake of finding the most at last writes Log Report.The mistake of being found comprises that sequence block diagram or the message of cooperation in the block diagram do not shine upon with operation, and the object in sequence block diagram or the cooperation block diagram with type do not shine upon;

Step 3, the visitor is set, the definition mapping ruler

Step 4, Access Model

Visit model with the visitor, the contrast mapping ruler proceeds to the conversion of code while visiting, and finally obtains the target language frame model;

Step 5, code generate

The process that code generates is: Accessor Access's model at first, the limit is read the model limit and is transformed according to mapping ruler then, finally generates the object code framework.

Visitor's access method is set, and the mode that is based on the visitor of employing is changed; The visitor mainly is responsible for the inside of Access Model, in Access Model, writes code to the text output stream, and implementation model is to the conversion of code; The visitor at first utilizes a series of class to set up the UML model of system; The internal representation of a model is provided then and adds that some control the defined function in advance of model; Realize OO framework, produce code through defined function in advance and access mechanism of controlling model at last.

Model is to the mapping ruler of code, and the notion of the class of describing in the UML model, attribute, operation is directly corresponding with the corresponding concepts in the object code, and the method for transformation of association wherein, gathering, dependence, extensive relation difference correspondence is following:

31) method for transformation that the incidence relation in the said mapping ruler is corresponding is: at first with the associated end of two classes in the UML model and the related attribute that produces as source object; Destination object is exactly class, attribute and the method in the code model, the association between the object that the realization UML is represented; Then with incidence relation and attribute assignment thereof in the class that is associated; Said incidence relation type of being meant and type between relation, the attribute that is produced by association is as the attribute in the respective class, and each class also comprises and quote attribute, can visit the class that is associated through this attribute;

32) the corresponding method for transformation of the relation of the gathering in the said mapping ruler is: at first be mapped as the class of assembling two ends respectively the code word object of correspondence, in the object code model, express whole type then and add quoting the part class;

33) the corresponding method for transformation of extensive relation in the said mapping ruler is: the property transformation with parent when conversion is the attribute of target subclass; The source object of conversion is the attribute of parent; Destination object is the attribute of subclass, and the concrete implication of said extensive relation is for inheriting, and subclass is inherited all properties of parent; The conversion starting condition is to have inheritance between subclass and the parent, and content transformed is the attribute that becomes the property transformation of source object destination object;

34) method for transformation of the correspondence of the dependence in the said mapping ruler is: with the attribute of dependence type of being expressed as in the model, quote attribute to converted into the dependence object by the object of dependence class one simultaneously.

Described Access Model, the step of its visit is:

41), select one group of rule of Satisfying Matching Conditions according to current model state and mapping ruler;

42) from the one group of rule that satisfies condition, select a rule by scheduling mechanism, find out the rule of carrying out in next step;

43) Accessor Access carries out mapping ruler, generates the object code element, changes corresponding model and object code state, and selects matching rules in next step;

44) repeat above three steps until stopping;

45) generate complete object code, preserve the conversion record, switch process and error message in the record transfer process.

Claims (4)

  1. One kind towards the model language of wireless sense network to the code method for transformation, it is characterized in that this method comprises the steps:
    Step 1, establishment UML model
    Creating the UML model, at first is that the logic data model from total system begins, and comes all master data entity and mutual relationships thereof in the illustrative system through global information demand view then, progressively constructs The model at last; The described modeling process to system object of this method thinks that the node in wireless sense network is static;
    The correctness of step 2, inspection UML model
    At first through pattern checking setting in the modeling tool; Be used for checking access problem; From the model menu item, find out problem and inconsistency in the model, seek the problem that has generation when concerning between different two classes of wrapping then, the mistake of finding the most at last writes Log Report; The mistake of being found comprises that sequence block diagram or the message of cooperation in the block diagram do not shine upon with operation, and the object in sequence block diagram or the cooperation block diagram with type do not shine upon;
    Step 3, the visitor is set, the definition mapping ruler
    Step 4, Access Model
    Visit model with the visitor, the contrast mapping ruler proceeds to the conversion of code while visiting, and finally obtains the target language frame model;
    Step 5, code generate
    The process that code generates is: Accessor Access's model at first, the limit is read the model limit and is transformed according to mapping ruler then, finally generates the object code framework.
  2. 2. the model language towards wireless sense network according to claim 1 is characterized in that being provided with visitor's access method to the code method for transformation, and the mode that is based on the visitor of employing is changed; The visitor mainly is responsible for the inside of Access Model, in Access Model, writes code to the text output stream, and implementation model is to the conversion of code; The visitor at first utilizes a series of class to set up the UML model of system; The internal representation of a model is provided then and adds that some control the defined function in advance of model; Realize OO framework, produce code through defined function in advance and access mechanism of controlling model at last.
  3. 3. the model language towards wireless sense network according to claim 1 is to the code method for transformation; It is characterized in that the mapping ruler of model to code; The notion of the class of describing in the UML model, attribute, operation is directly corresponding with the corresponding concepts in the object code, and the method for transformation of association wherein, gathering, dependence, extensive relation difference correspondence is following:
    31) method for transformation that the incidence relation in the said mapping ruler is corresponding is: at first with the associated end of two classes in the UML model and the related attribute that produces as source object; Destination object is exactly class, attribute and the method in the code model, the association between the object that the realization UML is represented; Then with incidence relation and attribute assignment thereof in the class that is associated; Said incidence relation type of being meant and type between relation, the attribute that is produced by association is as the attribute in the respective class, and each class also comprises and quote attribute, can visit the class that is associated through this attribute;
    32) the corresponding method for transformation of the relation of the gathering in the said mapping ruler is: at first be mapped as the class of assembling two ends respectively the code word object of correspondence, in the object code model, express whole type then and add quoting the part class;
    33) the corresponding method for transformation of extensive relation in the said mapping ruler is: the property transformation with parent when conversion is the attribute of target subclass; The source object of conversion is the attribute of parent; Destination object is the attribute of subclass, and the concrete implication of said extensive relation is for inheriting, and subclass is inherited all properties of parent; The conversion starting condition is to have inheritance between subclass and the parent, and content transformed is the attribute that becomes the property transformation of source object destination object;
    34) method for transformation of the correspondence of the dependence in the said mapping ruler is: with the attribute of dependence type of being expressed as in the model, quote attribute to converted into the dependence object by the object of dependence class one simultaneously.
  4. 4. the model language towards wireless sense network according to claim 1 is characterized in that described Access Model to the code method for transformation, and the step of its visit is:
    41), select one group of rule of Satisfying Matching Conditions according to current model state and mapping ruler;
    42) from the one group of rule that satisfies condition, select a rule by scheduling mechanism, find out the rule of carrying out in next step;
    43) Accessor Access carries out mapping ruler, generates the object code element, changes corresponding model and object code state, and selects matching rules in next step;
    44) repeat above three steps until stopping;
    45) generate complete object code, preserve the conversion record, switch process and error message in the record transfer process.
CN2012101651655A 2012-05-25 2012-05-25 Model-to-code converting method facing wireless sensor network CN102681855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012101651655A CN102681855A (en) 2012-05-25 2012-05-25 Model-to-code converting method facing wireless sensor network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012101651655A CN102681855A (en) 2012-05-25 2012-05-25 Model-to-code converting method facing wireless sensor network

Publications (1)

Publication Number Publication Date
CN102681855A true CN102681855A (en) 2012-09-19

Family

ID=46813832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012101651655A CN102681855A (en) 2012-05-25 2012-05-25 Model-to-code converting method facing wireless sensor network

Country Status (1)

Country Link
CN (1) CN102681855A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235729A (en) * 2013-04-18 2013-08-07 南京大学 Software model synchronization method based on code modification

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138808A1 (en) * 2008-12-02 2010-06-03 Wooyeol Kim Embedded system design device and a method thereof using a target independent model

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138808A1 (en) * 2008-12-02 2010-06-03 Wooyeol Kim Embedded system design device and a method thereof using a target independent model

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
廖礼萍 等: "MDA中UML模型到Java对象模型的元数据映射", 《计算机科学》 *
张宁: "使用UML和Rational Rose建立系统模型", 《CSDN, HTTP://DOWNLOAD.CSDN.NET/DOWNLOAD/STUDYSNOEND/212091》 *
曹响: "MDA中基于Java的PSM到代码转换研究与实现", 《万方数据知识服务平台》 *
李姝: "通信与信息系统建模技术研究", 《中国优秀博硕士学位论文全文数据库 (硕士)信息科技辑 》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235729A (en) * 2013-04-18 2013-08-07 南京大学 Software model synchronization method based on code modification
CN103235729B (en) * 2013-04-18 2016-03-16 南京大学 A kind of software model synchronous method changed based on code

Similar Documents

Publication Publication Date Title
US10664243B2 (en) System and method for iterative generating and testing of application code
Sheu et al. A proposed process for systematic innovation
Drath et al. AutomationML-the glue for seamless automation engineering
Fortino et al. Towards a development methodology for smart object-oriented IoT systems: A metamodel approach
Yin et al. A connector-based hierarchical approach to assembly sequence planning for mechanical assemblies
Li et al. Modeling and analyzing the reliability and cost of service composition in the IoT: A probabilistic approach
Shu et al. NetTopo: A framework of simulation and visualization for wireless sensor networks
Zheng et al. Real-time big data processing framework: challenges and solutions
US9858046B2 (en) System and method for implementing application code from application requirements
CN100542178C (en) Multi-source heterogeneous data integrated system based on data flow technique
Wainer CD++: a toolkit to develop DEVS models
Rice et al. Enabling framework for structural health monitoring using smart sensors
CN100476819C (en) Data mining system based on Web and control method thereof
CN101996271B (en) Software interface for automatically generating simulation calculation model of PSCAD power system
Wainer et al. Timed Cell-DEVS: modeling and simulation of cell spaces
Xie et al. An energy-delay tunable task allocation strategy for collaborative applications in networked embedded systems
CN103150165B (en) For building frame system and the program construction method of outdoor data acquisition program
CN1713196B (en) Product ordering system based on automatic design grid
Losilla et al. Wireless sensor network application development: An architecture-centric mde approach
Molcho et al. Computer aided manufacturability analysis: Closing the knowledge gap between the designer and the manufacturer
Wang et al. Hybridsim: A modeling and co-simulation toolchain for cyber-physical systems
CN105630472B (en) Client rapid development framework of manufacturing execution system and software development method thereof
CN102750145A (en) Network system software system framework and implementation method thereof
CN103441900A (en) Centralization cross-platform automated testing system and control method thereof
CN101356522A (en) Dynamically repositioning workflow by end users

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C05 Deemed withdrawal (patent law before 1993)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120919