Abnormal Condition Monitoring of Workpieces Based on RFID for Wisdom Manufacturing Workshops

Radio Frequency Identification (RFID) technology has been widely used in many fields. However, previous studies have mainly focused on product life cycle tracking, and there are few studies on real-time status monitoring of workpieces in manufacturing workshops. In this paper, a wisdom manufacturing model is introduced, a sensing-aware environment for a wisdom manufacturing workshop is constructed, and RFID event models are defined. A synthetic data cleaning method is applied to clean the raw RFID data. The Complex Event Processing (CEP) technology is adopted to monitor abnormal conditions of workpieces in real time. The RFID data cleaning method and data mining technology are examined by simulation and physical experiments. The results show that the synthetic data cleaning method preprocesses data well. The CEP based on the Rifidi® Edge Server technology completed abnormal condition monitoring of workpieces in real time. This paper reveals the importance of RFID spatial and temporal data analysis in real-time status monitoring of workpieces in wisdom manufacturing workshops.


Introduction
The monitoring and localization of objects have been an active research and development field in recent years. Existing techniques include Global Position System (GPS), infrared, Local Area Network (LAN) and ultrasound-based methods, etc. [1]. However, these technologies have some disadvantages. Thus, GPS technology is often used to locate outdoor objects, and is not suitable for indoor monitoring and localization due to its requirement of a direct line-of-sight communication to the satellites. Infrared methods also require a direct line-of-sight and involve a short-range signal transmission, and thus are not suitable for indoor monitoring and localization either. Wireless LAN technology is used to monitor and locate the objects by signal strength, and the target objects must be in the coverage area of wireless LAN, hence it might not be a good solution. Ultrasonic technology utilizes the Time of Flight (TOF) method to locate target objects. It usually requires either a transmitter or a receiver to accurately determine the location. Radio Frequency Identification (RFID) technology has become popular and been widely used in many fields due to its advantages [2], such as contactless communications, high data rate and security, no need for line-of-sight readability and low cost. With these advantages, RFID is a good candidate for workpiece monitoring and localization in manufacturing workshops.
There are workshops, machines, workers, raw materials, workpieces, products, etc. in the physical world of wisdom manufacturing. These real physical things are called u-things if they are attached, embedded, or blended with computers, networks, and/or some other devices such as sensors, actuators, e-tags [12]. Through SEA-nets such as sensors net, embedded devices net and actuators net, manufacturing data such as the workshop environment data, machines state data, inventory data of raw materials and production data are transmitted to the web.
In the cyber world, the data level is involved with various data management and preprocessing technologies, including data collection, cleaning, integration and storage, etc. for completing the "things-data" conversion; data is converted into information through some methods such as metadata construction, data mining, event driven actions and the study of human information processing, The information level is involved with information extraction, information storage and information organization, etc. for completing the "data-information" conversion; Information is converted into knowledge through some methods such as space/user/thing modeling, model integration, knowledge retrieval and study of human knowledge expression. The knowledge level is involved with knowledge extraction and knowledge expression, etc. for completing the "information-knowledge" conversion; Knowledge is converted into wisdom through some methods such as autonomy-oriented computing, granular computing, complex network and study of human intelligence. The wisdom level is involved with cyber individuals, wisdom web and smart u-things, etc. for completing the "knowledge-wisdom" conversion; Wisdom is applied in various fields to provide active, transparent, security and reliable services. The service level is involved with services construction, services publishing and services integration for completing the "services-human" conversion.
In the social world, clients, social groups and enterprises implement effectively the implicit knowledge conversion and the integration of humans with the aid of social software (such as Blog, Tag, (Social Network Site) SNS and Wiki.). They use and enjoy a variety of products and services through the transparent service middleware and service platform, at the same time, and propose more personalized requirements for different products and services. These personalized requirements are converted into the product parameters to update the product gradually. Therefore, based on SCPS, the wisdom manufacturing model is formed.
In a wisdom manufacturing environment, the entire manufacturing workshop is covered by internet (such as LAN and WIFI). The sensing-aware environment of a wisdom manufacturing workshop is constructed based on cyber-physical systems, as shown in Figure 2. The manufacturing workshop contains dispatching center, raw material warehouse, (Automated Guided Vehicle) AGV, numerical control machines, workbenches, product warehouse, and so on. Directional (Ultra High Frequency) UHF RFID readers with LAN (WIFI) are installed on every workstation. Anti-metal ceramic RFID tags are pasted on every workpiece. The whole process from raw material to product is monitored. Each workstation is equipped with RFID sensing nodes, which sense ID numbers, time, location and other data of arrived workpieces in real time. Abnormal events can be monitored through data analysis in real time.
RFID applications in wisdom manufacturing are typically classified into two types [3]: (1) real-time-oriented monitoring applications; (2) history-oriented tracking applications. The fundamental characteristics of RFID data are temporal, dynamic, implicit semantic, inaccurate, integrated, flowing and large volume. Raw data provides no explicit semantic meaning for applications or business logics. It has to be transformed into semantic data properly represented with its own data models before it can be integrated into applications. Thus, RFID data model translates the physical world into its corresponding virtual (cyber) world. In this paper, passive tags are adopted, and RFID event processing models based on data mining are proposed to realize the monitoring of workpieces in wisdom manufacturing workshops. The remainder of this paper is organized as follows: Section 2 reviews the literature of product monitoring, data cleaning and data mining based on RFID in manufacturing, and states the problems to be solved. Section 3 gives RFID event models consisting of tag event, simple event, and complex event. Section 4 proposes RFID data cleaning and data mining methods. Section 5 shows simulation and physical experiments to test the system functions. Conclusions and suggestions for future work are given in Section 6.

Monitoring Based on RFID in Manufacturing
RFID technology is widely applied throughout the manufacturing lifecycle, especially in materials or product management. In materials management, for example, an approach was presented to bridge the gap between the physical flow of materials on the shop floor and manufacturing information using RFID technology in discrete manufacturing environment [13]. In hyper environments, RFID was used to track and trace processes and supplies in construction and assembly industries, using networks of sensors/actuators and virtual reality [14]. A RFID-enabled real-time manufacturing information tracking infrastructure to address the real-time manufacturing data capturing and manufacturing information processing for extended enterprises [15] and traditional manufacturing resources such as employees, machines and materials equipped with RFID devices (readers and tags) to build the real-time data capturing environment was proposed. Qu et al. [16] proposed a RFID-based real-time shop floor materials management system, applying RFID for managing materials distribution in a complex assembly shop floor at a large air conditioner manufacturer. In product management, for example, a RFID-based intelligent decision support system architecture was proposed to handle production monitoring in a distributed clothing manufacturing environment [17], where RFID and cloud technologies were integrated for real-time and remote products monitoring. A Work In Progress (WIP) management framework based on smart objects such as RFID devices and web service technologies was proposed in a ubiquitous manufacturing [18]. Huang et al. [19] proposed an affordable approach to shop floor performance improvement by using wireless manufacturing with emphasis on how to deploy RFID technology for managing WIP inventories in manufacturing job shops with typical functional layouts; a refrigerated fruit storage monitoring system combining RFID and WSN was presented in [20], aiming to estimate energy consumption in a cold room, water loss from the products and detect any condensation over the stored commodities.
RFID technology has been increasingly applied to production planning and scheduling. For example, Zhong et al. [21] proposed a RFID-enabled real-time advanced production planning and scheduling shell to coordinate different decision makers across production processes for enhancing information sharing and coordinating decisions and operations of different parties involved in production planning, scheduling, execution and control. Qu et al. [22] discussed the item-level RFID implementation in terms of both real-time information control mechanism and system development environment, aiming to use RFID systems to enable the real-time coordination and interaction between the production planning and execution levels to achieve the lean control of manufacturing processes in smart assembly workshop. Dai et al. [23] proposed a RFID-enabled real-time manufacturing execution system at a typical (Small and Medium-sized Enterprise) SME engine valve manufacturer with the extension in setting up and integrating manufacturing execution system and enterprise resource planning system.

RFID Data Cleaning and Mining in Manufacturing
RFID raw data is inherently unreliable due to physical device limitations and different kinds of environmental noise. Kawakita et al. [24] discovered that the bit errors significantly degraded Class-1 Generation-2 protocol (C1G2) performance due to erroneous communication links. Buettner et al. [25] thought that physical effects such as errors and multipath degraded the overall performance of commercial readers. Therefore, RFID data cleaning is essential in order to correct the reading errors, aiming to allow these data streams to be used to make correct interpretations and analysis of the physical world they are representing.
A lot of approaches to clean RFID data have been studied in recent years with a focus on either fixed size sliding windows or adaptive sliding windows. For fixed size sliding windows, Bai et al. [26] proposed two types of filtering: false positive readings are removed from RFID data, and duplicate readings are merged into one distinct reading. The static size of the window is the limitation of this approach because a large window induces false positive readings and a small window cannot fill false negative readings. For adaptive sliding windows, Jeffery et al. [27,28] proposed the Extensible receptor Stream Processing (ESP) and Statistical sMoothing for Unreliable RFid data (SMURF) cleaning methods. ESP segments receptor stream processing into a cascade of five programmable stages: Point-Smooth-Merge-Arbitrate-Virtualize, which captures the context of temporal and spatial application layers by introducing the concept of temporal and spatial granularity. SMURF uses a statistical sampling-based approach to determine the"right" window size automatically and continuously adapts it over the life time of the system based on observed readings. This window size carefully balances two opposing application requirements: ensuring completeness for the set of tag readings (due to reader unreliability) and capturing tag dynamics (due to tag movements in and out of the reader's detection field). Fan et al. [29] presented a behavior-based unreliable RFID data smoothing system to ensure a more complete access to get the movement behavior characteristics of tag. Massawe et al. [30] proposed an adaptive sliding window based approach called Window Sub-Range Transition Detection (WSTD), where a binomial sampling concept was used to calculate the appropriate window size and π-estimator to estimate the number of tags as proposed by SMURF. WSTD then used the comparison of the two window sub-range observations or estimated tag counts and some rules to detect when transition occurred within the window and then adjusted the window size appropriately. Li et al. [31] improved the SMURF algorithm by adding parameter p* and the reading rate to the reading cycle which was coming to the window. Zhao et al. [32] presented another confidence parameter η to decrease the false positive readings of original SMURF method based on the mathematical analysis. Most existing approaches for cleaning RFID data are rule-based inference algorithms with rather low accuracy. On the basis of above summary, a synthetic RFID data cleaning method based on SMURF is used to clean RFID tags in this paper.
The concepts and techniques of data mining were introduced to discover the invaluable new patterns from large number of data sets [33]. The volume of data generated by a RFID system is enormous due to redundancy and low level of abstraction, and the resulting main challenge then becomes how to handle and interpret the enormous volume of data in RFID applications [34]. In modern manufacturing, the volume of data grows at an unprecedented rate in the digital manufacturing environment. Such data may be related to design, products, machines, processes, materials, inventories, maintenance, planning and control, assembly, logistics, performance, etc. [35]. However, due to the "rich data but poor information" problem [36], data mining must be used on the collected manufacturing data, which contains valuable information and knowledge that could be integrated into the manufacturing system to improve decision making and enhance productivity [37].
As for RFID data mining, there exist many methods such as event model, Kriging method, and Procedure Tree. Of those methods, the event model is widely adopted. For example, an application framework for a real-time Complex Event Management System (CEMS) based on RFID device deployment was proposed in [38], which allowed users to obtain interested and meaningful information from large number of primitive events captured from the RFID devices in real time. An event-driven shop floor WIP management platform was created in Ubiquitous Manufacturing (UM) [39], aiming to monitor and control dynamic production and material handling through RFID-enabled traceability and visibility of shop floor manufacturing processes environment. A real-time Discrete Event (DE)-based monitoring system was developed for RFID-enabled shop floor monitoring in manufacturing [40], where the DE observer is designed to construct complex events from the simple events extracted from the raw RFID data. Huang et al. [41] studied abnormal event detection in the supply network, where the data captured from the (Electronic Product Code) EPC information service was used to calculate a path, and the machine learning method was adopted to cluster the path.
For the other RFID data mining methods, there also exist many examples that can be listed as follows: a schema-based RFID data storage model was presented to store and process RFID data efficiently in supply chain management systems [42], where a structure-based path splitting approach was proposed to intelligently and automatically split the movement paths of products. In tracking accuracy of the areas between the observed points, spatial and temporal analysis was applied to interpolate the continuous distribution of RFID tracking accuracy based on the Kriging method [43]. A holistic Big Data (BD) approach was proposed to extract frequent trajectory data from a massive collection of RFID-enabled shop floor logistics data [44], where enormous data could be collected and used for supporting further decision-makings such as logistics planning and scheduling; A method of configuring traditional manufacturing resources with RFID technology was proposed to capture and track real-time information during the manufacturing processes [45]. A data mining model was proposed to estimate the lead time from a real-life case [46], where the impact factors such as processing routine, batching strategy, scheduling rules and critical parameters were examined. A system architecture based on a data warehouse coupled with data mining functionalities was presented [47], which was capable of sending personalized offers to customers in the area of interest in real time. Masciari [48] introduced a Stream Monitoring enterprise Activities by RFID Tags (SMART) system based on an outlier template definition for detecting anomalies in RFID streams. Kwon et al. [49] proposed an advanced process management method, called "Procedure Tree" (PT), aiming to manage massive RFID data and perform real-time process management effectively. Kim et al. [50] suggested a method that applied RFID tag information and data mining technology to a manufacturing execution system (MES) for efficient process control in a TFT LCD production line.
From the above literature survey, we can see that abnormal condition monitoring of workpieces in manufacturing workshops is scarcely reported. As RFID applications in workpiece abnormal conditions are still in the starting stage, most research focuses on materials or product management.

Problem Statements
RFID technology has been widely used in manufacturing so far, and the application fields include product and process design, assembly, materials planning, quality control, scheduling, maintenance, etc.
Most of literature studies focus on supply chain, objects tracking and product management, etc., while few researchers concentrate on abnormal condition monitoring of workpieces based on RFID. On the basis of the above summary, this paper proposes an abnormal condition monitoring method based on RFID in wisdom manufacturing workshops. The machining workpieces are monitored during the whole production process in real time, and abnormal condition of workpieces is mined on each workstation. This provides the basis of proactive scheduling and increases production efficiency in wisdom manufacturing workshops.

Event
The term event refers to the fact that something is happening (such as a change in the state of the system). An event is a happening of interest. In database applications, the interest in events comes mostly from the state changes that are produced by data manipulation [51]. In a monitored environment deployed with sensors, flows of observation data can be seen as streams of observable events. An event takes place, which refers to its occurrence, while an event is recognized by the system, which refers to its detection [52]. Event streams are sequences of event objects, which arrive in accordance with the order of the events. RFID events can be categorized as tag events, simple events (atomic events, basic events) and complex events (composite events, aggregated events) according to the particle size.

Tag Event
A tag event occurs when a RFID reader reads a tag. In other words, a tag is detected by a reader at a certain interval, a volume of fragmentary and redundancy tag events will occur in a short period of time. A tag event is denoted as E t , and a tag event model is defined as: where w id is the Electronic Product Code (EPC) of a workpiece, r id is the Identification (ID) of a reader (the Internet Protocol (IP) address of a reader is bound with a workstation), and t is the time point of a tag event occurrence. There are a large number of unimportant and redundant events in collected tag events, which are filtered, accumulated, composited, reported and extracted into meaningful simple events.

Simple Event
A simple event is defined to occur at a certain time point or not occur at all. The simple event is used to directly represent the behavior of the system state. A simple event is denoted as E s , and a simple event model is defined as: where w id is the EPC of a workpiece, l is the location (workstation) of a workpiece when a simple event occurs, and t is the time point of a simple event occurrence. A simple event only reflects a single state of a workpiece at a time point, and simple events involved in each workstation are shown in Table 1.
AE is the arrived event, and LE is the left (departed) event. AE sagv1 denotes the arrived event that a raw material or a workpiece (EPC is w id ) arrives the workstation N agv1 at t time. LE srw denotes the left (departed) event that a raw material or a workpiece (EPC is w id ) leaves the workstation N rw at t time. Other events denote the similar meanings, and each workstation location is shown in Figure 2. Table 1. Simple events used in this paper.

Simple Event Description Events on All Workstations
Arrived Event: AE s " e pw id , l, tq A workpiece (EPC is w id ) arrives the workstation l at t time.

Complex Event
A complex event is defined to apply to an event operator to constitute events that are simple events or other complex events [51]. A complex event is denoted as E c , and the complex event model is defined as: where w id is the EPC of a workpiece, l is the location (workstation) of a workpiece when a complex event occurs, e s is the sub-event set constituting a complex event, t s is the start time of a complex event occurrence, and t e is the end time of a complex event occurrence. If t s is equal to t e , the complex event occurs at a certain time point. Complex event operators used in this paper are shown in [53]. Complex events involved in each workstation are shown in Table 2. SE is the stayed event, and DE is the disappeared event. SE cagv1 denotes the stayed event that a raw material or a workpiece (EPC is w id ) is located on the workstation N agv1 to stay or be machined from t s to t e . DE crw´agv1 denotes the disappeared event that a raw material or a workpiece (EPC is w id ) is located on the dead zone temporally between the workstations N rw and N agv1 from t s to t e . Other events denote similar meanings. Table 2. Complex events used in this paper.

Complex Event Description Events on All Workstations
Stayed (Machined) Event SE c " e pw id , l, e s , t s , t e q A workpiece (EPC is w id ) is located on the workstation l to stay or be machined from t s to t e .
Disappeared Event DE c " e`w id , l 1 , e s , t s , t e˘A workpiece (EPC is w id ) is located on the dead zone temporally between the workstations from t s to t e .

Complex Event Processing System
RFID data is real-time and complex in logic. The workpiece condition information is mined from RFID data by CEP technology. The implementation of RFID CEP system is shown in Figure 3.
Readers with a LAN (WIFI) interface are located at different workstations. These readers are connected to the internet through the Router/Hub/LAN (WIFI), and tag data is transmitted via the internet in real time. Tag data collection, processing and release are implemented on the Rifidi Edge Server [54], which is an open source software from Transcends LLC (Glastonbury, CT, USA). It is a rapid development and configuration platform of RFID application system. This platform consists of four conceptual layers: sensor abstraction layer, application engine layer, communication layer (integration layer), and operations, administration & management layer. Diverse readers such as Impinj, Thinkify, ThingMagic, Alien and (Applied Wireless IDentifications group) AWID, are all supported by this platform, which contains (Application Level Events) ALE middleware and the Esper [53] complex event processing engine. A Derby database is embedded into this platform, which uses (Message Queue Telemetry Transport) MQTT information protocol and the Restlet plug-in to realize information transfer and operation management. The tag data preprocessing is based on Application Level Events (ALE), and the ALE middleware is an international standard released by the EPC Global Organization for Standardization of EPC Processing Systems (such as reader.) and the interacting client. In terms of the RFID system, interactive activities include reading tags and writing tags. For reading tags, ALE collects RFID data and aggregates them at the same time interval. Reduplicative data is eliminated. Then, data is combined to reduce the amount of data. Finally, event reports are sent in different forms, and a simple event containing the intuitive information is formed.
Simple events are created (stated) and become semantic events, historical events in data warehouse are inserted, and these events are aggregated into complex events with the event operators. Complex events are processed by the Esper engine, founded by Bernhardt [55]. Esper is an open source complex event processing application platform, which contains a high performance event correlation (analysis) engine, and uses Event Processing Language (EPL) to define the client rules. The EPL syntax is found in [53]. Events are processed through Event Patterns and the Event Stream Queries (ESQ) methods, monitoring the occurrence of events and pushing the results to the subscribers.

RFID Data Cleaning
In a monitoring system based on RFID, readers communicate with tags by radio waves, and the system is quite vulnerable to environmental impacts. With the growing numbers of readers and tags, the interference will become particularly serious. These typical undesired scenarios caused by radio frequency interference include three aspects: false negative readings, false positive readings and duplicate readings [26].
False negative readings refer to that tags are in the vicinity of a reader but not detected by it. This can be due to two causes: (1) when multiple tags are to be simultaneously detected due to the interference of radio frequency collisions and signals, preventing the reader from identifying any tag; (2) a tag is not detected due to water or metal shielding or radiofrequency interference. False positive readings refer to that a tag is not present but captured. Besides RFID tags to be read, additional unexpected readings are generated. This can be caused by RFID tags outside the normal reading scope of a reader are captured by the reader. Duplicate readings refer to when tags are in the range of a reader for a long time and are read multiple times by the reader. It also occurs due to the tags in overlapping areas read by multiple readers. Data cleaning is key to abnormal condition monitoring using RFID data. The better data cleaning performs, the more accurate the abnormal detection results are.

SMURF Method
SMURF is a method that dynamically adjusts the window size according to the average reading rate of the window based on a sliding window processor and binomial sampling theory. If the reading rate of a tag is lower, it sets a large window size to reduce false negative readings. On the other hand, if a tag reading rate is high, it sets a small window size to reduce false positive readings.
The sliding window theory is illustrated in Figure 4. The window size is four epochs. Tag A1 enters the window at t + 4, which is thought as a new tag data. Tag A2 and A3 enter the window separately at t + 5 and t + 7. Meanwhile, Tag A1 remains in this window. Tag A1 leaves the sliding window at t + 8, and it is thought as an old tag data to be removed from the window.
The average read rate over all observation epochs is calculated from Equation (5): where S i is the number of tag i sampled epochs in the sliding window.
At first, the problem of setting SMURF's window size w i is considered to guarantee completeness with Equation (6): where w i is the number of epochs within the sliding window, δ is the required completeness confidence. Equation (7) is a control condition to transit current size of sliding window and it can guarantee tag dynamics:ˇˇˇ|

Synthetic Method Based on SMURF
Li et al. [31] add a parameter p*, which is the reading rate of reading cycle about entering to the window, to determine whether to change the window size to the satisfaction of Equation (8): ω ăˇˇˇˇˆř n n"1 p i`pn`1˙´p˚ˇ" p n (8) where ω is the required probability threshold. Zhao et al. [32] think that p avg i is calculated simply by a mean method, but the mean value cannot measure how far a set of numbers is spread out or describe how far the numbers lie from the mean value. Variance var w is adopted to describe how the numbers of a data set change from Equation (9): A required tag dynamics confidence parameter η is adopted while p avg i is calculated, and var w must satisfy Equation (10): A pseudo-code description of synthetic per-tag data cleaning algorithm is depicted in Algorithm 1. This method dynamically adjusts its window size for each tag, based on the guidance from its binomial-sampling model as discussed above with parameter δ, ω and η.

Real-Time-Oriented Workpiece Monitoring Based on RFID Data Mining
RFID data is sequence data, streaming data and spatial-temporal data [33], which inflows into and outflows from a processing system at different update rates, and reflects the spatial-temporal characteristic of objects. The raw data provides no explicit semantic meaning, and has to be transformed into semantic data through an event model. Semantic data is further aggregated in different logic rules into semantic information indicating abnormal events. For this purpose, in this paper the complex event processing (streaming data processing) method is applied in RFID data mining to monitor workpiece abnormal conditions in manufacturing workshops. RFID data mining can be divided into real-time-oriented workpiece monitoring and history-oriented workpiece tracking. The former will be discussed in the following section.
In the manufacturing workshops, the IP address of a RFID reader is bound with a workstation (node), and the tag EPC is bound with a workpiece. The corresponding relationships of reader IPs, workstations and trigger events are shown in Table 3. The spatial-temporal and real-time RFID data is mined to monitor abnormal conditions of workpieces in real time, such as lack of raw materials, stayed (machined) time anomaly, workbench blocking and no product inventory. Estimating and detecting these abnormal conditions can make a preliminary decision according to the stayed (machined) time of a workpiece on every workstation, or whether a reader detects data. The results are shown in a state matrix, which provides a basis for further analysis and proactive scheduling. For workstation N rw equipped with a RFID reader in a raw materials warehouse, if data is not read for a long time, or event LE srw does not occur, an abnormal lack of raw materials condition occurs; For workstation N pw in a product warehouse, if data is not read for a long time, or event AE spw does not occur, an abnormal no product inventory condition occurs. Time threshold t rw´th and t pw´th are set, and the occurrence of event LE srw or AE spw in time threshold t rw´th or t pw´th is queried. For example, in a raw materials warehouse, the anomaly of raw materials lack is monitored by the following statement: Select * from pattern [every LE srw ->timer:interval (t rw´th ) and not LE srw ]; (2) Stayed (Machined) Time Anomaly For AGV workstations N agv1 and N agv2 , machine workstations N ncm1 , N ncm2 and N ncm3 , assuming that the processing time is equal to the staying time on every workstation. The time threshold range is set with the lower threshold t low´th , and the higher threshold t high´th . Time attribute of stayed event SE cagv1 , SE cncm1 , SE cncm2 , SE cncm3 or SE cagv2 is queried to judge whether the time attribute is within the scope of the threshold or not. If the threshold is exceeded, a stayed (machined) time anomaly occurs. For example, stayed (machined) event SE cncm1 is made up by simple events AE sncm1 and LE sncm1 , the stayed (machined) time anomaly on workstation N ncm1 is monitored by the following statement: (3) Workbench Blocking The workbench is used to cache raw materials or products in workshops. If the cache time of raw materials or products is very long, the workbench will be blocked. For workbench workstation N wt1 and N wt2 , time thresholds of caching raw materials and products are set by t wt1-th and t wt2-th . Time attribute of stayed event SE cwt1 or SE cwt2 is queried to judge the time attribute within the scope of the threshold or not. If the threshold is exceeded, an abnormal workbench blocking condition occurs. For example, stayed event SE cwt1 is made up of simple events AE swt1 and LE swt1 , the anomaly of workbench blocking on workstation N wt1 is monitored by the following statement: Select AE swt1 tag from pattern [every AE swt1 = AE->timer:interval (t wt1-th ) and not LE swt1 (tag.tag.ID= AE swt1 .tag.tag.ID)]; Abnormal conditions of workpieces are monitored in real time through RFID data mining, which results in a real-time state matrix: S "`a ij˘p 1 ď i ď m, 1 ď j ď 9q, as shown in Equation (11), where i denotes a workpiece serial number, and j denotes a workstation serial number: a 12 a 13 a 14 a 15 a 16 a 17 a 18 a 19  a 21 a 22 a 23 a 24 a 25 a 26 a 27 a 28 a 29  a 31 a 32 a 33 a 34 a 35 a 36 a 37 a 38 If a ij is equal to 1, the processed condition of the workstation is normal, whereas, If a ij is equal to 0, the processed condition of the workstation is abnormal. At the same time, all kinds of events are stored in the data warehouse as historical data for querying.

Experimental Results and Discussion
In this section, synthetic data cleaning and data mining techniques are evaluated experimentally.
Three key points are illustrated: (1) the synthetic per-tag data cleaning algorithm is evaluated under the aid of MATLAB and a physical reader; (2) the simulation experiment of abnormal condition monitoring is tested by the Rifidi Edge Server; (3) abnormal condition monitoring is evaluated by physical experiments.

Synthetic Data Cleaning Experiment
In order to run experiments across a wide variety of scenarios, a physical reader and fifteen tags are set up to generate experimental data. The synthetic data cleaning algorithm is programmed in MATLAB. Two tag movement behaviors are investigated. The first is that a tag is static, which simulates how to place a tag suitably within the reader detection region, and the tag is monitored in a lower average errors per epoch. The second is that a tag is moved at a random initial velocity, which simulates dynamic environments such as tagged items on an AGV or conveyor belt, and the tag is monitored in a lower average errors per epoch at an appropriate velocity. The reader detection model is built based on the RFID tag-reader detection regions. Generally there are three distinct regions of operations of a passive RFID reader tag system: major detection region, minor detection region and outside of detection region [28]. The major detection region corresponds to roughly 75% of the full detection region, but it makes only 25% of the range in the noisy environment, as illustrated in Figure 5. In the major detection region, the probability of detection maintains the max value (MaxReadRate). The tag read rate then degrades gradually with increasing distance to the minor detection region. In the outside of detection region, the read rate goes down to 0%. The main difference on this detection pattern when the tags are operated in different environments lies in the percentage of the reader's detection range corresponding to its major detection region. The experimental parameters are summarized in Table 4. pFalsePositiveReadings i`F alseNegativeReadings i q {NumEpochs. Based on Figure 5, a simplified reader detection model presented in [30] is adopted in Equation (12): Varying the MajorPercentage parameter simulates the reliability factors that affect the tag detection rates such as tag orientation and the radio frequency interference, while varying the distance (x) parameter simulates the tag-reader signal attenuation with distance. The MajorPercentage is varied between 0 and 100%. A lower value of MajorPercentage corresponds to a more unreliable environment and higher value of MajorPercentage corresponds to a more controlled environment.
At first, the average errors per epoch is tested on the conditions of different levels of reader unreliability. For the static tag tests, the tag is static, but the MajorPercentage is varied. The results from data collected at every 1 cm within the range from 0 to 20 cm (the reader's detection range is approximately 20 cm) are averaged. The repetitions of every data collection point are 20 times. The average errors per epoch is measured at each value for MajorPercentage between 0 and 1. Figure 6 shows the results of this experiment.
As can be seen from Figure 6, the synthetic data cleaning method results in lower errors than SMURF on the whole. The raw data straight line is truncated due to poor performance. As MajorPercentage increases, the accuracy of the two methods improves due to more reliable raw data. Especially, when the MajorPercentage is more than 0.6, the synthetic method works well. This region is adopted to monitor tagged workpieces in this paper. The difference of the synthetic method and SMURF method is evaluated by independent samples t-test [56]. The variance for the synthetic is 0.7162, and that for SMURF is 0.6176. The former is slightly bigger than the latter in static environment. The p-value of Levene's test for equality of variances is 0.695 (Sig. = 0.695) assuming the variances of two methods are equal (p > 0.05). The p-value of t-test for equality of means is 0.385 (Sig. (2-tailed) = 0.385), and thus there is not a significant difference in the two data cleaning methods (p > 0.05).  Figure 7 shows the results of this experiment.
In Figure 7, the synthetic data cleaning method performs better than SMURF. The average errors of raw data have little change as tag velocity varies. When the tag velocity is less than 0.01 cm/epoch, the two methods perform similarly. As tag velocity increases, the average errors of the two methods increase, but the synthetic data cleaning method shows lower average errors than SMURF. The difference of synthetic method and SMURF method is evaluated by an independent samples t-test.
The variance for the synthetic approach is 0.1274, and that for SMURF is 0.7867. The former is smaller than the latter in a dynamic environment. The p-value of Levene's test for equality of variances is 0.035 (Sig. = 0.035) assuming the variances of two methods are unequal (p < 0.05). The p-value of t-test for equality of means is 0.04 (Sig. (2-tailed) = 0.04), and thus there is a significant difference in the two data cleaning methods (p < 0.05). In the above comparison results, the synthetic data cleaning method performs better than SMURF in two tag movement behaviors. In particular, there is a significant difference between the two cleaning methods in a dynamic environment. The key factor is whether the window size is calculated and adjusted precisely. The mechanism of adjusting the window size is different in the two methods. The SMURF approach adjusts the window size only based on the average reading rate of the window (p avg i ) in Equations (6) and (7). For non-uniform RFID data stream, the SMURF performs poorer. However, the synthetic method considers the average reading rate (p avg i ), the reading rate of reading cycle about entering to the window (p*) and Variance (var w ) in Algorithm 1. Before calculating the window size, the condition (ω < p n^v ar w ď η) must be satisfied. The parameter η is a required tag dynamics confidence in dynamic environment. The window size is calculated and adjusted precisely, the synthetic data cleaning method adopted in this paper shows much lower average errors in dynamic environment.

Construction of Simulation Experiment Environment
A RFID complex event processing simulation environment is constructed by Eclipse and its plug-ins such as Rifidi SDK3.2 and Esper5.2 in a Windows 7 (32 bit) operating system environment. The virtual manufacturing system under the simulation environment is built according to the real environment layout of the wisdom manufacturing workshop in Figure 2. There are 10 workpieces, and the reader Alien is used and supported by the Rifidi Edge Server. The workpiece EPCs, reader IPs (the reader IP is replaced by a port number under a single PC simulation environment) and attribute threshold values are shown in Table 5. In this simulation experiment, it is assumed that the workpiece (w id = 355401990A44526D30609CE2) is moved from the raw materials warehouse, and afterwards, no other raw material is moved; The workpiece (w id = 355401990A44526D30609CE2) is transmitted into the product warehouse, and afterwards, no other product is transmitted; The workpiece (w id = 35B2B5A08B3F39347F4A8FA7) is processed on workstation N ncm1 for very short time (less than t low´th ); The workpiece (w id = 35ECDF34F4D15171B87B71AF) stayed on workstation N wt1 for a long time (more than t wt1´th ). For example, abnormal condition monitoring of raw material lack is depicted in Algorithm 2. The simulation result is shown in Figure 8.

Construction of Physical Experiment Environment
In order to test the effectiveness of the proposed method, a physical experimental system for workpiece monitoring in real time is established and the experiments are carried out on the test rig. The architecture of the physical experiment system is shown in Figure 9. A mini-type CNC lathe is thought as the workstation N ncm1 , a mini-type CNC milling machine is thought as the workstation N ncm2 A computer control system is used to control two CNC machines. The metal workpiece 1 and workpiece 2 with anti-metal ceramic tags are machined separately on workstation N ncm1 and N ncm2 Readers are placed on one side of every workstation to monitor the arrived and left (departed) time in real time. The real-time monitoring data is sent to the upper computer to process by the internet with routers. The experimental parameters are summarized in Table 6. In the whole workpiece processing task, the tag is pasted on the non-machining surface of a workpiece, and the reader on every workstation monitors the arrived and left time of machined workpieces in real time. The upper computer collects the real-time data to clean and process these data with the CEP method. The machined time is judged whether anomalies occur or not. There are two workstations in the physical experiment system, while there are nine in the simulation experiment.
In the physical experiment, it is assumed that workpiece 1 (w id = 300833B2DDD9014000000001) is processed on workstation N ncm1 for less than 20 s; workpiece 2 (w id =300833B2DDD9014000000002) is processed on workstation N ncm2 for more than 25 s. The physical experiment result is shown in Figure 10. The abnormal condition of workpiece 1 on workstation N ncm1 are shown in Figure 10a. The machined time was calculated based on the arrived time and left (departed) time, which was 8 s. The machined time was less than the threshold t low´th (20 s). As such, a machined time anomaly occurred, and a 14 element in status matrix was 0. It was expressed that an abnormal condition of workpiece 1 occurred on workstation N ncm1 . In Figure 10b, the machined time (32 s) was more than the threshold t high´th (25 s). Element a 25 in status matrix was 0, which expressed that an abnormal condition of workpiece 2 occurred on workstation N ncm2 .

Conclusions and Future Work
In this study, a RFID-based method of abnormal condition real-time monitoring of workpieces in wisdom manufacturing workshops is presented. RFID is used to detect the spatial-temporal information of workpieces at every workstation. Synthetic data cleaning and data mining based on CEP are applied to process RFID data in real time. The synthetic data cleaning method works better than SMURF in guaranteeing tag completeness and dynamics. Such real-time condition monitoring of workpieces provides a basis for proactive job shop scheduling in wisdom manufacturing.
However, this study only focuses on three abnormal conditions for real-time monitoring of workpieces in the wisdom manufacturing workshops. In the future work, more abnormal conditions such as urgent workpiece arrival, incorrect workpiece quantities and misplaced parts will be monitored by searching, aggregating and matching the EPCs of the workpieces, and the abnormal results being sent to the web. At the same time, we also plan to study the Prognostics and Health Management (PHM) of processing equipment in manufacturing workshops. For example, tools can be monitored and diagnosed with different sensors such as cutting force, vibration and acoustic emission, and deep learning is adopted to complete the tool condition monitoring and prognostics.