Method for constructing a credible and visible traceability system for enhancing pasteurized crab meat HACCP plan

CN116976916BActive Publication Date: 2026-06-02SHANGHAI OCEAN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI OCEAN UNIV
Filing Date
2023-07-31
Publication Date
2026-06-02

Smart Images

  • Figure CN116976916B_ABST
    Figure CN116976916B_ABST
Patent Text Reader

Abstract

The application discloses a kind of enhanced pasteurized crab meat HACCP plan's credible visual traceability system construction method, it includes: pasteurized crab meat HACCP plan text is carried out semantic understanding, obtain the enhanced HACCP plan for execution;For the quality traceability application system to be constructed soon, data hierarchical mode, data storage structure, the design of upper chain intelligent contract;For the design of knowledge representation of visual atlas display, divide static entity and dynamic entity, and carry out atlas structure design;The data generated in the execution process of HACCP plan is collected, and data hierarchical storage is stored to corresponding database;From each database, the data collected is obtained, and the construction of visual data is carried out based on the visualization design of step S3 and the rendering of final front-end visual atlas. From the angle of data monitoring and different levels of traceability different data requirements, adjust and expand HACCP plan table;Optimize upper chain data, form the hierarchical upper chain mode of quality risk data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of food information, and in particular to a method for constructing a reliable and visual traceability system to enhance the HACCP program for pasteurized crab meat. Background Technology

[0002] Food safety has always been a major concern. Aquatic products are loved for their unique taste and high nutritional value, making them a frequent guest on people's tables. However, the short shelf life and susceptibility to spoilage of aquatic products make them prone to quality and safety risks during transportation, processing, and sales. Therefore, ensuring the quality and safety of aquatic products is of paramount importance.

[0003] Hazard Analysis and Critical Control Point (HACCP) is an effective control system focused on prevention. Based on science and a systematic approach, it identifies specific hazards and corresponding control measures to ensure food safety. Since its introduction in the late 1980s, HACCP has been widely implemented in the food processing industry and is also extensively used in the production and processing of aquatic products, demonstrating its effectiveness. Several researchers have studied and discussed the needs and benefits of implementing HACCP programs, illustrating the crucial and urgent importance of monitoring and preventing hazards during food processing, and demonstrating that implementing HACCP programs can more economically guarantee food quality and safety. Some scholars have also combined HACCP programs with aquatic product traceability, incorporating technologies such as the Internet of Things and knowledge modeling to conduct innovative research on HACCP-based traceability systems.

[0004] A blockchain can be viewed as a distributed database, a unidirectional chain structure composed of many blocks. Each block contains a hash value generated by a hash algorithm and a timestamp based on time; these two pieces of information are crucial tools for ensuring the immutability of data. Tampering with data will change the hash value, thereby invalidating the timestamp and causing a mismatch between the hash values ​​of all subsequent blocks. If you want to modify the data in a block, you must recalculate the hash value and timestamp of the current block and all subsequent blocks; this computational process is extremely difficult, almost impossible. Therefore, the complex structure and mechanisms of blockchain technology guarantee the high reliability of data uploaded to the chain.

[0005] Knowledge modeling is the process of structuring complex knowledge into a unified, operational representation. This study analyzes the data and structure of the HACCP plan for pasteurized crab meat in the national standard, extracting knowledge from both static and dynamic perspectives. Knowledge representations are then developed for the extracted static and dynamic entities, constructing a unified knowledge system for the pasteurized crab meat HACCP plan. This lays the foundation for enhancing the system's early warning, feedback, and traceability capabilities, and promoting the automated application of HACCP. Furthermore, this semantic and knowledge modeling research on the HACCP plan guides not only the development of HACCP plans for deployment but also the construction of the knowledge structure in the final knowledge visualization.

[0006] Knowledge visualization is the process of presenting structured descriptions of knowledge through graphics and images. The knowledge representation of a constructed HACCP plan is stored using a graph database based on attribute graphs, and the structural relationships between knowledge points are displayed in the form of a knowledge graph. A seafood quality monitoring and traceability system based on the national standard of the HACCP plan, incorporating knowledge visualization, can more intuitively display the plan's implementation status, facilitate real-time feedback to business personnel, and improve the early warning, feedback, and traceability capabilities of the HACCP-based quality monitoring and traceability platform.

[0007] Chinese invention patent CN113487032A, published on October 8, 2021, is entitled "A Knowledge Reasoning System and Method for HACCP in Aquatic Products." This method, based on the HACCP plan for aquatic products, constructs an HACCP knowledge application model, analyzes the entire aquatic product business process and the standard structure of the HACCP system; it uses descriptive logic language to analyze the semantics between data, enhancing machine understanding of the data and abstracting it into a knowledge structure; it scientifically represents, acquires, organizes, and stores the knowledge in the HACCP plan for aquatic products; and it describes business logic rules, increasing the automatic reasoning ability of knowledge, enabling effective improvement and sharing among various aspects of HACCP in aquatic products. This invention can improve the safety of aquatic product production and the application of HACCP.

[0008] Blockchain technology, which enhances data trustworthiness, has been widely used in many industries[1], including the food industry. [2] Feng Tian [3] This paper proposes a concept for a distributed information system for monitoring and traceability of the food supply chain, integrating HACCP, blockchain, and IoT technologies. (Mingyuan Fan et al.) [5] A trusted traceability platform for pigeon flocks based on HACCP was established, using a blockchain platform to store and manage relevant data for all key control points. (Li Jiali et al.) [6]A complete on-chain mechanism covering the pre-, mid-, and post-on-chain stages has been improved and implemented around the agricultural product blockchain traceability system that integrates the HACCP system.

[0009] Most research institutes have adopted the method of putting all quality data of enterprises on the chain, which will bring problems such as a large amount of data on the chain and a lack of data privacy for enterprises. Although the literature [6] proposed a new improvement scheme to solve the load problem in the process of putting on the chain and the security warning problem after putting on the chain, it chose to put qualified data that did not exceed the critical limit on the chain. However, this study believes that risk is responsibility, and the focus of traceability should be to ensure the credibility of risk data. At the same time, it is necessary to provide appropriate privacy protection for the internal data of enterprises, and also to make the traceability results readable for the end users of traceability from the perspective of quality and safety risk control. Moreover, at present, the National Standardization Management Committee of my country has already issued its own national standard GB / T 19838-2005 "Hazard Analysis and Critical Control Point (HACCP) System and its Application Guide for Aquatic Products" [7], but research on the implementation of quality and safety supervision and traceability services for improving national standards is still insufficient.

[0010] References

[0011] [1]MOHANTA BK,JENA D,PANDA SS,et al.Blockchain technology: A surveyon applications and security privacy Challenges[J].Internet of Things,2019,8:100107.

[0012] [2] MARKOVIC M, JACOBS N, DRYJAK, et al. Integrating Internet of Things, Provenance, and Blockchain to Enhance Trust in Last Mile Food Deliveries[J]. Frontiers in Sustainable Food Systems, 2020, 4: 563424.

[0013] [3]TIAN FA Supply Chain Traceability System for Food Safety Based on HACCP,Blockchain&Internet of Things[Z].2017 14TH INTERNATIONAL CONFERENCE ONSERVICES SYSTEMS AND SERVICES MANAGEMENT(ICSSSM).2017.

[0014] [4]REJEB A. Halal meat supply chain traceability based on HACCP, blockchain and internet of things[J]. Acta Technica Jaurinensis, 2018, 11(4): 218-247.

[0015] [5]FAN MY, LIU SY, XU LQ, et al. Credible pigeon permissioned blockchain traceability platform integrated with IoT based on HACCP[J]. Scientific Reports, 2022, 12(1): 22363.

[0016] [6] Li Jiali, Chen Yu, Qian Jianping, et al. Improvement of the precise on-chain mechanism of agricultural product blockchain traceability system integrating HACCP system [J]. Transactions of the Chinese Society of Agricultural Engineering, 2022, 38(20): 276-285.

[0017] [7] Standardization Administration of China. Hazard Analysis and Critical Control Point (HACCP) System for Aquatic Products and its Application Guidelines: GB / T 19838—2005 [S]. Beijing: China Standards Press, 2005. Summary of the Invention

[0018] To address the aforementioned shortcomings and enhance the credibility and readability of data in the national standard for Hazard Analysis and Critical Control Points (HACCP) systems for aquatic products in ensuring quality traceability, this invention, taking the pasteurized crab meat HACCP plan in the national standard as an example, proposes a method to enhance the credibility and visual traceability of the pasteurized crab meat HACCP plan by combining semantic modeling and blockchain technology. This method can, to a certain extent, ensure the credibility of risk data in quality traceability, improve the readability of data feedback, enhance the early warning capabilities of the quality traceability platform, and enable enterprises to achieve refined internal monitoring, multi-party external supervision, and public disclosure of risks and responsibilities.

[0019] To achieve the above objectives, this invention provides a method for constructing a reliable and visual traceability system to enhance the HACCP program for pasteurized crab meat, comprising:

[0020] S1: Perform semantic understanding on the HACCP plan text for pasteurized crab meat to obtain an enhanced HACCP plan for later execution;

[0021] S2: Design the data grading mode, data storage structure, and on-chain smart contract for the quality traceability application system to be built;

[0022] S3: Design knowledge representation for visual graph display, classify static and dynamic entities, and design the graph structure;

[0023] S4: Collect data generated during the execution of the HACCP plan;

[0024] S5: Obtain the collected data from various databases, construct the visualization data based on the visualization design made in step S3, and render the final front-end visualization map.

[0025] A further improvement of the present invention is that step S1 specifically includes:

[0026] Using the example HACCP plan table for pasteurized crab meat as an example, this paper analyzes the table from both data semantic and data structure perspectives to obtain the final enhanced pasteurization HACCP plan table. The enhanced pasteurization crab meat HACCP plan still primarily covers the CCP plan, monitoring plan, corrective action plan, and validation plan. Considering that significant hazards have relative stability in plan execution monitoring and do not involve monitoring content, they are removed from the enhanced CCP plan. Considering that operational limits are important for daily monitoring and early warning management, they are added to the enhanced HACCP plan table, numbered 3+. CCP2 and CCP3 involve temperature operational limits. The values ​​are defined as MinT and MaxT, respectively, and the specific values ​​are determined by the enterprise based on its risk management capabilities during actual implementation. Broadly speaking, the CCP plan encompasses more than just identifying key control points and designing limits; it also includes monitoring, corrective action after identifying problems, and subsequent verification operations. Corresponding to the operational limit column, a warning column, numbered 5+, is added to detect problems earlier. It will provide a friendly reminder when the corresponding operational limit is exceeded, further reducing or preventing the possibility of exceeding key limits. Records in the original plan table have been deleted as they have been dissolved in the aforementioned columns.

[0027] After understanding the above knowledge content, the HACCP plan table for pasteurized crab meat is divided into three dimensions based on its knowledge structure. The first row of the table is the first dimension of the knowledge structure, which is further divided into the definition of the row title and the column title. The part of columns (1), (3), and (3+) after removing the first row is the second dimension of the knowledge structure, which represents the composite row title. Each row title contains a description of the CCP. Once this information is determined at the beginning of the plan execution, it will have relative stability during the execution of the sub-plans. The part of columns (4), (5), (5+), and (6) after removing the first row is the third dimension of the knowledge structure, which is equivalent to the value at the intersection of the row and column. It describes the key points of monitoring, correcting, and verifying the execution of each CCP sub-plan. The data will grow dynamically in the later stages.

[0028] A further improvement of the present invention is that step S2 specifically includes:

[0029] Step 21: Design the data hierarchy model and storage scheme, as follows:

[0030] Based on the enhanced pasteurized crab meat HACCP plan obtained in S1, quality and safety risk monitoring is carried out. The generated monitoring data is defined into three levels according to the level of risk: Level 0, Level 1, and Level 2. Level 0 data is risk-free data; Level 1 data is a low-risk monitoring data group that exceeds the operational limits of the Critical Control Point (CCP) preventive measures but has not yet reached the critical limits, and this data needs to be encrypted later as privacy data; Level 2 data refers to a high-risk monitoring data group that exceeds the critical limits of the CCP preventive measures. All plan execution data is stored using a relational database, and risky data is further stored using blockchain.

[0031] Step 22: Design the storage structure for HACCP plan execution data. The specific steps are as follows:

[0032] The execution data of the HACCP plan for pasteurized crab meat is enhanced by covering the critical control point (CCP) data identified through hazard analysis, as well as the corresponding monitoring, corrective action, warning, and validation data. The CCP data includes critical limit values ​​and operational limit values ​​for CCP preventive measures. A relational database storage structure is designed for this information.

[0033] Step 23: Design the on-chain storage structure for risk data. The specific steps are as follows:

[0034] On-chain data is stored in a key-value database within the blockchain. The quality and safety risk data of key control points are packaged in JSON format as the value. The key stores the unique index value of the corresponding data, which is represented by a combination of numbers representing the current key control point, letters representing different data types, batch numbers or device numbers, and timestamps.

[0035] Step 24: Design the smart contract, as follows:

[0036] Smart contracts involve four main categories: on-chain data acquisition algorithms, data encryption algorithms, data upload algorithms, and data query algorithms. The data upload algorithm includes a secondary quality assessment of the input monitoring data, calling the on-chain data acquisition algorithm for auxiliary quality assessment, and then calling the data encryption algorithm to encrypt the primary risk data. The encryption algorithm combines symmetric and asymmetric encryption algorithms. First, an ECC key pair is generated and managed locally, ensuring regular updates and that the private key is only accessible to internal personnel. Then, an AES key is automatically generated using the smart contract, and this key is used to encrypt the uploaded data. Simultaneously, the AES key is encrypted using the ECC public key. Finally, the ciphertext of the uploaded data and the ciphertext of the AES key are uploaded to the blockchain together.

[0037] A further improvement of the present invention is that step S2 specifically includes:

[0038] Step 31, the design of knowledge representation, is carried out as follows:

[0039] Knowledge extraction was performed on the HACCP plan data table for enhanced pasteurized crab meat. The complete enhanced HACCP plan is defined as a binary data structure consisting of an entity set and a relationship set: (EN,R); where EN = {ENC, ESE} is the entity set constituting the plan definition, ENC represents the critical control point entity, and ESE represents the derived entity; the derived entity is an abstract object of derived data, which mainly refers to the monitoring, correction, and verification data generated around the critical control points, and also includes some data that needs to be recorded in advance for judgment in monitoring for critical limits; the derived entity can only depend on the existence of a certain entity, and can also be said to be a special kind of entity;

[0040] For any entity, the set of relationships R associated with it can be expressed as follows:

[0041] R(EN i ):=(EN i {,(RE i ,EN i+1 )}{,(REE ij ,ESE ij )})(i=1,…,M; j=0,…,N) (1)

[0042] in:

[0043] EN i Let i represent any of the above entities and be the i-th entity.

[0044] RE i It represents EN i With EN i+1 The connection between them;

[0045] ESE ij It represents EN i The j-th derived entity;

[0046] REE ij It represents EN i With ESE ij The connection between them;

[0047] M is the number of corresponding entities;

[0048] N is EN i The maximum number of corresponding derived entities, when EN i When there is no corresponding derived entity, N is 0;

[0049] Step 32: The division between static and dynamic entities is carried out as follows:

[0050] Static entities are collections of static data, which refers to the definitions and operational instructions of the entire HACCP plan, i.e., the table definitions included in the second and third dimensions of the HACCP plan structure. Dynamic entities are collections of dynamic data, which refers to the data generated during monitoring, corrective action, and verification of the plan, i.e., the data dynamically generated during the implementation of the HACCP plan in the third dimension. Static entities are like the type of an object; once the HACCP plan is determined, it has a certain degree of stability. Dynamic entities are like the value of an object; they are the real-time states generated during the stable execution of the HACCP plan, and are flexible and changeable.

[0051] Step 33: Design the visualization graph structure. The specific steps are as follows:

[0052] The visualization structure of static entities and their relationships can be designed as a series of circles representing multiple entities. The larger circle represents the key control point static entity, and the smaller circles around it represent the corresponding static derived entities. The key control point static entities are connected in the order of the business process, indicated by arrow directions.

[0053] The visualization structure of dynamic entities and relationships is similar to the former; it reflects the business processes and time relationships between real-time data generated during the execution of the enhanced HACCP plan, and fully describes the monitoring, correction, and verification data of key control points in the processing process.

[0054] To facilitate information viewing, a mapping relationship is designed between static and dynamic entities for visualization. The static CCP entity is connected to the dynamic CCP entity. This mapping can more intuitively reflect the status of all monitoring points of each CCP, and allows for the intuitive selection of a specific monitoring point to further explore its detailed data.

[0055] The method provided by this invention has the following technical effects:

[0056] (1) Based on the national standard for HACCP of aquatic products, this invention takes the pasteurized crab meat HACCP plan as an example, and combines semantic modeling and blockchain technology to understand, reorganize, acquire data and visualize the HACCP plan. This provides a reference solution for the construction of a reliable and visible quality traceability system based on the national standard for HACCP.

[0057] (2) Taking the pasteurized crab meat HACCP plan as an example, based on a comprehensive understanding of the HACCP plan, the original pasteurized crab meat HACCP plan table was adjusted and expanded from the perspective of different data requirements for data monitoring and traceability at different levels; the on-chain data was optimized to form a hierarchical on-chain mode for quality data; different styles of visualization of traceability data at different levels were realized to assist in the refined monitoring, early warning and feedback of internal quality of enterprises; and multi-party supervision from outside the enterprise ensured the openness of safety risks and facilitated the refined positioning of responsibilities.

[0058] (3) Enhancing the credibility of HACCP program traceability means faithfully tracing the monitoring data of the HACCP program execution process, while preventing malicious data tampering. The traceability data is authentic and credible for the company's internal management, regulatory agencies, and consumers.

[0059] (4) After testing, the traceability application system based on EHTVTM can realize basic functions such as data collection, hierarchical security management of data, data visualization, and data traceability. The system throughput based on blockchain reaches 300 transactions / second, which can basically meet the business needs of the traceability system. Attached Figure Description

[0060] Figure 1 This is a diagram of the trusted visual traceability model of the pasteurized crab meat enhancement HACCP plan proposed in this invention;

[0061] Figure 2 The enhanced pasteurized crab meat HACCP plan obtained after semantic understanding;

[0062] Figure 3 ER diagram for HACCP plan execution data;

[0063] Figure 4 To visualize the static entity relationship diagram in the structural design;

[0064] Figure 5 To visualize the dynamic entity relationship diagrams in the structural design.

[0065] Figure 6 A mapping diagram of CCP static entities and CCP dynamic entities;

[0066] Figure 7 This is a diagram showing the logical architecture of the system implemented in the experiment.

[0067] Figure 8 This is a visualization interface for primary risk data.

[0068] Figure 9 A visualization interface for secondary risk data;

[0069] Figure 10This is the interface for consumers to view search results. Detailed Implementation

[0070] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.

[0071] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the illustrations only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0072] Some exemplary embodiments of the invention have been described for illustrative purposes. It should be understood that the invention may be implemented in other ways not specifically shown in the accompanying drawings.

[0073] This invention proposes a reliable and visible traceability method to enhance the HACCP (Hazard Analysis and Critical Control Points) program for pasteurized crab meat. To verify the feasibility of the proposed method, the system implementation experiment used Hyperledger Fabric as the blockchain development platform, Go language for smart contract writing, and the blockchain network deployed on a cloud server. The overall system architecture adopts a front-end and back-end separation model, with Vue as the front-end and SpringBoot and Mybatis as the back-end, and Java language for system development. Specific system configurations and software versions are shown in Table 1. The experimental system comprises four main parts: information collection, temperature data collection, data visualization graph display, and consumer traceability.

[0074] Table 1 Development Environment Description

[0075]

[0076] The experimental logic architecture diagram of the enhanced pasteurized crab meat HACCP program's trusted visual traceability application based on knowledge base and blockchain technology is as follows: Figure 7As shown. The system experiment of the method of this invention collects data through a combination of manual input and the Internet of Things. In the temperature monitoring stage, each device dynamically collects the internal temperature through an independent temperature acquisition subsystem. Information generated by other monitoring, correction, and verification operations is input by quality control personnel through a client. The collected data is aggregated to the business server, which standardizes and stores all data in MySQL. Simultaneously, abnormal monitoring data that fails the initial quality judgment, as well as correction and verification data, are uploaded to the blockchain platform. The business server then interacts with the MySQL database and the blockchain platform, retrieving risky data from the blockchain platform and risk-free data from MySQL. After filtering and integration, the data is stored in Neo4j, completing the visualization of important data.

[0077] The method specifically includes the following steps:

[0078] Step S1: Perform semantic understanding on the HACCP plan in the national standard to obtain the enhanced HACCP plan for later implementation;

[0079] Step S2: Design important parts of the quality traceability application system to be built, such as data classification mode, data storage structure, and on-chain smart contract.

[0080] Step S3: Design the knowledge representation for the final visualization graph display, divide static and dynamic entities, and design the graph structure;

[0081] Step S4: Based on the preliminary design made in steps S1 and S2, data generated during the execution of the HACCP plan is collected through a combination of manual input and Internet of Things, and the data is stored in the corresponding databases in a hierarchical manner.

[0082] Step S5: Obtain the collected data from various databases, construct the visualization data based on the visualization design made in step S3, and render the final front-end visualization map.

[0083] The specific steps in step S1 are as follows:

[0084] To facilitate subsequent design and system implementation, a Trusted Visual Traceability Model of Enhanced HACCP Plan (EHTVTM) was constructed for the proposed trusted visual traceability method of the HACCP plan for pasteurized crab meat. Figure 1 As shown.

[0085] Using the example HACCP plan table for pasteurized crab meat in the national standard appendix as an example, this paper analyzes the table from both data semantics and data structure perspectives to obtain the final enhanced pasteurization HACCP plan table, as shown below. Figure 2 As shown, the HACCP plan before understanding mainly covers five aspects: CCP plan, monitoring plan, corrective action plan, verification plan, and record plan.

[0086] ●The CCP plan includes descriptions of the CCP name, significant hazards, and key limits for each preventative measure.

[0087] The "Significant Hazards" column contains information selected from a range of potential hazards to aid in determining critical limits for CCPs and corresponding preventative measures. Therefore, in the specific implementation of the CCP plan, significant hazards can be downplayed and removed from the understood HACCP plan. Furthermore, operational limits are integrated into the underlying HACCP plan. Operational limits, as indicators crucial for daily monitoring and management, need to be added to the understood HACCP plan, numbered 3+. The specific content of the operational limits is defined by the company. In the packaging / sealing stage, the critical limit "the can seal must meet the manufacturer's specifications" is not explicitly stated; therefore, this section is left blank, and the specific operational limits will also be defined by the company later.

[0088] ●The monitoring plan is a crucial step in promptly identifying whether critical limits at key control points are out of control. (By [Brand Name])

[0089] Supervisors monitor and record the can seams, water bath temperature and time, and cold storage temperature according to the prescribed monitoring frequency. The temperature and time are monitored in real time by hardware equipment, thereby reducing manual labor and improving accuracy. The monitoring methods and operators in the monitoring plan are not key focuses for the computer in the HACCP automation process and can be omitted.

[0090] • A corrective action plan refers to taking corrective action when monitored data exceeds corresponding limits, thereby reducing or avoiding [the negative impact of these limits].

[0091] To prevent quality and safety issues, a warning column, numbered 5+, is added to the existing 3+ columns during domain knowledge understanding. This provides adjustment methods for exceeding corresponding operational limits, customizable by the enterprise, further reducing or preventing the possibility of exceeding critical limits.

[0092] • The verification plan is a process in which the verifier periodically checks and verifies the monitoring and corrective data, and creates verification records.

[0093] The frequency of verification is sufficient to confirm the effectiveness of the HACCP system and help determine whether CCPs are under control.

[0094] ●The recording plan can be ignored since the recording actions have already been dissolved in the aforementioned columns.

[0095] After understanding the above knowledge content, the HACCP plan table for pasteurized crab meat is divided into three dimensions based on its knowledge structure. The first row of the table serves as the first dimension of the knowledge structure, which is further divided into the definition of row headings and column headings. The portions of columns (1), (3), and (3+) after removing the first row constitute the second dimension of the knowledge structure, representing composite row headings. Each row heading contains a description of the CCP. Once this information is determined at the beginning of the plan's execution, it will have relative stability during the execution of sub-plans. The portions of columns (4), (5), (5+), and (6) after removing the first row constitute the third dimension of the knowledge structure, equivalent to the values ​​at the intersection of rows and columns. These values ​​describe the key points of monitoring, correcting, and verifying the execution of each CCP sub-plan, and the data will dynamically increase in the later stages.

[0096] The detailed steps of step 2 are as follows:

[0097] Step 21: Design the data hierarchy model and storage scheme, as follows:

[0098] Based on the enhanced pasteurized crab meat HACCP plan obtained in S1, quality and safety risk monitoring was conducted. The generated monitoring data was defined into three levels: Level 0, Level 1, and Level 2, according to the level of risk. Level 0 data represents no risk. Level 1 data consists of low-risk monitoring data that exceeds the operational limits of Critical Control Point (CCP) preventative measures but has not yet reached the critical limits; this data is considered privacy and requires subsequent encryption. Level 2 data refers to high-risk monitoring data that exceeds the critical limits of CCP preventative measures. All plan execution data is stored using a relational database, with risky data further stored using blockchain technology. The final optimized safety management and storage scheme is shown in Table 2.

[0099] Table 2. Risk Data Tiered Storage Scheme Design Table

[0100]

[0101] Step 22: Design the storage structure for HACCP plan execution data. The specific steps are as follows:

[0102] The enhanced HACCP implementation data for pasteurized crab meat covers Critical Control Point (CCP) data identified through hazard analysis, along with corresponding monitoring, corrective action, warning, and validation data. CCP data includes critical limit values ​​and operational limit values ​​for preventative measures at each CCP. Based on this information, designs such as... Figure 3The data storage structure is shown below. Taking the CCP1 data table as an example, the table uses the following fields to describe the monitoring, correction, and verification data of the packaging / sealing critical control points: data_id, batch_id, equipment_id, supervisor_id, timestamp, exception, seam status, corrective action, and daily_verify. The exception field is used to describe whether the data is considered level one or level two data in the initial quality assessment.

[0103] Step 23: Design the on-chain storage structure for risk data. The specific steps are as follows:

[0104] On-chain data is stored in a key-value database within the blockchain. The quality and safety risk data for critical control points is packaged in JSON format and stored as the value. The key stores a unique index value for the corresponding data, represented by a combination of numbers representing the current critical control point, letters representing different data types, batch numbers or device numbers, and a timestamp. For example, a key like "1#1#681744#20230405080000" indicates that the data is monitoring data from CCP1 batch number "681744," and the data time is 8:00 AM on April 5, 2023.

[0105] Step 24: Design the smart contract, as follows:

[0106] Smart contracts involve four main categories: on-chain data acquisition algorithms, data encryption algorithms, data upload algorithms, and data query algorithms. The data upload algorithm includes a secondary quality assessment of the input monitoring data, calling the on-chain data acquisition algorithm for auxiliary quality assessment, and then calling the data encryption algorithm to encrypt the primary risk data. The encryption algorithm combines symmetric and asymmetric encryption algorithms. First, an ECC key pair is generated and managed locally, ensuring regular updates and that the private key is only accessible to internal personnel. Then, an AES key is automatically generated using the smart contract, and this key is used to encrypt the uploaded data. Simultaneously, the AES key is encrypted using the ECC public key. Finally, the ciphertext of the uploaded data and the ciphertext of the AES key are uploaded to the blockchain together.

[0107] Taking the algorithm for uploading monitoring data from the pasteurization process to the blockchain as an example, its pseudocode is as follows:

[0108] 1:tempList=getTempList(ccp,TempID,TempStratTime,TempEndTime)

[0109] / / Retrieve the temperature list for the current monitoring time period using the getTempList method.

[0110] 2:unusualDuration=0

[0111] 3:unusualFlag = false

[0112] 4: for t = 0 -> len(tempList) do

[0113] 5: temp = tempList[t]

[0114] 6:if temp <criticalLimit then

[0115] 7:unusualFlag = true

[0116] 8:unusualDuration=unusualDuration+getDurationOfUnusualTemp(temp)

[0117] 9:end if

[0118] 10:end for

[0119] 11: if unusualFlag then

[0120] 12:resMassage = "Water bath temperature below critical limit".

[0121] 13:else

[0122] 14:resMassage = "Water bath temperature is only below the operating limit".

[0123] 15:end if

[0124] 16:if WaterDuration! =120then

[0125] 17:unusualFlag = true

[0126] 18:resMassage = resMassage + "Please note that the water bath time does not meet the requirements."

[0127] 19:else

[0128] 20:resMassage = resMassage + "Water bath time only fails to meet operational restrictions."

[0129] 21:end if

[0130] 22:value=json(arg[],unusualFlag,unusualDuration,resMassage)

[0131] / / Encapsulate the data as JSON

[0132] 23:object = value

[0133] 24: if! unusualFlag then

[0134] 25: value, priKey = encryption(value, eccPubKey) / / Encrypts data and returns the encryption key

[0135] 26:object=json(value,priKey)

[0136] 27:end if

[0137] 28: stub.PutState(key, object)

[0138] The detailed steps of step 3 are as follows:

[0139] Step 31, the design of knowledge representation, is carried out as follows:

[0140] Knowledge extraction was performed on the HACCP plan data table for enhanced pasteurized crab meat. The complete enhanced HACCP plan is defined as a binary data structure consisting of an entity set and a relationship set: (EN,R); where EN = {ENC, ESE} is the entity set constituting the plan definition, ENC represents the critical control point entity, and ESE represents the derived entity; the derived entity is an abstract object of derived data, which mainly refers to the monitoring, correction, and verification data generated around the critical control points, and also includes some data that needs to be recorded in advance for judgment in monitoring for critical limits; the derived entity can only depend on the existence of a certain entity, and can also be said to be a special kind of entity;

[0141] For any entity, the set of relationships R associated with it can be expressed as follows:

[0142] R(EN i ):=(EN i {,(RE i ,EN i+1 )}{,(REE ij ,ESE ij )})(i=1,…,M; j=0,…,N) (1)

[0143] in:

[0144] EN i Let i represent any of the above entities and be the i-th entity.

[0145] RE i It represents EN i With EN i+1 The connection between them;

[0146] ESE ij It represents EN i The j-th derived entity;

[0147] REE ij It represents EN i With ESE ij The connection between them;

[0148] M is the number of corresponding entities;

[0149] N is EN i The maximum number of corresponding derived entities, when EN i When there is no corresponding derived entity, N is 0;

[0150] Step 32: The division between static and dynamic entities is carried out as follows:

[0151] Static entities are collections of static data, which refers to the definitions and operational instructions of the entire HACCP plan—that is, the table definitions included in the second and third dimensions of the HACCP plan structure. Dynamic entities are collections of dynamic data, which refers to the data generated during monitoring, corrective action, and plan verification—that is, the data dynamically generated during the implementation of the HACCP plan within the third dimension. Static entities are like the type of an object; once the HACCP plan is determined, it possesses a certain degree of stability. Dynamic entities are like the value of an object; they represent the real-time state generated during the stable execution of the HACCP plan, exhibiting flexibility and variability.

[0152] Step 33: Design the visualization graph structure. The specific steps are as follows:

[0153] The visual representation structure of static entities and their relationships can be expressed as follows: Figure 4 The diagram shows static entity relationships. Each entity is represented by a circle; the larger circle represents a key control point static entity, and the smaller circles around it represent the corresponding derived static entities. The key control point static entities are connected according to the business process sequence, as indicated by the arrows. Other connection arrows express the derivative relationships between entities and their derived counterparts.

[0154] The visual representation structure of dynamic entities and relationships is expressed as follows: Figure 5 The diagram shown illustrates the dynamic entity relationship. It reflects the business processes and temporal relationships between real-time data generated during the execution of the enhanced HACCP plan, and fully describes the monitoring, corrective, and verification data of key control points in the processing process. Taking the structure of dynamic entities generated by a business process in the processing of crab meat batch "1001" as an example, the CCP1 and CCP2 data nodes are identified in the form of "batch number / machine equipment number / time series", while the CCP3 data node is identified in the form of "machine equipment number / time series", and the corresponding derived entity nodes have the same identification.

[0155] To facilitate information viewing, a mapping relationship was designed between static and dynamic entities in the visualization. The static CCP entity is linked to the dynamic CCP entity, as shown below. Figure 6 As shown, this mapping can more intuitively reflect the status of all monitoring points of each CCP, and allows for the intuitive selection of a specific monitoring point to further explore its detailed data.

[0156] In the visualization portion of step 5, the generated graphs from some test data primarily contain risk data, while hiding static data nodes and some validation data nodes. Risk-free data is also aggregated during visualization. Taking a specific batch as an example, the visualization graph display interface for the primary and secondary risk data generated during processing is as follows: Figure 8 , Figure 9 As shown. To distinguish it from Level 1 risk, Level 2 risk data warning nodes are specifically marked with thick circles, and when the cursor hovers over the corresponding node, a floating window displays node information describing the risk data for that node. From Figure 9 As can be seen, all observed nodes are in a broken chain state, indicating that the current monitoring data only contains scattered secondary risk data at various key control points, and there is no complete data chain with secondary risk at every key control point. To facilitate consumers' understanding of relevant information and product certifications for the products they purchase, the system needs to provide consumers with a channel for product traceability. However, research revealed that consumers do not pay much attention to the specific risk details and traceability storage mechanisms in product traceability; their main concern is whether the product poses a safety risk, whether it is qualified, or whether it has passed national certification. Therefore, the system prototype designed in this paper provides consumers with a simple product query. Consumers can query products through the code on the packaging, and the query results are displayed as follows: Figure 10 .

[0157] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A method for constructing a reliable and visual traceability system to enhance the HACCP program for pasteurized crab meat, characterized in that... include: S1: Perform semantic understanding on the HACCP plan text for pasteurized crab meat to obtain an enhanced HACCP plan for later execution; Step S1 includes: The enhanced HACCP plan for pasteurized crab meat includes a CCP plan, a monitoring plan, a corrective action plan, operational limits, and a validation plan. Operational limits are numbered 3+ in the HACCP plan table. CCP2 and CCP3 in the operational limits involve temperature operational limits, which are defined as MinT and MaxT, respectively. Corresponding to the operational limit column, a warning column is added, numbered 5+, to detect problems earlier. S2: Design the data grading model, data storage structure, and on-chain smart contract for the quality traceability application system to be built; Step S2 includes: Based on the enhanced pasteurized crab meat HACCP plan obtained in S1, quality and safety risk monitoring was carried out, and the generated monitoring data was defined into three levels: level zero, level one, and level two according to the risk level. The specific steps for designing smart contracts are as follows: Smart contracts involve four main categories: on-chain data acquisition algorithms, data encryption algorithms, data upload algorithms, and data query algorithms. The data upload algorithm includes a secondary quality assessment of the input monitoring data, calling the on-chain data acquisition algorithm for auxiliary quality assessment, and then calling the data encryption algorithm to encrypt the primary risk data. The encryption algorithm combines symmetric and asymmetric encryption algorithms. First, an ECC key pair is generated and managed locally, ensuring regular updates and that the private key is only accessible to internal personnel. Then, an AES key is automatically generated using the smart contract, and this AES key is used to encrypt the uploaded data. Simultaneously, the ECC public key is used to encrypt the AES key. Finally, the ciphertext of the uploaded data and the ciphertext of the AES key are uploaded to the blockchain together. S3: Design knowledge representation for the visual graph display, classify static and dynamic entities, and design the graph structure; Step S3 includes: The distinction between static and dynamic entities is as follows: Static entities are collections of static data, which refers to the definitions and operational instructions of the entire HACCP plan, i.e., the table definitions included in the second and third dimensions of the HACCP plan structure. Dynamic entities are collections of dynamic data, which refers to the data generated during monitoring, corrective action, and verification of the plan, i.e., the data dynamically generated during the implementation of the HACCP plan in the third dimension. Static entities are like the type of an object; once the HACCP plan is determined, it has a certain degree of stability. Dynamic entities are like the value of an object; they are the real-time states generated during the stable execution of the HACCP plan, exhibiting flexibility and variability. The specific steps for designing a visual graph structure are as follows: The visualization structure of static entities and their relationships is designed as a series of circles representing multiple entities. The larger circles represent key control point static entities, while the smaller circles around them represent the corresponding static derived entities. The key control point static entities are connected in the order of the business process, indicated by arrow directions. The dynamic entity and relationship visualization structure will reflect the business processes and time relationships between real-time data generated during the execution of the enhanced HACCP plan, and fully describe the monitoring, correction and verification data of key control points in the processing process; S4: Collect data generated during the execution of the HACCP plan; S5: Obtain the collected data from various databases, construct the visualization data based on the visualization design made in step S3, and render the final front-end visualization map.

2. The method for constructing a reliable and visual traceability system for enhancing the HACCP program of pasteurized crab meat according to claim 1, characterized in that, Step S1 specifically includes: Taking the pasteurized crab meat HACCP plan table as an example, this paper analyzes the table from both data semantic and data structure perspectives to obtain the final enhanced pasteurization HACCP plan table. The enhanced pasteurized crab meat HACCP plan includes a CCP plan, a monitoring plan, a corrective action plan, operational limits, and a validation plan. Operational limits are numbered 3+ in the HACCP plan table. CCP2 and CCP3, which involve temperature operational limits, are defined as MinT and MaxT, respectively. Corresponding to the operational limit column, a warning column, numbered 5+, is added to detect problems earlier. This column will provide a friendly reminder when the corresponding operational limit is exceeded, further reducing or avoiding the possibility of exceeding critical limits. After understanding the knowledge content, the HACCP plan table for pasteurized crab meat was divided into three dimensions: the first dimension, which includes the definition of row headings and column headings; the second dimension, which represents composite row headings; and the third dimension, which is the value at the intersection of rows and columns.

3. The method for constructing a reliable and visual traceability system for enhancing the HACCP program of pasteurized crab meat according to claim 2, characterized in that, Step S2 specifically includes: Step 21: Design a data hierarchy model and storage scheme, as follows: Based on the enhanced pasteurized crab meat HACCP plan obtained in S1, quality and safety risk monitoring is carried out. The generated monitoring data is defined into three levels according to the level of risk: Level 0, Level 1, and Level 2. Level 0 data is risk-free data; Level 1 data is a low-risk monitoring data group that exceeds the operational limits of the Critical Control Point (CCP) preventive measures but has not yet reached the critical limits, and this data needs to be encrypted later as privacy data; Level 2 data refers to a high-risk monitoring data group that exceeds the critical limits of the CCP preventive measures. All plan execution data is stored using a relational database, and risky data is further stored using blockchain. Step 22: Design the storage structure for HACCP plan execution data. The specific steps are as follows: The enhanced HACCP implementation data for pasteurized crab meat covers critical control point data identified through hazard analysis, as well as corresponding monitoring, corrective action, warning, and validation data. The control point data includes critical limit and operational limit data for critical control point preventive measures. A relational database storage structure is designed for this information. Step 23: Design the on-chain storage structure for risk data. The specific steps are as follows: On-chain data is stored in a key-value database within the blockchain. The quality and safety risk data of key control points is packaged in JSON format as the Value; the Key stores the unique index value of the corresponding data, which is represented by a combination of numbers representing the current key control point, letters representing different data types, batch numbers or device numbers, and timestamps. Step 24: Design the smart contract, as follows: Smart contracts involve four main categories: on-chain data acquisition algorithms, data encryption algorithms, data upload algorithms, and data query algorithms. The data upload algorithm includes a secondary quality assessment of the input monitoring data, calling the on-chain data acquisition algorithm for auxiliary quality assessment, and then calling the data encryption algorithm to encrypt the primary risk data. The encryption algorithm combines symmetric and asymmetric encryption algorithms. First, an ECC key pair is generated and managed locally, ensuring regular updates and that the private key is only accessible to internal personnel. Then, an AES key is automatically generated using the smart contract, and this AES key is used to encrypt the uploaded data. Simultaneously, the ECC public key is used to encrypt the AES key. Finally, the ciphertext of the uploaded data and the ciphertext of the AES key are uploaded to the blockchain together.

4. The method for constructing a reliable and visual traceability system for enhancing the HACCP program of pasteurized crab meat according to claim 2, characterized in that, Step S3 specifically includes: Step 31, the design of knowledge representation, is carried out as follows: Knowledge extraction was performed on the HACCP plan data table for enhanced pasteurized crab meat. The complete enhanced HACCP plan was defined as a binary data structure consisting of an entity set and a relationship set: (EN, R); where EN = {ENC, ESE} is the entity set constituting the plan definition, ENC represents the critical control point entity, and ESE represents the derived entity; the derived entity is an abstract object of derived data, which mainly refers to the monitoring, correction, and verification data generated around the critical control points, and also includes some data that needs to be recorded in advance for judgment in monitoring for critical limits; the derived entity can only depend on the existence of a certain entity, and can also be said to be a special kind of entity; For any entity, the set of relationships R associated with it can be expressed as follows: ; in: EN i Let i represent any of the above entities and be the i-th entity. RE i It represents EN i With EN i+1 The connection between them; ESE ij It represents EN i The j-th derived entity; REE ij It represents EN i With ESE ij The connection between them; M is the number of corresponding entities; N is EN i The maximum number of corresponding derived entities, when EN i When there is no corresponding derived entity, N is 0; Step 32: The division between static and dynamic entities is carried out as follows: Static entities are collections of static data, which refers to the definitions and operational instructions of the entire HACCP plan, i.e., the table definitions included in the second and third dimensions of the HACCP plan structure. Dynamic entities are collections of dynamic data, which refers to the data generated during monitoring, corrective action, and verification of the plan, i.e., the data dynamically generated during the implementation of the HACCP plan in the third dimension. Static entities are like the type of an object; once the HACCP plan is determined, it has a certain degree of stability. Dynamic entities are like the value of an object; they are the real-time states generated during the stable execution of the HACCP plan, and are flexible and changeable. Step 33: Design the visualization graph structure. The specific steps are as follows: The visualization structure of static entities and their relationships is designed as a series of circles representing multiple entities. The larger circles represent key control point static entities, while the smaller circles around them represent the corresponding static derived entities. The key control point static entities are connected in the order of the business process, indicated by arrow directions. The dynamic entity and relationship visualization structure will reflect the business processes and time relationships between real-time data generated during the execution of the enhanced HACCP plan, and fully describe the monitoring, correction and verification data of key control points in the processing process; To facilitate information viewing, a mapping relationship was designed between static and dynamic entities for visualization. The static CCP entity is connected to the dynamic CCP entity. This mapping is used to more intuitively reflect the status of all monitoring points of each CCP, and to intuitively select a monitoring point to further expand its detailed data for observation.