Food preservative tracing system based on whole industrial chain

By deploying sensing devices and constructing a spatiotemporal grid trajectory model covering the entire lifecycle of food preservatives, the problems of lagging monitoring information and insufficient risk identification in food preservatives have been solved, enabling real-time traceability and intelligent early warning, and improving food safety assurance capabilities.

CN121581902APending Publication Date: 2026-02-27FUQING BRANCH OF FUJIAN NORMAL UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202610117167.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-28
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing technologies lack efficient, intelligent, and real-time tracking methods for monitoring the status of key links in the food preservative industry chain. This results in delayed information updates, making it difficult to ensure the accuracy of traceability verification information and timely identification of potential quality risks. Furthermore, there is a lack of a real-time data-driven risk warning mechanism.

Method used

By deploying sensing devices and RFID readers in the raw material preparation, finished product production, warehousing and logistics transportation of food preservatives, identity codes and environmental parameters are collected in real time. Data is uploaded to the central control server for cleaning and storage using a narrowband IoT communication module, a full life cycle spatiotemporal grid trajectory model is constructed, a dynamic time warping algorithm is used to calculate the quality deviation index, and an early warning is triggered when the threshold is exceeded.

Benefits of technology

It enables real-time tracking and visualization of the food preservative circulation process, accurately identifies quality deterioration trends, shortens risk response time, assists regulatory personnel in quickly locating the root cause of problems, and prevents quality hazards from flowing into subsequent stages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121581902A_ABST
    Figure CN121581902A_ABST
Patent Text Reader

Abstract

The invention discloses a food preservative traceability system based on a whole industrial chain, which belongs to the technical field of industrial chain traceability, and specifically comprises the following steps: deploying equipment to collect batch identity codes and environmental parameters at physical nodes of links from food preservative raw material preparation to logistics transportation; uploading the data to a central server through the narrowband Internet of Things, cleaning and stamping a uniform timestamp, and then storing the data into a non-relational database; mapping the environment parameters to a full life cycle space-time grid according to a timestamp, and constructing a real-time state trajectory model to form a visual traceability link; calculating a similarity distance between the trajectory and a standard quality curve through a dynamic time warping algorithm, and quantizing to generate a quality deviation index; and comparing the index with a safety threshold, if the index exceeds the standard, locking the batch of electronic archives, and sending an early warning signal containing an abnormal node position and a risk type to a supervision terminal.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of industry chain traceability, and particularly relates to a food preservative traceability system based on a whole industry chain. BACKGROUND

[0002] With the continuous strengthening of food safety supervision, food preservatives, as a key aid to ensure the shelf life and quality of food, have become the focus of the industry. At present, related traceability technologies have gradually upgraded from single-link monitoring to whole-industry-chain coverage. Through the deployment of sensing devices and identification terminals in raw material preparation, production processing, warehousing and logistics, etc., the collection and transmission of preservative batch information, environmental parameters and other data can be completed. At the same time, with the help of data storage and visualization technology, some traceability systems can already realize basic traceability link display, providing a direct query channel for preservative flow process for supervisors, and promoting the standardized development of food preservative quality control.

[0003] However, the existing technology lacks efficient and intelligent real-time tracking means in the key link state monitoring of the food preservative industry chain, and the key link state information update is lagging, making it difficult to guarantee the accuracy of information in the traceability verification process, and unable to identify potential quality risks in a timely manner. Moreover, there is a lack of real-time data-based risk warning mechanism, which is difficult to meet the actual needs of enterprise quality control and food safety protection. SUMMARY

[0004] The purpose of the present application is to provide a food preservative traceability system based on a whole industry chain, which solves the problems in the background art:

[0005] The purpose of the present application can be achieved by the following technical solutions: A food preservative traceability system based on a whole industry chain, comprising: An information collection module is used to fixedly deploy sensing devices and radio frequency identification readers on physical nodes in the raw material preparation, finished product production, warehousing and logistics transportation links of food preservatives, and to collect the identity codes of the preservative batches and the environmental parameters corresponding to the nodes in real time; A transmission and storage module is used to upload the collected identity codes and environmental parameters to a central control server through the narrowband Internet of Things communication module of the sensing device, and to store the data in a non-relational database after cleaning and adding a uniform timestamp by the central control server; A trajectory construction module is used to map the continuous environmental parameters into the whole life cycle space-time grid of the preservative according to the timestamp order, to construct a real-time state trajectory model of the batch of preservatives in the flow process, and to form visual traceability link data; The deviating quantification module is configured to calculate a similarity distance between a real-time state trajectory model and a preset standard quality evolution curve by using a dynamic time warping algorithm, and to generate a quality deviation index of the batch of preservatives according to the similarity distance; The early warning control module is configured to automatically lock an electronic file of the batch of preservatives in the database and immediately send an early warning signal containing an abnormal node position and a risk type to a supervision terminal when the quality deviation index exceeds a safety threshold preset by the system.

[0006] As a further scheme of the present application, the environmental parameters include an air temperature value, a relative humidity value, an illumination intensity value and an environmental oxygen concentration value of the current physical node.

[0007] As a further scheme of the present application, in the transmission and storage module, the process of cleaning, stamping with a unified timestamp and storing the data in the non-relational database by the central control server comprises: The central control server receives the identity code and the environmental parameters, detects the data packet field integrity and the numerical value logic range by using a verification algorithm, directly eliminates invalid data containing null values and format errors, and extracts valid service payload data conforming to a preset format; The central control server calls a local system clock to obtain a standard time of a current receiving time, defines the standard time as a unique timestamp and binds the unique timestamp to the valid service payload data, and generates a structured data object with a strict time attribute; The central control server establishes a connection channel with the non-relational database by using an application program interface, serializes the structured data object into a key-value pair format, and writes the key-value pair format into a storage node of the non-relational database according to a timestamp index sequence.

[0008] As a further scheme of the present application, in the trajectory construction module, the process of mapping the continuous environmental parameters into a full life cycle space-time grid of the preservatives according to the timestamp sequence to construct a real-time state trajectory model of the batch of preservatives in the circulation process comprises: A multi-dimensional coordinate system is established by taking geographical coordinates of a preservative circulation path as a space axis and taking a circulation time sequence as a time axis, the multi-dimensional coordinate system is divided into discretized grid units with a fixed space-time resolution, and a full life cycle space-time grid covering a full link is generated; The non-relational database is traversed, corresponding discretized grid units in the full life cycle space-time grid are locked according to a timestamp index and a physical node position, air temperature values, relative humidity values, illumination intensity values and environmental oxygen concentration values are extracted, and the air temperature values, the relative humidity values, the illumination intensity values and the environmental oxygen concentration values are filled into the discretized grid units as multi-dimensional attribute data; Extract the geometric center of the discretized grid cell filled with attribute values in the full life cycle space-time grid in chronological order, and use the cubic spline interpolation algorithm to smoothly connect the continuous geometric center points to generate a real-time state trajectory model representing the space-time evolution of the preservative environment state.

[0009] As a further scheme of the present application: the specific way of generating the real-time state trajectory model representing the space-time evolution of the preservative environment state is: Scan the full life cycle space-time grid, identify and filter out non-empty discretized grid cells filled with multi-dimensional attribute data, arrange the filtered non-empty discretized grid cells in ascending order according to the time axis coordinate value, and generate a time-sequential effective grid sequence; Analyze the spatial coordinate range and time span of each non-empty discretized grid cell in the effective grid sequence, calculate the arithmetic mean of its spatial dimension and time dimension to obtain the geometric center coordinate, and bind the multi-dimensional attribute data to the geometric center coordinate to form a discrete trajectory feature point; Input the discrete trajectory feature point as a node into the cubic spline interpolation algorithm, construct a piecewise cubic polynomial function that satisfies the equality of the function value at the node and the continuity of the first and second derivatives, and calculate the interpolation coordinate data of the missing time between adjacent discrete trajectory feature points; Connect the discrete trajectory feature points and interpolation coordinate data, and fit a continuous and smooth time series curve in the multi-dimensional coordinate system, and define the curve as the real-time state trajectory model representing the space-time evolution of the preservative environment state.

[0010] As a further scheme of the present application: in the deviation quantification module, the process of calculating the similarity distance between the real-time state trajectory model and the preset standard quality evolution curve using the dynamic time warping algorithm, and quantifying the quality deviation index of the batch of preservatives according to the similarity distance is: Extract the preset standard quality evolution curve, and discretely sample it with the real-time state trajectory model according to a fixed time step to generate a standard feature sequence and a real-time feature sequence containing multi-dimensional environmental attribute values, and establish a sequence data basis for distance calculation; Construct a cost matrix with the real-time feature sequence and the standard feature sequence as dimensions, and calculate the Euclidean distance between the feature points in the real-time feature sequence and the feature points in the standard feature sequence in multi-dimensional space one by one, and fill the Euclidean distance as a unit value to the corresponding row and column nodes of the cost matrix; Apply a dynamic programming strategy to retrieve a warping path with the smallest cumulative value in the cost matrix, which strictly follows the boundary conditions, continuity and monotonicity constraints, and determine the minimum cumulative value of the warping path as the similarity distance between the real-time state trajectory model and the standard quality evolution curve; The calculated similarity distance is input into a preset exponential normalization function, and the function mapping operation is used to convert the absolute distance value into a relative value within the closed interval of 0 to 1, and the relative value is directly defined as the quality deviation index of the batch of preservatives.

[0011] As a further scheme of the present application: the specific way of constructing a cost matrix with real-time feature sequence and standard feature sequence as dimensions, and calculating the Euclidean distance between the feature points in the real-time feature sequence and the feature points in the standard feature sequence in the multi-dimensional space one by one, is as follows: The total number of time sampling points contained in the real-time feature sequence is taken as the number of rows of the matrix, the total number of time sampling points contained in the standard feature sequence is taken as the number of columns of the matrix, and a two-dimensional array structure is opened in the memory to construct a vacant cost matrix, which is defined as the vacant cost matrix to be filled in; Each grid cell of the vacant cost matrix is traversed according to the row index and the column index, and a group of feature vectors for comparison is locked by retrieving the multi-dimensional environmental attribute vector corresponding to the current row index in the real-time feature sequence and the multi-dimensional environmental attribute vector corresponding to the current column index in the standard feature sequence, respectively; The Euclidean distance value between the group of feature vectors is calculated according to the multi-dimensional space distance calculation formula, and the Euclidean distance value is written into the grid cell pointed to by the current row index and the current column index in the vacant cost matrix, until the traversal is completed and the fully filled cost matrix is generated.

[0012] As a further scheme of the present application: in the early warning and control module, the process of automatically locking the electronic file of the batch of preservatives in the database and immediately sending a warning signal containing the abnormal node position and the risk type to the supervision terminal when the quality deviation index exceeds the system preset safety threshold is as follows: The calculated quality deviation index is compared with the system preset safety threshold value, and when it is detected that the quality deviation index value is greater than the safety threshold value, the database locking instruction is immediately executed to modify the write permission of the electronic file of the batch of preservatives in the non-relational database to the read-only state; The coordinates of the discretized grid cell with the maximum local distance value in the dynamic time warping path are taken as the abnormal node position, the environmental parameter name with the maximum difference amplitude from the standard feature sequence at this position is selected as the risk type, and the abnormal node position and the risk type data are packaged to generate a digital warning signal; The transmission link with the specified supervision terminal is established by using the network communication module, and the generated digital warning signal is sent to the supervision terminal to trigger the supervision terminal to decode the data packet and display the specific abnormal node position and risk type information on the interactive interface.

[0013] The beneficial effects of the present application are: The present application significantly improves the real-time performance and visualization accuracy of traceability data by constructing a full life cycle trajectory model based on a space-time grid. The system uses narrowband Internet of Things technology to capture identity and environmental data in real time at all links of raw materials, production and logistics, and cleans and binds the data with a unified timestamp via a central control server, eliminating information lag and fault phenomena caused by traditional manual recording or discrete node monitoring. By mapping continuous environmental parameters to a discretized space-time grid, the system can reconstruct the complete space-time evolution trajectory of the preservative flow, so that the environmental history of each batch of products can be traced and reproduced, effectively solving the technical problem of difficulty in ensuring information accuracy in traceability verification, and providing a solid data foundation for transparent supervision of the entire industry chain.

[0014] Secondly, the present application realizes intelligent risk early warning and active quality control based on algorithm model. Unlike traditional single-point threshold alarm, the system introduces a dynamic time warping algorithm, calculates the similarity distance between the real-time trajectory and the standard quality evolution curve, and quantitatively generates a quality deviation index that can reflect the cumulative environmental impact, so as to accurately identify subtle and potential quality deterioration trends. Once the index exceeds the standard, the system triggers the automatic locking mechanism of the database electronic file and pushes the early warning signal containing the abnormal node position and risk type. This change from "passive query" to "active blocking" not only greatly shortens the risk response time, but also helps supervisors quickly locate the problem source, effectively preventing preservatives with quality problems from flowing into subsequent links. BRIEF DESCRIPTION OF DRAWINGS

[0015] The present application will be further described below with reference to the accompanying drawings.

[0016] Figure 1 is a module schematic diagram of a food preservative traceability system based on the entire industry chain of the present application. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0018] Please refer to Figure 1 The present application is a food preservative traceability system based on the entire industry chain, which comprises: The information collection module is used for fixedly arranging the temperature and humidity sensing device and the radio frequency identification reader at physical nodes of raw material preparation, finished product production, storage and logistics transportation of the food preservative, and collecting the identity code of the batch of preservative and the corresponding environmental parameters of the node in real time; The transmission storage module is used for uploading the collected identity code and environmental parameters to the central control server through the narrowband Internet of Things communication module of the sensing device, and storing the data in the non-relational database after cleaning and marking with a unified timestamp by the central control server; The trajectory construction module is used for mapping the continuous environmental parameters to the space-time grid of the whole life cycle of the preservative according to the timestamp sequence, constructing the real-time state trajectory model of the batch of preservative in the circulation process, and forming the visual traceability link data; The deviation quantification module is used for calculating the similarity distance between the real-time state trajectory model and the preset standard quality evolution curve by using the dynamic time warping algorithm, and generating the quality deviation index of the batch of preservative according to the similarity distance; The early warning control module is used for locking the electronic file of the batch of preservative in the database when the quality deviation index exceeds the safety threshold preset by the system, and immediately sending the early warning signal containing the abnormal node position and the risk type to the supervision terminal.

[0019] In an embodiment of the present application, the information collection module is used for fixedly arranging the sensing device and the radio frequency identification reader at the physical nodes of raw material preparation, finished product production, storage and logistics transportation of the food preservative, and collecting the identity code of the batch of preservative and the corresponding environmental parameters of the node in real time. In the whole process of production, processing and circulation of food preservatives, the hardware deployment of the information collection module covers four key physical nodes of raw material preparation, finished product production, storage and logistics transportation. In specific implementation, the technical personnel first install high-precision industrial-grade temperature and humidity transmitters, illumination sensors and electrochemical oxygen concentration detectors on the walls of the stirring area and reaction area in the raw material preparation workshop, and fix the ultra-high frequency radio frequency identification reader on the side of the conveying belt at the raw material inlet. When the raw material barrel with an electronic tag passes through the conveying belt, the reader immediately senses and reads the unique identity code stored in the tag memory, and at the same time triggers the surrounding environmental sensing equipment to synchronously collect the current air temperature value, relative humidity value, light intensity value and environmental oxygen concentration value. At the packaging station of the finished product production link, a miniature environmental monitoring probe and a close-range radio frequency identification antenna are also configured to record the micro-environmental data of the preservatives exposed to the air. After entering the storage link, an integrated environmental sensing node is deployed under each storage beam of the stereoscopic warehouse to continuously monitor the temperature and humidity and gas content changes around the stored preservatives. In the logistics transportation link, an anti-shock environmental data recorder and a vehicle-mounted radio frequency reading terminal are fixed on the inner wall panels of the cold chain transport vehicle. During vehicle driving, the equipment automatically wakes up every 10 minutes, reads the identity code in the vehicle compartment and records the real-time environmental parameters. All collected temperature values, humidity values, illumination lux values and oxygen percentage values are marked with the collection time, thereby completing the accurate capture of the physical environmental data of the preservatives throughout the life cycle.

[0020] In an embodiment of the present application, in the transmission storage module, the process of cleaning the data by the central control server, marking a unified timestamp and storing it in the non-relational database is: The central control server continuously listens to the uplink data from each sensor node through the Ethernet interface or wireless communication module. When receiving the original binary data packet containing the identity code and environmental parameters, the processor first starts the preset data verification subprogram to match the start and end of the data packet header frame, confirming that the data packet has not been truncated or lost during transmission. Then the server scans the fields in the data packet according to the preset communication protocol specification, focusing on checking whether the identity code field conforms to the standard 16-bit hexadecimal format and whether the environmental parameter field is missing. At the same time, the server also retrieves the logical verification rule table in the memory to determine the numerical logical range of the extracted air temperature value, relative humidity value, etc. For example, it determines whether the temperature value is within the reasonable range of -40°C to +80°C. Once it detects that the data packet contains null values, random codes, or values exceeding the physical limit, the server will determine that the data is invalid noise data and directly execute the discard instruction, only retaining the valid payload data that passes all integrity and logicality checks in the memory buffer area for processing.

[0021] After completing the extraction of valid data, the central control server immediately calls its internal high-precision crystal oscillator clock source to obtain the standard time information of the current reception time. To ensure the accuracy and uniqueness of the time label, the server accurately extracts the time value to the millisecond level and defines it in the international standard UTC time format. Then the server generates a unique timestamp as the core index key value and logically binds it to the valid payload data temporarily stored in the memory buffer area. In this process, the identity code, air temperature value, relative humidity value, light intensity value, and environmental oxygen concentration value are re-encapsulated. The server integrates the timestamp attribute with the above business data attributes according to the pre-defined data structure template to build a structured data object with strict time sequence characteristics. This structured data object not only contains environmental state information in the physical world but also carries an unforgeable time dimension label, providing an accurate spatiotemporal coordinate reference for the construction of a traceable link. It ensures that each record can be uniquely located on the time axis, completing the conversion process from raw discrete data to high-value structured information.

[0022] The central control server initializes and establishes a stable and high-bandwidth data writing connection channel by calling the native application programming interface provided by the non-relational database, which supports high-concurrency data throughput operations. The server inputs the structured data object built in memory into the serialization engine, which converts it into a binary stream or text string format that meets the key-value pair storage specification, usually using a timestamp as the key name and a data entity as the key value. Then the server accurately routes the serialized key-value pair data to the specified storage node in the non-relational database cluster according to the timestamp index order. Using the columnar storage or document storage features of the non-relational database, the data is quickly and persistently written to the hard disk medium. During the writing process, the database engine automatically establishes an inverted index based on the time dimension for newly written data entries, ensuring that the data is arranged in chronological order on the physical storage medium. When the server receives the write success confirmation signal returned by the database, it indicates that the archiving of the environmental parameter data is complete. These massive time-series data will serve as the foundation for the entire traceability analysis function, enabling long-term secure management and rapid retrieval of data.

[0023] In an embodiment of the present application, in the trajectory construction module, the process of mapping continuous environmental parameters into the full life cycle space-time grid of the preservative and constructing the real-time state trajectory model of the batch of preservatives in the circulation process according to the timestamp order is as follows: The processor first initializes a virtual three-dimensional space model in memory, maps the longitude coordinates of all geographical positions passed through by the preservative during the circulation process to the X-axis value, maps the latitude coordinates to the Y-axis value, and maps the time sequence of the circulation to the vertical Z-axis value, thereby constructing a multi-dimensional coordinate reference system containing spatial and temporal dimensions. On this basis, the processor sets the space-time resolution parameters of the discretized grid units, for example, sets the spatial resolution to a 10m x 10m square area and the time resolution to a 5-minute time slice length. According to these two key resolution parameters, the processor performs global cutting and division on the multi-dimensional coordinate system, generating tens of thousands of hexahedral grid units that are closely arranged and do not overlap, collectively forming a space-time grid structure covering the full life cycle of the preservative from manufacturing to sales, providing a basic container carrier for standardized mapping of data.

[0024] The trajectory construction module linearly traverses the storage nodes in the non-relational database through a high-throughput read interface, and the program pointer reads the historical record data stored in the database piece by piece. For each read record, the module first parses the timestamp value and the position coordinate information of the physical node carried by the record, quickly calculates the unique grid index number corresponding to the time and space coordinates in the full life cycle space-time grid through the hash mapping algorithm, and accurately locks the target discretized grid unit. Then the module extracts the air temperature value, relative humidity value, light intensity value and environmental oxygen concentration value from the service payload of the database record, and encapsulates them as a multi-dimensional feature vector. The module writes the multi-dimensional feature vector into the storage attribute domain inside the locked discretized grid unit. If multiple discrete sampling points are mapped in the same grid unit, the module calculates the arithmetic mean of these sampling points as the final attribute value of the grid unit, ensuring that each non-empty grid unit carries the real environmental state data of the preservative in the space-time range.

[0025] The geometric centers of the discretized grid units with filled attribute values in the full life cycle space-time grid are extracted in chronological order, and the consecutive geometric center points are smoothly connected using a cubic spline interpolation algorithm to generate a real-time state trajectory model representing the space-time evolution of the preservative environmental state. The specific method includes: The processor starts the full grid scanning program to perform layer-by-layer traversal and retrieval on the full life cycle space-time grid constructed in the memory, and focuses on checking the data storage state flag bit in each discretized grid unit. Identify those non-empty grid units that have successfully written environmental parameters and position information and mark them as valid data nodes. After completing the global screening operation, the processor reads the time axis coordinate values of all valid data nodes as the basis for sorting, and uses the quicksort algorithm or the merge sort algorithm to rearrange these nodes, ensuring that all nodes strictly follow the order from small to large according to time to form a linear logical queue. After this processing step, the scattered data in the multi-dimensional space structure is integrated into an effective grid sequence with a clear time sequence, and each element in the sequence represents the real physical state of the preservative at a specific historical time, laying a ordered data foundation for the subsequent geometric center calculation and trajectory fitting work.

[0026] For each non-empty discretized grid cell in the effective grid sequence, the calculation module calls the parsing subroutine to read the boundary definition parameters of the cell in the multi-dimensional coordinate system, and obtains the starting coordinate value and the terminal coordinate value in the longitude direction, the latitude direction and the time axis direction, respectively. The calculation module uses the arithmetic average method to centralize the calculation of the three groups of boundary values, that is, the starting value and the terminal value are added and divided by 2, so as to accurately obtain the longitude coordinate, the latitude coordinate and the time point coordinate of the geometric center of the grid cell. Then the calculation module extracts the environmental attribute data such as air temperature value, relative humidity value, light intensity value and environmental oxygen concentration value stored in the grid cell, and performs one-to-one deep binding with the calculated geometric center coordinates, so as to construct a discrete trajectory feature point in memory which contains accurate space-time position and rich environmental attributes. By executing this operation on all cells in the sequence, the originally volumetric grid data is abstractly converted into a series of high-precision vector point sets in multi-dimensional space.

[0027] The processor inputs the generated discrete trajectory feature point set as the basic anchor point into the preset cubic spline interpolation algorithm engine, and the algorithm engine constructs a linear equation set according to the coordinate difference and attribute difference between adjacent feature points, and solves the cubic polynomial function coefficients in each interval. In the solving process, the algorithm strictly follows the mathematical constraint condition to ensure that the generated interpolation function not only has equal function values at each feature point, but also has continuous and smooth tangent slopes represented by the first derivative and curvatures represented by the second derivative, avoiding sharp turning points. Based on the solved segmented cubic polynomial function, the processor calculates the interpolation coordinate data corresponding to the missing time between two adjacent discrete trajectory feature points according to the preset high-density sampling frequency. These interpolation data accurately fill in the data gaps during the sensor collection interval, so that the originally sparse discrete point set is expanded to a high-density continuous data stream.

[0028] The data processing module performs a merging operation on the original discrete trajectory feature points and the interpolation coordinate data generated by the algorithm, and concatenates these data points in the natural order of the time axis to depict a continuous path in the multi-dimensional virtual coordinate system. The path not only presents the physical movement trajectory of the preservative in the geographical space, but also presents the smooth curves of temperature, humidity and other parameters changing with time in the environmental attribute dimension. The module further optimizes the path by least squares method to eliminate possible small oscillation errors in the calculation process, and finally generates a smooth curve that perfectly reflects the space-time evolution law of the environmental state of the preservative from factory to delivery. The processor defines the high-dimensional curve containing space-time information and environmental attributes as a real-time state trajectory model, and stores it in the database in the form of vector graphics data or high-dimensional array as the core digital model for judging the quality evolution and traceability analysis of the preservative.

[0029] In one embodiment of the present application, in the deviation quantification module, the process of calculating the similarity distance between the real-time state trajectory model and the preset standard quality evolution curve by using the dynamic time warping algorithm, and quantifying the quality deviation index of the batch of preservatives according to the similarity distance, is as follows: The processor first retrieves the pre-set standard quality evolution curve from the memory, which records in detail the optimal trajectory of the environmental parameters of the preservatives changing over time under ideal conditions. At the same time, the processor also reads the real-time state trajectory model that has been constructed. In order to convert the two continuous analog signals into digital signals that can be processed by the computer, the processor sets a fixed time sampling step, for example, every 10 minutes as a sampling point, and performs high-density discrete sampling operation on the standard curve and the real-time trajectory model according to the step. For each sampling time, the processor extracts multi-dimensional values including air temperature, relative humidity, light intensity and environmental oxygen concentration, and arranges these values in chronological order. After this series of sampling processing, the original curves are converted into two characteristic sequences with specific lengths, which are the standard characteristic sequence representing the ideal state and the real-time characteristic sequence representing the actual situation. Each element in these two sequences is an environmental attribute vector containing four dimensions, thereby establishing the underlying sequence data basis required for mathematical distance calculation.

[0030] A cost matrix is constructed with the real-time characteristic sequence and the standard characteristic sequence as dimensions, and the Euclidean distance of the feature points in the real-time characteristic sequence and the feature points in the standard characteristic sequence in the multi-dimensional space is calculated one by one, and the Euclidean distance is filled as a unit value into the corresponding row and column nodes of the cost matrix. The specific method includes: First, read the header information of the real-time characteristic sequence data structure temporarily stored in the memory, obtain the total number of time sampling points contained in the sequence and assign it to the first integer variable as the row number parameter of the matrix, and read the header information of the standard characteristic sequence to obtain the total number of time sampling points contained in it and assign it to the second integer variable as the column number parameter of the matrix. According to the two read integer variable values, the processor allocates a continuous heap memory space in the dynamic random access memory, and the size of the space is exactly equal to the product of the row number parameter, the column number parameter and the number of bytes occupied by a single-precision floating-point number. On the basis of this memory space, the processor constructs a logical two-dimensional array structure, and initializes each cell in the two-dimensional array, usually setting its initial value to infinity or a specific marker value to prevent residual garbage data in the memory from interfering with the calculation results, thereby defining a row and column explicit and internally not filled with effective distance values of the to-be-filled empty cost matrix, providing a standard container carrier for the following comprehensive distance measurement calculation.

[0031] The computing module initiates a double-layer loop traversal logic to perform a global scan on the constructed vacancy cost matrix. The outer loop control variable is incremented from 0 to the row number minus 1 to traverse each row index, and the inner loop control variable is incremented from 0 to the column number minus 1 to traverse each column index, so as to access each grid cell in the matrix one by one. For the specific combination of the current traversed row index and column index, the computing module uses the row index as a pointer offset to address the real-time feature sequence, accurately retrieves and extracts the multi-dimensional environmental attribute vector composed of air temperature, relative humidity, light intensity and oxygen concentration corresponding to this time. At the same time, the computing module uses the column index as a pointer offset to address the standard feature sequence synchronously, retrieves and extracts the multi-dimensional environmental attribute vector corresponding to this time of the standard curve. The computing module loads the two extracted vector data into the cache register and locks it as a pair of feature vectors for the current calculation period, ensuring the accuracy of the data source and the uniqueness of the corresponding relationship when performing numerical operations.

[0032] The operation unit performs numerical operations on the locked pair of feature vectors according to the preset multi-dimensional spatial Euclidean distance calculation formula. The specific process is to calculate the numerical difference of the two vectors in the temperature dimension, humidity dimension, light dimension and oxygen concentration dimension respectively, sum the squared values of the differences in the four dimensions, and finally take the arithmetic square root of the sum to obtain a non-negative floating-point value. This value represents the Euclidean distance between the real-time sampling point and the standard sampling point in the multi-dimensional feature space. The operation unit writes the calculated Euclidean distance value into the grid cell address pointed to by the current row index and the current column index in the vacancy cost matrix through the memory bus, covering the original initialization value. With the continuous execution of the double-layer loop, the operation unit will repeat the above calculation and writing steps until the last row and the last column of the grid cell in the matrix are filled. At this time, the originally vacant two-dimensional array in the memory is transformed into a fully numerically filled cost matrix, which records the local similarity distance information of the real-time trajectory and the standard curve at all possible time alignment points.

[0033] The dynamic programming strategy is applied to the constructed cost matrix for deep search and path optimization, aiming to find a regular path from the starting point in the lower left corner of the matrix to the ending point in the upper right corner. In the search process, the algorithm strictly follows three core constraints, namely, the boundary condition requires that the path must start at the first time point and end at the last time point, the continuity constraint requires that the path can only move to adjacent grid cells and cannot jump, and the monotonicity constraint requires that the path must maintain a non-decreasing trend in the time axis direction to prevent time reversal. The processor recursively calculates the cumulative distance of each grid cell based on the state transition equation, which is the Euclidean distance of the current cell plus the cumulative distance of the smallest one of its left, bottom or lower left neighbor cells. When the calculation advances to the end point position of the matrix, the cumulative value stored in the end point represents the total distance of the entire regular path. The processor determines the minimum cumulative value after nonlinear alignment in the time axis as the similarity distance between the real-time state trajectory model and the standard quality evolution curve.

[0034] The similarity distance value obtained by the above calculation steps is input into the internal preset exponential normalization function operation logic for conversion processing. The operation logic usually uses a mathematical model in the form of a negative exponential, which performs nonlinear mapping operation on the input distance value through a specific decay coefficient, compressing and mapping the originally wide range of absolute distance to the closed interval range of 0 to 1. In this mapping relationship, the smaller the distance value, the closer the output result is to 0, representing a very low degree of quality deviation, and the larger the distance value, the closer the output result is to 1, representing a very high degree of quality deviation. The processor directly defines the relative value obtained after this conversion as the quality deviation index of the batch of preservatives, which can quantitatively reflect the difference between the environmental history experienced by the current batch of products in the circulation process and the ideal standard in the form of a standardized percentage.

[0035] In one embodiment of the present application, when the quality deviation index exceeds the system's preset safety threshold in the early warning control module, the electronic file of the batch of preservatives in the database is automatically locked, and a warning signal containing the abnormal node position and the risk type is immediately sent to the monitoring terminal. The quality deviation index value generated by the previous stage calculation is read from the memory register, and the preset safety threshold parameter is called from the read-only memory, which is usually set to an empirical value of 0.15 or 0.20. The comparison unit loads the two values into the arithmetic logic unit for size comparison operation. When the operation result shows that the current quality deviation index value is strictly greater than the preset safety threshold value, the processor immediately determines that the batch of preservatives has a major quality risk. At this time, the processor generates a high-priority database control instruction, which is sent to the management interface of the non-relational database through the internal bus. The instruction contains the unique index key value of the specific batch of preservative electronic archives and the permission modification parameter. After receiving the instruction, the database management engine quickly locates the corresponding document record on the storage medium, and forcibly updates the access control list in the metadata attribute of the document. The originally open read-write permission is modified to a strict read-only state or an abnormal frozen state. This operation is completed within milliseconds, aiming to prevent external programs from continuing to write new regular flow data to the archive, thereby ensuring the originality and tamper resistance of the on-site accident data, preserving the most authentic electronic evidence on site for future quality accident investigation, and also marking the batch of products entering the abnormal control process.

[0036] At the same time of completing the archive locking operation, the analysis module starts the backtracking algorithm to reverse scan the optimal warping path generated in the dynamic time warping calculation process, which records all the node correspondence relationships of real-time trajectories and standard curves. The analysis module reads the Euclidean distance values of each alignment point pair on the path one by one, and selects the alignment point pair with the largest local distance value through bubble sorting or direct comparison method. The time-space coordinates of the corresponding discretized grid unit are determined as the specific node position of the abnormal occurrence. Then the analysis module extracts the real-time environmental parameter vector and the standard environmental parameter vector at the abnormal node position, and calculates the absolute difference values of air temperature, relative humidity, light intensity and environmental oxygen concentration between the two vectors. The analysis module compares the sizes of the four difference values, and marks the environmental parameter with the largest difference amplitude as the main risk type causing the quality deviation, for example, if the temperature difference is the largest, it is determined as a temperature abnormal risk. The analysis module standardizes the encoding of the latitude and longitude coordinates, timestamp information and determined risk type text code, and packages them according to the pre-defined communication protocol format to generate a digital early warning signal data packet containing complete fault diagnosis information, ready for sending through the network layer.

[0037] The communication control unit calls the on-board wireless network communication module, initiates a connection request to the cloud server or the designated monitoring terminal through TCP or IP protocol stack, and establishes a safe and stable encrypted transmission link through three-way handshake. Once the link is successfully connected, the control unit immediately pushes the digital early warning signal data packet generated in the buffer area into the sending queue, and uses 4G or 5G mobile network and industrial Ethernet to transmit the data to the remote monitoring terminal device at high speed. The receiving program of the monitoring terminal immediately starts the unpacking and analysis subprogram after detecting the incoming data stream, strips the header and check bits of the data packet according to the communication protocol, and restores the core abnormal node position coordinates and risk type description text. The terminal's graphical user interface rendering engine is triggered, which calls the map component to mark the abnormal position's latitude and longitude coordinates on the corresponding layer of the electronic map, and flashes with a prominent red highlight icon for warning. At the same time, the interface engine will display the specific risk type information in the pop-up floating window, such as high temperature alarm or humidity exceeding the standard, so as to intuitively assist the supervisor to master the location and cause of the problem in the first time, and realize the seamless connection from automatic monitoring to manual intervention.

[0038] The above describes one embodiment of the present application in detail, but the content described is only the preferred embodiment of the present application, and cannot be considered as limiting the scope of the present application. Any equivalent changes and improvements made according to the scope of the present application should still belong to the scope of the present application.

Claims

1. A food preservative traceability system based on the entire industry chain, characterized by, The application relates to a food fresh-keeping agent traceability system. The information acquisition module is used for fixedly arranging sensor devices and radio frequency identification read-write devices on physical nodes in the raw material preparation, finished product production, storage and logistics transportation links of food fresh-keeping agents, and collecting the identity codes of the fresh-keeping agent batches and the corresponding environmental parameters of the nodes in real time; The transmission and storage module is used for uploading the collected identity codes and environmental parameters to a central control server through a narrowband Internet of Things communication module of the sensor device, and storing the data in a non-relational database after the data is cleaned and marked with a unified timestamp by the central control server; The trajectory construction module is used for mapping the continuous environmental parameters to a full life cycle space-time grid of the fresh-keeping agent according to the timestamp sequence, constructing a real-time state trajectory model of the batch of fresh-keeping agents in the circulation process, and forming visual traceability link data; The deviation quantification module is used for calculating the similarity distance between the real-time state trajectory model and a preset standard quality evolution curve by using a dynamic time warping algorithm, and generating a quality deviation index of the batch of fresh-keeping agents according to the similarity distance; The early warning and control module is used for automatically locking the electronic archives of the batch of fresh-keeping agents in the database when the quality deviation index exceeds a safety threshold preset by the system, and immediately sending a warning signal containing an abnormal node position and a risk type to a supervision terminal.

2. The food preservative traceability system based on the whole industry chain according to claim 1, characterized in that, In the information acquisition module, the environmental parameters include the air temperature value, the relative humidity value, the light intensity value and the environmental oxygen concentration value of the current physical node. 3.The food preservative traceability system based on the whole industry chain according to claim 1, characterized in that, In the transmission and storage module, the process of cleaning the data by the central control server, marking the data with a unified timestamp and storing the data in a non-relational database is as follows: The central control server receives the identity codes and environmental parameters, detects the data packet field integrity and numerical logic range by using a verification algorithm, directly removes invalid data containing null values and format errors, and extracts valid business payload data in a preset format; The central control server calls a local system clock to obtain a standard time of the current receiving time, defines the standard time as a unique timestamp and binds the unique timestamp to the valid business payload data, and generates a structured data object with strict time attributes; The central control server establishes a connection channel with the non-relational database through an application program interface, serializes the structured data object into a key-value pair format, and writes the key-value pair format into the storage node of the non-relational database according to the timestamp index sequence.

4. The food preservative traceability system based on the whole industry chain according to claim 1, characterized in that, In the trajectory construction module, the process of mapping the continuous environmental parameters to the full life cycle space-time grid of the fresh-keeping agent according to the timestamp sequence, and constructing the real-time state trajectory model of the batch of fresh-keeping agents in the circulation process is as follows: A multi-dimensional coordinate system is established by taking the geographical coordinates of the fresh-keeping agent circulation path as a space axis and taking a circulation time sequence as a time axis, the multi-dimensional coordinate system is divided into discrete grid units with fixed space-time resolution, and a full life cycle space-time grid covering the whole link is generated; The non-relational database is traversed, the corresponding discrete grid unit in the full life cycle space-time grid is locked according to the timestamp index and the physical node position, the air temperature value, the relative humidity value, the light intensity value and the environmental oxygen concentration value are extracted, and the values are filled into the discrete grid unit as multi-dimensional attribute data; The geometric centers of the discrete grid cells filled with attribute values in the full life cycle space-time grid are extracted in chronological order, and the geometric centers are connected smoothly by using a cubic spline interpolation algorithm to generate a real-time state trajectory model representing the space-time evolution of the preservative environment state.

5. The food preservative traceability system based on the whole industry chain according to claim 4, characterized in that, The specific way of generating the real-time state trajectory model representing the space-time evolution of the preservative environment state is: Scan the full life cycle space-time grid, identify and filter out non-empty discrete grid cells filled with multi-dimensional attribute data, arrange the filtered non-empty discrete grid cells in ascending order according to the time axis coordinate values, and generate a time-sequential effective grid sequence; Analyze the spatial coordinate range and time span of each non-empty discrete grid cell in the effective grid sequence, calculate the arithmetic mean of the spatial dimension and the time dimension to obtain the geometric center coordinates, and bind the multi-dimensional attribute data to the geometric center coordinates to form discrete trajectory feature points; Input the discrete trajectory feature points as nodes into the cubic spline interpolation algorithm, construct a piecewise cubic polynomial function that satisfies the equal function value at the nodes and the continuity of the first and second derivatives, and calculate the interpolation coordinate data of the missing time between adjacent discrete trajectory feature points; Connect the discrete trajectory feature points and the interpolation coordinate data, and fit a continuous and smooth time series curve in the multi-dimensional coordinate system to generate a real-time state trajectory model representing the space-time evolution of the preservative environment state.

6. The food preservative traceability system based on the whole industry chain according to claim 1, characterized in that, In the deviation quantification module, the process of calculating the similarity distance between the real-time state trajectory model and the preset standard quality evolution curve using the dynamic time warping algorithm, and quantifying the quality deviation index of the batch of preservatives according to the similarity distance is: Extract the preset standard quality evolution curve, discretely sample it with the real-time state trajectory model according to a fixed time step, generate a standard feature sequence and a real-time feature sequence containing multi-dimensional environmental attribute values, and establish a sequence data basis for distance calculation; Construct a cost matrix with the real-time feature sequence and the standard feature sequence as dimensions, calculate the Euclidean distance between the feature points in the real-time feature sequence and the feature points in the standard feature sequence in multi-dimensional space one by one, and fill the Euclidean distance as a unit value into the corresponding row and column nodes of the cost matrix; Apply a dynamic programming strategy to search for a warping path with the smallest cumulative value in the cost matrix. The warping path strictly follows the boundary conditions, continuity and monotonicity constraints. Determine the smallest cumulative value of the warping path as the similarity distance between the real-time state trajectory model and the standard quality evolution curve; Input the calculated similarity distance into the pre-set exponential normalization function, convert the absolute distance value to a relative value in the closed interval of 0 to 1 through function mapping operation, and directly define the relative value as the quality deviation index of the batch of preservatives.

7. The food preservative traceability system based on the whole industry chain according to claim 6, characterized in that, The specific way of constructing a cost matrix with the real-time feature sequence and the standard feature sequence as dimensions, calculating the Euclidean distance between the feature points in the real-time feature sequence and the feature points in the standard feature sequence in multi-dimensional space one by one, and filling the Euclidean distance as a unit value into the corresponding row and column nodes of the cost matrix is: The total number of time sampling points contained in the real-time feature sequence is read as the number of rows of the matrix, the total number of time sampling points contained in the standard feature sequence is read as the number of columns of the matrix, and a two-dimensional array structure is opened in the memory to construct a corresponding storage space, and the two-dimensional array structure is defined as an empty cost matrix to be filled; According to the row index and the column index, each grid cell of the empty cost matrix is traversed, and a plurality of multi-dimensional environmental attribute vectors corresponding to the current row index in the real-time feature sequence and a plurality of multi-dimensional environmental attribute vectors corresponding to the current column index in the standard feature sequence are retrieved respectively, and a group of feature vector pairs for comparison are locked; According to the multi-dimensional space distance calculation formula, the Euclidean distance value between the group of feature vector pairs is calculated, and the Euclidean distance value is written into the grid cell pointed by the current row index and the current column index in the empty cost matrix, until the traversal is completed and the cost matrix filled with all values is generated. 8.The food preservative traceability system based on the whole industry chain according to claim 1, characterized in that, In the early warning control module, when the quality deviation index exceeds the system preset safety threshold, the electronic file of the batch of preservatives in the database is automatically locked, and a warning signal containing the abnormal node position and the risk type is immediately sent to the supervision terminal. The calculated quality deviation index is compared with the system preset safety threshold, and when the quality deviation index value is greater than the safety threshold value, the database locking instruction is executed to modify the write permission of the electronic file of the batch of preservatives in the non-relational database to the read-only state; The coordinates of the discretized grid cell with the maximum local distance value in the dynamic time warping path are taken as the abnormal node position, the environmental parameter name with the maximum difference amplitude from the standard feature sequence at the position is selected as the risk type, and the abnormal node position and the risk type data are packaged to generate a digital warning signal; The transmission link with the specified supervision terminal is established by using the network communication module, the generated digital warning signal is sent to the supervision terminal, and the supervision terminal is triggered to decode the data packet and display the specific abnormal node position and risk type information on the interactive interface.

Citation Information

Patent Citations

  • Crack damage quantitative detection method based on dynamic time normalizing correlation characteristics

    CN111208142A

  • Virtual DPU power plant simulation fault restoration method and system based on digital twinning

    CN120124471A

  • Agricultural whole industry chain tracing method and system based on big data

    CN120181877A

  • Biomass power generation efficiency optimization method based on data driving

    CN120216958A

  • Visual traceability processing method and system for food deterioration data

    CN120494852A