CN111897874A - A data security exchange and calculation method based on hybrid chain - Google Patents
A data security exchange and calculation method based on hybrid chain Download PDFInfo
- Publication number
- CN111897874A CN111897874A CN202010730721.3A CN202010730721A CN111897874A CN 111897874 A CN111897874 A CN 111897874A CN 202010730721 A CN202010730721 A CN 202010730721A CN 111897874 A CN111897874 A CN 111897874A
- Authority
- CN
- China
- Prior art keywords
- data
- node
- result
- contract
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000004364 calculation method Methods 0.000 title claims abstract description 15
- 238000000034 method Methods 0.000 claims abstract description 22
- 238000013475 authorization Methods 0.000 claims description 10
- 238000012795 verification Methods 0.000 claims description 2
- 238000007689 inspection Methods 0.000 claims 2
- 238000004806 packaging method and process Methods 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000012545 processing Methods 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种基于混合链的数据安全交换和运算方法。发送数据调用请求,接收到请求的节点触发智能合约计算请求的哈希写入区块链,并作为任务分发给其他节点;接收到的节点根据任务获取运算合约并验证正确性,利用本地数据和运算合约得到结果;节点计算运算过程数据的哈希值写入区块链,将结果数据返回至分发任务的节点;分发任务的节点对比和验证返回结果;在确定结果合理后由返回结果及本地数据得到最终结果,计算运算过程数据的哈希值写入区块链,并将最终结果返回给用户。本发明通过区块链技术实现多方数据安全交换,将数据任务分发至多个参与方即可安全地获得数据的最终结果。
The invention discloses a data security exchange and calculation method based on a hybrid chain. Send a data call request, the node that receives the request triggers the smart contract to calculate the hash of the request, write it into the blockchain, and distribute it to other nodes as a task; the received node obtains the operation contract according to the task and verifies the correctness, using local data and The operation contract obtains the result; the node calculates the hash value of the operation process data into the blockchain, and returns the result data to the node that distributes the task; the nodes that distribute the task compare and verify the returned result; after the result is determined to be reasonable, the returned result and local The data gets the final result, the hash value of the data in the calculation operation process is written into the blockchain, and the final result is returned to the user. The invention realizes the secure exchange of data among multiple parties through the blockchain technology, and the final result of the data can be safely obtained by distributing data tasks to multiple participating parties.
Description
技术领域technical field
本发明涉及区块链中的一种数据处理交换方法,特别是涉及一种基于混合链的数据安全交换和运算方法。The invention relates to a data processing and exchanging method in the block chain, in particular to a data security exchanging and computing method based on a hybrid chain.
背景技术Background technique
随着科技的发展,数据量呈指数级的增加,这使得政府、企业和其他主体掌握着大量的数据资源,但由于缺少安全、可靠的数据共享交换协同机制,导致数据孤岛现象明显。传统情况下,为实现数据共享交换都是采用数据直接集中和处理的方式,将多方的数据直接调取汇集在本地进行中心化存储,然而这种方式存在数据安全、隐私泄露等问题。With the development of science and technology, the amount of data has increased exponentially, which makes the government, enterprises and other subjects have a large number of data resources. Traditionally, in order to realize data sharing and exchange, data is directly centralized and processed, and data from multiple parties is directly retrieved and collected locally for centralized storage. However, this method has problems such as data security and privacy leakage.
与此同时,由于很多隐私数据不能出私域,无法直接采用调用源数据的方式实现数据共享交换,因此很大范围的数据还是处于未被利用的状态。为充分发挥数据价值,实现数据的安全流通和使用,需要在授权的情况下合理、安全地使用数据,还需要实时追踪数据流向和使用过程,以确保数据的真实性和安全性。At the same time, because a lot of private data cannot go out of the private domain, and data sharing and exchange cannot be realized by directly calling source data, a large range of data is still in an unused state. In order to give full play to the value of data and realize the safe circulation and use of data, it is necessary to use data reasonably and safely under authorization, and it is also necessary to track data flow and use process in real time to ensure the authenticity and security of data.
发明内容SUMMARY OF THE INVENTION
为了克服上述现有技术的不足,本发明提供了一种基于混合链的数据安全交换和运算方法,旨在通过智能、安全的方式进行数据融合和使用,在保证数据隐私安全和归属权的前提下充分进行数据安全交换和运算。In order to overcome the above-mentioned deficiencies of the prior art, the present invention provides a data security exchange and calculation method based on a hybrid chain, aiming at data fusion and use in an intelligent and safe manner, on the premise of ensuring data privacy security and ownership. Under the fully secure data exchange and operation.
本发明所采用的技术方案是:The technical scheme adopted in the present invention is:
A)用户发送数据调用请求,接收到数据调用请求的节点作为初始节点,初始节点触发智能合约去计算数据调用请求的哈希并将哈希写入所在区块链,然后将数据调用请求作为任务分发给混合链中其他节点;A) The user sends a data call request, the node that receives the data call request is used as the initial node, the initial node triggers the smart contract to calculate the hash of the data call request and writes the hash to the blockchain where it is located, and then uses the data call request as a task Distributed to other nodes in the hybrid chain;
B)接收到任务的节点从混合链运算合约库获取运算合约,对运算合约的源代码的哈希进行链上进行验证,在验证运算合约的正确性后,根据数据调用请求调用对应的本地数据运行运算合约得到结果数据,然后接收到任务的节点计算输入数据、运算合约、结果数据、运算开始时间和运算结束时间的共同哈希值,并写入节点所在区块链网络,将结果数据返回至分发任务的初始节点;B) The node receiving the task obtains the operation contract from the hybrid chain operation contract library, verifies the hash of the source code of the operation contract on the chain, and after verifying the correctness of the operation contract, calls the corresponding local data according to the data call request Run the operation contract to get the result data, and then the node receiving the task calculates the input data, the operation contract, the result data, the operation start time and the operation end time of the common hash value, and writes it into the blockchain network where the node is located, and returns the result data. to the initial node that distributes the task;
C)分发任务的节点接收到混合链中接收到任务的节点运算返回的结果数据,对比所有返回的结果数据,确定结果数据的合理性;C) The node that distributes the task receives the result data returned by the node operation that receives the task in the hybrid chain, compares all the returned result data, and determines the rationality of the result data;
D)在确定返回结果合理性后,接收到数据调用请求的节点根据本地数据、返回结果和运算合约计算最终结果,计算输入数据、运算合约、结果数据、运算开始时间和的运算结束时间的哈希值,并写入节点所在区块链网络,并将计算的最终结果返回给用户。D) After determining the reasonableness of the returned result, the node receiving the data call request calculates the final result according to the local data, the returned result and the operation contract, and calculates the input data, the operation contract, the result data, the operation start time and the operation end time. The value is written into the blockchain network where the node is located, and the final result of the calculation is returned to the user.
本发明所述的节点均为混合链中的节点。The nodes described in the present invention are all nodes in the hybrid chain.
所述步骤A)具体包括:Described step A) specifically comprises:
A1)用户发送数据调用请求,数据调用请求包括数据查询、汇集、计算,根据实际需要进行选择;A1) The user sends a data call request, and the data call request includes data query, collection, and calculation, and the selection is made according to actual needs;
A2)混合链中接收到数据调用请求的节点Sr计算数据调用请求的哈希并写入所在区块链,并触发智能合约将数据调用请求作为任务分发给混合链中需要的其他n个节点Nx,x=1,...,n,x表示节点的序数,n表示混合链中需接收数据调用请求的节点总数;A2) The node S r that receives the data call request in the hybrid chain calculates the hash of the data call request and writes it into the blockchain where it is located, and triggers the smart contract to distribute the data call request as a task to other n nodes needed in the hybrid chain N x , x=1,...,n, x represents the ordinal number of nodes, n represents the total number of nodes in the hybrid chain that need to receive data call requests;
所述混合链是整个区块链网络中涉及多种类型的区块链,包括联盟链、私有链和公有链等,用户向混合链中受理请求的区块链节点发送数据调用请求。The hybrid chain refers to various types of blockchains involved in the entire blockchain network, including alliance chains, private chains, and public chains, etc. The user sends a data call request to the blockchain node in the hybrid chain that accepts the request.
所述步骤B)具体包括:Described step B) specifically comprises:
B1)接收到任务的节点Nx,根据任务从混合链运算合约库所在的代码服务器获取运算合约Cx,并计算运算合约Cx的源代码的哈希;B1) The node Nx that receives the task, obtains the operation contract Cx from the code server where the hybrid chain operation contract library is located according to the task, and calculates the hash of the source code of the operation contract Cx ;
B2)将计算出的源代码哈希与混合链上原有的源代码哈希进行比对验证,在验证运算合约的正确性后运行运算合约Cx,调用与数据调用请求匹配的本地数据作为输入数据Data(in,x),根据运算合约Cx运算出任务所需的结果数据Data(out,x),B2) Compare and verify the calculated source code hash with the original source code hash on the hybrid chain, run the operation contract C x after verifying the correctness of the operation contract, and call the local data matching the data call request as input Data Data (in,x) , according to the operation contract C x to calculate the result data Data (out,x) required by the task,
B3)接收到任务的节点Nx,计算输入数据Data(in,x)、运算合约Cx、结果数据Data(out,x)、运算开始时间Time(start,x)和运算结束时间Time(end,x)的共同哈希值Hx,并将共同哈希值Hx写入节点Nx所在的区块链;B3) The node N x that receives the task, calculates the input data Data (in,x) , the operation contract C x , the result data Data (out,x) , the operation start time Time (start,x) and the operation end time Time (end , x) of the common hash value H x , and write the common hash value H x into the blockchain where the node N x is located;
Hx=H(Data(in,x),Cx,Data(out,x),Time(start,x),Time(end,x))H x =H(Data (in,x) ,C x ,Data (out,x) ,Time (start,x) ,Time (end,x) )
其中,H(·)为安全哈希函数;Among them, H( ) is a secure hash function;
B4)节点Nx将运算出的结果Dataout返回至分发任务的初始节点Sr。B4) The node N x returns the calculated result Data out to the initial node S r of the distribution task.
所述步骤C)具体包括:Described step C) specifically comprises:
初始节点Sr接收到混合链其他节点Nx返回的结果数据Data(out,x)后,按照以下方式对比所有返回的结果数据:After the initial node S r receives the result data Data (out,x) returned by other nodes N x of the hybrid chain, it compares all the returned result data in the following way:
若其中有节点Nx返回的结果数据存在过大偏差时,初始节点Sr向存在过大偏差的节点Ny发送查验请求m,y∈{1,...,n},以进行本地数据查验,并计算查验请求m的哈希值写入所在区块链,存在过大偏差的节点Ny在接收到查验请求m后,先进行自我校验,判定输入数据Data(in,y)、运算合约Cy和结果数据Data(out,y)的正确性:If there is a large deviation in the result data returned by node N x , the initial node S r sends a check request m, y∈{1,...,n} to the node N y with excessive deviation to perform local data analysis. Check, and calculate the hash value of the check request m and write it into the blockchain where it is located. After receiving the check request m, the node N y with excessive deviation first performs self-check to determine the input data Data (in, y) , Correctness of operation contract C y and result data Data (out, y) :
若判定数据及运算方式存在问题,则存在过大偏差的节点Ny更新输入数据和运算合约,根据新的运算合约运算新的结果数据Data'(in,y)并返回给初始节点Sr,并计算更新后的输入数据Data'(in,y)、运算合约C'y、结果数据Data'(out,y)、运算开始时间Time'(start,y)和运算结束时间Time'(end,y)的新的共同哈希值H'(Data,y),并将新的共同哈希值H'(Data,y)写入所在区块链:If it is determined that there is a problem with the data and the operation method, the node N y with excessive deviation updates the input data and the operation contract, calculates the new result data Data' (in, y) according to the new operation contract and returns it to the initial node S r , And calculate the updated input data Data' (in,y) , operation contract C' y , result data Data' (out,y) , operation start time Time' (start,y) and operation end time Time' (end, y) of the new common hash value H' (Data,y) , and write the new common hash value H' (Data,y) into the blockchain:
H'(Data,y)=H(Data'(in,y),C'y,Data'(out,y),Time'(start,y),Time'(end,y))H' (Data,y) = H(Data' (in,y) ,C' y ,Data' (out,y) ,Time' (start,y) ,Time' (end,y) )
其中,H(·)为安全哈希函数;Among them, H( ) is a secure hash function;
若判定数据及运算方式均正确,则存在过大偏差的节点Ny发送与数据调用请求匹配的本地数据的调用请求至该本地数据的数据拥有者,在获得数据拥有者的授权w后将输入数据Data(in,y)、运算合约Cy和结果数据Data(out,y)打包返回给初始节点Sr,并计算数据拥有者的授权w、授权时间Timew、输入数据Data(in,y)、运算合约Cy和结果数据Data(out,y)的共同哈希值写入区块链:If it is determined that both the data and the operation method are correct, the node Ny with excessive deviation sends a local data call request matching the data call request to the data owner of the local data, and after obtaining the authorization w of the data owner, it will input The data Data (in,y) , the operation contract C y and the result data Data (out,y) are packaged and returned to the initial node S r , and the authorization w of the data owner, the authorization time Time w , and the input data Data (in,y ) are calculated. ) , the common hash value of the operation contract C y and the result data Data (out,y) is written into the blockchain:
Hw=H(w,Data(in,y),Cy,Data(out,y),Timew)H w =H(w,Data (in,y) ,C y ,Data (out,y) ,Time w )
若其中没有节点Nx返回的结果数据存在过大偏差时,则所有节点Nx返回的结果数据是合理的。If the result data returned by no node N x is too large, the result data returned by all nodes N x is reasonable.
所述步骤D)具体包括:Described step D) specifically comprises:
D1)初始节点Sr利用返回结果运算最终结果:D1) The initial node S r uses the returned result to calculate the final result:
若对比后所有节点Nx返回的结果数据是合理的,则初始节点Sr调用自身的运算合约Cr根据返回的结果数据{Data(out,1),...,Data(out,n)}、与数据调用请求匹配的自身的本地数据Data(in,r)进行运算获得最终的自身结果数据Data(out,r),然后计算返回的结果数据{Data(out,1),...,Data(out,n)}、本地数据Data(in,r)、运算合约Cr、自身结果数据Data(out,r)、运算开始时间Time(start,r)和运算结束时间Time(end,r)的共同哈希值H(Data,r)并写入出示节点Sr所在区块链:If the result data returned by all nodes N x is reasonable after comparison, the initial node S r calls its own computing contract C r according to the returned result data {Data (out,1) ,...,Data (out,n) }. Perform operation on the local data Data (in,r) matching the data call request to obtain the final self-result data Data (out,r) , and then calculate the returned result data{Data (out,1) ,... ,Data (out,n) }, local data Data (in,r) , operation contract C r , own result data Data (out,r) , operation start time Time (start,r) and operation end time Time (end, r) of the common hash value H (Data,r) and write it into the blockchain showing the location of the node S r :
H(Data,r)=H(Data(in,r),Data(out,1),...,Data(out,n),Cr,Data(out,r),Time(start,r),Time(end,r))H (Data,r) =H(Data (in,r) ,Data (out,1) ,...,Data (out,n) ,C r ,Data (out,r) ,Time (start,r) ,Time (end,r) )
其中,H(·)为安全哈希函数;Among them, H( ) is a secure hash function;
若对比后所有节点Nx返回的结果数据存在较大偏差且判定数据及运算方式存在问题,则节点Ny向初始节点Sr返回新的结果数据,初始节点Sr调用自身的运算合约Cr根据返回的新的结果数据{Data(out,1),...,Data'(out,y),...,Data(out,n)}、与数据调用请求匹配的自身的本地数据Data(in,r)进行运算获得最终的自身结果数据Data(out,r),并计算返回的新的结果数据{Data(out,1),...,Data'(out,y),...,Data(out,n)}、本地数据Data(in,r)、运算合约Cr、自身结果数据Data(out,r)、运算开始时间Time(start,r)和运算结束时间Time(end,r)的共同哈希值H(Data,r)写入初始节点Sr所在区块链:If there is a large deviation in the result data returned by all nodes N x after the comparison and it is determined that there is a problem with the data and the operation method, the node N y returns new result data to the initial node S r , and the initial node S r calls its own operation contract C r According to the returned new result data {Data (out,1) ,...,Data' (out,y) ,...,Data (out,n) }, its own local data Data that matches the data call request (in,r) performs the operation to obtain the final self-result data Data (out,r) , and calculates the returned new result data {Data (out,1) ,...,Data' (out,y) ,.. .,Data (out,n) }, local data Data (in,r) , operation contract C r , own result data Data (out,r) , operation start time Time (start,r) and operation end time Time (end ,r) The common hash value H (Data,r) is written into the blockchain where the initial node S r is located:
H(Data,r)=H(Data(in,r),Data(out,1),...,Data'(out,y),...,Data(out,n),Cr,Data(out,r),Time(start,r),Time(end,r))H (Data,r) =H(Data (in,r) ,Data (out,1) ,...,Data' (out,y) ,...,Data (out,n) ,C r ,Data (out,r) ,Time (start,r) ,Time (end,r) )
若对比后所有节点Nx返回的结果数据存在较大偏差但判定数据及运算方式均正确,则初始节点Sr调用自身的运算合约Cr根据返回的结果数据{Data(out,1),...,Data(out,n)}、与数据调用请求匹配的自身的本地数据Data(in,r)进行运算获得最终的自身结果数据Data(out,r),然后计算返回的结果数据{Data(out,1),...,Data(out,n)}、本地数据Data(in,r)、运算合约Cr、自身结果数据Data(out,r)、运算开始时间Time(start,r)和运算结束时间Time(end,r)的共同哈希值H(Data,r)并写入出示节点Sr所在区块链:If there is a large deviation in the result data returned by all nodes N x after comparison, but the data and operation methods are judged to be correct, the initial node S r calls its own operation contract C r according to the returned result data {Data (out,1) ,. ..,Data (out,n) }, and its own local data Data (in,r) matching the data call request to obtain the final self-result data Data (out,r) , and then calculate the returned result data {Data (out,1) ,...,Data (out,n) }, local data Data (in,r) , operation contract C r , own result data Data (out,r) , operation start time Time (start,r ) and the common hash value H (Data,r) of the operation end time Time (end,r ) and write it into the blockchain where the node S r is located:
H(Data,r)=H(Data(in,r),Data(out,1),...,Data(out,n),Cr,Data(out,r),Time(start,r),Time(end,r))H (Data,r) =H(Data (in,r) ,Data (out,1) ,...,Data (out,n) ,C r ,Data (out,r) ,Time (start,r) ,Time (end,r) )
D2)初始节点Sr将最终的自身结果数据Data(out,r)返回发送给用户。D2) The initial node S r returns the final self-result data Data (out, r) to the user.
本发明通过区块链技术实现多方数据安全交换,将数据任务分发至多个参与方即可安全地获得数据的最终结果。The invention realizes the secure exchange of data among multiple parties through the blockchain technology, and the final result of the data can be safely obtained by distributing data tasks to multiple participating parties.
与现有技术相比,本发明的有益效果是:Compared with the prior art, the beneficial effects of the present invention are:
(1)利用区块链技术将任务分发至混合链网络,节点根据任务调用本地数据进行计算后将结果返回,既保证数据归属权和数据隐私又充分使用数据。(1) Using blockchain technology to distribute tasks to the hybrid chain network, nodes call local data to perform calculations according to tasks and return the results, which not only ensures data ownership and data privacy, but also makes full use of data.
(2)通过区块链的智能合约完成任务发起、分发、运算和返回的全流程记录,实现数据使用的使用溯源,确保数据的真实性、安全性和结果的准确性。(2) Complete the whole process record of task initiation, distribution, calculation and return through the smart contract of the blockchain, realize the traceability of data usage, and ensure the authenticity, security and accuracy of the data.
附图说明Description of drawings
图1为基于混合链的数据安全交换和运算方法流程说明。Figure 1 is a flow description of the data security exchange and operation method based on the hybrid chain.
具体实施方式Detailed ways
下面结合附图对本发明进一步说明。The present invention will be further described below with reference to the accompanying drawings.
如图1所示,本发明具体实施例和实施方式如下:As shown in Figure 1, specific embodiments and implementations of the present invention are as follows:
1)用户为一个输入指令的电子设备。用户需要获取详细信息,将数据调用请求发送至节点Sr,接收到请求的节点Sr是区块链B1的一个节点,节点Sr计算数据调用请求的哈希值写入区块链B1,并触发智能合约将数据调用请求根据内容作为数据处理任务分发给混合链中相关节点,当前任务相关的节点有n=5个,接收到任务的节点为Nx,x=1,...,5。各节点情况和接收到的信息如下:1) The user is an electronic device that inputs commands. The user needs to obtain the detailed information and send the data call request to the node S r , the node S r that receives the request is a node of the blockchain B 1 , and the node S r calculates the hash value of the data call request and writes it to the blockchain B 1 , and trigger the smart contract to distribute the data call request as a data processing task to the relevant nodes in the hybrid chain according to the content. There are n=5 nodes related to the current task, and the node receiving the task is Nx , x=1, .. .,5. The status of each node and the information received are as follows:
节点Sr、N1、N2、N3、N4和N5均为混合链的节点,节点Sr和N1在同一个区块链网络,节点N2、N3和N4在同一区块链网络。Nodes S r , N 1 , N 2 , N 3 , N 4 and N 5 are all hybrid chain nodes, nodes S r and N 1 are in the same blockchain network, and nodes N 2 , N 3 and N 4 are in the same blockchain network blockchain network.
2)接收到任务的节点Nx根据任务从代码服务器获取运算合约,x∈{1,...,5},并计算运算合约的源代码的哈希;2) The node N x that receives the task obtains the operation contract from the code server according to the task, x∈{1,...,5}, and calculates the hash of the source code of the operation contract;
每个节点Nx本身的工作情况不同,在进行任务处理时所使用的运算合约不同,运算合约对应的哈希值也不同。将计算出的源代码哈希与链上的源代码哈希进行比对验证,在验证运算合约的正确性后运行运算合约,调用本地数据作为输入数据Data(in,x)运算出任务所需结果Data(out,x):The working conditions of each node N x are different, the operation contracts used in task processing are different, and the hash values corresponding to the operation contracts are also different. Compare and verify the calculated source code hash with the source code hash on the chain, run the operation contract after verifying the correctness of the operation contract, and call the local data as the input data Data (in,x) to calculate the required tasks. Result Data (out,x) :
3)接收到任务的各个节点Nx各自计算输入数据Data(in,x)、运算合约Cx和结果数据Data(out,x)、运算开始时间Time(star,tx)和运算结束时间Time(end,x)的共同哈希值Hx,并将哈希值H(Data,x)写入节点所在区块链;3) Each node N x that receives the task calculates the input data Data (in,x) , the operation contract Cx and the result data Data (out,x) , the operation start time Time (star,tx) and the operation end time Time ( end,x) of the common hash value H x , and write the hash value H (Data,x) into the blockchain where the node is located;
H(Data,x)=H(Data(in,x),Cx,Data(out,x),Time(start,x),Time(end,x))H (Data,x) =H(Data (in,x) ,C x ,Data (out,x) ,Time (start,x) ,Time (end,x) )
各个节点Nx将运算出的结果数据Data(out,x)返回至接收到数据调用请求的节点Sr。具体信息如下:Each node N x returns the calculated result data Data (out,x) to the node S r that received the data call request. Specific information is as follows:
4)节点Sr接收到混合链中接收到任务的节点返回的结果数据Data(out,x)后对比所有返回数据:4) The node S r receives the result data Data (out,x) returned by the node receiving the task in the hybrid chain and compares all the returned data:
若发现其中某一节点N3返回数据存在过大偏差时,申请本地数据查验:节点Sr发送查验请求m至偏差大的节点N3,并计算说明内容的哈希值写入区块链。节点N3在接收到查验请求m后,先进行自我校验,判定输入数据Data(in,3)、运算合约C3和结果数据Data(out,3)的正确性:If it is found that there is a large deviation in the data returned by one of the nodes N 3 , apply for local data verification: the node S r sends a verification request m to the node N 3 with a large deviation, and calculates the hash value indicating the content and writes it into the blockchain. After receiving the check request m, the node N 3 first performs self-checking to determine the correctness of the input data Data (in, 3) , the operation contract C 3 and the result data Data (out, 3) :
a)若判定数据及运算方式存在问题,节点N3更新运算数据和运算合约并重新运算,获得新的结果数据Data'(in,3)返回给节点Sr,并计算更新后的输入数据Data'(in,3)、运算合约C'3和结果数据Data'(out,3)、运算开始时间Time'(start,3)和运算结束时间Time'(end,3)的共同哈希值H'(Data,3),将共同哈希值H'(Data,3)写入节点所在区块链;a) If it is determined that there is a problem with the data and the operation method, the node N 3 updates the operation data and the operation contract and re-operation, obtains the new result data Data' (in, 3) and returns it to the node S r , and calculates the updated input data Data ' (in,3) , operation contract C' 3 and result data Data' (out, 3) , operation start time Time' (start, 3) and operation end time Time' (end, 3) The common hash value H ' (Data,3) , write the common hash value H' (Data,3) into the blockchain where the node is located;
H'(Data,3)=H(Data'(in,3),C'3,Data'(out,3),Time'(start,3),Time'(end,3))H' (Data,3) = H(Data' (in,3) ,C' 3 ,Data' (out,3) ,Time' (start,3) ,Time' (end,3) )
b)若判定数据及运算方式均正确,节点N3发送与数据调用请求对应的本地数据调用的申请至数据拥有者,节点N3虽然有本地数据、自身有权限,但是发送给其他节点使用没有权限需要获取数据拥有者的权限,在获得数据拥有者的授权w后将输入数据Data(in,3)、运算合约C3和结果数据Data(out,3)返回给节点Sr,并计算数据拥有者的授权w、授权时间Timew、输入数据Data(in,3)、运算合约C3和结果数据Data(out,3)的哈希值写入区块链:b) If it is determined that the data and the operation method are correct, the node N 3 sends an application for local data invocation corresponding to the data invocation request to the data owner. Although the node N 3 has local data and has its own authority, it sends it to other nodes for use without The authority needs to obtain the authority of the data owner. After obtaining the authorization w of the data owner, the input data Data (in, 3) , the operation contract C 3 and the result data Data (out, 3) are returned to the node S r , and the data is calculated. The owner's authorization w, authorization time Time w , input data Data (in, 3) , operation contract C 3 and the hash value of the result data Data (out, 3) are written into the blockchain:
Hw=H(w,Data(in,3),C3,Data(out,3),Timew)H w =H(w,Data (in,3) ,C 3 ,Data (out,3) ,Time w )
若未发现明显偏差过大的数据,则所有节点Nx返回的结果数据是合理的。If no data with obvious deviation is found, the result data returned by all nodes N x is reasonable.
5)节点Sr利用返回结果运算最终结果:5) Node S r uses the returned result to calculate the final result:
若对比后所有节点Nx返回的结果数据是合理的,则节点Sr调用自身的运算合约Cr根据返回的结果数据{Data(out,1),...,Data(out,n)}、与数据调用请求匹配的自身的本地数据Data(in,r)进行运算获得最终的自身结果数据Data(out,r),然后计算返回的结果数据{Data(out,1),...,Data(out,n)}、本地数据Data(in,r)、运算合约Cr、自身结果数据Data(out,r)、运算开始时间Time(start,r)和运算结束时间Time(end,r)的共同哈希值H(Data,r)并写入出示节点Sr所在区块链:If the result data returned by all nodes N x is reasonable after comparison, the node S r calls its own computing contract C r according to the returned result data {Data (out,1) ,...,Data (out,n) } , The local data Data (in,r) matching the data call request is operated to obtain the final self-result data Data (out,r) , and then the returned result data {Data (out,1) ,..., Data (out,n) }, local data Data (in,r) , operation contract C r , own result data Data (out,r) , operation start time Time (start,r) and operation end time Time (end,r ) of the common hash value H (Data,r) and write it into the blockchain where the node S r is located:
H(Data,r)=H(Data(in,r),Data(out,1),...,Data(out,5),Cr,Data(out,r),Time(start,r),Time(end,r))H (Data,r) =H(Data (in,r) ,Data (out,1) ,...,Data (out,5) ,C r ,Data (out,r) ,Time (start,r) ,Time (end,r) )
若对比后所有节点Nx返回的结果数据存在较大偏差且判定数据及运算方式存在问题,则节点Ny向初始节点Sr返回新的结果数据,初始节点Sr调用自身的运算合约Cr根据返回的新的结果数据{Data(out,1),...,Data'(out,y)}、与数据调用请求匹配的自身的本地数据Data(in,r)进行运算获得最终的自身结果数据Data(out,r),并计算返回的新的结果数据{Data(out,1),...,Data'(out,y)}、本地数据Data(in,r)、运算合约Cr、自身结果数据Data(out,r)、运算开始时间Time(start,r)和运算结束时间Time(end,r)的共同哈希值H(Data,r)写入初始节点Sr所在区块链:If there is a large deviation in the result data returned by all nodes N x after the comparison and it is determined that there is a problem with the data and the operation method, the node N y returns new result data to the initial node S r , and the initial node S r calls its own operation contract C r According to the returned new result data {Data (out,1) ,...,Data' (out,y) }, and the local data Data (in,r) matching the data call request to obtain the final self Result data Data (out,r) , and calculate the returned new result data {Data (out,1) ,...,Data' (out,y) }, local data Data (in,r) , operation contract C r , self-result data Data (out,r) , operation start time Time (start,r) and operation end time Time (end,r) The common hash value H (Data,r) is written into the area where the initial node S r is located Blockchain:
H(Data,r)=H(Data(in,r),Data(out,1),...,Data'(out,3),...,Data(out,5),Cr,Data(out,r),Time(start,r),Time(end,r))H (Data,r) =H(Data (in,r) ,Data (out,1) ,...,Data' (out,3) ,...,Data (out,5) ,C r ,Data (out,r) ,Time (start,r) ,Time (end,r) )
若对比后所有节点Nx返回的结果数据存在较大偏差但判定数据及运算方式均正确,则初始节点Sr调用自身的运算合约Cr根据返回的结果数据{Data(out,1),...,Data(out,n)}、与数据调用请求匹配的自身的本地数据Data(in,r)进行运算获得最终的自身结果数据Data(out,r),然后计算返回的结果数据{Data(out,1),...,Data(out,n)}、本地数据Data(in,r)、运算合约Cr、自身结果数据Data(out,r)、运算开始时间Time(start,r)和运算结束时间Time(end,r)的共同哈希值H(Data,r)并写入出示节点Sr所在区块链:If there is a large deviation in the result data returned by all nodes N x after comparison, but the data and operation methods are judged to be correct, the initial node S r calls its own operation contract C r according to the returned result data {Data (out,1) ,. ..,Data (out,n) }, and its own local data Data (in,r) matching the data call request to obtain the final self-result data Data (out,r) , and then calculate the returned result data {Data (out,1) ,...,Data (out,n) }, local data Data (in,r) , operation contract C r , own result data Data (out,r) , operation start time Time (start,r ) and the common hash value H (Data,r) of the operation end time Time (end,r ) and write it into the blockchain where the node S r is located:
H(Data,r)=H(Data(in,r),Data(out,1),...,Data(out,n),Cr,Data(out,r),Time(start,r),Time(end,r))H (Data,r) =H(Data (in,r) ,Data (out,1) ,...,Data (out,n) ,C r ,Data (out,r) ,Time (start,r) ,Time (end,r) )
其中,H(·)为安全哈希函数。where H(·) is a secure hash function.
节点Sr将运算的最终结果Data(out,r)返回给用户。The node S r returns the final result of the operation Data (out, r) to the user.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010730721.3A CN111897874B (en) | 2020-07-27 | 2020-07-27 | Data security exchange and operation method based on hybrid chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010730721.3A CN111897874B (en) | 2020-07-27 | 2020-07-27 | Data security exchange and operation method based on hybrid chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111897874A true CN111897874A (en) | 2020-11-06 |
CN111897874B CN111897874B (en) | 2023-10-13 |
Family
ID=73190237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010730721.3A Active CN111897874B (en) | 2020-07-27 | 2020-07-27 | Data security exchange and operation method based on hybrid chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111897874B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107038578A (en) * | 2017-04-19 | 2017-08-11 | 浙江数秦科技有限公司 | Multi-signature exchange information processing method in data trade platform based on block chain |
KR101849912B1 (en) * | 2017-05-25 | 2018-04-19 | 주식회사 코인플러그 | Method for providing certificate service based on smart contract and server using the same |
KR20180041055A (en) * | 2017-09-06 | 2018-04-23 | 주식회사 코인플러그 | Method for providing certificate service based on smart contract and server using the same |
CN108959416A (en) * | 2018-06-08 | 2018-12-07 | 浙江数秦科技有限公司 | A kind of web data automatic evidence-collecting based on block chain and deposit card method |
-
2020
- 2020-07-27 CN CN202010730721.3A patent/CN111897874B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107038578A (en) * | 2017-04-19 | 2017-08-11 | 浙江数秦科技有限公司 | Multi-signature exchange information processing method in data trade platform based on block chain |
KR101849912B1 (en) * | 2017-05-25 | 2018-04-19 | 주식회사 코인플러그 | Method for providing certificate service based on smart contract and server using the same |
KR20180041055A (en) * | 2017-09-06 | 2018-04-23 | 주식회사 코인플러그 | Method for providing certificate service based on smart contract and server using the same |
CN108959416A (en) * | 2018-06-08 | 2018-12-07 | 浙江数秦科技有限公司 | A kind of web data automatic evidence-collecting based on block chain and deposit card method |
Non-Patent Citations (1)
Title |
---|
梁伟等: "基于区块链的可信数据交换技术与应用", 《信息通信技术与政策》, pages 91 - 96 * |
Also Published As
Publication number | Publication date |
---|---|
CN111897874B (en) | 2023-10-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Peng et al. | Vfchain: Enabling verifiable and auditable federated learning via blockchain systems | |
US10868865B2 (en) | System and apparatus to manage data using a peer-to-peer network and the blockchain | |
CN112703499B (en) | Distributed platform for computing and trusted verification | |
CN109003185B (en) | Intelligent contract establishing method and device, computing equipment and storage medium | |
CN109598147B (en) | Data processing method and device based on block chain and electronic equipment | |
CN110599275B (en) | Data processing method, device and storage medium based on blockchain network | |
CN113222601B (en) | System and method for permitting block chain anonymous transaction endorsement | |
CN115082180B (en) | Credit behavior evidence-preserving method and system based on blockchain and federal learning | |
CN113239255B (en) | Heterogeneous data resource sharing method and device, computer equipment and medium | |
CN112738172B (en) | Block chain node management method and device, computer equipment and storage medium | |
CN113987080A (en) | Blockchain incentive method, device and related products based on reputation consensus | |
CN110990879B (en) | Data evidence storing method based on block chain | |
KR20210087552A (en) | Systems and methods for distributed resource allocation | |
CN111368311A (en) | A block chain-based point management method and related device | |
WO2023116790A1 (en) | Method and apparatus for executing computing task, and storage medium and electronic apparatus | |
CN109886712A (en) | Data processing method and device based on block chain | |
CN111897874A (en) | A data security exchange and calculation method based on hybrid chain | |
CN112734420A (en) | Token management method, device, server and storage medium based on big data platform | |
CN111737008B (en) | Resource data processing method, device, computer equipment and storage medium | |
CN111818107B (en) | Network request response method, device, equipment and readable storage medium | |
CN111738855A (en) | A smart contract management method and device | |
CN117220927B (en) | Fuzzy trust management method and device for traffic information sharing based on block chain | |
CN118014624B (en) | Data rights allocation and revenue clearing method, device, electronic equipment and medium | |
CN112199732B (en) | Aviation logistics electronic waybill management method based on blockchain | |
CN115981997A (en) | Test problem processing method and device, electronic equipment and computer readable medium |
Legal Events
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 | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A data security exchange and computation method based on hybrid chain Granted publication date: 20231013 Pledgee: Bank of Beijing Co.,Ltd. Hangzhou Yuhang sub branch Pledgor: ZHEJIANG SHUQIN TECHNOLOGY CO.,LTD. Registration number: Y2024330002485 |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right |