技术领域Technical field
本发明涉及区块链技术领域,更具体的说是涉及一种面向群智服务的区块链节点贡献度证明共识方法。The present invention relates to the field of blockchain technology, and more specifically to a blockchain node contribution proof consensus method for crowd intelligence services.
背景技术Background technique
群智服务是由群体性的智能边缘节点协作提供服务,联邦学习是典型的应用框架之一。联邦学习是一种协作式的机器学习框架,参与协作的节点利用本地数据训练本地模型,通过参数服务器进行模型聚合,实现多来源数据的预测效果。在联邦学习模型聚合过程中需要区块链节点的多方共识验证,然而现有的共识算法并不完全适用于此场景。工作量证明(Proof of Work,PoW)不仅会消耗大量节点算力,也不利于轻量级边缘节点的参与。用户权益证明(Proof of Stake,PoS)中不在线节点也可以积累币龄,可能导致参与节点搭便车的行为。Crowd intelligence services are provided by the collaboration of group intelligent edge nodes, and federated learning is one of the typical application frameworks. Federated learning is a collaborative machine learning framework. The nodes participating in the collaboration use local data to train local models, and perform model aggregation through the parameter server to achieve prediction results from multiple sources of data. During the aggregation process of the federated learning model, multi-party consensus verification of blockchain nodes is required. However, the existing consensus algorithms are not fully suitable for this scenario. Proof of Work (PoW) not only consumes a large amount of node computing power, but is also not conducive to the participation of lightweight edge nodes. In Proof of Stake (PoS), nodes that are not online can also accumulate currency age, which may lead to free-riding behavior by participating nodes.
因此,如何提供一种能够有效节省计算开销并提高公平性的面向群智服务的区块链节点贡献度证明共识方法是本领域技术人员亟需解决的问题。Therefore, how to provide a blockchain node contribution proof consensus method for crowd intelligence services that can effectively save computing overhead and improve fairness is an urgent problem that needs to be solved by those skilled in the art.
发明内容Contents of the invention
有鉴于此,本发明提供了一种面向群智服务的区块链节点贡献度证明共识方法,解决了现有技术在群智服务模型共识验证过程中造成的资源开销与不公平问题。In view of this, the present invention provides a blockchain node contribution proof consensus method for crowd intelligence services, which solves the resource overhead and unfairness problems caused by the existing technology in the crowd intelligence service model consensus verification process.
为了实现上述目的,本发明采用如下技术方案:In order to achieve the above objects, the present invention adopts the following technical solutions:
一种面向群智服务的区块链节点贡献度证明共识方法,包括以下步骤:A blockchain node contribution proof consensus method for crowd intelligence services, including the following steps:
S1.获取现有区块链的最后一个区块的时间戳、节点第一次加入区块链的网络时间戳与下线时间戳,计算节点在线贡献度;S1. Obtain the timestamp of the last block of the existing blockchain, the network timestamp when the node first joined the blockchain, and the offline timestamp, and calculate the node's online contribution;
S2.本地模型进行训练,计算本地模型质量评估结果交叉熵,确定本地模型贡献度,广播梯度数据进行共享;S2. Train the local model, calculate the cross entropy of the local model quality assessment results, determine the local model contribution, and broadcast gradient data for sharing;
S3.计算数据信息熵,统计样本数据量,通过数据信息熵和数据量确定数据贡献度;S3. Calculate data information entropy, count sample data volume, and determine data contribution through data information entropy and data volume;
S4.通过差分隐私生成对抗网络DPGAN为群智服务参数验证节点提供用于验证模型质量的对抗样本数据集,触发模型参数质量验证智能合约,通过对抗样本数据集对共享得到的梯度数据和本地模型质量评估结果进行验证,若满足验证条件,则执行步骤S5,否则舍弃当前的梯度数据;S4. Use the differential privacy generated adversarial network DPGAN to provide the crowd intelligence service parameter verification node with an adversarial sample data set for verifying model quality, trigger the model parameter quality verification smart contract, and share the obtained gradient data and local model through the adversarial sample data set. The quality assessment results are verified. If the verification conditions are met, step S5 is executed, otherwise the current gradient data is discarded;
S5.参与节点利用本地数据训练,并结合共享得到的梯度数据,聚合得到联合训练模型,完成群智服务协作过程;将节点在线贡献度、本地模型贡献度和数据贡献度相加获取评估节点贡献度,其中节点贡献度评估参与节点对联合训练模型的贡献度,并为参与节点分配与节点贡献度成反比例的工作量证明难度系数,动态调整工作量证明难度,并通过工作量证明达成账本共识。S5. Participating nodes use local data for training, combine with shared gradient data, and aggregate to obtain a joint training model to complete the group intelligence service collaboration process; add the node online contribution, local model contribution, and data contribution to obtain the evaluation node contribution. Degree, in which the node contribution degree evaluates the contribution of participating nodes to the joint training model, and assigns participating nodes a proof-of-work difficulty coefficient that is inversely proportional to the node contribution, dynamically adjusts the difficulty of proof-of-work, and reaches ledger consensus through proof-of-work .
需要说明的是:It should be noted:
节点下线时间戳指的是区块链网络中的节点退出网络的时间戳。The node offline timestamp refers to the timestamp when the node in the blockchain network exits the network.
本发明通过节点在线时间判断节点在线资源开销贡献度;通过模型质量评估结果的交叉熵数据判断节点本地模型质量贡献度;最后计算节点本地数据信息熵与数据量占比判断节点数据贡献度;基于上述三个维度判断群智服务参与节点对整个协作式群智服务模型的贡献度;另一方面,本地模型与模型质量验证结果需要经过共识机制验证后记录在区块链上以便数据共享。首先将本地模型参数与模型质量验证结果以交易形式打包上链,基于节点贡献度动态调整工作量证明难度系数,避免过度的计算开销,保证共识过程的公平性。此外,当接收到区块链记账请求Req时,根据区块链网络中节点的贡献值从交易区块链中选择一个主节点负责接收交易请求。在一段时间内,选择贡献度最大的节点作为主节点,负责响应请求并推动整体的共识流程。This invention determines the node's online resource overhead contribution through the node's online time; determines the node's local model quality contribution through the cross-entropy data of the model quality assessment results; finally calculates the node's local data information entropy and data volume ratio to determine the node data contribution; based on The above three dimensions determine the contribution of crowd intelligence service participating nodes to the entire collaborative crowd intelligence service model; on the other hand, local models and model quality verification results need to be verified by the consensus mechanism and then recorded on the blockchain for data sharing. First, the local model parameters and model quality verification results are packaged and uploaded to the chain in the form of transactions, and the workload proof difficulty coefficient is dynamically adjusted based on the node contribution to avoid excessive computing overhead and ensure the fairness of the consensus process. In addition, when the blockchain accounting request Req is received, a master node is selected from the transaction blockchain based on the contribution value of the nodes in the blockchain network to be responsible for receiving the transaction request. Within a period of time, the node with the greatest contribution is selected as the master node, responsible for responding to requests and promoting the overall consensus process.
上述基于群智服务参与者包括:群智服务任务发布者和执行本地随机梯度下降算法的智能边缘设备。其中任务发布者提出模型训练需求,负责将可进行联合训练的参与节点构建联合训练组,并可对参与节点进行信誉评估,以避免参与节点作恶与搭便车行为。本地随机梯度下降算法需要接收到初始训练模型之后,利用本地数据不断优化迭代此模型,并将训练的中间梯度参数广播后与区块链上共享的本地模型参数进行聚合,各节点不断优化聚合模型以达到模型收敛条件。The above-mentioned group intelligence-based service participants include: group intelligence service task publishers and intelligent edge devices that execute local stochastic gradient descent algorithms. Among them, the task publisher proposes model training requirements and is responsible for constructing a joint training group of participating nodes that can conduct joint training, and can evaluate the reputation of participating nodes to avoid participating nodes from committing evil and free-riding behavior. The local stochastic gradient descent algorithm needs to receive the initial training model, use local data to continuously optimize and iterate the model, and broadcast the trained intermediate gradient parameters to aggregate them with the local model parameters shared on the blockchain. Each node continuously optimizes the aggregation model. to achieve model convergence conditions.
优选的,S1的具体内容包括:Preferably, the specific contents of S1 include:
通过下线时间戳减去节点第一次加入区块链的网络时间戳获取节点的下线时间间隔,通过最后一个区块的时间戳减去节点第一次加入区块链的网络时间戳获取节点在线时间段,将节点在线时间段与下线时间间隔相减获取在线时间贡献度;Obtain the node's offline time interval by subtracting the network timestamp when the node first joins the blockchain from the offline timestamp. Obtain the node's offline time interval by subtracting the network timestamp when the node first joins the blockchain from the timestamp of the last block. Node online time period, subtract the node online time period and the offline time interval to obtain the online time contribution;
通过提前预设的在线时间贡献度调节系数控制在线时间贡献度的比例。The proportion of online time contribution is controlled through the online time contribution adjustment coefficient preset in advance.
需要说明的是:It should be noted:
通过由用户提前预设的在线时间贡献度调节系数(大于0小于1)控制,用该调节系数乘以在线时间贡献度得出节点在线贡献度数值。It is controlled by the online time contribution adjustment coefficient (greater than 0 and less than 1) preset by the user, and the node online contribution value is obtained by multiplying the online time contribution by the adjustment coefficient.
优选的,S2中的内容具体包括:Preferably, the content in S2 specifically includes:
本地模型进行训练的过程为:群智服务任务发布者向各参与节点分发初始模型;The process of local model training is as follows: the crowd intelligence service task publisher distributes the initial model to each participating node;
各参与节点基于初始模型,利用本地数据执行多轮随机梯度下降算法,优化本地模型,迭代固定轮数之后将训练梯度与训练损失进行广播上链;Based on the initial model, each participating node uses local data to execute multiple rounds of stochastic gradient descent algorithms, optimizes the local model, and broadcasts the training gradient and training loss to the chain after iterating for a fixed number of rounds;
通过标签数据测试本地模型训练效果,交叉熵是衡量模型质量的损失函数值,通过计算标签数据期望输出与预测结果间的偏差表征模型预测结果与真实结果的逼近程度;Test the local model training effect through labeled data. Cross entropy is the loss function value that measures the quality of the model. By calculating the deviation between the expected output and the predicted result of the labeled data, it represents the degree of approximation between the model prediction result and the real result;
交叉熵越小,则代表模型预测的概率分布越接近真实结果,即模型质量越高。The smaller the cross entropy, the closer the probability distribution predicted by the model is to the true result, that is, the higher the quality of the model.
需要说明的是:It should be noted:
交叉熵是衡量训练后的本地模型在标签数据集进行测试后的损失值,用于衡量模型训练的质量。Cross-entropy is a measure of the loss value of a trained local model after testing on a labeled data set, and is used to measure the quality of model training.
标签数据是用于测试模型训练效果的数据集,由测试集和验证集组成,测试集用于模型训练,验证集提前打好标签用于测试模型训练的准确率。Labeled data is a data set used to test the training effect of the model. It consists of a test set and a verification set. The test set is used for model training, and the verification set is labeled in advance to test the accuracy of model training.
优选的,S3中的数据信息熵表征数据价值,数据量为节点本地训练样本数据量在整体数据样本中的占比。Preferably, the data information entropy in S3 represents the value of the data, and the data volume is the proportion of the local training sample data volume of the node in the overall data sample.
优选的,S4中模型参数质量验证智能合约验证的具体内容包括:Preferably, the specific contents of smart contract verification for model parameter quality verification in S4 include:
参与节点基于本地训练样本进行差分隐私后采用DPGAN产生对抗样本数据集并进行广播;Participating nodes perform differential privacy based on local training samples and then use DPGAN to generate an adversarial sample data set and broadcast it;
其他节点收到广播的梯度数据与训练损失,训练损失为本地模型质量评估结果即交叉熵,自动触发模型参数质量验证智能合约,通过对抗样本数据集对共享得到的梯度数据和本地模型质量评估结果进行验证;Other nodes receive the broadcast gradient data and training loss. The training loss is the local model quality assessment result, that is, cross entropy. It automatically triggers the model parameter quality verification smart contract and shares the obtained gradient data and local model quality assessment results through the adversarial sample data set. authenticating;
如果差值小于预设范围则验证通过,否则验证失败,验证失败后则将所接收到的梯度数据舍弃,以免影响聚合模型准确性。If the difference is less than the preset range, the verification passes, otherwise the verification fails. After the verification fails, the received gradient data is discarded to avoid affecting the accuracy of the aggregation model.
需要说明的是:It should be noted:
验证节点训练损失与被验证节点训练损失之差,用于评估被验证节点提交参数的准确性,从而降低了节点搭便车提供虚假损失值的风险。The difference between the training loss of the verification node and the training loss of the verified node is used to evaluate the accuracy of the parameters submitted by the verified node, thereby reducing the risk of nodes providing false loss values by free riding.
优选的,S5的账本共识具体内容包括:共识过程开始之后,联合训练模型中节点贡献度最高的节点被选为主节点接受交易请求;各节点进行本地训练,将本地训练损失广播给联合训练模型中的其他节点,并以交易形式打包发送;节点本地模型梯度数据与当前轮模型质量评估结果交叉熵打包为区块,竞争后记录在区块链上;为保证记账竞争的公平性,基于工作量证明机制,动态调整工作量证明难度,对节点贡献度大的节点,降低其工作量证明难度,以便质量较高的模型快速上链。Preferably, the specific content of S5's ledger consensus includes: after the consensus process starts, the node with the highest node contribution in the joint training model is selected as the master node to accept transaction requests; each node performs local training and broadcasts the local training loss to the joint training model Other nodes in the network are packaged and sent in the form of transactions; the local model gradient data of the node and the cross-entropy of the current round of model quality assessment results are packaged into blocks, which are recorded on the blockchain after competition; in order to ensure the fairness of accounting competition, based on The proof-of-work mechanism dynamically adjusts the difficulty of proof-of-work, and reduces the difficulty of proof-of-work for nodes that contribute a lot to nodes, so that higher-quality models can be quickly uploaded to the chain.
需要说明的是:It should be noted:
节点本地模型梯度数据与当前轮模型质量评估结果交叉熵打包为区块,竞争后记录在区块链上的具体内容包括:The local model gradient data of the node and the cross-entropy of the current round of model quality assessment results are packaged into blocks. The specific contents recorded on the blockchain after the competition include:
节点训练本地模型后,为了避免原始数据隐私泄露,仅将模型训练的中间梯度参数以及该轮模型训练质量评估结果(交叉熵)打包为区块,区块链网络中的节点通过贡献度证明共识算法争夺记账权,竞争成功的节点将区块信息追加在当前区块链结尾,完成记账。After the node trains the local model, in order to avoid the privacy leakage of the original data, only the intermediate gradient parameters of the model training and the quality evaluation results (cross-entropy) of the model training of this round are packaged into blocks, and the nodes in the blockchain network prove the consensus through contribution. The algorithm competes for the accounting rights, and the node that succeeds in the competition appends the block information to the end of the current blockchain to complete the accounting.
一种面向群智服务的区块链节点贡献度证明共识装置,包括区块链矿工模块、模型训练模块、模型聚合模块和模型验证模块;A blockchain node contribution proof consensus device for crowd intelligence services, including a blockchain miner module, a model training module, a model aggregation module and a model verification module;
其中,区块链矿工模块用于实现数据交易;Among them, the blockchain miner module is used to implement data transactions;
模型训练模块用于实现模型的训练过程;The model training module is used to implement the model training process;
模型聚合模块用于实现联合训练模型的聚合;The model aggregation module is used to implement the aggregation of joint training models;
模型验证模块用于对训练后的模型进行验证。The model verification module is used to verify the trained model.
一种计算机设备,所述设备包括:存储器和一个或一个以上的处理器;A computer device including: a memory and one or more processors;
存储器,用于存储一个或一个以上的程序;Memory, used to store one or more programs;
当一个或一个以上的程序被处理器执行时,使得处理器执行上述方法。When one or more programs are executed by the processor, the processor is caused to execute the above method.
一种计算机可读存储介质,存储有计算机可执行指令,指令被处理器执行时实现上述方法。A computer-readable storage medium stores computer-executable instructions. When the instructions are executed by a processor, the above method is implemented.
经由上述的技术方案可知,与现有技术相比,本发明公开提供了一种面向群智服务的区块链节点贡献度证明共识方法,可以基于参与节点对协作训练过程中的贡献度进行量化评估,并基于参与节点贡献度动态调整共识过程工作量证明难度系数,提升群智服务过程与共识机制的公平性。由于全量高维梯度数据可能推理攻击而存在隐私泄露问题,因此本发明考虑将梯度压缩之后进行广播,从而避免因完整梯度数据而造成参与节点本地数据隐私泄露。为了保证本地模型参数质量的可验证性,采用智能合约进行本地模型参数自动化验证操作。通过基于差分隐私保护的生成对抗网络(DPGAN),将原始数据经过差分隐私加噪后训练生成可以公开的对抗样本数据进行广播,以免原始样本数据的隐私泄露。智能合约通过验证对抗样本与模型参数从而对本地模型质量进行评估,舍弃低质量的模型参数。It can be seen from the above technical solutions that compared with the existing technology, the present invention discloses a blockchain node contribution proof consensus method for crowd intelligence services, which can quantify the contribution of participating nodes in the collaborative training process. Evaluate and dynamically adjust the workload proof difficulty coefficient of the consensus process based on the contribution of participating nodes to improve the fairness of the crowd intelligence service process and consensus mechanism. Since the full amount of high-dimensional gradient data may cause privacy leakage due to inference attacks, the present invention considers compressing the gradients before broadcasting, thereby avoiding leakage of local data privacy of participating nodes due to complete gradient data. In order to ensure the verifiability of local model parameter quality, smart contracts are used to automatically verify local model parameters. Through the Generative Adversarial Network (DPGAN) based on differential privacy protection, the original data is trained with differential privacy and noise to generate publicly available adversarial sample data for broadcast to avoid privacy leakage of the original sample data. The smart contract evaluates the quality of the local model by verifying adversarial samples and model parameters, discarding low-quality model parameters.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without exerting creative efforts.
图1附图为本发明提供的一种面向群智服务的区块链节点贡献度证明共识方法的概要示意图;Figure 1 is a schematic diagram of a blockchain node contribution proof consensus method for crowd intelligence services provided by the present invention;
图2附图为本发明提供的一种面向群智服务的区块链节点贡献度证明共识方法的整体流程示意图;Figure 2 is a schematic diagram of the overall flow of a blockchain node contribution proof consensus method for crowd intelligence services provided by the present invention;
图3附图为本发明提供的一种面向群智服务的区块链节点贡献度证明共识方法的中间梯度参数压缩与共享流程示意图。Figure 3 is a schematic diagram of the intermediate gradient parameter compression and sharing process of a blockchain node contribution proof consensus method for crowd intelligence services provided by the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
本发明实施例公开了一种面向群智服务的区块链节点贡献度证明共识方法,如图1所示,计算群智服务参与节点的贡献度,基于节点贡献度动态调整共识过程的工作量证明难度达成本地模型参数分布式账本记账共识。如图2所示,基于区块链的群智服务参与者贡献度证明共识的过程如下:The embodiment of the present invention discloses a blockchain node contribution proof consensus method for crowd intelligence services. As shown in Figure 1, the contribution of nodes participating in the crowd intelligence service is calculated, and the workload of the consensus process is dynamically adjusted based on the node contribution. Prove the difficulty to achieve local model parameter distributed ledger accounting consensus. As shown in Figure 2, the process of participating in the blockchain-based crowd intelligence service to prove the consensus is as follows:
1)获取第一个与最后一个区块时间戳以及节点下线时间,计算节点在线贡献度;1) Obtain the first and last block timestamps and node offline time, and calculate the node’s online contribution;
2)参与节点提供本地数据信息熵与数据量结果(以MB为单位);2) Participating nodes provide local data information entropy and data volume results (in MB);
3)节点本地训练模型,广播经过梯度压缩后的高维梯度数据以及本地模型质量评估结果,并行执行步骤4);3) The node locally trains the model, broadcasts the high-dimensional gradient data after gradient compression and the local model quality assessment results, and executes step 4) in parallel;
4)触发模型参数质量验证智能合约,通过DPGAN生成的对抗样本对输入的梯度数据与模型质量评估结果进行验证,如果满足验证条件执行5),否则执行6);4) Trigger the model parameter quality verification smart contract, and verify the input gradient data and model quality assessment results through the adversarial samples generated by DPGAN. If the verification conditions are met, execute 5), otherwise execute 6);
5)将1)2)3)步骤计算得到节点贡献度进行加和,并为节点分配与贡献度成反比例的工作量证明难度系数,动态调整工作量证明难度,并通过工作量证明达成账本共识,本地模型参数记录上链;5) Add up the node contribution calculated in steps 1) 2) 3), assign the node a workload proof difficulty coefficient that is inversely proportional to the contribution, dynamically adjust the workload proof difficulty, and achieve ledger consensus through workload proof , local model parameter records are uploaded to the chain;
6)对未通过本地模型参数验证的节点进行惩罚,并舍弃其提供的本地模型参数,不进行上链操作。6) Penalize nodes that fail local model parameter verification, discard the local model parameters they provide, and do not perform on-chain operations.
本地模型参数智能合约验证过程包括:参与节点将本地模型训练的中间梯度数据进行压缩,并将本地训练的交叉熵损失函数广播,其中中间梯度参数压缩与共享流程示意图如图3所示。参与节点基于本地训练样本进行差分隐私后采用DPGAN产生对抗样本并进行广播。接收到广播参数的节点通过本地参与与对抗样本对交叉熵损失函数进行验证,如果差值小于一定范围则验证通过,可以进行上链共识,否则将参数舍弃,以免影响聚合模型准确性。The local model parameter smart contract verification process includes: participating nodes compress the intermediate gradient data trained by the local model and broadcast the cross-entropy loss function of the local training. The schematic diagram of the intermediate gradient parameter compression and sharing process is shown in Figure 3. Participating nodes perform differential privacy based on local training samples and then use DPGAN to generate adversarial samples and broadcast them. The node that receives the broadcast parameters verifies the cross-entropy loss function through local participation and adversarial samples. If the difference is less than a certain range, the verification is passed and the on-chain consensus can be carried out. Otherwise, the parameters will be discarded to avoid affecting the accuracy of the aggregation model.
使用此方案通过参与者贡献度证明共识节省了参与节点共识过程的资源开销,并提升了节点参与的公平性。采用区块链技术实现了群智服务本地模型的参数共享,并且降低了低质量模型对聚合模型准确率的影响。通过梯度压缩,降低了中间梯度数据隐私泄露的风险,通过执行智能合约将本地模型参数的验证自动化,节省了参数管理维护和管理的成本,提高了效率。验证数据集通过差分隐私生成对抗网络(DPGAN)产生对抗样本,通过对抗样本验证本地模型参数质量,不仅保证本地训练参数不被暴露,还可提供可验证模型参数的数据集。通过此方案可以实现群智服务参与节点协作式训练的公平性,减轻节点共识过程的计算与存储负担。本方案精准解决群智服务中参数共识的节点公平性问题与中间参数隐私泄露。Using this solution to prove consensus by participants' contribution saves the resource overhead of participating in the node consensus process and improves the fairness of node participation. Blockchain technology is used to realize parameter sharing of local models of crowd intelligence services and reduce the impact of low-quality models on the accuracy of the aggregate model. Through gradient compression, the risk of privacy leakage of intermediate gradient data is reduced. By executing smart contracts, the verification of local model parameters is automated, saving the cost of parameter management maintenance and management, and improving efficiency. The verification data set generates adversarial samples through Differential Privacy Generative Adversarial Network (DPGAN), and verifies the quality of local model parameters through adversarial samples. It not only ensures that local training parameters are not exposed, but also provides a data set that can verify model parameters. Through this solution, the fairness of the crowd intelligence service participating in node collaborative training can be achieved, and the computing and storage burden of the node consensus process can be reduced. This solution accurately solves the problem of node fairness and intermediate parameter privacy leakage in parameter consensus in crowd intelligence services.
群智服务由多种类型的智能边缘设备协作提供智能服务。随着移动通讯技术和智能边缘设备的兴起,群智服务将在智慧城市、电子医疗、无线通讯、移动边缘网络等领域有着广泛的应用前景。然而群智服务中涉及多节点的协作训练,如何保证多节点参与的公平性是推动群智服务进一步落地的关键问题。特别是协作训练过程中可能涉及到一些恶意节点参与和节点搭便车行为造成的聚合模型质量不高,影响了群智服务的进一步发展。此外,由于高维梯度数据可能造成本地训练数据的隐私泄露,从而将群智服务特有的优势掩盖。为了上述问题,本公开将区块链引入群智服务多节点协作训练场景,科学量化参与节点的贡献度,并根据贡献度动态调整区块链共识过程中的工作量证明难度,改进了工作量证明共识机制,降低了节点的资源浪费,提升了参与节点的公平性。Crowd intelligence services consist of multiple types of intelligent edge devices collaborating to provide intelligent services. With the rise of mobile communication technology and intelligent edge devices, crowd intelligence services will have broad application prospects in smart cities, electronic medical care, wireless communications, mobile edge networks and other fields. However, group intelligence services involve collaborative training of multiple nodes. How to ensure the fairness of multi-node participation is a key issue to promote the further implementation of group intelligence services. In particular, the collaborative training process may involve the participation of some malicious nodes and node free-riding behavior, resulting in low-quality aggregate models, which affects the further development of crowd intelligence services. In addition, high-dimensional gradient data may cause privacy leakage of local training data, thus covering up the unique advantages of crowd intelligence services. In order to solve the above problems, this disclosure introduces the blockchain into the crowd intelligence service multi-node collaborative training scenario, scientifically quantifies the contribution of participating nodes, and dynamically adjusts the workload proof difficulty in the blockchain consensus process based on the contribution, improving the workload Proving the consensus mechanism reduces the waste of node resources and improves the fairness of participating nodes.
为了避免恶意节点提供虚假的模型参数,本公开采用基于差分隐私保护的生成对抗网络(Differential Privacy with Generative Adversarial Network,DPGAN)提供对抗样本验本地模型参数。DPGAN是一种融合了差分隐私和生成对抗网络(GAN)的深度学习网络模型,提供了一种保护中间梯度隐私的生成对抗网络模型。由于深度学习网络模型的高度复杂性,完整的中间梯度数据很容易暴露训练样本,因此对梯度加噪是目前常用的梯度隐私保护方法。DPGAN不仅利用差分隐私对数据样本隐私保护,并基于加躁的数据样本训练得到对抗样本,对抗样本不会暴露节点本地数据隐私,并且还可用于模型质量验证。通过智能合约自动化验证模型参数质量,从而避免虚假的本地模型参数,提升了聚合模型的可靠性。本公开提出的基于区块链的群智服务参与者贡献度证明方式实现了群智服务参与节点的分布式自治训练,并且通过改进的参与者贡献度证明算法降低了节点共识过程的资源浪费,提升了节点参与的公平性。通过区块链保存经过压缩的中间梯度参数与模型质量验证结果,不仅实现了共享数据透明,还具备了参数不可篡改和可追溯的特性。In order to prevent malicious nodes from providing false model parameters, this disclosure uses a Generative Adversarial Network (DPGAN) based on differential privacy protection to provide adversarial samples to test local model parameters. DPGAN is a deep learning network model that combines differential privacy and generative adversarial networks (GAN), providing a generative adversarial network model that protects intermediate gradient privacy. Due to the high complexity of deep learning network models, complete intermediate gradient data can easily expose training samples, so gradient noise is currently a commonly used gradient privacy protection method. DPGAN not only uses differential privacy to protect the privacy of data samples, but also obtains adversarial samples based on noise-added data sample training. The adversarial samples will not expose the local data privacy of the node, and can also be used for model quality verification. The quality of model parameters is automatically verified through smart contracts, thereby avoiding false local model parameters and improving the reliability of the aggregate model. The blockchain-based group intelligence service participant contribution proof method proposed by this disclosure realizes the distributed autonomous training of crowd intelligence service participating nodes, and reduces the waste of resources in the node consensus process through the improved participant contribution proof algorithm. Improved the fairness of node participation. Saving the compressed intermediate gradient parameters and model quality verification results through the blockchain not only achieves transparent shared data, but also has the characteristics of non-tamperable and traceable parameters.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on its differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For relevant details, please refer to the description in the method section.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110547351.4ACN113347162B (en) | 2021-05-19 | 2021-05-19 | Block chain link point contribution degree proving consensus method for crowd-sourcing service |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110547351.4ACN113347162B (en) | 2021-05-19 | 2021-05-19 | Block chain link point contribution degree proving consensus method for crowd-sourcing service |
| Publication Number | Publication Date |
|---|---|
| CN113347162A CN113347162A (en) | 2021-09-03 |
| CN113347162Btrue CN113347162B (en) | 2023-09-29 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110547351.4AExpired - Fee RelatedCN113347162B (en) | 2021-05-19 | 2021-05-19 | Block chain link point contribution degree proving consensus method for crowd-sourcing service |
| Country | Link |
|---|---|
| CN (1) | CN113347162B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113762528A (en)* | 2021-09-10 | 2021-12-07 | 北京航空航天大学 | A blockchain-based approach to federal credit assessment |
| CN113961969B (en)* | 2021-12-22 | 2022-03-15 | 北京金睛云华科技有限公司 | Security threat collaborative modeling method and system |
| CN114492854A (en)* | 2022-02-09 | 2022-05-13 | 北京百度网讯科技有限公司 | Method, apparatus, electronic device and storage medium for training model |
| CN114614511A (en)* | 2022-02-22 | 2022-06-10 | 广西电网有限责任公司电力科学研究院 | Microgrid group distributed intelligent sensing and coordinated operation system based on block chain |
| CN115203732A (en)* | 2022-04-29 | 2022-10-18 | 北京国联视讯信息技术股份有限公司 | A method and system for data collaboration based on blockchain |
| CN114757674B (en)* | 2022-06-15 | 2022-09-23 | 中科链安(北京)科技有限公司 | Consensus method, system and storage medium for rewarding and punishing ability based on intelligent contract |
| CN115297009B (en)* | 2022-07-08 | 2023-11-17 | 中电信数智科技有限公司 | Digital encryption consistency optimization method based on blockchain distributed network |
| CN115296918B (en)* | 2022-08-10 | 2025-04-18 | 杭州电子科技大学 | A decentralized financial strategy sharing method based on on-chain behavior contribution proof |
| CN117670340A (en)* | 2022-08-25 | 2024-03-08 | 华为技术有限公司 | Equity distribution method and device |
| CN115914277A (en)* | 2022-10-09 | 2023-04-04 | 中国科学院信息工程研究所 | C-D mode-based network target range resource sharing method and platform |
| CN115643267B (en)* | 2022-10-12 | 2024-11-12 | 合肥工业大学 | Method and blockchain system for dynamically improving blockchain performance based on network trust model |
| CN119377684A (en)* | 2024-12-30 | 2025-01-28 | 中国人民解放军总医院 | Data processing method, system, device and medium based on biological information data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020165256A1 (en)* | 2019-02-13 | 2020-08-20 | Uvue Limited | System and method for evaluating useful work |
| CN111931242A (en)* | 2020-09-30 | 2020-11-13 | 国网浙江省电力有限公司电力科学研究院 | Data sharing method, computer equipment applying same and readable storage medium |
| CN112784994A (en)* | 2020-12-31 | 2021-05-11 | 浙江大学 | Block chain-based federated learning data participant contribution value calculation and excitation method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110825810B (en)* | 2019-10-28 | 2023-05-19 | 天津理工大学 | A double privacy protection method based on blockchain group intelligence perception |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020165256A1 (en)* | 2019-02-13 | 2020-08-20 | Uvue Limited | System and method for evaluating useful work |
| CN111931242A (en)* | 2020-09-30 | 2020-11-13 | 国网浙江省电力有限公司电力科学研究院 | Data sharing method, computer equipment applying same and readable storage medium |
| CN112784994A (en)* | 2020-12-31 | 2021-05-11 | 浙江大学 | Block chain-based federated learning data participant contribution value calculation and excitation method |
| Title |
|---|
| 基于工作量证明和权益证明改进的区块链共识机制;吴梦宇 等;计算机应用;第40卷(第08期);全文* |
| Publication number | Publication date |
|---|---|
| CN113347162A (en) | 2021-09-03 |
| Publication | Publication Date | Title |
|---|---|---|
| CN113347162B (en) | Block chain link point contribution degree proving consensus method for crowd-sourcing service | |
| Nguyen et al. | Cooperative task offloading and block mining in blockchain-based edge computing with multi-agent deep reinforcement learning | |
| CN113794675B (en) | Distributed Internet of things intrusion detection method and system based on block chain and federal learning | |
| Cui et al. | CREAT: Blockchain-assisted compression algorithm of federated learning for content caching in edge computing | |
| Yuan et al. | Performance modeling and analysis of a Hyperledger-based system using GSPN | |
| CN113992676B (en) | Incentive method and system for layered federal learning under terminal edge cloud architecture and complete information | |
| Rivera et al. | A blockchain framework for secure task sharing in multi-access edge computing | |
| Huang et al. | Resource allocation and consensus of blockchains in pervasive edge computing environments | |
| CN113037504B (en) | Node excitation method and system under fragment-based unauthorized block chain architecture | |
| CN116306910B (en) | A fair privacy calculation method based on federated node contributions | |
| Guerra et al. | The cost of training machine learning models over distributed data sources | |
| Huang et al. | Enabling DNN acceleration with data and model parallelization over ubiquitous end devices | |
| CN113364831B (en) | Multi-domain heterogeneous computing network resource credible cooperation method based on block chain | |
| CN103631898B (en) | Calculation method of multimedia social network reputation value based on strong and weak connection feedback | |
| CN115640305A (en) | A fair and credible federated learning method based on blockchain | |
| CN104394202B (en) | A kind of node liveness quantization method in mobile community network | |
| WO2023240911A1 (en) | Computing power scheduling system and method, control node, storage medium, and device | |
| CN113052329A (en) | Method and device for jointly updating service model | |
| CN117196010B (en) | Block chain distributed federation learning method, system and terminal for internet-connected automobile | |
| Xiao et al. | Deep reinforcement learning for optimal resource allocation in blockchain-based IoV secure systems | |
| CN116595094A (en) | Federal learning incentive method, device, equipment and storage medium based on block chain | |
| CN116112953A (en) | Blockchain task offloading and resource allocation method based on mobile edge computing | |
| Zhou et al. | Incentive-Driven and Energy Efficient Federated Learning in Mobile Edge Networks | |
| Chen et al. | CVT: A crowdsourcing video transcoding scheme based on blockchain smart contracts | |
| CN115481752A (en) | Model training method and device, electronic equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | Granted publication date:20230929 | |
| CF01 | Termination of patent right due to non-payment of annual fee |