# Research on Traceability System of Food Safety Based on PDF417 Two-Dimensional Bar Code

Shipu Xu, Muhua Liu, Jingyin Zhao, Tao Yuan, Yunsheng Wang

► To cite this version:

Shipu Xu, Muhua Liu, Jingyin Zhao, Tao Yuan, Yunsheng Wang. Research on Traceability System of Food Safety Based on PDF417 Two-Dimensional Bar Code. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.434-440, 10.1007/978-3-642-18336-2_53. hal-01562739

HAL Id: hal-01562739

https://inria.hal.science/hal-01562739

Submitted on 17 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Research on Traceability System of Food Safety Based
on PDF417 Two-Dimensional Bar Code

Shipu Xu¹, Muhua Liu², Jingyin Zhao¹, Tao Yuan¹, Yunsheng Wang¹*

¹ Technology & Engineering Research Center for Digital Agriculture, Shanghai Academy of Agricultural Sciences, Shanghai 201106, China; ² Engineering College, Jiangxi Agricultural University, Nanchang, Jiangxi 330045, China; * Author for correspondence. Email: wangyunsheng@saas.sh.cn

**Abstract.** In this paper, through the research on two-dimensional bar codes of food source tracking; a set of traceability tracking system was designed based on the two bar coding algorithm and decoding algorithms. This system could generate PDF417 code based on food production, logistics and transport, supermarket and other storage information. Consumers could identify PDF417 code through a client based on B/S architecture so that a simple process of food traceability has been completed.

**Keywords:** Food source tracking, Food safety, B/S, Two-dimensional bar code

# 1 Introduction

In recent years, food safety is always a focus of governments, food companies, news media and the consumers, such as foreign BSE, GMF, domestic Melamine scandal, Sudan, etc. In 2009, the Food Safety Law adopted on Two Sessions shows the importance of food safety.

As more serious and emergent of food safety incidents were appeared, the concept of food traceability was mentioned once again. Food traceability is a process, in which the supply chains of participants take use of information technology to carry out the information sharing or to track food supply chains. Once a problem was discovered in some part of the food supply chains, we could find out the root of the problem using the information technology from downstream to upstream. There would be another relative word—traceability. It means that the system can provide backtracking mechanism at all possible steps, such as food growing period, breeding, processing, transportation and sale which involved in the process of products providing. So the consumers could decide what to buy according to this information related to the origin and transport. The application of backtracking mechanism was more mature and widespread in the EU and Japan than our country.

Currently, there are two popular traceability technologies in the world, including isotopes tracing and barcode technology. Isotope tracing technique is to distinguish various types of food and their possible sources, depending on isotopic composition in vivo of which is affected by the factors of climate, environment, and type of biological metabolism [1]. The basic principle and foundation of this technique is
based on the natural isotope fractionation effects. AS the information carrier, the bar
code technology is a traceable method from downstream to upstream. This method is
widely used in the world, and it also reached a certain high degree of maturity.
Different types of bar code offered different origins of the principle.

In China, traceability of food safety technology develops late. There was only the concept of food traceability in the late 1970s, but it has a fairly rapid development. During the Tenth Five-Year Plan period, independent innovation capacity original innovation of food safety technology and recreation capacity of digestion and absorption are greatly enhanced through the implementation of food safety science and technology projects. In recent years, due to the repeated food safety problems, the government intensifies the monitoring of food safety but the work is just beginning. As the feature of decentralized management of food security monitoring, the uniform national food safety traceability system has not been established. The stage of research and simulation is presented in the sector, local department and company. At present, there is a relatively standard of food tracking and traceability technology which is introduced by the ANCC (Article Numbering Country Centre); but it has not carried out specific research on a particular aspect of the traceability technology. During Spring Festival of China in 2010, the two-dimensional bar code has a good use for security identification.

There has been 80 years since the bar code was invented. With the advance of
technology, development of bar code is maturing and people's lives are more
convenient. However, there is a separatist party because of the different
characteristics in areas. Currently, bar code has more limited application which is
only used in goods, logistics, library management, medical treatment and so on. Bar
codes are different in different aspects. The same series of information cannot be
shared between each other. The two-dimensional bar code which is emerging in these
years can solve this problem well.

## 2 Coding of PDF417

As shown in Figure 1, each of PDF417 code includes 3~90 layers and each layer is composed by Start/End, Left/Right Row Indicator Code words and 1~30 symbol characters. Each symbol character is consisted of 17 modules, including the four black bars and four white bars [3]. As the number of layers and each symbolic in a layer is uncertain, the PDF417 can suit different needs.

<figure><img src="image_2.png" /><figcaption>**Fig.1.** The Schematic of PDF417. It contains start symbol and terminator, left and right level indicator.</figcaption></figure>
As shown in Figure 1, the PDF417 code is composed by a symbol for each character which has four black bars (The black part in Figure 2, b1~b4) and four white bars (The white part in Figure 2, s1~s4). From the Start, each bars contains 1~6 modules from left to right. In a symbol character, there are a total of 17 modules in every bar.

<figure><img src="image_3.png" /><figcaption>Fig.2. The schematic of symbol characters. In this chart, it contains a symbol for each character which has four black bars and four white bars.</figcaption></figure>

The PDF417 symbol set is formed by the three clusters. Each cluster contains 929 PDF417 codeword in different bars. In each cluster, each symbol corresponds to a unique code word characters which is ranging from 0 to 928. In PDF417, the symbol characters are used in cluster No.0, No.3 and No.6. PDF417 uses only one cluster on each layer of the symbol characters [5]. The same clusters have a repeat in every 3 layers. Layer 1 uses the symbol character of the 0 cluster, Layer 2 uses the symbol character of the 3 cluster, Layer 3 uses the symbol character of the 6 cluster, and Layer 4 uses the symbol character of the 0 cluster, and so on.

The most important process which is taken by the mix of main text is translating data (character or ASC II) into a symbol in coding with two-dimensional bar code. The corresponding relationship of data and text mode was stored in a database. Text code will be obtained through the corresponding to each character from a database. This text can generate PDF417 code word. The combination formula is $C = 30 \times H + L(C)$ means code words and H and L means high and low characters in the corresponding character value respectively) [2].

First, the algorithm flow chart of generated codeword is shown in Figure 3.
<figure><img src="image_4.png" /><figcaption>Fig.3. The algorithm flow chart of generated codeword.</figcaption></figure>

As shown in Figure 3, it can calculate the required error-correcting code word according to the generated code and choose error correction level. The error correction code words generated according to Reed_Solomon algorithm, including the following three steps [4].

First, data polynomial symbol will be established. Its expression is $d(x) = d_{n-1}x_{n-1} + d_{n-2}x_{n-2} + ... + d_1x + d_0$. The coefficients of this polynomial contains a data code word which has a area code word, including the length of code word symbols, data code words and filled code words. The alignment of each data code words ($d_{i,i} = 0, ... n-1$) in the bar code is shown in Table 1.

<table><caption>Table 1. The location diagram of data, row identifier, and error correction code words</caption><tr><td></td><td>L0</td><td>dn-1</td><td>dn-2</td><td></td><td></td><td>R0</td></tr><tr><td></td><td>L0</td><td></td><td></td><td></td><td></td><td>R1</td></tr><tr><td rowspan="3">start</td><td>Lm-2</td><td></td><td></td><td></td><td>d0</td><td>Ck-1</td><td>Ck-1</td><td>Rm-2</td></tr><tr><td>Lm-1</td><td></td><td></td><td></td><td></td><td>C1</td><td>C0</td><td>Rm-1</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>end
Second, error-correcting code word generating polynomial will be established.
The polynomial with k-generator for the codeword is: $g(x) = (x-3)(x-3^2)...(x-3^k) = x^k + g_{k-1}x^{k-1} + ... + g_1x + g_0$.

Third, for a given set of data code words and a selected level of error correction,
error correction code words will be generated.

Finally, it arranged in a matrix on which the request was encoded in accordance
with the d<sub>n-1</sub>, dn_2... d<sub>0</sub>, C<sub>k-1</sub>, C<sub>k-2</sub>...C<sub>1</sub>, C<sub>0</sub> order. As shown in Table 1, the d<sub>n-1</sub>=n means
the number of data code word. The output encoding can be a text file. Each row in the
file corresponds to each line of bar code, and each line is content from Table 1.With
the calculated code word, it will be transformed into the corresponding 01 sequence
for white and black bars through a piece. Such as 4111315, it will be compiled out of
the 1111010111011111.

After completing these three steps, it will query symbol characters by the data
word, Left/Right row indicator, error-correcting code word and each cluster of a line,
and drawing a bar code in accordance with the code symbol character. It can be
modeled on the one-dimensional bar code.

In the design of the traceability of food safety system, the process of encoding is
to convert the readable information to a bar code character which is used to draw, and
then the additional and related information can be added. The process of coding is
shown in Figure 4.

<figure><img src="image_5.png" /><figcaption>**Fig.4.** The flow chart of generating a PDF417 image. There are four statuses in this chart. At last, a picture could be output.</figcaption></figure>

The original information which contains text, characters, numbers, images and
fingerprints is converted to PDF417 bar code string. The code string is 929 for the
domain of integers. After searching the database, it will be converted into symbol
characters, and finally a two-dimensional bar code graphics will be drawn through the
relevant procedures.

# 3 Designing of System

There are four design principles of this system: 1, Convenient and practical. The first principle of this platform design is convenient, simple to operate, and the system is easy to learn and use, thus it reduces the threshold for using this platform. To some extent, it avoids a difficult situation when promoting this system by the lack of technology.2 Science and reliability. The food safety traceability system makes full use of one-off data from research and market. It could ensure that the information provide is scientific, reliable to meet the needs of all users.3 Three-dimensional, cross and completely. The system uses the information dissemination chain with multiple, three-dimensional and cross.4, High security, high compatibility, easy to maintain and
scalable. It ensures security of data backup and recovery automatically by using advanced technology. With a cross-platform technology, all the function modules of this system could be run normally in a variety of operating environment. Thus it could be easy to maintain and manage in later period, easy to upgrade, expand and improve.

As a widely used system, the system's designing goals and requirements, combination of advancement and practicability, and scalability need to be balanced. It can be considered from the following aspects of the system's logical designing.

① Make clear the construction goals and the user's needs of this system. In fact, the system can determine the goal of building phases. Only when the goal was clearly defined, we can determine the content and size of system construction. And to formulate a reasonable and ordered solution is the key of success or failure of the system.

② In the choosing of ‘advanced’ and ‘practicality’, it does not blindly pursue the advancement in technology. It just tries its best to meet the needs of the user when the technology can be achieved.

③ Considering scalability. With the development of society, the progress of information technology and user needs can be changed; the system scalability is referred to a very high level, which requires the structure of rational planning system; and it should be set aside the interface with other systems.

Based on the above considerations, the map of the system logic design and framework is shown in Figure 5.

<figure><img src="image_6.png" /><figcaption>Fig.5. The map of system logic design and framework. There are three types of user in this system which contains administrator, special users and guest</figcaption></figure>

According to Figure 5, the logic design and framework map from the following three aspects to illustrate.

① The security and accuracy of core database data. In order to ensure this, the authority of a person who stored such information into production base, transport
and supermarket is set to only increase data, but cannot modified and deleted the information. The authority permission is set to place the database on management who has the highest permission. In order to prevent the invasion of hackers and viruses, the interface of information input was designed to C/S structure which is the only way to guarantee data's security and accuracy.

② A major function of the system is bar code generation module based on C/S structure. The appropriate encoding algorithm of PDF417 two-dimensional bar code was selected in this system. It needs a special note that the PDF417 bar code's image should be saved as a picture into database in the background.

③ When PDF417 bar code is identified, there are two types of user groups. One of them is identified as the typical consumer. The convenience and fast of use is what they need mostly; so we choose the better algorithm of PDF417 bar code decoding which reflected in the error correction capability and time. Another type is identified as the user who has a special need, such as members with information at all levels and the secession makers in other departments. They need to draw more information on this PDF417 bar code and develop appropriate policies and regulations; so these users should require higher accuracy of the information. If necessary, such users can connect directly to the database.

## 4 Conclusion

This paper analyzed the current situation of food safety traceability at home and abroad; and the framework map and logic design of the system was released in this paper. The traceability of food safety in the promotion of the tracking system will be restricted by a number of hardware and the narrow use. In future, if the hardware was more mature, this system can be ported to the portable devices, such as mobile phones, PDA and other mobile devices. Under the mature 3G network, the consumer is convenient to use the system.

## References

1. MacKay, D. J. C. Information Theory, Inference, and Learning Algorithms. Cambridge University Press: Cambridge, UK, 2003

2. N. Pradeep Kumar, A, R. DNA Barcodes can distinguish species of Indian mosquitoes. J.Med.Entomol.77 (2007)1-7

3. Dermot J. Hayes, Jason F. Shogren, Seung Youll Shin, James B. Kliebenstein Valuing Food Safety in Experimental Auction Markets American Journal of Agricultural Economics, 1995, V77 (1): 35-46.

4. S. Itkin and J. Martell, A PDF417 Primer. Bohemia, NY: Symbol Technologies, 2002

5. Robert B. Johnston and Alvin Khin Choy Yap, Electronic Data Interchange using Two Dimensional Bar Code, HICSS(4).1998.V14 (5): 83-91.