Research on Flexible Traceability System of Agaricus bisporus Supply Chain

: The supply chain of Agaricus bisporus constitutes a complex, multi-layered production and distribution network, encompassing various stages. Challenges in information transmission and process integration between these stages often lead to reduced query efﬁciency, subsequently compromising the credibility of traceability results and the ﬂexibility of the system. In traditional traceability systems, data for multiple service recipients may be stored on a single blockchain, resulting in complex data structures and making it challenging for users to conduct effective queries and analyses. To address this issue, this paper proposes a solution: a multi-chain tracing model tailored for stakeholders in the traceability process of Agaricus bisporus . This model establishes public chains, enterprise chains, and supervision chains for consumers, enterprises, and regulatory authorities, respectively, to enhance system storage and query efﬁciency. Additionally, leveraging the modular design of Hyperledger Fabric, the paper optimizes and upgrades the supply chain of Agaricus bisporus . The proposed multi-chain tracing model, designed for traceability for stakeholders, undergoes rigorous validation. Analysis and application results demonstrate that this approach signiﬁcantly improves the query efﬁciency and credibility of traceability information while markedly enhancing system ﬂexibility.


Introduction
Agaricus bisporus, a common species of edible mushroom, faces challenges in its supply chain, including pesticide and chemical residues, microbial contamination, and inadequate temperature control.These issues can jeopardize consumer health and harm the reputations of enterprises.The rapid advancement of blockchain technology has garnered widespread interest in the international research community, providing a multitude of services not only in academia but also in practical applications [1].The Chinese government has issued a total of 59 policy documents related to blockchain technology, aimed at supporting and promoting its application in various fields including finance, supply chain management, healthcare, and smart manufacturing.Additionally, the government has set development targets for the blockchain industry to achieve a significant scale by 2025.This initiative offers enterprises ample opportunities for development and promotes the construction of an innovative ecosystem.
The application of blockchain technology in the field of food safety provides endto-end traceability and information transparency, effectively addressing challenges such as difficulties in traceability and lack of transparency within the food industry [2][3][4][5].Its immutable nature ensures the authenticity and integrity of food information, bolstering consumer trust in food safety.Furthermore, blockchain technology enables functions like rapid recalls and real-time monitoring of the supply chain, enhancing the efficiency and precision of food safety management.Smart contracts are a type of contract system embedded in blockchain technology, encompassing agreements, conditions, and execution rules among contract participants.Once the conditions specified in the contract are met, smart contracts automatically execute their designated tasks, without the need for thirdparty intervention or mediation.This characteristic endows smart contracts with high levels of automation, transparency, and tamper resistance [6].In conclusion, blockchain technology provides a viable and robust means to address food safety issues, offering solid technical support for industry development and ensuring consumer health and safety [7].
The rapid advancement of blockchain technology has provided a more dependable solution for traceability systems.Many scholars have conducted in-depth research on the challenges within traceability systems and proposed corresponding solutions.Son et al. proposed an approach that utilizes blockchain and internet of things (IoT) technology to trace the origin of agricultural products from farms.This is achieved by using smart contracts to record and store information in the form of logs on a blockchain system [8].Yu et al. introduced a node authorization method to differentially protect sensitive data that requires safeguarding.This method takes into account both the encryption protection of enterprise privacy data and the public supervision of supply chain traceability data [9].Jing et al. presented a multi-department supervisory scheme for a cluster-based agricultural product supply chain blockchain using CP-ABE.This scheme ensures data privacy while enabling data accessibility to relevant regulators [10].Wang et al. proposed an effective separation strategy, where the header and body of a blockchain are detached and stored within the blockchain, while the body is stored in the InterPlanetary File System [11].
Based on the research of multiple scholars, it can be observed that blockchain-based traceability systems for agricultural products exhibit notable advantages in terms of trustworthiness and transparency.However, certain challenges persist, such as the substantial query pressure when dealing with a large volume of data [12].This arises from the fact that each blockchain ledger combines traceability data for multiple tracing entities, making it unable to meet the diverse requirements of different tracing subjects [13].
By establishing a multi-stakeholder blockchain-based traceability model tailored for the tracing entities in the Agaricus bisporus supply chain, we have not only proposed a novel solution based on comprehensive research and analysis of each link in the chain, but also provided consumers with a critical assurance.This model caters not only to the diverse needs of information management and sharing among stakeholders but, more importantly, guarantees the credibility and tamper-proof nature of the traceability data.This implies that consumers can confidently opt for Agaricus bisporus, as they can trace every step of the product's production and each facet of the supply chain, ensuring product quality and safety.The storage architecture design, integrating blockchain technology and encryption algorithms within a multi-chain traceability model, has transformed the reliable traceability system for Agaricus bisporus into a reality.Ultimately, this system will furnish consumers with end-to-end traceable data support, enabling comprehensive oversight and traceability management of Agaricus bisporus quality and safety.This, in turn, provides consumers with a more dependable and secure product selection experience.
The organizational structure of this paper is as follows: Section 2 analyzes the issues with traditional traceability models.In Section 3, an analysis of the traceability process in the Agaricus bisporus supply chain is conducted, along with the selection of traceability indicators.Section 4 constructs a multi-chain traceability model tailored for traceability subjects in the Agaricus bisporus supply chain based on an analysis of the requirements from consumers, enterprises, and regulatory authorities.The scalability and security of the model are also discussed.Additionally, a description of the flexible traceability process is provided, along with experimental validation.The discussion is presented in Section 5, followed by the conclusion in Section 6.

Traditional Blockchain-Based Traceability Model for Agricultural Products
The combination of blockchain and traditional agricultural product traceability models can lead to a more comprehensive and efficient agricultural product traceability system.The decentralized and tamper-proof characteristics of blockchain technology can effectively address these issues [14].Blockchain technology can be employed to record and store information at various stages of agricultural product cultivation, storage, processing, transportation, and sale.Through smart contracts, it facilitates information sharing and verification, enabling all participants to trace the origin and production process of agricultural products.This, in turn, enhances the security and credibility of agricultural products [15].The blockchain-based agricultural product traceability model is illustrated in Figure 1.
the model are also discussed.Additionally, a description of the flexible traceability process is provided, along with experimental validation.The discussion is presented in Section 5, followed by the conclusion in Section 6.

Traditional Blockchain-Based Traceability Model for Agricultural Products
The combination of blockchain and traditional agricultural product traceability models can lead to a more comprehensive and efficient agricultural product traceability system.The decentralized and tamper-proof characteristics of blockchain technology can effectively address these issues [14].Blockchain technology can be employed to record and store information at various stages of agricultural product cultivation, storage, processing, transportation, and sale.Through smart contracts, it facilitates information sharing and verification, enabling all participants to trace the origin and production process of agricultural products.This, in turn, enhances the security and credibility of agricultural products [15].The blockchain-based agricultural product traceability model is illustrated in Figure 1.

Problems
Modern agricultural supply chains often comprise multiple stages, involving numerous participants, and are continuously expanding.In a flexible traceability system, through the application of concepts such as modularity and microservices, supply chain management becomes more adaptable, capable of responding flexibly to evolving demands and environments.Currently, there are two main issues present in traditional traceability systems.
(1) Issue of Low Query Efficiency The immutability of blockchain also gives rise to the problem of low query efficiency.Once data are recorded on the blockchain, it cannot be modified or deleted.Therefore, querying data requires a slow process of verification starting from the genesis block of the blockchain.This can significantly slow down the query speed, especially when dealing with large-scale data processing.Blockchain-based traceability systems require consensus mechanism verification and encryption calculations, which consume a substantial amount of computational resources, leading to low query efficiency.
(2) Incompatibility with the Diverse Needs of Traceability Subjects Each blockchain ledger mixes traceability data aimed at multiple traceability subjects.If different traceability subjects want to obtain specific data according to their respective needs, complex data filtering and screening are required.This can affect the accuracy of data traceability.For a traceability subject, only their own traceability data are of concern.In this scenario, storing all traceability data together in one ledger not only increases the size and complexity of the ledger but also leads to data redundancy and wastage.Since each traceability subject needs to maintain a complete ledger, it consumes a significant

Problems
Modern agricultural supply chains often comprise multiple stages, involving numerous participants, and are continuously expanding.In a flexible traceability system, through the application of concepts such as modularity and microservices, supply chain management becomes more adaptable, capable of responding flexibly to evolving demands and environments.Currently, there are two main issues present in traditional traceability systems.
(1) Issue of Low Query Efficiency The immutability of blockchain also gives rise to the problem of low query efficiency.Once data are recorded on the blockchain, it cannot be modified or deleted.Therefore, querying data requires a slow process of verification starting from the genesis block of the blockchain.This can significantly slow down the query speed, especially when dealing with large-scale data processing.Blockchain-based traceability systems require consensus mechanism verification and encryption calculations, which consume a substantial amount of computational resources, leading to low query efficiency.
(2) Incompatibility with the Diverse Needs of Traceability Subjects Each blockchain ledger mixes traceability data aimed at multiple traceability subjects.If different traceability subjects want to obtain specific data according to their respective needs, complex data filtering and screening are required.This can affect the accuracy of data traceability.For a traceability subject, only their own traceability data are of concern.In this scenario, storing all traceability data together in one ledger not only increases the size and complexity of the ledger but also leads to data redundancy and wastage.Since each traceability subject needs to maintain a complete ledger, it consumes a significant amount of storage space and computational resources.This not only results in high maintenance costs for the ledger but also leads to performance degradation and system instability.

Supply Chain Traceability Process Analysis
The supply chain of Agaricus bisporus exhibits pronounced seasonality, with its growth being significantly influenced by natural factors such as temperature and humidity, leading to fluctuations in production across different seasons.As a perishable product, it is imperative to maintain freshness, imposing higher standards on transportation, storage, and sales processes.Compared to other agricultural products, the growth cycle of Agaricus bisporus is relatively short, requiring timely harvesting and market entry, thereby necessitating the supply chain to possess efficient coordination and distribution capabilities.Additionally, consumers have stringent requirements for the quality and safety of mushroom products, with high standards set for aspects such as pesticide residues and pest control.The cultivation and production stages demand a certain level of agricultural expertise and specialized knowledge, including techniques for soil treatment and temperature-humidity control.Due to the influence of seasonality and growth cycles, matching the supply and demand of Agaricus bisporus proves relatively complex, calling for a supply chain equipped with flexible allocation capabilities.
Through a more detailed examination of the Agaricus bisporus supply chain traceability process, it is imperative that various stages within the supply chain facilitate the sharing and exchange of information to ensure seamless collaboration among them.Each stage comprises multiple sub-stages [16].Addressing all stages, the system further categorizes the Agaricus bisporus production process into six main modules: raw material and mushroom house management, cultivation management, storage management, processing management, logistics management, and sales management [17].The traceability process of the Agaricus bisporus supply chain is illustrated in Figure 2.
maintenance costs for the ledger but also leads to performance degradation and system instability.

Supply Chain Traceability Process Analysis
The supply chain of Agaricus bisporus exhibits pronounced seasonality, with its growth being significantly influenced by natural factors such as temperature and humidity, leading to fluctuations in production across different seasons.As a perishable product, it is imperative to maintain freshness, imposing higher standards on transportation, storage, and sales processes.Compared to other agricultural products, the growth cycle of Agaricus bisporus is relatively short, requiring timely harvesting and market entry, thereby necessitating the supply chain to possess efficient coordination and distribution capabilities.Additionally, consumers have stringent requirements for the quality and safety of mushroom products, with high standards set for aspects such as pesticide residues and pest control.The cultivation and production stages demand a certain level of agricultural expertise and specialized knowledge, including techniques for soil treatment and temperature-humidity control.Due to the influence of seasonality and growth cycles, matching the supply and demand of Agaricus bisporus proves relatively complex, calling for a supply chain equipped with flexible allocation capabilities.
Through a more detailed examination of the Agaricus bisporus supply chain traceability process, it is imperative that various stages within the supply chain facilitate the sharing and exchange of information to ensure seamless collaboration among them.Each stage comprises multiple sub-stages [16].Addressing all stages, the system further categorizes the Agaricus bisporus production process into six main modules: raw material and mushroom house management, cultivation management, storage management, processing management, logistics management, and sales management [17].The traceability process of the Agaricus bisporus supply chain is illustrated in Figure 2.

Supply Chain Traceability Indicator Screening
Traceability indicators refer to the relevant information that needs to be recorded and obtained when tracing products.They are divided into two categories: basic traceability content and safety traceability content.Basic traceability content includes the fundamental information of the product, as well as key links such as harvesting, storage, processing, and transportation [18].Safety traceability content, based on relevant national laws and regulations, records and reflects information regarding product quality and safety.This encompasses inspection reports, production process monitoring records, raw material and auxiliary material inspection reports, production equipment inspection reports, etc.This assists in promptly tracing back to the source of contamination and the relevant responsible parties.
When selecting traceability content, it is essential to comprehensively collect and record relevant information, establish a corresponding information management system, and make selections and assessments based on the product's characteristics and national regulatory requirements.Timely updates and the completeness of the traceability information are also crucial guarantees to ensure the effectiveness and reliability of traceability.By prudently selecting the traceability content, we can ensure the integrity and accuracy of the traceability information, providing effective support and assurance for safeguarding consumer rights and product quality and safety.
In various stages of the Agaricus bisporus supply chain, blockchain technology has been employed to establish a public chain, an enterprise chain, and a regulatory chain, enabling effective storage and sharing of information.The public chain is tasked with disclosing product information, allowing consumers to gain comprehensive insights into the origin, production process, and quality of the product.This enhances consumer rights protection, satisfaction, and provides a more trustworthy consumption experience.The enterprise chain offers a platform for relevant companies to share information, promoting collaboration and cooperation among enterprises, thus driving the development and innovation of the entire industry.The regulatory chain shoulders the responsibility of monitoring and supervising, storing pertinent qualification information from various links in the supply chain, as well as information that may affect the food safety and quality of Agaricus bisporus.This enables regulatory authorities to comprehensively monitor the entire supply chain from cultivation to the consumer end, swiftly addressing and tracing food safety issues, thereby safeguarding consumer rights effectively.The entire system, through the immutability and transparency of blockchain, establishes a reliable foundation of trust, providing robust assurance for the healthy development of the Agaricus bisporus supply chain.Based on the differentiated requirements for traceability subjects, the traceability information of the Agaricus bisporus supply chain is categorized as shown in Table 1.Addressing the issues of low query efficiency and the inability to accommodate the diverse information needs of different traceability stakeholders in the supply chain, we propose a multi-chain traceability model for Agaricus bisporus tailored to these stakeholders' requirements.
(1) Consumers Consumers assume a pivotal role as ultimate end-users within the Agaricus bisporus supply chain.Their levels of awareness, attitudes, and willingness to invest in traceable Agaricus bisporus serve as the primary impetus driving the advancement of the traceability system.Consequently, this exerts a substantial influence on the operational conduct of enterprises and the regulatory frameworks enacted by governmental bodies.Notably, consumers exhibit a pronounced demand for transparency in traceability information.They seek comprehensive insights into various facets, encompassing the provenance of Agaricus bisporus within the supply chain, enterprise licensing particulars, cultivation and harvesting timelines, quality evaluation records, storage and transit conditions, as well as processing protocols.Moreover, consumers are displaying an escalating concern regarding the application of pesticides, fertilizers, and other potentially hazardous substances throughout the production process.Additionally, they are vigilant about potential issues pertaining to environmental contamination, all in the pursuit of improving levels of safety and quality assurance [19][20][21].
(2) Enterprises Enterprises play a pivotal role in the Agaricus bisporus supply chain, serving as the principal providers of goods, disseminators of information, financial resources, and credit, as well as connectors with consumer groups.They assume a central position in the supply chain, facilitating comprehensive information sharing within the traceability system.This capability empowers them to aggregate and distribute data across various stages, affording a more profound comprehension of the complete Agaricus bisporus production process.Consequently, enterprises can refine their production processes and bolster the efficacy of supply chain management.
Moreover, transparent information sharing enables enterprises to bolster their brand image.The traceability system functions as a catalyst for attaining meticulous management and quality control.By vigilantly overseeing the entire lifecycle of Agaricus bisporus, enterprises can expeditiously pinpoint and rectify production-related issues and effectively manage risks, thereby improving product quality and safety.This, in turn, elevates consumer satisfaction levels and fortifies the reputation of the enterprise.Enterprises are poised to institute a value delivery framework within the traceability system, accomplishing a spectrum of value delivery objectives, including information dissemination, brand fortification, quality assurance, and risk mitigation.Ultimately, this fosters the enhancement in core competitiveness and market prowess for enterprises [22].
(3) Regulatory Authorities Regulatory authorities hold a pivotal role within the Agaricus bisporus traceability system.Their primary responsibility is to oversee a range of crucial data and information, particularly those pertaining to potential food safety concerns within the Agaricus bisporus supply chain.This encompasses scrutinizing the production qualifications of enterprises, examining quality inspection reports, and evaluating environmental data at various stages of production.
As an authoritative third party, regulatory authorities conduct comprehensive oversight and audits across the various stages of the Agaricus bisporus supply chain.This approach ensures a thorough and vigilant control over the circulation, production, and quality of products.It also verifies the legitimacy and compliance of enterprise production processes, ultimately safeguarding the lawful rights and interests of consumers.
Moreover, regulatory authorities play a dual role by both constraining and guiding enterprises through the dissemination of regulatory information.This proactive involvement allows them to swiftly identify and implement timely measures to foster the healthy development of enterprises, while simultaneously upholding the integrity of the Agaricus bisporus supply chain.

Design Concept
Consumer, enterprise, and regulatory entities, as pivotal stakeholders in traceability, present distinct requirements and utilization patterns for traceability data.This leads to notable disparities in aspects such as capacity, privacy, and security.Consumer demands for traceability data capacity are relatively modest, primarily encompassing fundamental information on cultivation, storage, processing, logistics, and sales within the Agaricus bisporus supply chain.These details typically entail straightforward data with relatively small volumes.
Conversely, enterprises and regulatory bodies necessitate higher traceability data capacity, seeking more extensive and detailed insights.This includes comprehensive information on growth environment specifics, product quality inspection data, qualification reports, and other substantial datasets, resulting in larger data volumes.These stakeholders engage with traceability data in a manner that requires a more comprehensive and detailed understanding of the Agaricus bisporus supply chain, thus demanding a higher capacity to accommodate the larger volumes of data involved.In terms of traceability data privacy and security, it is imperative to ensure secure data transmission and storage for both consumers and enterprises.This can be achieved by employing triple-layer data encryption algorithms for ciphertext storage of traceability data in off-chain databases.Regulatory entities additionally need to verify the source and authenticity of the traceability data, and conduct risk assessments and compliance checks on the data.
The single-chain structure in conventional blockchain models encounters challenges pertaining to diminished query efficiency and redundant traceability data.In response, we advocate for the establishment of three distinct main chains: a public chain, an enterprise chain, and a regulatory chain, each tailored to the specific needs of traceability stakeholders.Multi-chain technology serves as a safeguard for data security and privacy, ensuring that different traceability entities are shielded from the potential risk of disclosing proprietary information to third-party entities.
Within the traceability chain and the risk chain, nodes at various stages play crucial roles in maintaining the ledgers of all three main chains.This configuration enables both upstream and downstream enterprises to access pertinent data through local nodes at each stage.However, consumer nodes are confined to retrieving traceability data solely through dedicated consumer traceability nodes within the traceability chain.Similarly, regulatory nodes are restricted to supervising risk data solely within the regulatory chain, precluding access to data housed in the other chains.This methodical approach not only upholds the confidentiality of internal data exchanged between upstream and downstream enterprises, but also endows each traceability entity with access solely to duly authorized data.Thus, it effectively establishes controlled access permissions tailored to the distinctive requirements of different traceability stakeholders [23,24].

Model Construction
In response to consumers' demands for traceability information in the Agaricus bisporus supply chain, we propose the establishment of a public chain.This chain will facilitate the upload of traceability information related to Agaricus bisporus, providing a transparent and accessible query interface.This ensures consumers' right to information and choice regarding food safety and quality.
To enhance information sharing among upstream and downstream enterprises in the supply chain, we suggest the implementation of an enterprise chain.Through smart contracts, this chain will enable seamless data sharing and circulation between enterprises.This collaborative effort aims to improve the efficiency and quality across various stages of the supply chain.
For regulatory authorities overseeing quality and safety information, we advocate for the establishment of a supervision chain.This chain will serve as a platform for recording quality and safety information and will include designated supervision nodes.This setup will ensure that regulatory authorities can promptly and effectively access information on food safety and quality, thereby safeguarding public interests.
The multi-chain traceability model for Agaricus bisporus, tailored to the needs of different traceability stakeholders, is illustrated in Figure 3.

Scalability and Security Analysis of the Model
The multi-chain traceability model for Agaricus bisporus, tailored to different traceability stakeholders, aims to enhance the scalability and security of the entire blockchain system.
(1) Scalability Traditional blockchain-based agricultural product traceability models may face challenges such as network congestion and slow transaction speeds during large-scale data processing.In contrast, the multi-chain traceability model for Agaricus bisporus supply chains addresses the diverse traceability information needs of stakeholders.It is divided into three application scenarios: the public chain, enterprise chain, and supervision chain.Each main chain maintains its independent ledger, and each sub-chain has a relatively smaller capacity.This design helps to alleviate the storage pressure on the blockchain system, thereby enhancing the overall system's scalability.
(2) Security The design of the multi-chain traceability model for Agaricus bisporus, tailored to traceability stakeholders, can enhance the security of the blockchain system.Each main chain has its independent ledger, meaning that even if one main chain is attacked, it will In the multi-subject chain traceability system for Agaricus bisporus, the public chain directly uploads plaintext information on the blockchain.The enterprise chain stores plaintext hash values on the blockchain, while adopting a ciphertext approach for data storage and management off the blockchain.The supervision chain stores data information as a 46-character hash value on the blockchain, and in the off-chain domain, it is stored in the IPFS (InterPlanetary File System) file system [25].
For consumers, their primary concerns usually revolve around data query speed and transparency.Therefore, in the consumer-oriented traceability chain, data are typically stored in plaintext on the blockchain.Consumers can directly query plaintext data through public chain nodes to quickly obtain the information they need.
For the traceability information within the enterprise chain, the plaintext data undergoes a hash calculation using the SHA-512 algorithm, generating a 512-bit hash value that is uploaded to the enterprise chain to ensure data integrity.Subsequently, the plaintext data are converted into binary form and encrypted using the AES symmetric encryption algorithm, with the ciphertext stored in the local database to ensure data security and privacy.Following this, the ciphertext undergoes attribute-based encryption (CP-ABE) using the access policy vector as the key.During decryption, users are required to provide their own attribute vector that complies with the access policy vector of the ciphertext, allowing them to use their private key to decrypt the plaintext data [26][27][28].
CP-ABE technology empowers us to control data access based on specific conditions or attributes.Only users who meet these specific conditions can decrypt and access the data, providing a high level of security and flexibility.In contrast, the AES algorithm uses the same key for encryption and decryption, offering an efficient and reliable data protection mechanism.
Regulators typically require strict real-time monitoring and review of data to ensure its accuracy and compliance.Since IPFS supports content addressing and content encryption, a file's unique identifier in the IPFS system is its content hash value.If the content of a file is modified, the hash value will also change.Additionally, IPFS supports an encryption file system based on public key cryptography.This system encrypts data using public key encryption algorithms before storing them in the IPFS network.Only users with the corresponding private key can decrypt and access these data, ensuring their security and privacy.

Scalability and Security Analysis of the Model
The multi-chain traceability model for Agaricus bisporus, tailored to different traceability stakeholders, aims to enhance the scalability and security of the entire blockchain system.
(1) Scalability Traditional blockchain-based agricultural product traceability models may face challenges such as network congestion and slow transaction speeds during large-scale data processing.In contrast, the multi-chain traceability model for Agaricus bisporus supply chains addresses the diverse traceability information needs of stakeholders.It is divided into three application scenarios: the public chain, enterprise chain, and supervision chain.Each main chain maintains its independent ledger, and each sub-chain has a relatively smaller capacity.This design helps to alleviate the storage pressure on the blockchain system, thereby enhancing the overall system's scalability. (

2) Security
The design of the multi-chain traceability model for Agaricus bisporus, tailored to traceability stakeholders, can enhance the security of the blockchain system.Each main chain has its independent ledger, meaning that even if one main chain is attacked, it will not affect the other main chains or the entire system.Additionally, each main chain can have its consensus mechanism and security policies.This allows for the selection of different consensus mechanisms and security policies based on specific circumstances, thereby reducing the possibility of being attacked across the entire network and enhancing the overall security of the blockchain system.

Optimization of the Traceability Process
The flexible traceability model described in this paper adopts a distributed, modular design approach.By decoupling and encapsulating different segments of the supply chain into independent modules, the entire traceability system becomes more flexible and scalable.This optimized process is better suited to adapt to the continuously changing dynamics of the supply chain, allowing seamless integration based on actual circumstances, achieving a high degree of flexible traceability.Additionally, each functional module encompasses data processing logic and blockchain components, enabling independent transaction processing and data storage.Modules communicate and invoke one another through data flows, thereby realizing coordination across the supply chain segments and facilitating data sharing.The concept of a flexible and reliable traceability process is illustrated in Figure 4.
circumstances, achieving a high degree of flexible traceability.Additionally, each functional module encompasses data processing logic and blockchain components, enabling independent transaction processing and data storage.Modules communicate and invoke one another through data flows, thereby realizing coordination across the supply chain segments and facilitating data sharing.The concept of a flexible and reliable traceability process is illustrated in Figure 4.

Experiment
We conducted experimental simulations of the multi-chain traceability model tailored for traceability subjects, aiming to thoroughly investigate and evaluate the performance and feasibility of this model.The operating system used was Ubuntu 20.04 TLS, with an i9-13900kf CPU, and the version of Hyperledger Fabric was 2.4.6.The port testing tool employed was Apifox 2.2.37.

System Response Time
The "system response time" refers to the entire duration from when a user or another system sends a request to the blockchain network, to when the corresponding result is obtained.This is a critical metric for evaluating the system performance, directly impacting user experience and system availability.A shorter response time typically signifies higher performance and a faster transaction confirmation speed.Compared to the traditional blockchain-based storage structure, the multi-stakeholder chain's storage architecture exhibits significantly improved query efficiency.
Through testing and comparing 50 sets of traceability data in both the traditional blockchain-based traceability model and the traceability model designed for traceability subjects, we empirically demonstrated a significant improvement in efficiency in favor of the traceability model tailored for traceability subjects.The results of the experimental simulation are presented in Figure 5.

Experiment
We conducted experimental simulations of the multi-chain traceability model tailored for traceability subjects, aiming to thoroughly investigate and evaluate the performance and feasibility of this model.The operating system used was Ubuntu 20.04 TLS, with an i9-13900kf CPU, and the version of Hyperledger Fabric was 2.4.6.The port testing tool employed was Apifox 2.2.37.

System Response Time
The "system response time" refers to the entire duration from when a user or another system sends a request to the blockchain network, to when the corresponding result is obtained.This is a critical metric for evaluating the system performance, directly impacting user experience and system availability.A shorter response time typically signifies higher performance and a faster transaction confirmation speed.Compared to the traditional blockchain-based storage structure, the multi-stakeholder chain's storage architecture exhibits significantly improved query efficiency.
Through testing and comparing 50 sets of traceability data in both the traditional blockchain-based traceability model and the traceability model designed for traceability subjects, we empirically demonstrated a significant improvement in efficiency in favor of the traceability model tailored for traceability subjects.The results of the experimental simulation are presented in Figure 5.

Data Source
Shandong Century Wisdom Agricultural Technology Co., Ltd. is located in the National Agricultural Science and Technology Park of Zoucheng City, Shandong Province, China, and is currently the largest and most advanced Agaricus bisporus factory cultivation enterprise in Shandong Province.The company's primary business activities revolve around the production, processing, and domestic trade of edible mushrooms, as well as the production of organic bio-fertilizers.The company has introduced Dutch-style Agaricus bisporus cultivation technology and processes.Building upon the Agaricus bisporus supply chain of the company, this study conducted a comprehensive upgrade and optimization, culminating in the development of a flexible traceability system for the Agaricus bisporus supply chain.All data utilized in this study were sourced from this company.

Research and Development of the System
Based on the open-source framework Hyperledger Fabric v2.4.6, this paper establishes a system with three main organizations, including 12 peer nodes and 6 orderer nodes.Each organization contains two peer nodes.Utilizing the raft consensus mechanism in the backend of the Hyperledger Fabric, the fabric-sdk-java is integrated into the blockchain frontend code and adapted according to specific functional requirements.This has resulted in the initial implementation of a flexible traceability system for the Agaricus bisporus supply chain.The system has been running smoothly for two months, with a total of over 400 records stored in the blockchain.Figures 6-8 show screenshots of the Agaricus bisporus raw material management, raw material fermentation management interface, and official test network test results.

Data Source
Shandong Century Wisdom Agricultural Technology Co., Ltd. is located in the National Agricultural Science and Technology Park of Zoucheng City, Shandong Province, China, and is currently the largest and most advanced Agaricus bisporus factory cultivation enterprise in Shandong Province.The company's primary business activities revolve around the production, processing, and domestic trade of edible mushrooms, as well as the production of organic bio-fertilizers.The company has introduced Dutch-style Agaricus bisporus cultivation technology and processes.Building upon the Agaricus bisporus supply chain of the company, this study conducted a comprehensive upgrade and optimization, culminating in the development of a flexible traceability system for the Agaricus bisporus supply chain.All data utilized in this study were sourced from this company.

Research and Development of the System
Based on the open-source framework Hyperledger Fabric v2.4.6, this paper establishes a system with three main organizations, including 12 peer nodes and 6 orderer nodes.Each organization contains two peer nodes.Utilizing the raft consensus mechanism in the backend of the Hyperledger Fabric, the fabric-sdk-java is integrated into the blockchain frontend code and adapted according to specific functional requirements.This has resulted in the initial implementation of a flexible traceability system for the Agaricus bisporus supply chain.The system has been running smoothly for two months, with a total of over 400 records stored in the blockchain.Figures 6-8 show screenshots of the Agaricus bisporus raw material management, raw material fermentation management interface, and official test network test results.7 is the enterprise's management of traceability information for the fermentation of raw materials, including the fermentation type, temperature and humidity, fermentation time, employee information and so on.)

Discussion
Based on on-site research at a modern Agaricus bisporus factory, this paper conducts an in-depth analysis of various links in the Agaricus bisporus supply chain.By combining the differentiated requirements of traceability subjects including consumers, enterprises, and regulatory authorities, a trustworthy traceability system architecture for Agaricus bisporus quality and safety is constructed.This includes the deployment of the Hyperledger Fabric environment and the development of smart contracts.The logical design of the system is outlined through the on-site research plan, demonstrating the operation of the trustworthy traceability system for Agaricus bisporus quality and safety.
The following are two key points to consider.Intra-and inter-firm challenges: Internally, companies must overcome challenges such as inadequate technical expertise and facility limitations, necessitating significant resource allocation to ensure the system operates efficiently.Additionally, it is crucial for companies to invest the requisite time and resources in employee training and to safeguard data accuracy, integrity, and confidentiality to enhance credibility.Externally, implementation between companies requires addressing issues like partner compliance, ensuring transparency in information sharing, and establishing uniform data standards.This involves fostering a relationship of mutual trust, clarifying the allocation of risk and

Discussion
Based on on-site research at a modern Agaricus bisporus factory, this paper conducts an in-depth analysis of various links in the Agaricus bisporus supply chain.By combining the differentiated requirements of traceability subjects including consumers, enterprises, and regulatory authorities, a trustworthy traceability system architecture for Agaricus bisporus quality and safety is constructed.This includes the deployment of the Hyperledger Fabric environment and the development of smart contracts.The logical design of the system is outlined through the on-site research plan, demonstrating the operation of the trustworthy traceability system for Agaricus bisporus quality and safety.
The following are two key points to consider.Intra-and inter-firm challenges: Internally, companies must overcome challenges such as inadequate technical expertise and facility limitations, necessitating significant resource allocation to ensure the system operates efficiently.Additionally, it is crucial for companies to invest the requisite time and resources in employee training and to safeguard data accuracy, integrity, and confidentiality to enhance credibility.Externally, implementation between companies requires addressing issues like partner compliance, ensuring transparency in information sharing, and establishing uniform data standards.This involves fostering a relationship of mutual trust, clarifying the allocation of risk and responsibilities, and collectively driving the smooth implementation and operation of the traceability system.
The challenges in technical and system management aspects: In the process of system implementation, ensuring data security and privacy protection is of paramount importance, especially when dealing with sensitive information.Corresponding protective measures are imperative.Additionally, maintaining and promptly updating the system to adapt to new demands and technological advancements is crucial.However, introducing new technology or upgrading existing systems necessitates a substantial investment of resources, including funds and human capital.Therefore, businesses need to adopt appropriate strategies and measures in the realms of technology and systems to ensure their effective operation and sustained development.
From the perspective of consumers and society, this system enhances consumer trust and confidence in the products, allowing them to accurately understand the production source, quality, and safety information.It aids in swiftly identifying and resolving product quality and safety issues, thereby safeguarding the health and safety of consumers.Additionally, the system encourages consumers to actively participate in product quality supervision and feedback, enhancing their sense of involvement and prompting companies to continually improve product quality standards.
At the enterprise and supply chain levels, this system yields significant positive effects.Firstly, it enables companies to precisely trace the fundamental causes of product quality issues, facilitating targeted improvements and enhancing overall product quality.Secondly, by swiftly locating and recalling affected products, the system reduces the time and cost involved in crisis management, effectively lowering enterprises' risks.Furthermore, the implementation of a traceability system underscores a company's heightened emphasis on product quality and safety, thereby bolstering its brand image and reputation.The system furnishes more accurate data and information, aiding in the optimization of supply chain management and operations, thereby elevating overall efficiency and laying a solid foundation for the sustainable development of enterprises.
Currently, our team has conducted some preliminary experiments at Shandong Century Smart Agriculture Technology Co., Ltd.(Weifang, China), focusing mainly on Agaricus bisporus supply chain data collection technology and the development of a flexible traceability system.These are just initial explorations, and future work will focus on optimizing the system's interface and usability, providing enterprises and consumers with a better user experience.

Conclusions
This paper is dedicated to addressing the specific requisites of traceability within the Agaricus bisporus supply chain.It meticulously considers the disparities in information administration and dissemination among traceability entities.We introduce a conceptual framework for a multi-chain traceability model, meticulously tailored to the distinct needs of various traceability stakeholders.This framework ensures the lucidity and seamless integration of traceability information.Through rigorous experimental simulations, the model exhibits exceptional performance in terms of data query efficiency and security.Additionally, we disentangle and encapsulate different nodes within the supply chain into autonomous modules, thereby augmenting the adaptability and scalability of the entire traceability system.Furthermore, to enhance the quality and safety management of the Agaricus bisporus supply chain, we present pragmatic resolutions that furnish robust backing for real-world applications.Nevertheless, with the incessant progression of blockchain and artificial intelligence technologies, there remain challenges in harmonizing them to anticipate potential food safety risks.Consequently, our research team remains committed to sustained endeavors aimed at unearthing innovative resolutions.
In summation, this investigation proffers a traceability model attuned to the diverse exigencies of stakeholders within the Agaricus bisporus supply chain.By instituting public, enterprise, and regulatory chains, we aptly cater to the requisites of consumers, enterprises, and regulatory authorities, thereby markedly enhancing the storage and query efficiency of the system.Through the strategic deployment of Hyperledger Fabric's modular design, we optimize the Agaricus bisporus supply chain, with validation results distinctly showcasing a notable enhancement in the query efficiency and credibility of traceability information.This notably heightens the system's flexibility.

Figure 3 .
Figure 3. Multi-chain traceability model of Agaricus bisporus for traceability subjects.

Figure 3 .
Figure 3. Multi-chain traceability model of Agaricus bisporus for traceability subjects.

Figure 5 .
Figure 5.Comparison of query efficiency between the two models.4.6.2.Data Source Shandong Century Wisdom Agricultural Technology Co., Ltd. is located in the National Agricultural Science and Technology Park of Zoucheng City, Shandong Province, China, and is currently the largest and most advanced Agaricus bisporus factory cultivation enterprise in Shandong Province.The company's primary business activities revolve around the production, processing, and domestic trade of edible mushrooms, as well as the production of organic bio-fertilizers.The company has introduced Dutch-style Agaricus bisporus cultivation technology and processes.Building upon the Agaricus bisporus supply chain of the company, this study conducted a comprehensive upgrade and optimization, culminating in the development of a flexible traceability system for the

Figure 5 .
Figure 5.Comparison of query efficiency between the two models.

Figure 6 .
Figure 6.Raw material management interface.(The Chinese in Figure 6 is for the addition of raw material information in the enterprise, including suppliers, contact information, contact person and other information.)

Figure 6 . 15 Figure 7 .
Figure 6.Raw material management interface.(The Chinese in Figure 6 is for the addition of raw material information in the enterprise, including suppliers, contact information, contact person and other information.)Appl.Sci.2023, 13, x FOR PEER REVIEW 12 of 15

Figure 7 .
Figure 7. Raw material fermentation management interface.(The Chinese in Figure7is the enterprise's management of traceability information for the fermentation of raw materials, including the fermentation type, temperature and humidity, fermentation time, employee information and so on.)

Figure 7 .Figure 8 .
Figure 7. Raw material fermentation management interface.(The Chinese in Figure7is the enterprise's management of traceability information for the fermentation of raw materials, including the fermentation type, temperature and humidity, fermentation time, employee information and so on.)

Figure 8 .
Figure 8. Test results using the official test network.

Table 1 .
Supply chain traceability data classification for traceability subjects.