CN113779624A - Private data sharing method based on intelligent contracts - Google Patents

Private data sharing method based on intelligent contracts Download PDF

Info

Publication number
CN113779624A
CN113779624A CN202110997271.9A CN202110997271A CN113779624A CN 113779624 A CN113779624 A CN 113779624A CN 202110997271 A CN202110997271 A CN 202110997271A CN 113779624 A CN113779624 A CN 113779624A
Authority
CN
China
Prior art keywords
data
model
storage
receiving node
intelligent contract
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.)
Pending
Application number
CN202110997271.9A
Other languages
Chinese (zh)
Inventor
张金琳
俞学劢
高航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Shuqin Technology Co Ltd
Original Assignee
Zhejiang Shuqin Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhejiang Shuqin Technology Co Ltd filed Critical Zhejiang Shuqin Technology Co Ltd
Priority to CN202110997271.9A priority Critical patent/CN113779624A/en
Publication of CN113779624A publication Critical patent/CN113779624A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • G06Q20/102Bill distribution or payments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to the technical field of block chains, in particular to a private data sharing method based on an intelligent contract, which comprises the following steps: establishing a data storage node and distributing row numbers for data rows; the data source side generates a data sharing public key and a corresponding data sharing private key, and submits the data public key to the intelligent contract in association with the wallet public key of the data demand side; encrypting the line number by using a data sharing private key to obtain an encrypted line number, and sending the encrypted line number to a data demand side; establishing a model receiving node, and sending the model number, the encryption line number, the wallet public key and a plurality of tokens to an intelligent contract by a data demand party; sending the model number, the line number and the wallet public key to a data storage node; the data storage node substitutes the data line into the data processing model corresponding to the model number; and sending the model result to a data demand side. The substantial effects of the invention are as follows: the diffusion of the private data is effectively avoided, and the privacy of the private data is protected.

Description

Private data sharing method based on intelligent contracts
Technical Field
The invention relates to the technical field of block chains, in particular to a private data sharing method based on an intelligent contract.
Background
New technologies represented by intelligent manufacturing and artificial intelligence are opening new changes and leading global economic development. No matter intelligent manufacturing or artificial intelligence is independent of data analysis, and the big data era has come. The core of artificial intelligence is data, and the support artificial intelligence apart from the data can hardly realize complex functions. However, the data required for artificial intelligence is now scattered across different enterprise and departmental systems. Due to the reasons of privacy protection requirements, competitive relationships and the like, the current data are difficult to share and fuse, and individual data islands are formed. This severely limited the development of artificial intelligence techniques. Therefore, it is necessary to develop a data sharing mechanism to realize data sharing and circulation on the premise of ensuring data privacy. And the development of artificial intelligence technology is promoted. The intelligent contract is a code segment deployed on a blockchain, and can ensure that the code segment can be correctly executed based on the characteristics of non-tampering and collective maintenance of the blockchain.
Chinese patent CN110909073A, published 2020, 3/24/a method for sharing private data based on intelligent contracts, comprising: receiving a first pointer pointing to a data contract from a first providing device, and adding the first pointer to a relationship contract of a first user, wherein the data contract is deployed on a first block chain by the first providing device in response to the added first private data, and the first private data belongs to a first user; in response to the first private data being authorized to be shared with the second providing device, the first pointer is provided to the second providing device to allow the second providing device to access the first private data through the first pointer. The technical scheme realizes data access through the pointer, and although the data has certain confidentiality, the private data can still be completely read, so that the risk of revealing the private data by the second providing device exists.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the technical problem of providing a data sharing function on the premise of lacking effective data privacy protection is solved. The method can effectively avoid the leakage and diffusion of the private data while sharing the data.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows: a private data sharing method based on intelligent contracts comprises the following steps: establishing a data storage node, distributing a row number for a data row by the data storage node, and submitting the row number associated with the data row to the data storage node for storage; the data demand party has a virtual wallet address on the blockchain, and the virtual wallet address is a wallet public key; the data source party generates a data sharing public key and a corresponding data sharing private key for each data demand party, the data public key is associated with the wallet public key of the data demand party and submitted to an intelligent contract, and the data sharing private key is stored by the data source party; the data source side encrypts the line number by using a data sharing private key to obtain an encrypted line number, and sends the encrypted line number to the data demand side; establishing a model receiving node, submitting a data processing model to the model receiving node by a data demander, and returning a model number by the model receiving node; the data demand party sends the model number, the encryption line number, the wallet public key and a plurality of tokens to the intelligent contract; the intelligent contract calls the data processing model from the model receiving node to carry out privacy security check, if the privacy security check is passed, the next step is carried out, and if the privacy security check is not passed, the method is ended; the intelligent contract decrypts the encrypted line number by using the data sharing public key, and if the encrypted line number is successfully decrypted, the model number, the line number and the wallet public key are sent to the data storage node; the data storage node calls a data line corresponding to the line number, substitutes the data line into a data processing model corresponding to the model number, encrypts a model result of the data processing model by using a wallet public key and then sends the encrypted model result to an intelligent contract; the intelligent contract sends the encrypted model result to the data demand side and transfers a plurality of tokens to the virtual account of the data source side.
Preferably, the data storage nodes comprise a receiving node and a plurality of storage nodes; the receiving node receives the data lines and the line numbers submitted by the data source side, and the receiving node sends the data lines to a plurality of storage nodes; the storage node extracts the hash value of each received data line, extracts the hash values of all the data lines received in a period together again to serve as a secondary hash value, uploads the secondary hash value to a block chain through the receiving node, and encrypts and stores the serial number of the associated line of the received data line; the receiving node obtains a data processing model from a model receiving node according to a model number, the receiving node sends the data processing model and a line number to a plurality of storage nodes, the storage nodes fetch and decrypt data lines corresponding to the line number, the receiving node and the storage nodes construct safe multi-party calculation, the data lines are substituted into the data processing model, model result association line numbers are fed back to the receiving node, and after the receiving node receives all fed-back model results, the model results are encrypted by using a wallet public key and then sent to an intelligent contract.
Preferably, the data source side establishes a substitution number table, the value of the non-numerical field is replaced by a corresponding substitution number, the receiving node establishes a plurality of copies for the received data line, the number of the copies is matched with the number of the storage nodes, the actual value of the field of the data line is divided into a plurality of addends, the addends are distributed to the copy storage, and the plurality of copies are distributed to the plurality of storage nodes for storage.
Preferably, the fields of the copies form a field structure, the storage node opens up a storage area for each field structure, a plurality of storage blocks are opened up in the storage area, the size of each storage block is matched with the maximum occupied space of the copy, the storage node stores the number of the associated rows of the copies in the storage blocks, and when the storage blocks in the storage areas are full, new storage areas and storage blocks are opened up for the column structures of the copies.
Preferably, the storage node is provided with a longitudinal displacement sequence for each storage area, the longitudinal displacement sequence records longitudinal offset of each column, the storage blocks in the storage areas have sequence numbers, when a copy is stored, the longitudinal offset corresponding to the column of the copy is obtained, the corresponding column is stored in the storage block corresponding to the longitudinal offset, when the copy is restored, the storage block corresponding to each column is searched downwards according to the longitudinal displacement sequence, the value of each column of the copy is obtained, and the restoration of the copy is completed.
As a substitution scheme, the storage node is provided with a plurality of exchange pairs for each storage area, the storage node additionally stores the latest received copy in a free storage block of the current storage area, checks whether the copy and the previous copy have exchange pairs aligned according to bits, and exchanges the storage positions of the aligned exchange pairs with the content if the copy and the previous copy exist; if the storage area has no idle storage block, storing the copy in the first storage block of the new storage area without checking the exchange pair; when a data line corresponding to the line number is called, the storage node finds a storage block stored by the copy according to the line number; firstly, downwards checking whether an aligned exchange pair exists with a copy of a next storage block, and if so, continuously downwards checking whether the aligned exchange pair exists at the position of the checked exchange pair; if yes, continuing to check whether an aligned exchange pair exists or not at the newly checked exchange pair position until the exchange pair is not checked or the last storage block of the storage area is reached; copying a copy of all the storage blocks which are checked to exist the exchange pairs downwards, and starting from the last storage block, sequentially exchanging and aligning the storage positions of the exchange pairs to restore the copy; after restoration, detecting whether an aligned exchange pair exists with a copy of a previous storage block, and if so, exchanging the storage position of the aligned exchange pair; and finishing restoring the copy in the storage block corresponding to the line number.
Preferably, the receiving node calculates the actual value of the field and the value from the power of 2 to the power of N, and a field from the power of 2 to the power of N is newly established for each numerical field in the copy; splitting the value from the power of 1 to the power of N of the real value of the numerical type field into a plurality of addends respectively, and distributing the addends to a plurality of copies for storage respectively; before the receiving node constructs the safe multi-party calculation, the following steps are executed to the data processing model: extracting a unitary calculation formula which takes a real value as input and can be subjected to Taylor expansion, and expanding the unitary calculation formula into a Taylor expansion formula which is a weighted sum calculation formula of a value from 1 power to N power of the real value; the storage node calls a corresponding copy, the 1 st-power addend to the N-power addend stored in the copy is substituted into the weighting sum calculation formula to obtain an intermediate sum, and the intermediate sum is sent to the receiving node; the receiving node adds the intermediate sums sent by all the storage nodes to obtain an approximate result of substituting the true value into the unitary calculation formula; substituting the approximate result of the unary calculation formula into the data processing model, and constructing a safe multiparty calculation solution for the calculation formula of the non-weighted summation.
Preferably, the receiving node judges an error of an approximate result obtained by the unary calculation formula through calculation by using the taylor expansion formula, if the error exceeds a preset percentage, the approximate result is discarded, the secure multi-party calculation is reestablished to solve the unary calculation formula, and if the error does not exceed the preset percentage, the approximate result is retained; the receiving node executes the following steps to judge the error: the receiving node reversely calculates an approximate true value according to the approximate result and the unitary calculation formula; and multiplying the approximate real value by a coefficient k, wherein k =1+ delta and delta are preset percentages, substituting the approximate real value corrected by using the coefficient k into a unitary calculation formula to obtain a corrected approximate result, and judging that the error exceeds the preset percentages if the difference between the corrected approximate result and the absolute values of the approximate results exceeds the preset percentages.
Preferably, after receiving the data processing model, the model receiving node enumerates the outputs of the data processing model, each output related intermediate result and input field form a sub-model, if the sub-model only contains one input field, the data processing model privacy security check is judged not to pass, the data processing model is rejected to be received, otherwise, the data processing model privacy security check is judged to pass, and the model number is returned.
The substantial effects of the invention are as follows: 1) the private data can be called only by a target data requiring party through sharing the private key encryption line number and combining the verification of an intelligent contract, so that the target data requiring party cannot share the private data in a relay manner, and the diffusion of the private data is effectively avoided; 2) through the data processing model, isolation is established between the data demanding party and the private data, so that the private data does not need to be directly checked when the data demanding party calls the private data, and the privacy of the private data is protected; 3) by the improved secure multiparty computation, the efficiency of the secure multiparty computation is improved.
Drawings
Fig. 1 is a flowchart illustrating a private data sharing method according to an embodiment.
FIG. 2 is a schematic diagram of a data storage process according to an embodiment.
FIG. 3 is a diagram illustrating a field structure according to an embodiment.
FIG. 4 is a diagram illustrating a memory block according to an embodiment.
FIG. 5 is a diagram illustrating an implementation of a second data processing model according to an embodiment.
FIG. 6 is a diagram illustrating an error determination method according to the second embodiment.
FIG. 7 is a diagram of a second submodel according to an embodiment.
Wherein: 10. field structure, 21, line number, 31, storage area, 32, storage block, 40, sub-model.
Detailed Description
The following provides a more detailed description of the present invention, with reference to the accompanying drawings.
The first embodiment is as follows:
referring to fig. 1, a method for sharing private data based on an intelligent contract, in this embodiment, includes:
step A01), establishing a data storage node, distributing a row number 21 for a data row by the data storage node, and submitting the row number 21 associated with the data row to the data storage node for storage;
step A02) the data demand party has a virtual wallet address on the blockchain, and the virtual wallet address is a wallet public key;
step A03) the data source side generates a data sharing public key and a corresponding data sharing private key for each data demand side, the data public key is associated with the wallet public key of the data demand side and submitted to an intelligent contract, and the data sharing private key is stored by the data source side;
step A04) the data source side encrypts the line number 21 by using a data sharing private key to obtain an encrypted line number 21, and sends the encrypted line number 21 to the data demand side;
step A05), establishing a model receiving node, submitting a data processing model to the model receiving node by a data demander, and returning a model number by the model receiving node;
step A06) the data demander sends the model number, the encryption line number 21, the wallet public key and a plurality of tokens to the intelligent contract;
step A07) the intelligent contract calls the data processing model to the model receiving node for privacy security check, if the privacy security check is passed, the next step is carried out, and if the privacy security check is not passed, the method is ended;
step A08) the intelligent contract uses the data sharing public key to decrypt the encrypted line number 21, and if the decryption is successful, the model number, the line number 21 and the wallet public key are sent to the data storage node;
step A09) the data storage node calls the data line corresponding to the line number 21, substitutes the data line into the data processing model corresponding to the model number, encrypts the model result of the data processing model by using the wallet public key and then sends the encrypted model result to the intelligent contract;
step a 10) the smart contract sends the encrypted model results to the data demander and transfers tokens to the virtual account of the data source. The data processing model is a combination of a series of operations for logical judgment or numerical transport of data rows. For example, a bank credit card user loss early warning model reads credit card swiping data of a user bank, user credit card shopping data shared by an e-commerce platform and user academic information, performs logical judgment and numerical calculation processes on the data and the information, and outputs a user loss early warning result. And arranging a customer manager to perform targeted contact processing according to the user loss early warning result of 1. If the consumption amount paid by the credit card is extracted from the credit card shopping data of the user, if the consumption amount paid by the credit card exceeds the credit card swiping expense amount of the bank of the user by a certain preset proportion and the duration time exceeds a threshold value, outputting a user loss early warning result as 1, wherein the academic history influences the value of the preset proportion, and the higher the academic history is, the higher the preset proportion is, the more easily the highly learnable people can obtain the credit cards of a plurality of banks, and in flexible use, the fluctuation of the credit card spending amount of the bank is more frequent and normal, so that early warning is performed by using a wider threshold value.
Referring to fig. 2, a method for storing a data line in a data storage node includes: step B01) the data storage nodes comprise a receiving node and a plurality of storage nodes; step B02) the receiving node receives the data line and the line number 21 submitted by the data source side, and the receiving node sends the data line to a plurality of storage nodes; step B03) the storage node extracts the hash value of each received data line, and extracts the hash value of all the data lines received in the period together as a secondary hash value; step B04) uploading the secondary hash value to a block chain through a receiving node, and encrypting and storing the received data row association line number 21 by a storage node; step B05) the receiving node obtains the data processing model from the model receiving node according to the model number, and the receiving node sends the data processing model and the line number 21 to a plurality of storage nodes; step B06) the storage node calls and decrypts the data line corresponding to the line number 21; step B07) the receiving node and a plurality of storage nodes construct safe multi-party calculation, the data lines are substituted into the data processing model, and the model result association line number 21 is fed back to the receiving node; step B08), after receiving all the fed back model results, the receiving node encrypts the model results by using the wallet public key and sends the encrypted model results to the intelligent contract.
The data source side establishes a substitution number table, and replaces the value of the non-numerical field with a corresponding substitution number, as shown in table 1, for the substitution number table used in this embodiment, the non-numerical field study is converted into a substitution number, the substitution number is used for performing, the receiving node establishes a plurality of copies for the received data line, the number of copies is matched with the number of storage nodes, the actual value of the field of the data line is split into a plurality of addends, the addends are allocated to copy storage, and the plurality of copies are allocated to a plurality of storage nodes for storage.
Table 1 alternative number table used in this embodiment
Study calendar Number of substitutions
High school and below 1
Special section 2
This section 3
Master student 4
Doctor researcher 5
The field composition of the copies forms a field structure 10, the field structure 10 is shown in fig. 3, a storage node opens up a storage area 31 for each field structure 10, a plurality of storage blocks 32 are opened up in the storage area 31, the size of each storage block 32 is matched with the maximum occupied space of the copy, the storage node stores the copy associated row number 21 in the storage block 32, and when the storage block 32 in the storage area 31 is full, a new storage area 31 and a new storage block 32 are opened up for the column structure of the copy.
Referring to fig. 4, the storage node sets a longitudinal shift sequence for each storage area 31, the longitudinal shift sequence records a longitudinal offset of each column, the storage blocks 32 in the storage area 31 have sequential numbers, when a copy is stored, the longitudinal offset corresponding to the column of the copy is obtained, the corresponding column is stored in the storage block 32 corresponding to the longitudinal offset, when the copy is restored, the storage block 32 corresponding to each column is searched downwards according to the longitudinal shift sequence, the value of each column of the copy is obtained, and the restoration of the copy is completed. The use of longitudinal displacement sequences can improve the security of data storage.
As an alternative to the longitudinal displacement sequence, a storage node sets a plurality of exchange pairs for each storage area 31, the storage node additionally stores the latest received copy in an idle storage block 32 of the current storage area 31, checks whether a bit-aligned exchange pair exists between the copy and the previous copy, and exchanges the storage positions of the aligned exchange pairs with the content if the bit-aligned exchange pair exists; if the storage area 31 has no free storage block 32, storing the copy in the first storage block 32 of the new storage area 31, and not checking the swap pair; when a data line corresponding to the line number 21 is called, the storage node finds a storage block 32 stored in a copy according to the line number 21; firstly, checking whether an aligned exchange pair exists with the copy of the next storage block 32 or not downwards, and if so, continuing to check whether the aligned exchange pair exists or not at the position of the checked exchange pair; if yes, continuing to check whether an aligned swap pair exists at the newly checked swap pair position, until no swap pair is checked or the last memory block 32 of the memory area 31 is reached; copying a copy of all the storage blocks 32 which are checked to exist the exchange pairs downwards, and starting from the last storage block 32, sequentially exchanging and aligning the storage positions of the exchange pairs to restore the copy; after restoration, detecting whether an aligned exchange pair exists with the copy of the previous storage block 32, and if so, exchanging the storage position of the aligned exchange pair; the restoration of the copy in the memory block 32 corresponding to the line number 21 is completed.
TABLE 2 exchange pair table
Storage area 31 numbering Exchange pair A Exchange pair B
9AD 100011 101000
9AE 101011 101110
9AE 000111 101010
The storage node establishes an exchange pair table, the storage node associates a plurality of exchange pairs for each storage area 31, the exchange pair table records the line number 21 and the exchange pair of the storage area 31, and the storage area 31 associates a plurality of exchange pairs, so that a plurality of records are established in the exchange pair table. As shown in table 2, the swap pair used in the storage area 31 corresponding to each number is described as a swap pair table. The exchange pair A and the exchange pair B form a pair of exchange contents, and the exchange pair A and the exchange pair B have no exchange sequence constraint. That is, the last copy contains exchange pair a, and the aligned bit value of the next copy is exactly exchange pair B, then the two are exchanged. If the last copy contains the exchange pair B, the aligned bit value of the next copy is just the exchange pair A, and the two are also exchanged. As shown in table 2, are several copies stored within storage area 319 AE. Memory area 319AE uses a total of two swap pairs, "101011" - "101110" and "000111" - "101010". As can be seen in table 3, there are three, in total, exchange pairs in line number 21 that are aligned between the three copies of B36a55DE, B36a55DF, and B36a55E0, respectively, i.e., underlined. The results of exchanging the values of the three parts are shown in table 4, and the contents of each copy will be destroyed after exchanging, and the correct result cannot be decrypted even if the decryption key is obtained in time. So that the real data is hidden. An attacker needs to obtain the exchange pair table to recover the data. In the embodiment, the exchange pair table is encrypted and stored by the public key of the storage node, and when the exchange pair table needs to be used, the exchange pair table is decrypted by the private key and is placed in the memory, and the exchange pair table is destroyed after being used.
Table 3 line number 21 and copy stored in memory area 9AE
Line number 21 Copies of
B36A55DE 101011010…0101010100…1101010100111001
B36A55DF 101110000…0000111010…0100101011110111
B36A55E0 101010100…0110111111…1001101110101010
B36A56D7 101100100…0010000110…1100001100001111
Table 4 results of memory area 9AE over swap vs swap
Line number 21 Copies of
B36A55DE 101110010…0000111100…1101010100111001
B36A55DF 101011000…0101010010…0100101110110111
B36A55E0 101010100…0110111111…1001101011101010
B36A56D7 101100100…0010000110…1100001100001111
The beneficial technical effects of this embodiment are: the private key is shared by the encryption line number 21, verification is performed by combining an intelligent contract, so that only a target data requiring party can call the private data, the target data requiring party cannot share the private data in a relay mode, and diffusion of the private data is effectively avoided. Through the data processing model, isolation is established between the data demand party and the private data, so that the private data does not need to be directly checked when the data demand party calls the private data, and the privacy of the private data is protected.
Example two:
the embodiment specifically improves an execution method of a data processing model on the basis of the first embodiment. Referring to fig. 5, the embodiment includes: step C01), the receiving node calculates the actual value of the field and the value from the power of 2 to the power of N, and a field from the power of 2 to the power of N is newly established for each numerical field in the copy; step C02) splitting the values of the power from 1 to the power N of the real value of the numerical type field into a plurality of addends respectively, and distributing the addends to a plurality of copies for storage respectively; before the receiving node constructs the safe multi-party calculation, the following steps are executed to the data processing model: step C03), extracting a unitary calculation formula which takes the real value as input and can be subjected to Taylor expansion, and expanding the unitary calculation formula into the Taylor expansion formula which is a weighted sum calculation formula of the value from the power of 1 to the power of N of the real value; step C04) the storage node calls the corresponding copy, the 1 st power to N th power addends saved in the copy are substituted into the weighting sum calculation formula to obtain the intermediate sum, and the intermediate sum is sent to the receiving node; step C05), the receiving node adds the intermediate sums sent by all the storage nodes, namely, the approximate result of substituting the true value into the unary calculation formula is obtained; and step C06) substituting the approximate result of the unary calculation formula into the data processing model, and constructing a safe multiparty calculation solution for the calculation formula of the non-weighted summation.
As the taylor expansion of an exponential function with a natural number as the base: e x =1+ x + x 2/2! + x 3/3! + … + x ^ N/N! + O (x ^ N), ignoring the last term, when the value of N is large enough, the error will suffice for the value of the exponential function obtained using the expansion calculation. The function ln (1+ x) is also a weighted sum of x to the power of 1 to N after taylor expansion. In this embodiment, when x is equal to the ratio of the payment amount of the credit card of the bank to the total consumption amount, the function ln (1+ x) is characterized in that the more x is close to 1, the less obvious the change of the function value is, and the more close to 0, the more significant the change of the function value is, so as to improve the sensitivity of the data processing model to the change when the value of x is small, that is, improve the sensitivity of the data processing model when the payment amount of the credit card of the bank accounts for the lower consumption amount. The method provided by the embodiment can be adopted for calculation. Secure multiparty computing, while capable of protecting data privacy, is relatively inefficient.
And the receiving node judges the error of the approximate result obtained by the unitary calculation formula through the Taylor expansion formula, if the error exceeds the preset percentage, the approximate result is discarded, the safe multiparty calculation solving unitary calculation formula is reestablished, and if the error does not exceed the preset percentage, the approximate result is retained. Referring to fig. 6, the receiving node performs the following steps to determine an error: step D01), the receiving node reversely calculates an approximate true value according to the approximate result and the unary calculation formula; step D02) multiplying the approximated true value by a factor k, k =1+ Δ, Δ being a preset percentage; step D03) substituting the approximate true value corrected by using the coefficient k into a unitary calculation formula to obtain a corrected approximate result; step D04) if the difference between the absolute value of the corrected approximate result and the absolute value of the approximate result exceeds the preset percentage, the error is judged to exceed the preset percentage.
After receiving the data processing model, the model receiving node lists the outputs of the data processing model, and the intermediate result and the input field related to each output form a sub-model 40, see fig. 7, which is a schematic diagram of the sub-model 40. If the sub-model 40 only contains one input field, the data processing model privacy security check is judged not to pass, and the data processing model is refused to be received, otherwise, the data processing model privacy security check is judged to pass, and the model number is returned. The rest steps are the same as the first embodiment. The output of a single input field may cause leakage of data. The embodiment improves the execution efficiency of the data processing model by specifically improving the secure multi-party calculation.
The above embodiment is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, and other variations and modifications may be made without departing from the technical scope of the claims.

Claims (8)

1. A private data sharing method based on intelligent contracts is characterized in that,
the method comprises the following steps:
establishing a data storage node, distributing a row number for a data row by the data storage node, and submitting the row number associated with the data row to the data storage node for storage;
the data demand party has a virtual wallet address on the blockchain, and the virtual wallet address is a wallet public key;
the data source party generates a data sharing public key and a corresponding data sharing private key for each data demand party, the data public key is associated with the wallet public key of the data demand party and submitted to an intelligent contract, and the data sharing private key is stored by the data source party;
the data source side encrypts the line number by using a data sharing private key to obtain an encrypted line number, and sends the encrypted line number to the data demand side;
establishing a model receiving node, submitting a data processing model to the model receiving node by a data demander, and returning a model number by the model receiving node;
the data demand party sends the model number, the encryption line number, the wallet public key and a plurality of tokens to the intelligent contract;
the intelligent contract calls the data processing model from the model receiving node to carry out privacy security check, if the privacy security check is passed, the next step is carried out, and if the privacy security check is not passed, the method is ended;
the intelligent contract decrypts the encrypted line number by using the data sharing public key, and if the encrypted line number is successfully decrypted, the model number, the line number and the wallet public key are sent to the data storage node;
the data storage node calls a data line corresponding to the line number, substitutes the data line into a data processing model corresponding to the model number, encrypts a model result of the data processing model by using a wallet public key and then sends the encrypted model result to an intelligent contract;
the intelligent contract sends the encrypted model result to the data demand side and transfers a plurality of tokens to the virtual account of the data source side.
2. The method of claim 1, wherein the privacy data sharing method based on the intelligent contract,
the data storage nodes comprise receiving nodes and a plurality of storage nodes;
the receiving node receives the data lines and the line numbers submitted by the data source side, and the receiving node sends the data lines to a plurality of storage nodes;
the storage node extracts the hash value of each received data line, extracts the hash values of all the data lines received in a period together again to serve as a secondary hash value, uploads the secondary hash value to a block chain through the receiving node, and encrypts and stores the serial number of the associated line of the received data line;
the receiving node obtains a data processing model from a model receiving node according to a model number, the receiving node sends the data processing model and a line number to a plurality of storage nodes, the storage nodes fetch and decrypt data lines corresponding to the line number, the receiving node and the storage nodes construct safe multi-party calculation, the data lines are substituted into the data processing model, model result association line numbers are fed back to the receiving node, and after the receiving node receives all fed-back model results, the model results are encrypted by using a wallet public key and then sent to an intelligent contract.
3. The method of claim 2, wherein the privacy data sharing method based on the intelligent contract,
the data source side establishes a substitution number table, values of non-numerical fields are replaced by corresponding substitution numbers, the receiving node establishes a plurality of copies for received data lines, the number of the copies is matched with the number of the storage nodes, actual values of the fields of the data lines are divided into a plurality of addends, the addends are distributed to the copy storage, and the plurality of copies are distributed to a plurality of storage nodes for storage.
4. The method of claim 3, wherein the privacy data sharing method based on the intelligent contract,
the storage nodes store the serial numbers of the associated rows of the copies in the storage blocks, and when the storage blocks in the storage blocks are full, new storage areas and storage blocks are opened up for the column structures of the copies.
5. The method of claim 4, wherein the privacy data sharing method based on the intelligent contract,
the storage nodes are provided with longitudinal displacement sequences for each storage area, the longitudinal displacement sequences record longitudinal offset of each column, storage blocks in the storage areas are sequentially numbered, when the copies are stored, the longitudinal offset corresponding to the columns of the copies is obtained, the corresponding columns are stored in the storage blocks corresponding to the longitudinal offset, when the copies are restored, the storage blocks corresponding to each column are searched downwards according to the longitudinal displacement sequences, the value of each column of the copies is obtained, and the restoration of the copies is completed.
6. The method for sharing private data based on smart contracts according to any one of claims 3 to 5,
the receiving node calculates the actual value of the field and the values from the power of 2 to the power of N, and newly establishes fields from the power of 2 to the power of N for each numerical field in the copy;
splitting the value from the power of 1 to the power of N of the real value of the numerical type field into a plurality of addends respectively, and distributing the addends to a plurality of copies for storage respectively;
before the receiving node constructs the safe multi-party calculation, the following steps are executed to the data processing model:
extracting a unitary calculation formula which takes a real value as input and can be subjected to Taylor expansion, and expanding the unitary calculation formula into a Taylor expansion formula which is a weighted sum calculation formula of a value from 1 power to N power of the real value;
the storage node calls a corresponding copy, the 1 st-power addend to the N-power addend stored in the copy is substituted into the weighting sum calculation formula to obtain an intermediate sum, and the intermediate sum is sent to the receiving node;
the receiving node adds the intermediate sums sent by all the storage nodes to obtain an approximate result of substituting the true value into the unitary calculation formula;
substituting the approximate result of the unary calculation formula into the data processing model, and constructing a safe multiparty calculation solution for the calculation formula of the non-weighted summation.
7. The method of claim 6, wherein the privacy data sharing method based on the intelligent contract,
the receiving node judges the error of the approximate result obtained by the unitary calculation formula through the Taylor expansion, if the error exceeds a preset percentage, the approximate result is discarded, the secure multi-party calculation is reestablished to solve the unitary calculation formula, and if the error does not exceed the preset percentage, the approximate result is reserved;
the receiving node executes the following steps to judge the error:
the receiving node reversely calculates an approximate true value according to the approximate result and the unitary calculation formula;
and multiplying the approximate real value by a coefficient k, wherein k =1+ delta and delta are preset percentages, substituting the approximate real value corrected by using the coefficient k into a unitary calculation formula to obtain a corrected approximate result, and judging that the error exceeds the preset percentages if the difference between the corrected approximate result and the absolute values of the approximate results exceeds the preset percentages.
8. The method for sharing private data based on smart contracts according to any one of claims 1 to 5,
and after receiving the data processing model, the model receiving node lists the output of the data processing model, an intermediate result and an input field related to each output form a sub-model, if the sub-model only comprises one input field, the data processing model privacy security check is judged not to pass, the data processing model is rejected to be received, otherwise, the data processing model privacy security check is judged to pass, and the model number is returned.
CN202110997271.9A 2021-08-27 2021-08-27 Private data sharing method based on intelligent contracts Pending CN113779624A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110997271.9A CN113779624A (en) 2021-08-27 2021-08-27 Private data sharing method based on intelligent contracts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110997271.9A CN113779624A (en) 2021-08-27 2021-08-27 Private data sharing method based on intelligent contracts

Publications (1)

Publication Number Publication Date
CN113779624A true CN113779624A (en) 2021-12-10

Family

ID=78839733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110997271.9A Pending CN113779624A (en) 2021-08-27 2021-08-27 Private data sharing method based on intelligent contracts

Country Status (1)

Country Link
CN (1) CN113779624A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114092122A (en) * 2022-01-19 2022-02-25 浙江数秦科技有限公司 Carbon emission right transaction system and method based on intelligent contract
WO2023185052A1 (en) * 2022-03-30 2023-10-05 蚂蚁区块链科技(上海)有限公司 Smart contract-based calculation, update and read method and apparatus, and electronic device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114092122A (en) * 2022-01-19 2022-02-25 浙江数秦科技有限公司 Carbon emission right transaction system and method based on intelligent contract
CN114092122B (en) * 2022-01-19 2022-04-22 浙江数秦科技有限公司 Carbon emission right transaction system and method based on intelligent contract
WO2023185052A1 (en) * 2022-03-30 2023-10-05 蚂蚁区块链科技(上海)有限公司 Smart contract-based calculation, update and read method and apparatus, and electronic device

Similar Documents

Publication Publication Date Title
US11388009B2 (en) Token management system and token management method
EP3576033B1 (en) Secure transaction method based on block chain, electronic device, system, and storage medium
KR102208891B1 (en) Encrypted transaction information recovery from blockchain confidential transactions
CN110582793B (en) Anonymity and traceability of digital property transactions on a distributed transaction consensus network
CN107846278B (en) Intelligent contract processing method and device
CN109544331B (en) Supply chain financial application method and device based on block chain, terminal equipment and storage medium
CN108519981B (en) Cross-chain intelligent contract cooperation possibility evaluation method
CN113779624A (en) Private data sharing method based on intelligent contracts
CN101241527A (en) System and method for ordinary authentication
CN109670826B (en) Anti-quantum computation block chain transaction method based on asymmetric key pool
CN101218609B (en) Portable data carrier featuring secure data processing
CN112995221B (en) Safe multi-party calculation method for alliance chain
CN110225000A (en) A kind of data processing and Transmission system based on block chain technology
CN113420335B (en) Block chain-based federal learning system
CN113886867A (en) Loan credit granting system based on multi-source data fusion
CN110162570A (en) The gradation acquisition methods and device of block chain data
CN108876605A (en) Digital asset method of commerce and device
CN109272311A (en) A kind of across chain flogic system based on digital wallet
Verma et al. Blockchain: An analysis on next-generation internet
Drusinsky On the high-energy consumption of bitcoin mining
CN113779622B (en) Safety data fusion system suitable for multiple application scenes
US20200175562A1 (en) Gem trade and exchange system and previous-block verification method for block chain transactions
CN112419060B (en) Asset hosting system, asset management method, node and medium
CN114547684A (en) Method and device for protecting multi-party joint training tree model of private data
KR20220056574A (en) A method and an apparatus for master key management based on sharing algorithms for block chain transactions

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20211210

WD01 Invention patent application deemed withdrawn after publication