Food detection data management system and method based on cloud computing

By utilizing a cloud-based food testing data management system, leveraging the Internet of Things, dynamic risk assessment models, and blockchain technology, the problems of data silos and tampering risks in traditional methods have been solved. This has enabled accurate assessment of food safety risks and ensured the authenticity of data, thereby improving work efficiency.

CN120994747AInactive Publication Date: 2025-11-21SICHUAN NANSHUI AGRI & ANIMAL HUSBANDRY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511535999.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2025-11-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional food testing data management methods suffer from problems such as data silos, risks of data tampering, and insufficient real-time performance, making it difficult to achieve efficient sharing and collaborative analysis, and the authenticity of the data is hard to guarantee.

Method used

Design a cloud-based food testing data management system. Collect data through IoT devices, construct a dynamic risk assessment model using the AHP (Analytic Hierarchy Process) algorithm and XGBoost (Extreme Gradient Boosting Tree), and combine the SHA-256 hash algorithm and blockchain notarization technology to achieve data labeling, encryption and management.

Benefits of technology

It enables precise assessment of food safety risks, improves the dynamic adaptability and accuracy of data, ensures the authenticity and integrity of data, breaks down information silos, and improves work efficiency and data sharing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994747A_ABST
    Figure CN120994747A_ABST
Patent Text Reader

Abstract

The invention discloses a food detection data management system and method based on cloud computing, and the method comprises the steps: obtaining a structured data set, carrying out the preprocessing of the structured data set in a data processing module, and transmitting the preprocessed structured data set to a cloud platform; constructing a dynamic risk assessment model based on an AHP (Analytical Hierarchy Process) and an XGBoost extreme gradient boosting tree, and inputting the preprocessed structured data set into the dynamic risk assessment model for identification; marking the detected food according to the food safety risk index, and generating a unique Hash value of the structured data set by using an SHA-256 Hash algorithm to obtain a detection data Hash value; and writing the marked structured data set and the detection data hash value into a block chain for evidence storage, and deploying an intelligent contract to execute compliance verification management. Data sharing and cooperative work can be realized on a unified platform, an information island is broken, and the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food testing data management technology, and in particular to a cloud-based food testing data management system and method. Background Technology

[0002] As food safety issues receive increasing attention, traditional food testing data management methods have the following shortcomings: data silos, with testing data scattered across different enterprises, regulatory departments, and consumer platforms, making efficient sharing and collaborative analysis difficult; data tampering risks, as traditional centralized storage models are vulnerable to attacks, making it difficult to guarantee data authenticity; and insufficient real-time performance, as testing data requires manual review and uploading, leading to delayed responses. Summary of the Invention

[0003] The purpose of this invention is to solve the above problems by designing a cloud computing-based food testing data management system and method.

[0004] To achieve the above objectives, the technical solution of the present invention further includes, in the above-mentioned cloud-based food testing data management system, the food testing data management system comprises: The data processing module is used to collect food testing data through IoT devices and acquire supply chain information data. The data is then fused to generate a structured dataset. The structured dataset is preprocessed in the data processing module and then transmitted to the cloud platform. The cloud platform module is used to build a dynamic risk assessment model based on the AHP hierarchical analysis algorithm and XGBoost extreme gradient boosting tree. The preprocessed structured dataset is input into the dynamic risk assessment model for identification to obtain the food safety risk index. The encryption tagging module is used to tag the tested food according to the food safety risk index and generate a unique hash value of the structured dataset using the SHA-256 hash algorithm to obtain the test data hash value. The data management module is used to write the marked structured dataset and the hash value of the detection data into the blockchain for evidence storage, and to deploy smart contracts to perform compliance verification management.

[0005] Furthermore, in the aforementioned cloud-based food testing data management system, the data processing module includes the following units: The data cleaning unit is used to clean the collected food testing data and supply chain information data, removing duplicate, erroneous, and invalid data to obtain cleaned testing data. The data unification unit is used to convert data of different formats and sources in the cleaning and testing data into a unified format to obtain standard testing data; The data association unit is used to associate the standard testing data with information data from each link in the supply chain, using the unique identifier of the food as the key index, to obtain associated testing data; The data fusion unit is used to determine the definition, data type and constraints of each data field in the associated detection data, and generate a structured dataset.

[0006] Furthermore, in the aforementioned cloud-based food testing data management system, the data processing module further includes the following units: The noise reduction processing unit is used to perform noise reduction processing on the sensor data in the structured dataset using a mean filtering algorithm to obtain noise-reduced structured data. The compression and aggregation unit is used to compress the noise-reduced structured data and then aggregate data of the same type and time period to obtain aggregated structured data. The communication transmission unit is used to transmit the aggregated structured data to the cloud platform via the MQTT network communication protocol.

[0007] Furthermore, in the aforementioned cloud-based food testing data management system, the cloud platform module includes the following units: The indicator determination unit is used to determine the criteria layer indicators based on the AHP (Analytic Hierarchy Process) algorithm, according to each link of the food supply chain and the main factors affecting food safety. These indicators include at least raw material risk, processing risk, transportation and storage risk, and reliability risk of testing data. The matrix construction unit is used to construct the judgment matrix. It uses the eigenvalue method to calculate the largest eigenvalue and the corresponding eigenvector of the judgment matrix, and then normalizes the eigenvector to obtain the weight of each index. The weight output unit is used to calculate the consistency index and consistency ratio. When the consistency ratio is less than 0.1, the judgment matrix has satisfactory consistency; otherwise, the judgment matrix needs to be readjusted, and the weights of each risk factor are output.

[0008] Furthermore, in the aforementioned cloud-based food testing data management system, the cloud platform module includes the following units: The data extraction unit is used to extract sample data for training the model from the preprocessed structured dataset, including input features and output labels; The parameter setting unit is used to set the key parameters of the XGBoost extreme gradient boosting tree, including at least the learning rate, maximum depth, subsampling rate, column sampling rate, and number of trees. The risk output unit is used to take the weights of each risk factor obtained by the AHP (Analytic Hierarchy Process) algorithm as the input feature weights of the XGBoost model. By learning the relationship between the weights and features of each risk factor, it outputs a food safety risk index.

[0009] Furthermore, in the aforementioned cloud-based food testing data management system, the encryption tagging module includes the following units: The serialization processing unit is used to serialize the preprocessed structured dataset, convert it into a byte stream format, and obtain sequential structured data. The hash calculation unit is used to perform hash calculation on the sequence structured data using the SHA-256 hash algorithm to generate a 256-bit hash value and obtain the detection data hash value.

[0010] Furthermore, in the aforementioned cloud-based food testing data management system, the data management module includes the following units: The data packaging unit is used to package the labeled structured dataset and the hash value of the detection data to generate transaction data; The data verification unit is used by each participating node to verify the transaction data. After successful verification, the transaction data is broadcast to the consortium blockchain network. The data query unit is used by participants to query the data storage information through a blockchain explorer, including the data's on-chain time, transaction hash value, and data content.

[0011] Furthermore, in implementing the above-mentioned cloud-based food testing data management method, the method includes the following steps: Food testing data is collected through IoT devices, and supply chain information data is obtained at the same time. The data is then merged to generate a structured dataset. The structured dataset is preprocessed in the data processing module and then transmitted to the cloud platform. A dynamic risk assessment model is constructed based on the AHP (Analytic Hierarchy Process) algorithm and XGBoost (Extreme Gradient Boosting Tree). The preprocessed structured dataset is input into the dynamic risk assessment model for identification to obtain the food safety risk index. The tested food is labeled according to the food safety risk index, and a unique hash value of the structured dataset is generated using the SHA-256 hash algorithm to obtain the hash value of the tested data. The labeled structured dataset and the hash value of the detection data are written into the blockchain for evidence storage, and a smart contract is deployed to perform compliance verification management.

[0012] Furthermore, in implementing the above-mentioned cloud-based food testing data management method, the method includes the following steps: The collected food testing data and supply chain information data are cleaned to remove duplicate, erroneous, and invalid data, resulting in cleaned testing data. The cleaning test data of different formats and sources are converted into a unified format to obtain standard test data; Taking the unique identifier of the food as the key index, associate the standard detection data with the information data of each link in the supply chain to obtain associated detection data; Determine the definitions, data types, and constraint conditions of each data field in the associated detection data to generate a structured data set.

[0013] Furthermore, in implementing the above food detection data management method based on cloud computing, the method includes the following steps: Use the mean filter algorithm to perform noise reduction processing on the sensor data in the structured data set to obtain noise-reduced structured data; After compressing the noise-reduced structured data, perform aggregation processing on data of the same type and in the same time period to obtain aggregated structured data; Transmit the aggregated structured data to the cloud platform through the MQTT network communication protocol.

[0014] The beneficial effects are as follows: Food detection data is collected through Internet of Things devices, and at the same time, supply chain information data is obtained. The data is fused to generate a structured data set, and the structured data set is preprocessed in the data processing module and then transmitted to the cloud platform; A dynamic risk assessment model is constructed based on the AHP hierarchical analysis algorithm and the XGBoost extreme gradient boosting tree. The preprocessed structured data set is input into the dynamic risk assessment model for identification to obtain a food safety risk index; The detected food is marked according to the food safety risk index, and the unique hash value of the structured data set is generated using the SHA-256 hash algorithm to obtain a detection data hash value; The marked structured data set and the detection data hash value are written into the blockchain for evidence storage, and a smart contract is deployed to perform compliance verification management. 1. Achieve accurate assessment of food safety risks. Compared with traditional methods, this model has stronger dynamic adaptability and accuracy, and can timely discover potential food safety risks. 2. Utilize the immutable and traceable characteristics of the blockchain to ensure the authenticity and integrity of the data. Once a food safety problem occurs, the source and circulation path of the problem food can be quickly traced through the blockchain, and the problem link can be accurately locked. 3. It can achieve data sharing and collaborative work on a unified platform, break the information silos, and improve work efficiency. Description of the Drawings

[0015] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention.

[0016] Figure 1 It is a schematic diagram of the first embodiment of the food detection data management system based on cloud computing in the embodiments of the present invention; Figure 2 This is a schematic diagram of a second embodiment of the cloud-based food testing data management system of the present invention; Figure 3 This is a schematic diagram of the third embodiment of the cloud computing-based food testing data management system of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0018] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0019] The present invention will now be described in detail with reference to the accompanying drawings, such as... Figure 1 As shown, a cloud-based food testing data management system includes: The data processing module is used to collect food testing data through IoT devices and acquire supply chain information data. The data is then integrated to generate a structured dataset, which is preprocessed in the data processing module and then transmitted to the cloud platform. Specifically, this embodiment also includes a data cleaning unit, which is used to clean the collected food testing data and supply chain information data, remove duplicate data, erroneous data and invalid data, and obtain cleaned testing data; The data unification unit is used to convert data of different formats and sources in cleaning and testing data into a unified format to obtain standard testing data; The data association unit is used to associate standard testing data with information data from various links in the supply chain, using the unique identifier of the food as the key index, to obtain associated testing data; The data fusion unit is used to determine the definition, data type, and constraints of each data field in the associated detection data, and to generate a structured dataset.

[0020] The noise reduction processing unit is used to perform noise reduction processing on the sensor data in the structured dataset using the mean filtering algorithm to obtain noise-reduced structured data; The compression and aggregation unit is used to compress the noise-reduced structured data and then aggregate data of the same type and time period to obtain aggregated structured data. The communication transmission unit is used to transmit aggregated structured data to the cloud platform via the MQTT network communication protocol.

[0021] Specifically, (i) IoT devices collect food testing data; Equipment type and function; Sensor-type equipment: Used to collect real-time environmental data on food, such as temperature sensors, humidity sensors, and gas sensors (detecting the concentration of oxygen, carbon dioxide, volatile organic compounds, etc.). Temperature and humidity sensors are deployed in food storage warehouses and transport vehicles to monitor changes in ambient temperature and humidity in real time; gas sensors are deployed in food processing workshops to monitor the concentration of pollutants in the air.

[0022] Testing and analysis equipment includes spectrometers (for detecting chemical residues, nutrients, etc. in food), chromatographs (for analyzing additives, pesticide residues, etc. in food), and microbial detectors (for detecting total bacterial count, pathogens, etc. in food). For example, in the raw material inspection stage, spectrometers are used to quickly screen raw materials and obtain data on heavy metals, pesticide residues, etc.; in the finished product inspection stage, microbial detectors are used to detect microbial indicators in food.

[0023] Identification equipment, such as RFID tag readers and QR code scanners, assigns a unique RFID tag or QR code to each food package or batch. The reader or scanner reads the information from the tag to obtain basic identification data of the food, such as product name, production date, and batch number.

[0024] Data acquisition frequency and accuracy; Different data collection frequencies are set according to the type of food, the importance of the testing indicators, and the different stages of the supply chain. For example, temperature and humidity data for perishable foods during transportation are collected every 5 minutes; pesticide residue testing data for raw materials are tested once per batch.

[0025] The data acquisition accuracy of the equipment must meet relevant national standards and industry specifications. The equipment should be calibrated and maintained regularly to ensure the accuracy of the acquired data.

[0026] (ii) Obtaining supply chain information data; Data content; Raw material supply information: This includes the name of the raw material supplier, the origin of the raw material, the purchase date of the raw material, the type of raw material, and the quality inspection report of the raw material. By establishing a data interface with the raw material supplier, relevant information about the raw material can be obtained in real time.

[0027] Processing information includes the processing company name, processing technology, processing time, processing equipment number, and key control point data (sterilization temperature, time, etc.) during processing. Detailed processing information is recorded in the processing company's production management system and transmitted to the food testing data management system via a data interface.

[0028] Transportation and storage information includes: transportation company name, mode of transportation (road, rail, air, etc.), transportation route, transportation time, warehouse name, and storage conditions (temperature, humidity, ventilation, etc.). Information on the transportation and storage processes is obtained using the GPS positioning system of the transport vehicles and the warehouse management system.

[0029] Sales information: such as seller name, sales location, sales time, and sales quantity. This information is obtained through data integration with sales platforms or sales terminals.

[0030] Data acquisition methods; Establish data interfaces with enterprises or systems at each stage of the supply chain, and obtain supply chain information data in real time or on a regular basis using API interfaces, file transfer (CSV, XML format), and other methods.

[0031] For some small and medium-sized enterprises or traditional supply chain links, it may not be possible to obtain information directly through data interfaces. In such cases, manual data entry can be used to ensure the integrity of supply chain information.

[0032] (iii) Data fusion to generate structured datasets; Data cleaning and transformation; The collected food testing data and supply chain information data are cleaned to remove duplicate, erroneous, and invalid data. For example, data collected by temperature and humidity sensors must be filtered and corrected if outliers (temperatures exceeding reasonable ranges) are found.

[0033] Convert data from different formats and sources into a unified format for fusion. For example, convert binary data collected by sensors into decimal values, and standardize text data in supply chain information (unify date formats, units, etc.).

[0034] Data association and integration; Using unique food identifiers (batch numbers, RFID tag numbers) as key indexes, food testing data is linked to information data from all stages of the supply chain. For example, raw material supply information, processing information, transportation and storage information, and testing data for a particular batch of food can be integrated into a single data record.

[0035] Construct a structured data model, clearly defining the types, data types, and constraints of each data field. The structured dataset should include basic food information (product name, specifications, production date, batch number, etc.), supply chain information (information on raw material supply, processing, transportation, storage, sales, etc.), and testing data (values ​​of various testing indicators, testing time, testing institutions, etc.).

[0036] (iv) Data processing module preprocessing; Preprocessed content; Data noise reduction: Filtering algorithms (mean filtering, median filtering) are used to reduce noise in the collected sensor data, remove noise interference, and improve data quality.

[0037] Data compression: For large amounts of testing data and supply chain information data, use appropriate data compression algorithms (lossless compression algorithm ZIP, lossy compression algorithm JPEG, etc.) to reduce the amount of data transmitted and storage space.

[0038] Data aggregation: In the data processing module, data of the same type and within the same time period are aggregated, such as calculating the average, maximum, and minimum values ​​of temperature and humidity, thereby reducing the amount of data transmitted to the cloud platform.

[0039] Preprocessing flow; Data collected by IoT devices and supply chain information are first transmitted to the data processing module.

[0040] The data processing module performs preprocessing operations such as cleaning, noise reduction, compression, and aggregation on the data to generate a preprocessed structured dataset.

[0041] The pre-processed data is transmitted to the cloud platform via network communication protocols (TCP / IP, MQTT, etc.).

[0042] The cloud platform module is used to build a dynamic risk assessment model based on the AHP (Analytic Hierarchy Process) algorithm and XGBoost (Extreme Gradient Boosting Tree). The preprocessed structured dataset is input into the dynamic risk assessment model for identification to obtain the food safety risk index. Specifically, this embodiment also includes a noise reduction processing unit, which uses a mean filtering algorithm to perform noise reduction processing on the sensor data in the structured dataset to obtain noise-reduced structured data; The compression and aggregation unit is used to compress the noise-reduced structured data and then aggregate data of the same type and time period to obtain aggregated structured data. The communication transmission unit is used to transmit aggregated structured data to the cloud platform via the MQTT network communication protocol.

[0043] The noise reduction processing unit is used to perform noise reduction processing on the sensor data in the structured dataset using the mean filtering algorithm to obtain noise-reduced structured data; The compression and aggregation unit is used to compress the noise-reduced structured data and then aggregate data of the same type and time period to obtain aggregated structured data. The communication transmission unit is used to transmit aggregated structured data to the cloud platform via the MQTT network communication protocol.

[0044] Specifically, (i) the AHP (Analytical Hierarchical Analysis) algorithm is used to determine the weights of risk factors; Construct a hierarchical model; Target layer: Food safety risk assessment, which involves obtaining a food safety risk index through assessment to reflect the safety status of food.

[0045] Criteria Layer: Based on each link in the food supply chain and the main factors affecting food safety, criteria layer indicators are determined. These include raw material risk, processing risk, transportation and storage risk, and the reliability risk of testing data.

[0046] Indicator Layer: Each indicator at the criterion layer is further refined into specific indicators. For example, raw material risks include the degree of environmental pollution in the raw material's production area, the rate of pesticide residue exceeding standards, and the quality control capabilities of raw material suppliers; processing risks include the implementation of hygiene standards during processing, the cleanliness of processing equipment, and the rationality of processing techniques; transportation and storage risks include temperature and humidity control during transportation, the concentration of pollutants in the storage environment, and the duration of transportation and storage; and the reliability risks of testing data include the accuracy of testing equipment, the professional level of testing personnel, and the compliance of testing methods.

[0047] Expert scoring and judgment matrix construction; An expert panel comprised of food industry experts, testing personnel, and supply chain managers was formed to score the importance of each indicator at the indicator level relative to the indicators at the criteria level. A 1-9 scale was used, where 1 indicates that the two indicators are equally important, 3 indicates that one indicator is slightly more important than the other, 5 indicates that it is relatively important, 7 indicates that it is very important, 9 indicates that it is extremely important, and 2, 4, 6, and 8 are intermediate values.

[0048] For each criterion-level indicator, a judgment matrix is ​​constructed. For example, for the indicator-level indicators C1, C2, and C3 under raw material risk (R1), the judgment matrix is ​​formed after expert scoring; Weighting and consistency testing; The eigenvalue method is used to calculate the largest eigenvalue and the corresponding eigenvector of the judgment matrix. After normalizing the eigenvector, the weights of each index are obtained.

[0049] Perform a consistency check and calculate the consistency index CI and consistency ratio CR. When CR < 0.1, the judgment matrix has satisfactory consistency; otherwise, the judgment matrix needs to be readjusted.

[0050] (ii) Training of XGBoost extreme gradient boosting tree model; Dataset preparation; Extract sample data for training the model from the structured dataset, including input features (the values ​​of each indicator in the indicator layer) and output labels (the known food safety risk level).

[0051] The dataset is divided into training, validation, and test sets, typically in a 7:2:1 ratio.

[0052] Parameter settings; Key parameters of the XGBoost model are set, such as the learning rate (eta), maximum depth (max_depth), subsample rate, column sampling rate (colsample_bytree), and number of trees (n_estimators). The parameter combination is optimized through grid search and cross-validation to improve the model's prediction accuracy.

[0053] Model training and evaluation; The XGBoost model is trained using the training set, and the performance of the model is monitored using the validation set during training to prevent overfitting.

[0054] After training, the model is evaluated using a test set, and evaluation metrics such as accuracy, recall, and F1 score are calculated to ensure the effectiveness and generalization ability of the model.

[0055] (III) Integration of dynamic risk assessment models; The weights of each risk factor obtained by the AHP (Analytic Hierarchy Process) algorithm are used as input feature weights for the XGBoost model to construct a dynamic risk assessment model. A preprocessed structured dataset is input into the model, which learns the relationships between the weights and features of each risk factor to output a food safety risk index. The risk index ranges from 0 to 100, with higher values ​​indicating higher food safety risks.

[0056] The encryption tagging module is used to tag the tested food according to the food safety risk index and use the SHA-256 hash algorithm to generate a unique hash value for the structured dataset, thus obtaining the hash value of the tested data. Specifically, this embodiment also includes a serialization processing unit, which is used to serialize the preprocessed structured dataset and convert it into a byte stream format to obtain sequential structured data; The hash calculation unit is used to perform hash calculations on the sequence structured data using the SHA-256 hash algorithm, generate a 256-bit hash value, and obtain the hash value of the detection data.

[0057] Specifically, (i) food is tested based on risk index marking; Risk level classification; The food safety risk index is divided into four levels: low risk (0-25), low-to-medium risk (26-50), medium-to-high risk (51-75), and high risk (76-100).

[0058] Different labeling methods are used for different risk levels. For example, low-risk foods are labeled with green labels, low-to-medium risk foods with yellow labels, medium-to-high risk foods with orange labels, and high-risk foods with red labels. In addition to displaying the risk level, the labels may also include basic information about the food, the testing date, and risk factors.

[0059] Mark application scenarios; Attaching risk level labels to food packaging allows consumers to easily understand the safety status of the food.

[0060] In the enterprise's management system and the regulatory authority's platform, food products of different risk levels are classified and monitored, such as high-risk food products are subject to key testing and traceability.

[0061] (ii) The SHA-256 hash algorithm generates the hash value of the detection data; Data input processing; The preprocessed structured dataset is serialized into a byte stream format. This ensures data integrity and order, and avoids hash value generation errors caused by data format issues.

[0062] The process of generating hash values; The serialized byte stream data is hashed using the SHA-256 hash algorithm to generate a 256-bit hash value. The hash value is represented as a hexadecimal string and is unique and irreversible.

[0063] To improve the security and reliability of hash values, a salt can be added to the data. The salt is a randomly generated string that is used in the hash calculation along with the data to prevent the hash value from being brute-forced.

[0064] The data management module is used to write the tagged structured dataset and the hash value of the detection data into the blockchain for notarization, and to deploy smart contracts to perform compliance verification management.

[0065] Specifically, this embodiment also includes a data packaging unit, used to package the labeled structured dataset and the detection data hash value to generate transaction data; The data verification unit is used by each participating node to verify the transaction data. After successful verification, the transaction data is broadcast to the consortium blockchain network. The data query unit is used by participants to query the data storage information through a blockchain explorer, including the data's on-chain time, transaction hash value, and data content.

[0066] Specifically, (i) Blockchain selection and architecture design; Blockchain type selection; Considering the security, privacy, and regulatory requirements of food testing data, a consortium blockchain was chosen as the blockchain platform. The consortium blockchain is jointly maintained by multiple participants (food production companies, testing institutions, regulatory authorities, supply chain companies, etc.), each with specific permissions to ensure data sharing and collaboration.

[0067] Blockchain architecture; Node layer: This layer includes nodes from various participating parties, such as enterprise nodes, testing agency nodes, and regulatory department nodes. Nodes communicate with each other via a P2P network to achieve data transmission and consensus.

[0068] Consensus layer: Employs a consensus algorithm suitable for consortium blockchains, such as PBFT (Practical Byzantine Fault Tolerance), to ensure consensus among nodes and guarantee data consistency and reliability.

[0069] Data layer: Stores the tagged structured dataset and the hash values ​​of the detection data. It adopts the chain structure of the blockchain, where each block contains the hash value of the previous block, ensuring the immutability and traceability of the data.

[0070] Contract layer: Deploy smart contracts to automate compliance checks and cross-departmental collaborative processes.

[0071] (ii) Data storage process; Data on the blockchain; The labeled structured dataset and the hash values ​​of the detection data are packaged together to generate transaction data.

[0072] Each participating node verifies the transaction data, and once the verification is successful, the transaction data is broadcast to the consortium blockchain network.

[0073] Consensus nodes reach a consensus through a consensus algorithm, write transaction data into the blockchain, and generate new blocks.

[0074] Data query and traceability; Participants can query the data's storage information, including the data's on-chain time, transaction hash value, and data content, through a blockchain explorer or application interface.

[0075] When food safety issues arise, the traceability of blockchain can be used to quickly locate the source and distribution channels of problematic food products, enabling recall and disposal.

[0076] (iii) Smart contract writing and execution; Compliance verification of smart contracts; Define rules for compliance verification, such as whether food testing indicators meet national standards, whether supply chain information is complete, and whether risk level markings are correct.

[0077] The smart contract automatically performs compliance checks before data is uploaded to the blockchain. If the check passes, the data is allowed to be uploaded; if the check fails, an error message is returned, requiring the data provider to make corrections.

[0078] Smart contracts for cross-departmental collaborative processes; Design cross-departmental collaborative processes, such as automatically receiving and reviewing test data uploaded by testing institutions; and automatically triggering recall processes to notify relevant departments and enterprises when enterprises discover food safety issues.

[0079] Smart contracts automatically trigger corresponding operations based on preset processes and conditions, enabling information sharing and collaborative work across departments, thereby improving work efficiency and regulatory effectiveness.

[0080] Please see Figure 2 In a cloud-based food testing data management system, the data processing module includes: The data cleaning unit is used to clean the collected food testing data and supply chain information data, removing duplicate, erroneous, and invalid data to obtain cleaned testing data. The data unification unit is used to convert data of different formats and sources in cleaning and testing data into a unified format to obtain standard testing data; The data association unit is used to associate standard testing data with information data from various links in the supply chain, using the unique identifier of the food as the key index, to obtain associated testing data; The data fusion unit is used to determine the definition, data type, and constraints of each data field in the associated detection data, and to generate a structured dataset.

[0081] Please see Figure 3 In a cloud-based food testing data management system, the cloud platform module includes: The indicator determination unit is used to determine the criteria layer indicators based on the AHP (Analytic Hierarchy Process) algorithm, according to each link of the food supply chain and the main factors affecting food safety. These indicators include at least raw material risk, processing risk, transportation and storage risk, and reliability risk of testing data. The matrix construction unit is used to construct the judgment matrix. It uses the eigenvalue method to calculate the largest eigenvalue and the corresponding eigenvector of the judgment matrix, and then normalizes the eigenvector to obtain the weight of each index. The weight output unit is used to calculate the consistency index and consistency ratio. When the consistency ratio is less than 0.1, the judgment matrix has satisfactory consistency; otherwise, the judgment matrix needs to be readjusted, and the weights of each risk factor are output.

[0082] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A cloud-based food testing data management system, characterized in that, The food testing data management system includes: The data processing module is used to collect food testing data through IoT devices and acquire supply chain information data. The data is then fused to generate a structured dataset. The structured dataset is preprocessed in the data processing module and then transmitted to the cloud platform. The cloud platform module is used to construct a dynamic risk assessment model based on the AHP (Analytic Hierarchy Process) algorithm and XGBoost (Extreme Gradient Boosting Tree). The preprocessed structured dataset is input into the dynamic risk assessment model for identification to obtain the food safety risk index. The encryption tagging module is used to tag the tested food according to the food safety risk index and generate a unique hash value of the structured dataset using the SHA-256 hash algorithm to obtain the test data hash value. The data management module is used to write the marked structured dataset and the hash value of the detection data into the blockchain for evidence storage, and to deploy smart contracts to perform compliance verification management.

2. The cloud-based food testing data management system as described in claim 1, characterized in that, The data processing module includes the following units: The data cleaning unit is used to clean the collected food testing data and supply chain information data, removing duplicate, erroneous, and invalid data to obtain cleaned testing data. The data unification unit is used to convert data of different formats and sources in the cleaning and testing data into a unified format to obtain standard testing data; The data association unit is used to associate the standard testing data with information data from each link in the supply chain, using the unique identifier of the food as the key index, to obtain associated testing data; The data fusion unit is used to determine the definition, data type and constraints of each data field in the associated detection data, and generate a structured dataset.

3. The cloud-based food testing data management system as described in claim 1, characterized in that, The data processing module also includes the following units: The noise reduction processing unit is used to perform noise reduction processing on the sensor data in the structured dataset using a mean filtering algorithm to obtain noise-reduced structured data. The compression and aggregation unit is used to compress the noise-reduced structured data and then aggregate data of the same type and time period to obtain aggregated structured data. The communication transmission unit is used to transmit the aggregated structured data to the cloud platform via the MQTT network communication protocol.

4. The cloud-based food testing data management system as described in claim 1, characterized in that, The cloud platform module includes the following units: The indicator determination unit is used to determine the criteria layer indicators based on the AHP (Analytic Hierarchy Process) algorithm, according to each link of the food supply chain and the main factors affecting food safety. These indicators include at least raw material risk, processing risk, transportation and storage risk, and reliability risk of testing data. The matrix construction unit is used to construct the judgment matrix. It uses the eigenvalue method to calculate the largest eigenvalue and the corresponding eigenvector of the judgment matrix, and then normalizes the eigenvector to obtain the weight of each index. The weight output unit is used to calculate the consistency index and consistency ratio. When the consistency ratio is less than 0.1, the judgment matrix has satisfactory consistency; otherwise, the judgment matrix needs to be readjusted and the weights of each risk factor are output.

5. The cloud-based food testing data management system as described in claim 1, characterized in that, The cloud platform module includes the following units: The data extraction unit is used to extract sample data for training the model from the preprocessed structured dataset, including input features and output labels; The parameter setting unit is used to set the key parameters of the XGBoost extreme gradient boosting tree, including at least the learning rate, maximum depth, subsampling rate, column sampling rate, and number of trees. The risk output unit is used to take the weights of each risk factor obtained by the AHP (Analytic Hierarchy Process) algorithm as the input feature weights of the XGBoost model. By learning the relationship between the weights and features of each risk factor, it outputs a food safety risk index.

6. The cloud-based food testing data management system as described in claim 1, characterized in that, The encryption tag module includes the following units: The serialization processing unit is used to serialize the preprocessed structured dataset, convert it into a byte stream format, and obtain sequential structured data. The hash calculation unit is used to perform hash calculation on the sequence structured data using the SHA-256 hash algorithm to generate a 256-bit hash value and obtain the detection data hash value.

7. The cloud-based food testing data management system as described in claim 1, characterized in that, The data management module includes the following units: The data packaging unit is used to package the labeled structured dataset and the hash value of the detection data to generate transaction data; The data verification unit is used by each participating node to verify the transaction data. After successful verification, the transaction data is broadcast to the consortium blockchain network. The data query unit is used by participants to query the data storage information through a blockchain explorer, including the data's on-chain time, transaction hash value, and data content.

8. A cloud computing-based food testing data management method, characterized in that, The method includes the following steps: Food testing data is collected through IoT devices, and supply chain information data is obtained at the same time. The data is then merged to generate a structured dataset. The structured dataset is preprocessed in the data processing module and then transmitted to the cloud platform. A dynamic risk assessment model is constructed based on the AHP (Analytic Hierarchy Process) algorithm and XGBoost (Extreme Gradient Boosting Tree). The preprocessed structured dataset is input into the dynamic risk assessment model for identification to obtain the food safety risk index. The tested food is labeled according to the food safety risk index, and a unique hash value of the structured dataset is generated using the SHA-256 hash algorithm to obtain the hash value of the tested data. The labeled structured dataset and the hash value of the detection data are written into the blockchain for evidence storage, and a smart contract is deployed to perform compliance verification management.

9. The cloud computing-based food testing data management method as described in claim 8, characterized in that, The method includes the following steps: The collected food testing data and supply chain information data are cleaned to remove duplicate, erroneous, and invalid data, resulting in cleaned testing data. The cleaning test data of different formats and sources are converted into a unified format to obtain standard test data; Using the unique identifier of the food as a key index, the standard testing data is linked with information data from each link in the supply chain to obtain linked testing data; The definitions, data types, and constraints of each data field in the associated detection data are determined, and a structured dataset is generated.

10. The cloud computing-based food testing data management method as described in claim 8, characterized in that, The method includes the following steps: The sensor data in the structured dataset is denoised using a mean filtering algorithm to obtain denoised structured data. After the noise-reduced structured data is compressed, data of the same type and within the same time period are aggregated to obtain aggregated structured data. The aggregated structured data is transmitted to the cloud platform via the MQTT network communication protocol.

Citation Information

Patent Citations

  • A blockchain-based method and system for detecting and tracing medicinal and edible ingredients

    CN119762100A