A Study on Semantic-Based Autonomous Computing Technology for Highly Reliable Smart Factory in Industry 4.0

: Smart factories have made great progress with the development of various ICT technologies, such as IoT, big data, and artiﬁcial intelligence. The recent development of smart factory technology has shown results in automation and data acquisition and processing. However, it still has incomplete points to be converted to advanced technology, including intelligence. For intelligentization, there is a need to propose a new research method in addition to the previous methodologies. Considering the speciﬁcity of the factory, the data structure and methodology of the Semantic Web can be effective. Therefore, in this study, a smart factory was designed by the convergence of monitoring technology, autonomous control technology, and semantic web technologies. Based on the proposed methodology, a methodology for the autonomous control of a smart factory on a digital twin was designed.


Introduction
Recently, industries in major countries have shifted from a labor-intensive production structure to a knowledge-intensive structure. As a result, competition for product performance and quality is intensifying. Korean manufacturing industries, such as semiconductors, automobiles, and mobiles, use standardized communication technologies to respond immediately to customer changes and prepare measures for mass production of various types [1]. In this environment, Industry 4.0 is a paradigm that has evolved into a smart factory or an intelligent factory in the traditional manufacturing industry [2].
The complexity of a smart factory has increased significantly due to changes in the market according to the various needs of consumers, development of cyber-physical systems (CPS), Internet of things (IoT), wireless communication technologies, and so on [3].
Recently, services such as communication, banking, and shopping provided by companies have also been fused with information and communication technology. They can be performed without interactions between individuals. In addition, as heterogeneous computing devices, software, and communication methods are very closely coupled, computing technologies are evolving into complex, diverse, and large-scale systems that interwork with each other in a distributed environment and achieve a common purpose or goal.
When various manufacturing facilities, such as smart factories that communicate with each other and form a network to perform various processes, are operated, there is a very high possibility of more error situations than before. The complexity of the system is very high due to the connection between manufacturing facilities that perform various manufacturing processes and the communication network. Accordingly, the possibility of unexpected errors or situations also increases [4].
In particular, the implementation of smart factories is being promoted by the development of cyber-physical systems and IoT technologies, which are complex aggregates of information and communication technologies. For more reliable implementation, communication middleware/protocol, autonomous computing technology, and manufacturing generating information. It is a structure in which data samples are published. It then distributes the data sample to all the subscribers interested in the topic.
DDS manages message addressing, data marshaling, demarshalling, distribution, flow control, and retries. In addition, DDS has the characteristics of a message-based connectionless service. It provides a real-time communication environment that enables access to data regardless of service information (location, time, synchronization).

OPC
OPC [9] is an industrial communication protocol standard to securely and reliably exchange data in the automation field of manufacturing. OPC was standardized to improve problems existing in the manufacturer-dependent monitoring system. Control SW/HW, Microsoft's OLE (Object Linking and Embedding), COM/DCOM (Component Object Model/Distributed Component) Object Model), the server, and client exchanging data have to comply with standardized matters. OPC is divided into 'OPC Data Access' for OPC data access, 'OPC Alarms and Events' for OPC alarms and events, and 'OPC Historical Data Access' for OPC historical data access. However, OPC is dependent on Microsoft's OLE and COM/DCOM technologies. Therefore, a new standard, OPC-UA (OLE for Process Control Unified Architecture), has been recently proposed to compensate for these shortcomings of OPC [10]. OPC-UA is an integrated open platform that supports security (mutual authentication, encryption) and data modeling.

The Need for MTConnect
As mentioned above, communication middleware/protocols, such as DDS, OPC, and OPC-UA, are being developed for mutual data exchange between heterogeneous devices. However, for interactions with heterogeneous devices and systems, a higher level of interoperability is required with a simple data exchange/conversion.
Recently, the industrial network environment has been evolving from a closed structure to a service-oriented structure from the point of view of information technology. Data distributed in a closed way inside the factory are open to the outside for company-wide visibility. In other words, the need for interoperability is increasing. MTConnect is an industrial communication protocol standard based on communication/analysis using 'agent/API' and so on. MTConnect is a standard based on XML message format and RESTful interface [11].

MTConnect
MTConnect [12] is an extensible lightweight protocol developed for the data exchange between manufacturing facilities and applications. It is mainly used for monitoring and data analysis in industrial network environments.
MTConnect parses and provides manufacturing facility data in XML format (based on HTTP protocol). The interoperability can be greatly improved by exchanging data between different types. In addition, by using the RESTful interface method, the scale scalability and versatility of the interaction can be increased.
There are three data types that can be expressed by MTConnect: (1) property data of a physical device (model number, serial number, maximum speed, device threshold, and so on); (2) real-time data measured by the device; and (3) real-time data of the device itself (current speed, position, temperature, and so on).
The MTConnect structure consists of eight basic elements, as shown in Table 1 below. In MTConnect, there is an 'agent' that performs the role of real protocol implementation and XML generation. This 'agent' stores and manages data in the form of 'key/value' through a queue. As shown in Figure 1, the agent can manage using unique keys. MTConnect's agent processes XML messages in a FIFO method. To identify the data stored in the queue, there are three request types, as shown in Table 2. Table 3 shows MTConnect's response XML main elements of messages.

Probe
To retrieve the components and the data items for the device

Current
To retrieve a snapshot of the data item's most recent values or the state of the device at a point in time Sample To retrieve the samples, events, and condition in time series Table 3. MTConnect response XML element.

Elements Description
MTConnectDevices Contains information about each device served by this agent and specifies the data items that are available MTConnectStreams Contains a timeseries of samples, events, and condition from devices and their components MTConnectError Contains information about an error that occurred in processing the request Recently, methodologies for the high reliability of MTConnect based cyber physical systems (CPS) have been developed. They are being used in domains such as manufacturing, defense, and aviation. In particular, the MTConnect Association and OPC Council are promoting MTConnect and OPC-UA Companion standards to ensure the interoperability between the standards maintained by each organization and to expand the scope of the existing manufacturing data exchange standards and implementation technologies. In addition to UA, the use of MTConnect is expected to expand further.

Traditional Autonomous Computing Technology Trends
Traditional autonomous computing technologies consider the following requirements to secure reliability, robustness, and availability.

•
Monitoring: to identify 'errors' in the running system. • Analysis: to analyze types of identified errors and determine the problem resolution request by analyzing the severity of the problem. • Diagnosis: to diagnose the cause of the problem and suggest a solution based on the diagnosis. • Strategies: to choose strategies to solve problems that have arisen. • Implementation: to dynamically deploy and execute the structure and behavior of the target management system in operation.
Based on the above-mentioned requirements, an autonomic computing technology should be able to control and resolve errors that occur in the system automatically/autonomously. Such technology can recover system errors by self-managing the state of the system while minimizing human interference [14].
The traditional component-based autonomous control methodology [15] uses an autonomous control method for error detection in a component-based system consisting of components and connectors. For autonomous control, it has a feature of detecting errors that have occurred by setting a component monitor inside the component. The component monitor can monitor objects inside the component and the message-passing relationship between the components. It can execute the strategy of reconstructing the component relationship when the constraint is violated by comparing the state information prepared in advance in the state chart. This methodology has advantages of stipulating the message delivery relationship of the facilities operating in a manufacturing environment and handling errors that occur.
However, it is necessary to analyze errors that occur in the manufacturing facilities, communication protocols, and server-side since a lot of manpower and time are required to analyze the manufacturing process for various purposes. One of various ways to solve this problem is to design a management area that can understand the manufacturing environment, that is, a 'target model' and an 'error model'.
The heartbeat framework [16] proposes a method for checking the communication signal based on the component's communication environment and recognizing the normal/abnormal status of the management component. This methodology has the advantage of checking the normal operation of components based on a timer and a heartbeat generator. A non-response of the communication signal indicates that an error has occurred inside the system. If there is no response to the heartbeat signal, a reset and restart strategy can be used to solve the problem. As an advantage, it is easy to detect the normal/abnormal conditions of a component or system by testing the response time for a communication signal. In addition, the consumption of system resources for autonomous control is reduced. However, it is very difficult to identify the type of error related to the internal state of a component. One of many ways to solve this problem is to reflect 'error modeling'.
An error event-based autonomous control methodology [17] has the characteristic of emphasizing the importance of error analysis by constructing a chain that can infer errors and symptoms. This methodology has the advantage of providing the data required for autonomous control by analyzing the normal operation of a target system to be managed. It then extracts and defines possible errors. However, such a methodology can lead to inaccurate definitions of errors for abnormal phenomena. Therefore, it is necessary to clearly define the error event that meets the management goal.
Our previous study proposed an autonomous control methodology for a highly reliable cyber-physical system [18]. It is a method for building a knowledge base to construct autonomous control systems. This methodology creates a knowledge base, such as error analysis, error event definition, error modeling, error state analysis, and strategy decision. As an advantage, the detailed creation process of the knowledge base is well explained. However, it is necessary to analyze the error associated with the target model that models the management goal. In other words, more advanced autonomous control methodologies need to be implemented. Although traditional autonomous control research has been conducted at home and abroad, research in the smart factory field is still in its early stage.
Thus, the aim of this study was to present a target model methodology and an error tree-based control methodology for building a high-reliability smart factory.
Autonomous Control Process Figure 2 shows the autonomous control process by linking the target model and the error tree. It enables autonomous control in a four-step process: (1) mapping target model constraints, (2) monitoring target achievement rates, (3) recognizing problems and requesting diagnosis, and (4) diagnosing problems and executing strategies [19]. (1) To evaluate the error of a system, a constraint (a criterion for evaluating whether the goal is violated) must be connected to the goal, as shown in Figure 3. At this stage, it becomes a basic model of goal achievement by linking the constraints to the goals of the abstract system.
(2) Through the goal model to which constraints are mapped, the overall goal achievement rate of the system is monitored. If the target achievement rate is lower than expected, it recognizes that a problem has occurred and executes the next step, problem recognition and diagnosis request.
(3) At the current stage, if the goal achievement rate is violated, the current state is diagnosed and the cause is inferred based on the error tree shown in Figure 4 to recognize the goal that has not been achieved. Table 4 shows an error table prepared.    Table 5 shows the strategy execution table.

Semantic Web
Semantic web technology was proposed in 1998 by Tim Berners-Lee, the founder of the Web. A semantic web means a web with meaning. In more detail, it is a technology that expresses each resource object in a Linked List relationship on the Internet in a form that a machine or computer can understand and process. Through the application of these semantic technologies, the web can deliver simple information to a framework so that various services can be provided based on meaning [20].

Design of Semantic Factory
To build a semantic smart factory, it is necessary to analyze the components within the factory. The components of a traditional factory were man, material, method, and machine (4M). Today, these components have evolved into man, material, method, machine, and environment (4M1E), which includes factors such as pollution reduction.
Man can be defined as a worker. Its attributes may include general attributes, such as affiliation, position, years of service, disability, and attitude of the worker. Material indicates the material required for production. It includes the manufacturer, storage location, mixing ratio, and number of days in stock. Method refers to methods, mixing ratios, and order. Machine includes the equipment identification number, use, affiliated process, repair history, maintenance manual, and so on that might correspond to this.
Such information can be expressed according to the six-fold principle (5W1H). When (time stamp), where (machine), who (man), what (product or sub-product), why (work order), and why (work order) can be explained (method). That is, it can be called a situation. Manual information can be obtained accordingly.
Several methods have been proposed for the methodology for semantic design, including a method that divides the entire factory into layers of the bottom-up method and utilizes the information exchange method accordingly. The other method creates a basic ontology by analyzing the requirements through the collaboration of workers, ontology experts, and factory operation experts. It then gradually develops the ontology accordingly. There is also a technique for expanding based on information acquired, such as the facility and the asset of the facility [21][22][23].
In this paper, we intended to design a semantic web based on the process. The following figure shows the semantic design based on the process presented in this paper.
As shown in Figure 5, the process is located at the top, while facilities, workers, and materials are located at the bottom. Equipment, workers, and materials each have detailed information as subordinates, including asset details and detailed data for status values and sub-assemblies. If this is schematized in semantics, it can be expressed as the following figure. As shown in Figure 6, a process has relationships with workers, materials, and equipment. Workers, materials, and equipment also have relationships with each other. In other words, it is easy to understand that each object has an organic relationship within the same process. Method and environment are associated with the sub-processes of workers, materials, and equipment. In the case of the temperature and humidity of a work facility or a material storage place, their effects on workers, materials, and equipment are sub-data that can be semantized. The following figure briefly shows the sub-semantic relationships for machine.
As shown in Figure 7, the facility has the humidity and temperature as information of the external environment. It has a relationship with the parts included in the lower level. Examples of equipment such as CNC include motors and cutting tools. It has a structure that can describe the state of each lower part in detail.
In this way, each object in the factory is configured in an organic relationship. If there is a new requirement, a semantic model is added according to it. The configuration can be expanded from a small process area to the entire factory.

Semantic Data
Semantic data are data in XML format with the structure of subject-predicate-object. They are mainly defined by defined structure words, such as RDF and OWL. RDF provides a way to describe information about the data. A widely used relational database uses a table structure to describe information about the data. However, linked of data (LOD) pursued by the Semantic Web is based on a standard called RDF to describe information about the data. This is suitable for describing Unified Resource Identification (URI) in a graph form. Table 6 shows an example of RDF [16].
As shown in Figure 8, there is a rolling process in a virtual factory. The subjectpredicate-object can be expressed at each step by giving a URI that can identify the worker. OWL is a language designed to implement applications that can directly process information content. It does not just display information. As OWL includes a rich vocabulary and formal semantics, it is possible to create machine-interpretable web contents [17].
SPARQL is W3C's standard query language for data constructed in LOD format. It has a form similar to SQL for retrieving the desired data from a relational database [18].
As shown in Figure 9, the desired information is retrieved using SPARQL, a language similar to SQL but with a different syntax.

Design of Semantic-Based Autonomous Computing Technology
The structure of the semantic-based autonomous control system proposed in this paper is designed for the predictive maintenance of smart factories. The flow of this system is shown in Figure 10. The flow chart of the architecture proposed in this paper is shown in the figure below. The overall structure consists of four areas. The monitoring area collects various data generated from equipment, IoT, and sensors using MTConnect adapter/agent. The collected information is serialized in XML format in accordance with the semantic standard. Through this, a monitoring server is built. In the analysis area, various situations that can occur in the semantic factory are defined in semantic language in advance. The weights for these are defined in the target model through tools, such as decision trees. The problem is identified by analyzing it in the digital twin space implemented based on the data built from a monitoring server. In the planning area, the analyzed problem is planned for preventive maintenance using expert techniques or a set manual. In the execution area, based on the strategy established in the planning area, the situation in the factory is grasped, an execution plan is established, and actual equipment, IoT, and sensors are controlled. Figure 11 below is a schematic depiction of an actual motor factory in Gumi, Korea. If our proposal is applied to this factory, it can be implemented with the following model.
As shown in Figure 11, there are five major processes: (1) a process of making a motor cap, (2) a process of making a housing, (3) a bonding process, (4) an assembly process, and (5) an inspection process. Each process is connected by an AGV equipped with a robotic arm.
When explaining the factory inner grinding equipment modeled in Figure 8 as an example, first, the data generated from the equipment are collected using MTConnect. The MTConnet adapter converts the binary data generated in the facility into simple hierarchical data representation (SHDR) protocol. The agent stores the received agent. If there is an http request, it converts it into XML and provides the data.
The data of the lower stage along the semantic hierarchy are stored as the following Figure 12.  A digital twin is constructed based on the semantic repository transformed into semantic data. The reason why a digital twin is needed is because it consumes a lot of resources in order to perform a simulation on an actual physical model and to find and operate the optimal result value. The digital twin model defines and solves problems using goal models and expert techniques.
As shown in Figure 13, first, a problem is found through an error tree on a digital twin that is modeled on a virtual factory, and a solution and a plan are established using the semantic repository composed of manuals and coping methods made by experts. For example, if the normal operating value of the motor is 500~800, a low rpm is a warning sign. If this is defined as an error tree, it can be expressed in the following Figure 14.
As shown in Figure 14, low voltage, high voltage, bearing, and vibration are defined as constraints that cause the malfunction of the motor. Certain conditions are input according to each constraint. Through this, the cause of the malfunction can be defined. The set manual and response method can be easily searched through a semantic search. By identifying the cause of an error or a danger and quickly knowing how to respond through the reference of the object in the manual linked list method, it can be used for prediction, maintenance, and accident response.

Conclusions
In this paper, a more intelligent smart factory construction method is considered through communication technology, autonomous control technology control, and semantic web technology for a high-trust smart factory. Traditionally, monitoring, analysis, plan, and execution (MAPE) have widely been used for autonomous control. In accordance with this methodology, necessary technologies for an intelligent smart factory are introduced.
For monitoring, new technologies, such as MTConnect, which can easily and centrally monitor data from legacy equipment, were introduced, and a method for identifying problems through traditional autonomous control methods and goal models and error analysis trees was introduced. It suggested that the analysis of errors should be carried out on the digital twin and that the problem should be solved through the semantic model built through experts and manuals. In addition, the semantic model is presented as a good data exchange method for the abstract digital twin world.
There may be other ways to utilize the semantic web, MTConnect, error tree, and goal model presented in this study through big data and AI, which have recently been in the spotlight. Although it provides a method with a high degree of freedom, considering the specificity of the factory and that most of the predictive maintenance and response to emergencies are equipped with manuals, countermeasures and the experiences of workers cannot be ignored.
In order to improve the proposal of this paper, several future tasks should be performed. The semantic model proposed in this paper should be expanded to show a more detailed semantic model. A clear framework for implementing digital twins based on real or virtual factories should be described. Moreover, based on the detailed semantic model, performance evaluations should be performed based on the suggestions in this study.