Blockchain-based framework for ontology-oriented robots ’ coalition formation in cyberphysical systems

The creation and functioning of intelligent robots coalition is impossible without the organization of an information interaction environment between them. To solve this problem, it is proposed to use the concept of cyberphysical framework, which involves the unification of physical and cyber (virtual) environments. Intelligent robots can interact with each of the environments. The paper proposes methodology of the cyber physical smart space creation for the intelligent robots’ coalition formation and functioning, based on the concept of the "blackboard" with the support of smart contracts over the blockchain technology. It provides a new approach to the distribution of sensory, computational, information-control and service tasks between intelligent robots, embedded devices, fixed service equipment, cloud computing and information resources.


Introduction
The development of information technology and robotics in particular, achieved to date, allows to develop robots that are able to make independent decisions in unknown situations.It becomes available by equipping robots with a large number of various sensors to check the physical environment parameters, actuators to make actions in it and the development of computational algorithms that allow making decisions based on information received from robots' sensors and external information sources.
At the same time, the task remains open to organize the joint work of various robots to solve a common problem under current conditions.To date, there are a large number of various solutions dedicated to the joint work performed by a group of robots.Among them, such models of joint work can be distinguished, like swarms, schooling and collective (coalition) work.The first two models are based on imitating swarms or schools peeped in wildlife, i.e. fish schools on insect swarms.Robots in such models have simple instructions that allow them to make decisions based on a limited amount of information provided by nearest neighbors.
In a collective robot interaction model, each robot is viewed as a separate entity or agent, which allows the use of approaches developed for multi-agent systems [1][2][3].Agents can form a coalition in which joint actions will be planned for the solutions of the problem facing the robots.Each agent in the coalition operates independently of the others, but within the scope of the developed plan and taking into consideration the current context, which provides possibility to make maximum use of the capabilities of individual robots to achieve a common goal.The robots' coalition formation with the distribution of tasks among all coalition members is an NP-complete task.To date, many solutions have been proposed that provide an approximate solution to the coalition forming task [2,[4][5][6][7].Another important task in the robots coalition formation is the organization of an information interaction environment between them, which allows information exchanging about the current situation and the distribution of tasks among the participants in the coalition.
The purpose of this paper is to develop a methodology for creating a platform where robots are viewed as separate independent entities -agents interacting with each other in cyberphysical space and able to unite in a coalition to solve a common complex problem.During a coalition creation, robots negotiate among themselves spreading knowledge they know about the task being solved, their current state and the state of the environment.The negotiation process is carried out in a common information space, and the result of negotiations is the coalition in which the common complex problem is divided to tasks distributed among the coalition participants.The tasks are bond to the robots, as well as the required resources, and the remuneration for solving the problem.Assignment and binding of tasks, resources and remuneration is proposed to be carried out using a smart contract that is based on the blockchain technology.
The methodology presented in this paper is described in the following sections.Section 2 includes the description of creating a smart space for robots interaction.Section 3 provides the basis of smart contract and blockchain technologies as well as the way of interaction organization through smart contracts.Section 4 describes the integration of smart space and smart contract technologies for organizing trusted interaction between robots.

Organization of a smart space for robots' interaction
The formation and functioning of an intelligent robots coalition is impossible without the organization of an information interaction environment between them.To date, many solutions have been proposed in the field of collective decentralized robot control systems.In works [2,5,6,8,9] models and algorithms for solving problems of optimal distribution of goals between robots of the group are presented, as well as algorithms for collective control of robots in conditions of active counteraction from the environment.Original methods for solving the problem of controlling large groups of robots are proposed.Also presented is the development of a decentralized production management model in which the dispatcher is distributed among program agents and solves the task of scheduling a plan for the performance of a production task [3,4,8,10].
To organize an information interaction environment between robots, it is proposed to use the concept of cyberphysical systems that is actively developed now.It involves the integration of physical and cyber (virtual) environments.Intelligent robots can interact with each of the environments using their hardware and software.In the physical environment, the interaction is effected through sensors and actuators that robots are equipped.With their help, the robot can track the development of the current situation (its context) by measuring the physical characteristics of the environment and objects in it, moving around in environment and performing various operations (for example, measuring, capturing, moving) over physical objects in the environment.To exchange data received from the sensors, current actuators' status and robots' roles, and actions in the coalition it is proposed to use the smart space concept.This concept is based on the "blackboard" information sharing model [11,12], which assumes the availability of a public information object where it is possible to write, read, and search for information without any restriction.This approach makes it possible to inform all coalition members about the context of the current situation in order to access the extent to which the overall goal of the coalition has been achieved and to analyze the change in the environment for a timely response.The computation power over the cyberphysical framework at all can be expanded by adding powerful computing devices on which additional processing of information can be done in order to accelerate the decisionmaking on the formation and functioning of the coalition.
The semantic interoperability between robots during the interaction through the smart space is supported by using an ontology that contains the main characteristics of the robot with their current values, robot resources such as time to the maintenance, current battery charge, type and amount of consumable resources that is depended on the problem area (for example, in medicine -the amount of available drugs, in agriculture -the supply of fertilizers, and in aerospace -the fuel supply).In addition, for each robot, the competences are defined, such as tasks that can be handled by the robot, and patterns of its behavior.The description of the robot competences of is necessary for the formation of the list of tasks with which it is able to cope.
It should be noted that in spite of all the advantages of the cyberphysical systems concept while ensuring interaction of robots, the problems associated with ensuring the control of the process of performing tasks by individual robots remain topical.This control includes the assignment of specific tasks for robots, the description and monitoring of the implementation of the norms of the coalition, the distribution of scarce resources, and the distribution of remuneration for the solved task.

Smart contracts in the robots interaction
The requirements presented in the end of previous section can be satisfied by using the blockchain technology and smart contract concept.The properties of the blockchain and smart contract that allows meeting the requirements are presented below.

Blockchain
Blockchain was originally considered as a distributed transaction ledger for keeping records of operations with the cryptocurrency [13], but it can also be used for other purposes.It is a chain of transaction blocks containing a header and a list of transactions.The header specifies its own hash, hash of the previous block, hash of transactions and additional service information.To calculate transaction hashes, hashing algorithm based on the Merkle Tree is using [13,14].Thus, due to linking with the previous block by hash and calculating of the total hash for several transactions this technology can keep the data in block immutable (Fig. 1).The earlier block was created the harder to change data in it.In the simplest case, a transaction is a record that specifies the operation id and type, the operation itself, and the users participating in the specified operation [15].For each user, an open-private key pair is usually formed on the registration stage, which is used to sign a transaction to unambiguously establish the ownership of the operation [16].On the next step, to form a block in the blockchain, a hash function is calculated over all transaction information, and the hash value is then used to calculate the hash of the block.Thus, information about the transaction becomes also unchangeable and ensures the safety and durability of data storage in the blockchain.It should be noted that the transaction ledger is designed to be distributed in peer to peer way.This means that each blockchain user has access to the entire transaction log and can check any entry that it contains.Thus, it is possible to achieve a common consensus when carrying out operations, since each user can check the hash of the new block and determine the correctness of the transaction.
The built-in consensus mechanism allows to organize all published information, so that any protocols can be implemented on top of the blockchain, and any distributed business processes can be managed.For example, ownership of virtual resources with support for their transmission and atomic exchange can be realized.To do this, the following form of statements can be used: 1) "Participant X is an owner of resource A"; 2) "Participant Y proposes to exchange resource A to their resource B from participant X (or any other, or from the list)"; 3) "Participant X is agreed to the exchange of resource B to A from participant Y"; 4) "Participant Y cancel the offer of exchange of resource A to B from participant X".
Statement "1" can be used for the transmission and creation of a resource.For atomic exchange, statement "2" can be used and followed by "3" or "4" in case of cancel the offer.It should be noted that users could publish statements without having the necessary resource.Such statements should be ignored, and it is necessary to track who owns what resources, considering the entire history of the transactions to determine the invalid statements.The above conceptual process is typically implemented based in a smart contract, whose ideas are presented below (Fig. 3).
To the date, the blockchain is mainly used as a basis for cryptocurrencies, for example, in platforms like Blockchain, Ethereum, LiteCoin, etc.However, during recent years there have been published works, the main purpose of which is the investigation of blockchain usage in other areas, such as supply chain [17], medicine [18], and IoT [19].

Smart contract
The idea of smart contract was proposed first in 1994 by Nick Szabo, even before the development of blockchain technology.N. Szabo had defined a smart contract in the following way: "A smart contract is a set of promises, specified in digital form, including protocols within which the parties perform on these promises."[20] Blockchain Smart contract in scope of the blockchain technology can be viewed as a decentralized application available to all users of the blockchain.Due to the use of the Turingcomplete language, the description of the contract code allows implementing of rather complex algorithms.At the same time, it is mandatory to have conditions under which the contract must be executed, and the list of actions assigned to the submitted conditions.All conditions of a smart contract must have a mathematical description and a clear execution logic.In this regard, the first smart contracts in the chain of blocks are created to formalize the simplest relationships, and consist of a small number of conditions.
Users sign a contract by using their private key [16] and send signed contract as a transaction that is written to the chain of blocks.After signing by all contract sides, the smart contract comes into force.To ensure the automated performance of contract obligations, an environment of existence is required that allows fully automating the execution of contract items.This means that smart contracts can only exist within an environment that has unrestricted access to executable code of smart contract objects.Having unimpeded access to the objects of the contract, the smart contract monitors the specified conditions of achievement or violation of the points and makes independent decisions based on the programmed conditions.Thus, the main principle of a smart contract is the complete automation and reliability of the performance of contractual relations between people.Some blockchain platforms that provide environment for smart contracts are listed below: 1) Bitcoin [13].It should be noted that this platform uses not a Turing-complete language and has strict restrictions on the format of the contract 2) Ethereum [21].Contracts can be created using the internal program language -Solidity.
3) Hyperledger Fabric [22].Platform leverages container technology to host smart contracts called "chaincode" that comprise the application logic of the system.

Robots interaction through smart contracts
The main way of robots interaction through blockchain technology, is the use of smart contracts.Since in the previous section it was noted that the chain of smart contracts always starts with a basic contract describing the simplest relationship, then for the interaction of robots such a contract will provide the basic principles of interaction, such as transferring a resource for use, paying a reward, receiving and performing a task.During the negotiation process robots can form additional contracts, using various combinations of basic contracts (Figure 4).When the robot is connected to the blockchain network, its main function is to the transfer of the transaction, which contains its requirements and competencies, drawn up in the form of a smart contract code.A new contract is created when forming the coalition based on combination of robots contracts and chain's base contracts.The condition of the new contract is the fulfillment of a certain task, and the body -the expected reward for the robot.
Resource allocation can be carried out in a separate chain of blocks in the blockchain.The resource is represented in the form of tokens that plays a role of a replacement for the resource in blockchain.The number of tokens is coincides with the available amount of the resource, while one token exactly corresponds to the resource unit and can not be divided into parts.The allocation of resources between robots can be carried out in a similar manner to the cryptocurrency in the Ethereum or Bitcoin system, but using the Proof-of-Stake consensus algorithm that does not require a "mining" procedure [25].
Contracts recorded in the blockchain remain immutable, which allows to track the sequence of robots' actions in the coalition and, for example, to correct the behavior of the robot to improve the effectiveness of its actions in the coalition.Also, by monitoring the time of the robot operation, it is possible to estimate the time to maintenance and pre-contract with the service organization for repairing the robot, which in the future will reduce the downtime of the robot due to breakdowns.Tracing the resources used by the robot will allow distribution of the resources according to the needs of the robot and to adjust the algorithm for forming a coalition to increase the efficiency of resource use.

Framework for robots interaction based on the smart space & smart contract concepts
The creation of a cyberphysical framework for the interaction of intelligent robots is based on the integration of the methods presented in the previous sections.This allows to create a system that combines advantages and closes the shortcomings of each of the concepts used.The conceptual scheme of the cyberphysical framework for the interaction of robots is presented in Figure 5.The framework is based on the organizing a smart cyberphysical space.It provides the ability to organize basic interaction of robots in the physical and cyber (virtual) spaces.The basic interaction includes solo and joint manipulations of robots with physical objects, information exchange about the current state of robots and objects for planning further joint actions during the coalition formation.
In the organization of information interaction of robots, heterogeneity and distribution of the cyberspace should be taken into account that is raised due to a large number of different robots and sensors, from different manufacturers and with different software, connected through a wireless data network.To provide interoperability, the information exchange between robots is represented using ontologies.Such approach allows to expand the context by providing additional information about the semantic meaning of individual context parameters or robot characteristics.Moreover, within the main idea of the approach, a common ontology can be developed for the whole system, or ontologies of individual components can be used, and information exchange between them is carried out using ontology matching methods [26,27].The concept of "blackboard" in this case allows providing all robots a common information space through which they can distribute information.All robots have equal access rights to read and write information in cyberphysical space.
The use of blockchain technology in this method is explained by the need of information exchange that requires long-term storage and the impossibility of unauthorized changes.These properties of the blockchain are required to solve several tasks at once, namely: monitoring the implementation of the basic norms of coalition interaction and agreements recorded in the smart contracts, as well as control over the expenditure of resources, including the basic resources of the system, specific to the problem area of the problem being solved.To do this, several independent chains are created in the blockchain, storing the distribution state of each of the available resources.In addition, a separate chain of blocks uses smart contracts to store the basic norms of behavior in the coalition and agreements formed based on the norms for the distribution of tasks among the coalition members.When an agreement is concluded between robots in a coalition, its conditions are transformed into a smart contract that is placed in a new block of a separate contract-oriented chain.The terms of the contract are the fact that the task or action is performed on a particular resource within the designated time range.In the case of this contract, the robot receives a bonus, which is to increase the competence parameter associated with the task being solved.In case of non-fulfillment of the contract, the robot gets a lowering of the relevant competence, and the other participants receive an automatic notification about faults to adjust the plans for performing their tasks.
Robots interact with the smart space and the blockchain by using of special software called knowledge processor (KP) that is located in the robot control block.KP realize the functions of processing information from physical components of robots, as well as their mapping into cyber space.In addition, with the help of KP, robots interact with each other during the formation of a coalition.KP also has access to the blockchain to obtain information about the amount of available resources required to solve the problem and obtain the required amount, according to the corresponding smart contract.
In addition to robots KP in cyber (virtual) space, there are KPs available for physical and cyber resources that perform control and timely informing all participants of cyberphysical system about changes in available resources and their characteristics.Resource characteristics changes are displayed in the smart space, while a change in the available amount of resources is displayed in the corresponding blockchain chain, which allows tracking its consumption and arrival.In order to ensure trust when changing the amount of resource, access to the blockchain is provided by all KPs directly with using the private-public key pair.
To solve the service tasks related to processing and storing large data sets from sensors and robots in the cyber space, the Information service and Sensors KPs are allocated.In addition, it is possible to interoperate the blockchain and smart space networks with blockchain KP.This KP is necessary for automatic control over the performance of smart contract conditions based on information located in smart space.

Conclusion
In the work the methodology of creation of the cyberphysical smart space, allowing formation and functioning of coalitions of intelligent robots is proposed.The methodology is based on the use of the concept of a "blackboard" to ensure the prompt exchange of information between coalition members and smart contracts in blockchain technology for the distribution of sensors, network, computing, information management and service tasks between intelligent robots, embedded devices, and equipment.To ensure the interoperability of heterogeneous participants in cyberphysical space, an ontology can be used that represents knowledge and competencies of robots in the system.
The use of blockchain technology and smart contracts in the proposed approach has allowed to provide immutable distributed storage of transactions about robot actions and resource allocation.This kind of storage is important on the negotiation stage when the coalition is formed to bind separated tasks with concrete coalition participants as well as on the execution stage to check the tasks execution process.