Method and System for Constructing Production Process Dataset of Food Quality Traceability Edge Computing

Through edge computing and deep learning models, the food production process is layered and classified and data processing is solved, and the problems of incomplete collection of multi-source heterogeneous data and complex data types in the food production process are achieved, and the accuracy and completeness of food traceability data is achieved, and the accurate traceability positioning of food quality is supported.

CN119313361BActive Publication Date: 2025-07-11ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411840160.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-07-11
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively solve the problem of inaccurate traceability data caused by incomplete collection of multi-source heterogeneous data and complex data types in the food production process, and the difficulty of cross-departmental collaboration affects the transparency and intelligence of food quality traceability.

Method used

Through edge computing and deep learning models, a layered classification method is used to collect and classify key information in the food production process, and data processing is used to use edge devices and cloud computing power to build a food traceability production process data set to achieve the integration and unity of dynamic and static data.

Benefits of technology

It realizes efficient integration and unity of data in food production process, ensures the accuracy and completeness of food traceability data, adapts to the rapid processing of different types of data, and supports the accurate traceability positioning of food quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119313361B_ABST
    Figure CN119313361B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for constructing a production process data set for food quality traceability edge computing. By collecting and uploading key information in the food production process, classifying key data in the production process, and performing data processing on the key data to obtain a processed edge-side JSON data set and a cloud-side JSON data set, and finally associating and fusing the obtained edge-side JSON data set and cloud-side JSON data set according to the corresponding relationship of the identification features of the products, a food traceability production process data set is obtained. Using the present invention can effectively solve problems such as inaccurate traceability data caused by the wide span and complex data types involved in traceability information in the food production process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data acquisition and processing, and specifically relates to a production process data set construction method and system for edge computing for food quality traceability. Background Art

[0002] Food production quality traceability data comes from all aspects of the food production process, including food production data, food packaging data, food storage data, etc. At the same time, the data sources of these data are also different, including production equipment, packaging equipment, logistics conveyor belts, etc. This leads to the multi-source heterogeneity of production quality traceability data. Not only are the data sources different, but the data types and structures collected in each data source are also different.

[0003] In order to achieve transparency, intelligence and efficiency in the food production process, it is necessary to build a food production quality traceability data set based on technologies such as the Internet of Things (IoT) and blockchain. However, due to the large differences in production processes and quality requirements in different industries, existing general solutions may not be able to fully meet the needs of specific industries. In addition, the construction of quality traceability data sets involves multiple departments and links, and cross-departmental collaboration and communication may be difficult, which in turn leads to incomplete data collection, omission of key data, and other issues, ultimately affecting the overall effect. Summary of the invention

[0004] In response to the problems existing in the prior art, the present invention provides a method and system for constructing a production process data set for food quality traceability edge computing.

[0005] The hierarchical classification of multi-source heterogeneous data in the entire production process can lay a good foundation for the subsequent rapid and effective use of data and corresponding processing. The edge device can realize the decentralization of computing power, reduce the bandwidth waste of uploading unstructured data, and optimize the data heterogeneity problem faced during data collection. The dynamic and static data fusion of key data in the production process is realized, and the production process data set is constructed, so as to achieve the richness and accuracy of the content of the product traceability data set.

[0006] The first object of the present invention is to propose a method for constructing a production process data set for food quality traceability edge computing, comprising the following steps:

[0007] S1: Collect key information in the food production process and upload it to edge devices and the cloud;

[0008] S2: Classify the key data in the production process in layers according to food production operations, production data structure, production data processing and production data types;

[0009] S3: Develop a data processing plan or strategy for the key data classified in step S2, and use the computing power of edge devices and the cloud to process the key data according to the processing plan or strategy, and obtain the processed edge-side JSON data set and cloud-side JSON data set;

[0010] S4: Correlate and fuse the obtained edge-side JSON data set and cloud-side JSON data set according to the corresponding relationship of the identification features of the product to obtain the food traceability production process data set.

[0011] Further, the collection of key information in the food production process in step S1 and the upload of the key information to edge devices and the cloud include:

[0012] Step S11: Determine the key information included in the food production process.

[0013] Step S12: Deploy the collection devices for the key information in step S11, and enable the mutual communication between each collection device and edge devices and the cloud and upload the collected data.

[0014] Further, the hierarchical classification of the key data in the production process in step S2 according to food production operations, production data structures, production data processing, and production data types includes:

[0015] Step S21: Classify the key data in the production process based on the production operation stages in the actual production process. The categories include: data classes in the mixing stage, data classes in the packaging stage, and data classes in the warehousing stage.

[0016] Step S22: Classify the key data in the production process based on the characteristics of the data storage structure. The categories include: structured data classes, semi-structured data classes, and unstructured data classes.

[0017] Step S23: Classify the key data in the production process based on the data processing method. The classification basis includes: priority, storage rules, processing strategies, and linkage rules.

[0018] The key data comes from various stages of food production. The sources and structures of these data are different. If each key data wants to be converted into the key-value pair text data type required for constructing the data set, a suitable data processing method needs to be developed. To meet the above requirements, the key data is classified in detail from four perspectives: priority, storage rules, processing strategies, and linkage rules.

[0019] Step S24: Classify the key data in the production process based on the changes in data events. The categories include: static data classes and dynamic data classes.

[0020] Further, in step S3, a data processing plan or strategy is formulated for the key data classified in step S2, and the key data is processed using the computing power of edge devices and the cloud according to the processing plan or strategy, and the processed edge-side JSON data set and cloud-side JSON data set are obtained, including:

[0021] Step S31: The key data selects the corresponding data processing algorithm model according to its data type characteristics in the production data structure layer.

[0022] Step S32: The key data in the production data processing layer selects the corresponding data processing plan according to its data type.

[0023] Step S33: The key data is processed according to the data algorithm selection in step S31 and the data processing plan in step S32 to obtain the edge-side JSON data set and cloud-side JSON data set.

[0024] Further, in step S4, the obtained edge-side JSON data set and cloud-side JSON data set are associated and fused according to the corresponding relationship of the identification features of the product to obtain the food traceability production process data set, including:

[0025] Step S41: A dynamic and static data fusion model is established to fuse the data belonging to the dynamic data class in the edge-side JSON data set and the cloud-side JSON data set with the static objects.

[0026] Step S42: On the basis of the dynamic and static data set in step S41, the data belonging to the static data class in the edge-side JSON data set and the cloud-side JSON data set are fused with the dynamic and static data set to obtain the food traceability production process data set.

[0027] The second object of the present invention is to propose a production process data set construction system for food quality traceability edge computing, including:

[0028] The key information collection and upload module is used to collect the key information in the food production process and realize the upload of the key information to edge devices and the cloud;

[0029] The key data classification module is used to hierarchically classify the key data in the production process according to food production operations, production data structures, production data processing, and production data types;

[0030] The key data processing module is used to formulate a data processing plan or strategy for the classified key data, and process the key data using the computing power of edge devices and the cloud according to the processing plan or strategy to obtain the processed edge-side JSON data set and cloud-side JSON data set;

[0031] The edge-side dataset and cloud dataset fusion module is used to associate and fuse the obtained edge-side JSON dataset and cloud JSON dataset according to the corresponding relationship of the identification features of the products, so as to obtain the food traceability production process dataset.

[0032] Furthermore, the key data classification module includes:

[0033] The production business stage data classification sub-module is used to classify the key data in the production process based on the production business stages in the actual production process. The categories include: mixing stage data class, packaging stage data class, and warehousing stage data class;

[0034] The data storage structure feature classification sub-module is used to classify the key data in the production process based on the data storage structure features. The categories include: structured data class, semi-structured data class, and unstructured data class;

[0035] The data processing method classification sub-module is used to classify the key data in the production process based on the data processing methods. The classification basis includes: priority, storage rules, processing strategies, and linkage rules;

[0036] The data event change classification sub-module is used to classify the key data in the production process based on the data event changes. The categories include: static data class and dynamic data class.

[0037] Furthermore, the edge-side dataset and cloud dataset fusion module includes:

[0038] The dynamic and static data fusion model establishment sub-module is used to establish a dynamic and static data fusion model, and fuse the data belonging to the dynamic data class in the edge-side JSON dataset and cloud JSON dataset with static objects;

[0039] The dynamic and static data fusion sub-module is used to, on the basis of the dynamic and static datasets, fuse the data belonging to the static data class in the edge-side JSON dataset and cloud JSON dataset with the dynamic and static datasets to obtain the food traceability production process dataset.

[0040] The advantages of the present invention are as follows:

[0041] 1. The present invention fully considers the diversity and complexity of data in the food production process, and adopts targeted deep learning models or algorithms for multi-source heterogeneous food production data. Different processing strategies can be adopted according to different data structures, retaining the core features of heterogeneous data and converting them into a unified data format, achieving the fusion and unification of heterogeneous data in the food production process, and laying a foundation for the fusion and use of production data and quality inspection data.

[0042] 2. The present invention integrates and fuses the edge-side dataset and the cloud dataset, can accurately locate the detailed production process data and status of a certain batch of products, and realizes the accurate traceability and positioning of food. At the same time, the integration of dynamic data and static data is realized, and the integrated food quality traceability production process dataset can completely reflect the food production process.

[0043] 3. The method for classifying and stratifying key food production data in the present invention has good adaptability. When the type of collected data changes, it only needs to be reclassified and configured according to the classification method to quickly adapt to production. This classification architecture realizes the decoupling of different types of data processing and can well meet the needs of current food flexible production.

[0044] In summary, through technical means such as edge computing, deep learning models, image recognition algorithms, multi-source heterogeneous data fusion, and multi-source heterogeneous data classification and stratification, the present invention solves the problems of inaccurate traceability data caused by the wide span of traceability information and complex data types in the food production process. Brief Description of the Drawings

[0045] The accompanying drawings here are incorporated into the specification and form a part of the specification of the embodiments of the present invention, showing the embodiments in line with the present invention, and are used together with the specification to explain the principles of the present invention.

[0046] Figure 1 is a flowchart showing a method for constructing a food quality traceability edge computing production process dataset according to an embodiment of the present invention.

[0047] Figure 2 is a schematic diagram of a method for classifying and stratifying key data in the food production process in the embodiment.

[0048] Figure 3 is a schematic flowchart of a method for processing key data in the food production process in the embodiment.

[0049] Figure 4 is a schematic diagram of the structure of a dynamic and static data fusion model in the embodiment.

[0050] Figure 5 is a schematic diagram of a method for constructing a dynamic and static data fusion model in the embodiment. Detailed Embodiments

[0051] The following further describes the present invention with reference to specific embodiments.

[0052] Embodiment 1

[0053] An embodiment of a method for constructing a production process dataset for food quality traceability edge computing, Figure 1 The basic processing flow of this embodiment is shown, and the implementation steps are described in detail as follows:

[0054] Step S1: Collect the key information in the food production process and upload the key information to the edge device and the cloud.

[0055] In this embodiment, the food production process data processed covers the complete process data from the raw material feeding at the beginning of food production to the warehousing and storage after food processing is completed.

[0056] Step S11: Determine the key information included in the food production process.

[0057] The key information in this embodiment can be determined according to whether the information will have a direct impact on the quality of the food when the information changes or whether the information is the index information required for quality traceability. The various key information mentioned in this embodiment are as follows:

[0058] (1) Product information of the food and the ratio and quality of each production raw material;

[0059] (2) Food production work order information and its production plan;

[0060] (3) Raw material batch information carried on the raw material packaging label;

[0061] (4) pH value information and temperature and humidity information of the food during the mixing process in food production;

[0062] (5) Temperature of the packaging sealing mechanism during food packaging;

[0063] (6) Flow rate information of the single feeding at the food filling port during food packaging;

[0064] (7) Speed information of the packaging bag conveying mechanism during food packaging;

[0065] (8) Weight information of the finished product after food packaging;

[0066] (9) Label information carried on the food finished product packaging and the packaging situation of the packaging;

[0067] (10) Logistics information carried by the two-dimensional code on the food packaging;

[0068] (11) Association information between the food finished product, the packaging box and the warehouse stacking;

[0069] (12) Quality inspection report of the food.

[0070] It should be noted that the above-listed key information is not necessary. According to the above selection method, key data that meets the selection requirements can also be selected according to different production processes. At the same time, for the convenience of understanding, all the key data mentioned in this embodiment are taken as the above data as examples.

[0071] Step S12: Deploy the collection devices for the key information described in step S11 to enable communication between each collection device, the edge device, and the cloud and upload the collected data.

[0072] To collect various key information described in step S11, data collection devices need to be deployed on several devices in the food production line. For example:

[0073] (1) At the raw material mixing device of the food:

[0074] An automatic weighing device is deployed at the raw material feeding port, and a pH value detection sensor and temperature and humidity sensors are deployed inside the raw material mixing kettle.

[0075] (2) At the food packaging equipment:

[0076] A temperature sensor is deployed at the food packaging sealing mechanism, a flow sensor is deployed at the food filling port, and a speed sensor is deployed at the food packaging conveying mechanism.

[0077] (3) At the food finished product conveyor belt:

[0078] A weight sensor and a speed sensor are deployed, and an industrial camera is deployed above the conveyor belt.

[0079] (4) At the food boxing and palletizing equipment:

[0080] A barcode scanning camera is deployed near the food boxing machine, and a barcode scanning camera is deployed near the food palletizing robot.

[0081] The sensors or weighing devices deployed on each production device are connected to the programmable logic controller (PLC) ports on their respective devices through cables, and the transmission of their respective data to the PLC is realized through PLC programming. The PLCs of each device are connected to the router through network cables, and the PLC programming software is used to configure the Internet protocol address (IP address) and port number of the PLC to achieve the connection between the PLC and the router.

[0082] For the industrial camera and barcode scanning device for image acquisition and two-dimensional code recognition, models equipped with GigE (Gigabit Ethernet) interfaces are selected. The camera is connected to the router through a network cable, and the IP configuration tool equipped with the camera and barcode scanner is used to configure the IP address of the device to achieve the connection between the industrial camera and barcode scanning device and the router.

[0083] It should be noted that the IP addresses configured for the above devices should belong to the same network segment or the connected switch has the ability to communicate across network segments.

[0084] Furthermore, the router is connected to the edge device and the cloud device through a network cable or WIFI (wireless communication technology) to ensure that the information collected by each collection device in the production process can be uploaded to the edge and cloud devices.

[0085] Step S2, as Figure 2 shown, classify the key data in the production process into layers according to food production operations, production data structures, production data processing, and production data types, which is used to manage and process different types of data more clearly, ensuring that each data category can be fully processed and utilized. Specifically, it includes:

[0086] Step S21, classify the key data in the production process based on the classification of production operation stages in the actual production process. The categories include: data categories in the mixing stage, data categories in the packaging stage, and data categories in the warehousing stage.

[0087] In order to accurately locate the actual production operation stage to which the key data belongs during food quality traceability, so as to quickly locate and solve production quality problems, it is necessary to classify the key data according to the food production stage. The name of this classification layer is the food production operation layer. The specific classification includes:

[0088] (1) Data categories in the mixing stage

[0089] All key data during the food production and processing process from receiving a food order to starting processing until the food is mixed and enters the packaging machine belongs to this category. For example: product information of the food and the ratio and quality of each production raw material, food production work order information and its production plan, raw material batch information carried on the raw material packaging label, acidity and alkalinity information and temperature and humidity information of the food during the mixing process in food production, etc.

[0090] (2) Data categories in the packaging stage

[0091] All key data during the food production and processing process from the food entering the packaging machine to completing the food packaging stage belongs to this category. For example: temperature of the packaging sealing mechanism during food packaging, flow information of the single feed at the food filling port during food packaging, speed information of the packaging bag conveying mechanism during food packaging, etc.

[0092] (3) Data categories in the warehousing stage

[0093] All key data during the food production and processing process from the food completing packaging to the formal warehousing stage belongs to this category. For example: weight information of the finished product after food packaging, label information carried on the food finished product packaging and packaging conditions, logistics information carried by the QR code on the food packaging, association information between the food finished product and the packaging box and warehousing palletizing, quality inspection report of the food, etc.

[0094] Step S22, classify the key data in the production process based on the characteristics of the data storage structure. The categories include: structured data categories, semi-structured data categories, and unstructured data categories.

[0095] In order to store food quality traceability data in a relational database in the form of a text data set to achieve the purpose of quickly querying and calling traceability information, it is necessary to convert the key data into a key-value pair data type that meets the database storage requirements. For this purpose, the key data needs to be classified according to the characteristics of the data storage structure, so as to perform subsequent type conversion processing on the key data. This classification layer is called the production data structure layer. The specific classification includes:

[0096] (1) Structured data category

[0097] Generally, all the data with a structure that meets the database storage requirements among the key data obtained after being collected by equipment belong to this category. The data collected by numerical sensors during production all meet the above requirements. For example: the acidity, alkalinity, temperature, and humidity information of food during the mixing process in food production, the temperature of the packaging sealing mechanism during food packaging, the flow rate information of a single feeding at the food filling port during food packaging, the speed information of the packaging bag conveying mechanism during food packaging, the weight information of the finished product after food packaging, etc.

[0098] (2) Semi-structured data category

[0099] Generally, all the key data obtained after being collected by equipment that have certain data structure characteristics but do not fully meet the data storage structure requirements of a relational database belong to this category. This type of data usually exists in file formats such as XML (Extensible Markup Language). For example: the product information of food and the ratio and quality of its various production raw materials, the food production work order information and its production plan, the food quality inspection report, etc.

[0100] (3) Unstructured data category

[0101] Generally, all the key data obtained after being collected by equipment that do not have a fixed data structure belong to this category. This type of data is usually multimedia data such as pictures and videos. For example: the raw material batch information carried on the raw material packaging label, the label information and packaging situation carried on the food finished product packaging, the logistics information carried by the QR code on the food packaging, the association information between the food finished product, the packaging box, and the warehouse stacking code, etc.

[0102] Step S23: Classify the key data in the production process based on the data processing method. The classification basis includes: priority, storage rule, processing strategy, and linkage rule.

[0103] The key data comes from various stages of food production. The sources and structures of these data are different. If each key data wants to be converted into the key-value pair text data type required for constructing a data set, an appropriate data processing method needs to be formulated. To meet the above requirements, the key data is classified in detail from four aspects: priority, storage rule, processing strategy, and linkage rule. Specifically, it includes:

[0104] Step S231: Classify the key data into high-priority and low-priority categories according to the priority of data processing.

[0105] High priority means that the data has a high immediate need for processing, and if not processed in time, it will affect food production. Correspondingly, data that will not affect food production products even if not processed immediately is classified as low priority. Specific classifications include:

[0106] High-priority category: Such as the acidity and alkalinity information and temperature and humidity information of food during the mixing process in food production, the temperature of the packaging sealing mechanism during food packaging, the flow rate information of a single feeding at the food filling port during food packaging, the speed information of the packaging bag conveying mechanism during food packaging, the weight information of the finished product after food packaging, the label information carried on the food finished product packaging and the packaging situation of the packaging, etc.

[0107] Low-priority category: Such as the product information of food and the ratio and quality of its various production raw materials, the food production work order information and its production plan, the raw material batch information carried on the raw material packaging label, the logistics information carried by the QR code on the food packaging, the association information between the food finished product and the packaging box and the storage palletizing, the quality inspection report of food, etc.

[0108] Step S232: Classify the key data into edge storage and cloud storage categories according to the location of data storage.

[0109] The data in the edge storage category does not require long-term preservation of the original data. The data in this category is saved on the edge device to enable near-source data processing and conversion on the edge device close to the data collection side, thereby alleviating the bandwidth occupation of uploading data to the cloud. Correspondingly, the cloud storage category data requires long-term preservation of the original file to cope with possible subsequent traceability or proofreading. Specific classifications include:

[0110] Edge storage category: Such as the raw material batch information carried on the raw material packaging label, the label information carried on the food finished product packaging and the packaging situation of the packaging, the logistics information carried by the QR code on the food packaging, etc.;

[0111] Cloud storage category: Such as the product information of food and the ratio and quality of its various production raw materials, the food production work order information and its production plan, the acidity and alkalinity information and temperature and humidity information of food during the mixing process in food production, the temperature of the packaging sealing mechanism during food packaging, the flow rate information of a single feeding at the food filling port during food packaging, the speed information of the packaging bag conveying mechanism during food packaging, the weight information of the finished product after food packaging, the association information between the food finished product and the packaging box and the storage palletizing, the quality inspection report of food, etc.

[0112] Step S233: Classify the key data into edge - processing type and cloud - processing type according to the data - processing scheme.

[0113] The data in the edge - processing type has the requirements of low latency and fast response. Such data needs to be instantaneously processed by some lightweight algorithms on the edge device to obtain results. Correspondingly, the cloud - processing - type data may require complex processing such as complex calculations or big - data analysis, and this type of data usually does not require high timeliness. The specific classification includes:

[0114] Edge - processing type: Such as the raw - material batch information carried on the raw - material packaging label, the acidity, alkalinity, temperature, and humidity information of the food during the mixing process in food production, the temperature of the packaging - sealing mechanism during food packaging, the flow - rate information of the single - time feeding at the food - filling port during food packaging, the speed information of the packaging - bag conveying mechanism during food packaging, the weight information of the finished product after food packaging, the label information carried on the food - finished product packaging and the packaging situation, the logistics information carried by the two - dimensional code on the food packaging, the association information between the food - finished product, the packaging box, and the warehouse stacking, etc.

[0115] Cloud - processing type: Such as the product information of the food and the ratio and quality of its various production raw materials, the food - production work - order information and its production plan, the quality - inspection report of the food, etc.

[0116] Step S24: Classify the key data in the production process based on the changes of data events. The categories include: static - data type and dynamic - data type.

[0117] Due to the asynchronous nature of the key data (each data source of the key data updates the data according to its own logic and schedule), it is impossible to fully utilize all the key data when constructing the final data set. To solve this problem, it is necessary to ensure that the fusion model is dynamic when fusing the data sets, regard the sources of some key data as static objects, regard the changes of key data over time as events, and associate them with the objects in chronological order. Through the above - mentioned method, the logical association of all key information can be realized, and then the accurate tracking of the traceability information can be achieved.

[0118] The key data that frequently changes within a food - production order cycle can be regarded as the dynamic - data type. Correspondingly, the data that hardly changes within the order cycle is classified as the static - data type. The specific classification includes:

[0119] Dynamic - data type: Such as the food - production work - order information and its production plan, the acidity, alkalinity, temperature, and humidity information of the food during the mixing process in food production, the temperature of the packaging - sealing mechanism during food packaging, the flow - rate information of the single - time feeding at the food - filling port during food packaging, the speed information of the packaging - bag conveying mechanism during food packaging, the weight information of the finished product after food packaging, the label information carried on the food - finished product packaging and the packaging situation, etc.

[0120] Static data classes: such as product information of food, the ratio and quality of each raw material in production, the raw material batch information carried on the raw material packaging label, the quality inspection report of food. The association information between food products and packing boxes and storage pallets, the logistics information carried by the QR code on the food packaging, etc.

[0121] By classifying the data of the entire production process in Step 2 according to production operations, data types, data structures, and processing, different types of data can be managed and processed more clearly, ensuring that each data category can be properly processed and utilized in subsequent steps.

[0122] It should be noted that the above classification cases are only examples. When actually classifying the key data of food production, classify it according to the classification principle according to the needs.

[0123] Step S3: Develop a data processing plan or strategy for the key data classified in Step S2, and use the computing power of edge devices and the cloud to process the key data according to the processing plan or strategy, and obtain the processed edge-side JSON data set and cloud-side JSON data set.

[0124] Due to the heterogeneity of key data, it is necessary to process the key data into a unified format of data set. JSON (JavaScript Object Notation) is designed based on a subset of ECMAScript and is an open standard file format and data exchange format. It is easy for humans to read and write, and at the same time is easy for machines to parse and generate. Therefore, the JSON format is selected as the target format for data processing.

[0125] The edge devices required for key data processing refer to hardware devices with edge computing capabilities that can, at the edge side of the data acquisition network (i.e., near the data source or user), through some data processing models or algorithms deployed on the devices, process (such as data type conversion, extraction of key features of data, etc.) and analyze (such as fault diagnosis and feedback of processing signals, etc.) the collected data. These devices can directly process or preliminarily process the data from sensors or other data generation devices without sending all the raw data to a centralized cloud server for processing, thereby reducing data transmission latency, alleviating network bandwidth pressure, and improving data processing efficiency and security, etc. However, the computing power of such devices is relatively small, and only some lightweight models or algorithms can be deployed.

[0126] The cloud devices required for key data processing refer to the central servers of production enterprises or virtualized cloud servers based on cloud computing technology. These devices are generally far from the production site, have high computing performance, can perform complex data processing, and can achieve long-term storage of some information.

[0127] The following further illustrates the processing of key data in combination with Figure 3 the following.

[0128] Step S31: The key data selects the corresponding data processing algorithm model according to its data type characteristics in the production data structure layer.

[0129] To realize the conversion of the key data format, it is necessary to select a data processing model suitable for the data structure type of different data structures, including:

[0130] 1) Structured data type

[0131] Structured data itself has a good fit with the JSON format. Use fault diagnosis models such as CSDANet, MobileVit, CLFormer, etc. to judge whether the data is in a normal state, and write the judgment result into this piece of data. After that, just import the key data of this type into Python and use the JSON conversion module in the Python standard library to obtain the file data in JSON format.

[0132] 2) Semi-structured data type

[0133] Most of the key data in the semi-structured data type are text data. When processing files with a lot of text content such as processing logs, named entity recognition (NER) needs to be used to extract key information. Considering that the text content is relatively fixed in the production scenario, pre-trained NER models such as ALBERT, DistillBERT, ERNIE-Tiny, etc. in the food production scenario can be selected to obtain structured data, and further use the JSON conversion module in the Python standard library to obtain the file data in JSON format.

[0134] 3) Unstructured data type

[0135] The key data in the unstructured data type is multimedia data. The processing of this type of data involves defect detection, optical character recognition (OCR), and two-dimensional code recognition. Select image processing algorithms and deep learning frameworks to process multimedia data. Specifically: Use object detection models (such as YOLOv4-tiny, SSD MobileNet) to process the packaging situation of food finished product packaging, such as identifying leaking bags, printing errors, etc. Use the ZBar library to read the logistics information carried by the two-dimensional code on the food packaging. After extracting the image features through the above algorithm models, use a predefined text template to generate JSON text. For example: template ="{'barcode ': '{XXX}','status ': '{XXX}', 'time ': '{XXX}'}"

[0136] Step S32: Select corresponding data processing solutions for the key data in the production data processing layer according to their data types.

[0137] 1) High-priority category

[0138] Since the key data in this category will directly affect production safety, product quality or system stability and requires immediate processing and response, the key data in this category preferentially occupies the computing resources of edge devices and cloud devices. For example, the label information carried on the food finished product packaging and the packaging situation of the packaging need to immediately perform image processing on the edge device, and the weight information of the finished product after food packaging needs to immediately perform data verification on the edge device, etc.

[0139] 2) Low-priority category

[0140] Data in this category usually has no data processing requirements or has no requirements for real-time performance of data processing. This type of data can be stored first and processed when computing resources are available. For example, the feature extraction of the food quality inspection report, the verification of the association information between food finished products and packaging boxes and warehouse stacking, etc.

[0141] 3) Edge storage category

[0142] Edge storage means storing data on edge nodes close to the data source for quick access and processing. Most of this type of data is real-time data or data that requires low-latency processing, so it is stored in edge devices.

[0143] 4) Cloud storage category

[0144] Cloud storage means storing data on a remote cloud platform for long-term preservation and complex data analysis. Since most of this type of data is non-real-time data or historical records and is required for long-term preservation and complex data analysis, it is stored in cloud devices.

[0145] 5) Edge processing category

[0146] This type of data is processed using the computing resources of edge devices to meet the requirements of this type of data for fast processing and real-time response.

[0147] 6) Cloud processing category

[0148] This type of data is processed using the computing resources of cloud devices to meet the requirements of this type of data for complex calculations.

[0149] Step S33: Process the key data according to the data algorithm selection in step S31 and the data processing solutions in step S32 to obtain an edge-side JSON data set and a cloud JSON data set.

[0150] For easy understanding, the following are examples of key data processing methods:

[0151] 1) Structured data processing

[0152] Since structured data has a key-value pair data structure, it can be uploaded in JSON format when collected and uploaded to edge devices or cloud devices. Taking the mixing device as an example, the key data uploaded by mixing kettle A at a certain period is as follows:

[0153] {

[0154] "timestamp": "2024-11-24,14:00:00",

[0155] "equipment_id": "S001",

[0156] "temperature": 25.0,

[0157] "humidity": 60.0,

[0158] "pH_value":6.4

[0159] }

[0160] According to the processing scheme of the above steps, this data will be subject to fault diagnosis in the edge device and the judgment result will be attached, and then exported in JSON format again through Python. Specifically:

[0161] Call the deployed model in Python

[0162] # Load the model

[0163] model_path = 'path_to_model.tflite'

[0164] interpreter = tf.lite.Interpreter(model_path=model_path)

[0165] interpreter.allocate_tensors()

[0166] Input the data to be processed

[0167] # Prepare the input data

[0168] input_data = np.array(

[0169] data["temperature"],

[0170] data["humidity"],

[0171] data["pH_value "]

[0172] , dtype=np.float32)

[0173] Run the model with the model judgment result

[0174] # Run inference

[0175] status = run_inference(preprocessed_data)

[0176] print(f"Status: {status}")

[0177] Output the result

[0178] # Export the data to JSON format

[0179] json_data = json.dumps(processed_data, indent=4)

[0180] # Print the JSON data

[0181] print(json_data)

[0182] # Write the JSON data to a file

[0183] with open('processed_data.json', 'w') as f:

[0184] f.write(json_data)

[0185] The data in this case has no outliers. The final edge-side JSON data set obtained after processing is as follows:

[0186] {

[0187] "timestamp": "2024-11-24,14:00:00",

[0188] "equipment_id": "S001",

[0189] "temperature": 25.0,

[0190] "humidity": 60.0,

[0191] "pH_value":6.4,

[0192] "status": "normal"

[0193] }

[0194] 2) Semi-structured data class processing

[0195] Semi-structured data is mostly stored in file formats such as XML, TXT, XLS, etc. Taking the quality inspection report of a certain batch of products as an example, the report format is XLS. According to the processing solution of the above steps, this data will be processed by natural language in the cloud device and key information will be extracted, and finally exported in JSON format through Python. The file can be read by Python and the final processing can be completed. Specifically:

[0196] Import the report

[0197] # Read the Excel file

[0198] file_path = '6972735572975-20240921.xls'

[0199] df = pd.read_excel(file_path, sheet_name='Sheet1', header=None)

[0200] Load the pre-trained NER model (such as DistillBERT) and extract key information

[0201] # Load the pre-trained NER model

[0202] ner_model = pipeline("ner", model="distilbert-base-cased", tokenizer="distilbert-base-cased")

[0203] # Define a function to extract key information

[0204] def extract_key_info(text):

[0205] # Use the NER model to extract entities

[0206] entities = ner_model(text)

[0207] # Extract key information

[0208] extracted_info = {}

[0209] for entity in entities:

[0210] if entity['entity'].startswith('B-'):

[0211] key = entity['word'].strip().lower()

[0212] value = text[entity['start']:entity['end']].strip()

[0213] extracted_info[key] = value

[0214] return extracted_info

[0215] Convert the extracted information into JSON format and export it

[0216] import json

[0217] # Convert the extracted information into JSON format

[0218] json_data = json.dumps(key_info, ensure_ascii=False, indent=4)

[0219] # Print the JSON data

[0220] print(json_data)

[0221] # Write the JSON data to a file

[0222] with open('inspection_report.json', 'w', encoding='utf-8') as f:

[0223] f.write(json_data)

[0224] The quality inspection report in this case, after processing, finally obtains the following JSON data set on the cloud side:

[0225] {

[0226] "Inspection Number": "D2024203",

[0227] "Product Name": "XX Iodine-Free Edible Salt",

[0228] "Production Date / Batch Number": "20240921",

[0229] "Sample Number": "B2024-321",

[0230] "Sample Quantity": "220g × 2 cans",

[0231] "Representative Quantity": "249 cases",

[0232] "Product Standard / Inspection Standard": "Q / ZLY 0002S Class II",

[0233] "Manufacturer": "XXX Salt Products Co., Ltd.",

[0234] "Comprehensive Judgment": "This batch of products is qualified."

[0235] }

[0236] 3) Processing of unstructured data

[0237] Unstructured data mostly exists in the form of multimedia data. Taking the picture of the packaging situation of a packaged product as an example, the picture format is JPG. According to the processing scheme of the above steps, this data will be processed and judged for defects in the edge device, and finally, information such as the judgment result will be used to generate JSON text using a predefined text template. The picture can be read through Python and the final processing can be completed. Specifically:

[0238] Load the defect detection model

[0239] import cv2

[0240] import torch

[0241] from datetime import datetime

[0242] # Load the YOLOv4-tiny model

[0243] model = torch.hub.load('ultralytics / yolov5', 'custom', path='yolov4-tiny.weights')

[0244] Import the picture and process it

[0245] # Read the picture

[0246] image_path = 'package_image.jpg'

[0247] image = cv2.imread(image_path)

[0248] # Perform object detection

[0249] results = model(image)

[0250] # Extract detection results

[0251] detections = results.pandas().xyxy[0]

[0252] Define a template and output

[0253] # Define a template

[0254] template = {

[0255] "status": "",

[0256] "time": "",

[0257] "defects": []

[0258] }

[0259] # Check if there are any defects

[0260] if not detections.empty:

[0261] template["status"] = "Defects Detected"

[0262] for _, detection in detections.iterrows():

[0263] defect = {

[0264] "class": detection['name'],

[0265] "confidence": float(detection['confidence']),

[0266] "bbox": [float(detection['xmin']), float(detection['ymin']), float(detection['xmax']), float(detection['ymax'])]

[0267] }

[0268] template["defects"].append(defect)

[0269] else:

[0270] template["status"] = "No Defects"

[0271] # Record the current time

[0272] template["time"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")

[0273] # Convert the template to JSON format

[0274] json_data = json.dumps(template, ensure_ascii=False, indent=4)

[0275] # Print the JSON data

[0276] print(json_data)

[0277] # Write the JSON data to a file

[0278] with open('package_info.json', 'w', encoding='utf-8') as f:

[0279] f.write(json_data)

[0280] The processed edge-side JSON dataset of the product packaging images in this case is as follows:

[0281] {

[0282] "barcode:"XXX"

[0283] "status": "Defects Detected",

[0284] "time": "2024-11-24 15:30:00",

[0285] "defects":

[0286] {

[0287] "class": "leak",

[0288] "confidence": 0.95,

[0289] "bbox": [100.0, 150.0, 200.0, 250.0]

[0290] },

[0291] {

[0292] "class": "print_error",

[0293] "confidence": 0.85,

[0294] "bbox": [300.0, 400.0, 400.0, 500.0]

[0295] }

[0297] }

[0298] The above data algorithms and data processing methods are all prior arts and will not be elaborated here.

[0299] It should be noted that the above data processing model and data processing solution are only one embodiment. When actually processing the key data of food production, it can be processed according to the needs and the above principles.

[0300] Step S4: Correlate and fuse the obtained edge-side JSON data set and cloud JSON data set according to the corresponding relationship of the product identification features to obtain a food traceability production process data set.

[0301] Taking a certain product that has completed food production and processing and been warehoused as an example, the corresponding relationship of the product identification features refers to a series of data corresponding relationships that can be associated through the production work order information and its production plan based on features such as the labels and logistics codes carried on the packaging of the product. For example: which work order this product belongs to, which production line in this work order is used to produce the product, what equipment are there on this production line, and what sensors are there on these equipment. Through the above corresponding relationships, part of the construction of the food traceability production process data set can be realized.

[0302] Step S41: As Figure 4 shown, establish a dynamic and static data fusion model to fuse the data belonging to the dynamic data class in the edge-side JSON data set and the cloud JSON data set with static objects.

[0303] ​The dynamic and static data fusion model consists of static objects and dynamic objects. Among them, the dynamic objects are the key data in the dynamic data class, and these data will change continuously with data collection. The static objects are all physical entities in the production process, such as: Product A, Food Production Line No. 1, Flow Sensor No. 2, Food Production Work Order B, etc.

[0304] As Figure 5 shown, the event-driven architecture (EDA) is used to help build the dynamic and static data fusion model. Apache Kafka (Kafka) is an open-source distributed streaming platform, and this platform is used as an example to illustrate the construction method of the data fusion model. The static objects are defined as Topics in Kafka Broker (cache proxy, the core component in the Kafka distributed messaging system, which is mainly responsible for message storage and forwarding), and the Topic contains the feature information UID (user identification). The dynamic objects, as Kafka Producers, send data to the Topics of their corresponding static objects. The data of the dynamic objects contains feature information associated with user information, such as UID (user identification) and Timestamp (timestamp). In this way, an information flow related to the Topic can be formed within a certain Topic. Then, SQL (database) can subscribe to the Topic related to a certain product through the database subscription plugin, identify the relevant static information nodes through UID (user identification), and download information from Kafka Broker by combining the feature information. These information are respectively created into tables and associated in the database to obtain a dynamic and static dataset that integrates static key data and dynamic key data.

[0305] Among them, the dynamic nodes will be arranged in an orderly manner within the Topic according to the timestamps recorded during daily data collection. For example, the temperature of the packaging sealing mechanism during food packaging is associated with Temperature Sensor A. Since the temperature is constantly changing, the fused data instance is:

[0306] Temperature Sensor A{Time: "2024.11.10.16:05:10", temperature: "120°C"; Time: "2024.11.10.16:10:26", temperature: "123°C";...}

[0307] Based on the above data fusion method, only by taking a certain product as the target and using the time when the product is packaged as the characteristic time, and dynamically selecting a time range, a dynamic and static associated dataset related to the product can be obtained. The dynamic objects in this dataset are defined as Status 1 to Status N in chronological order, which is convenient for locating abnormal information in the traceability information later.

[0308] Step S42: Based on the dynamic and static data sets in step S41, fuse the data belonging to the static data class in the edge-side JSON data set and the cloud JSON data set with the dynamic and static data sets to obtain a food traceability production process data set.

[0309] For the key information in the static data class, it is only necessary to find the corresponding static object in the dynamic and static data fusion model according to the corresponding relationship of the product identification features and associate with it. Moreover, each static data class can be regarded as a static object in the dynamic and static data fusion model. For example, the quality inspection report of food is associated with a specific product produced within the production batch number.

[0310] Product A data set

[0311] {

[0312] Product: "Product A"

[0313] barcode: "XXX",

[0314] ……

[0315] "Inspection number": "XXX",

[0316] "Production date / batch number": "XXX",

[0317] "Sample number": "XXX",

[0318] "Comprehensive judgment": "This batch of products is qualified products"

[0319] ……

[0320] }

[0321] After the above steps, the food traceability production process data set can be obtained.

[0322] Embodiment 2

[0323] This embodiment proposes an embodiment of a production process data set construction system for food quality traceability edge computing, including:

[0324] Key information collection and upload module, used to collect key information in the food production process and realize the upload of key information to edge devices and the cloud;

[0325] Key data hierarchical classification module, used to hierarchically classify key data in the production process according to food production business, production data structure, production data processing, and production data type;

[0326] The key data processing module is used to formulate data processing plans or strategies for the classified key data, and perform data processing on the key data using the computing power of edge devices and the cloud according to the processing plans or strategies, so as to obtain the processed edge-side JSON data set and cloud-side JSON data set;

[0327] The edge-side data set and cloud-side data set fusion module is used to associate and fuse the obtained edge-side JSON data set and cloud-side JSON data set according to the corresponding relationship of the identification features of the product, so as to obtain the food traceability production process data set.

[0328] Preferably, the key data classification module includes:

[0329] The production business stage data classification sub-module is used to classify the key data in the production process based on the production business stages in the actual production process, and the categories include: mixing stage data class, packaging stage data class, and warehousing stage data class;

[0330] The data storage structure feature classification sub-module is used to classify the key data in the production process based on the data storage structure features, and the categories include: structured data class, semi-structured data class, and unstructured data class;

[0331] The data processing method classification sub-module is used to classify the key data in the production process based on the data processing methods, and the classification basis includes: priority, storage rules, processing strategies, and linkage rules;

[0332] The data event change classification sub-module is used to classify the key data in the production process based on the data event changes, and the categories include: static data class and dynamic data class.

[0333] Preferably, the edge-side data set and cloud-side data set fusion module includes:

[0334] The dynamic and static data fusion model establishment sub-module is used to establish a dynamic and static data fusion model, and fuse the data belonging to the dynamic data class in the edge-side JSON data set and cloud-side JSON data set with static objects;

[0335] The dynamic and static data fusion sub-module is used to fuse the data belonging to the static data class in the edge-side JSON data set and cloud-side JSON data set with the dynamic and static data set on the basis of the dynamic and static data set, so as to obtain the food traceability production process data set.

[0336] The specific implementation methods of each module are the same as the steps of the aforementioned method for constructing a production process data set for food quality traceability edge computing, and will not be elaborated here.

[0337] Embodiment 3

[0338] This embodiment provides an electronic device, including:

[0339] A memory for storing a computer program;

[0340] A processor for executing the program stored in the memory to implement the steps of the foregoing embodiment of the method for constructing a production process data set for food quality traceability edge computing.

[0341] For the specific implementation of each step and the relevant explanatory content, reference can be made to the foregoing embodiment of the method for constructing a production process data set for food quality traceability edge computing, which will not be elaborated here.

[0342] The memory of the electronic device mentioned in this embodiment may include a random access memory (RAM), or may also include a non-volatile memory (NVM), such as at least one disk memory.

[0343] The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0344] Embodiment 4

[0345] This embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the foregoing embodiment of the method for constructing a production process data set for food quality traceability edge computing; for the specific implementation of each step of the method and the relevant explanatory content, reference can be made to the foregoing embodiment of the method for constructing a production process data set for food quality traceability edge computing, which will not be elaborated here.

[0346] It should be noted that each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0347] In particular, for the embodiments of the device, electronic device, and computer-readable storage medium, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, please refer to the partial description of the method embodiments.

[0348] The above are only the embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various modifications and changes can be made to the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the scope of the claims of the present invention.

Claims

1. A method for constructing a production process dataset for food quality traceability edge computing, characterized in that, It includes the following steps: S1: Collect the key information in the food production process and upload the key information to the edge device and the cloud; S2: Classify the key data in the production process according to food production operations, production data structure, production data processing, and production data type; S3: Develop a data processing plan or strategy for the key data classified in step S2, and use the computing power of the edge device and the cloud to process the key data according to the processing plan or strategy to obtain the processed edge-side JSON data set and cloud-side JSON data set; S4: Associate and fuse the obtained edge-side JSON data set and cloud-side JSON data set according to the corresponding relationship of the identification features of the product to obtain the food traceability production process data set; Among them, the hierarchical classification of the key data in the production process according to food production operations, production data structure, production data processing, and production data type includes: Step S21: Classify the key data in the production process based on the production operation stages in the actual production process. The categories include: data categories in the mixing stage, data categories in the packaging stage, and data categories in the warehousing stage; Step S22: Classify the key data in the production process based on the characteristics of the data storage structure. The categories include: structured data categories, semi-structured data categories, and unstructured data categories; Step S23: Classify the key data in the production process based on the data processing method. The classification basis includes: priority, storage rules, and processing strategies; Among them, the key data is classified into edge storage categories and cloud storage categories according to the storage location of the data, and the key data is classified into edge processing categories and cloud processing categories according to the data processing plan; Step S24: Classify the key data in the production process based on the changes in data events. The categories include: static data categories and dynamic data categories; The step of associating and fusing the obtained edge-side JSON data set and cloud-side JSON data set according to the corresponding relationship of the identification features of the product to obtain the food traceability production process data set includes: Step S41: Establish a dynamic and static data fusion model, and fuse the data belonging to the dynamic data category in the edge-side JSON data set and the cloud-side JSON data set with static objects to obtain a dynamic and static data set; Step S42: On the basis of the dynamic and static data set in step S41, fuse the data belonging to the static data category in the edge-side JSON data set and the cloud-side JSON data set with the dynamic and static data set to obtain the food traceability production process data set.

2. The method for constructing a production process data set for food quality traceability edge computing according to claim 1, characterized in that, The step of collecting the key information in the food production process and uploading the key information to the edge device and the cloud in step S1 includes: Step S11: Determine the key information included in the food production process; Step S12: Deploy the collection devices for the key information described in step S11 to enable mutual communication between each collection device and the edge device and the cloud and upload the collected data.

3. The method for constructing a production process data set for food quality traceability edge computing according to claim 1, characterized in that, In step S3, a data processing plan or strategy is formulated for the key data classified in step S2. The key data is processed using the computing power of edge devices and the cloud according to the processing plan or strategy, and the processed edge-side JSON data set and cloud-side JSON data set are obtained, including: Step S31: Select the corresponding data processing algorithm model for the key data according to its data type characteristics in the production data structure layer; Step S32: Select the corresponding data processing plan for the key data in the production data processing layer according to its data type; Step S33: Process the key data according to the data algorithm selection in step S31 and the data processing plan in step S32 to obtain the edge-side JSON data set and cloud-side JSON data set.

4. A production process dataset construction system for food quality traceability edge computing, characterized in that Including: The key information collection and upload module is used to collect the key information in the food production process and realize the upload of the key information to edge devices and the cloud; The key data classification module is used to classify the key data in the production process according to food production operations, production data structure, production data processing, and production data type; The key data processing module is used to formulate a data processing plan or strategy for the classified key data, and process the key data using the computing power of edge devices and the cloud according to the processing plan or strategy to obtain the processed edge-side JSON data set and cloud-side JSON data set; The edge-side data set and cloud-side data set fusion module is used to associate and fuse the obtained edge-side JSON data set and cloud-side JSON data set according to the corresponding relationship of the identification features of the product to obtain the food traceability production process data set; The key data classification module includes: The production operation stage data classification sub-module is used to classify the key data in the production process based on the production operation stage in the actual production process. The categories include: mixing stage data class, packaging stage data class, and warehousing stage data class; The data storage structure feature classification sub-module is used to classify the key data in the production process based on the data storage structure feature. The categories include: structured data class, semi-structured data class, and unstructured data class; The data processing method classification sub-module is used to classify the key data in the production process based on the data processing method. The classification basis includes: priority, storage rule, and processing strategy; Among them, the key data is classified into edge storage class and cloud storage class according to the data storage location, and the key data is classified into edge processing class and cloud processing class according to the data processing plan; The data event change classification sub-module is used to classify the key data in the production process based on the data event change. The categories include: static data class and dynamic data class; The edge-side data set and cloud-side data set fusion module includes: The dynamic and static data fusion model establishment sub-module is used to establish a dynamic and static data fusion model, and fuse the data belonging to the dynamic data class in the edge-side JSON data set and cloud-side JSON data set with static objects to obtain a dynamic and static data set; The dynamic and static data fusion sub-module is used to fuse the data belonging to the static data class in the edge-side JSON data set and the cloud JSON data set with the dynamic and static data set on the basis of the dynamic and static data sets, so as to obtain the food traceability production process data set.

5. An electronic device, comprising: A memory for storing a computer program; A processor for executing the program stored on the memory to implement the method for constructing a production process data set for food quality traceability edge computing according to any one of claims 1-3.

6. A computer-readable storage medium storing a computer program therein, and when the computer program is executed by a processor, the method for constructing a production process data set for food quality traceability edge computing according to any one of claims 1-3 is implemented.

Citation Information

Patent Citations

  • Intelligent Internet of Things information processing platform and edge data processing method thereof

    CN113965601A

  • Wheat quality safety credible traceability method based on chain network connector

    CN115310983A