A NOVEL METHOD FOR PETRI NET MODELING

Size: px
Start display at page:

Download "A NOVEL METHOD FOR PETRI NET MODELING"

Transcription

1 A NOVEL METHOD FOR PETRI NET MODELING Chen-x SHAO 1,3, Er-hu ZHOU 1,2, Zhen-zhong SHAO 4, We-hua WANG 5, Xue-feng WU 1 1 Department of Computer Scence and Techmology, Unversty of Scence and Technology of Chna, Hefe, ,Chna cxshao@ustc.edu.cn, xfwu@ustc.edu.cn 2 Informaton Center of Hosptal 152 of PLA, Pngdngshan , Chna ehzhou@mal.ustc.edu.cn 3 Anhu Provnce Key Laboratory of Software n Computng and Communcaton, Hefe , Chna 4 Janghua Automoble Co., Ltd. Hefe, , Chna v5vv5v@163.com 5 Lwe Automoble Ol-pump Co., Ltd. Anhu, Hefe , Chna @qq.com ABSTRACT Message Sequence Chart (MSC) s a graphcal trace language for descrbng the communcaton behavour of dstrbuted systems. In order to buld a Petr Net model of a complex system, ths paper ntroduces a strategy to buld a Petr Net model by usng MSC. The algorthm of translatng the MSC model to Petr Net model s also gven n ths paper. We can get the Petr Net model and mprove t by translatng the model of MSC. By analyzng the Petr Net model, t s proved to be safe and relable. KEYWORDS modelng/smulaton; Message Sequence Charts(MSC); Petr Net 1. INTRODUCTION Petr nets s a graphc representaton of the combnaton model, has the merts of ntutve, smple and easy, for descrbng and analyzng of concurrent phenomena have unque advantage. Of the exstng modelng methods, the Petr Net modelng has got well developed and wdely appled. It not only has the strct mathematcal bass, but also has a lot of analytcal and smulaton tools. However, the tradtonal method for buldng a Petr Net model requres hghly for the modelng staff: They must be good at mathematcs and famlar to the structure and functon of the complex system. In order to smplfy the Petr Net modelng of a complex system, ths paper present a new modelng method, whch uses Message Sequence Charts(MSC) to model the research obects at frst, then translate the MSC model to Petr Net model wth the correspondng algorthm. Ths method can tae full advantage of MSC whch s smple, ntutonstc and easy to modfy, and Nataraan Meghanathan, et al. (Eds): ITCS, SIP, JSE-2012, CS & IT 04, pp , CS & IT-CSCP 2012 DOI : /cst

2 72 Computer Scence & Informaton Technology (CS & IT) can be used to buld the Petr Net model for analyss and modelng. By analyzng the Petr Net model, t s proved to be safe and relable. 2. MESSAGE SEQUENCE CHARTS [1,2] MSC s a good graphcal language for descrbng the communcaton behavour of dstrbuted systems, whch s smple, ntutonstc, easy to modfy, and can also gve a complete descrpton of mathematcal semantcs [1,2,3]. The Z.120 [1] enacted by the Internatonal Telecommuncaton Unon has gven the standardzed defnton of Message Sequence Charts. MSC s wdely appled n many felds due to ts advantages of convenence and ntutve graphc descrpton [4,5]. But t also has some dsadvantages: The graphcal semantc model and mathematcal semantc model are both not easy to analyze and smulate [6] Graphcal semantc descrpton of MSC MSC s composed of obects, ncludng the own event of an obect, the message transmsson among obects. msc A l Fgure 1 Two messages MSC As shown n fgure 1, the MSC A of two peces of message s composed of obect, obect, and message, message l. The top and bottom of obect and are expressed wth whte rectangle and blac rectangle respectvely, connectng wth straght lne whch stands for the tme. The MSC of two peces of message shown n fgure 1 descrbe the sequence of the two communcaton events between obect and obect : Frstly, obect sends a message to obect ; secondly, obect receves the message ; then obect sends another message l to obect ; at last, obect receves the message l The process algebrac specfcaton of MSC Every MSC can be gven a strct descrpton wth the process algebrac language, ncludng the algebrac expresson of event and the operator. The algebrac expresson of event: For example, out(,,) stands for the event that obect sends the message to obect ; n(,,) stands for the event that obect receves the message from obect ; ε stands for the state of a obect (t doesn't express any acton); acton(,a) stands for that obect taes the acton a, and so on. The operator: For example, defnes strct order, that s the event on the left of ths operator taes place precede the event on the rght; + stands for that to choose a event on ether sde of ths operator to tae; stands for parallel relaton, that s the event on ether sde of ths operator can occur frst, and so on. The prorty of the operators above defnes as follow: s pror to, and Is pror to +. The event sequence of the MSC shown n chart 1 can be expressed wth the process algebrac language that:

3 (out(,,) n(,,)) (out(,,l) n(,,l)) (1) Computer Scence & Informaton Technology (CS & IT) 73 + can be replaced wth. So expresson (1) can be replaced wth (out(,,) n(,,)+n(,,) out(,,)) (out(,,l) n(,,l)+ n(,,l) out(,,l)) (2) Because the message s receved only after t s sent out, the expresson n(,,) out(,,) and n(,,l) out(,,l) should be deleted. So the expresson (2) can be smlfed to the expresson (3) out(,,) n(,,) out(,,l) n(,,l) (3) 2.3. The descrpton functon of MSC The powerful descrpton functon of MSC can meet the requrements of general stuatonal modelng. MSC can descrbe the transmsson and recept of message (shown n char 1). It can also descrbe the state, acton, calculagraph, and meet the functon of fuzzy sequence and subsequence charts. Detals can be found n paper [2]. In the subsequence functon of MSC, every obect n the sequence can be abstract obect, whch s able to extend to a subsequence chart. In ths way, we can buld a herarchcal model of a system. 3. THE TRANSLATION TO PETRI NET 3.1. The defnton of Petr Net Petr Net [7,8] s a graphcal and mathematcal modelng tool whch can be appled to many systems. It s also a powerful tool to descrbe and study a complex system characterzed by parallel, asynchronsm, dstrbuted and random. The defnton s as follow: Petr Net s defned as a three-tuples, PN = ( P, T, F), n whch P stands for a set of places whch s lmted and nonempty, P={p 1,p 2,,p m }; T stands for a set of transtons, whch s lmted and nonempty, T={t 1,t 2,,t n }; F stands for a set of connectons, F=P T T P. P and T also meet the requrement that P T= Ф, and P T Ф. In the actual chart, the "place" s expressed wth, the "transton" s expressed wth, the connecton s represented by the straght lne wth arrows, the place and transton are connected wth connectons. 3.2 The translaton algorthm The algorthm of translatng the MSC model to Petr Net model s as follows: Step 1: Dvde every obect of MSC nto three parts, the top, the bottom and the event( sendng or recevng the message, state, acton and so on); Step 2: Replace the whte rectangle and blac rectangle whch stand for the top and bottom of a obect respectvely wth whch stands for the place;

4 74 Computer Scence & Informaton Technology (CS & IT) Step 3: Replace the event( sendng or recevng the message, acton and so on) wth whch stands for the transton; Step 4: Delete the state In the MSC; Step 5: If n the MSC there are events of fuzzy order, then determne flexbly the order of dvded events accordng to demand; Step 6: If there are two neghborng transtons on the tme lne or on the lne of message transmsson, add a place n the mddle of the two transtons; Step 7: Connect the transton and the place wth the connecton along the tme lne and the message transmsson lne. The drecton of the connecton must be the same to the drecton of the tme lne and the message transmsson lne; Step 8: Translaton ends. 3.3 The llustraton of translaton algorthm Accordng to the translaton algorthm, the translaton from the MSC of two obects to Petr Net s shown n fgure 2: (a) MSC model (b) Segmentaton (d) Connectng arc ont (c) Replace and supplement Fgure 2 Messagng between two obects nto the MSC correspondng Petr net 4. APPLICATION INSTANCE 4.1 The descrpton of nstance Here, we buld a model for the procedure from developng new products to comng nto the maret of an automotve vehcles manufacturer wth vrtual manufacturng technque. Detals are as follows: When the maret s actve, the MaretDept grasps the opportunty to put forward the suggeston of developng new products; Vrtual Manufacturng Envronment provdes the vrtual prototype to be evaluated by the MaretDept; then the MaretDept feedbacs the evaluaton and correcton to the Vrtual Manufacturng Envronment; after the vrtual prototype s mproved, the Vrtual Manufacturng Envronment provdes the nformaton of the fnal mproved

5 Computer Scence & Informaton Technology (CS & IT) 75 products for the Real Manufacturng Envronment, whch produces the new products n the hundreds. At last, the MaretDept gets for puttng the new products on the maret. 4.2 The model of MSC The descrpton of MSC model In the model of MSC, the procedure from developng new products to comng nto the maret s abstracted to be sx obects: MaretEnvronment, MaretDepartment, Vrtual Manufacturng Envronment, Real ManufacturngEnvronment, PurchaseDepartment and ErrorManage, whch are shown n fgure Conflct Resoluton Mechansm In a more complex system, conflcts are nevtable. Smlarly, there wll be many conflcts of technque, personnel, resources and so on n the producton and busness of a manufacturer [9]. MSC Manufacturng Enterprse Maret Env Maret Dept VM Env RM Env Purchase Dept Error Manage actvt busness opportuntes study New product plan evaluate Vrtual prototypng result VM mprove products fnsh desgn produce error (lac of resources) notfy Resource valdaton valdaton fnsh prepare fnsh Products Fgure 3 MSC model of manufacturng enterprses In order to resolve the conflct, n the MSC model of the manufacturer above, we add the ErrorManage. In the actual busness operaton of a manufacturer, ErrorManage s a flexble department composed of relevant experts and headers of the mportant department to tae realtme communcaton and coordnaton, whch also ntegrates the system of experts n charge of conflct resoluton wth the set of rules, the set of lmts and so on to be n charge of resolvng and coordnatng nds of conflcts.

6 76 Computer Scence & Informaton Technology (CS & IT) The nstance of Conflct Resoluton In RMEnv of the model, when t s lac of resources, the Conflct Resoluton Mechansm starts: Frstly, t reports to ErrorManage; then ErrorManage reports to PurchaseDept; after PurchaseDept supples resources to RMEnv, t reports confrmaton to ErrorManage; meanwhle, after gets the supplement, RMEnv reports the recept to ErrorManage. Such Conflct Resoluton Mechansm maes sure the normal management of a manufacturer. 4.3 The model of Petr Net Wth the translaton algorthm shown n 3.2, the MSC of a manufacturer shown n chart 3 can be translated to the correspondng Petr Net, shown n fgure The analyss of Petr Net Analyze the ntalzed Petr Net wth the exstng analytcal technque of Petr Net. Wth respect to safety, t s easy to fnd that there s no dead loc n the model of Petr Net translated from MSC wth the translaton algorthm. That s because the message of MSC must be sent out before receved. It s won't occur that to receve a pece of message whch s can't be sent out, whch breas the necessary condton of the dead loc. So there can't be dead-loc. Wth respect to

7 Computer Scence & Informaton Technology (CS & IT) 77 lveness, the nodes from the begnnng to the end are all reachable (the route of message transmsson s attanable). Therefore, the Petr Net s safe and feasble. 5. CONCLUSION In the Petr Net modelng of a complex system, t has many advantages to get the Petr Net model from MSC model: (1) Because of the powerful functon of the descrpton of MSC, t s easy to buld a smple, ntutonstc MSC model of a complex system; (2) The subsequence charts functon of MSC support the theory of herarchcal modelng and module abstract and composte [10] ; (3) The translaton algorthm provdes a powerful tool to translate the MSC model to Petr Net model; (4) MSC model can help to understand Petr Net model of a complex system, enhance the readablty of Petr Net model, and avod the dead loc effectvely; (5) It can modfy Petr Net model by modfyng the respondng MSC model, whch maes buldng and modfyng Petr Net model based on the smple and ntutonstc MSC model. After Petr Net model s bult, how to evaluate a complex system wth the respondng Petr Net model s the next target of author's group. ACKNOWLEDGEMENTS Ths wor s supported by the Natural Scence Foundaton of Chna (NSFC) under Grant No and No And thans professor Fang-zhou BAI for hs valuable suggestons. REFERENCES [1] Geneva:ITU-T, (1996). ITU-T Recommendaton Z.120: Message Sequence Chart (MSC). [2] S.Mauw, (1996). The formalzaton of Message Sequence Charts. Computer Networs and ISDN Systems. No.28,pp [3] Rudolph, E., J. Grabows and P. Graubmann,( 1996). Tutoral on Message Sequence Charts. Computer Networs and ISDN Systems. No.28,pp [4] Kumar, Sandeep; Khoo, Sau-Cheng; Roychoudhury, Abh; Lo, Davd,(2011). Mnng message sequence graphs. 33rd Internatonal Conference on Software Engneerng, ICSE 2011, May 21, May 28, 2011, p [5] Dan, Hatao; Herons, Robert M.(2011), Conformance testng from message sequence charts. Proceedngs - 4th IEEE Internatonal Conference on Software Testng, Verfcaton, and Valdaton, ICST 2011, p [6] Olaf Kluge, ( 2003). Modellng a Ralway Crossng wth Message Sequence Charts and Petr Nets. Lecture Notes n Computer Scence. Sprnger Verlag. No.2472,pp

8 78 Computer Scence & Informaton Technology (CS & IT) [7] T.Murata,( 1989). Petr Nets: Propertes, Analyss and pplcatons. Proceedngs of the IEEE. No.77,pp [8] Chongy Yuan,( 1998). Prncple of Petr Net. Beng:Electroncs Industral Press. [9] Song Huang,Yun Hu,Chenggang L,( 2004). A TCPN based approach to model the coordnaton n vrtual manufacturng organzatons. Computers & Industral Engneerng. No.47,pp [10] Zhbn Jang,( 2004). Petr Net and ts applcaton n the manufacturng system modelng and control. Beng: Machnery Industral Press. Authors Chen-x SHAO, male, 1954, M.Eng., assocate professor, research nterests are smulaton of complex system and qualtatve smulaton; Zhen-zhong SHAO, male,1983, B. Eng., engneer, research ntersts are CIM, CAD/CAM and VR. We-hua WANG, female, 1960, B. In.& Co., research nterests are MRP-II,ERP andscm.