Context-aware architecture for Industry 4.0-ready manufacturing facility

The industry 4.0 revolution is empowering the manufacturing sector with several advantages from the production to consumption stage of products, or beyond that. Recently, operators in factories have been accumulating extensive data from machine sensors and other organizational and operational technologies such as company enterprise and planning systems. Notably, having access to extensive data is a double-edged sword. To the best of our knowledge, there is not any work in the literature that proposed architecture for industry 4.0 based on a context-aware system. The aim of this research is to provide the context-aware architecture to enhance decision-making in factories and reduce the exposure of operators to the necessary and related findings. The proposed system is contextually aware of three aspects, operator feedback for previous similar findings, specifications of products under production, and historical data of manufacturing machines. The proposed system is proactive which attracted operator attention only when the findings were contextually related, based on the aforementioned aspects. The contributions of this research an intelligent architecture, a case study, and a mathematical model.


Introduction
*The world is living in transformations caused by the digital revolution that began in the last quarter of the last century, characterized by the fusion of all the techniques across the physical, digital, and biological worlds, blurring the lines between them. There are three reasons for these transformations to be unique in nature and distinct and not merely an extension of the third industrial revolution, namely the speed of change, its scope, and the impact of these transformations on prevailing systems. The speed of the current scientific breakthroughs has no parallel in human history; the development of digital technologies is at an amazing speed compared to the previous industrial revolutions (Peruzzini et al., 2017).
The fourth Industrial Revolution as it shows in Fig. 1 is a result of the impact of technology, the Internet, and computers on various sectors of development and labor. Industry 4.0 is a collection of material science, robots, nanotechnology, 3-D printing, unmanned aerial vehicles, digital computing, and globalization. In recent times, the Industry 4.0 revolution empowers the manufacturing sector with abilities to link machine data from Operation Technology (OT) to a historian server (HS). The machine data from OT includes different categories such as utility data (temperature and air pressure), process data (cycle time), and other data. These data are archived in HS. Thus, operators can access historical data for troubleshooting purposes.

Problem statement
In reality, the revolutions in operation and information technologies have improved and empowered the civilization from mechanical-based manufacturing and mass production manufacturing to contemporary highly automated and connected production lines, resulting in efficient and effective production lines (Lee et al., 2014). As mentioned above, Industry 4.0 empowers manufacturing stakeholders with access to extensive data from different sources. These data are helpful once they are presented in an integrated platform with decision support capabilities (Lee et al., 2013).
There are few architectures in the literature (Jardine et al., 2006;Colombo and Karnouskos, 2009;Lee et al., 2017;Teti et al., 2010;Gao et al., 2015;Agarwal and Weill, 2012;Zhong et al., 2017) that authors claim is intelligent. However, to the best of our knowledge, there is not any study in the literature that considers building an intelligent architecture of industry based on the concept of a context-aware system that reduces the interaction with the machine. The proposed approach presents several advantages to the industry. To verify the viability of the proposed approach in real life, the author presents a real-life case study. In addition, a mathematical model presents the approach in a mathematical way. This approach uses several internal and external data related to the user, machine, and products; the system collects these data for the required analysis. In addition, this approach can benefit from user feedback because the operator feedback can be used as an input to the prediction component of the proposed approach. This paper is organized as follows: the next section presents the related work. The following section describes the concept of a context-aware system. The next section focuses on the proposed system. After that, the research illustrates applying the proposed system to a real-life case study. Then it presents the mathematical model/algorithms. Finally, it presents discussions and provides the conclusion of the study. However, unlike the three previous revolutions of industry where the adoption of the revolution was smooth and did not require a lot of preparation, the adoption of Industry 4.0 and achievement of its promising recompenses requires a tight collaboration between stakeholders such as government agencies, business owners, manufacturing sector, and researchers (Lee et al., 2017;Agarwal and Weill, 2012;Zhong et al., 2017) and academic institutions. Lee et al. (2017) described systems for Industry 4.0 as those that can collect, process, and analyze data to deliver simple information about the production equipment availability, production quality, and performance. The information is based on historical and real-time data. Additionally, to stress the importance of maintaining all related data in one intelligence system, authors of Colombo andKarnouskos (2009), Teti et al. (2010), Gao et al. (2015), Agarwal and Weill (2012) and Zhong et al. (2017) argued that the factory of the future has to collaborate all factory connected devices and business systems such as the connection between Enterprise Resource Planning (ERP) and operation technology. Hence, Industry 4.0 in well-structured factories with an IT backbone are harvesting these capabilities by presenting new data sources, such as product history from planning systems and employee capabilities from HR systems, to the operation and maintenance teams.
However, the implementation of Industry 4.0 technologies such as connecting production lines and machines provides access to historical data, several dashboards, and new data sources; operation and maintenance teams struggle to draw meaningful conclusions from those data. Therefore, in literature, studies focus on implementing novel systems such as condition-based maintenance (Jardine et al., 2006). To enhance these systems, researchers recommended better analysis practices using available machines and process data and advanced to predictive maintenance level (Lee et al., 2013). Connecting machines provide more data about the machine and production process that help predictive models to provide better results (Teti et al., 2010). Hence, it motivates researchers to explore novel practices that can be helpful by providing new data sources in collaborative design (Lee et al., 2013;Gao et al., 2015). Lee et al. (2017) observed that Artificial Intelligence (AI) is an essential component of Industry 4.0 and would have a big impact on different aspects and areas of manufacturing. Moreover, the authors of Zhong et al. (2017) overviewed related work in artificial intelligence. In one of the cases, AI was observed to be helpful in determining the remaining lifetime of machines, mainly by tracking the machine data to detect analogous engine behavior (Lee et al., 2014). In addition, the authors of Lee et al. (2014) recommended a more comprehensive analysis environment. In Industry 4.0, artificial intelligence is not only limited to fault prediction but also used in other important areas such as customer satisfaction. Agarwal and Weill (2012) observed that artificial intelligence empowered customer relationship personnel of automobile companies to be more empathetic towards customers, owing to their ability to mine history orders and operator feedback; it was a vital player in customer satisfaction.

Context-aware system
Pervasive computing encompasses a wide range of systems, and one of these is a context-aware system. Want et al. (1992) developed the first context-aware system application when they introduced the active badge location system. Later, this application was one of the first context-aware applications (Baldauf et al., 2007). The main aim of context-aware systems is to adjust their processes to the current context. Fig. 2 shows the architecture of the context-aware system. Several definitions for the word "context" have been introduced by certain authors according to their opinion and research area. Ryan et al. (1998) clarified the word "context" as the user's location environment, identity, and time (Ryan et al., 1998). Whereas Abowd et al. (1999) defined "context" as the user's emotional state, the focus of attention, location and orientation, and date and time, in addition to objects and people in the user's environment (Abowd et al., 1999). Another definition can be obtained via the synonyms in any English dictionary, such as situation, surroundings, environment, and position (Alharbi et al., 2012). The precise definition of "context" given by Dey (2000) is-"any information that can be used to characterize the situation of entities (i.e., whether a person, place or object) that are considered relevant to the interaction between a user and an application, including the user and the application themselves" (Dey, 2000).

Application
Several definitions for a "context-aware system" are present in the literature. Abowd et al. (1999) defined a "context-aware system" as "a system that uses context to provide relevant information and/or service to the user, where relevancy depends on the user's task" (Abowd et al., 1999). This definition offers a more general understanding of a contextaware system. Therefore, a context-aware system can sense the environment and react to any changes. It is important for the reader to understand the concept of context-aware architecture.
The basic design and architecture of the contextaware system are presented in Dey (2000) and depicted in Fig. 2. The architecture consists of different layers, from sensors to applications.

Proposed system
Factories that rely on Industry 3.0 technology have an advantage in troubleshooting failed machines by accessing the Human-Machine Interface (HMI). HMI displays all error messages that are recorded in the Programmable Logic Controller (PLC). Hence, troubleshooting machines in Industry 3.0 relies heavily on three aspects:  Knowledge and skills of operation and production team: Whenever a machine fails for any reason, the team that operates the machine is the first team to troubleshoot. Their knowledge and capabilities impact troubleshooting effectiveness.  Knowledge and skills of the maintenance team: The second phase of fixing a failed machine is conducted by the factory maintenance team. The maintenance team is in charge of the maintenance of the entire factory. Their knowledge goes beyond the knowledge of the production and operation team for two reasons-their specialty as a maintenance team and their experience in all factory resources such as the utility machines (air compressor and chiller water).  Report of HMI: When a PLC-equipped machine fails, an HMI presents an error message and certain hints to the operator and maintenance team. This technology is called operation technology (OT).
Data retrieved from OT, such as data available on PLC, can be integrated into an organization's information technology (IT). This integration provides production, operation, and maintenance team data from two different sources. These sources possess different categories of data such as process data from OT and data about employee skills and qualifications from IT as shown in In summary, the Industry 4.0 mechanism aims to collect data about machines, manufacturing, the environment surrounding the production lines, humans, raw materials, and others. This data corresponds to time-series data, which implies that the current data and historical data are stored.
Based on the aforementioned aspects, this research proposes an architecture for maintenance based on a context-aware architecture that includes machines' current error report and historical data, team members who are interacting with the failed machines, environmental and seasonal data, and available data of similar machines within the same factory or even outside it.
An overview of the proposed context-aware machine architecture is presented in Fig. 4. The proposed system consisted of two layers, the upper and bottom layers. The upper layer included three main components-system profile, system manager, and context-aware system. These components could communicate with each other and with the bottom layer to predicate any change that might happen during the process operation.
The bottom layer included the outside data component that comprised various types of data, and each type was an independent provider. The main aim of the outside data component was to supply the upper layer with appropriate and contextually related data, in the form of virtual data. At present, we will explain the three components of the upper layer, as depicted in Fig. 4

System profile component
The system profile was responsible for storing the temporary data of operators and machines obtained from the bottom layer via a context-aware system. Once started, the system recognized the connected machine and the operator using the system. The system started by feed up the contextaware by both system profile and outside data. The data included all facts about the operator and the machine, such as the operator experience, machine specification, and machine age. Furthermore, the system profile temporarily stored time-series data produced by the machine while the machine was in production mode. The system profile could communicate with only the system manager component and context-aware system.

System manager
The only way for the operator to interact with the proposed system was through the system manager. It is predicted that the system management system will be deployed as an application on smart devices.

Context-aware system
The context-aware system was in charge of filtering, predicating, and interpreting the raw data provided by both layers. It consisted of six subcomponents-acquire, context history, profile detector, creation, predication, and feedback as shown in Fig. 5. Each component will be explained in more detail.

Acquire
The main objective of the acquire component was to gather or isolate raw data initiated from the bottom layer, which was an outside data component. In addition, it provided both a profile detector and predication with raw data.

Context history
The context history component was responsible for storing high-level information that had been gathered previously, processed, analyzed, and had thus already been transported to the operator during the tasks. The storage of this information was necessary as it prevented the transfer of duplicate information to the operator at a later point in time. At the end of every task, all the information in the context history was stored in the outside data component as permanent data.

Profile detector
The profile detector component was associated with the system profile, acquire, and predication components. It was responsible for providing the predication component with information related to the machine and operator from the outside data or system profile component via the acquire component.

Predication
The predication component was responsible to predict/produce contextual information. This component could learn, reason, and be dynamic. It had the ability to predict based on the contextual information received from the profile detector, context history, and acquire components.

Creation
This component was responsible to create an action based on input from the predication component. The action had to be transported to the operator via the system manager.

Feedback
The feedback component was introduced to increase the precision of the operator requirements. This component was responsible for feeding up our proposed system with the reaction of the operator. The feedback from the operator was ranked from high to low. The result from the feedback was stored in the context history during the task time and used by the predication component when required.

Applying the proposed architecture to a reallife case study
The case study undertaken was for a printing and packaging factory. The factory produces food and beverage bottles from raw materials such as polyethylene terephthalate (PET)  A context-aware system, in general, faces three scenarios: First, the machine performs with a normal setting, and there is no expected variance or abnormal trending. Second, the machine performs normally with an expected variance, however, the expected variance already has negative feedback in the historical data from an operator in a similar situation. Third, the machine performs normally with an expected variance that never happened with the same operator or variance that has a positive reaction from the same operator.
To apply the context-aware architecture to the preformed bottle line, the contextually related data was divided into two main categories based on the variation of the data and functionality.

I.
System profile (real-time operation data): The system profile data included all data belonging to the production machine, the process of the production, and the production itself, such as the description of the machine, the preformed bottle production process such as heating temperature, and the calculated and collected data from the current production task data. The most common sources of the system profile data were:

Machine data (facts and specifications):
Machine capability and specification 2. Process data (Time series data (Table 1)).
Process parameters: Each production machine possessed a group of parameters. These parameters were adjusted based on the formula of each product. Table 1 presents how production processes are stored in the outside data. Each parameter has five attributes:  Parameter name (Kn)  Parameter measurement unit (Unit), e.g., bar, mm, and s.  Parameter value settings based on the product formula that lists all values of the process parameters for that product (Table 1 includes parameters and their settings for three different products, namely Preformed Bottles 13.5g, Preformed Bottles 24g, and Preformed Bottles 35g.): a. Parameter maximum value (maxv): The maximum allowed value that a parameter can reach. For example, in the pressure parameter case, the machine cannot have a pressure of more than 10 bar. b. Parameter minimum value (minv). c. Parameter center value (cv): The center value represents the targeted value that is considered as the optimal value for that parameter.
Outside Data: The outside data included all data retrieved from the outside system but is related to the production machine, production material, or/and the operators. The most common outside data sources were:  Enterprise data (data from ERP) (i.e., Raw material data and Operation and maintenance team data (HRMS))  Historical Data: The history database archived the production data for all previous production tasks. The data included all the aforementioned data in the process data section.
The proposed system is stage-based. It included several stages as it is shown in Fig. 6. Let us attempt to align the case study and the system stages for a clearer case study. The stages included operator registration, context system preparation, contextaware prediction system, and operator feedback and actions.

Stage 1: Operator registration
On the first use of the system, after an operator signed up with his/her enterprise login credentials, the system created an operator profile in the system profile component. The operator profile included operator email, tasks, skills, and responsibilities. Each time the operator logged in, the system profile retrieved the operator profile data from the outside data component via the profile detector and acquire components. In the outside data, the operator data was derived from the enterprise HRMS for human resources data and ERP for schedule, planning, and production data. Hence, the system stored the operator's current data in the system profile component, and this was used to initiate the operator profile.

Stage 2: Context system preparation
Each time an operator with an assigned task logged into the system, the system prepared itself for its main task of automatic prediction for any variance in the product centerline process data. The preparation included the following steps: 1. The system profile retrieved the machine data from the outside data via the acquire and profile detector components and stored them temporarily in the system profile component. 2. The system profile retrieved product centerline process parameters from the outside data component and stored them temporarily in the system profile, similar to step 1 (Table 1). 3. The system profile retrieved the value of product centerline process parameters with their allowed variances and stored them temporarily in the system profile, similar to step 1.

Stage 3: Context-aware prediction system
The objective of the predication component was to predict any change in the value of product centerline process parameters. The component predicted a change if the value was outside the limited variance. Further, the component considered the context of the machine, product, and operator. For instance, the component would be aware of the previous decision of the operator for any repeated prediction for a certain parameter. The component performed as below:  For any assigned task, the predication component constantly monitored the value of product centerline process parameters.
 The component used the acquire component to retrieve all important data that played a main role in the predication component from the outside data, context history, and profile detector. In particular, these data were real-time CLD, context history data from the context history component, and historical production data from the outside data component.  Fig. 6: Applying the case study to the proposed architecture The system used its intelligent part and the aforementioned data to predict any undesired change in the value of real-time CLD.
The predication component compared the new prediction results with the previous feedback of the operator for similar prediction results stored in the context history component.
If these prediction results were unprecedented or the operator feedback was positive, the creation component created an alert message to the operator.

Stage 4: Operator feedback and action
The creation component created a notification containing the predication result and delivered it to the operator via the system manager.
Based on the prediction results, the operator usually could perform several actions-ignore the alert, react and adjust the CLD of the product, or stop the machine to perform urgent maintenance.
The operator feedback component received the operator feedback via the system manager and stored the new feedback. In addition, this component identified the operator action via the system manager and stored it in the context history component for future use.

Mathematical model/algorithms
This section presents a mathematical model that demonstrates how the case study works in a mathematical model.
The operator of the system is denoted by , and each operator has an . The logging in of an operator, , into the system to start the work is denoted by ( ( ). The operator enters the login credentials into the system via the system manager, and if the credentials are accurate, then ( ) = t. Then, the system automatically retrieves the operator data from the outside data, denoted by , and stores it in the system profile. This is expressed as: where, : The system profile; ( ): The operator data stored in the system profile; : The operator name; : The operator email; : The operator task; : The operator skill; : The operator responsibility.
The next stage is to obtain the machine data from the outside data component and store it in the system profile. This is expressed as: where : The system profile; ( ): Machine data number that has to be stored in the system profile; MAN: The name of the machine; MAT: The type of the machine; j: The machine index.
Each product is denoted by and the products index by , where 1 < ≤ .
There are certain parameters, , that are related to each product. The number of the parameter is denoted by , where 1 < ≤ . For each product , there are number of parameters. This is denoted by ( ) .
For each parameter , there are three valuescenterline value, ; maximum value, ; and minimum value, . We can express ( ) as: For example, if we have a product 1 that has one parameter 1( 1 ) , this parameter has three values: = 70, = 72, and = 68. The system obtains the three values of each parameter from the outside data component and stores them in the system profile. This can be expressed as: During the production process, the actual value ( ) changes over time (previous ) and during the task. For this reason, the system has the ability to predict any change in ( ) that exceeds beyond the ( ) ( ) values and alert the operator in the event of any change. Hence, we set up the following condition: where ℎ( ) denotes the feedback of the operator for similar situations that were stored in the context history. Thus, the prediction is considering the contextual data that is related to the same product and operator.

Discussion
This study proposed an intelligent architecture for machines in the manufacturing sector. The architecture was built on the concept of a contextaware system. A context-aware system is any system that uses environmental context to predicate a new context related to the operator or object. A contextaware system can be applied to any domain such as those described in Alharbi et al. (2012) and Alharbi (2014) that presented a proactive context-aware architecture.
To the best of our knowledge, no one has proposed such an approach in the industry section. The proposed system had several advantages such as:  This approach used several internal and external data related to the operator, machine, and products; the system collected these data for the required analysis.  This approach benefitted from the operator feedback because the operator feedback could be used as an input to the predication component of the proposed approach.  One of the features of the approach was that it had a temporary memory to store the data during the operation process. In addition, the system had a historical memory that could store all the data after each task, to be used in the next task. This satisfied the system objective of storing all contextually related data for the current task and any previous similar tasks.  The proposed approach could automatically consider the context of each operator. The operator could define his or her individual interests in the system profile. Therefore, the proposed approach was highly capable to understand the operator behavior. This decreased the interaction between the operator and the machine production and, in turn, reduced the traditional work and advanced towards the automated work.  The general approach was applied to a real-life case study, which was a printing and packaging factory. This demonstrated the viability of the proposed approach.  A mathematical model was presented to describe the system using mathematical concepts and provide appropriate clarifications for the system and the case study.
In Industry 4.0, Digital Twin is applied (Uhlemann et al., 2017). The digital twin mainly focuses on the process parameters obtained from the machine. Most of the digital twins include a trending dashboard and other analytical tools. However, they do not include any outside data such as the material data, operator information, and ERP and planning information. The digital twin is not capable of receiving the operator feedback; furthermore, it does not include the operator feedback in future analysis. The proposed context-aware system included most of the related information and operator feedback to enhance the analytics engine. In addition, it enhanced the operator experience by focusing their attention on the most related alert, considering the operator feedback in similar situations.
The proposed solution was operator-centric. For any new task, the system published a profile considering the operator information in previous similar tasks. In addition, while the task was running, the system acquired the operator feedback to enhance the analytic engine outcome and provided the operator with a better user experience.
In conclusion, Table 2 presents a comparison between proposed architecture and other scientific works that were found in the related works. As a result, eighth criteria have been choosing to measure the success of the proposed approach against three proposals in the same field, which shows that the proposed architecture has all the criteria comparing with others.

Conclusion
The proposed system was built on the concept of a context-aware system that is contextually aware in three aspects: Operator feedback for previous similar findings, specifications of products under production, and historical data of manufacturing machines. The proposed architecture is a proactive one that attracted operator attention only when the findings were contextually related, based on the aforementioned aspects. The contributions of this study are an intelligent architecture, a case study, and a mathematical model.
The author starts with the revolution of the industry from Industry 2.0 until Industry 4.0, which is present in the introduction section of the paper. Then the motivation for the research is presented. The context-aware system, a new phenomenon of interest that has been used to build the architecture, has been identified. Subsequently, the author presents the study approach in two figures with definitions of each component. To demonstrate the applicability of this approach in real life, a real-life case study is explained in four stages. To be more specific, a mathematical model has been proposed for the case study with more details. Finally, a discussion and conclusion have been presented.

Conflict of interest
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.