Grain supply chain privacy data sharing method based on distributed federated learning

By combining distributed federated learning and blockchain technology, the problems of data heterogeneity and centralized architecture in the food supply chain have been solved, enabling privacy data sharing and collaborative modeling in the food supply chain, and improving data security and intelligence.

CN120834918APending Publication Date: 2025-10-24BEIJING TECH & BUSINESS UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510476665.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

Existing technologies suffer from data heterogeneity issues in the food supply chain. The large volume and uneven distribution of data make collaborative computation of privacy data and end-to-end traceability difficult. Furthermore, existing federated learning systems have centralized architectural flaws that make them unsuitable for multi-dimensional collaborative needs.

Method used

This paper proposes a distributed federated learning approach for sharing privacy-preserving data in the food supply chain. By combining blockchain technology, a heterogeneous federated learning, model aggregation scheme, and hierarchical federated learning aggregation algorithm are designed. Through feature distillation and hierarchical encryption management of privacy-preserving data in the food supply chain, data privacy protection and collaborative modeling are achieved.

Benefits of technology

It enhances data security and information transparency in the food supply chain, promotes data sharing and collaborative analysis among all parties, improves data security, information transparency and intelligent development of the supply chain, and has strong applicability, applicable to different types of grain and oil products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120834918A_ABST
    Figure CN120834918A_ABST
Patent Text Reader

Abstract

The invention discloses a grain supply chain privacy data sharing method based on distributed federated learning, and relates to the field of grain quality safety. According to the method, the private data sharing architecture of the grain supply chain is divided into a local layer, an edge layer and a global layer, a feature distillation framework is designed for data isomerism, and a model aggregation scheme and a hierarchical federated learning algorithm of each layer are optimized. And meanwhile, five encryption algorithms are introduced to realize hierarchical encryption, so that the data are ensured to be available but invisible, the sharing security and credibility are improved, and privacy protection and data sharing are balanced. Coupling of different types of data among links of the grain supply chain is increased, convenience and safety of data interaction among the links of the grain supply chain are improved, storage cost of the data of the supply chain and high delay of interaction are reduced, fine management of the data of the grain supply chain and personnel is achieved, and the management efficiency of the grain supply chain is improved. And the food quality safety of the grains is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a grain supply chain privacy data sharing method based on distributed federated learning, and relates to the fields of grain quality and safety, blockchain, federated learning, and artificial intelligence. BACKGROUND

[0002] Grain is the cornerstone of human survival and development, and ensuring food security is crucial for maintaining social stability, promoting economic growth, and addressing global crises. As the world's major grain crops, including wheat, corn, and rice, their widespread cultivation not only supports the livelihoods of millions of farmers but also provides abundant nutrition and cultural heritage to humanity, while promoting sustainable agriculture and environmental protection practices. According to the US Department of Agriculture (USDA) 2025 report, global grain production in the 2024 / 25 season is expected to reach 2.854 billion tons, a new historical high, with wheat production reaching 794 million tons, corn production reaching 1.212 billion tons, and rice production reaching 535 million tons. Global grain consumption is expected to reach 2.856 billion tons, with end-of-season inventory reaching 874 million tons, indicating a generally relaxed supply situation. However, grain quality and safety issues remain serious. For example, the cadmium over-standard rate of rice in some areas of China exceeds 8%, and the pesticide residue over-standard rate in India and Vietnam reaches 12%-18%. In addition, mold contamination and fumigant residue issues are prevalent worldwide, posing a serious threat to consumer health and food safety. Therefore, strengthening quality regulation, promoting green planting techniques, reducing pesticide use, and developing heavy metal treatment technologies have become key tasks for the sustainable development of the global grain industry. Despite overall growth in global grain production, imbalances in supply and demand, quality and safety issues, and climate change continue to pose challenges to food security.

[0003] In addressing these challenges, technological innovation plays a crucial role. In recent years, the combination of blockchain and federated learning has shown great potential in various fields, particularly in data sharing and multi-party collaboration. This approach effectively addresses issues such as privacy protection, security, and efficiency. Related theoretical research focuses on incentive mechanisms, attack prevention strategies, lightweight blockchain design, and framework optimization to enhance system efficiency and defend against malicious behavior. The combination of distributed federated learning and blockchain technology has demonstrated significant advantages in several key areas. In the financial industry, this technology enhances the reliability and timeliness of data processing, supporting core businesses such as credit scoring, risk control, and anti-fraud. In the medical and health sector, it promotes disease diagnosis, new drug development, and personalized medicine, benefiting from its privacy protection mechanism. In the field of network security, the integration of the two technologies facilitates the sharing of security threat intelligence while ensuring data privacy. The Internet of Vehicles and autonomous driving systems benefit from the decentralized architecture, improving data interaction security and communication efficiency. In industrial Internet of Things, the technology assists in energy trading, remote device monitoring, and production optimization, enhancing manufacturing intelligence. In the energy and power sector, the synergy of consortium blockchain and federated learning enables distributed power demand forecasting. However, research in the field of food security is still in its early stages. Overall, distributed federated learning provides a secure and efficient solution for cross-industry data collaboration, accelerating the widespread application of decentralized and intelligent technologies.

[0004] Federated learning is a distributed machine learning method that allows multiple parties to collaboratively train a model without sharing raw data, ensuring data privacy. Each participant updates their model locally and shares the updated model parameters securely. This approach effectively avoids data leakage risks while improving learning efficiency and model accuracy. The integration of blockchain and federated learning enhances data collaboration security and auditability through its decentralized architecture and tamper-proof mechanism, making the multi-party model training process traceable and verifiable. Additionally, the introduction of smart contracts automates collaboration rules and programmatically manages participant behavior, optimizing system autonomy and trust mechanisms. The resulting distributed federated learning architecture opens up innovative paths for addressing data privacy protection and model security upgrades, becoming a new technology support for safeguarding food supply chain data security.

[0005] The distributed federated learning technology provides a new solution path for data security protection and intelligent upgrading of the food supply chain, but it still faces many challenges when dealing with large-scale and high-complexity food supply chain data. As the main food supply basis for more than 70% of the world's population, the food supply chain involves massive heterogeneous data, and the existing technology still has the following limitations in private data collaborative computing and whole-process traceability.

[0006] (1) The food supply chain covers the whole life cycle, involves complex links, has large data volume and uneven distribution, resulting in serious data heterogeneity problems. However, existing research lacks systematic exploration of this issue, and there is an urgent need to develop federated learning solutions for heterogeneous data in the food field.

[0007] (2) Due to the massive nature of global food system data collection and the geographical dispersion of participants, information acquisition faces temporal and spatial barriers. The food supply chain, as a complex network involving multiple participants, relies on close collaboration among all links for efficient operation. The current federated learning system has centralized architecture defects and needs to be combined with blockchain technology to ensure data credibility and process verifiability. In addition, a single distributed federated learning model has been difficult to adapt to the multi-dimensional collaboration needs of the food supply chain. SUMMARY

[0008] In view of the deficiencies in existing research on private data management and traceability of the food supply chain, the present application provides a distributed federated learning method for sharing private data of the food supply chain, designs a distributed federated learning private data trusted sharing model for the food supply chain, and on the basis of the model, designs a heterogeneous federated learning, model aggregation scheme and hierarchical federated learning aggregation algorithm to jointly control the private data of the food supply chain.

[0009] The distributed federated learning method for sharing private data of the food supply chain of the present application has the following specific steps:

[0010] Step 1: Construct a distributed federated learning private data trusted sharing model for the food supply chain.

[0011] According to the differences in the types and sensitivity of food data, combined with the data needs of different links, a privacy data trusted sharing model based on distributed federated learning is proposed for the food supply chain. Based on the privacy data permission hierarchical encryption of food supply chain data, the model aims to efficiently manage and coordinate data and models while protecting data privacy. The six links of the food supply chain—production, storage, processing, warehousing, logistics, and sales—correspond to different data collection devices and enterprise nodes. The model applies encryption and privacy protection strategies to each node to ensure that all parties can share and use data while protecting privacy. To ensure data security and privacy and promote data sharing and collaborative analysis among parties, the model uses a distributed approach to protect data privacy and uses federated learning technology to perform collaborative modeling and analysis while ensuring data security. The model fully considers data privacy, compliance, and the balance of interests among all parties, effectively supporting trusted data sharing and collaboration among the links of the food supply chain, further enhancing data security and information transparency in the food supply chain, and promoting the intelligent and digital development of the supply chain.

[0012] Step two, build a feature distillation framework for data heterogeneity in federated learning.

[0013] Food supply chain privacy data is divided into sensitive features (i.e., features that significantly contribute to model performance) and stable features (i.e., features that have limited contribution to model performance) through feature distillation. Sensitive features are shared globally to alleviate data heterogeneity, while stable features are kept locally. Then the clients of federated learning can train the model on local and shared food privacy data, and upload the model parameters to the server for parameter aggregation.

[0014] Step three, design different model aggregation schemes.

[0015] According to the design of three model aggregation schemes based on distributed federated learning, different food supply chain structures and data characteristics can be flexibly handled, local and global collaborative optimization during training can be achieved, and the efficiency and adaptability of the model can be ensured. Local aggregation optimization is the model training and aggregation within each link. The nodes within each link will perform local model training and aggregate local model parameters to ensure the optimization effect of the model within the link. Edge collaborative aggregation aggregates model parameters of each link on the edge server, focusing on model parameter aggregation within the same link to ensure model optimization and consistency within the link. Global collaborative aggregation is responsible for aggregating model parameters of multiple links at the server level, acting as a central coordination role, aggregating models from each link to form a global model, promoting cross-link collaborative optimization and knowledge sharing. The three aggregation strategies work together to improve the collaborative efficiency and model optimization capability of the entire system under data privacy protection.

[0016] Step four, design a distributed federated learning aggregation algorithm.

[0017] In order to promote the cooperation of different levels and nodes in the food supply chain, solve the data problem and improve the information flow, model training efficiency and system automation level, three kinds of distributed federated learning aggregation algorithms are designed: the local collaborative optimization algorithm adopts the combination of FedAvg algorithm and blockchain verification mechanism, and the lightweight verification of blockchain can significantly improve the communication efficiency between nodes, and the collaborative training between local nodes can improve the overall efficiency and speed up the model training process; The edge collaborative aggregation algorithm adopts the combination of pFedMe algorithm and the collaborative effect of blockchain distributed ledger, through personalized optimization and global information synchronization, the system's adaptability to data heterogeneity is improved, the ability of edge node collaborative update is enhanced, the data utilization rate and decision efficiency are optimized, and the complexity of the supply chain is adapted; The global collaborative aggregation algorithm adopts the fusion application of FedProx algorithm and the tamper-proof feature of blockchain, which ensures the consistency of cross-node models, solves the data heterogeneity problem through regularization constraint, prevents the deviation of node model update from the global goal, ensures the consistency and stability of the global model, and improves the collaborative efficiency of the system. The three kinds of aggregation algorithms work together to promote the efficient operation and optimization of the food supply chain.

[0018] The advantages and positive effects of the present application are:

[0019] (1) The food supply chain privacy data sharing method based on distributed federated learning of the present application combines federated learning technology, blockchain technology, feature distillation technology, privacy protection technology and food supply chain, which is innovative and has certain guiding value for extending the method to other foods or even other industries in the future. The present application ensures data privacy through federated learning, ensures trusted sharing through blockchain, and realizes safe and efficient collaborative modeling and knowledge flow in the food supply chain.

[0020] (2) The distributed federated learning food supply chain data sharing method proposed in the present application realizes the verifiable on-chain of private data through blockchain, while ensuring data security, relying on the responsibility tracing mechanism constructed by smart contract, which can efficiently identify and hold accountable the dishonest subject.

[0021] (3) The food supply chain privacy data sharing method based on distributed federated learning of the present application efficiently manages and coordinates data and models by combining blockchain and federated learning technology, improves collaborative efficiency and protects data privacy. Compared with the prior art, different encryption methods are used to encrypt the data digest at multiple levels, and the complexity of encrypted data is higher, which ensures that the private data information is transmitted in encrypted form. The framework includes local layer, edge layer and global layer, which are responsible for local model update, edge model generation and global model aggregation respectively, ensuring the privacy and collaboration of data at each link.

[0022] (4) The food supply chain privacy data sharing method based on distributed federated learning of the present invention has strong applicability and can realize trusted dynamic supervision of the supply chain for different types of grain and oil products, and has universal applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a diagram of the research architecture for trusted sharing of private data in the food supply chain based on distributed federated learning in the present invention;

[0024] Figure 2 This is a diagram of the heterogeneous federated learning architecture of the method of the present invention;

[0025] Figure 3 It is a data heterogeneity characteristic distillation diagram of the method of the present invention;

[0026] Figure 4 Schematic diagram of the model polymerization scheme of the method of the present invention; Figure 5 Schematic diagram of the distributed federated learning system architecture of the method of the present invention; DETAILED DESCRIPTION

[0027] In order to facilitate those skilled in the art to understand and implement the present invention, the present invention is further described in detail and in depth below with reference to examples.

[0028] The present invention conducts an in-depth analysis of the operational process of the food supply chain and systematically sorts out the main participants and their functional division of each node in the supply chain. It innovatively adopts a method that combines blockchain technology with federated learning to construct a decentralized privacy data collaborative computing framework. This framework effectively solves the problem of integrating heterogeneous data in the food supply chain, and innovatively designs a flexible and scalable model fusion mechanism that can dynamically adapt to diverse supply chain architectures and differentiated data characteristics. On this basis, an intelligent aggregation algorithm for distributed federated learning was developed, which significantly improves the collaborative efficiency between various levels and nodes in the food supply chain, successfully overcomes the problem of data islands, and achieves efficient transmission of information flow, performance optimization of model training, and an overall leap in the intelligence level of the entire system.

[0029] like Figure 1 As shown, the method of the present invention is based on a trusted sharing model of food supply chain privacy data based on distributed federated learning.

[0030] A privacy protection data sharing model for grain supply chain is proposed in this study, which adopts a distributed federated learning framework combined with a hierarchical architecture and a hierarchical encryption mechanism to improve computational efficiency while ensuring data security. By replacing centralized servers with a hierarchical blockchain, decentralized operation is achieved. Nodes at each level collaborate through smart contracts to complete local training and global aggregation of federated learning, reducing the risk of privacy leakage and enhancing the supply chain's intelligent decision-making capabilities. This solution provides a secure and efficient technical path for the digitalization of the grain supply chain, enabling safe circulation and value extraction of data.

[0031] The model is deployed in multiple geographically distributed grain production, storage, and transportation links and collects and transmits data through AIoT (Artificial Intelligence Internet of Things) devices. In each link of the supply chain, AIoT devices such as sensors and RFID readers are distributed to collect key data such as environmental temperature and humidity, storage conditions, and transportation status to support horizontal federated learning. The collected data is assumed to follow the same distribution and is stored in the nearest edge server, which communicates with each other through a relatively stable dedicated network (such as the internal network of a field station or warehouse) for high-speed point-to-point communication, which is more efficient than remote network communication across links. To improve the security and collaboration efficiency of federated learning in the entire AIoT network, the model uses a hierarchical blockchain system to replace traditional centralized parameter servers, enabling decentralized privacy data sharing and model training. Specifically, hierarchical blockchain nodes act as supply chain participants to collaboratively execute hierarchical federated learning processes and ensure data privacy protection and the effectiveness of global optimization of the supply chain through joint global model aggregation.

[0032] To better protect data privacy, this paper designs a hierarchical encryption management scheme based on privacy sensitivity. This scheme divides the privacy data in the grain supply chain into five levels according to the sensitivity of the data and uses corresponding encryption methods for protection. Hierarchical encryption strategies are used for data and models involving privacy and sensitive information, and precise management and access control are performed according to permission levels to ensure data security and compliance, as shown in Tables 1 and 2.

[0033] Table 1: Hierarchical Encryption of Privacy Data Permissions

[0034]

[0035] Table 2: Classification of Privacy Data

[0036]

[0037] The model is divided into three levels of local layer, edge layer and global layer, aiming to realize the decentralized management and efficient sharing of privacy data, and to improve the security and efficiency of data privacy protection and cross-institutional collaboration modeling in the grain supply chain. The local layer is where each link trains the model independently, updates the model based on local privacy data, and transmits the update results to the edge server of the link. The edge layer connects multiple local link data nodes, receives local model parameter updates, generates an edge model by aggregating local model parameters, and finally uploads the edge model to the global layer for sharing and training. The global layer is responsible for collecting aggregated model parameters uploaded by each edge layer, executing aggregation algorithms to generate a global model, and recording global model updates and model parameters of each edge node. Through this hierarchical structure, the protection of data privacy and the collaborative optimization of the model are ensured, and the efficiency and security of the overall system are improved.

[0038] As shown in Figure 2 The method of the present application is based on a heterogeneous federated learning architecture.

[0039] The federated learning framework based on feature distillation aims to achieve the dual goals of model performance optimization and data privacy protection through selective sharing of key features. The framework adopts a four-stage processing flow: first, in the feature distillation stage, the server side analyzes the features of the original data, distinguishing between sensitive features (which have a decisive role in model performance) and stable features (which contain redundant or secondary information); then, in the data sharing stage, the system only transmits the filtered sensitive features to each client, and introduces protection mechanisms such as homomorphic encryption to effectively control the risk of privacy leakage; finally, the overall learning process is completed through the local training and model updating stages. This feature selection mechanism not only guarantees the model training effect, but also significantly improves data security.

[0040] In the local training stage, the client uses local data combined with shared sensitive features for hybrid training to improve the model's generalization ability and alleviate the problem of data heterogeneity. The updated model obtained by each client through local training will be uploaded to the server, and in the model updating stage, the server integrates the model parameters of each client through the classic federated learning aggregation algorithm FedAvg algorithm to generate a global updated model, which is then distributed to the clients for the next round of training. Through this iterative process, the system can continuously optimize the model performance while always maintaining data privacy and security. Through the strategies of feature distillation and selective sharing, not only the data transmission and computing overheads are reduced, but also the efficiency and accuracy of model training are effectively improved, solving the challenges brought by data heterogeneity.

[0041] As shown in Figure 3 The method of the present application is based on a heterogeneous federated learning architecture.

[0042] The FD framework adopts a feature distillation technique to process the privacy data of the grain supply chain. The core of the feature distillation technique is to divide the data features into two categories: sensitive features (i.e., features that have a significant contribution to the performance of the model) and stable features (i.e., features that have a limited contribution to the performance of the model). The framework reduces data heterogeneity by sharing sensitive features globally, while keeping stable features locally. On this basis, FD allows clients to train models using both local data and shared features. In particular, the framework designs a special feature distillation algorithm that can extract the minimum sufficient information representation from the data and discard other features, which can be expressed as:

[0043]

[0044] where Z represents the desired representation extracted from the input X (with label Y), I(·) is mutual information, I IB is a constant. Z minimizes the mutual information between X and Y. At the same time, Z removes most of the information about the input X, so that the mutual information I(X; Z) is less than a constant I IB .

[0045] Similarly, in FD, only the minimum sufficient information needs to be shared to alleviate data heterogeneity, while other features are discarded before sharing the data, i.e., kept locally on the client side. The goal of feature distillation is:

[0046]

[0047] where Z represents the sensitive features in X, Y is the label of X, (X-Z) represents features that have little effect on performance and do not need to be shared, and I FF is a constant, (X-Z) should mainly contain data based on the sensitive features Z, and Z should contain the necessary information about the label Y. Therefore, learning with this goal can divide the grain data features into sensitive features and stable features, achieving the goal of feature distillation.

[0048] As shown in Figure 4 , the model aggregation scheme of the distributed federated learning of the present application has the following specific steps:

[0049] Under the above model framework, three distributed federated learning model aggregation schemes are designed to flexibly cope with different grain supply chain structures and data characteristics, achieve local, edge, and global collaborative optimization during training, and ensure the efficiency and adaptability of the model. Local aggregation optimization is the model training and aggregation within each link. The nodes in each link will perform local model training and aggregate local model parameters to ensure the optimization effect of the model within the link. Edge collaborative aggregation is the aggregation of model parameters in each link on the edge server, focusing on the aggregation of model parameters within the same link to ensure model optimization and consistency within the link. Global collaborative aggregation is responsible for aggregating model parameters of multiple links at the server level, acting as a central coordination role, aggregating models from each link to form a global model, and promoting cross-link collaborative optimization and knowledge sharing. The three aggregation strategies work together to improve the collaborative efficiency and model optimization capability of the entire system under data privacy protection.

[0050] The specific workflow of local aggregation optimization is as follows. The local layer is composed of various grain supply chain enterprises or data collection devices, and its function corresponds to the general node (CN) of federated learning. Based on private data, each participant in this layer independently completes local model training and generates corresponding model parameters, uploads the model parameters to the KNPB (link aggregation node) for secure aggregation instead of direct exchange, to ensure data privacy while achieving collaborative optimization of federated learning. The original data is always kept within each participant, and knowledge sharing is completed through model parameter interaction to effectively avoid the risk of data leakage.

[0051] Each private blockchain is deployed in a different link of the grain supply chain - production, storage, processing, warehousing, logistics, and sales, responsible for local FL training and data management. Within each supply chain link, AIoT devices (such as sensors, intelligent warehousing systems, etc.) collect local private data, edge servers (ES) act as worker nodes to perform local FL training, and share learning results within the private blockchain to achieve decentralized private data collaboration.

[0052] In each private blockchain, the local model trained by the CN needs to be integrated through the key node, and the local consensus result is sent to the KNPB for model aggregation to generate the link model parameters. KNPB adopts a node election method based on a verifiable random function to reduce the probability of malicious nodes being selected and reduce the computational overhead caused by frequent elections. VRF allows random selection of KNPB in an unpredictable but verifiable manner. KNPB is mainly responsible for collecting local model updates trained by CN and packaging them as transaction data to form candidate blocks. At the same time, KNPB is responsible for generating and publishing new blocks to ensure the integrity and security of private data. This distributed data sharing mode ensures the independence of data in each link of the supply chain, while connecting to the higher-level edge blockchain layer through KNPB and ultimately aggregating to the global blockchain layer, realizing cross-link private data sharing and optimized modeling.

[0053] The specific workflow of edge collaborative aggregation is shown below. The edge layer, as a key bridge connecting the global layer and the local layer, corresponds to the private blockchain link node. Each edge server receives the parameters of the local model after training and further aggregates them to form an edge model, which is then uploaded to the global layer. At the same time, the private blockchain nodes in this layer store and synchronize data between food supply chain enterprises and data collection devices in different regions, ensuring data privacy and secure sharing.

[0054] In the edge blockchain layer, each supply chain link node uploads model parameters to the edge server layer to form a consortium blockchain, realizing data collaboration and model fusion between multiple private blockchains. In the consortium chain, each edge server acts as a computing node responsible for executing edge layer FL training tasks and exchanging training results with other nodes to aggregate edge model parameters on the consortium chain. Subsequently, the updated edge model is synchronized to each private blockchain to optimize local FL training and improve the intelligent level of decision-making in each link of the supply chain. The consortium chain adopts a key node election mechanism to select a KNCB from all edge nodes as the core management node, responsible for collecting edge consensus results and aggregating local model parameters to form edge model parameters, packaging candidate blocks and publishing new blocks to ensure data integrity, security and traceability on the consortium chain. At the same time, the edge consensus result will be sent back to the local link node to further optimize the model training and data storage of the private blockchain layer.

[0055] The specific workflow of global collaborative aggregation is shown as follows: the global layer is responsible for model management and updating of the entire system. In this layer, each edge server uploads the aggregated model parameters, confirms the validity of the model through a global consensus algorithm, ensures the credibility and consistency of the global model, and generates a global model through a federated learning aggregation algorithm, and records all model update information. The global layer ensures the integrity and global optimality of the model, and transmits the global model parameters to the lower layer to ensure the collaborative optimization of each node.

[0056] The alliance chain is responsible for connecting multiple edge blockchain layers to realize global federated learning modeling and cross-link data sharing of the supply chain. In this layer, each link server of the supply chain serves as a shared node to jointly build a higher-level global blockchain. Each link alliance chain can access the global blockchain, which not only improves the data collaboration ability across regions and subjects but also ensures privacy protection. The servers in the global blockchain serve as computing nodes to perform large-scale federated learning training tasks and build a globally optimized model by exchanging training results with other servers. The updated global model will be synchronized to the edge blockchain layer and the private blockchain layer, ultimately benefiting each supply chain link and realizing intelligent management. The global blockchain layer adopts a key node election mechanism to select a KNDB as the core management node from all global layer nodes, which is responsible for collecting global consensus results and aggregating edge model parameters to form global model parameters, packaging candidate blocks and publishing new blocks, and ensuring the data integrity, security and traceability of the alliance chain.

[0057] The multi-layer blockchain architecture combines the FL method to ensure data privacy protection of the grain supply chain while improving data collaboration efficiency and decision-making intelligence. Through FL training and key node election mechanism in the private blockchain, data can be efficiently shared within each supply chain link while ensuring security and reliability. Combined with the edge blockchain layer and the global blockchain layer, this method can further improve the global modeling capability and provide reliable technical support for the intelligent management of the grain supply chain.

[0058] As shown in Figure 5 , a distributed federated learning aggregation algorithm of the present application, the specific steps are as follows:

[0059] To improve the collaboration efficiency and data flow security of the grain supply chain, a distributed federated learning aggregation algorithm is designed to optimize the model training and decision-making process at different levels. The local collaborative optimization algorithm combines the FedAvg algorithm and blockchain technology to reduce communication costs between nodes and improve computational efficiency. The edge collaborative aggregation algorithm integrates the pFedMe algorithm and the distributed characteristics of blockchain to enhance the system's adaptability to data heterogeneity and optimize the decision-making process. The global collaborative aggregation algorithm is based on the FedProx algorithm and the collaborative application of blockchain's tamper-proof nature, effectively solving the cross-node data heterogeneity problem and ensuring model consistency. The three-level algorithm collaboratively builds an efficient and secure optimization scheme for the grain supply chain, significantly improving operational efficiency. The specific algorithm implementation process is as follows:

[0060] (1) Local collaborative optimization algorithm

[0061] Step 1: Initialization and registration

[0062] Each specific node k (k1 is the production node, k2 is the storage node, k3 is the processing node, k4 is the warehouse node, k5 is the logistics node, and k6 is the sales node) in the grain supply chain registers on the blockchain, declaring its data n k and identity (need to pledge tokens to prevent malicious behavior. The smart contract initializes the global model parameters and local aggregation rules.

[0063] Step 2: Local training and gradient calculation

[0064] Each node k based on local individual link private data independently trains the local model, while submitting the encrypted digest of the gradient hash and model parameters to the blockchain, triggering the smart contract to verify data integrity, optimize the local loss function F k (ω), and use the gradient descent method to iteratively update the local model parameters

[0065]

[0066] where η is the local learning rate, is the gradient based on the local data of node k.

[0067] Step 3: Decentralized local aggregation

[0068] The blockchain publicly records n k and aggregation weights to ensure fairness, while the aggregation result ​Write a new block and send it to the link aggregation node KNPB, each node can be verified. The smart contract submits n k and model parameters, and the link aggregation node performs weighted average according to the local data amount n k to generate local model parameters

[0069]

[0070] Where K is the total number of nodes participating in the grain supply chain, and n is the total amount of data samples of all nodes in the link

[0071] Step 4: Model distribution and consensus

[0072] The local model aggregated by the link aggregation node will be broadcast to all link nodes through the smart contract, and the nodes will synchronize the latest model after verifying the signature of the new block through the blockchain. If abnormalities (such as fake n k ) are found, a consensus challenge can be initiated, and the malicious node's staked tokens will be confiscated.

[0073] (2) Edge collaborative aggregation algorithm

[0074] Step 1: Initialization and registration

[0075] Each supply chain link node (k1, k2, … k6) registers its identity and data amount n k on the blockchain, and staked tokens are used as a good faith deposit. At the same time, the intelligent contract initializes the global model parameters θ 0 and hyperparameters λ, η, η g .

[0076] Step 2: Local training and model updating

[0077] Each grain supply chain link generates a local model ω k based on the local data set within the link. The objective function of the local node is:

[0078]

[0079] The grain supply chain node updates the local model parameters through gradient descent:

[0080]

[0081] Where f k (ω k ) is the local loss function of the kth node of the grain supply chain, λ is the regularization coefficient, which is used to balance the local loss and model synchronization, and θ is the global model parameter of the tth round of training.

[0082] Each food supply chain node will update the local model parameters Upload to the edge blockchain layer. In the blockchain, the node will submit the model parameters And the encryption hash of the difference Submit to the blockchain, splice model parameters and gradient updates to prevent nodes from submitting model parameters or mismatched gradients.

[0083] Step 3: Decentralized edge aggregation

[0084] The smart contract is based on the amount of data n k And the model parameters submitted by each node, the KNCB node of the edge blockchain layer performs weighted aggregation;

[0085]

[0086] Where η g is the global learning rate, n k is the data volume of the kth node, and n is the sum of the data volumes of all participating nodes.

[0087] Step 4: Edge synchronization and verification

[0088] The edge model θ t+1 is sent to the blockchain layer, and the smart contract broadcasts the updated global model θ t+1 To all edge servers and local link nodes. After verifying the signature of the new block, the node synchronizes the model, and if an anomaly (such as a fake ) is found, a PBFT consensus challenge can be initiated, and malicious nodes (such as submitting false gradients) will be penalized.

[0089] (3) Global collaborative aggregation algorithm

[0090] Step 1: Blockchain network initialization

[0091] In the smart contract deployment stage, the system designs three types of contracts: registration contract (used to manage the identity authentication of edge servers and nodes, based on PKI system to ensure the identity of each participant is real and credible.), aggregation contract (ensure that all nodes follow the same rules for model parameter aggregation, avoid cheating or data inconsistency) and reward and punishment contract (record model contribution evaluation through Commit-Reveal mechanism).

[0092] Step 2: The edge blockchain layer uploads the aggregated model To the global server layer, the local objective function and gradient calculation formula are as follows:

[0093]

[0094] Where f​k (ω k ) is the local loss function of the kth node in the food supply chain, μ is the regularization coefficient, which is used to impose constraints on the edge node model to prevent it from deviating from the global target, is the gradient of the local loss function, is the gradient of the regularization term.

[0095] Step 3: The global server updates the local model according to the gradient descent method:

[0096]

[0097] where η is the learning rate and l is the number of local iterations.

[0098] Step 4: The global server layer selects KNDB and performs model aggregation, KNDB performs weighted average on all edge models, and updates the global model parameters:

[0099]

[0100] where n k is the data volume of the kth node, and n is the total data volume of all participating nodes.

[0101] Step 5: The generated global model parameters θ t+1 are issued to each edge server to complete a global update.

[0102] Step 6: The edge server distributes the updated global model to each local node in the food supply chain, and starts a new round of training.

[0103] In addition to the technical features described in the specification, they are known to those skilled in the art. The present application omits the description of known components and known technologies to avoid redundancy and unnecessary limitation of the present application. The embodiments described in the above embodiments also do not represent all embodiments consistent with the present application. Various modifications or variations made by those skilled in the art on the basis of the technical solutions of the present application without creative labor are still within the protection scope of the present application.

Claims

1. A grain supply chain privacy data sharing method based on distributed federated learning, characterized in that, It includes the following steps: Step 1: Analyze the structure of the grain supply chain and the actual production and living needs, taking into account different types of privacy data and different needs for interaction between nodes, and build a privacy data trust sharing model for the grain supply chain based on distributed federated learning. In this model, data collection devices and nodes at each link can collect privacy data to implement the federated learning process. Blockchain is used to record the learning process and results to encourage nodes to actively participate in the knowledge sharing process, improve the quality and accuracy of their contribution models, and enhance the security of privacy data interaction in the federated learning process. The distributed ledger technology records the privacy data of the grain supply chain and implements the distributed knowledge sharing process. Step 2: According to the sensitivity of local privacy data in the six links of the grain supply chain, classify the privacy data into five levels, and configure appropriate encryption measures for different levels of data. For data and models involving privacy and sensitive content, adopt a hierarchical encryption strategy and implement fine-grained management and access control based on permission levels to effectively protect data security and compliance. Step 3: In the distributed federated learning privacy data sharing model of the grain supply chain, the model is divided into three levels: local, edge, and global. The local layer independently trains and uploads model parameters based on privacy data; the edge layer aggregates local parameters to generate an edge model; and the global layer integrates edge models to build a global model and records the update process. Step 4: According to the multi-level structure characteristics of the grain supply chain, data heterogeneity, and privacy protection requirements, design three distributed federated learning model aggregation schemes: local aggregation optimization, edge collaborative aggregation, and global collaborative aggregation. Step 5: According to the model aggregation scheme, design distributed federated learning aggregation algorithms: local aggregation optimization algorithm, edge collaborative aggregation algorithm, and global collaborative aggregation algorithm.

2. The food supply chain private data sharing model of distributed federated learning constructed according to the method of claim 1, characterized in that It is a distributed federated learning framework with three layers from bottom to top: local, edge, and global. The system uses a local-edge-global three-layer architecture: the local layer independently trains based on private data and uploads parameters to the edge layer; the edge layer aggregates multiple local nodes to generate an edge model and uploads it to the global layer; the global layer integrates each edge model to generate a global model and records the update process, while protecting data privacy and achieving efficient collaborative training and system security optimization. Local layer: The six links of the grain supply chain: production, storage, processing, transportation, warehousing, and sales, correspond to six different link chain layers and a number of different testing equipment TE. TE is responsible for collecting privacy data in different links and acting as a distributed training party in the federated learning process to update the local model. Edge layer: By connecting multiple local data nodes, it collects their model parameter updates, completes the aggregation of the edge model, and uploads the edge model to the global layer to realize model sharing and continuous training. Global layer: Collects aggregated model parameters uploaded by each edge layer, executes aggregation algorithms to generate a global model, and records global model updates and model parameters of each edge node.

3. The method of claim 1, wherein, In step four, the application proposes a federated learning framework based on feature distillation, which effectively solves the problem of privacy data heterogeneity in the grain supply chain through an intelligent feature screening mechanism. The framework innovatively divides data features into sensitive features and stable features, where sensitive features carry key model information, and stable features retain secondary redundant information. In terms of technical implementation, the system first performs server-side feature analysis and distillation processing, then selectively shares sensitive features using homomorphic encryption technology, each client combines local data and received encrypted features for hybrid training, and finally completes global model aggregation and update through the FedAvg algorithm.

4. The method according to claim 1 or 3, characterized in that, In step four, the hierarchical federated learning architecture proposed by the application uses the VRF (verifiable random function) mechanism to realize the secure election of key nodes at each level. In the local private blockchain, VRF generates an encrypted hash value for each candidate node through its "randomness verifiable" feature, and only nodes that meet the preset threshold can be elected as KNPB nodes, preventing malicious nodes from predicting election results and ensuring that all participating nodes can verify the legitimacy of the elected nodes. In the alliance blockchain of the edge layer, VRF elects KNCB nodes in the same mechanism, responsible for the aggregation and verification of edge models, realizing cross-link intermediate layer collaboration. In the public blockchain of the global layer, the KNDB nodes produced by VRF election assume the responsibility of global model aggregation, ensuring the fusion of the final model across regions and subjects. This mechanism significantly reduces the communication overhead of traditional consensus algorithms, while effectively suppressing Sybil attacks, providing a reliable multi-level secure election solution for the grain supply chain federated learning.

5. The method according to claim 1 or 4, characterized in that, The application proposes a distributed federated learning aggregation algorithm, which realizes efficient and secure modeling of the grain supply chain through local aggregation optimization, edge collaborative aggregation, and global collaborative aggregation algorithms. In the local layer, each link node (production, storage, processing, etc.) uses the FedAvg algorithm for local training, and the KNPB nodes selected by VRF complete weighted aggregation after verification by the smart contract; the edge layer uses the pFedMe algorithm to process data heterogeneity, and the KNCB nodes aggregate the link models and use the PBFT consensus verification; the global layer realizes cross-link model fusion through the KNDB nodes based on the FedProx algorithm, and uses three types of smart contracts (registration, aggregation, and reward and punishment) to ensure the credibility of the whole process.

Citation Information

Cited By

  • Brain MRI hippocampus three-dimensional segmentation method based on deep learning

    CN121033081A