Food quality safety traceability system and method based on block chain technology
Through the food quality and safety traceability system based on blockchain technology, real-time collection and analysis of food status information is solved, the problem of insufficient food traceability efficiency and accuracy in the existing technology is solved, efficient tracking and response to food quality abnormalities is achieved, and the degree of systematization of food safety monitoring is improved.
Patent Information
- Application Number
- CN202411669003.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing food quality monitoring system has problems such as monitoring of single environmental parameters and lack of cross-analysis of multi-dimensional parameters in food traceability, resulting in insufficient traceability efficiency and accuracy, especially when multiple factors act simultaneously, it is difficult to accurately identify the root cause of quality problems.
The food quality and safety traceability system based on blockchain technology is adopted to collect food status information in real time through IoT devices, perform data normalization processing and feature extraction, calculate deviation index to judge the abnormality of the food surface state, and conduct risk assessment and traceability circulation path marking.
It realizes efficient tracking and response to food quality abnormalities, improves the accuracy of abnormal status recognition, ensures transparency and dynamic optimization of food quality and safety, and significantly improves the systematic degree of food safety monitoring.
Smart Images

Figure CN119722096A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a food quality and safety traceability system and method based on blockchain technology. Background Art
[0002] For the entire process of food production, transportation, storage and sales. With the advancement of technology, supply chain management no longer relies solely on traditional recording methods, but has begun to gradually apply advanced technologies such as the Internet of Things and blockchain to ensure the transparency of information in each link. In food safety traceability, food quality issues are the core of great concern in all links. By tracking and recording multi-dimensional parameters of food transportation environment and storage conditions, the status of food can be monitored in a timely manner.
[0003] However, in the current food quality monitoring system, due to the single monitoring of environmental parameters and the lack of effective cross-analysis of multi-dimensional parameters, the tracing of problems is often limited to a single link. For example, temperature abnormalities are often the direct manifestation of food spoilage, but this may not be the only reason. Fluctuations in humidity and pressure, as well as damage, can also have an impact on food. The existing traceability system is difficult to effectively distinguish the dominant influence of these multi-dimensional factors, and lacks an automatic analysis mechanism, resulting in insufficient information or misjudgment in anomaly detection. Especially in long-term transportation or complex storage environments, when multiple factors fluctuate at the same time, the existing system is often unable to accurately identify which factor caused the food quality problem, and the traceability efficiency and accuracy are both lacking. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a food quality and safety traceability system and method based on blockchain technology, which solves the problems mentioned in the background technology.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a food quality and safety traceability method based on blockchain technology, comprising the following steps:
[0006] S1. Collect food status information in real time through IoT devices, including food physical integrity information and food appearance consistency information, form a food feature vector set Es, and upload it to the blockchain cloud platform;
[0007] S2. Perform data normalization processing according to the food feature vector set Es, and simultaneously perform feature extraction and correlation analysis to obtain a feature extraction vector set Te;
[0008] S3, calculating the deviation index Dx according to the acquired feature extraction vector set Te, judging the abnormality of the food surface state, and obtaining the abnormal state result of the food surface;
[0009] S4. Verify the risk assessment of the abnormal state of the food surface on the food quality based on the abnormal state of the food surface, obtain the comprehensive risk index Rs, and match it with the preset food quality risk assessment threshold SZ to obtain the food quality assessment plan;
[0010] S5. Trigger the traceability flow path of food quality according to the content of the food quality assessment plan, mark the blockchain timestamp and node analysis results, and send relevant prompts to the quality and safety inspection personnel for confirmation;
[0011] S6. Based on the feedback information from quality and safety inspectors, compare the actual feedback information with the comprehensive risk index Rs to obtain an optimization adjustment plan for the comprehensive risk index Rs.
[0012] Preferably, said S1 includes S11 and S12;
[0013] S11. The food status information received by this block is collected in real time through the Internet of Things devices, including food physical integrity information and food appearance consistency information. The food physical integrity information is obtained by using laser scanning, high-definition cameras and contact sensors to detect food surface cracks, flatness and damage status information, and the surface crack ratio Fs and surface flatness Ss are obtained; the food appearance consistency information is obtained by using near-infrared spectroscopy technology, capacitive sensors and multi-spectral imaging technology to check the moisture and color uniformity of the food surface, and the surface wetness Ms and color uniformity Cu are obtained;
[0014] S12. Integrate the surface crack ratio Fs, surface flatness Ss, surface wetness Ms and surface color uniformity Cu to form a food feature vector set Es = {Fs, Ss, Ms, Cu}, and upload it to the blockchain cloud platform via the Internet for real-time marking and food status information received in this block.
[0015] Preferably, S2 includes S21 and S22;
[0016] S21. Performing data normalization processing according to the uploaded food feature vector set Es to eliminate the dimensional differences of different parameters, and generating a normalized feature vector set Enorm={Fn, Sn, Mn, Cn}, where Fn represents the normalized crack ratio, Sn represents the normalized flatness, Mn represents the normalized wetness, and Cu represents the normalized color uniformity;
[0017] S22, performing feature extraction and correlation analysis on the normalized feature vector set Enorm to obtain a wet smoothness correlation factor Vms and a crack color correlation factor Vfc, and then reorganizing the normalized feature vector set Enorm to obtain a feature extraction vector set Te = {Fn, Sn, Mn, Cn, Vms, Vfc};
[0018] The wet smoothness correlation factor Vms is obtained by the following calculation formula:
[0019]
[0020] In the formula, exp represents the exponential decay function, which specifically adjusts the correlation between the normalized wetness Mn and the normalized flatness Sn;
[0021] The crack color correlation factor Vfc is obtained by Obtain the calculation formula.
[0022] Preferably, said S3 includes S31 and S32;
[0023] S31, performing deviation calculation according to the acquired feature extraction vector set Te, obtaining a deviation index Dx, which is used to judge the abnormality of the food surface state, wherein the deviation index Dx is specifically Dx={DFn, DSn, DMn, DCn, DVms, DVfc};
[0024] Among them, DFn represents the normalized crack ratio deviation value, DSn represents the normalized flatness deviation value, DMn represents the normalized wetness deviation value, DCn represents the normalized color uniformity deviation value, DVms represents the wetness and smoothness correlation factor deviation value, and DVfc represents the crack color correlation factor deviation value;
[0025] The deviation index Dx is specifically obtained by the following calculation formula:
[0026]
[0027] Where N represents the length of the feature extraction vector set Te, specifically the total number of vectors included in the feature extraction vector set Te, i represents the i-th vector, Te i represents the i-th vector in the feature extraction vector set Te, and ln represents the logarithmic function.
[0028] Preferably, S32, by summarizing the deviation index Dx obtained by calculation, obtaining the total deviation Rabn, and matching it with the preset food quality deviation assessment threshold Rth, judging the abnormality of the food surface state, and obtaining the abnormal state result of the food surface;
[0029] The total number of deviations Rabn is obtained by the following calculation formula:
[0030]
[0031] Where M represents the length of the deviation index Dx, specifically the total number of deviation values included in the deviation index Dx, j represents the jth deviation value, and Dx jrepresents the jth deviation value in the deviation index Dx;
[0032] The abnormal state result of the food surface is obtained by the following matching method:
[0033] When the total number of deviations Rabn ≥ the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as an abnormal result, and the food quality score SZL=1 is marked, and the relevant detection is prompted that the current food needs to be eliminated and marked, and the marking information of the current food is uploaded to the blockchain cloud platform simultaneously. Specifically, the abnormal result, timestamp and block information are marked by obtaining the unique information of the current food. At the same time, the unique information of the same food will continue to accumulate when the food quality SZL appears;
[0034] When the total number of deviations Rabn is less than the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as a normal result, and the food quality score SZL is marked as 0;
[0035] When the total deviation Rabn ≥ twice the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as the warning result, and the food quality score SZL=9 is marked. The warning result is sent to the relevant control personnel in real time to prompt them to suspend the food disposal process. At the same time, the warning result, timestamp and block information of the current food are marked, uploaded to the blockchain cloud platform, and a top prompt is given. At the same time, when the food quality score SZL appears in the unique information of the same food, it will continue to accumulate.
[0036] Preferably, said S4 includes S41 and S42;
[0037] S41. Verify the risk assessment of the abnormal state of the food surface on the food quality based on the abnormal state of the food surface. Specifically, when the abnormal state result of the food surface is an abnormal result and a warning result, the risk assessment of the abnormal state of the food surface on the food quality is triggered, including accumulating the food quality score SZL within a fixed time range and a fixed quantity range to obtain the comprehensive risk index Rs.
[0038] The comprehensive risk index Rs is obtained by the following calculation formula:
[0039]
[0040] Wherein, Ct and Cq represent the total number of abnormal time series marks and the total number of abnormal quantity marks of the accumulated food quality score SZL within a fixed time range and a fixed quantity range, respectively; Tmax and Qmax represent the upper limit of abnormal time series marks and the upper limit of abnormal quantity marks within a fixed time range and a fixed quantity range, respectively; r1 and r2 represent the preset weight coefficients of the calculation results of the total number of abnormal time series marks Ct and the upper limit of abnormal time series marks Tmax and the total number of abnormal quantity marks Cq and the upper limit of abnormal quantity marks Qmax, respectively; and 0<r1+r2≤1, and the specific value is set by the user;
[0041] The total number of abnormal markers in the time series Ct is The calculation formula is obtained, where SZL t SZL represents the food quality score of the food at time t on the blockchain cloud platform, and T represents the fixed time range of the preset food inspection;
[0042] The total number of abnormal markers in the quantitative sequence Cq is The calculation formula is obtained, where SZL q It represents the food quality score SZL of the qth food on the regional chain cloud platform, and Q represents the fixed quantity range of the preset food inspection.
[0043] Preferably, S42, obtaining a food quality assessment scheme by matching the obtained comprehensive risk index Rs with a preset food quality risk assessment threshold SZ;
[0044] The food quality assessment scheme is obtained by matching:
[0045] When the comprehensive risk index Rs ≥ the food quality risk assessment threshold SZ, obtain the quality and safety abnormality plan for the current food batch, mark the transportation, warehousing and detection abnormalities of the current batch of food on the blockchain cloud platform, and notify relevant personnel to recall and centrally dispose of all foods in the current food batch;
[0046] When the comprehensive risk index Rs is less than the food quality risk assessment threshold SZ, the normal quality and safety plan for the current food batch is obtained, and the current batch of food is marked as qualified on the blockchain cloud platform at the same time.
[0047] Preferably, said S5 includes S51 and S52;
[0048] S51. Trigger the traceability circulation path of food quality according to the content of the food quality assessment plan. When the content of the food quality assessment plan includes the quality and safety abnormality plan content of the current food batch, trigger the traceability circulation path of food quality, mark the blockchain timestamp and node analysis results, and send relevant prompts to the quality and safety inspection personnel for confirmation. The prompts include the uniqueness information of the abnormal food, the quality and safety abnormality plan content of the current food batch and the comprehensive risk index Rs.
[0049] Preferably, S6, based on the feedback information from the quality and safety inspectors, including the total number of food abnormalities STZ, the actual feedback information is compared with the comprehensive risk index Rs to obtain an optimization adjustment plan for the comprehensive risk index Rs;
[0050] The optimization adjustment scheme is obtained by the following calculation formula:
[0051]
[0052]
[0053] In the formula, r1 new and r2 new They respectively represent the preset weight coefficients of the optimized total number of time series abnormal marks Ct and the upper limit value of time series abnormal marks Tmax and the total number of quantity series abnormal marks Cq and the upper limit value of quantity series abnormal marks Qmax, and γ represents the proportional factor, which is specifically used to adjust the sensitivity of the weight coefficient.
[0054] The food quality and safety traceability system based on blockchain technology includes food information collection module, information processing module, deviation calculation module, quality assessment module, feedback module and optimization module;
[0055] The food information collection module collects food status information in real time through IoT devices, including food physical integrity information and food appearance consistency information, forms a food feature vector set Es, and uploads it to the blockchain cloud platform;
[0056] The information processing module performs data normalization processing according to the food feature vector set Es, and simultaneously performs feature extraction and correlation analysis to obtain a feature extraction vector set Te;
[0057] The deviation calculation module calculates the deviation index Dx according to the acquired feature extraction vector set Te, determines the abnormality of the food surface state, and obtains the abnormal state result of the food surface;
[0058] The quality assessment module verifies the risk assessment of the abnormal state of the food surface on the food quality according to the abnormal state result of the food surface, obtains the comprehensive risk index Rs, and matches it with the preset food quality risk assessment threshold SZ to obtain the food quality assessment plan;
[0059] The feedback module triggers the traceability flow path of food quality according to the content of the food quality assessment plan, marks the blockchain timestamp and node analysis results, and sends relevant prompts to the quality and safety inspection personnel for confirmation;
[0060] The optimization module compares the actual feedback information with the comprehensive risk index Rs based on the feedback information from the quality and safety inspection personnel, and obtains an optimization adjustment plan for the comprehensive risk index Rs.
[0061] The present invention provides a food quality and safety traceability system and method based on blockchain technology, which has the following beneficial effects:
[0062] (1) Through the collection of IoT devices, the food feature vector set Es is generated. Subsequently, the data is normalized and feature extracted to generate the feature extraction vector set Te, which further measures the degree of abnormality of the food surface state, and the abnormal state of the food surface is obtained through judgment. The comprehensive risk index Rs and the food quality risk assessment threshold SZ are calculated and matched to generate a targeted quality assessment plan, and the flow path is traced based on the blockchain, and abnormal nodes are marked and notified to ensure timely traceability and control. Finally, according to the feedback information from quality and safety inspectors, the calculation model of the comprehensive risk index Rs is dynamically adjusted to improve the flexibility and accuracy of risk judgment. Efficient tracking and response to food quality abnormalities realizes refined control and dynamic optimization of food quality and safety in the entire supply chain process.
[0063] (2) Through multi-dimensional food surface state deviation analysis, the accuracy of abnormal state identification is effectively improved. And through the set scoring mark food quality score SZL, the system can not only accurately mark abnormal and warning situations, but also track the circulation information of abnormal food on the blockchain through timestamps and unique information, realizing the complete quality chain management from source to final batch. In addition, the system can dynamically identify batch risks and generate targeted quality assessment plans through the cumulative statistics of the time range and quantity range of the comprehensive risk index Rs, so that batch problems can be detected in time and effective countermeasures can be taken. Finally, this method realizes the transparency of food quality status through blockchain, reminds relevant personnel in real time to recall or dispose of problematic batches of food, and significantly improves the systematization of food safety monitoring.
[0064] (3) When a food batch is detected to have quality and safety anomalies, the food quality traceability circulation path is automatically triggered, and the unique information of the abnormal food, the quality and safety anomaly plan content of the current food batch, and the key data of the comprehensive risk index Rs are uploaded to the blockchain, so as to realize the rapid identification and transmission of abnormal information. At the same time, by sending real-time prompts to quality and safety inspection personnel, it is convenient for relevant personnel to confirm the specific abnormal nodes of the current batch of food. And by feedback optimization of the dynamic adjustment method of the comprehensive risk index, the system has higher sensitivity and accuracy to batch anomalies, and timely response to abnormal batches is achieved through optimization of the model, which overcomes the shortcomings of traditional detection methods in abnormal identification and response, which are inflexible and difficult to adapt to the risk fluctuations of different batches. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a schematic diagram of the steps of the food quality and safety traceability method based on blockchain technology of the present invention;
[0066] Figure 2 This is a schematic diagram of the food quality and safety traceability system based on blockchain technology in the present invention. DETAILED DESCRIPTION
[0067] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0068] Example 1
[0069] The present invention provides a food quality and safety traceability method based on blockchain technology, please refer to Figure 1 , including the following steps:
[0070] S1. Collect food status information in real time through IoT devices, including food physical integrity information and food appearance consistency information, form a food feature vector set Es, and upload it to the blockchain cloud platform;
[0071] S2. Perform data normalization processing according to the food feature vector set Es, and simultaneously perform feature extraction and correlation analysis to obtain a feature extraction vector set Te;
[0072] S3, calculating the deviation index Dx according to the acquired feature extraction vector set Te, judging the abnormality of the food surface state, and obtaining the abnormal state result of the food surface;
[0073] S4. Verify the risk assessment of the abnormal state of the food surface on the food quality based on the abnormal state of the food surface, obtain the comprehensive risk index Rs, and match it with the preset food quality risk assessment threshold SZ to obtain the food quality assessment plan;
[0074] S5. Trigger the traceability flow path of food quality according to the content of the food quality assessment plan, mark the blockchain timestamp and node analysis results, and send relevant prompts to the quality and safety inspection personnel for confirmation;
[0075] S6. Based on the feedback information from quality and safety inspectors, compare the actual feedback information with the comprehensive risk index Rs to obtain an optimization adjustment plan for the comprehensive risk index Rs.
[0076] In this embodiment, the food feature vector set Es is generated through the collection of IoT devices and uploaded to the blockchain platform, so that the data is tamper-proof and provides a reliable basis for subsequent analysis. Subsequently, the data normalization processing and feature extraction generate the feature extraction vector set Te, realize the correlation analysis between different features, and make the fluctuation of food state change more referenceable. The deviation index Dx calculated based on the feature extraction vector set Te further measures the abnormal degree of the food surface state, and obtains the abnormal state result of the food surface by judgment. In addition, the method uses the abnormal state result of the food surface to conduct risk assessment on food quality, calculates and matches the comprehensive risk index Rs with the food quality risk assessment threshold SZ to generate a targeted quality assessment plan, and traces the flow path based on the blockchain, marks and notifies at the abnormal nodes, and ensures timely traceability and control. Finally, according to the feedback information from the quality and safety inspection personnel, the calculation model of the comprehensive risk index Rs is dynamically adjusted to improve the flexibility and accuracy of risk judgment. Through the above steps, the system can efficiently track and respond to abnormal food quality issues, realize refined control and dynamic optimization of food quality and safety throughout the entire supply chain, and effectively make up for the shortcomings of traditional methods such as gaps in food data monitoring, inaccurate traceability, and delayed risk assessment.
[0077] Example 2
[0078] This embodiment is explained in Example 1, please refer to Figure 1 , specifically: the S1 includes S11 and S12;
[0079] S11. The food status information received by this block is collected in real time through the Internet of Things devices, including food physical integrity information and food appearance consistency information. The food physical integrity information is obtained by using laser scanning, high-definition cameras and contact sensors to detect food surface cracks, flatness and damage status information, and the surface crack ratio Fs and surface flatness Ss are obtained; the food appearance consistency information is obtained by using near-infrared spectroscopy technology, capacitive sensors and multi-spectral imaging technology to check the moisture and color uniformity of the food surface, and the surface wetness Ms and color uniformity Cu are obtained;
[0080] S12. Integrate the surface crack ratio Fs, surface flatness Ss, surface wetness Ms and surface color uniformity Cu to form a food feature vector set Es = {Fs, Ss, Ms, Cu}, and upload it to the blockchain cloud platform via the Internet for real-time marking and food status information received in this block.
[0081] The S2 includes S21 and S22;
[0082] S21. Performing data normalization processing according to the uploaded food feature vector set Es to eliminate the dimensional differences of different parameters, and generating a normalized feature vector set Enorm={Fn, Sn, Mn, Cn}, where Fn represents the normalized crack ratio, Sn represents the normalized flatness, Mn represents the normalized wetness, and Cu represents the normalized color uniformity;
[0083] S22, performing feature extraction and correlation analysis on the normalized feature vector set Enorm to obtain a wet smoothness correlation factor Vms and a crack color correlation factor Vfc, and then reorganizing the normalized feature vector set Enorm to obtain a feature extraction vector set Te = {Fn, Sn, Mn, Cn, Vms, Vfc};
[0084] The wet smoothness correlation factor Vms is obtained by the following calculation formula:
[0085]
[0086] In the formula, exp represents the exponential decay function, which specifically adjusts the correlation between the normalized wetness Mn and the normalized flatness Sn;
[0087] The crack color correlation factor Vfc is obtained by Obtain the calculation formula.
[0088] Example 3
[0089] This embodiment is explained in Example 2. Please refer to Figure 1 , specifically: S3 includes S31 and S32;
[0090] S31, performing deviation calculation according to the acquired feature extraction vector set Te, obtaining a deviation index Dx, which is used to judge the abnormality of the food surface state, wherein the deviation index Dx is specifically Dx={DFn, DSn, DMn, DCn, DVms, DVfc};
[0091] Among them, DFn represents the normalized crack ratio deviation value, DSn represents the normalized flatness deviation value, DMn represents the normalized wetness deviation value, DCn represents the normalized color uniformity deviation value, DVms represents the wetness and smoothness correlation factor deviation value, and DVfc represents the crack color correlation factor deviation value;
[0092] The deviation index Dx is specifically obtained by the following calculation formula:
[0093]
[0094] Where N represents the length of the feature extraction vector set Te, specifically the total number of vectors included in the feature extraction vector set Te, i represents the i-th vector, Te i represents the i-th vector in the feature extraction vector set Te, and ln represents the logarithmic function, which is specifically used to smooth the deviation value of the i-th vector in the feature extraction vector set Te to avoid over-amplifying small differences. It converts subtle deviations into controllable changes instead of linear amplification.
[0095] S32, by summarizing the deviation index Dx obtained by calculation, obtaining the total deviation Rabn, and matching it with the preset food quality deviation assessment threshold Rth, judging the abnormality of the food surface state, and obtaining the abnormal state result of the food surface;
[0096] The total number of deviations Rabn is obtained by the following calculation formula:
[0097]
[0098] Where M represents the length of the deviation index Dx, specifically the total number of deviation values included in the deviation index Dx, j represents the jth deviation value, and Dx j represents the jth deviation value in the deviation index Dx, represents the average value of all deviation indices, measuring the overall deviation, It is specifically used to measure the fluctuation intensity of the deviation value and reflect the degree of abnormal fluctuation;
[0099] The abnormal state result of the food surface is obtained by the following matching method:
[0100] When the total number of deviations Rabn ≥ the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as an abnormal result, and the food quality score SZL=1 is marked, and the relevant detection is prompted that the current food needs to be eliminated and marked, and the marking information of the current food is uploaded to the blockchain cloud platform simultaneously. Specifically, the abnormal result, timestamp and block information are marked by obtaining the unique information of the current food. At the same time, the unique information of the same food will continue to accumulate when the food quality SZL appears;
[0101] When the total number of deviations Rabn is less than the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as a normal result, and the food quality score SZL is marked as 0;
[0102] When the total deviation Rabn ≥ twice the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as the warning result, and the food quality score SZL=9 is marked. The warning result is sent to the relevant control personnel in real time to prompt them to suspend the food disposal process. At the same time, the warning result, timestamp and block information of the current food are marked, uploaded to the blockchain cloud platform, and a top prompt is given. At the same time, when the food quality score SZL appears in the unique information of the same food, it will continue to accumulate.
[0103] The S4 includes S41 and S42;
[0104] S41. Verify the risk assessment of the abnormal state of the food surface on the food quality based on the abnormal state of the food surface. Specifically, when the abnormal state result of the food surface is an abnormal result and a warning result, verify the risk assessment of the abnormal state of the food surface on the food quality, including accumulating the food quality score SZL within a fixed time range and a fixed quantity range to obtain the comprehensive risk index Rs.
[0105] The comprehensive risk index Rs is obtained by the following calculation formula:
[0106]
[0107] Wherein, Ct and Cq represent the total number of abnormal time series marks and the total number of abnormal quantity marks of the accumulated food quality score SZL within a fixed time range and a fixed quantity range, respectively; Tmax and Qmax represent the upper limit of abnormal time series marks and the upper limit of abnormal quantity marks within a fixed time range and a fixed quantity range, respectively; r1 and r2 represent the preset weight coefficients of the calculation results of the total number of abnormal time series marks Ct and the upper limit of abnormal time series marks Tmax and the total number of abnormal quantity marks Cq and the upper limit of abnormal quantity marks Qmax, respectively; and 0<r1+r2≤1, and the specific value is set by the user;
[0108] The total number of abnormal markers in the time series Ct is The calculation formula is obtained, where SZL t SZL represents the food quality score of the food at time t on the blockchain cloud platform, and T represents the fixed time range of the preset food inspection;
[0109] The total number of abnormal markers in the quantitative sequence Cq is The calculation formula is obtained, where SZL q It represents the food quality score SZL of the qth food on the regional chain cloud platform, and Q represents the fixed quantity range of the preset food inspection.
[0110] S42, obtaining a food quality assessment plan by matching the obtained comprehensive risk index Rs with a preset food quality risk assessment threshold SZ;
[0111] The food quality assessment scheme is obtained by matching:
[0112] When the comprehensive risk index Rs ≥ the food quality risk assessment threshold SZ, obtain the quality and safety abnormality plan for the current food batch, mark the transportation, warehousing and detection abnormalities of the current batch of food on the blockchain cloud platform, and notify relevant personnel to recall and centrally dispose of all foods in the current food batch;
[0113] When the comprehensive risk index Rs is less than the food quality risk assessment threshold SZ, the normal quality and safety plan for the current food batch is obtained, and the current batch of food is marked as qualified on the blockchain cloud platform at the same time.
[0114] In this embodiment, the accuracy of abnormal state identification is effectively improved through multi-dimensional food surface state deviation analysis. After the food surface state is judged in real time, the comparison of the total deviation Rabn and the food quality deviation assessment threshold Rth further refines the abnormal state of the food, ensuring timely identification and accurate marking of different risk levels. Through the set scoring identifier food quality score SZL, the system can not only accurately mark abnormal and early warning situations, but also track the circulation information of abnormal food on the blockchain through timestamps and unique information, realizing complete quality chain management from source to final batch. In addition, the system can dynamically identify batch risks and generate targeted quality assessment plans through the time range and quantity range cumulative statistics of the comprehensive risk index Rs, so that batch problems can be detected in time and effective countermeasures can be taken. Finally, the method realizes the transparency of food quality status through blockchain, reminds relevant personnel to recall or dispose of problematic batches of food in real time, and significantly improves the systematization of food safety monitoring.
[0115] Example 4
[0116] This embodiment is explained in Example 3, please refer to Figure 1 , specifically: the S5 includes S51 and S52;
[0117] S51. Trigger the traceability circulation path of food quality according to the content of the food quality assessment plan. When the content of the food quality assessment plan includes the quality and safety abnormality plan content of the current food batch, trigger the traceability circulation path of food quality, mark the blockchain timestamp and node analysis results, and send relevant prompts to the quality and safety inspection personnel for confirmation. The prompts include the uniqueness information of the abnormal food, the quality and safety abnormality plan content of the current food batch and the comprehensive risk index Rs.
[0118] Among them, S6, based on the feedback information from the quality and safety inspectors, including the total number of food abnormalities STZ, compare the actual feedback information with the comprehensive risk index Rs to obtain an optimization adjustment plan for the comprehensive risk index Rs;
[0119] The optimization adjustment scheme is obtained by the following calculation formula:
[0120]
[0121] In the formula, r1 new and r2 new They respectively represent the preset weight coefficients of the optimized total number of time series abnormal marks Ct and the upper limit value of time series abnormal marks Tmax and the total number of quantity series abnormal marks Cq and the upper limit value of quantity series abnormal marks Qmax, and γ represents the proportional factor, which is specifically used to adjust the sensitivity of the weight coefficient.
[0122] Among them, when the comprehensive risk index Rs is less than the total number of food abnormality statistics STZ, the difference percentage is positive, r1 is increased and r2 is reduced to increase the weight of the time range abnormality, so that the comprehensive risk index Rs is adjusted upward and close to the actual feedback;
[0123] When the comprehensive risk index Rs is greater than the total number of food abnormalities STZ, the difference percentage is negative, which reduces r1 and increases r2 to enhance the weight of quantity abnormalities, so that the comprehensive risk index Rs is adjusted downward and is close to the actual feedback.
[0124] In this embodiment, when a food batch is detected to have quality and safety anomalies, the traceability flow path of food quality is automatically triggered, and the unique information of abnormal food, the quality and safety anomaly plan content of the current food batch, and the key data of the comprehensive risk index Rs are uploaded to the blockchain to achieve rapid identification and transmission of abnormal information. At the same time, by sending real-time prompts to quality and safety inspection personnel, it is convenient for relevant personnel to confirm the specific abnormal nodes of the current batch of food. Based on the total number of food anomaly statistics STZ fed back by quality and safety inspection personnel, the system optimizes the calculation of the comprehensive risk index Rs by dynamically adjusting the weight coefficient. Including automatically adjusting the abnormal weights of time series and quantity series according to the difference percentage, and optimizing the dynamic adjustment method of the comprehensive risk index through feedback, so that the system has higher sensitivity and accuracy to batch anomalies, and realizes timely response to abnormal batches through optimization models, overcoming the shortcomings of inflexible abnormal identification and response in traditional detection methods, and difficulty in adapting to risk fluctuations of different batches.
[0125] Example 5
[0126] For food quality and safety traceability system based on blockchain technology, please refer to Figure 2 ,Specifically: including food information collection module, information processing module, deviation calculation module, quality assessment module, feedback module and optimization module;
[0127] The food information collection module collects food status information in real time through IoT devices, including food physical integrity information and food appearance consistency information, forms a food feature vector set Es, and uploads it to the blockchain cloud platform;
[0128] The information processing module performs data normalization processing according to the food feature vector set Es, and simultaneously performs feature extraction and correlation analysis to obtain a feature extraction vector set Te;
[0129] The deviation calculation module calculates the deviation index Dx according to the acquired feature extraction vector set Te, determines the abnormality of the food surface state, and obtains the abnormal state result of the food surface;
[0130] The quality assessment module verifies the risk assessment of the abnormal state of the food surface on the food quality according to the abnormal state result of the food surface, obtains the comprehensive risk index Rs, and matches it with the preset food quality risk assessment threshold SZ to obtain the food quality assessment plan;
[0131] The feedback module triggers the traceability flow path of food quality according to the content of the food quality assessment plan, marks the blockchain timestamp and node analysis results, and sends relevant prompts to the quality and safety inspection personnel for confirmation;
[0132] The optimization module compares the actual feedback information with the comprehensive risk index Rs based on the feedback information from the quality and safety inspection personnel, and obtains an optimization adjustment plan for the comprehensive risk index Rs.
[0133] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A food quality and safety traceability method based on blockchain technology, characterized by: The following steps are involved: S1. Collect food status information in real time through IoT devices, including food physical integrity information and food appearance consistency information, form a food feature vector set Es, and upload it to the blockchain cloud platform; S2. Perform data normalization processing according to the food feature vector set Es, and simultaneously perform feature extraction and correlation analysis to obtain a feature extraction vector set Te; S3, calculating the deviation index Dx according to the acquired feature extraction vector set Te, judging the abnormality of the food surface state, and obtaining the abnormal state result of the food surface; S4. Verify the risk assessment of the abnormal state of the food surface on the food quality based on the abnormal state of the food surface, obtain the comprehensive risk index Rs, and match it with the preset food quality risk assessment threshold SZ to obtain the food quality assessment plan; S5. Trigger the traceability flow path of food quality according to the content of the food quality assessment plan, mark the blockchain timestamp and node analysis results, and send relevant prompts to the quality and safety inspection personnel for confirmation; S6. Based on the feedback information from quality and safety inspectors, compare the actual feedback information with the comprehensive risk index Rs to obtain an optimization adjustment plan for the comprehensive risk index Rs.
2. The food quality and safety traceability method based on blockchain technology according to claim 1 is characterized by: Said S1 includes S11 and S12; S11. The food status information received by this block is collected in real time through the Internet of Things devices, including food physical integrity information and food appearance consistency information. The food physical integrity information is obtained by using laser scanning, high-definition cameras and contact sensors to detect food surface cracks, flatness and damage status information, and the surface crack ratio Fs and surface flatness Ss are obtained; the food appearance consistency information is obtained by using near-infrared spectroscopy technology, capacitive sensors and multi-spectral imaging technology to check the moisture and color uniformity of the food surface, and the surface wetness Ms and color uniformity Cu are obtained; S12. Integrate the surface crack ratio Fs, surface flatness Ss, surface wetness Ms and surface color uniformity Cu to form a food feature vector set Es = {Fs, Ss, Ms, Cu}, and upload it to the blockchain cloud platform via the Internet for real-time marking and food status information received in this block.
3. The food quality and safety traceability method based on blockchain technology according to claim 2 is characterized by: The S2 includes S21 and S22; S21. Performing data normalization processing according to the uploaded food feature vector set Es to eliminate the dimensional differences of different parameters, and generating a normalized feature vector set Enorm={Fn, Sn, Mn, Cn}, where Fn represents the normalized crack ratio, Sn represents the normalized flatness, Mn represents the normalized wetness, and Cu represents the normalized color uniformity; S22, performing feature extraction and correlation analysis on the normalized feature vector set Enorm to obtain a wet smoothness correlation factor Vms and a crack color correlation factor Vfc, and then reorganizing the normalized feature vector set Enorm to obtain a feature extraction vector set Te = {Fn, Sn, Mn, Cn, Vms, Vfc}; The wet smoothness correlation factor Vms is obtained by the following calculation formula: In the formula, exp represents the exponential decay function, which specifically adjusts the correlation between the normalized wetness Mn and the normalized flatness Sn; The crack color correlation factor Vfc is obtained by Obtain the calculation formula.
4. The food quality and safety traceability method based on blockchain technology according to claim 1 is characterized by: The S3 includes S31 and S32; S31, performing deviation calculation according to the acquired feature extraction vector set Te, obtaining a deviation index Dx, which is used to judge the abnormality of the food surface state, wherein the deviation index Dx is specifically Dx={DFn, DSn, DMn, DCn, DVms, DVfc}; Among them, DFn represents the normalized crack ratio deviation value, DSn represents the normalized flatness deviation value, DMn represents the normalized wetness deviation value, DCn represents the normalized color uniformity deviation value, DVms represents the wetness and smoothness correlation factor deviation value, and DVfc represents the crack color correlation factor deviation value; The deviation index Dx is specifically obtained by the following calculation formula: Where N represents the length of the feature extraction vector set Te, specifically the total number of vectors included in the feature extraction vector set Te, i represents the i-th vector, Te i represents the i-th vector in the feature extraction vector set Te, and ln represents the logarithmic function.
5. The food quality and safety traceability method based on blockchain technology according to claim 4 is characterized in that: S32, by summarizing the deviation index Dx obtained by calculation, obtaining the total deviation Rabn, and matching it with the preset food quality deviation assessment threshold Rth, judging the abnormality of the food surface state, and obtaining the abnormal state result of the food surface; The total number of deviations Rabn is obtained by the following calculation formula: Where M represents the length of the deviation index Dx, specifically the total number of deviation values included in the deviation index Dx, j represents the jth deviation value, and Dx j represents the jth deviation value in the deviation index Dx; The abnormal state result of the food surface is obtained by the following matching method: When the total number of deviations Rabn ≥ the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as an abnormal result, and the food quality score SZL=1 is marked, and the relevant detection is prompted that the current food needs to be eliminated and marked, and the marking information of the current food is uploaded to the blockchain cloud platform simultaneously. Specifically, the abnormal result, timestamp and block information are marked by obtaining the unique information of the current food. At the same time, the unique information of the same food will continue to accumulate when the food quality SZL appears; When the total number of deviations Rabn is less than the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as a normal result, and the food quality score SZL is marked as 0; When the total deviation Rabn ≥ twice the food quality deviation assessment threshold Rth, the abnormal state result of the food surface is obtained as the warning result, and the food quality score SZL=9 is marked. The warning result is sent to the relevant control personnel in real time to prompt them to suspend the food disposal process. At the same time, the warning result, timestamp and block information of the current food are marked, uploaded to the blockchain cloud platform, and a top prompt is given. At the same time, when the food quality score SZL appears in the unique information of the same food, it will continue to accumulate.
6. The food quality and safety traceability method based on blockchain technology according to claim 5 is characterized by: The S4 includes S41 and S42; S41. Verify the risk assessment of the abnormal state of the food surface on the food quality based on the abnormal state of the food surface. Specifically, when the abnormal state result of the food surface is an abnormal result and a warning result, the risk assessment of the abnormal state of the food surface on the food quality is triggered, including accumulating the food quality score SZL within a fixed time range and a fixed quantity range to obtain the comprehensive risk index Rs. The comprehensive risk index Rs is obtained by the following calculation formula: Wherein, Ct and Cq represent the total number of abnormal time series marks and the total number of abnormal quantity marks of the accumulated food quality score SZL within a fixed time range and a fixed quantity range, respectively; Tmax and Qmax represent the upper limit of abnormal time series marks and the upper limit of abnormal quantity marks within a fixed time range and a fixed quantity range, respectively; r1 and r2 represent the preset weight coefficients of the calculation results of the total number of abnormal time series marks Ct and the upper limit of abnormal time series marks Tmax and the total number of abnormal quantity marks Cq and the upper limit of abnormal quantity marks Qmax, respectively; and 0<r1+r2≤1, and the specific value is set by the user; The total number of abnormal markers in the time series Ct is The calculation formula is obtained, where SZL t SZL represents the food quality score of the food at time t on the blockchain cloud platform, and T represents the fixed time range of the preset food inspection; The total number of abnormal markers in the quantitative sequence Cq is The calculation formula is obtained, where SZL q It represents the food quality score SZL of the qth food on the regional chain cloud platform, and Q represents the fixed quantity range of the preset food inspection.
7. The food quality and safety traceability method based on blockchain technology according to claim 6 is characterized by: S42, obtaining a food quality assessment plan by matching the obtained comprehensive risk index Rs with a preset food quality risk assessment threshold SZ; The food quality assessment scheme is obtained by matching: When the comprehensive risk index Rs ≥ the food quality risk assessment threshold SZ, obtain the quality and safety abnormality plan for the current food batch, mark the transportation, warehousing and detection abnormalities of the current batch of food on the blockchain cloud platform, and notify relevant personnel to recall and centrally dispose of all foods in the current food batch; When the comprehensive risk index Rs is less than the food quality risk assessment threshold SZ, the normal quality and safety plan for the current food batch is obtained, and the current batch of food is marked as qualified on the blockchain cloud platform at the same time.
8. The food quality and safety traceability method based on blockchain technology according to claim 7 is characterized by: The S5 includes S51 and S52; S51. Trigger the traceability circulation path of food quality according to the content of the food quality assessment plan. When the content of the food quality assessment plan includes the quality and safety abnormality plan content of the current food batch, trigger the traceability circulation path of food quality, mark the blockchain timestamp and node analysis results, and send relevant prompts to the quality and safety inspection personnel for confirmation. The prompts include the uniqueness information of the abnormal food, the quality and safety abnormality plan content of the current food batch and the comprehensive risk index Rs.
9. The food quality and safety traceability method based on blockchain technology according to claim 7 is characterized in that: in, S6. Based on the feedback information from the quality and safety inspectors, including the total number of food abnormalities STZ, the actual feedback information is compared with the comprehensive risk index Rs to obtain an optimization adjustment plan for the comprehensive risk index Rs; The optimization adjustment scheme is obtained by the following calculation formula: In the formula, r1 new and r2 new They respectively represent the preset weight coefficients of the optimized total number of time series abnormal marks Ct and the upper limit of time series abnormal marks Tmax and the total number of quantity series abnormal marks Cq and the upper limit of quantity series abnormal marks Qmax, and γ represents the proportional factor, which is specifically used to adjust the sensitivity of the weight coefficient.
10. A food quality and safety traceability system based on blockchain technology, applied to a food quality and safety traceability method based on blockchain technology according to any one of claims 1 to 9, characterized in that: It includes food information collection module, information processing module, deviation calculation module, quality assessment module, feedback module and optimization module; The food information collection module collects food status information in real time through IoT devices, including food physical integrity information and food appearance consistency information, forms a food feature vector set Es, and uploads it to the blockchain cloud platform; The information processing module performs data normalization processing according to the food feature vector set Es, and simultaneously performs feature extraction and correlation analysis to obtain a feature extraction vector set Te; The deviation calculation module calculates the deviation index Dx according to the acquired feature extraction vector set Te, determines the abnormality of the food surface state, and obtains the abnormal state result of the food surface; The quality assessment module verifies the risk assessment of the abnormal state of the food surface on the food quality according to the abnormal state result of the food surface, obtains the comprehensive risk index Rs, and matches it with the preset food quality risk assessment threshold SZ to obtain the food quality assessment plan; The feedback module triggers the traceability flow path of food quality according to the content of the food quality assessment plan, marks the blockchain timestamp and node analysis results, and sends relevant prompts to the quality and safety inspection personnel for confirmation; The optimization module compares the actual feedback information with the comprehensive risk index Rs based on the feedback information from the quality and safety inspection personnel, and obtains an optimization adjustment plan for the comprehensive risk index Rs.
Citation Information
Cited By
Probiotic plant beverage production method and system
CN120678174A
Shoe leather industry collaborative supply chain system based on block chain
CN120893975A