The frequent occurrence of food safety accidents and the globalization of food import and export circulation make it very important to establish a food traceability system. Due to the bulk and low-value characteristics of grain, it is difficult to achieve traceability in a single unit like meat products; as grain has a longer supply chain, involving much more links and even more complicated factors, it is easy to cause information disconnection. In response to the above problems, this paper has done the following tasks: First, propose a RFID-based grain supply chain traceability model, which mainly describes the information flow and grain flow in the grain traceability system, and secondly, in combination with the GTIN coding standard in the GS1 system, a stage traceability code is set for each batch of grains at each link, providing a method for uniquely identifying the batch of grains at that link, to improve the accuracy of grain traceability. In addition, in order to enable consumers to inquire all the detailed information of the grain in the supply chain through a traceability code, the PRESENT algorithm and the format-preserving algorithm are used to encrypt the traceability codes of each link and generate a final traceability code. Finally, a security and performance analysis of the proposed traceability scheme was carried out. The results show that the proposed scheme is safe and effective, ensuring the safety and traceability of the traceability system of the grain supply chain.