A cake production whole-process traceability management system technology method based on internet of things
By collecting process parameter data during the pastry production process, a time series prediction model and a dynamic neighborhood constraint structure are constructed. Combined with the local outlier factor algorithm, the problem of insufficient anomaly identification in the existing traceability system is solved, and traceability management with high accuracy and reliability is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI QIAONONG FOOD TECH CO LTD
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-12
AI Technical Summary
Existing pastry production traceability systems lack the ability to continuously analyze production process data, making it difficult to dynamically identify abnormal production nodes and time intervals, resulting in insufficient accuracy and reliability of traceability information.
By collecting production process parameter data at each stage of pastry production, a Prophet time series prediction model and a dynamic neighborhood constraint structure are constructed. Combined with an improved local outlier factor algorithm, abnormal production nodes and time intervals are identified, and a full-process traceability record is generated.
It enables the correlation management and anomaly monitoring of data throughout the entire pastry production process, improves the completeness of traceability information and the accuracy of anomaly identification, and enhances the traceability of the production process.
Smart Images

Figure CN122198591A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of food production process management and data analysis technology, and in particular to a technology and method for a traceability management system for the entire process of pastry production based on the Internet of Things. Background Technology
[0002] With the continuous improvement of the food safety supervision system and the development of digital management in food production, data collection and traceability management based on Internet of Things (IoT) technology has become an important technical means in the food processing industry. In the pastry production process, manufacturers typically deploy environmental sensing devices or production management systems at production nodes to record raw material information, production process parameters, and production batch information, thereby achieving product traceability and production process supervision.
[0003] Existing traceability systems for pastry production still have significant shortcomings. On the one hand, traditional traceability systems mainly rely on manual input or simple equipment to record production data, lacking the ability to continuously analyze production process data. They struggle to dynamically model and identify anomalies in production process parameters such as temperature, humidity, processing time, and equipment operating status, making it difficult to detect potential quality risks in a timely manner. On the other hand, existing traceability technologies typically only store and query production data, lacking in-depth analysis of the relationships between data points. Especially when abnormal fluctuations occur in production data, they cannot accurately identify abnormal production nodes and time intervals through data analysis methods, thus affecting the accuracy and reliability of traceability information. Furthermore, traditional anomaly detection methods are mostly based on fixed neighborhoods or static parameters for data analysis, making it difficult to adapt to the dynamic characteristics of production process parameters changing over time, easily leading to insufficient anomaly identification accuracy.
[0004] Therefore, how to provide a technology for a traceability management system for the entire pastry production process based on the Internet of Things is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a technology and method for a traceability management system for the entire pastry production process based on the Internet of Things (IoT). This invention collects production process parameter data at each node of pastry production, constructs time-series data of these parameters, and uses the Prophet time-series prediction model to generate predicted production parameter sequences and prediction deviation sequences. Simultaneously, a dynamic neighborhood constraint structure is constructed based on the prediction deviation sequences, and an improved local outlier factor algorithm is used to identify anomalies in the production data. Abnormal production nodes and abnormal time intervals are associated with traceability codes to generate a full-process traceability record. This achieves associated management and anomaly monitoring of the entire pastry production process, possessing advantages such as high traceability information integrity, high anomaly identification accuracy, and strong traceability of the production process.
[0006] According to an embodiment of the present invention, a technology method for a traceability management system for the entire process of pastry production based on the Internet of Things includes the following steps: A unique raw material batch identifier is generated for each batch of raw materials entering the production process and written into an RFID tag. At the same time, raw material batch data corresponding to the raw material batch identifier is established on the traceability platform. Temperature, humidity, processing time, and equipment operating status data are collected at the production nodes of ingredient preparation, molding, baking, and packaging. The collected data is then processed for time synchronization and unified encoding to generate time series data of production process parameters for the corresponding production batch. A unique traceability code is generated for each production batch, and a data association structure is established with the traceability code as an index to associate and store raw material batch data with time series data of production process parameters. A Prophet time series prediction model is constructed based on the time series data of production process parameters, generating a production parameter prediction sequence for the corresponding time window, and calculating the prediction deviation sequence based on the time series data of production process parameters and the production parameter prediction sequence. A dynamic neighborhood constraint structure is constructed on the time series data of production process parameters using the prediction deviation sequence. Under the dynamic neighborhood constraint structure, an improved local outlier factor algorithm is used to identify anomalies in the time series data of production process parameters, thereby obtaining abnormal production nodes and abnormal time intervals. The abnormal production nodes and abnormal time intervals are associated with the corresponding traceability codes and written into the data association structure. Based on the data association structure, the full-process traceability record of the corresponding production batch is generated.
[0007] Optionally, the establishment of raw material batch data includes: collecting information on the raw material name, supplier identifier, purchase batch number, purchase time, and raw material category of the raw materials entering the production process; standardizing the fields of the collected raw material information to generate structured raw material information data; generating corresponding raw material batch identifiers based on the structured raw material information data; writing the generated raw material batch identifiers into the storage area of RFID tags; reading and verifying the RFID tags with the written raw material batch identifiers to obtain RFID tag identification data corresponding to the raw material batch identifiers; matching and verifying the RFID tag identification data with the structured raw material information data; and uploading the raw material batch identifiers and structured raw material information data to the traceability platform after successful matching and verification; the traceability platform establishes a corresponding data index based on the uploaded raw material batch identifiers and stores the structured raw material information data under the data index to generate raw material batch data.
[0008] Optionally, the generation of the time series data of the production process parameters includes: Data on ambient temperature, humidity, raw material mixing duration, and equipment operation status of the batching area are collected at the batching production node. Data on ambient temperature, humidity, molding duration, and equipment operation status of the molding area are collected at the molding production node. Data on oven temperature, humidity, baking duration, and equipment operation status of the baking oven are collected at the baking production node. Data on ambient temperature, humidity, packaging duration, and equipment operation status of the packaging area are collected at the packaging production node. The temperature, humidity, processing time, and equipment operation status data collected from each production node are then used to form the original process parameter data for the corresponding production node. Add acquisition time stamps to the raw process parameter data generated at each production node to obtain production node data records containing time stamps, and perform time synchronization processing on the time stamps in the data records of each production node according to a unified time benchmark. Add production batch and production node identifiers to the data records that have completed time synchronization. Perform unified field ordering and field coding on the temperature, humidity, processing time and equipment operating status data in the data records to generate production node coded data records. The coded data records of production nodes are arranged in chronological order according to the time stamp, and the coded data records of the ingredient production node, molding production node, baking production node and packaging production node are sequentially integrated to form a continuous data record sequence, generating time series data of production process parameters for the corresponding production batch.
[0009] Optionally, the generation of the unique traceability code and the establishment of the data association structure include: Obtain the production batch identifier and retrieve the raw material batch data corresponding to the production batch identifier from the traceability platform, while also obtaining the time series data of the production process parameters for the corresponding production batch. A unique traceability code is generated for the corresponding production batch based on the production batch identifier, and the generated unique traceability code is written into the traceability code data record in the traceability platform; In the traceability platform, a data association structure is established using a unique traceability code as an index identifier, and a data record unit corresponding to the unique traceability code is created in the data association structure. The raw material batch data obtained from the call is written into the data record unit corresponding to the unique traceability code, and the raw material batch data and the unique traceability code form a first association record; After the raw material batch data is written, the production process parameter time series data is written into the data record unit corresponding to the same unique traceability code. The production process parameter time series data and the raw material batch data form an associated data record under the same unique traceability code index. After completing the association writing of raw material batch data and production process parameter time series data, the data record unit corresponding to the unique traceability code is saved, forming a production batch association data record indexed by the unique traceability code in the data association structure.
[0010] Optionally, the calculation of the prediction bias sequence includes: Obtain the time series data of the production process parameters for the corresponding production batch, and extract the temperature, humidity, processing time and equipment operating status data corresponding to each time point according to the time mark order to form the production parameter observation sequence for the corresponding production batch. The time stamps in the production parameter observation sequence are converted to a unified time format, and the production parameter data with missing time points are filled in by time neighborhood processing. Abnormal data collection is removed to obtain standardized production parameter time series data. Standardized production parameter time series data are input into the Prophet time series forecasting model. A time series index is built on the standardized production parameter time series data according to the time stamp. Based on the time series index, trend term modeling, period term modeling and residual term modeling are performed on the production parameter time series data to obtain the production parameter forecasting model for the corresponding production batch. A production parameter prediction model is used to perform time series prediction on standardized production parameter time series data. Based on the time markers in the standardized production parameter time series data, a production parameter prediction sequence for the corresponding time point is generated. Based on the production parameter observation sequence and the production parameter prediction sequence, data matching is performed at the same time mark. The production parameter observation value and the production parameter prediction value corresponding to the same time mark are formed into observation-prediction data pairs. The difference between the observation-prediction data pairs is calculated to obtain the prediction deviation value at the corresponding time point. The predicted deviation values obtained at each time point are arranged according to the time stamp order to generate the predicted deviation sequence for the corresponding production batch.
[0011] Optionally, the construction of the dynamic neighborhood constraint structure includes: Obtain time series data of production process parameters and obtain the prediction deviation sequence; The production process parameter time series data and the prediction deviation sequence are time-aligned according to the time stamp order, so that the parameter records at each time point in the production process parameter time series data correspond to the prediction deviation values in the prediction deviation sequence, and a deviation data record containing time stamps, parameter records and prediction deviation values is generated. The neighborhood constraint coefficients of the parameter records at each time point are calculated based on the predicted deviation values in the deviation data records, and the neighborhood constraint coefficients are written into the corresponding time point parameter records to generate extended parameter records containing the predicted deviation values and neighborhood constraint coefficients. The neighborhood constraint range of each time point parameter record is determined based on the neighborhood constraint coefficient in the extended parameter record, and the neighborhood constraint range is written into the corresponding extended parameter record to generate a neighborhood constraint data record containing the neighborhood constraint range. Based on the neighborhood constraint range in the neighborhood constraint data record, determine the neighborhood data set corresponding to the parameter record at each time point in the production process parameter time series data, and generate the corresponding neighborhood data record; The extended parameter records are associated and organized with the corresponding neighborhood data records to form a dynamic neighborhood constraint structure that includes time stamps, parameter records, prediction deviation values, neighborhood constraint coefficients, and neighborhood data sets.
[0012] Optionally, the improved local outlier factor algorithm includes: Obtain the dynamic neighborhood constraint structure, and extract extended parameter records from the dynamic neighborhood constraint structure, including time stamps, parameter records, prediction bias values, neighborhood constraint coefficients, and neighborhood data sets; Based on the prediction deviation value in the extended parameter record, the neighborhood data set corresponding to the extended parameter record is reconstructed. By constructing a neighborhood size parameter driven by prediction deviation, the neighborhood data set corresponding to each extended parameter record is redefined according to the prediction deviation value, and the reconstructed neighborhood data set is generated. The parameter distance values between the extended parameter records and each parameter record in the neighborhood data set are calculated based on the reconstructed neighborhood data set, and the reachable distance data corresponding to each extended parameter record is determined based on the calculated parameter distance values. The local reachability density corresponding to the extended parameter record is calculated based on the reachability distance data and the reconstructed neighborhood data set. During the local reachability density calculation process, the prediction deviation value in the extended parameter record is coupled with the prediction deviation value corresponding to the parameter record in the neighborhood data set, so that the prediction deviation difference participates in the local reachability density calculation, and local reachability density data containing the prediction deviation coupling result is generated. The coupling process includes calculating the difference between the prediction deviation value in the extended parameter record and the prediction deviation value corresponding to each parameter record in the neighborhood data set, and using the obtained deviation difference in the local reachability density calculation process to adjust the density relationship between the corresponding parameter records. Calculate the local outlier factor value corresponding to the extended parameter record based on the local reachability density data, and form local outlier factor data corresponding to the extended parameter record; Anomalies are determined for extended parameter records based on the local outlier data, and extended parameter records with local outlier values exceeding a preset threshold are identified as abnormal parameter records. Abnormal production nodes and abnormal time intervals are determined based on the timestamps corresponding to the abnormal parameter records.
[0013] Optionally, the generation of the full-process traceability record for the corresponding production batch includes: obtaining the abnormal production node, abnormal time interval, and unique traceability code; locating the data record unit of the corresponding production batch in the established data association structure based on the unique traceability code; writing the abnormal production node and abnormal time interval into the data record unit; forming an abnormal record with the abnormal production node, abnormal time interval, and unique traceability code; after completing the writing of the abnormal record, reading the raw material batch data and production process parameter time series data already associated and stored in the data record unit of the corresponding production batch in the data association structure based on the unique traceability code; associating and integrating the abnormal record with the raw material batch data and production process parameter time series data to generate a data set containing raw material batch data, production process parameter time series data, and abnormal record; sorting the production process parameter time series data according to the time stamp order based on the data set; and inserting the abnormal record corresponding to the time stamp into the sorted production process parameter time series data to generate the full-process traceability record for the corresponding production batch.
[0014] The beneficial effects of this invention are: This invention deploys an Internet of Things (IoT) data collection mechanism at various production stages of pastry production, including ingredient preparation, shaping, baking, and packaging. This mechanism continuously collects data on temperature, humidity, processing time, and equipment operating status, generating time-series data of production process parameters. Simultaneously, it generates a unique traceability code for each production batch and establishes a data association structure. This enables the associated storage of raw material batch data and time-series data of production process parameters, achieving unified management and traceability of data throughout the entire pastry production process.
[0015] This invention constructs a Prophet time series prediction model to model the trend, periodic, and residual terms of time series data of production process parameters, generates a production parameter prediction sequence, and calculates the prediction deviation sequence. This enables dynamic prediction and analysis of changes in production process parameters, provides a data foundation for identifying anomalies in the production process, and improves the continuity and accuracy of production process data analysis.
[0016] This invention utilizes a predicted deviation sequence to construct a dynamic neighborhood constraint structure, and on this basis, introduces an improved local outlier factor algorithm to reconstruct the neighborhood scale and calculate the density of time series data of production process parameters. This enables accurate identification of abnormal production nodes and abnormal time intervals, and associates the abnormal information with the traceability code and writes it into the data association structure to generate a full-process traceability record for the corresponding production batch. This improves the ability to identify anomalies in the pastry production process and the traceability of production information. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a technology method for a traceability management system for the entire pastry production process based on the Internet of Things, as proposed in this invention. Figure 2 This is a schematic diagram illustrating the process of anomaly identification using the improved local outlier factor algorithm in this invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0019] refer to Figures 1-2 A technology and method for a traceability management system for the entire pastry production process based on the Internet of Things includes the following steps: A unique raw material batch identifier is generated for each batch of raw materials entering the production process and written into an RFID tag. At the same time, raw material batch data corresponding to the raw material batch identifier is established on the traceability platform. Temperature, humidity, processing time, and equipment operating status data are collected at the production nodes of ingredient preparation, molding, baking, and packaging. The collected data is then processed for time synchronization and unified encoding to generate time series data of production process parameters for the corresponding production batch. A unique traceability code is generated for each production batch, and a data association structure is established with the traceability code as an index to associate and store raw material batch data with time series data of production process parameters. A Prophet time series prediction model is constructed based on the time series data of production process parameters, generating a production parameter prediction sequence for the corresponding time window, and calculating the prediction deviation sequence based on the time series data of production process parameters and the production parameter prediction sequence. A dynamic neighborhood constraint structure is constructed on the time series data of production process parameters using the prediction deviation sequence. Under the dynamic neighborhood constraint structure, an improved local outlier factor algorithm is used to identify anomalies in the time series data of production process parameters, thereby obtaining abnormal production nodes and abnormal time intervals. The abnormal production nodes and abnormal time intervals are associated with the corresponding traceability codes and written into the data association structure. Based on the data association structure, the full-process traceability record of the corresponding production batch is generated.
[0020] In this embodiment, the establishment of raw material batch data includes: collecting information on the raw material name, supplier identifier, purchase batch number, purchase time, and raw material category of the raw materials entering the production process; standardizing the fields of the collected raw material information to generate structured raw material information data; generating corresponding raw material batch identifiers based on the structured raw material information data; writing the generated raw material batch identifiers into the storage area of RFID tags; reading and verifying the RFID tags with the written raw material batch identifiers to obtain RFID tag identification data corresponding to the raw material batch identifiers; matching and verifying the RFID tag identification data with the structured raw material information data; and uploading the raw material batch identifiers and structured raw material information data to the traceability platform after successful matching and verification. The traceability platform establishes a corresponding data index based on the uploaded raw material batch identifiers and stores the structured raw material information data under the data index to generate raw material batch data. Field standardization processing includes uniformly converting the collected raw material name, supplier identifier, purchase batch number, purchase time and raw material category information into a unified field format, unifying coding rules and time format processing, and generating structured raw material information data with consistent field structure; The storage area of the RFID tag is a read-write storage space inside the RFID chip used to store data. It is used to write and save raw material batch identification data and supports data writing and reading operations through RFID reading and writing devices. The read verification includes rereading the RFID tag with the raw material batch identifier written in it using an RFID reader / writer device, and comparing the read result with the original raw material batch identifier to confirm that the written data is correctly stored in the RFID tag. Matching verification involves comparing the raw material batch identifier in the RFID tag identification data with the raw material batch identifier in the structured raw material information data. When the two identifiers match, the data match is confirmed to be valid. The traceability platform is an information management system used to store, manage, and retrieve raw material batch data, production process parameter time series data, and traceability code associated data. It is used to establish data indexes and realize the recording and querying of data throughout the entire production batch process.
[0021] In this embodiment, the generation of the time series data of the production process parameters includes: Data on ambient temperature, humidity, raw material mixing duration, and equipment operation status of the batching area are collected at the batching production node. Data on ambient temperature, humidity, molding duration, and equipment operation status of the molding area are collected at the molding production node. Data on oven temperature, humidity, baking duration, and equipment operation status of the baking oven are collected at the baking production node. Data on ambient temperature, humidity, packaging duration, and equipment operation status of the packaging area are collected at the packaging production node. The temperature, humidity, processing time, and equipment operation status data collected from each production node are then used to form the original process parameter data for the corresponding production node. The original process parameter data generated at each production node is appended with a collection time stamp to obtain production node data records containing time stamps. The time stamps in the data records of each production node are then synchronized according to a unified time benchmark, so that the data records of the ingredient production node, molding production node, baking production node and packaging production node have a unified time identifier. Additional data acquisition timestamps include writing the corresponding data acquisition time timestamp into each original process parameter data record, and binding the timestamp with temperature, humidity, processing time and equipment operating status data to form a data record containing time information; A unified time base is a standard time source used to align the collection times of each production node. By using the same time reference value for time identification of data records of the ingredient preparation, forming, baking and packaging production nodes, the data of each node has a consistent time reference. Time synchronization processing includes correcting the time stamps in the data records of each production node according to a unified time reference, converting the acquisition time of different nodes into a unified time coordinate, and updating the time stamps in the data records according to a unified time format; Add production batch and production node identifiers to the data records that have completed time synchronization. Perform unified field ordering and field coding on the temperature, humidity, processing time and equipment operating status data in the data records to generate production node coded data records. The additional production batch identifier and production node identifier include writing the corresponding production batch identifier and the production node identifier of the current data source into the data record that is processed by completion time synchronization, so that each data record contains both production batch information and production node source information. The unified field order arrangement and field encoding process includes arranging production batch identifier, production node identifier, time stamp, temperature, humidity, processing time and equipment operating status data in a preset field order, and converting the format of each field according to a unified encoding rule to form a data record with a consistent structure. The coded data records of production nodes are arranged in chronological order according to the time stamp, and the coded data records of ingredient production nodes, molding production nodes, baking production nodes and packaging production nodes are sequentially integrated to form a continuous data record sequence, generating time series data of production process parameters for the corresponding production batch. The chronological order arrangement involves sorting the coded data records of each production node according to the timestamps in the data records, arranging the data records with earlier timestamps first and the data records with later timestamps last, so as to form a data sequence arranged continuously in time. Sequential integration involves merging data records from the ingredient preparation, molding, baking, and packaging production nodes into a single data sequence after completing the chronological arrangement, so that data records from different production nodes are arranged continuously under a unified chronological order.
[0022] In this embodiment, the generation of the unique traceability code and the establishment of the data association structure include: Obtain the production batch identifier and retrieve the raw material batch data corresponding to the production batch identifier from the traceability platform, while also obtaining the time series data of the production process parameters for the corresponding production batch. A unique traceability code is generated for the corresponding production batch based on the production batch identifier, and the generated unique traceability code is written into the traceability code data record in the traceability platform; In the traceability platform, a data association structure is established using a unique traceability code as an index identifier, and a data record unit corresponding to the unique traceability code is created in the data association structure. The raw material batch data obtained from the call is written into the data record unit corresponding to the unique traceability code, and the raw material batch data and the unique traceability code form a first association record; After the raw material batch data is written, the production process parameter time series data is written into the data record unit corresponding to the same unique traceability code. The production process parameter time series data and the raw material batch data form an associated data record under the same unique traceability code index. After completing the association writing of raw material batch data and production process parameter time series data, the data record unit corresponding to the unique traceability code is saved, forming a production batch association data record indexed by the unique traceability code in the data association structure.
[0023] In this embodiment, the calculation of the prediction deviation sequence includes: Obtain the time series data of the production process parameters for the corresponding production batch, and extract the temperature, humidity, processing time and equipment operating status data corresponding to each time point according to the time mark order to form the production parameter observation sequence for the corresponding production batch. The time stamps in the production parameter observation sequence are converted to a unified time format, and the production parameter data with missing time points are filled in by time neighborhood processing. Abnormal data collection is removed to obtain standardized production parameter time series data. Unified time format conversion includes converting various time markers into a unified time representation format; time neighborhood completion processing includes interpolating and filling missing time point data based on the production parameter data corresponding to adjacent time markers; abnormal data collection removal processing includes identifying and deleting collected data that exceeds a preset threshold range. Standardized production parameter time series data are input into the Prophet time series forecasting model. A time series index is built on the standardized production parameter time series data according to the time stamp. Based on the time series index, trend term modeling, period term modeling and residual term modeling are performed on the production parameter time series data to obtain the production parameter forecasting model for the corresponding production batch. Trend term modeling includes fitting long-term changes in production parameters based on time stamps; periodic term modeling includes periodic fitting of changes in production parameters based on periodic fluctuations in the time series; residual term modeling includes random fluctuation modeling of the residual error after fitting the trend term and periodic term. A production parameter prediction model is used to perform time series prediction on standardized production parameter time series data. Based on the time markers in the standardized production parameter time series data, a production parameter prediction sequence for the corresponding time point is generated. Time series forecasting involves inputting time stamps of standardized production parameter time series data into a pre-built production parameter forecasting model, calculating the predicted production parameter values corresponding to each time stamp based on the model parameters, and thus generating a production parameter forecasting sequence corresponding to the time stamps. Based on the production parameter observation sequence and the production parameter prediction sequence, data matching is performed at the same time mark. The production parameter observation value and the production parameter prediction value corresponding to the same time mark are formed into observation-prediction data pairs. The difference between the observation-prediction data pairs is calculated to obtain the prediction deviation value at the corresponding time point. Data matching involves pairing observed values in the production parameter observation sequence with predicted values in the production parameter prediction sequence according to the same time stamp, so that each time stamp forms a corresponding pair of observed and predicted values. The predicted deviation values obtained at each time point are arranged according to the time stamp order to generate the predicted deviation sequence for the corresponding production batch.
[0024] In this embodiment, the construction of the dynamic neighborhood constraint structure includes: Obtain time series data of production process parameters and obtain the prediction deviation sequence; The production process parameter time series data and the prediction deviation sequence are time-aligned according to the time stamp order, so that the parameter records at each time point in the production process parameter time series data correspond to the prediction deviation values in the prediction deviation sequence, and a deviation data record containing time stamps, parameter records and prediction deviation values is generated. Time alignment processing includes matching the parameter records in the time series data of production process parameters with the predicted deviation values in the predicted deviation sequence according to the same time mark, so that each time mark corresponds to a unique parameter record and predicted deviation value; The neighborhood constraint coefficients of the parameter records at each time point are calculated based on the predicted deviation values in the deviation data records, and the neighborhood constraint coefficients are written into the corresponding time point parameter records to generate extended parameter records containing the predicted deviation values and neighborhood constraint coefficients. Calculating the neighborhood constraint coefficients of the parameter records at each time point involves performing a numerical mapping operation based on the prediction deviation value of the corresponding time marker, converting the prediction deviation value into the neighborhood constraint coefficients of the parameter records at the corresponding time point, and writing it into the parameter record at that time point. The neighborhood constraint range of each time point parameter record is determined based on the neighborhood constraint coefficient in the extended parameter record, and the neighborhood constraint range is written into the corresponding extended parameter record to generate a neighborhood constraint data record containing the neighborhood constraint range. Based on the neighborhood constraint range in the neighborhood constraint data record, determine the neighborhood data set corresponding to the parameter record at each time point in the production process parameter time series data, and generate the corresponding neighborhood data record; The extended parameter records are associated and organized with the corresponding neighborhood data records to form a dynamic neighborhood constraint structure that includes time stamps, parameter records, prediction deviation values, neighborhood constraint coefficients, and neighborhood data sets.
[0025] In this embodiment, the improved local outlier factor algorithm includes: Obtain the dynamic neighborhood constraint structure, and extract extended parameter records from the dynamic neighborhood constraint structure, including time stamps, parameter records, prediction bias values, neighborhood constraint coefficients, and neighborhood data sets; Based on the prediction deviation value in the extended parameter record, the neighborhood data set corresponding to the extended parameter record is reconstructed. By constructing a neighborhood size parameter driven by prediction deviation, the neighborhood data set corresponding to each extended parameter record is redefined according to the prediction deviation value, and the reconstructed neighborhood data set is generated. The neighborhood size reconstruction process includes calculating the corresponding neighborhood size parameter based on the prediction deviation value in the extended parameter record, and reselecting the neighborhood data set in the production process parameter time series data according to the neighborhood size parameter, so that the number of members in the neighborhood data set is determined by the prediction deviation value. The process of redefining the neighborhood data set involves filtering or expanding the original neighborhood data set based on the neighborhood size parameter, and reselecting data records that meet the neighborhood size parameter according to the parameter distance in the time series data of production process parameters to form an updated neighborhood data set. The parameter distance values between the extended parameter records and each parameter record in the neighborhood data set are calculated based on the reconstructed neighborhood data set, and the reachable distance data corresponding to each extended parameter record is determined based on the calculated parameter distance values. Calculating the parameter distance between the extended parameter record and each parameter record in the neighborhood data set involves extracting the corresponding temperature, humidity, processing time and equipment operating status data, performing numerical calculations on the differences of each corresponding parameter and weighted summation to obtain the parameter distance between the two parameter records. The local reachability density corresponding to the extended parameter record is calculated based on the reachability distance data and the reconstructed neighborhood data set. During the local reachability density calculation process, the prediction deviation value in the extended parameter record is coupled with the prediction deviation value corresponding to the parameter record in the neighborhood data set, so that the prediction deviation difference participates in the local reachability density calculation, and local reachability density data containing the prediction deviation coupling result is generated. The coupling process includes calculating the difference between the prediction deviation value in the extended parameter record and the prediction deviation value corresponding to each parameter record in the neighborhood data set, and using the obtained deviation difference in the local reachability density calculation process to adjust the density relationship between the corresponding parameter records. Calculate the local outlier factor value corresponding to the extended parameter record based on the local reachability density data, and form local outlier factor data corresponding to the extended parameter record; Anomalies are determined in the extended parameter records based on the local outlier data, and extended parameter records whose local outlier values exceed a preset threshold are identified as abnormal parameter records. Abnormal production nodes and abnormal time intervals are determined based on the timestamps corresponding to the abnormal parameter records. Anomaly detection involves comparing the local outlier value corresponding to the extended parameter record with a preset threshold. When the local outlier value is greater than the preset threshold, the corresponding extended parameter record is identified as an anomalous parameter record. The preset threshold is a reference value for local outlier factors used for anomaly detection. It is determined by statistical analysis of local outlier values in historical production data and serves as a benchmark for judging whether a parameter record is an anomalous parameter record.
[0026] In this embodiment, the generation of the full-process traceability record for the corresponding production batch includes: obtaining the abnormal production node, abnormal time interval, and unique traceability code; locating the data record unit of the corresponding production batch in the established data association structure based on the unique traceability code; writing the abnormal production node and abnormal time interval into the data record unit; forming an abnormal record with the abnormal production node, abnormal time interval, and unique traceability code; after completing the writing of the abnormal record, reading the raw material batch data and production process parameter time series data already associated and stored in the data record unit of the corresponding production batch in the data association structure based on the unique traceability code; associating and integrating the abnormal record with the raw material batch data and production process parameter time series data to generate a data set containing raw material batch data, production process parameter time series data, and abnormal record; sorting the production process parameter time series data according to the time stamp order based on the data set; and inserting the abnormal record corresponding to the time stamp into the sorted production process parameter time series data to generate the full-process traceability record for the corresponding production batch.
[0027] Example 1: To verify the feasibility of this invention in practice, it was applied to the production of a pastry. In actual production environments, the pastry production process exhibits a clear characteristic of temporal continuity. For example, in the baking stage, the internal temperature of the baking oven typically needs to be maintained within a certain range. Large temperature fluctuations may lead to excessive caramelization of the pastry surface or insufficient internal ripening. In the ingredient preparation stage, abnormal stirring time and equipment speed can also result in uneven mixing of raw materials, affecting the product's texture. Traditional production monitoring systems often only record production data at a specific point in time, failing to analyze trends in production data or identify potential anomalies in advance. Therefore, in actual production, some potential anomalies are often only discovered during product quality inspection or customer feedback stages, which not only affects production efficiency but may also lead to economic losses.
[0028] In this embodiment, the manufacturing company deploys environmental sensors and equipment status acquisition modules in the batching, forming, baking, and packaging areas of the production workshop to collect data on temperature, humidity, processing time, and equipment operating status during the production process. For example, a temperature and humidity sensor and an equipment speed acquisition module are installed in the batching area to record the ambient temperature, humidity, and mixing equipment speed in real time. Temperature and humidity acquisition devices and forming equipment operating status acquisition devices are installed in the forming area to record the forming machine's operating speed and forming time. Oven temperature sensors, oven humidity sensors, and a heating power monitoring module are installed in the baking area to record the internal environmental parameters of the baking oven. Environmental monitoring devices and packaging equipment operating status monitoring modules are installed in the packaging area to record the temperature, humidity, and equipment conveying speed during the packaging process.
[0029] At the start of production, the system first manages the batch identification of raw materials entering the production process. For example, when a batch of flour, eggs, butter, and sugar enters the production line, the system generates a unique batch identifier for that batch of raw materials and writes this identifier into an RFID tag. Production personnel use scanning equipment to bind the RFID tag to the production batch, thus forming raw material batch data. The system establishes raw material batch data records corresponding to the raw material batch identifiers in the background database, which include information such as raw material type, supply batch number, and raw material warehousing time.
[0030] During production, the system continuously collects environmental parameters and equipment operating status data at each production node. For example, in one actual production process, the temperature in the batching area was maintained between 24.3℃ and 25.1℃, the humidity between 55% and 57%, the stirring equipment operated at approximately 120 revolutions per minute, and the stirring time was 480 seconds. In the molding stage, the molding machine operated at a speed of 36 products per minute, and the molding time was approximately 180 seconds. In the baking stage, the internal temperature of the baking oven was maintained between 175℃ and 182℃, the humidity in the oven cavity was maintained between 18% and 21%, and the baking time was 720 seconds. In the packaging stage, the temperature in the packaging area was maintained at approximately 23.6℃, the humidity was approximately 52%, and the packaging conveyor operated at a speed of 48 products per minute.
[0031] The system records the collected data in chronological order and generates time-series data of production process parameters for the corresponding production batch. For example, approximately 5,400 production parameter data records are collected within a single production cycle. Each record includes information such as timestamps, temperature, humidity, processing time, and equipment operating status.
[0032] After generating time-series data of production process parameters, the system models the production parameter data based on the Prophet time-series prediction model. The system first trains the model on historical production data, for example, using data from the past 120 production batches. The training data contains approximately 648,000 production parameter records. After the model training is complete, the system uses the trained model to predict the production parameters of the current production batch, generating the corresponding production parameter prediction sequence.
[0033] During the prediction process, for example in the baking stage, the system predicted the oven temperature at a certain time point to be 178.5℃, while the actual collected temperature was 181.2℃, resulting in a prediction deviation of approximately 2.7℃. Similarly, at another time point, the system predicted the temperature to be 179.0℃, while the actual temperature was 179.3℃, with a prediction deviation of only 0.3℃. The system arranges the prediction deviation values for each time point in chronological order, forming a prediction deviation sequence.
[0034] After generating the prediction deviation sequence, the system uses it to construct a dynamic neighborhood constraint structure. By aligning the time series data of production process parameters with the prediction deviation sequence, each production parameter record corresponds to a prediction deviation value. For example, if the prediction deviation value at a certain time point is 3.1℃, the system calculates the neighborhood constraint coefficient based on this deviation value and redefines the neighborhood data set accordingly.
[0035] In the anomaly identification phase, the system employs an improved local outlier factor algorithm to analyze production data. The algorithm first reconstructs the neighborhood size based on the prediction deviation value, assigning different neighborhood structures to data points with larger prediction deviations. Subsequently, the system calculates the parameter distances between parameter records; for example, it calculates the distance value after weighting temperature, humidity, processing time, and equipment operating status data. Based on this, the system calculates the local reachability density and couples it with the prediction deviation differences to obtain the local outlier factor value.
[0036] During a real-world test, the system performed anomaly detection on 5400 data points from a production batch. Approximately 5384 data points were identified as normal, while 16 were identified as abnormal. These abnormal data points were concentrated within a specific time interval during the baking process. For example, within a 45-second time window, the oven temperature rapidly increased from 178°C to 186°C, then decreased to 180°C. The system used an anomaly detection algorithm to determine this time interval as an abnormal production time interval and identified the corresponding production node as an abnormal production node. The system then wrote the abnormal production node and abnormal time interval into the data record unit of the corresponding traceability code and associated it with the raw material batch data and the time series data of the production process parameters. In this way, the system generates a full-process traceability record containing information on the source of raw materials, production process parameters, and abnormal production information.
[0037] In actual system operation, statistical analysis of data from 180 consecutive production batches revealed that the method described in this embodiment achieved a production anomaly identification accuracy of 96.8%, while the accuracy of traditional fixed threshold-based monitoring methods was approximately 81.3%. Furthermore, when a production anomaly occurs, the system can locate the abnormal production node and time interval within approximately 12 seconds, whereas traditional methods typically require manual analysis of production logs, with an average location time of approximately 15 minutes.
[0038] In terms of product quality traceability, the unique traceability code allows for quick retrieval of raw material information, production process data, and anomaly records for the corresponding production batch within the system. In one quality traceability test, the system completed the production batch traceability record query in approximately 1.6 seconds, while traditional manual traceability methods typically take about 35 minutes.
[0039] As can be seen from the above embodiments, the present invention combines IoT data acquisition technology, Prophet time series prediction model and improved local outlier factor algorithm to realize automatic collection, dynamic analysis and anomaly identification of data in the entire process of pastry production, and can generate complete production traceability records, thereby effectively improving the data management capability of production process and the product quality traceability capability.
[0040] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A technical method for a traceability management system for the entire pastry production process based on the Internet of Things, characterized in that, include: A unique raw material batch identifier is generated for each batch of raw materials entering the production process and written into an RFID tag. At the same time, raw material batch data corresponding to the raw material batch identifier is established on the traceability platform. Temperature, humidity, processing time, and equipment operating status data are collected at the production nodes of ingredient preparation, molding, baking, and packaging. The collected data is then processed for time synchronization and unified encoding to generate time series data of production process parameters for the corresponding production batch. A unique traceability code is generated for each production batch, and a data association structure is established with the traceability code as an index to associate and store raw material batch data with time series data of production process parameters. A Prophet time series prediction model is constructed based on the time series data of production process parameters, generating a production parameter prediction sequence for the corresponding time window, and calculating the prediction deviation sequence based on the time series data of production process parameters and the production parameter prediction sequence. A dynamic neighborhood constraint structure is constructed on the time series data of production process parameters using the prediction deviation sequence. Under the dynamic neighborhood constraint structure, an improved local outlier factor algorithm is used to identify anomalies in the time series data of production process parameters, thereby obtaining abnormal production nodes and abnormal time intervals. The abnormal production nodes and abnormal time intervals are associated with the corresponding traceability codes and written into the data association structure. Based on the data association structure, the full-process traceability record of the corresponding production batch is generated.
2. The technical method for a traceability management system for the entire process of pastry production based on the Internet of Things as described in claim 1, characterized in that, The establishment of raw material batch data includes: collecting information on the raw material name, supplier identifier, purchase batch number, purchase time, and raw material category of raw materials entering the production process; standardizing the fields of the collected raw material information to generate structured raw material information data; generating corresponding raw material batch identifiers based on the structured raw material information data; writing the generated raw material batch identifiers into the storage area of RFID tags; reading and verifying the RFID tags with the written raw material batch identifiers to obtain the RFID tag identification data corresponding to the raw material batch identifiers; matching and verifying the RFID tag identification data with the structured raw material information data; and uploading the raw material batch identifiers and structured raw material information data to the traceability platform after successful matching and verification. The traceability platform establishes a corresponding data index based on the uploaded raw material batch identifiers and stores the structured raw material information data under the data index to generate raw material batch data.
3. The technical method for a traceability management system for the entire process of pastry production based on the Internet of Things as described in claim 1, characterized in that, The generation of the time series data of the production process parameters includes: Data on ambient temperature, humidity, raw material mixing duration, and equipment operation status of the batching area are collected at the batching production node. Data on ambient temperature, humidity, molding duration, and equipment operation status of the molding area are collected at the molding production node. Data on oven temperature, humidity, baking duration, and equipment operation status of the baking oven are collected at the baking production node. Data on ambient temperature, humidity, packaging duration, and equipment operation status of the packaging area are collected at the packaging production node. The temperature, humidity, processing time, and equipment operation status data collected from each production node are then used to form the original process parameter data for the corresponding production node. Add acquisition time stamps to the raw process parameter data generated at each production node to obtain production node data records containing time stamps, and perform time synchronization processing on the time stamps in the data records of each production node according to a unified time benchmark. Add production batch and production node identifiers to the data records that have completed time synchronization. Perform unified field ordering and field coding on the temperature, humidity, processing time and equipment operating status data in the data records to generate production node coded data records. The coded data records of production nodes are arranged in chronological order according to the time stamp, and the coded data records of the ingredient production node, molding production node, baking production node and packaging production node are sequentially integrated to form a continuous data record sequence, generating time series data of production process parameters for the corresponding production batch.
4. The technical method for a traceability management system for the entire process of pastry production based on the Internet of Things as described in claim 1, characterized in that, The generation of the unique traceability code and the establishment of the data association structure include: Obtain the production batch identifier and retrieve the raw material batch data corresponding to the production batch identifier from the traceability platform, while also obtaining the time series data of the production process parameters for the corresponding production batch. Generate a unique traceability code for the corresponding production batch based on the production batch identifier; In the traceability platform, a data association structure is established using a unique traceability code as an index identifier, and a data record unit corresponding to the unique traceability code is created in the data association structure. The raw material batch data obtained from the call is written into the data record unit corresponding to the unique traceability code, and the raw material batch data and the unique traceability code form a first association record; After the raw material batch data is written, the production process parameter time series data is written into the data record unit corresponding to the same unique traceability code. The production process parameter time series data and the raw material batch data form an associated data record under the same unique traceability code index. After completing the association writing of raw material batch data and production process parameter time series data, the data record unit corresponding to the unique traceability code is saved, forming a production batch association data record indexed by the unique traceability code in the data association structure.
5. The technical method for a traceability management system for the entire process of pastry production based on the Internet of Things as described in claim 1, characterized in that, The calculation of the prediction deviation sequence includes: Obtain the time series data of the production process parameters for the corresponding production batch, and extract the temperature, humidity, processing time and equipment operating status data corresponding to each time point according to the time mark order to form the production parameter observation sequence for the corresponding production batch. The time stamps in the production parameter observation sequence are converted to a unified time format, and the production parameter data with missing time points are filled in by time neighborhood processing. Abnormal data collection is removed to obtain standardized production parameter time series data. Standardized production parameter time series data are input into the Prophet time series forecasting model. A time series index is built on the standardized production parameter time series data according to the time stamp. Based on the time series index, trend term modeling, period term modeling and residual term modeling are performed on the production parameter time series data to obtain the production parameter forecasting model for the corresponding production batch. A production parameter prediction model is used to perform time series prediction on standardized production parameter time series data. Based on the time markers in the standardized production parameter time series data, a production parameter prediction sequence for the corresponding time point is generated. Based on the production parameter observation sequence and the production parameter prediction sequence, data matching is performed at the same time mark. The production parameter observation value and the production parameter prediction value corresponding to the same time mark are formed into observation-prediction data pairs. The difference between the observation-prediction data pairs is calculated to obtain the prediction deviation value at the corresponding time point. The predicted deviation values obtained at each time point are arranged according to the time stamp order to generate the predicted deviation sequence for the corresponding production batch.
6. The technical method for a traceability management system for the entire process of pastry production based on the Internet of Things as described in claim 1, characterized in that, The construction of the dynamic neighborhood constraint structure includes: Obtain time series data of production process parameters and obtain the prediction deviation sequence; The time series data of the production process parameters are time-aligned with the predicted deviation sequence according to the time stamp order to generate a deviation data record containing time stamps, parameter records and predicted deviation values. The neighborhood constraint coefficients of the parameter records at each time point are calculated based on the predicted deviation values in the deviation data records, and the neighborhood constraint coefficients are written into the corresponding time point parameter records to generate extended parameter records containing the predicted deviation values and neighborhood constraint coefficients. The neighborhood constraint range of each time point parameter record is determined based on the neighborhood constraint coefficient in the extended parameter record, and the neighborhood constraint range is written into the corresponding extended parameter record to generate a neighborhood constraint data record containing the neighborhood constraint range. Based on the neighborhood constraint range in the neighborhood constraint data record, determine the neighborhood data set corresponding to the parameter record at each time point in the production process parameter time series data, and generate the corresponding neighborhood data record; The extended parameter records are associated and organized with the corresponding neighborhood data records to form a dynamic neighborhood constraint structure that includes time stamps, parameter records, prediction deviation values, neighborhood constraint coefficients, and neighborhood data sets.
7. The technical method for a traceability management system for the entire pastry production process based on the Internet of Things as described in claim 6, characterized in that, The improved local outlier factor algorithm includes: Obtain the dynamic neighborhood constraint structure, and extract extended parameter records from the dynamic neighborhood constraint structure, including time stamps, parameter records, prediction bias values, neighborhood constraint coefficients, and neighborhood data sets; Based on the prediction deviation value in the extended parameter record, the neighborhood data set corresponding to the extended parameter record is reconstructed. By constructing a neighborhood size parameter driven by prediction deviation, the neighborhood data set corresponding to each extended parameter record is redefined according to the prediction deviation value, and the reconstructed neighborhood data set is generated. The parameter distance values between the extended parameter records and each parameter record in the neighborhood data set are calculated based on the reconstructed neighborhood data set, and the reachable distance data corresponding to each extended parameter record is determined based on the calculated parameter distance values. The local reachability density corresponding to the extended parameter record is calculated based on the reachability distance data and the reconstructed neighborhood data set. The prediction deviation value in the extended parameter record is coupled with the prediction deviation value corresponding to the parameter record in the neighborhood data set to generate local reachability density data containing the prediction deviation coupling result. The coupling process includes calculating the difference between the prediction deviation value in the extended parameter record and the prediction deviation value corresponding to each parameter record in the neighborhood data set, and using the obtained deviation difference in the local reachability density calculation process to adjust the density relationship between the corresponding parameter records. Calculate the local outlier factor value corresponding to the extended parameter record based on the local reachability density data, and form local outlier factor data corresponding to the extended parameter record; Anomalies are determined for extended parameter records based on the local outlier data, and extended parameter records with local outlier values exceeding a preset threshold are identified as anomalous parameter records. Abnormal production nodes and abnormal time intervals are determined based on the timestamps corresponding to the anomalous parameter records.
8. The technical method for a traceability management system for the entire process of pastry production based on the Internet of Things as described in claim 1, characterized in that, The generation of the full-process traceability record for the corresponding production batch includes: obtaining the abnormal production node, abnormal time interval, and unique traceability code; locating the data record unit of the corresponding production batch in the established data association structure based on the unique traceability code; writing the abnormal production node and abnormal time interval into the data record unit; forming an abnormal record with the abnormal production node, abnormal time interval, and unique traceability code; after completing the writing of the abnormal record, reading the raw material batch data and production process parameter time series data already associated and stored in the data record unit of the corresponding production batch in the data association structure based on the unique traceability code; associating and integrating the abnormal record with the raw material batch data and production process parameter time series data to generate a data set containing raw material batch data, production process parameter time series data, and abnormal record; sorting the production process parameter time series data according to the time stamp order based on the data set; and inserting the abnormal record corresponding to the time stamp into the sorted production process parameter time series data to generate the full-process traceability record for the corresponding production batch.