Privacy data transaction method, system, computer device and storage medium
Through smart contracts, the target computing nodes under the chain are determined for data processing, which solves the problems of excessive consumption of blockchain storage resources and low processing efficiency, and achieves data privacy protection and security improvement.
Patent Information
- Application Number
- CN202111627562.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the existing technology, data storage and calculation are all performed in the blockchain, resulting in excessive consumption of blockchain storage resources, low business processing efficiency, and lack of effective solutions.
The target computing node under the chain is determined through smart contracts. The node is configured with a trusted execution environment. The data demander obtains transaction data from the data provider and stores it encrypted. The target computing node performs data processing locally and returns the results to the data demander. , avoid storing and calculating transaction data on the blockchain.
It saves on-chain storage resources of the blockchain, improves the processing efficiency of the blockchain, protects the data privacy of the data provider, and enhances data security.
Smart Images

Figure CN114301675B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a privacy data transaction method, system, computer device and storage medium. Background Art
[0002] With the rapid development of computer technology and Internet technology, blockchain technology has gradually emerged, and blockchain networks have been increasingly widely used in finance and other fields. Based on blockchain, data privacy can be protected during data circulation to ensure data security.
[0003] In traditional technology, data is usually stored in smart contracts on the blockchain after being encrypted, and calculations on the data are also performed on the blockchain. However, for larger data sets, the above method will consume a large amount of on-chain storage resources, thereby reducing the business processing efficiency of the blockchain itself.
[0004] In the above method, data storage and calculation are all carried out in the blockchain transaction, resulting in excessive consumption of blockchain storage resources and low efficiency of blockchain business processing. No effective solution has been proposed yet. Summary of the invention
[0005] Based on this, it is necessary to provide a privacy data transaction method, system, computer device and computer-readable storage medium that can save on-chain storage resources to address the above technical problems.
[0006] In a first aspect, the present application provides a privacy data transaction method, the method comprising:
[0007] The data demander determines the target computing node under the chain through a smart contract, wherein the target computing node is configured with a trusted execution environment;
[0008] The target computing node obtains transaction data from the data provider, wherein the transaction data is determined by the data demander according to the data information stored in the smart contract, and the transaction data is encrypted and stored locally at the data provider;
[0009] The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander.
[0010] In one embodiment, the target computing node obtains transaction data from the data provider including:
[0011] The target computing node initiates a data acquisition request to the data provider according to the data computing request of the data demander;
[0012] After receiving the data acquisition request, the data provider verifies the binding relationship between the computing task corresponding to the data acquisition request and the transaction data;
[0013] When the verification is passed, the data provider encrypts the transaction data by using the public key of the target computing node, and sends the encrypted transaction data to the target computing node.
[0014] In one embodiment, the target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processed result to the data demander, including:
[0015] The target computing node decrypts the encrypted transaction data, processes the decrypted transaction data according to the computing logic, and stores the processing result locally;
[0016] After receiving the processing result request from the data demander, the target computing node encrypts the processing result according to the public key of the data demander, and returns the encrypted processing result to the data demander.
[0017] In one embodiment, before the data demander determines the target computing node off-chain through a smart contract, the method includes:
[0018] The smart contract verifies the assets of the data demander;
[0019] If the verification is successful, the smart contract generates a transaction identifier corresponding to at least one of the transaction data.
[0020] In one embodiment, the data demander determines the target computing node off-chain through the smart contract, including:
[0021] The smart contract verifies the identity of the data demander according to the transaction identifier. If the verification is successful, the data demander selects an initial target computing node from multiple idle computing nodes in the smart contract.
[0022] The data demander binds the initial target computing node to a task identifier of a computing task, wherein the computing task is created by the data demander through the smart contract, and the task identifier is generated according to the task information of the computing task;
[0023] When the smart contract passes the verification of the current computing power of the initial target computing node, it is considered that the initial target computing node is successfully bound to the task identifier, and the initial target computing node is the final target computing node.
[0024] In one embodiment, before the target computing node processes the transaction data according to the computing logic provided by the data demander, the method includes:
[0025] The data demander obtains the public key and location information of the target computing node through the smart contract;
[0026] The data demander encrypts the computing logic by using the public key of the target computing node, and transmits the task identifier corresponding to the transaction data and the encrypted computing logic to the target computing node according to the location information;
[0027] The target computing node verifies the computing task corresponding to the transaction data according to the task identifier in the smart contract and the assets of the data demander.
[0028] In one embodiment, before the data demander determines the target computing node off-chain through the smart contract, the method further includes:
[0029] The target computing node configured with a trusted execution environment and / or the data provider configured with a trusted execution environment are registered in the smart contract.
[0030] In a second aspect, the present application further provides a privacy data transaction system, the system comprising a data provider and a target computing node:
[0031] The data demander determines the target computing node under the chain through a smart contract, wherein the target computing node is configured with a trusted execution environment;
[0032] The target computing node obtains transaction data from the data provider, wherein the transaction data is determined by the data demander according to the data information stored in the smart contract, and the transaction data is encrypted and stored locally at the data provider;
[0033] The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander.
[0034] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the privacy data transaction method described in any one of the first aspects are implemented.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the privacy data transaction method described in any one of the first aspects are implemented.
[0036] The above-mentioned privacy data transaction method, system, computer equipment, and storage medium store transaction data locally on the data demander, and only store data information of the transaction data in the smart contract. During the transaction process, the target computing node under the chain obtains transaction data directly from the data provider without going through the blockchain. Therefore, there is no need to store transaction data or perform data calculation in the blockchain, thereby solving the problem in related technologies that data storage and calculation are both performed in the blockchain, which may lead to low blockchain processing efficiency. While saving the on-chain storage space of the blockchain, it protects the data privacy of the data provider and improves data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A diagram of an application environment of a privacy data transaction method in an embodiment;
[0038] Figure 2 is a flow chart of a privacy data transaction method in an embodiment;
[0039] Figure 3 is a flow chart of a transaction data acquisition method in an embodiment;
[0040] Figure 4 is a flowchart of a method for determining a target computing node in an embodiment;
[0041] Figure 5 A flowchart of a TEE node registration method in one embodiment;
[0042] Figure 6 is a structural block diagram of a privacy data transaction system in one embodiment;
[0043] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The privacy data transaction method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Figure 1As shown, it is a privacy data transaction system, in which the blockchain layer 11 includes multiple blockchain nodes, and is configured with smart contracts to manage each blockchain node, and the off-chain privacy computing layer 12 includes multiple TEE nodes, in which the TEE node is a node configured with a trusted execution environment (Trusted Execution Environment, referred to as TEE), which can be a computing node or a node of a data provider. Network communication can be carried out between different TEE nodes, and the smart contract of the blockchain layer 11 can be accessed inside the TEE node. The system ensures the credibility of TEE nodes, data transaction processes and data computing processes through blockchain, and provides the functions of TEE node access management, data transaction authorization management, and privacy computing task management through smart contracts. Preferably, TEE uses trusted hardware as a carrier to provide hardware-level strong security isolation and a general computing environment. Data is only decrypted and calculated in the isolated security zone "enclave". Any other method cannot access the plaintext content of the data, and the data will be automatically encrypted before leaving the "enclave". Specifically, privacy data trading refers to the data trading process that is achieved without exposing the data of the data provider and the needs of the data demander.
[0046] In one embodiment, Figure 2 is a flow chart of a privacy data transaction method in an embodiment. Figure 2 As shown, this method is applied to Figure 1 The privacy data transaction system in the example is used to illustrate, which includes the following steps:
[0047] In step S202, the data demander determines the target computing node under the chain through a smart contract, wherein the target computing node is configured with a trusted execution environment.
[0048] It is understandable that the data demander is the party that needs to use the data of other parties to realize its own computing needs. Usually, the data demander can access the smart contract of the blockchain layer through the Software Development Kit (SDK) or the software client. Furthermore, the data demander itself can provide the computing node in the TEE environment to realize the calculation of private data, or it can realize data processing through the computing node in the TEE environment provided by a third party.
[0049] The third party is the computing power provider, which is a computing node in a TEE environment. The computing node needs to register its node information in the smart contract and be verified before it can be added to the privacy data trading system. The computing node can receive encrypted data and computing logic, decrypt the data in the TEE environment, perform calculations according to the computing logic, and then return the data processing results to the data demander. At the same time, a certain fee is charged to the data demander based on the size of the data and the complexity of the computing logic.
[0050] Usually, there are multiple computing nodes in the privacy data transaction system. Therefore, in the process of data transaction, the data demander needs to select one of the computing nodes as the target computing node to realize the calculation of transaction data. Specifically, when each computing node is registered to the smart contract, it will store its node information on the smart contract. Therefore, the data demander can arbitrarily select a computing node as the target computing node, or select a suitable target computing node according to its own needs.
[0051] The trusted execution environment in this embodiment can be a secure operating environment for data processing. The trusted execution environment can be implemented by a program written in a predetermined programming language, that is, it can be implemented in the form of software, or it can be implemented by designated physical components and written programs, that is, it can be implemented in the form of hardware + software.
[0052] In step S204, the target computing node obtains transaction data from the data provider, wherein the transaction data is determined by the data demander based on the data information stored in the smart contract, and the transaction data is encrypted and stored locally in the data provider.
[0053] Since all data is encrypted and stored off-chain, the target computing node needs to directly initiate a request to the data provider when calculating the transaction data, and the data provider will send the transaction data to the target computing node. The data provider is the party that provides the data and can encrypt the data according to its own public key. The data provider itself is a TEE node and needs to be registered in the smart contract.
[0054] Specifically, the data information stored in the smart contract is used to indicate data characteristics, such as data identification, data type, data source, data address, data size, data price, and node identification of the TEE node storing the data, etc., where the data identification is a unique identification corresponding to the data. The data demander can select the required data for transaction based on the data information in the smart contract. Among multiple data, the selected data is the transaction data. Usually, the data demander will select multiple data for transaction, and the multiple data can come from the same data provider or different data providers.
[0055] Step S206: The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processed result to the data demander.
[0056] The calculation logic is the calculation method for transaction data that the data demander needs to implement. It can be statistical operations, such as statistical sum, median, average, etc., or various model operations. It should be noted that all calculation processes are performed in the target computing node, and the data demander can only obtain the calculation results, such as the calculated sum, median, average, or trained model.
[0057] It should be noted that the data demander, data provider and target computing node of the present application may be a server or various terminal devices.
[0058] In the above-mentioned privacy data transaction method, the transaction data is stored locally on the data demander, and only the data information of the transaction data is stored in the smart contract. During the transaction process, the target computing node under the chain directly obtains the transaction data from the data provider without going through the blockchain. Therefore, there is no need to store transaction data or perform data calculations in the blockchain, which reduces the load of the blockchain, improves the performance of the blockchain, and ensures the available storage space on the blockchain, thereby solving the problem in related technologies that the storage and calculation of data are both carried out in the blockchain, resulting in excessive consumption of blockchain storage resources and low blockchain business processing efficiency. While saving the on-chain storage space of the blockchain, it protects the data privacy of the data provider and improves data security.
[0059] On the other hand, the processing of transaction data can be implemented by a third party through computing nodes, and the security of the computing process can be guaranteed, so the privacy computing capabilities of the privacy data trading system are elastic and scalable.
[0060] In one embodiment, Figure 3 is a flow chart of a method for acquiring transaction data in an embodiment. Figure 3 As shown, the method comprises the following steps:
[0061] Step S302: The target computing node initiates a data acquisition request to the data provider according to the data computing request of the data demander.
[0062] Normally, the target computing node needs to start acquiring transaction data only after receiving a data computing request to avoid computing errors.
[0063] Step S304: after receiving the data acquisition request, the data provider verifies the binding relationship between the computing task corresponding to the data acquisition request and the transaction data.
[0064] After receiving the data acquisition request from the target computing node, the data provider needs to first perform binding verification on the transaction data that the target computing node wants to obtain and the computing task on the smart contract to confirm that the transaction data requested by the target computing node corresponds to the data in the computing task.
[0065] Specifically, after the data demander determines the transaction data, one or more computing tasks corresponding to the private data transaction are established through a smart contract, and the computing task corresponds to a unique task identifier, which is used to distinguish the tasks of different data demanders and different computing tasks of the same data demander. The task identifier will be stored in the smart contract and bound to the transaction data corresponding to the computing task. The data provider can access the smart contract to obtain the task identifier, and verify with the smart contract through the task identifier whether the transaction has been bound to the transaction data requested by the target computing node. Preferably, a private data transaction between a data demander and a data provider can be bound to multiple computing tasks, and a computing task can be bound to multiple transaction data. Therefore, a task identifier may correspond to multiple transaction data. During verification, each transaction data needs to be verified.
[0066] Step S306: When the verification is successful, the data provider encrypts the transaction data using the public key of the target computing node and sends the encrypted transaction data to the target computing node.
[0067] If the verification is successful, it means that there is a corresponding relationship between the task identifier and the transaction data. At this time, the data provider obtains the public key of the target computing node through the smart contract, encrypts the transaction data according to the public key of the target computing node, and sends it to the target computing node to improve the security of the transaction data.
[0068] In this embodiment, after receiving the data acquisition request, the data provider starts to verify the binding relationship between the task identifier and the transaction data, and encrypts the transaction data during the transmission process to ensure the security of the transaction data transmission.
[0069] In one of the embodiments, during the data transaction process, when the data demander provides the computing logic, it is necessary to first use the public key of the target computing node to encrypt the computing logic. Similarly, the data provider also needs to encrypt the transaction data according to the public key of the target computing node. Therefore, when the target computing node processes the transaction data according to the computing logic provided by the data demander, it is necessary to first decrypt the encrypted transaction data. Specifically, after the target computing node receives all the encrypted transaction data, it uses the private key of the target computing node to decrypt all the transaction data, and at the same time uses the private key of the target computing node to decrypt the computing logic sent by the data demander. After the decryption process is completed, the target computing node processes the decrypted transaction data according to the computing logic in the decrypted state, and stores the processing results locally based on the secure storage function provided by the combination of software and hardware of TEE. At the same time, the target computing node needs to change the status of the computing task in the smart contract to ended, and obtain the assets corresponding to the computing task. Specifically, the data demander needs to pay the cost of the computing process to the target computing node. Preferably, the data demander transfers the amount locked before the calculation to the account provided by the target computing node.
[0070] Furthermore, after receiving the information that the calculation is completed, the data demander will request the target computing node for the processing result of the transaction data. After receiving the processing result request from the data demander, the target computing node obtains the public key of the data demander through the smart contract, encrypts the processing result according to the public key of the data demander, and returns the encrypted processing result to the data demander. After receiving the encrypted processing result, the data demander uses its own private key to decrypt it to obtain the final processing result.
[0071] In this embodiment, the target computing node needs to perform encryption and decryption in the process of computing the transaction data and in the process of returning the processing results to the data demander, thereby further improving the privacy and security of the transaction data.
[0072] In one embodiment, the smart contract needs to verify the data demander's assets first to ensure that the entire transaction can proceed smoothly. Specifically, after the data demander browses the required transaction data on the smart contract, it purchases the transaction through the smart contract. At this time, the smart contract first needs to verify whether the assets in the data demander's account are greater than or equal to the total price of all transaction data. If not, the transaction fails. If so, the verification is passed, the assets corresponding to the transaction data in the data demander's account are deducted, and the corresponding assets are transferred to the data provider's account.
[0073] If the verification is successful, a corresponding data transaction is generated in the smart contract, and a transaction identifier corresponding to at least one transaction data is generated. The transaction identifier is a unique identifier of the transaction process, which is used to record information related to the transaction data, such as data identifier, information of the data demander, etc.
[0074] In this embodiment, before the formal transaction, the smart contract needs to verify the assets of the data demander to avoid transaction failure due to insufficient assets of the data demander, which can improve transaction efficiency.
[0075] In one embodiment, after determining the transaction data, the data demander needs to create a computing task for private data through a smart contract and record the task identifier of the computing task on the smart contract, where the task identifier can be given by the smart contract or by the data demander to distinguish multiple computing tasks on the smart contract. During the transaction, the smart contract needs to verify the identity of the data demander first. Only when the verification is passed can the data demander select the target computing node.
[0076] Figure 4 is a flowchart of a method for determining a target computing node in an embodiment. Figure 4 As shown, the method comprises the following steps:
[0077] In step S402, the smart contract verifies the identity of the data demander according to the transaction identifier. If the verification is successful, the data demander selects an initial target computing node from multiple idle computing nodes in the smart contract.
[0078] Specifically, during verification, the data demander needs to pass the transaction identifier to the smart contract to achieve binding with the transaction data. The smart contract verifies the identity of the data demander based on the passed-in transaction identifier and the transaction identifier recorded by itself. If the verification is successful, the data demander can start selecting the target computing node.
[0079] Normally, smart contracts will record the node information of multiple computing nodes, which can reflect the computing status, computing power, and cost of the corresponding nodes. When selecting a target computing node, data demanders should give priority to computing nodes that are currently idle to avoid waiting. Specifically, data demanders can randomly select one of multiple idle computing nodes as the initial target computing node, or prioritize them based on node information such as cost and computing power.
[0080] In step S404, the data demander binds the initial target computing node to the task identifier of the computing task, wherein the computing task is created by the data demander through a smart contract, and the task identifier is generated according to the task information of the computing task.
[0081] After selecting the initial target computing node, the data demander needs to bind the task identifier to the initial target computing node in order to obtain the transaction data stored by the data provider. The computing task is created by the data demander through a smart contract to record the privacy data transaction process. The task information is used to summarize the information of the computing task, including data identifier, data provider information, data demander information, data price, computing cost, etc.
[0082] Step S406: When the smart contract verifies the current computing power of the initial target computing node, it is considered that the initial target computing node is successfully bound to the task identifier, and the initial target computing node is the final target computing node.
[0083] In the process of selecting the target computing node, the smart contract also needs to verify the current computing power of the selected initial target computing node. Specifically, the validity of the current computing power of the initial target computing node is verified through the oracle. If the current computing power of the initial target computing node is invalid or the initial target computing node is performing other tasks, the binding fails, and other idle computing nodes need to be re-selected as the initial target computing node for verification; if the verification passes, the initial target computing node is used as the final target computing node, and the binding process with the task identifier is successful, and the transaction data can be processed. Among them, in the case of network failure or the shutdown of the initial target computing node, the current computing power of the initial target computing node is considered invalid and the verification fails. The oracle is a trusted medium for on-chain access to off-chain data.
[0084] In this embodiment, the data demander also needs to verify the data demander and the target computing node through a smart contract when selecting the target computing node, which can ensure the security and effectiveness of the transaction process.
[0085] Furthermore, before the target computing node processes the transaction data according to the computing logic provided by the data demander, the data demander needs to first pass the computing logic to the target computing node. Specifically, the data demander obtains the public key and location information of the target computing node through the smart contract. The location information can be a network address, preferably a Uniform Resource Locator (URL); then the computing logic is encrypted by the public key of the target computing node, and the task identifier corresponding to the transaction data and the encrypted computing logic are transmitted to the target computing node according to the location information, so that the target computing node can obtain the transaction data. After the transmission is completed, the data demander initiates a data computing request to the target computing node.
[0086] Then, the target computing node verifies the computing task corresponding to the transaction data according to the task identifier in the smart contract and the assets of the data demander. After the verification is passed, it requests the transaction data from the data provider. Specifically, after receiving the request, the target computing node first accesses the smart contract to verify whether the computing task corresponding to the task identifier is bound to this computing node. If not, the calculation is terminated. Then the target computing node calculates the cost of the computing power provided by this call and the calculation of the transaction data, and locks the corresponding assets of the data demander through the smart contract. If the assets of the data demander are insufficient, an error is returned to the data demander. Finally, the target computing node changes the status of this computing node to the smart contract to calculate, obtains the list of transaction data bound to the computing task, and requests transaction data from the TEE node of the data provider in turn.
[0087] In this embodiment, during the transmission of the computing logic, the computing logic still needs to be encrypted to avoid leakage of the computing logic and ensure the security of private data transactions.
[0088] In some of the embodiments, all nodes configured with a trusted execution environment need to be registered in the smart contract, including the data provider's node and each computing node. Figure 5 Flowchart of a TEE node registration method in one embodiment, as shown in FIG. Figure 5 As shown, the process of registering the target computing node and / or data provider configured with a trusted execution environment in the smart contract is as follows:
[0089] Step S502: The TEE node configured with a trusted execution environment generates node information through a privacy computing service. Specifically, the node information includes a public-private key pair and a node identifier, which is a unique identifier that characterizes the identity information and function of the node, such as category, access address, etc. The node information in this embodiment is encrypted and stored locally on the node.
[0090] Step S504: The TEE node implements remote authentication through the hash value of the privacy computing service and the node information to obtain a remote authentication report.
[0091] The privacy computing service is essentially a piece of program code. The hash value of the privacy computing service can be calculated based on the code, and the public key in the node information is required to implement remote authentication. Specifically, a remote authentication mechanism is usually set up inside the TEE node. The remote authentication process can be: combining the remote authentication mechanism built into the TEE node and the remote authentication server corresponding to the TEE node, calculating a hash value for the privacy computing service running inside the TEE, and generating a remote authentication report. The remote authentication report needs to be verified by the remote authentication server to ensure that the privacy computing service runs inside the TEE. At the same time, the hash value of the privacy computing service can be combined to ensure that the privacy computing service program has not been tampered with.
[0092] Step S506: The smart contract verifies the TEE node based on the remote authentication report and node information.
[0093] After receiving the remote authentication report, the TEE node sends the remote authentication report, public key, node ID, and URL for accessing the node to the smart contract. The smart contract accesses the remote authentication server of the TEE through the oracle to verify whether the privacy computing service code of the TEE node has been tampered with. Specifically, the hash value in the remote authentication report is compared with the hash value in the remote authentication server. Furthermore, the smart contract also needs to verify whether the privacy computing service is running in the TEE node through the remote authentication report. After the verification is passed, the smart contract records the information of the TEE node and completes the registration of the TEE node.
[0094] In this embodiment, both the data provider and the computing node need to complete the registration in the smart contract in advance to ensure that each node has a trusted execution environment. Specifically, this embodiment provides a trusted access mechanism for TEE nodes, combining remote authentication and blockchain to ensure that the TEE nodes connected to the privacy data transaction system are all trusted. Remote authentication verifies that the privacy computing service running in the TEE is complete and has not been tampered with. The public key carried in the report ensures that the public key is generated internally by the node, preventing man-in-the-middle attacks and improving the security of the privacy data transaction process.
[0095] The present embodiment is described and illustrated below through preferred embodiments.
[0096] The existing data trading system is generally centralized, and the transaction method is usually to directly send the data in plain text to the demander. For data with high privacy and security requirements, since it cannot be directly traded in plain text, the value of the data in the circulation process is greatly reduced. However, through privacy computing, the value of the data can be transmitted through the results of the calculation without exposing the data itself, and the circulation of private data can be indirectly achieved. The specific method includes the following steps:
[0097] Step 1: The computing nodes and data demanders have completed registration in the smart contract, and the computing nodes and data demanders’ nodes are configured with a trusted execution environment;
[0098] Step 2: The data provider uploads the data information and the node information of the TEE node corresponding to the data provider to the smart contract, where the data information includes data identification, data type, data size, data price, etc. The data identification is preferably a data ID (identifier).
[0099] Step 3: The data demander selects transaction data based on the data information in the smart contract and purchases the transaction data through the smart contract;
[0100] Step 4: The smart contract verifies the account balance of the data demander. If the account balance is greater than or equal to the data price, the verification is successful. The amount corresponding to the price of the transaction data is deducted from the account of the data demander and transferred to the account of the data provider. Then, a data transaction corresponding to the transaction data is generated in the smart contract, and the data ID, the buyer of the transaction data and other information are recorded, and a transaction identifier, such as a transaction ID, is generated.
[0101] Step 5: The data demander creates a privacy computing task through a smart contract and obtains a task identifier, preferably a task ID, which can be generated by the smart contract or by the data demander.
[0102] Step 6: The data demander passes the transaction ID to the smart contract to bind the transaction data. The smart contract verifies whether the data demander is the buyer of the transaction based on the transaction ID. If not, the binding fails.
[0103] Step 7: The data demander selects one of the multiple currently idle computing nodes listed in the smart contract to bind with the task ID of the computing task. The smart contract verifies the validity of the computing node through the oracle. If it is invalid or is executing other tasks, the binding fails. If the verification passes, it will be used as the final target computing node.
[0104] Step 8: The data demander obtains the public key and access URL of the target computing node through the smart contract, encrypts the code of the computing logic with the public key, and then requests the target computing node to start computing through the URL;
[0105] Step 9: After receiving the request, the target computing node verifies through the smart contract whether the computing task corresponding to the task ID is bound to this node. If not, the calculation is terminated. If the verification is successful, the cost of the computing power provided by this call is calculated, and the corresponding amount of the data demander is locked through the smart contract. If the amount is insufficient, an error is returned to the data demander. If the amount meets the requirements, the smart contract changes the status of this node to "calculating", obtains the data list bound to the computing task, and requests transaction data from the TEE node of the data provider in turn.
[0106] Step 10: After receiving the request, the TEE node of the data provider verifies with the smart contract whether the computing task has been bound to the corresponding transaction data. If it has been bound, the public key of the target computing node is obtained through the smart contract, and the transaction data is encrypted with the public key and sent to the target computing node;
[0107] Step 11: After receiving all encrypted transaction data, the target computing node uses its own private key to decrypt all transaction data and the computing logic sent by the data demander, and then sends the decrypted transaction data to the computing logic for execution;
[0108] Step 12: After the calculation logic is executed, the target computing node encrypts and stores the processing results in the local TEE node, changes the status of the computing task to the smart contract as completed, and transfers the amount locked before the calculation to the account of the target computing node;
[0109] Step 13: The data demander determines whether the calculation is completed based on the status of the target computing node in the smart contract. After the calculation is completed, the data demander requests the target computing node for the processing result.
[0110] Step 14: After receiving the request, the target computing node obtains the public key of the data demander through the smart contract, encrypts the processing result with the public key and returns it to the data demander. After receiving the encrypted processing result, the data demander decrypts it with the private key to obtain the plaintext processing result.
[0111] It should be noted that the data ID in this embodiment is used to locate the source of the data. Each data has its own data ID. The transaction ID corresponds to all transaction data under a computing task and is used to determine whether the transaction data is authorized. The task ID is used to determine the correspondence between the transaction data and the data demander.
[0112] Furthermore, all the above steps will carry the operator's signature and address to prevent forgery. Specifically, the operators include data demanders, data providers and target computing nodes.
[0113] In this preferred embodiment, during the transaction of private data, the target computing node off-chain obtains the transaction data directly from the data provider without going through the blockchain. Therefore, there is no need to store the transaction data or perform data calculations in the blockchain, which reduces the load on the blockchain, improves the performance of the blockchain, and ensures the available storage space on the blockchain, thereby solving the problem in the related technology that both the storage and calculation of data are conducted in the blockchain, resulting in excessive consumption of blockchain storage resources and low blockchain business processing efficiency. While saving the on-chain storage space of the blockchain, it protects the data privacy of the data provider and improves data security.
[0114] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0115] Based on the same inventive concept, the embodiment of the present application also provides a privacy data trading system for implementing the privacy data trading method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more privacy data trading system embodiments provided below can refer to the limitations on the privacy data trading method above, and will not be repeated here.
[0116] In one embodiment, Figure 6 As shown, a privacy data transaction system is provided, including a data provider 61 and a target computing node 62:
[0117] The data demander determines the target computing node 62 off the chain through a smart contract, wherein the target computing node 62 is configured with a trusted execution environment;
[0118] The target computing node 62 obtains transaction data from the data provider 61, wherein the transaction data is determined by the data demander according to the data information stored in the smart contract, and the transaction data is encrypted and stored locally in the data provider 61;
[0119] The target computing node 62 processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander.
[0120] This embodiment proposes a privacy data transaction system based on blockchain and trusted execution environment, which can ensure the security and reliability of the entire data transaction process through blockchain, and the security of data during use through trusted execution environment, and the data cannot be used without the system. Based on the security sandbox characteristics of the trusted execution environment, the data demander does not need to provide a trusted execution environment. The trusted execution environment is provided by the computing node. The data demander can encrypt the computing logic and send it to the trusted execution environment of the computing node for decryption and execution, which can protect the data provider's data and the data demander's computing logic at the same time.
[0121] Moreover, the above-mentioned privacy data transaction system stores transaction data locally on the data demander, and only stores data information of transaction data in the smart contract. During the transaction process, the target computing node off the chain directly obtains transaction data from the data provider without going through the blockchain. Therefore, there is no need to store transaction data or perform data calculations in the blockchain, which reduces the load of the blockchain, improves the performance of the blockchain, and ensures the available storage space on the blockchain, thereby solving the problem in related technologies that data storage and calculation are both carried out in the blockchain, resulting in excessive consumption of blockchain storage resources and low blockchain business processing efficiency. While saving the on-chain storage space of the blockchain, it protects the data privacy of the data provider and improves data security.
[0122] Furthermore, the target computing node 62 initiates a data acquisition request to the data provider 61 according to the data computing request of the data demander; after receiving the data acquisition request, the data provider 61 verifies the binding relationship between the computing task corresponding to the data acquisition request and the transaction data; if the verification is successful, the data provider 61 encrypts the transaction data through the public key of the target computing node 62, and sends the encrypted transaction data to the target computing node 62.
[0123] Furthermore, the target computing node 62 decrypts the encrypted transaction data, processes the decrypted transaction data according to the computing logic, and stores the processing results locally; after receiving the processing result request from the data demander, the target computing node 62 encrypts the processing result according to the public key of the data demander, and returns the encrypted processing result to the data demander.
[0124] Furthermore, before the data demander determines the target computing node 62 off the chain through the smart contract, the smart contract verifies the assets of the data demander; if the verification is passed, the smart contract generates a transaction identifier corresponding to at least one transaction data.
[0125] Furthermore, the smart contract verifies the data demander based on the transaction identifier. If the verification is successful, the data demander selects an initial target computing node from multiple idle computing nodes in the smart contract; the data demander binds the initial target computing node with the task identifier of the computing task, wherein the computing task is created by the data demander through the smart contract, and the task identifier is generated based on the task information of the computing task; if the smart contract verifies the computing power of the initial target computing node, the initial target computing node is successfully bound to the task identifier, and the initial target computing node is the final target computing node 62.
[0126] Furthermore, the data demander obtains the public key and location information of the target computing node 62 through the smart contract; the data demander encrypts the computing logic through the public key of the target computing node 62, and transmits the task identifier corresponding to the transaction data and the encrypted computing logic to the target computing node 62 according to the location information; the target computing node 62 verifies the computing task corresponding to the transaction data according to the task identifier in the smart contract and the assets of the data demander.
[0127] Furthermore, the target computing node 62 configured with a trusted execution environment and / or the data provider 61 configured with a trusted execution environment are registered in the smart contract.
[0128] Each component in the above-mentioned privacy data trading system can be implemented in whole or in part through software, hardware and their combination. Each of the above-mentioned components can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0129] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for trading private data is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0130] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0131] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0132] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0133] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0135] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0136] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A privacy data transaction method, It is characterized in that The method comprises: The data demander determines the target computing node under the chain through a smart contract, wherein the target computing node is configured with a trusted execution environment; The target computing node obtains transaction data from the data provider, wherein the transaction data is determined by the data demander according to the data information stored in the smart contract, and the transaction data is encrypted and stored locally at the data provider; The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander; The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander, including: The target computing node decrypts the encrypted transaction data, processes the decrypted transaction data according to the computing logic, and stores the processing result locally; After receiving the processing result request from the data demander, the target computing node encrypts the processing result according to the public key of the data demander, and returns the encrypted processing result to the data demander.
2. The method according to claim 1, It is characterized in that The target computing node obtains transaction data from the data provider including: The target computing node initiates a data acquisition request to the data provider according to the data computing request of the data demander; After receiving the data acquisition request, the data provider verifies the binding relationship between the computing task corresponding to the data acquisition request and the transaction data; When the verification is passed, the data provider encrypts the transaction data by using the public key of the target computing node, and sends the encrypted transaction data to the target computing node.
3. The method according to claim 1, It is characterized in that Before the data demander determines the target computing node under the chain through the smart contract, the method includes: The smart contract verifies the assets of the data demander; If the verification is successful, the smart contract generates a transaction identifier corresponding to at least one of the transaction data.
4. The method according to claim 3, It is characterized in that The data demander determines the target computing node off-chain through the smart contract, including: The smart contract verifies the identity of the data demander according to the transaction identifier. If the verification is successful, the data demander selects an initial target computing node from multiple idle computing nodes in the smart contract. The data demander binds the initial target computing node to a task identifier of a computing task, wherein the computing task is created by the data demander through the smart contract, and the task identifier is generated according to the task information of the computing task; When the smart contract passes the verification of the current computing power of the initial target computing node, it is considered that the initial target computing node is successfully bound to the task identifier, and the initial target computing node is the final target computing node.
5. The method according to claim 1, It is characterized in that Before the target computing node processes the transaction data according to the computing logic provided by the data demander, the method includes: The data demander obtains the public key and location information of the target computing node through the smart contract; The data demander encrypts the computing logic by using the public key of the target computing node, and transmits the task identifier corresponding to the transaction data and the encrypted computing logic to the target computing node according to the location information; The target computing node verifies the computing task corresponding to the transaction data according to the task identifier in the smart contract and the assets of the data demander.
6. The method according to claim 1, It is characterized in that Before the data demander determines the target computing node under the chain through the smart contract, the method further includes: The target computing node configured with a trusted execution environment and / or the data provider configured with a trusted execution environment are registered in the smart contract.
7. A privacy data trading system, It is characterized in that The system includes a data provider and a target computing node: The data demander determines the target computing node under the chain through a smart contract, wherein the target computing node is configured with a trusted execution environment; The target computing node obtains transaction data from the data provider, wherein the transaction data is determined by the data demander according to the data information stored in the smart contract, and the transaction data is encrypted and stored locally at the data provider; The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander; The target computing node processes the transaction data according to the computing logic provided by the data demander, and returns the processing result obtained after the processing to the data demander, including: The target computing node decrypts the encrypted transaction data, processes the decrypted transaction data according to the computing logic, and stores the processing result locally; After receiving the processing result request from the data demander, the target computing node encrypts the processing result according to the public key of the data demander, and returns the encrypted processing result to the data demander.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the privacy data transaction method described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the privacy data transaction method described in any one of claims 1 to 6 are implemented.
