Blockchain-based collaborative learning and privacy-efficiency optimization method
Patent Information
- Application Number
- CN202310891717.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-07-20
AI Technical Summary
许多相关工作已经被开展来改善基于区块链的协作学习中的隐私保护和培训效率,但是这些先前的工作将隐私和效率问题视为独立的,没有将两者联合起来考虑,后续在区块链的协作学习时学习准确率低,使得物联网边缘终端客户难以维护隐私保护和数据共享效率低
[0012]上述基于区块链的协作学习及隐私-效率优化方法,本申请通过利用个性化隐私保护策略对本地模型进行更新,避免了通过模型参数推断出的任何隐私泄露,更小隐私预算的差分隐私保护机制提高了模型的准确率,同时在协作学习过程中利用边缘客户端作为聚合服务器进行聚合,并且通过设置的验证条件确定获胜者候选人,将所有获胜者候选人中具有最小时间戳的边缘客户端作为本轮进行全局模型更新的领导者,减少了资源浪费,提高了数据共享效率。
Smart Images

Figure CN117272364B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a blockchain-based collaborative learning and privacy-efficiency optimization method. Background Technology
[0002] In recent years, the rapid development of communication and edge computing technologies has further propelled the Internet of Things (IoT) wave, giving rise to a thriving era of edge intelligence and edge services. Specifically, with the widespread use of IoT edge applications, a large amount of user operation data is generated at the network edge. Driven by artificial intelligence models, the potential value of this data can be fully realized, enabling large-scale monitoring, surveillance, and analysis activities to be performed at the edge, such as health monitoring, public disease prediction, and traffic congestion warnings. Undoubtedly, IoT edge terminals are revolutionizing fields such as smart healthcare, smart cities, and intelligent transportation by providing ubiquitous monitoring and collection of user data. However, the current cloud-centric architecture dominates data collection and analysis methods, leading to many isolated systems and data monopolies. This situation can result in problems such as a high incidence of single-point-of-failure attacks, high application latency, and low security protection for customers regarding data ownership and profit acquisition.
[0003] Therefore, emerging collaborative learning combining blockchain and federated learning (FL) can compensate for the shortcomings of IoT edge terminals in data sharing and has attracted widespread attention. Specifically, blockchain plays the role of a public ledger recording learning and sharing behaviors. With the help of smart contracts and consensus mechanisms from the blockchain, the original FL workflow can be driven by transparent transactions, enabling decentralized and trustworthy collaborative learning without relying on centralized servers. In turn, the FL mechanism transforms the IoT edge terminal data sharing task into a collaborative model training problem and shares knowledge updates, mitigating the impact of blockchain storage limitations while improving the synergy between AI models in edge intelligence. Although using collaborative learning in edge data sharing networks provides a promising solution for connecting fragmented IoT edge terminal data, blockchain-based collaborative learning faces privacy-efficiency cross threats. On the one hand, data collected from users contains a large amount of sensitive personal information. Although FL can mitigate privacy leaks to some extent, it may still disclose private information through inference attacks, making it difficult for IoT edge terminal customers to maintain privacy protection. On the other hand, in collaborative learning that combines federated learning and blockchain technology, the data sharing process is jointly driven by learning operations and verification consensus operations. It is worth noting that these two types of operations are not always performed synchronously and can consume resources, limiting the valuable resources of downstream devices through meaningless repetition. The overlapping vulnerabilities between these inefficiencies and the leakage of personal information inevitably compromise the security and sustainability of data sharing at IoT edge terminals. While much work has been undertaken to improve privacy and training efficiency in blockchain-based collaborative learning, these previous efforts treated privacy and efficiency issues as separate matters, failing to consider them together. This resulted in low learning accuracy during subsequent blockchain-based collaborative learning, making it difficult for IoT edge terminal customers to maintain privacy and ensure efficient data sharing. Summary of the Invention
[0004] Therefore, it is necessary to provide a blockchain-based collaborative learning and privacy-efficiency optimization method that can improve the privacy protection and data sharing efficiency of IoT edge terminal customers, addressing the aforementioned technical issues.
[0005] A blockchain-based collaborative learning and privacy-efficiency optimization method is applied to an edge data sharing network including a blockchain, data requesters joining the blockchain, and multiple edge clients. The method includes: The data requester pre-builds and trains an initial global model, and then sends the trained initial global model to a qualified edge client. The edge client trains the pre-trained initial global model according to a predefined loss function to obtain a local model; it updates the local model according to a personalized privacy protection strategy to obtain the model gradient of the updated local model and uploads the model gradient to the blockchain network; it searches the blockchain network for local model gradients that can be received in this round, aggregates them, and obtains the aggregated result. The aggregation results in the edge clients are verified to obtain the verification results. Based on the verification results, the winning candidates that meet the pre-set verification conditions are determined from multiple edge clients. The edge client with the smallest timestamp among all winning candidates is the winner of this round. The initial global model is trained based on the aggregation results corresponding to the winner, and the final global model is obtained. New blocks are constructed using the final global model, and the blockchain is updated based on the new blocks.
[0006] In one embodiment, the predefined loss function is: ; in, Indicates training rounds, k Indicates the sequence number of the edge client. This indicates the total number of local training samples in a batch. This represents the differentiation of the loss function. Indicates client k exist t Local model parameters for each round, Indicates the local training first j The next batch of samples. j Indicates the local training round.
[0007] In one embodiment, the local model is updated according to a personalized privacy protection strategy to obtain the model gradient of the updated local model, including: The local model is updated according to the personalized privacy protection strategy, and the gradient of the updated local model is obtained as follows: ; in, Represents edge client In the The local model gradient that gets its turn. It is the Laplace noise generation function. Represents edge client Any adjacent datasets and The training gradient is in the first... Sensitivity during rotation, Represents edge client In the Privacy budget for the wheel Represents edge client In the Personalized privacy protection strategies are adopted during each round.
[0008] In one embodiment, the local model gradients that can be received in the current round are searched from the blockchain network and aggregated to obtain the aggregation result, including: The local model gradients that can be received in this round are searched and aggregated from the blockchain network to obtain the aggregated result. ; in, Represents edge client The number of local model gradients received. Represents edge client In the The local model gradient that is in turn.
[0009] In one embodiment, the aggregation result in the edge client is verified to obtain the verification result, including: The aggregation results in the edge client were verified, and the verification results were as follows: ; in, Represents edge client In the The aggregation result obtained in the round, Represents edge client In the The aggregation result obtained in the round, Represents edge client The threshold for discrepancies in aggregation results received in the blockchain network. N This indicates the total number of edge clients.
[0010] In one embodiment, determining winner candidates who meet pre-set verification criteria from multiple edge clients based on verification results includes: In a blockchain network, edge clients Received broadcast Then, first of all Aggregation results with local Compare the differences; if the difference is less than a threshold... ,but It will be considered valid and marked as 1, while if the edge client Verification results Then edge client Become a candidate for the winner.
[0011] In one embodiment, the pre-trained initial global model is trained based on the aggregation result corresponding to the winner to obtain the final global model, including: The initial global model is trained based on the aggregation results corresponding to the winner, resulting in the final global model. ; in, Indicates the learning rate. Represents edge client In the The initial global model trained in rounds In one embodiment, constructing a new block using the final global model includes: Constructing a new block using the final global model ; in, Represents the final global model. Represents a timestamp. This represents the hash value of the previous block. This represents all transactions generated in this round. Indicates the current block. Indicates client k The signature operation.
[0012] The aforementioned blockchain-based collaborative learning and privacy-efficiency optimization method avoids any privacy leaks inferred from model parameters by using personalized privacy protection strategies to update the local model. The differential privacy protection mechanism with a smaller privacy budget improves the model's accuracy. Meanwhile, during the collaborative learning process, edge clients are used as aggregation servers for aggregation, and winning candidates are determined through set verification conditions. The edge client with the smallest timestamp among all winning candidates is selected as the leader for global model updates in this round, reducing resource waste and improving data sharing efficiency. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a blockchain-based collaborative learning and privacy-efficiency optimization method in one embodiment. Figure 2 This is a schematic diagram of a blockchain-based decentralized collaborative learning architecture in one embodiment; Figure 3 This is a schematic diagram of a privacy-efficiency joint optimization process design for one embodiment. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0015] In one embodiment, such as Figure 1 As shown, a blockchain-based collaborative learning and privacy-efficiency optimization method is provided. This method is applied to an edge data sharing network that includes a blockchain, data requesters joining the blockchain, and multiple edge clients. The method includes the following steps: Step 102: The data requester pre-builds an initial global model and trains it, then sends the trained initial global model to a qualified edge client.
[0016] This application designs a blockchain-based decentralized collaborative learning architecture with a tightly coupled design, such as... Figure 2 As shown, the data requester First, construct an initial global model. And set some training requirements. For example, data types Training optimizer Learning rate Global aggregation count Meanwhile, the number of trainees is defined. and reward rules They are formatted as an on-chain transaction. : ; Data requester After attaching a digital signature, the transaction... This information will be sent to the blockchain network. After observing the published training tasks, qualified edge clients will submit their information, and data requesters will ultimately be selected. Select qualified candidates to form a collaborative learning group.
[0017] Step 104: The edge client trains the pre-trained initial global model according to the predefined loss function to obtain the local model; updates the local model according to the personalized privacy protection strategy to obtain the model gradient of the updated local model and uploads the model gradient to the blockchain network; searches the blockchain network for local model gradients that can be received in this round and aggregates them to obtain the aggregation result.
[0018] In the In each training round, each selected client Obtain the latest global model Then, local model training is performed independently to obtain local updates, with the goal of minimizing the predefined loss function shown below.
[0019] To prevent any privacy leaks inferred from model parameters, the client... Adopting personal privacy enhancement strategies The process is as follows: First, differential privacy (DP) is defined as follows: For any client and its place Privacy budget of the wheel If a privacy mechanism satisfy - Differential privacy, on the other hand, allows for privacy between adjacent training datasets that differ only on one record. and and any output set Both satisfy the following constraints: ;
[0020] Differential privacy mechanisms, typically with smaller privacy budgets, introduce more noise and provide stronger protection, but at the cost of reduced model accuracy. Given that the learning preferences and privacy sensitivities of IoT end devices vary due to their dynamic nature and limited resources, in... Figure 3 Procedure 2 in the paper proposes a personalized DP privacy protection mechanism. In this mechanism, Laplacian noise can be determined by the client based on its own conditions and added to the local model gradient for processing before aggregation. This process can be further designed into the following two parts.
[0021] (1) Privacy parameter settings: Considering that the local gradient of the trained model is numerical data, any client In the From the wheel Generated Laplace noise The definition is as follows: ;
[0022] in, It is the Laplace noise generation function, which is actually derived from a noise generator with zero mean and a scale of 1. Laplace distribution Extracted from [the source]. For the client. Any adjacent datasets and The training gradient is in the first... Sensitivity during rotation The following conditions must be met: ; in, Represents the training loss function. It is used for restriction The cutoff threshold, i.e. According to the above formula, the noise value and the training dataset... , cutoff threshold and personal privacy budget The relevant information can be determined by the customer in different situations.
[0023] (2) Add personalized noise: After setting privacy parameters, perform personalized differential privacy protection on the model gradient. It can be represented as follows: ; After adding personalized DP noise, the client Use their signatures to determine the perturbed gradient. Uploaded to the blockchain network.
[0024] Adding personalized differential privacy noise inevitably reduces model performance (such as accuracy). Therefore, a theoretical upper limit for model convergence after adding personalized differential privacy noise is set. As shown below.
[0025] ; in, , Represents the learning parameters, , Differential privacy noise is represented by the formula Laplace noise. Calculations show that Indicates the degree of data heterogeneity. This represents noise parameters.
[0026] By using personalized privacy protection strategies to update the local model, any privacy leaks inferred from the model parameters are avoided, and the differential privacy protection mechanism with a smaller privacy budget improves the accuracy of the model.
[0027] Step 106: Verify the aggregation results in the edge clients to obtain the verification results; based on the verification results, determine the winning candidates that meet the pre-set verification conditions from multiple edge clients, and select the edge client with the smallest timestamp among all winning candidates as the winner of this round.
[0028] In collaborative learning, since there is no centralized aggregation server, the aggregation process is performed by the trainer. To maintain higher learning efficiency in IoT edge environments, Figure 3Procedure 4 in the paper proposes a flexible "aggregate proof" to replace consensus mechanisms that are energy-intensive and time-consuming, such as proof-of-work. The main process is as follows: (1) Calculate global update: Once the client Once it decides to participate in the consensus competition, it will immediately attempt to search the blockchain for all transaction information related to local gradients in this round and continuously execute the aggregation process to calculate the obtained... As shown in the following equation. Therefore, in this case, the client also acts as an aggregator, thereby reducing resource waste (such as asynchronous wait time or invalid empty block generation). ;
[0029] in, It is the client (it can also be called the client at this stage). The number of gradients received from the local model. If the client... The calculation results were obtained Then they will pack this immediately. individual transactions and The information is added to a new block, along with a timestamp. And broadcast this new block across the entire network.
[0030] (2) Share the calculation results and select the winner: Client The probability of obtaining the right to generate a new block and update the new global model depends not only on the computational acquisition. The speed also depends on The accuracy. We will [the client]. The model for waiting for verification results after broadcasting the new block is as follows: ; In a blockchain network, a certain client Received broadcast Then, it will first Comparison with local calculation results Compare the results. If the difference is less than the threshold... Then the result It will be considered valid and marked as 1. If the client Obtained The result will then become a candidate for winner. Finally, the candidate with the smallest timestamp among all candidates will be selected. The client that ultimately won the round was considered the winner.
[0031] Client A signed transaction will be transmitted to compete for the right to generate a block, including... Time spent and timestamp This provides greater robustness than traditional frameworks based on centralized parameter servers because all nodes can perform the merging role.
[0032] Step 108: Train the initial global model based on the aggregation result corresponding to the winner to obtain the final global model; construct a new block using the final global model, and update the blockchain based on the new block.
[0033] The participant who obtains a valid aggregation result in the shortest amount of time will become the interim leader for computing the next round of updates to the global model. The model formula is: ; At the same time, the interim leader announces a new block that defines the latest state of the network, including the hashes of previous blocks. round A block is accepted by other participants only if it is deemed valid. Then, a new round of training begins. The transactions that produce a new block are shown below: ; Once a new block is confirmed and attached to the blockchain, the winner is responsible for publishing the updated global model, and then collaborative learning begins a new round.
[0034] In the aforementioned blockchain-based collaborative learning and privacy-efficiency optimization method, this application avoids any privacy leakage inferred from model parameters by using personalized privacy protection strategies to update the local model. The differential privacy protection mechanism with a smaller privacy budget improves the accuracy of the model. At the same time, during the collaborative learning process, edge clients are used as aggregation servers for aggregation, and winning candidates are determined by setting verification conditions. The edge client with the smallest timestamp among all winning candidates is selected as the leader for global model updates in this round, reducing resource waste and improving data sharing efficiency.
[0035] In one embodiment, the predefined loss function is: ; in, Indicates training rounds, k Indicates the sequence number of the edge client. This indicates the total number of local training samples in a batch. This represents the differentiation of the loss function. Indicates client k exist t Local model parameters for each round, Indicates the local training first j The next batch of samples. j Indicates the local training round.
[0036] In one embodiment, the local model is updated according to a personalized privacy protection strategy to obtain the model gradient of the updated local model, including: The local model is updated according to the personalized privacy protection strategy, and the gradient of the updated local model is obtained as follows: ; in, Represents edge client In the The local model gradient that gets its turn. It is the Laplace noise generation function. Represents edge client Any adjacent datasets and The training gradient is in the first... Sensitivity during rotation, Represents edge client In the Privacy budget for the wheel Represents edge client In the Personalized privacy protection strategies are adopted during each round.
[0037] In one embodiment, the local model gradients that can be received in the current round are searched from the blockchain network and aggregated to obtain the aggregation result, including: The local model gradients that can be received in this round are searched and aggregated from the blockchain network to obtain the aggregated result. ; in, Represents edge client The number of local model gradients received. Represents edge client In the The local model gradient that is in turn.
[0038] In one embodiment, the aggregation result in the edge client is verified to obtain the verification result, including: The aggregation results in the edge client were verified, and the verification results were as follows: ; in, Represents edge client In the The aggregation result obtained in the round, Represents edge client In the The aggregation result obtained in the round, Represents edge client The threshold for discrepancies in aggregation results received in the blockchain network. N This indicates the total number of edge clients.
[0039] In one embodiment, determining winner candidates who meet pre-set verification criteria from multiple edge clients based on verification results includes: In a blockchain network, edge clients Received broadcast Then, first of all Aggregation results with local Compare the differences; if the difference is less than a threshold... ,but It will be considered valid and marked as 1, while if the edge client Verification results Then edge client Become a candidate for the winner.
[0040] In one embodiment, the pre-trained initial global model is trained based on the aggregation result corresponding to the winner to obtain the final global model, including: The initial global model is trained based on the aggregation results corresponding to the winner, resulting in the final global model. ; in, Indicates the learning rate. Represents edge client In the The initial global model trained in rounds In one embodiment, constructing a new block using the final global model includes: Constructing a new block using the final global model ; in, Represents the final global model. Represents a timestamp. This represents the hash value of the previous block. This represents all transactions generated in this round. Indicates the current block. Indicates client k The signature operation.
[0041] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0042] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0043] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0044] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A blockchain-based collaborative learning and privacy-efficiency optimization method, characterized in that, The method is applied to an edge data sharing network that includes a blockchain, data requesters joining the blockchain, and multiple edge clients. The method includes: The data requester pre-builds an initial global model and trains the initial global model, then sends the trained initial global model to a qualified edge client; The edge client trains the pre-trained initial global model according to a predefined loss function to obtain a local model; updates the local model according to a personalized privacy protection strategy to obtain the model gradient of the updated local model and uploads the model gradient to the blockchain network; searches the blockchain network for local model gradients that can be received in this round and aggregates them to obtain an aggregation result. The aggregation results in the edge clients are verified to obtain the verification results; based on the verification results, the winning candidates that meet the pre-set verification conditions are determined from multiple edge clients, and the edge client with the smallest timestamp among all winning candidates is the winner of this round; The initial global model is trained based on the aggregation result corresponding to the winner to obtain the final global model; A new block is constructed using the final global model, and the blockchain is updated based on the new block; The aggregation results in the edge client are validated to obtain the validation results, including: The aggregation results in the edge client were verified, and the verification results were as follows: in, Represents edge client In the The aggregation result obtained in the round, Represents edge client In the The aggregation result obtained in the round, Represents edge client The threshold for discrepancies in aggregation results received in the blockchain network. N This represents the total number of edge clients; Based on the verification results, winner candidates who meet the pre-set verification criteria are determined from multiple edge clients, including: In a blockchain network, edge clients Received broadcast Then, first of all Aggregation results with local Compare the differences; if the difference is less than a threshold... ,but It will be considered valid and marked as 1, while if the edge client Verification results Then edge client Become a candidate for the winner.
2. The method according to claim 1, characterized in that, The predefined loss function is: in, Indicates training rounds, k Indicates the sequence number of the edge client. This indicates the total number of local training samples in a batch. This represents the differentiation of the loss function. Indicates client k exist t Local model parameters for each round, Indicates the local training first j The next batch of samples. j Indicates the local training round.
3. The method according to claim 2, characterized in that, The local model is updated according to a personalized privacy protection strategy to obtain the model gradient of the updated local model, including: The local model is updated according to the personalized privacy protection strategy, and the model gradient of the updated local model is obtained as follows: in, Represents edge client In the The local model gradient that gets its turn. It is the Laplace noise generation function. Represents edge client Any adjacent datasets and The training gradient is in the first... Sensitivity during rotation, Represents edge client In the Privacy budget for the wheel Represents edge client In the Personalized privacy protection strategies are adopted during each round.
4. The method according to claim 3, characterized in that, The local model gradients that can be received in this round are searched and aggregated from the blockchain network to obtain the aggregation result, including: The local model gradients that can be received in this round are searched and aggregated from the blockchain network to obtain the aggregation result. in, Represents edge client The number of local model gradients received. Represents edge client In the The local model gradient that is in turn.
5. The method according to claim 4, characterized in that, The pre-trained initial global model is trained based on the aggregation result corresponding to the winner to obtain the final global model, including: The pre-trained initial global model is trained based on the aggregation result corresponding to the winner, resulting in the final global model. in, Indicates the learning rate. Represents edge client In the The initial global model that has been trained in the round.
6. The method according to claim 5, characterized in that, Constructing a new block using the final global model includes: Construct a new block using the final global model. in, Represents the final global model. Represents a timestamp. This represents the hash value of the previous block. This represents all transactions generated in this round. Indicates the current block. Indicates client k The signature operation.
Citation Information
Patent Citations
Four-network integration data sharing method based on block chain and federated learning
CN116389478A
Decentralized voting using quantum intelligence
US20230065435A1