Mutton Traceability Method Based on Internet of Things

In order to improve the mutton traceability efficiency for Internet of Things and solve the problem of data transmission, analyzed existing tracking algorithm, proposed the food traceability application model, Petri network model of food traceability and food traceability of time series data of improved K-means algorithm based on the Internet of things. The food traceability application model to convert, integrate and mine the heterogeneous information, implementation of the food safety traceability information management, Petri network model for food traceability in the process of the state transition were analyzed and simulated and provides a theoretical basis to study the behavior described in the food traceability system and structural design. The experiments on simulation data show that the proposed traceability method based on Internet ofThings is more effective for mutton traceability data than the traditional K-means methods.


Introduction
With the economic growth at full speed, people's living standards are generally improved, food consumption of rural residents gradually into a well-off from food and clothing, food consumption of urban residents will also benefit from a well-off steering wealthy.There will be a lot of changes for food supply and demand; it will be synchronous growth of the single pursuit food quantity and the food quality, the government's attention, and regulation of food from just focusing on food safety and quality concerns safety [1].
It will be development refined social division, specialization and globalization of food trade and production methods, and are increasingly complex of food supply chain [2].Food from the raw material production to final consumption of intermediate links becomes more and more involved in making food safety production, processing, storage, transportation, and sale of the entire food supply chain [3].On the one hand, it increased from production to consumption of food intermediate links may be causing increase the probability of food safety problems; on the other hand, the supplier pursuit of profit and increasing the food supply chain may be causing food safety problem [4,5].
At present, the food safety control methods in food processing only in the theoretical stage and lacking entire food supply chain safety control methods, but the traditional method is to use food inspection and food control key link in the supply chain and other means, due to poor management, operational errors and manual errors, often leading to inefficiencies and higher error rates.This requires creating a comprehensive system of food information traceability in the supply and ensuring food "from the source to table" all aspects of the information can be held liable retroactively and corresponding of the offender [6][7][8].
With the development of wireless radio frequency identification technology, it has become more sophisticated, gradually becoming various industries in Internet of Things (IoT).IoT refers to all the items through the radio frequency identification and other information sensing device connected to the Internet, to realize intelligent identification and management.Since 2000, the United States, European Union, Japan, and South Korea as the representative of developed countries invest a lot of manpower, material things related to technology research and infrastructure, digital residential, health care, environmental monitoring, food safety and other areas try to deploy IoT applications [9,10].In China, IoT related research attention has also been proposed to lead the international standards as the core infrastructure, the core technology research and development is related to platform construction, the research and development road demonstration of IoT applications simultaneously, IoT will become survival of intelligent environments.From the point of view of whole industry chain, social and economic, IoT is not only a sensor network, but also the need of various sectors involved in the application.Therefore, how to build demonstration application features and networking with industry characteristics is critical to the success of the promotion of networking applications.
Food safety traceability plays an irreplaceable role in people's health and social stability and development [11].It is an important measure of food safety risk management and an effective technology to control the whole supply chain.If there is a problem of food safety production that can be traced back to the source, find the problem and effective governance [12].The animal food safety traceability system not only includes the animal from birth to enter the slaughterhouse feeding process (feeding and management, disease prevention, treatment, and veterinary feed) recording and monitoring, but also includes animal products into the consumer market (supermarket), consumers can through every animal unique identification code to query the animal products breeding, slaughtering, processing and circulation process.Figure 1 shows the animal food from the producer to the aspects of consumer, and animal food from traced back the reciprocal process.
To sum up, in this paper, applied the traceability management network technology to the mutton food and collection information based on IoT, transmission and processing of each link to achieve mutton food industry chain, in order to create traceability and price analysis data base, the information traceability issues in-depth mutton products is studied.

Mutton Supply Chain Business Model Based on Petri Network
It is a must to carry on modeling analysis of the mutton supply chain business process in the traceability system design and development.In order to ensure the rationality of the business process, the consistency of logistics, and information flow in the business process [13], there are many modeling methods for business process that can be used, like Petri net as a kind of modeling method based on the strict mathematics definition, and various operating characteristics can be convenient analysis system, which can not only describe the internal system of logistics, but also describe the system of internal flow of information [14,15].Compared with other modeling approaches, Petri net has strict mathematical definitions, usable graphical representation, and the advantages of being intuitive and easy to understand and use.Specifically, it has the following advantages.
(1) An intuitive graphical representation.Petri net is a graphical language that can describe the basic elements of the process model with distributed, concurrent, and asynchronous features.
(2) Ability to express the semantics and rich formalized analysis.A Petri net model with the corresponding semantic description of a business process can also display the status and activities described in the process model.
(3) Extensive analysis techniques.Petri nets have strong analytical techniques and tools that can be used to analyze various characteristics of the model, such as peer-bounded and activity analysis calculations.
In short, it has strict mathematical definition, system analysis and verification methods provider of Petri nets, and an important analytical tool for some uncertainty, concurrency and resource sharing system.The complexity of business processes is mainly manifested in the uncertainty and concurrency and resource sharing problem of many factors, and the Petri net modeling method can well solve the problem.It can describe business processes between the upper and lower reaches of enterprise cooperation by Petri network and can better describe the logistics and information flow in parallel operation.Therefore, it can be used in the business activities, business processes, and their relationship modeling by Petri nets to verification and analysis of the logistics system.

Traceability Business Model Based on Petri
Network.Petri network is used to describe discrete, distributed systems mathematical modeling tools.With the development of Petri network, in order to enhance the ability of Petri net description of the system, there were many Petri modeling methods extended to Petri nets, such as Predicate Transition Net (PTN) [16], Colored Petri Net (CPN) [17], and Object-Oriented Petri Net (OPN) [18], as well as other senior Petri nets.
In the early stage, the main application field of Petri nets is in communication.In recent years, with the development of the theory of Petri nets, and its increasingly wide range of applications, such as areas of performance evaluation, communication protocols, and production systems [19], it has become asynchronous, concurrent, distributed, strong work in parallel and nondeterministic information systems of Petri nets [20].
Petri nets as a graphical and mathematical modeling tool have four basic elements that are place, transition, arc, and token.A Petri net model is formed by the four basic elements, a Petri net model is formed by the four basic elements.In addition, there are common elements in the condition and event of Petri nets model.If a library has only two states and there is no token, it is called event that the library is said to conditions involving changes condition.
Define the triple  = (, ; ) which is necessary and sufficient condition of Petri nets; it is given by: (1)  ∩ Τ = ; (2)  ∪  ̸ = ; (3)  ⊆ ( × ) ∪ ( × ); is the set of libraries of ;  is the set of transitions ;  is a collection of  ordered pair elements; and a -element has flow relation: is set to  contained in the first element and the second element-ordered pair consisting; is called  elements set.
The reference pattern of Petri nets is expressed as a library with a round, or a rectangular, or a short line which indicates that changes by directed arcs represent ordered pair and token represented by solid dots.Figure 2 is a graphical representation of Petri nets.
For different business processes that the task execution order is different, so it has relations sequence, parallel, selection and circulation between tasks.Petri nets can be divided behavioral characteristics and structural properties, it includes reachability, boundedness, liveness, and conservativeness.
There are a lot of Petri net analysis methods; it not only has the static structure analysis but also has the analysis of dynamic behavior, such as reachability graph and coverability tree, that is, incidence matrix, invariant, linguistic analysis, computer simulation analysis, and structure analysis; these methods have the strict mathematical foundation, and each one has its good points, in actual analysis comprehensive use.

Modeling Business Process
Based on Petri Network.Petri nets can be simply attributed to two basic concepts: events and conditions.The event is the system in action; event is determined by the system state control.System status may be described as a set of conditions; the predicate condition is a logical description of the system state or condition may also be true to false.Because the event is an action, it can happen; in order to make the event happen, certain conditions must be established in such a condition known as preconditions of the event.Events may damage the precondition and the other conditions are established; the condition is called postcondition events.
Based on the basic Petri nets theory and according to the characteristics of the business process for the mutton supply chain, definition the expansion five tipples is given by: where  is the library collection, representing the flow conditions;  is a transition set, representing the flow of events;  is the flow of the relationship between  and ;  is the weight, when the arc is not marked weights, its default value is given by 1;  0 is the initial marking, which means that is in the initial conditions, the each library token was been distribution.
Mutton The mutton supply chain business process algorithm based on Petri nets modeling is given by: (1) It is represented by a directed arc between tasks for library or process changes.
(2) There is only a starting place to run in the process beginning and has a termination end structure of the process end.
(3) The control structure is adopted the structure link together between starts and end by using the control structure routing.In addition, the beginning and end structure can also enter another control structure and can be linked together.
(4) Changes in the structure can be replaced by the control.A change in the input is replaced by the input library and library control structure of the merger and its output database output library and control structure of the merger.
Using Petri net advantage to the mutton supply chain business process modeling is the behavior of flow by using the analysis method of Petri net analysis.On one hand, the model can reflect the flow characteristics and, on the other hand, can find out potential problems process and ensure the process rationality.
Many systems or components can be considered at a time that is only a limited set of states in a "here we use word" and the system related to the history record [21].A finite automaton is an abstract model with the original memory capacity of the machine.A great advantage of using finite automata is its support for formal verification.In food traceability business, completeness and correctness are crucial issues.As a formal model, finite automata model can support the completeness and correctness of the business logic analysis.q 0 q 1 q q 7 q 5 q 6 q 4 q 2 q 3 Where set  = { 0 ,  1 ,  2 ,  3 ,  4 ,  5 ,  6 ,  7 , },  = {0, 1},  = {},  is composed of the following state transition equation: Figure 3 shows the state transition diagram ∑, where  represents the final state,  0 represents the initial state,  1 represents authentication, for receiving user service requests,  2 represents the basic food traceability information query request, such as the production date, food origin, source, and food production and processing information,  3 represents food processing enterprises query information,  4 is inquiries planting and cultivation of state food,  5 is breeding conditions survey,  6 is fertilizer and feed information inquiries, and  7 is related inquiries about disease prevention information.
In Figure 3, triggering state transitions movement 0 indicates the operation failed; 1 indicates the success of the operation.Finite state machine mutton traceability system in the state basically can be expressed as a state transition graph directed graph method.The vertices of the graph represent the state of the system, with a small circle to describe.The side with an arrow indicates the status of the migration from the starting point.The state transition diagram notation is usually adopted if it is not in the specified context, the initial state using a pointing arrow indicating the status of the short tail and not pointing to any system.
The business processes and conditions are described below.s 0 : begin; s The business process flow of events is as shown in Table 1.
As the above described process that the position is defined as Petri nets condition, event transfer methods, input transfer events corresponding pre-conditions, output transfer events corresponding post-condition; that is, ignition transfer incident position token condition is true.Based on the above ideas, mutton supply chain business process Petri net model is shown in Figure 4.

Analysis of Functional Clustering
Mutton Origin Time Series Data

Analysis of Time Series Data Function Cluster of Food.
With the gradual refinement of the social division of labor, specialization of food production, food supply chains become increasingly complex [22].With the refinement of the social division of labor that caused specialization production and supply chains become increasingly complex of food [22].The intermediate link food from raw material production to final consumption becomes more and more complex, the food safety relates to the production, processing, storage, transportation and sales throughout the food supply chain Figure 4: The Petri net model of supply chain business process of mutton.[23].It is Increased food intermediate links from production to consumption, to achieve the goal of the security problem analysis traced is to increase the probability of food safety issues.But because of the complexity of food data timeliness, the food traceability applications can only finish to food and raw material related to the collection of data, as well as some intuitive simple retrospective application.For example, a market mutton sold or heavy metals found in microbial contamination exceeding the traditional traceability system can be traced from the piece of meat, but it does not explain microbial contamination or excessive heavy metals and cannot make in-depth analysis of emerging issues and decision-making departments.It will be change over time that the mutton slaughter, transportation, sales process, water quality, feed ingredients and the surrounding environment growth process for several months, so the traditional system cannot effectively discrete data mining.
To analyse the basic methods and ideas by using the functional data through the networking mutton supply chain traceability system based on a large amount of first-hand data extraction, create the timing chain clustering data of the mutton generality framework.By mining the mutton breeding, slaughtering, circulation, and consumption quality data, it can be effective in-depth statistics, analysis, and regulatory tracking; create a data center to regulatory corresponding results of the final release through a unified platform based on web technology.
As a result the quality of morphological change over time is due to the sale of food production and processing is a dynamic process; most of the data is timing data type in the data center, such as the bacterial index chilled mutton slaughter plant environment index, temperature, and location data transport vehicles.The total number of colonies contains each market and the contact surface of the sales data and the like, and the characterized in that the attribute value is reflects the time order.The traditional methods mostly focused on the study of longitudinal data, but there are insufficient sample size and the estimated always difficult to measure the problem.In this paper, we introduced data function characteristics of the food chain, and the perspective of data methods is analyzed.First we analysis functional data, from the literature [24], and [25] give a description of a system, then that is literature [26] functional data.

Time Series Data Function Cluster Process
3.2.1.Parametric Curve.The multiple time series data can have some more direct processing approach, but it may lead to timing index set changed, causing it to become difficult for practical application.but it will cause a great amount of computation that makes it difficult to get the final calculation result.So it is necessary to maintain the functional structure for the time series data by analysis and processing of sampled functional data.In order to maintain such configuration, usually using a linear or nonlinear curve fitting model and classified on the model coefficients.But the limitations of the linear model make it unable to fit some basic phenomena, nonlinear model and too little, so choice a relevant model is more trouble.Through using the spline basis fitting function data and then using the K-means to cluster the colony data, -spline function is convenient in polynomial computation can also adapt to the specific application environment.
Suppose that { 1 , . . .,   } is a discrete set of independent data function curve.Firstly, it can fit the observed data by using the regression spline function.
Given  nodes (knots), distributed in [, ] interval, meet the conditions: The spline function () is an arbitrary interval on interval and is a polynomial of degree d and has a  − 1 continuous derivative on the interval [, ].For a fixed node sequence, spline set of linear space is a function of  =  +  + 1.A sequence commonly used is the -splines linear space.It is given a spline expressed by where  = ( 1 , . . .,   ) is the vector of the spline coefficients.
A cubic -spline basis can give a smooth curve; -spline basis is well suited as a single-variable regression-based function.
For fixed nodes, the smallest quadratic spline element is equivalent to a linear problem, once the -spline basis; it is not difficult to find the polynomial regression.
where   is the center of   , the first step in the algorithm; each   is assigned to the nearest cluster center.In this way, each data center will have access to a subset of the knife as its base.If the mean value   with the replacement cluster, the mean value of the point   may be reduced further when it can be reassigned to a number of new  center.
Clustering process is described as follows.
Step 1. Input the number of clusters , with  sample points databases .
Step 2. The related information function (, ) is recorded for each cluster, where  is the number of data points in each cluster;  is the average of each cluster data point that is Kmeans clustering algorithm initial heart values.
Step 3. It record the  number of each cluster and can be restricted by the  time DBSCAN algorithm terminates, the  is also determined by the number of clusters -means clustering algorithm.
Step 4. Output  clustering center is .
Step 5. Selected  arbitrarily sample points as the initial cluster centers.
Step 6.Every other sample point data set is to calculate the distance in the cluster center and then assign them to the appropriate class based on the nearest principle.
Step 7. Calculate the new cluster center: innovation average for each sample point in the formation of a class.
Step 8. Repeat process Step 5 and Step 6, until the distances between the classes and   are no longer changed.

K-Means Consistency.
Check the following progressive characteristics  average.Let V interval [, ] on a positive measure,  2 is a function f Hilbert space, it is given by Let (  )  be an independent and identically distributed random sequence of functions, mapping from the probability space (Ω, , ) to (

Experiments and Results
To verify the effectiveness of the presented method, select 60 days, December 1, 2013, to February 1, 2014, with a mutton supply chain process of continuous monitoring data for each contact surface and popliteal surface microbial contamination condition data.Analysis of microbial pollution factors through the monitoring of microbial contamination in the slaughter, transportation, sales and other meat supply chain link, the total number of bacteria per unit area to measure microbial pollution indicators, with the change of time, the influence of humidity temperature on the surface and the contact surface of the mutton in the total number is bacteria changing.There were 20 contact surface colony counts in the time series data, including tools, workers' hands, slaughter workshop air, cooling air, slaughtering water, tray, refrigerator car air, partition table, packaging materials, packaging workshop air.First, we use of -spline basis function vector of curve smoothing knife; a set of internal nodes must be properly selected according to the colony data.If all sample intervals have equal priority, then the node is equal to the more appropriate distance, usually only the part range is more important, so the internal nodes must be spread out along these intervals, where select cubic B-spline and seven nodes mutton chain based on the data collected and the specific aspects, based on the data collected and the specific aspects of a mutton chain situation that select cubic -spline and seven nodes  = (3.0,3.2, 4.3, 4.7, 5.2, 5.6, 6.3, 7.2) gcfu/cm 2 .
In the 3000 data objects, randomly select 300 samples' data to constitute a data set and density-based clustering; the simulation results are shown in Figure 5.
Then use the S-Plus of K-means function divided the B vector into three groups and the three initial cluster center, it can get high quality clustering results by using the Kmeans algorithm for the entire data sets clustering; the corresponding block is shown in Figure 6.Such data are also colonies of each contact surface is divided into three categories, and can be seen from the graph of each sub-colony clustering results are basically similar level of contact surface changes came together, clustering results nicely captures the total number of colonies in the form of on similarity, which can provide the basis for further analysis and decision-makers.

Conclusions
In this paper, we study the application of the model mutton traceability system.Firstly, from the point of view of information management and technology for the food traceability system involves information collection, transmission, integration, processing, regulatory and other aspects of the problem,and then explore the application architecture, standards and key technologies traceability system; Secondly, to simulate the traceability process, finite automata theory and finite automata model traceability system; Finally, analysis a function of cluster using the complex timing and strong traceability data, the complex discrete data clustering continuous classified information, making traceability data availability greatly enhanced.

Figure 3 :
Figure 3: The state transition diagram of ∑.

Table 1 :
The flow of events.
1 : breeding base of the sheep; s 2 : processing factory of sheep; s 3 : detection qualified sheep; s 4 : detect unqualified sheep; s 5 : temporary rearing of sheep; s 6 : emergency treatment after the sheep; s 7 : sheep carcass; s 8 : qualified sheep; s 9 : unqualified sheep; s 10 : bulk mutton; s 11 : sheep sheet processed; s 12 : bulk mutton processed products; s 13 : product; s 14 : qualified products; s 15 : unqualified products: s 16 : cold storage plant products; s 17 : product distribution centers; s 18 : store products; s 19 : sales of products.The business process of the event is described as follows.t 0 : aquaculture; t 1 : plant breeding base to transport; t 2 : admission detection; t 3 : relaying; t 4 : quarantine, Curve   is a range of [, ] × R, it is including the   observations, the collection of data types for (   ,    )  = 1, . . .,   regression.At the same time, the sample matrix function of   × matrix corresponding is the representation of, and   = {  (   )} Suppose  is a constant; in order to put  observations into , the vector  spline coefficients need an unsupervised clustering technique.The set of has  objects, it can be constructed according to {  , . . .,   } the partitions of the same class, the partition means is  = {  , . . .,   } the, where each   is within in R  , the problem is to choose a  = {  , . . .,   }, get the minimize data function is given by represents the Euclidean norm.This problem is equivalent to finding {  , . . .,   } partition {  , . . .,   }, so we can get a minimum given by 2 , ), where  is the Borel field, for each  ∈  2 , set from  2 to ∏() generated by the spline subspace( 1 , . ..,   ), the coordinates is the orthogonal projection vector, so ∏() is a unique  ∈ R  , so we have:Let  R  and  denote the R  domain and  images Borel measure, since ∏ is continuous, (R  ,  R  , ) is a probability space, a sequence ( 1 ,  2 , . . .,   ) comprising the sequence R  random vector   = ∏(  ) of the   = ( 1 ,  2 , . . .,   ).