## 1 Introduction
### Smart Factory  
The smart factory is an essential component of Industry 4.0, which focuses on achieving smart production through networked manufacturing systems and vertical integration of production processes [46]. The smart factory is a concept that makes intelligent use of robotics, automation, embedded systems, and information systems toward Industry 4.0. It is considered a transformation from classical (standard) to intelligent manufacturing heading towards digital manufacturing and digital twin models supported by many emerging technologies such as Cyber-Physical Systems (CPS), Internet of Things (IoT), Big Data, cloud computing, and advanced AI [17]. The autonomously running production processes of the smart factory are made possible by making full use of cutting-edge technology and manufacturing models to achieve self-optimized performance, adapt to new circumstances, and learn from them in real-time, enabling a high degree of flexibility, efficiency, and customization. Several different fields of study have addressed the topic of \"smart factory\" in the published literature. In [47], an introduction to a smart factory architecture and its key enabling technologies and challenges, along with the application case, has been investigated. In [48], a systematic literature review on the smart factory was conducted in order to provide an overview of current research progress, advancements in this field, and promising future directions in this field. Another comprehensive literature review has been conducted in [49]based on a multiple-stage approach and chosen criteria to establish existing knowledge in the field and to evaluate the latest trends and ideas of Industry 4.0 and smart manufacturing technologies, techniques, and applications in the manufacturing industry. Some scholars focused on the key architecture of the smart factory and adopted a multi-layer description consisting of four main layers [46; 47]:  
1. Physical resources layer: it includes all manufacturing resources (machines, equipment, sensors, actuators). 2. Network layer: data transmission and sharing between different layers (mainly between the physical resource layer and the cloud layer) requires advanced network technologies and communication protocols for high-speed and reliable real-time communication. It utilizes advanced networking technologies and protocols such as industrial ethernet, industrial wireless networks, Fieldbus, Profibus, Wi-Fi, Bluetooth, CAN, Cellular 4G/5G, TCP, OPC-UA, MQTT, JSON. 3. Data Application layer: also called _cloud layer_, where the term _cloud manufacturing (CMfg)_ has recently been widely used within smart factory context [24]. This layer serves as an information hub center for the smart factory, where cloud computing technology enables various Big Data applications, including data exchange, data storage and data analysis, and data management [50]. 4. Terminal layer: In this layer, people are connected to the smart factory assets and resources and available information via end-user devices (terminals), including smartphones and tablets, PCs, and monitoring devices. This provides human intervention via remote supervision to the processes and visualization of the results from CMfg for real-time diagnosis and control of the factory or prediction for future actions based on feedback performance indicators. Figure 2 shows the architecture of the smart factory where the four layers are integrated via different levels of an _intelligent automation pyramid_. This pyramid is different from the classical one as it enables information exchange and interaction between the elements of the hierarchical levels of the industrial process via advanced computing, clouding, networking, and smart devices.