=Paper= {{Paper |id=Vol-2893/short_4 |storemode=property |title=Integrating Smart Contracts into Smart Factory Elements' Informational Interaction Model |pdfUrl=https://ceur-ws.org/Vol-2893/short_4.pdf |volume=Vol-2893 |authors=Julia Lyakhovenko,Ilia Viksnin,Sergey Chuprov |dblpUrl=https://dblp.org/rec/conf/micsecs/LyakhovenkoVC20 }} ==Integrating Smart Contracts into Smart Factory Elements' Informational Interaction Model== https://ceur-ws.org/Vol-2893/short_4.pdf
Integrating Smart Contracts into Smart Factory
Elements’ Informational Interaction Model
Julia Lyakhovenkoa , Ilia Viksnina and Sergey Chuprova
a
    ITMO University, Kronverksky Pr. 49, 197101, St. Petersburg, Russian Federation


                                         Abstract
                                         The paper proposes a model for Smart Factory’s elements informational interaction and organizing their
                                         functioning using smart contracts. An approach for modeling Smart Factory is based on the Enterprise
                                         Resource Planning organizational strategy, which assumes the division of the manufacturing process
                                         into modules, and is focused on continuous balancing and resource optimization. The proposed model
                                         includes a common Central Computer, modules for resource managing, agents responsible for opera-
                                         tions, and task executors. The Central Computer receives a response from the External Environment,
                                         sends it to resource managing module, which determines the required amount of resources for the man-
                                         ufacturing operation and distribute tasks to the executors. To increase the production performance, two
                                         types of smart contracts are introduced: the former for defining a contract between the Smart Factory
                                         and the environment, and the latter for the production process organization. The integration of smart
                                         contracts into the production process allows to automate decision-making and control procedures, re-
                                         duce the probability of manufacturing a low-quality product, and diminish the production costs.

                                         Keywords
                                         Multi-agent system, Smart contracts, Smart factory, Smart factory model




1. Introduction
Smart contract is a block of computer code in which the agreement on the transaction between
the parties are formed. After the parties established the contract, it is maintained in the
blockchain and comes into force. Such contracts are used in various fields such as finance and
insurance, e-commerce, taxation and auditing, etc.
   The integration of smart contracts and blockchain technologies into various economy sectors
[1] is crucial for the Internet of Things (IoT) concept, which connects various physical objects
with each other via Internet and provides their informational interaction.
   Decision-making and execution control automation [2] in such an area as manufacturing
accelerates the production process, reduces its costs, and diminishes the number of system
vulnerabilities. The introduction of smart contract technology into the production system
(hereinafter referred to Smart Factories) allows to decrease risks of manufacturing a low-quality
product that does not meet the declared requirements, and ensures an increase in production
processes performance and accuracy. The advantages of integrating smart contracts into the

Proceedings of the 12th Majorov International Conference on Software Engineering and Computer Systems, December
10–11, 2020, Online Saint Petersburg, Russia
" lyakhovenko.kam@gmail.com (J. Lyakhovenko); wixnin@mail.ru (I. Viksnin); chuprov@itmo.ru (S. Chuprov)
 0000-0001-7396-2831 (J. Lyakhovenko); 0000-0002-3071-6937 (I. Viksnin); 0000-0001-7081-8797 (S. Chuprov)
                                       © 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
    CEUR
    Workshop
    Proceedings
                  http://ceur-ws.org
                  ISSN 1613-0073
                                       CEUR Workshop Proceedings (CEUR-WS.org)
production process are their application transparency, immutability, self-executing property.
   The contribution of this work is twofold. First, we propose a Smart Factory model, which
is described in the Enterprise Resource Planning organizational strategy context. The model
divides manufacturing process into modules, and is focused on continuous balancing and
resource optimization. In addition, we integrate smart contracts into Smart Factory elements’
informational interaction model, which allows to regulate the relations with the External
Environment and between Smart Factory elements’.


2. Related Work
Internet of Things (IoT) access control is a critical issue. In [1], the authors propose an intelligent
environment based on smart contracts, consisting of several contracts types: access control
contracts (ACCs), one judge contract (JC) and one register contract (RC). In such a system, each
ACC provides one access control method for the subject-object pair and implements it both
statically checking access rights based on predefined policies, and dynamically, verifying access
rights by checking the subject’s behavior. JC implements an abnormal behavior scoring method
to facilitate ACC dynamic check behavior by receiving abnormal behavior reports from the
ACC, assessing that behavior, and returning an appropriate penalty. The RC records information
on access control and abnormal behavior assessment methods, and provides functions (such as
registration, update, and deletion) to manage these methods.
   In [3] an intelligent logistics solution that includes smart contracts, logistics planning and
asset health monitoring in supply chain management was proposed. A prototype solution was
also implemented, demonstrating accountability, traceability, and responsibility for managing
the supply of various parties involved in the logistics scenario. The proposed solution uses a
smart contract system (SCS) that provides a recommended list of suppliers for a specific item to
be purchased. Once a list of suppliers is selected, the SCS sends notifications to the appropriate
suppliers and begins the negotiation process between buyer and supplier regarding conditions.
After the negotiation process is complete, a smart contract is established and a purchase order
is created. SCS receives periodic updates from the planner and condition monitoring modules
that provide information on the current purchase order status. These updates are used by SCS
to verify that the contract terms are met in accordance with the agreement. In the event of any
irregularities, SCS initiates the appropriate action specified in the contract, such as a certain
penalty or even cancellation of the purchase order.


3. Smart Factory Model
In this paper we consider centralized factory elements informational interaction model. Under
a centralized factory we mean a production model that has one common center responsible for
communication with the External Environment and production processes control. The Smart
Factory model description is formulated in the context of an Enterprise Resource Planning
(ERP) organizational strategy [4, 5], which assumes the division of the manufacturing into
modules, and is focused on continuous balancing and resources’ optimization. There are three
main groups of modules: finance, personnel, and operations. Our proposed model has one
common center and several control modules: a resource management module, an executor
management module, and an operations management module. To characterize a model, a
multi-agent approach was applied, which considers a system as a set of interacting intelligent
agents.
  The following types of agents were identified:

    • Central Agent - Central Computer;
    • Modules Agents: Resource Management Module Agent, Executor Management Module
      Agent, and Operations Management Module Agent (Comp1, Comp2, Comp3 respectively);
    • executors.

There is also some abstract wireless communication channel in the system. Figure 1 demonstrates
our proposed Smart Factory informational interaction model overview.
   Central Agent is the Central Computer, which communicates with the External Environ-
ment (for example, with a customer), verifies the information received from the control mod-
ules, and sends this information to the DataBase. The DataBase stores information about
orders received by the Smart Factory, the work of system agents and manufactured products.
Management Modules agents determine the available system resources, resources required
for the production, and perform task-distribution procedures. Executing agents have 𝑚 lev-
els, for each level 𝑞 access parameter is defined, i.e. set of executing agents: 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠 =
{(𝑎11 |𝑞1 ), (𝑎12 |𝑞1), . . . , (𝑎𝑚1 |𝑞𝑚 ), (𝑎𝑚𝑛 |𝑞𝑚 )}, where 𝑞 is the agent’s access parameter: 0 ≤
𝑞 ≤ 1, that distributes agents by access levels and determines the available functionality. The
following parameters are defined for each agent-executor:

    • a set of functions: 𝐹𝑗 = {𝑓1 , 𝑓2 , . . . , 𝑓𝑙 }, which depends on the agent’s access level and
      parameter;
    • agent’s resource set: 𝑅𝑖𝑗 = {𝑟1 , 𝑟2 , . . . , 𝑟𝑘 }, where 𝑖 relates to the agent 𝑎𝑖 ∈ 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠,
      and 𝑗 represents his level;
    • the remaining time of executor 𝑎𝑖𝑗 is 𝑡𝑤𝑖𝑗 , if 𝑡𝑤𝑖𝑗 ≈ 0, then the agent 𝑎𝑖𝑗 is redirected
      from the set of 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠 to the 𝐸𝑚𝑝𝑡𝑦 = {𝑎𝑖𝑗 ∈ 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠 : 𝑡𝑤𝑖𝑗 ≈ 0}, and
      𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠 = 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠 ∖ 𝐸𝑚𝑝𝑡𝑦

   Each 𝑎𝑖𝑗 = {𝑠𝑡𝑎𝑡𝑢𝑠𝑖𝑗 , 𝑙𝑜𝑐𝑎𝑡𝑖𝑜𝑛𝑖𝑗 , 𝑅𝑖𝑗 }, where 𝑠𝑡𝑎𝑡𝑢𝑠𝑖 = 0 if the agent is busy, and 1 if the
agent is free, and 𝑙𝑜𝑐𝑎𝑡𝑖𝑜𝑛𝑖𝑗 is the agent’s coordinates. The information space can be described
as 𝐼 = 𝐼𝑓 𝑢𝑛 ∪𝐼𝑟𝑢𝑙𝑒𝑠 ∪. . .∪𝐼𝑐𝑙𝑖𝑒𝑛𝑡 , where 𝐼𝑓 𝑢𝑛 is the information on Smart Factory’s functionality,
𝐼𝑟𝑢𝑙𝑒𝑠 is the Smart Factory’s rules, and 𝐼𝑐𝑙𝑖𝑒𝑛𝑡 is the information on Smart Factory’s consumers.
   Central agent has global knowledge on the information space. The resource management
module possesses information on the resources. The agent-executors management module
has information on the agent’s location and their status. The operations control module
has information on the different levels of executing agents’ functions, ways of transmitting
information over the communication channel such as encryption, transmission protocols, etc.
The combination of these modules constitutes a certain computer Shop.
   The manufacturing production can be represented as 𝑃 𝑅 = {𝑝𝑟1 , 𝑝𝑟2 , . . . , 𝑝𝑟𝑠 }, after con-
verting each product into some function by the Central agent: 𝑝𝑟𝑖 = 𝑓 𝑢𝑛(𝐴𝑖 , 𝐹𝑖 , 𝑅𝑖 , 𝐼, 𝑡𝑒𝑛 ),
this information is sent to the Shop, where, according to the provided function, resources, and
                                                   DataBase




                 External Environment           Central Computer




                                                                                         Shop


                                        Comp1       Comp2                      Comp3




                                         ...           ...                      ...




                                   executor1a     executor1b       ...          executor1n




                                    abstrPr1a      abstrPr1b                    abstrPr1n
                                                                   ...



                                                                         ...


                                                    Product




Figure 1: The schematic representation of the proposed Smart Factory model.


the required time, tasks are distributed among the executors agents. The production     ∑︀ process is
divided into several tasks: 𝑝𝑟𝑖 = {𝑡𝑠1 , 𝑡𝑠2 , . . . , 𝑡𝑠𝑑 }, where 𝑡𝑠𝑗 = 𝑓 𝑢𝑛(𝑝𝑟𝑖 ) and 𝑡𝑠𝑗 = 𝑝𝑟𝑖 ,
which means that all tasks are required to be performed to manufacture the product.
    Further, at each executing agents level, a task is performed, for which the access level and
functionality are defined. After that, the executing agents proceed to perform the assigned tasks,
the results of which are: 𝑎𝑏𝑠𝑡𝑟𝑃 𝑟𝑜𝑑𝑢𝑐𝑡1𝑎 , 𝑎𝑏𝑠𝑡𝑟𝑃 𝑟𝑜𝑑𝑢𝑐𝑡1𝑏 , . . . , 𝑎𝑏𝑠𝑡𝑟𝑡𝑃 𝑟𝑜𝑑𝑢𝑐𝑡1𝑛 . Further
information on abstract products (represented by (1)) is sent to the Shop, where it is verified for
the correctness of their assigning to the executing agents. All verified abstract products are
assembled at 𝑝𝑟𝑖 . After that, information on the product is sent to the Central Computer, where
it is verified for compliance with the product requirements. If the verification procedure passed
successfully, the information on the product is sent to the DataBase, and the product is sent to
the customer.

         𝐼 = 𝐼(𝑎𝑏𝑠𝑡𝑟𝑃 𝑟𝑜𝑑𝑢𝑐𝑡1𝑎 ) ∪ 𝐼(𝑎𝑏𝑠𝑡𝑟𝑃 𝑟𝑜𝑑𝑢𝑐𝑡1𝑏 ) ∪ . . . ∪ 𝐼(𝑎𝑏𝑠𝑡𝑟𝑃 𝑟𝑜𝑑𝑢𝑐𝑡𝑚𝑛 )              (1)


4. Our Approach to Smart Contracts in Smart Factory
For the centralized factory model, we introduce two smart contracts’ types. The former assure
the relationship between the External Environment and the Smart Factory, the latter is used to
organize the work inside the factory.
   The response for product 𝑝𝑟𝑖 manufacturing comes from the External Environment. Then, the
Central agent determines the required resources and functionality: 𝑝𝑟𝑖 = 𝑓 𝑢𝑛(𝐴𝑖 , 𝐹𝑖 , 𝑅𝑖 , 𝐼, 𝑡𝑒𝑛 ).
If the 𝑝𝑟𝑖 manufacturing is possible, a smart contract is composed between the Factory and
the External Environment: 𝐶𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 = 𝑓 𝑢𝑛(𝐶𝑒𝑛𝑡𝑟𝑎𝑙, 𝑝𝑟𝑖 , 𝑡𝑒𝑛 ), where 𝑡𝑒𝑛 is a producing
time limit, which is determined by the External Environment, 𝐶𝑒𝑛𝑡𝑟𝑎𝑙 is a function that
defines the resources and functionality, required to be performed by the factory: 𝐶𝑒𝑛𝑡𝑟𝑎𝑙 =
𝑓 𝑢𝑛(𝐴𝑗 , 𝐹𝑗 , 𝑅𝑗 , 𝐼, 𝑡𝑤𝑗 ). However, there are several conditions for the contract generation
process:
    • if 𝐶𝑒𝑛𝑡𝑟𝑎𝑙 → 0 : 𝐶𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 = 𝐹 𝑎𝑙𝑠𝑒;
    • if 𝑡𝑤𝑗 ∈ 𝐶𝑒𝑛𝑡𝑟𝑎𝑙 < 𝑡𝑒𝑛 : 𝐶𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 = 𝐹 𝑎𝑙𝑠𝑒;
    • 𝐶𝑒𝑛𝑡𝑟𝑎𝑙 ≥ 𝑝𝑟𝑖 .
   Information on the established contract is sent to the DataBase: 𝐷𝐵 = {𝐼𝑠𝑐1 , 𝐼𝑠𝑐2 , 𝐼𝑠𝑐3 , ...},
where 𝐼𝑠𝑐𝑖 = 𝐼(𝐶𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 ). After the 𝑝𝑟𝑖 manufacturing response is transferred from the
Central agent to the Shop, the Shop split the production procedure into certain tasks: 𝑝𝑟𝑖 =
{𝑡𝑠1 , 𝑡𝑠2 , . . . , 𝑡𝑠𝑑 }, 𝑡𝑠𝑗 = 𝑓 𝑢𝑛(𝑝𝑟𝑖 ). For each task, the access level 𝑞𝑒𝑛 , resources amount 𝑅𝑒𝑛
and functionality are defined 𝐹𝑒𝑛 : 𝐼(𝑡𝑠𝑗 ) = {𝐹𝑒𝑛 , 𝑅𝑒𝑛 , 𝑞𝑒𝑛 }.
   In the next step, the Shop forms internal smart contracts: 𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 = 𝑓 𝑢𝑛(𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠𝑎 , 𝐹𝑒𝑥 , 𝑅𝑒𝑥 , 𝑡𝑠𝑗 , 𝑡𝑒𝑛 ),
where 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠𝑎 ⊂ 𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠 is set of task executors agents, and 𝐹𝑒𝑥 , 𝑅𝑒𝑥 are functionality
and resources amount of these agents. In addition, the following contracts’ conditions are
introduced:
    • if 𝑡𝑠𝑖 ≥ 𝑓 𝑢𝑛(𝐸𝑥𝑒𝑐𝑢𝑡𝑜𝑟𝑠𝑎 , 𝐹𝑒𝑥 , 𝑅𝑒𝑥 ) : 𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 = 𝐹 𝑎𝑙𝑠𝑒;
    • 𝑅𝑒𝑥 → 0 : 𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 = 𝐹 𝑎𝑙𝑠𝑒;
    • 𝐼(𝑡𝑠𝑖 ) ≤ 𝐹𝑒𝑥 , 𝑅𝑒𝑥 , 𝑞𝑒𝑥 ;
    • 𝑡𝑤≥ 𝑡𝑒𝑛 .
   If one of the contact’s conditions does not met, the contract is canceled.
   When the contract is established, information on it is sent to the factory’s DataBase: 𝐷𝐵 =
{𝐼𝑐𝑜𝑛1 , 𝐼𝑐𝑜𝑛2 , 𝐼𝑐𝑜𝑛3 , . . .}, where 𝐼𝑐𝑜𝑛𝑖 is represented by (2). That is, knowledge on the
contract 𝑖 is linked to the knowledge on the previous contract 𝑖 − 1. This blocks’ sequence
forms a chain of related information. Information on the first contract 𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡0 is defined as:
𝐼𝑐𝑜𝑛0 = 𝐼(𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡0 ).

                            𝐼𝑐𝑜𝑛𝑖 = 𝐼(𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖 ) × 𝐼(𝑐𝑜𝑛𝑡𝑟𝑎𝑐𝑡𝑖−1 )                               (2)
5. Conclusion
In this paper, we proposed a novel approach for Smart Factory elements informational interaction
using smart contracts. The model is based on a multi-agent approach and ERP organizational
strategy, which divides the production process into several modules and is focused on continuous
balancing and resources optimization. Two smart contract types are introduced: the former for
generating a contract between the Smart Factory and the External Environment, and the latter
for manufacturing organizing inside the Smart Factory. The smart contracts integration into
the production process allows to automate decision-making and execution control, reduce the
probability of manufacturing a low-quality product, and decrease production costs.As future
plans, we intend to enhance the proposed Smart Factory elements’ informational interaction
model and integrate other manufacturing organization means into it, as well as conduct an
empirical study to assess the performance gain with smart contracts.


References
[1] Y. Zhang, S. Kasahara, Y. Shen, X. Jiang, J. Wan, Smart contract-based access control for the
    internet of things, IEEE Internet of Things Journal 6 (2018) 1594–1605.
[2] M. Wohrer, U. Zdun, Smart contracts: security patterns in the ethereum ecosystem and
    solidity, in: 2018 International Workshop on Blockchain Oriented Software Engineering
    (IWBOSE), IEEE, 2018, pp. 2–8.
[3] E. J. Umble, R. R. Haft, M. M. Umble, Enterprise resource planning: Implementation
    procedures and critical success factors, European journal of operational research 146 (2003)
    241–257.
[4] M. Al-Mashari, A. Al-Mudimigh, M. Zairi, Enterprise resource planning: A taxonomy of
    critical factors, European journal of operational research 146 (2003) 352–364.
[5] S. Rouhani, R. Deters, Security, performance, and applications of smart contracts: A
    systematic survey, IEEE Access 7 (2019) 50759–50779.