Automatic Generation of Automation Applications Based ... - IEEE Xplore

62 downloads 55453 Views 534KB Size Report
3Department of Electrical Engineering and Automation, Aalto University, Finland ... implemented using an appropriate programming language. For.
Automatic Generation of Automation Applications Based on Ontology Transformations Victor Dubinin1, Valeriy Vyatkin2,3, Chen-Wei Yang2, Cheng Pang2 Department of Computer Science, University of Penza, Penza, Russia 2 Department of Computer Science, Electrical and Space Engineering, Luleå University of Technology, Luleå, Sweden 3 Department of Electrical Engineering and Automation, Aalto University, Finland [email protected], [email protected], [email protected], [email protected] 1

Abstract— In this paper an ontology driven approach to the design of control systems, in particular, control applications of IEC 61499 standard is proposed. The source ontology is an ontological description of control object (plant) while the target ontology is an ontological description of a control system implemented using an appropriate programming language. For the ontologies transformation an extension of SWRL (called eSWRL) is informally introduced. An example of transformation of the ontological description of a baggage handling system to the ontological description of a control application based on IEC 61499 function blocks (FB) is in detail considered. The corresponding transformation rules have been developed in the context of this example. Keywords—Ontology, eSWRL, IEC61499, BHS

I.

INTRODUCTION

One of today's advanced technologies for the development of software is Model Driven Engineering (MDE), which uses models and their transformation as a primary artifact [1]. The design process is presented as a chain of transformations of a source model to a target model through a number of intermediate models. The Object Management Group (OMG) consortium [2] suggested Model Driven Architecture (MDA) to integrate various MDE tools. To determine modes and met models the OMG developed well-known standards MetaObject Facility (MOF) and Unified Modeling Language (UML). The MDE can be also applied in other areas of design outside the traditional area of software engineering. For example, [3] proposes Model-Integrated Computing (MIC) approach, which expands the MDA to the field of domainspecific modeling languages. On the other hand, Semantic Web technologies, closely related with ontologies, are rapidly developing [4]. The most widespread ontological language is OWL language based on description logic [5]. OWL ontology is composed of two components: T-Box and A-Box. T-Box introduces a terminology, in other words, a vocabulary of an application domain, while A-Box comprises of assertions about instances of concepts in terms of the vocabulary. To increase descriptive opportunities of the OWL ontology, the W3C consortium has proposed the Semantic Web Rule Language (SWRL), based on the logic of Horn clauses [6].

Currently, a major effort to merge object technologies (including MDE) with the technologies of semantic Web is undertaken. As a result of the joint activity of W3C and OMG Ontology Definition Metamodel (ODM) was developed [7]. The main feature of that is that one can treat formal ontologies as models and one can work with models in the form of ontologies too. However, ontologies in MDA have an ancillary role. Similar to the MDE, Ontology Driven Engineering (ODE) can be defined as a sequence of transformations of a source ontological description to a target one through a number of intermediate ontological descriptions. One can assume that ODE is more powerful than MDE, considering the following factors: 1) ontological languages have greater expressive power than UML language; 2) they are based on a formal theory, and 3) there are mechanisms of logical inference based on them. In [4] Ontology Driven Architecture (ODA) is defined. Modern industrial automation systems are becoming software intensive [8]. Their software has been primarily designed using languages of IEC 61131-3, while their hardware platform for decades is mainly Programmable Logical Controllers (PLC). According to opinions of many experts in the field of industrial automation, a new generation of industrial process control systems will be built in accordance with international standard IEC 61499 [9]. This standard defines an architecture and a programming language for distributed controllers on the basis of function blocks (FB). At the logic level, a control system is defined as an application that is a (multi-level) FB system. At the execution level, the FB allocated to resources and devices that communicates via a network. In this paper we propose an approach to the design of control systems, in particular IEC 61499 control applications, on the basis of transformation of ontologies. The source ontology is an ontological description of an object to be controlled (a plant) and the target ontology is an ontological description of a control system represented using implementation languages. For the transformation of ontologies the language eSWRL being an extension of the ontological rules language SWRL, is proposed. For the interpretation of eSWRL constructs, the Prolog language is used [10]. Due to paper constraints, the development of the

2014 IEEE Emerging Technology and Factory Automation (ETFA)

c 2014 IEEE 978-1-4799-4845-1/14/$31.00

IEC 61499 ontology and the prolog interpreter will not be discussed in this paper. II.

RELATED WORKS

The works [11]-[15] are the closest to the presented paper. The work [11] is devoted to modeling and verification of IEC 61499 applications using Prolog language. However, neither an ontology nor a transformation is considered in this paper. In [12] a graph transformation-based approach to the synthesis of formal models of IEC 61499 applications is presented. In this case the source model is a graph model of IEC 61499 applications, and the target model is a graph model of Net Condition/Event System (NCES). The transformation of attributed graphs is implemented in AGG tool [16]. [13] proposes an approach to semantic analysis of IEC 61499-based projects using multiple-layered ontological knowledge representation and rule-based inference engine. In [14] a methodology of migration from IEC 61131-3 PLCs to IEC 61499 function blocks using Semantic Web Technologies is proposed. The migration is realized as a transformation of ontological representation of IEC 61499 function block system to ontological representation of IEC 61131-3-based system. Drawbacks of this approach are the domain-specific orientation and the complicity of rule coding using XML. In contrast to that paper, UML models are not used in our approach that reduces the number of model representations during the transformation. In our case, the target model is an (direct) ontological representation of a domain-specific language that is the language of IEC 61499 FB. The transformation of ontology is conducted not at the level of RDF triples in the database but at the level of instances of classes and properties in Prolog program oneself, by selfmodification of the Prolog program. For operation with OWL ontologies in SWI Prolog it is proposed to use the OWL Thea library [17]. III.

ontology for IEC 61499 control applications represented using OWL is transformed to a set of facts and rules of Prolog

CONCEPT OF ONTOLOGY TRANSFORMATION AND ITS IMPLEMENTATION IN PROLOG

The general concept of ontology transformation is shown in Fig. 1. A concept of IEC 61499 control applications design on the basis of ontology transformation using eSWRL rules is introduced. The source data for the transformation are: 1) an ontology of a controlled object, including both T-Box component and A-Box component; 2) an initial ontology of IEC 61499 control applications in essence representing the ontology of IEC 61499 function blocks (T-Box component) [18], supplemented by A-Box component for common FB types serving as building blocks for a control system. The result of the transformation is a final ontology of the control application comprising A-Box which represents the entire control application. At that, the T-Box component remains unchanged. Fig. 2 shows a scheme for implementation of the concept of IEC 61499 control applications design on the basis of ontology transformation using Prolog language [10]. The ontology of a controlled object (a plant) and the common

Fig. 1. Concept of IEC61499 control applications design on the basis of ontology transformation

language. eSWRL rules are also converted to rules of Prolog. Further these rules are executed modifying a part of the current Prolog program representing the ontologies. The ability of Prolog program to create, delete and modify facts is commonly used, but the same actions can also apply to rules. After execution of the transformation rules, a part of the facts of the Prolog program will be A-Box of the target ontology of control application. Using a special converter these facts are transformed to the standard OWL representation of the ontology. IV.

LANGUAGE ESWRL FOR TRANSFORMATION OF ONTOLOGIES

The idea to use ontologies to transform them may have several benefits, such as uniformity and conciseness of transformation definitions. However, the OWL language has no transformation facilities to fulfill this concept. The potential of SWRL language for transformation seems to be higher. However, its limitation is that one cannot delete neither instance of a class nor a tuple of a relation due the inference monotonicity in the logics being the foundation of ontological languages. At the same time, in SWRL one can create a relation tuple between existing instances of classes, but, on the other hand, cannot create a (new) instance of a class. A trick of creating a priori a pool of unused instances

Ontology of controlled object

Common ontology for control applications

Transformation OWL→Prolog

eSWRL transformation rules

Transformation eSWRL→Prolog

Prolog program

Execution of Prolog program

Modified Prolog program

Transformation Prolog→OWL

Target ontology of control application

Fig. 2. Scheme for implementation of the concept of IEC61499 control applications design

for a particular problem solution, it is ineffective because it is impossible to change the "free" state of an instance to the "used" state due to the monotonicity property. In this case the transformation rule would apply to all "free" instances that will generate duplicate solutions, which is very hard to get rid of. To overcome these limitations an extension of SWRL named eSWRL (extended SWRL) is proposed. Syntactically eSWRL is similar to SWRL. In adddtion to SWRL, eSWRL has operators to create and delete instances of classes and relations as well as classes and relationships themselves. eSWRL is informally introduced here and only the relevant basic operators of the language used for the baggage handling system case study are considered. Operators for manipulation with T-Box: 1) Create a new class of ontology: eswrl:createClass({? | })

Example. Create new class "myClass": eswrl:createClass(myClass)

2) Create of a new object properties of ontology: eswrl:createObjectProperty({?

conveyors with each other. Their domain and rank are class convey. Moreover, two data properties: has_id ("to have a unique numeric identifier") and has_name ("to have a symbolic name") are introduced. B. Rules for transformation of Ontological Description Of BHS to the Ontological Description of the Control System based on IEC61499 FB The rules for transformation of a BHS layout model to a model of control system composed from IEC 61499 FB are presented in eSWRL form below. The rules are as follows: Rule 1: For each instance of conveyor one has to create an instance of FB type fb_control_block. This rule is defined by two eSWRL rules. a) a rule for creating an instance of FB type fb_control_block; b) a rule for creating interfaces and data inputs/outputs for the generated instances of class fb_control_block. Rule 2: In case of sequential connection of conveyors for FB type fb_control_block one has to create connections of initialize type and connections of type straight->inc (Fig. 5).

Example. Create a new object properties "has_child": eswrl:createObjectProperty(has_child)

3) Create a new data property of ontology: eswrl:createDataProperty({? | }, )

Example. Create a new data property "has_name" of type "String": eswrl:createDataProperty(has_name, String)

4) Create an instance of a class: eswrl:createInstance({? | }, { | })

Fig. 5. Connections of conveyors and its corresponding IEC61499 equivalent

Rule 3: For each FB of type fb_control_block associated with other FB of the same type one has to create an FB instance of photo_eye type. The graphical interpretation of this rule is shown in Fig. 3. This rule is encoded by two eSWRL rules:

Examples. Create instance "a1" of class "myClass": eswrl:createInstance(myClass, a1)

V. CASE STUDY: TRANSFORMATION OF AN AIRPORT BAGGAGE HANDLING SYSTEM A. Ontology of an airport Baggage Handling System In this section, a simplified (for illustrative purposes only) ontology of an airport baggage handling system (BHS) is considered. The foundation for the development of this ontology was works [19, 20]. The ontology of BHS in the Protégé [21] is shown in Fig. 4.

Fig. 4. Classes (Left), Object Properties (Center) and Data Properties (Right) of BHS ontology in Protege

As can be seen from Fig. 4, BHS ontology includes three classes: convey, diverter and photo_eye and four object properties: has_diverter, has_photoeye, has_divert_connection, has_straight_connection ("to be connected sequentially"). The meaning of the first two object properties is obvious. Two last object properties relate the

Fig. 3. Rule for creating FB of type fb_photo_eye

a) a rule for creating FBs for photocells in case of presence of connected FBs of type fb_control_block: b) a rule for creating interfaces as a whole and event outputs for the generated instances of class fb_photo_eye: Rule 4: Each created FB fb_photo_eye has to be connected to the appropriate FB fb_control_block. Rule 5: For all FBs of type fb_control_block having a link outgoing from event output divert, one has to create FBs of types fb_diverter and fb_photo_eye and to connect them to the FB of type fb_control_block in accordance with Fig. 6. The graphical representation of the transformation rules can be expressed with three sets of eSWRL rules: a) a rule creating FB of photocell and diverter when there is FB fb_control_block connected with other FB via a diverter (i.e. if connection divert->inc exists): fb_control_block(?ctrl1),

IEC 61499 applications, and can be used in other application domains. What is presented is an informal introduction to eSWRL. For future work, IEC 61499 ontology will need to be developed including a prolog reasoner for the eSWRL rules. REFERENCES Fig. 6. Rule for creating and embedding FB of type fb_diverter and fb_photo_eye has_id(?ctrl1, ?id1), has_interface(?ctrl1, ?i1), is_part_of_interface(?e1, ?i1), has_name(?e1, "divert"), connected_with(?e1, ?e2) -> eswrl:createInstance(fb_photo_eye, ?pe1), has_id(?pe1, ?id1), has_name(?pe1, "divert"), eswrl:createInstance(fb_diverter, ?diverter1), has_id(?diverter1, ?id1) b)

a rule for creating interfaces as a whole and data inputs/outputs for the generated instances of class fb_diverter:fb_diverter(?div) -> eswrl:createInstance(interface, ?i), has_interface(?div, ?i), eswrl:createInstance(event, ?e1), has_name(?e1, "push"), eswrl:createInstance(event, ?e2), has_name(?e2, "cnf"), is_part_of_interface(?e1, ?i), is_part_of_interface(?e2, ?i)

c)

a rule for connecting the generated FB fb_diverter and fb_photo_eye to FB fb_control_block having link divert->inc: fb_photo_eye(?pe), has_name(?pe, "diverter"), has_id(?pe, ?id), fb_diverter(?div), has_id(?div, ?id), fb_control_block(?ctrl), has_id(?ctrl, ?id), has_interface(?ctrl, ?i1), has_interface(?pe, ?i2), has_interface(?div, ?i3), is_part_of_interface(?e1, ?i1), has_name(?e1, "cnf_dvrt"), is_part_of_interface(?e2, ?i1), has_name(?e2, "is_bag"), is_part_of_interface(?e3, ?i1), has_name(?e3, "pusho"), is_part_of_interface(?e4, ?i2), has_name(?e4, "change"), is_part_of_interface(?e5, ?i3), has_name(?e5, "push"), is_part_of_interface(?e6, ?i3), has_name(?e6, "cnf")-> connected_with(?e3, ?e5), connected_with(?e6, ?e1), connected_with(?e4, ?e2)

VI.

CONCLUSION

This paper presented an approach to the synthesis of IEC 61499 applications on the basis of ontologies transformation using Prolog language. This approach fits the general framework of the ontology-driven engineering (ODE). The generated control application can be subjected to further transformations, such as refactoring, synthesis of formal models (for analysis), implementation using programming or modeling languages. The proposed approach is not limited to

[1] [2] [3]

[4]

[5]

[6]

[7] [8]

[9] [10] [11]

[12]

[13]

[14]

[15]

[16] [17] [18]

[19]

[20]

[21]

S. Beydeda, M. Book, and V. Gruhn, Model-Driven Software Development: Springer, 2005. Object Management Group (OMG). –http://www.omg.org A. Ledeczi, A. Bakay, M. Maroti, P. Volgyesi, G. Nordstrom, J. Sprinkle, et al., "Composing domain-specific design environments," Computer, vol. 34, pp. 44-51, 2001. W3C, Ontology Driven Architectures and Potential Uses of the Semantic Web in Systems and Software Engineering, 2006 http://www.w3.org/2001/sw/BestPractices/SE/ODA/. B. C. Grau, I. Horrocks, B. Motik, B. Parsia, P. Patel-Schneider, and U. Sattler, "OWL 2: The next step for OWL," Web Semant., vol. 6, pp. 309322, 2008. SWRL: A Semantic Web Rule Language Combining OWL and RuleML. W3C Member Submission, 2004. – http://www.w3.org/Submission/SWRL/. Ontology Definition Metamodel. Version 1.0 – OMG, 2009. – 349 P. V. Vyatkin, "Software Engineering in Industrial Automation: State-of´the-Art Review," Industrial Informatics, IEEE Transactions on, vol. 9, pp. 1234-1249, Aug 2013. IEC 61499, Function Blocks, International Standard, International Electrotechnical Commission, First Edition, 2005. W. F. Clocksin and C. S. Mellish, Programming in Prolog: Springer Berlin Heidelberg, 2003. V. Dubinin, V. Vyatkin, and H. M. Hanisch, "Modelling and Verification of IEC 61499 Applications using Prolog," in Emerging Technologies and Factory Automation, 2006. ETFA '06. IEEE Conference on, 2006, pp. 774-781. V. Dubinin, V. Vyatkin, Graph transformation-based approach to the synthesis of formal models of IEC 61499 function blocks systems, Proceedings of the Institutes of Higher Education. Volga region. Technical sciences. - 2008. - № 4. - pp. 16-26 (in Russian) D. Wenbin, V. N. Dubinin, and V. Vyatkin, "Automatically Generated Layered Ontological Models for Semantic Analysis of ComponentBased Control Systems," Industrial Informatics, IEEE Transactions on, vol. 9, pp. 2124-2136, 2013. W. Dai, V. N. Dubinin, and V. Vyatkin, "Migration From PLC to IEC 61499 Using Semantic Web Technologies," Systems, Man, and Cybernetics: Systems, IEEE Transactions on, vol. 44, pp. 277-291, 2014. J.M. Almendros-Jimenez and L. Iribarne. ODM-based UML Model Transformations using Prolog. In Model-Driven Engineering, Logic and Optimization: friends or foes? (MELO 2011), 2011 AGG. [Online]. Available: http://tfs.cs.tu-berlin.de/agg Thea: A Prolog library for OWL2. http://www.semanticweb.gr/thea/index.html Dubinin V., Vyatkin V. Ontology of IEC 61499 function blocks, Proc. Int. Scientific Conference "Contemporary Information Technology (CIT-2010)", Penza, 2010, Vol.12. - P. 113-126. G. Black and V. Vyatkin, "Intelligent Component-Based Automation of Baggage Handling Systems With IEC 61499," Automation Science and Engineering, IEEE Transactions on, vol. 7, pp. 337-351, 2010. J. Yan and V. V. Vyatkin, "Distributed execution and cyber-physical design of Baggage Handling automation with IEC 61499," in Industrial Informatics (INDIN), 2011 9th IEEE International Conference on, 2011, pp. 573-578. Protégé –http://protege.stanford.edu.