Fighting CPS Complexity by ComponentBased Software Development of MultiMode Systems
Abstract
:1. Introduction
1.1. MultiMode Systems
 Faster development: system behavior for different modes can be designed and tested in parallel.
 Diversified functionalities due to multiple modes.
 Enable adaptivity by modeswitch.
 Efficient resource usage: optimized resource reservation for each mode instead of fixed resource reservation.
 Fault tolerance: safetycritical systems can switch to a safe mode in case of a fault.
 Extensibility and scalability: it is flexible to add new modes and integrate them with an existing system.
1.2. ComponentBased Software Engineering
1.3. A Guiding Example
1.4. Contributions
2. The Composition of MultiMode Components
2.1. MultiMode Components and Mode Mapping
 A primitive component only knows own mode’s information such as supported modes, initial mode and the current mode of itself.
 A composite component knows the mode information of itself and its immediate subcomponents.
2.2. Mode Mapping Automata
2.3. MMA Composition
2.4. Mode Mapping Verification
 P1.
 A[] not deadlock: The complete set of UPPAAL models is deadlockfree. This is not directly related to mode mapping, but it is a fundamental property that we expect the model to satisfy.
 P2.
 E$<>$ sMMA_MuD.mode_Ed: It is possible for MuD to run in mode Ed. This property should be verified for all the modes of MuD and its subcomponents.
 P3.
 A[] (sMMA_MuD.mode_Rd and !ModeSwitchManager.switching) imply (cMMA_VAE.mode_D and cMMA_ViD.mode_Rvd and cMMA_AuD.mode_D): When MuD runs in Rd, its subcomponents VAE and AuD must be deactivated, while the other subcomponent ViD must run in Rvd. This property should be verified for all possible mode combinations between MuD and its subcomponents according to the mode mapping table in Table 1.
 P4.
 (ModeSwitchManager.switching and eventID==k1)–>(sMMA_MuD.mode_Ed and cMMA_VAE.mode_R3 and cMMA_ViD.mode_Evd and cMMA_AuD.mode_Rad): An external signal requesting MuD to switch from Rd to Ed will make VAE, ViD and AuD switch to R3, Evd and Rad, respectively. This property should be verified for all possible events from ${k}_{1}$–${k}_{4}$.
3. Mode Transformation
3.1. Construction of the Mode Combination Tree
 From ${\mathcal{N}}_{0}$, create ${\lambda}_{{\mathcal{N}}_{0}}=\left{\mathcal{M}}_{\mathit{Top}}\right$ new nodes, such that for each new node ${\mathcal{N}}_{i}\succ {\mathcal{N}}_{0}$, ${\mathcal{N}}_{i}=\{(\mathit{Top},{m}_{T}^{i})\}\phantom{\rule{4pt}{0ex}}(i\in [1,{\mathcal{M}}_{\mathit{Top}}\left\right])$.
 From each ${\mathcal{N}}_{i}=\{(\mathit{Top},{m}_{T}^{i})\}\phantom{\rule{4pt}{0ex}}(i\in [1,{\mathcal{M}}_{\mathit{Top}}\left\right])$, create ${\lambda}_{{\mathcal{N}}_{i}}=\left{\mathcal{W}}_{\mathit{Top},{m}_{T}^{i}}\right$ new nodes, such that for each ${\mathcal{N}}^{\prime}\succ {\mathcal{N}}_{i}$, ${\mathcal{N}}^{\prime}\in {\mathcal{W}}_{\mathit{Top},{m}_{T}^{i}}$. Moreover, if ${\lambda}_{{\mathcal{N}}_{i}}>1$, then for each ${\mathcal{N}}^{\prime},{\mathcal{N}}^{\u2033}\succ {\mathcal{N}}_{i}$, we have ${\mathcal{N}}^{\prime}\ne {\mathcal{N}}^{\u2033}$.
 For each node $\mathcal{N}=\{({c}_{1},{m}_{{c}_{1}}),({c}_{2},{m}_{{c}_{2}}),\cdots ,({c}_{n},{m}_{{c}_{n}})\}\phantom{\rule{4pt}{0ex}}(n\in \mathbb{N})$ with ${d}_{\mathcal{N}}\ge 2$, if $\forall i\in [1,n]$, ${c}_{i}\in \mathcal{PC}$, then $\mathcal{N}$ is marked as a leaf node, and no new node is created from $\mathcal{N}$. Otherwise, if $\exists i\in [1,n]$ such that ${c}_{i}\in \mathcal{CC}$, then create ${\lambda}_{\mathcal{N}}={\displaystyle \prod _{\begin{array}{c}i\in [1,n],\\ {c}_{i}\in \mathcal{CC}\end{array}}}\left{\mathcal{W}}_{{c}_{i},{m}_{{c}_{i}}}\right$ new nodes, such that for each ${\mathcal{N}}^{\prime}\succ \mathcal{N}$, ${\mathcal{N}}^{\prime}\in {\displaystyle \underset{\begin{array}{c}i\in [1,n],\\ {c}_{i}\in \mathcal{CC}\end{array}}{\u2a01}}{\mathcal{W}}_{{c}_{i},{m}_{{c}_{i}}}$. Moreover, if ${\lambda}_{\mathcal{N}}>1$, then for each ${\mathcal{N}}^{\prime},{\mathcal{N}}^{\u2033}\succ \mathcal{N}$, we have ${\mathcal{N}}^{\prime}\ne {\mathcal{N}}^{\u2033}$.
 Repeat Step 3 until all branches of the MCT have reached the leaf node.
Algorithm 1$constructMCT(\mathcal{N},{d}_{\mathcal{N}})$. 

3.2. Deriving the Mode Transition Graph
Algorithm 2$constructMTG(\mathcal{C},\mathcal{M},\mathcal{K})$. 

3.3. Concrete Implementation of Mode Transformation
4. Related Work
5. Conclusions and Future Work
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
 Rajkumar, R.; Lee, I.; Sha, L.; Stankovic, J. Cyberphysical systems: The next computing revolution. In Proceedings of the Design Automation Conference, Anaheim, CA, USA, 13–18 June 2010; pp. 731–736. [Google Scholar]
 Degani, A.; Kirlik, A. Modes in humanautomation interaction: Initial observations about a modeling approach. In Proceedings of the IEEE International Conference on Systems, Man, and Cybernetics, Vancover, BC, Canada, 22–25 October 1995; pp. 3443–3450. [Google Scholar]
 Crnković, I.; Larsson, M. Building Reliable ComponentBased Software Systems; Artech House: Norwood, MA, USA, 2002. [Google Scholar]
 Crnković, I.; Sentilles, S.; Vulgarakis, A.; Chaudron, M.R.V. A Classification Framework for Software Component Models. IEEE Trans. Softw. Eng. 2011, 37, 593–615. [Google Scholar] [CrossRef]
 Pop, T.; Hnětynka, P.; Hošek, P.; Malohlava, M.; Bureš, T. Comparison of component frameworks for realtime embedded systems. Knowl. Inf. Syst. 2013, 1–44. [Google Scholar] [CrossRef]
 Yin, H.; Hansson, H. A mode mapping mechanism for componentbased multimode systems. In Proceedings of the 4th Workshop on Compositional Theory and Technology for RealTime Embedded Systems, Vienna, Austria, 29 November–2 December 2011; pp. 38–45. [Google Scholar]
 Yin, H.; Hansson, H. Flexible and efficient reuse of multimode components for building multimode systems. In Proceedings of the 14th International Conference on Software Reuse, Miami, FL, USA, 4–6 January 2015; pp. 237–252. [Google Scholar]
 Yin, H.; Hansson, H. Handling multiple modeswitch scenarios in componentbased multimode systems. In Proceedings of the 20th AsiaPacific Software Engineering Conference, Ratchathewi, Bangkok, Thailand, 2–5 December 2013; pp. 404–413. [Google Scholar]
 Yin, H.; Hansson, H. Handling emergency modeswitch for componentbased systems. In Proceedings of the 21st AsiaPacific Software Engineering Conference, Jeju, Korea, 1–4 December 2014; pp. 158–165. [Google Scholar]
 Yin, H.; Hansson, H.; Orlando, D.; Miscia, F.; Marco, S.D. ComponentBased Software Development of MultiMode Systems—An Extended Report; Technical Report MDHMRTC312/20161SE; Mälardalen University: Västerås, Sweden, 2016. [Google Scholar]
 Larsen, K.G.; Pettersson, P.; Yi, W. UPPAAL in a nutshell. Int. J. Softw. Tools Technol. Transf. 1997, 1, 134–152. [Google Scholar] [CrossRef]
 Alur, R.; Courcoubetis, C.; Dill, D. Modelchecking for realtime systems. In Proceedings of the 5th Annual IEEE Symposium on Logic in Computer Science, Philadelphia, PA, USA, 4–7 June 1990; pp. 414–425. [Google Scholar]
 Miscia, F. Design and Implementation of the MCORE IDE: A MultiMode COmponent Reuse Environment. Master’s Thesis, University of L’Aquila, L’Aquila, Italy, 2015. [Google Scholar]
 Systems, A. Rubus ICE. Available online: https://www.arcticussystems.com/products/ (accessed on 20 October 2018).
 Hänninen, K.; MäkiTurja, J.; Nolin, M.; Lindberg, M.; Lundbäck, J.; Lundbäck, K. The Rubus component model for resource constrained realtime systems. In Proceedings of the 3rd International Symposium on Industrial Embedded Systems, La Grande Motte, France, 11–13 June 2008; pp. 177–183. [Google Scholar]
 Schubert, D.; Heinzemann, C.; Gerking, C. Towards Safe Execution of Reconfigurations in CyberPhysical Systems. In Proceedings of the 2016 19th International ACM SIGSOFT Symposium on ComponentBased Software Engineering (CBSE), Venice, Italy, 5–8 April 2016; pp. 33–38. [Google Scholar]
 Heinzemann, C.; Becker, S.; Volk, A. Transactional Execution of Hierarchical Reconfigurations in CyberPhysical Systems. Softw. Syst. Model. 2017. [Google Scholar] [CrossRef]
 Pop, T.; Plasil, F.; Outly, M.; Malohlava, M.; Bures, T. Property networks allowing oraclebased modechange propagation in hierarchical components. In Proceedings of the 15th International ACM SIGSOFT Symposium on Component Based Software Engineering, Bertinoro, Italy, 25–28 June 2012; pp. 93–102. [Google Scholar]
 Weimer, J.E.; Krogh, B.H. Hierarchical Modeling of ModeSwitching Systems. In Proceedings of the 2007 Summer Computer Simulation Conference, San Diego, CA, USA, 15–18 July 2007; pp. 567–574. [Google Scholar]
 MathWorks. Simulink. Available online: http://se.mathworks.com/products/simulink/ (accessed on 20 October 2018).
 Quadri, I.R.; Gamatié, A.; Boulet, P.; Dekeyser, J.L. Modeling of Configurations for Embedded System Implementations in MARTE. In Proceedings of the 1st Workshop on Model Based Engineering for Embedded Systems Design, Dresden, Germany, 12 March 2010. [Google Scholar]
 Gamatié, A.; Beux, S.L.; Piel, E.; Etien, A.; Atitallah, R.B.; Marquet, P.; Dekeyser, J.L. A Model Driven Design Framework for High Performance Embedded Systems; Technical Report RR6614; Institut National de Recherche en Informatique et Automatique: Rocquencourt, France, 2008. [Google Scholar]
 Hansson, H.; Åkerholm, M.; Crnković, I.; Törngren, M. SaveCCM—A component model for safetycritical realtime systems. In Proceedings of the Euromicro Conference, Special Session on Component Models for Dependable Systems, Rennes, France, 31 August–3 September 2004; pp. 627–635. [Google Scholar]
 Ke, X.; Sierszecki, K.; Angelov, C. COMDESII: A ComponentBased Framework for Generative Development of Distributed RealTime Control Systems. In Proceedings of the 13th IEEE International Conference on Embedded and RealTime Computing Systems and Applications, Daegu, Korea, 21–24 August 2007; pp. 199–208. [Google Scholar]
 Borde, E.; Haïk, G.; Pautet, L. Modebased reconfiguration of critical software component architectures. In Proceedings of the Conference on Design, Automation and Test in Europe, Nice, France, 20–24 April 2009; pp. 1160–1165. [Google Scholar]
 Ommering, R.V.; Linden, F.V.D.; Kramer, J.; Magee, J. The Koala component model for consumer electronics software. Computer 2000, 33, 78–85. [Google Scholar] [CrossRef][Green Version]
 Bennour, B.; Henrio, L.; Rivera, M. A reconfiguration framework for distributed components. In Proceedings of the 2009 ESEC/FSE Workshop on Software Integration and Evolution, Amsterdam, The Netherlands, 25 August 2009; pp. 49–56. [Google Scholar]
 Feiler, P.H.; Gluch, D.P.; Hudak, J.J. The Architecture Analysis & Design Language (AADL): An Introduction; Technical Report CMU/SEI2006TN011; Software Engineering Institute: Pittsburgh, PA, USA, 2006. [Google Scholar]
 Henzinger, T.A.; Horowitz, B.; Kirsch, C.M. Giotto: A timetriggered language for embedded programming. Proc. IEEE 2003, 91, 84–99. [Google Scholar] [CrossRef]
 Templ, J. TDL Specification and Report; Technical Report; Department of Computer Science, University of Salzburg: Salzburg, Austria, 2003. [Google Scholar]
 Hirsch, D.; Kramer, J.; Magee, J.; Uchitel, S. Modes for software architectures. In Proceedings of the 3rd European Conference on Software Architecture, Nantes, France, 4–5 September 2006; pp. 113–126. [Google Scholar]
 Maraninchi, F.; Rémond, Y. ModeAutomata: About Modes and States for Reactive Systems. In Proceedings of the European Symposium on Programming, Lisbon, Portugal, 28 March–4 April 998; pp. 185–199.
 Magee, J.; Dulay, N.; Eisenbach, S.; Kramer, J. Specifying Distributed Software Architectures. In Proceedings of the 5th European Software Engineering Conference, Sitges, Spain, 25–28 September 1995; pp. 137–153. [Google Scholar]
 Capilla, R.; Bosch, J.; Trinidad, P.; RuizCortés, A.; Hinchey, M. An overview of Dynamic Software Product Line architectures and techniques: Observations from research and industry. J. Syst. Softw. 2014, 91, 3–23. [Google Scholar] [CrossRef][Green Version]
 Clements, P.; Northrop, L. Software Product Lines: Practices and Patterns; AddisonWesley: Boston, MA, USA, 2001. [Google Scholar]
 Sharifloo, A.M.; Metzger, A.; Quinton, C.; Baresi, L.; Pohl, K. Learning and Evolution in Dynamic Software Product Lines. In Proceedings of the 11th International Symposium on Software Engineering for Adaptive and SelfManaging Systems, Austin, TX, USA, 14–22 May 2016; pp. 158–164. [Google Scholar]
 Baier, C.; Sirjani, M.; Arbab, F.; Rutten, J. Modeling component connectors in Reo by constraint automata. Sci. Comput. Program. 2006, 61, 75–113. [Google Scholar] [CrossRef]
 Phan, L.T.X.; Lee, I.; Sokolsky, O. Compositional Analysis of Multimode Systems. In Proceedings of the 22nd Euromicro Conference on RealTime Systems, Brussels, Belgium, 6–9 July 2010; pp. 197–206. [Google Scholar]
 Criado, J.; RodríguezGracia, D.; Iribarne, L.; Padilla, N. Toward the adaptation of componentbased architectures by model transformation: Behind smart user interfaces. Softw. Pract. Exp. 2015, 45, 1677–1718. [Google Scholar] [CrossRef]
(a) Mode Mapping of MoS  (b) Mode Mapping of MuD  

Component  Modes  Component  Modes  
MoS  Rm  Att  MuD  Rd  Ed  Dq  
DaD  R1  VAE  $Deactivated$  R3  
MuD  Rd  Ed  Dq  ViD  Rvd  Evd  
EvA  $Deactivated$  R2  AuD  $Deactivated$  Rad  $Deactivated$ 
© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Yin, H.; Hansson, H. Fighting CPS Complexity by ComponentBased Software Development of MultiMode Systems. Designs 2018, 2, 39. https://doi.org/10.3390/designs2040039
Yin H, Hansson H. Fighting CPS Complexity by ComponentBased Software Development of MultiMode Systems. Designs. 2018; 2(4):39. https://doi.org/10.3390/designs2040039
Chicago/Turabian StyleYin, Hang, and Hans Hansson. 2018. "Fighting CPS Complexity by ComponentBased Software Development of MultiMode Systems" Designs 2, no. 4: 39. https://doi.org/10.3390/designs2040039