Research on Food Safety Traceability Technology Based on Internet of Things

: Relying on the Internet of things platform, building a traceability system ranging from the source to dinner table is the crucial issue of meat products to be solved at the moment. On the basis of knowing the current situation of domestic and international food traceability quo, the passage will put forward the feasibility of mobile query used in food traceability queries, mainly targeting elaborating the core technology like image preprocessing and decoding. It illustrates the feasibility of the project by analyzing components such as QR code, middleware, cell phone, computer terminal and etc, in which identifying QR code with the cell phone brings great convenience. A real-time query available algorithm system of cell phone has come into being through the experimental comparison between relevant algorithms. It has also demonstrated the algorithm experiment through related experiments, which provides a certain amount of reference for mobile phone queries of food information traceability system. This study mainly discusses the way to realize the trace of products via consumers taking picture by mobile phones and processing by Internet of Things Technology when in query and relevant experiments were carried out


INTRODUCTION
In recent years, the occurrence of a series of food security events such as Sanlu Poisonous Milk Powder Crisis, Shanghai Black Steamed Bun Event and Shuanghui Clenbuterol Pork Incident, reflects the severe food security problem in China.And the animal infectious diseases occurring around the world frequently like BSE, FMD (Moses, 2002).And A (H1N1) (Feshchenko et al., 2012) Flu brings people great panic.The problems mentioned above objectively promote the development of the world food traceability system and the implementation of the food traceability system about large animal meat attracts great attention and general concern of the relevant state departments and consumers (Gonzales Barron, 2008).
The rapid development of Information Technology, especially Computer Networks and Mobile Communication Technology, provides a more convenient platform for people to acquire, communicate and process information.Therefore, the mobile phone query system, which is consumer-oriented, has a strong real-time performance and can query anytime and anywhere, still has huge space in the market.This thesis mainly discuss the way to realize the trace of products via consumers taking picture by mobile phones and processing by Internet of Things Technology when in query and relevant experiments were carried out.

MATERIALS AND METHODS
The Internet of things, just as its name implies is between things and things' networking.The Internet of things develops based on the development of the Internet.The subject of the Internet is person.However, the Internet of things, has extended to the specific content in the human life, such as a car, a bed, a microwave oven or even a house.Any object can be covered in this network, so that we can achieve the information exchanging between objects and objects, between people and objects, so as to achieve the intelligent recognition, positioning, monitoring and management of the object (Atzori et al., 2010).
The core of the Internet of things is make the interconnection between things (including people), so as to implement active information exchange and communication between all things.China Communications Standardization Association (CCSA) ubiquitous network working Committee (TC10) gives a three layer structure of the Internet of things (Liu et al., 2014).Layer 1 is perceptual extension system, connecting things and perception information through the sensor; layer 2 is generic in the communication network of heterogeneous integration, including the existing Internet, communication network, network and a variety of access network and private network, realize the information transmission and processing; Layer 3 is applications and services for all kinds of terminal equipment such as mobile phones, PC provides sensory information application service.The technology of IOT has been the capacity of being elastic, such as the versatile applications that these technologi in the real world, concretely regarding to smart cities, smart grid, remote management and monitoring (Castro et al., 2011) and business processes automation and optimization without the need for human intervention.
One of the most widely used QR Code (also known as 2-dimensional Code), is produced by a particular geometric figure according to certain rules in the plane (2 dimension) on the distribution of the black and white graphic record data symbol information.On the aspect of compiled code, it skillfully use 0/1 bit stream which form the basis of computer internal logic concept, Using a number of corresponding to the binary geometric shapes to represent text numerical information, image input device or photoelectric scanning equi automatically recognized, to realize the automatic processing of information.For example the Fig. 1, it has a common with bar code technology: each code system has its particular character set; each character has a certain width; and it also have a certain calibration function.Moreover, It has the function of automatic identification is not peer information and processing graphics rotation changes, etc.
Through QR code recognition algorithm, Mobile terminal technology has made a great progress in th connection between different user application systems and played an important role in information transfer.Mobile query technology has become an important auxiliary means daily production and life office.Based on RFID data real-time processing and comb the GIS system implementation localization, It has played a good complementary role in achieving the accurate positioning of meat food traceability information.

2-dimensional code preprocessing:
procedures of preprocessing 2D code are as follows: Firstly, make the images acquired to be gray.Then, Adv. J. Food Sci. Technol., 8(2): 126-130, 2015 127 Fig. 2: The treating process of original image applications and services for all kinds of terminal equipment such as mobile phones, PC provides sensory information application service.The technology of IOT has been the capacity of being elastic, such as the versatile applications that these technologies could offer in the real world, concretely regarding to smart cities, smart grid, remote management and monitoring (Castro ., 2011) and business processes automation and optimization without the need for human intervention.
ed QR Code (also known dimensional Code), is produced by a particular geometric figure according to certain rules in the plane (2 dimension) on the distribution of the black and white graphic record data symbol information.On the aspect ode, it skillfully use 0/1 bit stream which form the basis of computer internal logic concept, Using a number of corresponding to the binary geometric ent text numerical information, through image input device or photoelectric scanning equipment automatically recognized, to realize the automatic processing of information.For example the Fig. 1, it has a common with bar code technology: each code system has its particular character set; each character has a certain calibration function.Moreover, It has the function of automatic identification is not peer information and processing Through QR code recognition algorithm, Mobile terminal technology has made a great progress in the connection between different user application systems and played an important role in information transfer.Mobile query technology has become an important auxiliary means daily production and life office.Based time processing and combining with the GIS system implementation localization, It has played a good complementary role in achieving the accurate positioning of meat food traceability code preprocessing: The general procedures of preprocessing 2D code are as follows: Firstly, make the images acquired to be gray.Then, process the gray images by filtering.In consideration of the process of meat production, the limit of the environment around may make QR co blurring, we take the adaptive threshold to remove defocus blur effect.Finally, geometrically correct the barcodes which have geometry deformation.Take QR Code as an example, Figure 2 shows the image effect before and after tilt correction and processing.
In this study the image primary mapping algorithm based on Sobel Operator is adopted and we select the operators as follow: • Horizontal operator as: • Vertical operator as: Use Horizontal Operator and Vertical Operator, respectively for convolution calculation on each point in the image and we get two matrixes M1 and M2 and calculate the sum of squares of the two numbers in the corresponding position, in the end through the thres processing we get the edge image, the general process can be expressed as: In this formula, T represents sensitive threshold parameter and any edge whose gray value is lower than this threshold will be never detected and its default value is an empty matrix, at this time the algorithm will compute the threshold automatically.Because this calculation only determines the barcode edge roughly, by using the edge detection algorithm based on Sobel Operator, making the image acquired projected both horizontally and vertically and count the black pixels on Row I and Column J respectively, we can get the position of the 2D barcode in the whole image.
Through the linearization and filtering the 2D barcode image, in many cases due to the effect of illumination and other irrelevant conditions, the phenomena such as edge point in continuity appear.Therefore, we need to locate the barcode image further, only in this way can we finish the preprocessing of QR code better.In this study it is checked by polar coordinate parameter space which adopts Hough transformation in the process of using the edge linear equation of QR code.In the case that the 2D barcode process the gray images by filtering.In consideration of the process of meat production, the limit of the environment around may make QR code images blurring, we take the adaptive threshold to remove defocus blur effect.Finally, geometrically correct the barcodes which have geometry deformation.Take QR Code as an example, Figure 2 shows the image effect before and after tilt correction and adaptive threshold the image primary mapping algorithm based on Sobel Operator is adopted and we select the Horizontal Operator and Vertical Operator, respectively for convolution calculation on each point in the image and we get two matrixes M1 and M2 and calculate the sum of squares of the two numbers in the corresponding position, in the end through the threshold processing we get the edge image, the general process (1) In this formula, T represents sensitive threshold parameter and any edge whose gray value is lower than will be never detected and its default value is an empty matrix, at this time the algorithm will compute the threshold automatically.Because this calculation only determines the barcode edge roughly, by using the edge detection algorithm based on Sobel perator, making the image acquired projected both horizontally and vertically and count the black pixels on Row I and Column J respectively, we can get the position of the 2D barcode in the whole image.
Through the linearization and filtering operation of the 2D barcode image, in many cases due to the effect of illumination and other irrelevant conditions, the phenomena such as edge point in continuity appear.Therefore, we need to locate the barcode image further, sh the preprocessing of QR it is checked by polar coordinate parameter space which adopts Hough using the edge linear the case that the 2D barcode .And now we can determine the linear equation of the left edge of the barcode using standard Hough transformation by θ θ ρ Similarly, we can get the linear equation of other edges of the barcode and then get the coordinates of 4 vertices.Now the image of barcode is acquired.

RESULTS AND DISCUSSION
Food information is a huge information system, it is necessary to build unified platform architecture for enterprise resource to provide information that can be shared, integrated, stored and read conveniently for all kinds of information system.Platform architecture is divided into the data layer, business logic layer and application layer.The data layer is composed of a platform of data and business data; the business logic layer includes QR Code subsystem, food manufacturer subsystem, food circulation system, food data acquisition and analysis subsystem and query and trace subsystem; the client layer provides mobile phone terminal and PC terminal services.
QR code information structure definition: QR Code can store 1 k~ 2 K character, so its storage capacity is more than that of the bar code.Meanwhile, its confidentiality is better because it can be encrypted to store information.The definition of information structure of QR Code is listed in Table 1.

QR code decoding code:
The process of QR decoding is the reverse process of the encoding process, the main steps can be expressed as follows: firstly, obtain the symbol image positioning, read format information and version information; secondly, mask pattern for the coding region of the bitmap to XOR processing, remove mask; third, according to the module arrangement rule, reading characters, data and the error correction codeword recovery of information, error with the error correction codeword monitoring should be relative and error correcting code word class information, if an error is found, then the error correction is carried out; finally, according to the mode indicator and the character count indicator data codeword is divided into a plurality of partial decoding, according to the use of the model and get the string output.
QR code subsystem design: The QR Code system involves encryption, encoding, inkjet and generating a plurality of modules.Its corresponding relationships is shown in Fig. 3.
The QR Code system is mainly to complete the QR Code from the information encryption to the code and then to generate QR Code and graphics and the graphics printing on the packaging of such a correlation with QR Code process.
Food data acquisition and analysis subsystem: Food data acquisition subsystem is an important part in the Internet of things system.It is mainly used for consumers to identify the food specific information, such as expired not, production, product reputation and so on.The system is through a hand-held scanning device including mobile phone and other channels to scan identification information of the food packaging bag after sending to the platform and then by the platform to analyze the data decoding and feedback to consumers, vendors and provide the safety status of the food.The structure of the system is shown in Fig. 4.
Mobile query and move back: Food search and traceability system is a traceability system based on B/S and GIS system.The system is mainly used for consumers to trace the source of food production date, expiration time and circulation path.
The key technology of system implementation: Key parts of the food tracking which based on Internet of things is the enables the various functional modules to organic combination.QR code is the main line in the system.It through the system from generation from encryption system, printing to packaging, warehousing, to link to the retailer and finally to reach consumers' hands.The system of the diagram as shown in Fig. 5.When QR code is on the hand of reach consumers and distributors, the consumers and distributors' feedback  must be of great important.The system should rely on these two part of group to recovery, to make thinks link each other.
The recognition rate and accuracy: Recognition rate of experiment design is based on the collected some food commodity barcodes and image and data processing system for verification.Through the study of the image preprocessing of many pictures and decoding operation and compared with those of data query and database, we obtained the following results (Table 2).The query processing time: Experiment of the image processing time for food traceability information system is of great significance to the real-time query.It can effectively save consumers waiting time and improve the query efficiency.Here is to adopt the QR code of 1000 food commodities after process the average data.Its image and information processing time data statistics, such as Table 3.

CONCLUSION
This study presents the feasibility of achieving traceability queries by using mobile terminal.By researching of current food's traceability information inquiry system and combining with the current use of the algorithm system, we have optimized the correlation algorithm, so as to develop a set of consistent with the mobile phone image query algorithm system which requires the real-time and the accuracy.Through a series of experiments, the algorithm system has some advantages in the recognition of image processing and real-time.

Table 1 :
QR code information structure definition

Table 2 :
Statistical table of recognition rate

Table 3 :
Statistical table of recognition rate Query typeResponse time (msec) Feedback time (msec)