Learning-Based Coordination Model for On-the-Fly Self-Composing Services Using Semantic Matching
Abstract
:1. Introduction
2. Related Works
3. Service Composition
3.1. Coordination Model
- Software Agents (i.e., coordination entities): active software entities that act as an interface between the tuple space and the real world. An entity could be any sort of device (e.g., sensors or actuators), application or service;
- Live Semantic Annotations (LSA): tuples of data and properties which are managed and updated by the software agent (e.g., a property value is updated when the sensor updates its value);
- Tuple space: shared space (i.e., coordination media) that hosts all the tuples in a node. A node could be a Raspberry Pi, a smartphone, or any connected object that can host a shared space;
- Eco-laws (i.e., coordination laws): chemical-based coordination rules derived from bio-inspired mechanisms, dynamically acting on LSAs (see below).
- Operations: A set of operations (e.g., inject a new LSA, update an LSA’s content or remove an LSA) that are executed by the system.
- Bonding: links an agent with data provided by another agent that it was waiting for, referred to, concerns it, etc.
- Decay: (or evaporation) is a pattern used to mark the relevance of the information located in the tuple space. It regularly decreases the relevance of the data and ultimately removes outdated data.
- Spreading: similar to broadcast as it diffuses information within a network. However, the spread is done with a fixed propagation hops.
- Gradient: is build on the spreading pattern. It aggregates data using some algebraic operation (e.g., min, max or avg) and offers additional information about hops distance.
3.2. Data Structure
- A set of Service properties or property names which we note S: A software agent is sensitive to some property name or input to which it wants to be alerted when they become available.
- A set of Properties which we note P: Each software agent provides a set of properties or output which correspond to the service that it provides. It is defined by:
- : is the property name, .
- : is the value of property .
- : the id of the agent that manages the LSA to which a property bonded.
- : the id of the agent that is at the origin of the request.
- : a sequence of property names representing the composition schema. The requested property names are separated by a vertical line “|” from the provided properties during composition.
- : a flag that indicates if a property has been consumed (#True) or not (#False) by other agents.
- A set of Synthetic properties that contains some features related to the operation of the middleware. It is not shown in the above LSA representation for presentation concerns.
3.3. Learning-Based Coordination Model
- StatesS: a set of all possible composition schemas. A state is updated in the #C composition property attribute of the LSA.
- Actions: ;
- –
- Ignore the bonded LSA: useless bonding are avoided.
- –
- React to the bonded LSA: a new property is added or updated in the agent’s LSA, as the result of the internal computing of the agent following the bonding.
- Reward: A positive or negative reward is attributed to all agents that participated in a successful composition (with final composition schema). The user feedback depends on the actual relevance of the result [46].
- Exploration algorithm: -greedy [47]. This algorithm has a probability to select a random action and a probability to select the action that maximises the value of the approximation of .
- Q function: , where:, …, where n is the number of agents that participated in the service self-composition, t is the current time, is the state at time t in which the agent took action , is the next state reached by the agent after taking action , is the learning rate and is the discount factor that determines the cumulative discounted future reward.
3.4. Composition Schema
3.5. Reward
3.6. Scenario
- A user driving an Electric car is looking for an electric parking sport. The Electric car makes a query for an electric parking spot, on behalf of the user.
- A Gas station provides a set of services, such as restaurant, gas pump, or electric parking spot. The Gas station advertises itself (globally) as a gas station.
- A Booking service checks the availability of a parking spot and books it for the user. It waits for requests for parking spots.
Agents
- Agent_1: is the query agent. It works on behalf of the Electric car. It injects in the tuple space an LSA, with a property P with name “Location” and requests a property S with name “ElectricParkSpot”.
- Agent_2: is sensitive to the “Location” property. It works on behalf of the Gas station. Internally, it controls a set of services as it represents a series of Gas station services like the parking, restaurants and gas pump as shown in Figure 3. Agent_2 injects an LSA advertising itself with property P, as a “GasStation”, and waits for a query corresponding to a location indicated in property S. In this example, we are interested in the internal service of the gas station that provides parking.
- Agent_3: is a parking booking service specialising in electric parking spots. It works on behalf of the Booking service. Its LSA will bond with a request for any output with the “Parking” property and informs that it provides a specific electric parking spot, by providing the “E-Park” property P.
3.7. Syntactic Composition
Algorithm 1 Syntactic Bonding |
initialisation |
1: for do |
2: for do |
3: if ((syntacticMatching() and shouldBond()) then |
4: bondLSAToLSA() |
5: end if |
6: end for |
7: end for |
4. Enhancing Self-Composition with Semantic Matching
Algorithm 2 Semantic Bonding |
initialisation |
1: for do |
2: for do |
3: if (semanticMatching() and shouldBond()) then |
4: bondLSAToLSA() |
5: end if |
6: end for |
7: end for |
4.1. Scenario Revisited
5. Implementation and Experiments
5.1. Architecture
- Presentation layer: we propose to use an Angular web application to control the system. It allows to configure services and inject queries.
- Service layer: a Spring Boot application used to create a RESTful web service to instantiate and communicate with the “SAPERE Kernel” project. It is named “SAPERE api”. It is a Maven project that provides a RESTful web service. It is considered as a mediator between the “SAPERE Kernel” and the web application. It uses a local MongoDB database to save user credentials and SAPERE configuration.
- Application layer: A Java-based project called “SAPERE Kernel” that provides the essential features of our proposed solution. It provides a bidirectional socket communication between all nodes in the network. The core of the SAPERE coordination model has been extended in order to support semantic-based composition, as shown in Figure 7. We defined a new bonding eco-law called Semantic Bonding (see Figure 7) that holds semantic reasoning capabilities thanks to the Apache Jena rules engine [48]. The former provides a general-purpose rule-based reasoner that is exploited to perform reasoning on RDF data. Both the reasoner and the RDF data are included in the semantic bonding module.
5.2. Implementation
5.3. Deployment
5.4. Experiments
5.4.1. Synthetic Services
5.4.2. Electric Car Parking Scenario
- A Raspberry Pi 3 hosting the gas station services (Agent_2).
- A Raspberry Pi 3 hosting the booking service (Agent_3).
- A computer which is used to inject the service request and evaluate results, representing the Electric Car (Agent_1).
5.4.3. Emergency Situation-ICRC
5.4.4. Earlier Experiments
5.4.5. Parameters
- Alpha The learning rate is set between 0 and 1. Figure 17 presents how values in the Q matrix varies according to . The x-axis, that we named iteration, presents a user feedback under the form of a reward regarding a query. When the learning rate is close to 1, our system learns faster than when it is set close to 0 (where a higher number of feedback are required). Similarly, an agent changes quickly its behaviour after few opposite feedback. Since in our system, agents are not systematically rewarded, and we are dealing with a dynamic environment, has to be relatively small in order to limit the sensitivity of the agents to received feedback, accommodating by the way resistance to false negative and positive feedback.
- Epsilon We have employed the -greedy reinforcement learning algorithm [47] that has a probability to select a random action and a probability to select the action that maximises the value of the approximation of . -greedy ensures a permanent exploration which is necessary to allow adaptation to changing environmental conditions. A high value downgrades learning since the agent will explore more frequently the system, by making more frequent random choices. A small value lowers the adaptation capability of the system when the environmental conditions change. Therefore, choosing a suitable value of is critical. For example, when , the agents explore the system in 20% of the cases.
- Gamma is a discount factor that weights the future rewards. It shows the importance of such rewards in the learning process. When is close to 0, agents are short-sighted as gives importance to the cumulative discounted future reward. However, When it is close to 1, it helps agents to have further observations.
- Dynamicity: adding/removing agents Results in relation with dynamic changes of agents show that when agents disappear, the compositions in which they were involved are no longer available, negative feedbacks are sent to the the remaining agents, who quickly invert their Qmatrix and learn to avoid those compositions. In the case of new agents arriving in the system, and consequently new possible compositions, the system needs a few iterations cycles in order for the whole set of agents to learn the new meaningful compositions.
5.5. Further Validation
6. Discussion
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Weiser, M. The Computer for the 21st Century. Sci. Am. 1991, 265, 94–104. [Google Scholar] [CrossRef]
- Ben Mahfoudh, H. Learning-Based Coordination Model for Spontaneous Self-Composition of Reliable Services in a Distributed System. Ph.D. Thesis, University of Geneva, Geneva, Switzerland, 2020. [Google Scholar]
- Di Marzo Serugendo, G.; Abdennadher, N.; Houssem, B.M.; De Angelis, F.L.; Tomaylla, R. Spatial Edge Services. In Proceedings of the 2017 Global Internet of Things Summit (GIoTS), Geneva, Switzerland, 6–9 June 2017. [Google Scholar]
- Ben Mahfoudh, H.; Di Marzo Serugendo, G.; Naja, N.; Abdennhader, N. Learning-based coordination model for spontaneous self-composition of reliable services in a distributed system. Int. J. Softw. Tools Technol. Transf. 2020. [Google Scholar] [CrossRef]
- Kalasapur, S.; Kumar, M.; Shirazi, B.A. Dynamic Service Composition in Pervasive Computing. IEEE Trans. Parallel Distrib. Syst. 2007, 18, 907–918. [Google Scholar] [CrossRef]
- Lemos, A.L.; Daniel, F.; Benatallah, B. Web Service Composition: A Survey of Techniques and Tools. ACM Comput. Surv. 2015, 48, 1–41. [Google Scholar] [CrossRef] [Green Version]
- Peltz, C. Web services orchestration and choreography. IEEE Comput. 2003, 36, 46–52. [Google Scholar] [CrossRef]
- Talantikite, H.N.; Aissani, D.; Boudjlida, N. Semantic annotations for web services discovery and composition. Comput. Stand. Interfaces 2009, 31, 1108–1117. [Google Scholar] [CrossRef]
- Martin, D.; Burstein, M.; Hobbs, J.; Lassila, O.; Mcdermott, D.; Mcilraith, S.; Narayanan, S.; Paolucci, M.; Parsia, B.; Payne, T.; et al. OWL-S: Semantic Markup for Web Services. Available online: https://www.w3.org/Submission/2004/SUBM-OWL-S-20041122/ (accessed on 30 September 2020).
- Talib, M.A.; Yang, Z. Semi-Automatic Code Generation of Static Web Services Composition. In Proceedings of the Student Conference on Engineering, Sciences and Technology, Karachi, Pakistan, 30–31 December 2004; pp. 132–137. [Google Scholar] [CrossRef]
- Tzortzis, G.; Spyrou, E. A Semi-Automatic Approach for Semantic IoT Service Composition. In Proceedings of the Workshop on Artificial Intelligence and Internet of Things (AI-IoT), at the 9th Hellenic Conference on Artificial Intelligence (SETN 2016), Thessaloniki, Greece, 18–20 May 2016. [Google Scholar]
- Pierris, G.; Kothris, D.; Spyrou, E.; Spyropoulos, C. SYNAISTHISI: An enabling platform for the current internet of things ecosystem. In Proceedings of the 19th Panhellenic Conference on Informatics, PCI 2015, Athens, Greece, 1–3 October 2015; Karanikolas, N.N., Akoumianakis, D., Nikolaidou, M., Vergados, D.D., Xenos, M., Giaglis, G.M., Gritzalis, S., Merakos, L.F., Tsanakas, P., Sgouropoulou, C., Eds.; ACM: New York, NY, USA, 2015; pp. 438–444. [Google Scholar] [CrossRef]
- Noura, M.; Gaedke, M. WoTDL: Web of Things Description Language for Automatic Composition. In IEEE/WIC/ACM International Conference on Web Intelligence; Association for Computing Machinery: New York, NY, USA, 2019; pp. 413–417. [Google Scholar] [CrossRef]
- Editor, W. Thing Description (TD) Ontology. 2020. Available online: https://www.w3.org/2019/wot/td (accessed on 29 November 2020).
- Gyrard, A.; Datta, S.K.; Bonnet, C.; Boudaoud, K. A Semantic Engine for Internet of Things: Cloud, Mobile Devices and Gateways. In Proceedings of the 2015 9th International Conference on Innovative Mobile and Internet Services in Ubiquitous Computing, Santa Catarina, Brazil, 8–10 July 2015; pp. 336–341. [Google Scholar] [CrossRef]
- Zgheib, R. SeMoM: A Semantic Middleware for IoT Healthcare Applications. Ph.D. Thesis, Université Toulouse 3 Paul Sabatier, Toulouse, France, 2017. [Google Scholar]
- Zgheib, R.; Conchon, E.; Bastide, R. Semantic Middleware Architectures for IoT Healthcare Applications. In Enhanced Living Environments: Algorithms, Architectures, Platforms, and Systems; Springer International Publishing: Cham, Switzerland, 2019; pp. 263–294. [Google Scholar] [CrossRef] [Green Version]
- Rao, J.; Su, X. A survey of automated web service composition methods. In Proceedings of the First International Conference on Semantic Web Services and Web Process Composition, San Diego, CA, USA, 6 July 2004; Springer: Berlin/Heidelberg, Germany, 2005; pp. 43–54. [Google Scholar] [CrossRef]
- Grondin, G.; Bouraqadi, N.; Vercouter, L. MaDcAr: An Abstract Model for Dynamic and Automatic (Re-)Assembling of Component-Based Applications. In Component-Based Software Engineering; Lecture Notes in Computer Science; Gorton, I., Heineman, G.T., Crnkovic, I., Schmidt, H.W., Stafford, J.A., Szyperski, C.A., Wallnau, K.C., Eds.; Springer: Berlin/Heidelberg, Germany, 2006; Volume 4063, pp. 360–367. [Google Scholar] [CrossRef] [Green Version]
- Hellenschmidt, M. Distributed Implementation of a Self-Organizing Decentralized Multimedia Appliance Middleware. In Dagstuhl Seminar Proceedings, Mobile Computing and Ambient Intelligence: The Challenge of Multimedia, 1–4 May 2005; Davies, N., Kirste, T., Schumann, H., Eds.; IBFI: Schloss Dagstuhl, Germany, 2005. [Google Scholar]
- Vallée, M.; Ramparany, F.; Vercouter, L. A Multi-Agent System for Dynamic Service Composition in Ambient Intelligence Environments. In PERVASIVE 2005, Advances in Pervasive Computing; Austrian Computer Society (OCG): Vienna, Austria, 2005; Volume 191, pp. 175–182. [Google Scholar]
- Gabillon, Y.; Calvary, G.; Fiorino, H. Composing interactive systems by planning. In Proceedings of the 4th French-Speaking Conference on Mobility and Ubiquity Computing (UbiMob ’08), Saint Malo, France, 28–30 May 2008; pp. 37–40. [Google Scholar] [CrossRef] [Green Version]
- Bonjean, N.; Gleizes, M.P.; Maurel, C.; Migeon, F. SCoRe: A Self-Organizing Multi-Agent System for Decision Making in Dynamic Software Developement Processes. In Proceedings of the International Conference on Agents and Artificial Intelligence (ICAART), Barcelona, Spain, 15–18 February 2013. [Google Scholar]
- Degas, A. Auto-Structuration de Trafic Temps-réel Multi-objectif et Multi-Critère dans un Monde Virtuel. Ph.D. Thesis, Université de Toulouse III—Paul Sabatier, Toulouse, France, 2020. [Google Scholar]
- Viroli, M. On Competitive Self-composition in Pervasive Services. Sci. Comput. Program. 2013, 78, 556–568. [Google Scholar] [CrossRef]
- Frei, R.; Şerbănuţă, T.F.; Di Marzo Serugendo, G. Self-organising assembly systems formally specified in Maude. J. Ambient. Intell. Humaniz. Comput. 2012, 5, 491–510. [Google Scholar] [CrossRef] [Green Version]
- Di Napoli, C.; Giordano, M.; Németh, Z.; Tonellotto, N. Using chemical reactions to model service composition. In Proceedings of the 2nd International Workshop on Self-Organizing Architectures (SOAR’10); ACM: New York, NY, USA, 2010; pp. 43–50. [Google Scholar] [CrossRef]
- De Angelis, F.L. A Logic-Based Coordination Middleware for Self-Organising Systems: Distributed Reasoning Based on Many-Valued Logics. Ph.D. Thesis, University of Geneva, Geneva, Switzerland, 2017. [Google Scholar]
- Mazac, S.; Armetta, F.; Hassas, S. Bootstrapping sensori-motor patterns for a constructivist learning system in continuous environments. In Proceedings of the 14th International Conference on the Synthesis and Simulation of Living Systems (Alife’14), New York, NY, USA, 31 July 2014. [Google Scholar]
- Boes, J.; Nigon, J.; Verstaevel, N.; Gleizes, M.P.; Frederic, M. The Self-Adaptive Context Learning Pattern: Overview and Proposal. In Proceedings of the International and Interdisciplinary Conference on Modeling and Using Context (CONTEXT 2015), Larnaca, Cyprus, 2–6 November 2015; Springer: Berlin/Heidelberg, Germany, 2015; pp. 91–104. [Google Scholar]
- Ren, L.; Wang, W.; Xu, H. A Reinforcement Learning Method for Constraint-Satisfied Services Composition. IEEE Trans. Serv. Comput. 2017. [Google Scholar] [CrossRef]
- Wang, H.; Chen, X.; Wu, Q.; Yu, Q.; Zheng, Z.; Bouguettaya, A. Integrating On-policy Reinforcement Learning with Multi-agent Techniques for Adaptive Service Composition. In Proceedings of the International Conference on Service-Oriented Computing, Paris, France, 3–6 November 2014. [Google Scholar]
- Wang, H.; Wang, X.; Hu, X.; Zhang, X.; Gu, M. A multi-agent reinforcement learning approach to dynamic service composition. Inf. Sci. 2016, 363, 96–119. [Google Scholar] [CrossRef]
- Wang, H.; Gu, M.; Yu, Q.; Tao, Y.; Li, J.; Fei, H.; Hong, T. Adaptive and large-scale service composition based on deep reinforcement learning. Knowl. Based Syst. 2019, 180, 75–90. [Google Scholar] [CrossRef]
- Ahmed, M.; Takayuki, I. A Deep Reinforcement Learning Approach for Large-Scale Service Composition. In Proceedings of the International Conference on Principles and Practice of Multi-Agent Systems, Tokyo, Japan, 29 October–2 November 2018. [Google Scholar]
- Idir, A.; Saber, B.; Laid, K.; Kazar, O. Service composition approaches for Internet of Things: A review. Int. J. Commun. Netw. Distrib. Syst. 2019, 23, 194–230. [Google Scholar]
- Zambonelli, F.; Castelli, G.; Ferrari, L.; Mamei, M.; Rosi, A.; Di Marzo, G.; Wally, B. Self-aware Pervasive Service Ecosystems. Procedia Comput. Sci. 2011, 7, 197–199. [Google Scholar] [CrossRef]
- Martin, W.; Matthias, M.H.; Nora, K.; Philip, M. (Eds.) Software Engineering for Collective Autonomic Systems—The ASCENS Approach; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2015; Volume 8998. [Google Scholar] [CrossRef]
- Mamei, M.; Zambonelli, F. Programming Pervasive and Mobile Computing Applications: The TOTA Approach. ACM Trans. Softw. Eng. Methodol. 2009, 18, 15:1–15:56. [Google Scholar] [CrossRef]
- De Angelis, F.L.; Fernandez-Marquez, J.L.; Di Marzo Serugendo, G. Self-composition of services in pervasive systems: A chemical- inspired approach, Multi-Agent Systems: Technologies and Applications. In Advances in Intelligent Systems and Computing; Springer: Berlin/Heidelberg, Germany, 2014; Volume 296. [Google Scholar]
- De Angelis, F.L.; Fernandez-Marquez, J.L.; Di Marzo Serugendo, G. Self-composition of services with chemical reactions. In Proceedings of the 29th Annual ACM Symposium on Applied Computing (SAC), Gyeongju, Korea, 24–28 March 2014. [Google Scholar]
- Ben Mahfoudh, H.; Di Marzo Serugendo, G.; Boulmier, A.; Abdennadher, N. Coordination Model with Reinforcement Learning for Ensuring Reliable On-Demand Services in Collective Adaptive Systems. In International Symposium on Leveraging Applications of Formal Methods; Springer: Cham, Switzerland, 2018. [Google Scholar]
- Fernandez-Marquez, J.L.; Di Marzo Serugendo, G.; Montagna, S.; Viroli, M.; Arcos, J.L. Description and composition of bio-inspired design patterns: A complete overview. Nat. Comput. 2013, 12, 43–67. [Google Scholar] [CrossRef] [Green Version]
- Manju, S.; Punithavalli, M. An Analysis of Q-Learning Algorithms with Strategies of Reward Function. Int. J. Comput. Sci. Eng. 2011, 3, 814–820. [Google Scholar]
- Richard, S.S.; Andrew, G.B. Reinforcement Learning: An Introduction; MIT Press: Cambridge, MA, USA, 1998. [Google Scholar]
- Shauharda, K.; Kagan, T. Evolution-Guided Policy Gradient in Reinforcement Learning. In Proceedings of the 32nd Conference on Neural Information Processing Systems, Siem Reap, Cambodia, 13–16 December 2018. [Google Scholar]
- Kaelbling, L.P.; Littman, M.L.; Moore, A.W. Reinforcement learning: A survey. J. Artif. Intell. Res. 1996, 4, 237–285. [Google Scholar] [CrossRef] [Green Version]
- Apache Jena-Reasoners and Rule Engines: Jena Inference Support. Available online: https://jena.apache.org/documentation/inference/ (accessed on 30 September 2020).
- Ben Mahfoudh, H.; Di Marzo Serugendo, G.; Abdennadher, N.; Rumsch, A.; Upegui, A. Spatial services for decentralised smart green energy management. In Proceedings of the 2018 IEEE International Energy Conference (ENERGYCON), Limassol, Cyprus, 3–7 June 2018. [Google Scholar]
- Naja, N. Utilisation de L’apprentissage par Renforcement pour la Composition de Service dans un Milieumdistribuée. Master’s Thesis, University of Geneva, Geneva, Switzerland, 2019. [Google Scholar]
Agent | Schema | Ignore | React |
---|---|---|---|
Agent_2 | ElectricParkSpot|Location,GasStation | 0 | 5 |
Agent_3 | - | - | - |
Agent | Schema | Ignore | React |
---|---|---|---|
Agent_2 | ElectricParkSpot|Location,Parking | −3 | 6.5 |
Agent_3 | ElectricParkSpot|Location,Parking,E-park | −3 | 6.5 |
Agent | Schema | Ignore | React |
---|---|---|---|
Agent_2 | ElectricParkSpot|Location,Parking | −5.1 | 7.5 |
Agent_3 | ElectricParkSpot|Location,Parking,E-park | −5.1 | 7.5 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 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
Ben Mahfoudh, H.; Caselli, A.; Di Marzo Serugendo, G. Learning-Based Coordination Model for On-the-Fly Self-Composing Services Using Semantic Matching. J. Sens. Actuator Netw. 2021, 10, 5. https://doi.org/10.3390/jsan10010005
Ben Mahfoudh H, Caselli A, Di Marzo Serugendo G. Learning-Based Coordination Model for On-the-Fly Self-Composing Services Using Semantic Matching. Journal of Sensor and Actuator Networks. 2021; 10(1):5. https://doi.org/10.3390/jsan10010005
Chicago/Turabian StyleBen Mahfoudh, Houssem, Ashley Caselli, and Giovanna Di Marzo Serugendo. 2021. "Learning-Based Coordination Model for On-the-Fly Self-Composing Services Using Semantic Matching" Journal of Sensor and Actuator Networks 10, no. 1: 5. https://doi.org/10.3390/jsan10010005
APA StyleBen Mahfoudh, H., Caselli, A., & Di Marzo Serugendo, G. (2021). Learning-Based Coordination Model for On-the-Fly Self-Composing Services Using Semantic Matching. Journal of Sensor and Actuator Networks, 10(1), 5. https://doi.org/10.3390/jsan10010005