The invention relates to the technical field of block chain food
traceability, and discloses a block chain-based food
traceability method and
system, and the method comprises the steps: carrying out the
timestamp processing of a
batch number, a production date, a transportation temperature and storage
humidity, and calculating a dynamic guarantee period to generate a
traceability record; encrypting the
batch number and the dynamic
shelf life to generate a tamper-proof hash value; when the temperature and the
humidity exceed threshold values, food state records are generated in combination with the Hash values;
synchronizing the food state
record to a supply chain node and performing consistency
verification to obtain a shared
data set; generating a credible two-dimensional code containing a
batch number, a dynamic
shelf life and a circulation
record based on the shared
data set; the
consumer executes
verification after scanning the code, extracts the
shelf life field and the circulation information abstract, and compares the dynamic shelf life with the
current time to generate a
user interface; and
consumer feedback is extracted, batch matching is verified through a
timestamp, and a food traceability report is generated. The food state can be reflected in real time, data tampering is prevented, and traceability credibility is improved.