Data interaction methods, systems, devices, and storage media based on blockchain

By using blockchain technology to encrypt and distribute data and distribute computational tasks during data interaction, privacy and security issues in data sharing are resolved, enabling secure and efficient data transmission and acquisition of computational results.

CN117439747BActive Publication Date: 2026-06-30GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GLOBAL ENERGY INTERCONNECTION RES INST CO LTD
Filing Date
2022-07-13
Publication Date
2026-06-30

Smart Images

  • Figure CN117439747B_ABST
    Figure CN117439747B_ABST
Patent Text Reader

Abstract

This invention discloses a data interaction method, system, device, and storage medium based on blockchain. The blockchain includes data owner nodes. Data requester nodes upload their data requests to the blockchain. After verifying the data request, the target data owner node encrypts the target data required by the data requester node and divides the encrypted target data according to the task allocation method in the data request. It then performs calculations on the first encrypted sub-data based on the calculation method in the data request, and sends the calculation result of the first encrypted sub-data and a second encrypted sub-data to the data requester node. The data requester node performs calculations on the second encrypted sub-data, merges and decrypts the calculation results of the first and second encrypted sub-data, and finally obtains the calculation result of the target data. The transmitted data is encrypted, and the calculation task can be undertaken by two nodes, improving computational efficiency and the security of data interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and more specifically to blockchain-based data interaction methods, systems, devices, and storage media. Background Technology

[0002] Making full use of data is beneficial for realizing its value as a new type of production factor. Data utilization methods include, but are not limited to, using machine learning models for knowledge mining and statistical analysis. Data privacy and security have always been critical issues in the data utilization process. When data sharing is required, if the data provider directly provides the data in plaintext to the data requester for analysis, it can lead to data leakage, making it difficult to guarantee the privacy and security of the data provider. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a data interaction method, system, device and storage medium based on blockchain to solve the problem of data leakage during data interaction.

[0004] According to a first aspect, embodiments of the present invention provide a blockchain-based data interaction method applied to a data requester node, the method comprising:

[0005] Upload a data request to the blockchain for the target data of the target data owner node. The data request includes the calculation method of the target data and the task allocation method for the target data.

[0006] The target encrypted data is received from the target data owner node. The target encrypted data includes the calculation result of the first encrypted sub-data and the second encrypted sub-data. The first encrypted sub-data and the second encrypted sub-data are obtained by dividing the encrypted target data based on the task allocation method. The calculation result of the first encrypted sub-data is calculated based on the calculation method.

[0007] The second encrypted sub-data is calculated based on the aforementioned calculation method to obtain the calculation result of the second encrypted sub-data;

[0008] The calculation results of the first encrypted sub-data and the second encrypted sub-data are fused and decrypted to obtain the calculation result of the target data.

[0009] The blockchain-based data interaction method provided in this invention is applied to a data requester node. A data owner node also exists within the blockchain. The data requester node uploads its data request to the blockchain. After verifying the data request, the target data owner node encrypts the target data required by the data requester node and divides the encrypted target data according to the task allocation method in the data request. It then performs calculations on the first encrypted sub-data based on the calculation method in the data request, and sends the calculation result of the first encrypted sub-data along with a second encrypted sub-data to the data requester node. The data requester node performs calculations on the second encrypted sub-data, merges and decrypts the calculation results of the first and second encrypted sub-data, and finally obtains the calculation result of the target data. The transmitted data is encrypted, and two nodes can undertake part of the calculation task, improving computational efficiency and enhancing the security of data interaction.

[0010] In conjunction with the first aspect, in one implementation, before uploading the data request for the target data of the target data owner node to the blockchain, the method further includes:

[0011] In response to the selection operation of the data owner node in the blockchain, a target data owner node is determined to upload the data request to the blockchain.

[0012] In conjunction with the first aspect, in one implementation, the step of fusing and decrypting the calculation results of the first encrypted sub-data and the second encrypted sub-data to obtain the calculation result of the target data includes:

[0013] Based on the calculation method, the calculation results of the first encrypted sub-data and the calculation results of the second encrypted sub-data are fused to obtain the encrypted calculation result of the target data;

[0014] The encrypted calculation result is decrypted using the key corresponding to the data requester node uploaded to the blockchain by the key management node to obtain the calculation result of the target data.

[0015] In conjunction with the first aspect, in one implementation, the step of decrypting the encrypted calculation result based on the key corresponding to the data requester node uploaded to the blockchain by the key management node to obtain the calculation result of the target data includes:

[0016] Obtain the encryption / decryption key corresponding to the data requester node from the blockchain, wherein the encryption / decryption key is generated by the key management node and uploaded to the blockchain;

[0017] Obtain the decryption key, and decrypt the encrypted calculation result based on the decryption key to obtain the calculation result of the target data.

[0018] According to a second aspect, embodiments of the present invention provide a blockchain-based data interaction method applied to a data owner node, the method comprising:

[0019] Upload target data, obtain and verify the data request uploaded by the data requester node, the data request including the calculation method of the target data and the task allocation method of the target data;

[0020] The target data is encrypted, and the encrypted target data is divided based on the task allocation method to obtain a first encrypted sub-data and a second encrypted sub-data;

[0021] The first encrypted sub-data is calculated based on the calculation method. The calculation result of the first encrypted sub-data and the second encrypted sub-data are sent to the data requester node. The data requester node calculates the second encrypted sub-data based on the calculation method. After fusing and decrypting the calculation results of the first encrypted sub-data and the second encrypted sub-data, the calculation result of the target data is determined.

[0022] In conjunction with the second aspect, in one implementation, encrypting the target data includes:

[0023] Obtain the encryption key of the data requester node from the blockchain;

[0024] The target data is encrypted using the encryption key to obtain the encrypted target data.

[0025] According to a third aspect, embodiments of the present invention provide a blockchain-based data interaction system, comprising:

[0026] A data requester node, wherein the data requester node is used to execute the blockchain-based data interaction method of the first aspect or any implementation thereof;

[0027] At least one data owner node is connected to the data requester node, and the data owner node is used to execute the blockchain-based data interaction method of the second aspect or any implementation thereof.

[0028] In conjunction with the third aspect, in one embodiment, the system further includes:

[0029] A key management node is connected to the data requester node. The key management node is used to generate encryption and decryption keys corresponding to the data requester node and upload them to the blockchain.

[0030] According to a fourth aspect, embodiments of the present invention provide an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the blockchain-based data interaction method described in the first aspect, any embodiment of the first aspect, the second aspect, or any embodiment of the second aspect.

[0031] According to a fifth aspect, embodiments of the present invention provide a computer-readable storage medium storing computer instructions for causing the computer to perform the blockchain-based data interaction method described in the first aspect, any embodiment of the first aspect, the second aspect, or any embodiment of the second aspect. Attached Figure Description

[0032] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0033] Figure 1 This is a flowchart of a blockchain-based data interaction method according to an embodiment of the present invention;

[0034] Figure 2 This is a flowchart of a method for obtaining calculation results of target data according to an embodiment of the present invention;

[0035] Figure 3 This is a flowchart of a blockchain-based data interaction method according to an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram of the structure of a blockchain-based data interaction system according to an embodiment of the present invention;

[0037] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] Blockchain, with its decentralized, secure, trustworthy, and tamper-proof characteristics, provides a solution for the secure flow of data. Based on these characteristics, this solution proposes a data interaction method based on blockchain.

[0040] According to an embodiment of the present invention, a data interaction method based on blockchain is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0041] This embodiment provides a blockchain-based data interaction method that can be used on terminals such as mobile phones, tablets, and computers. Figure 1 This is a flowchart of a blockchain-based data interaction method according to an embodiment of the present invention. The method is applied to a data requester node, such as... Figure 1 As shown, the process includes the following steps:

[0042] S11, upload a data request for the target data of the target data owner node to the blockchain.

[0043] After identity authentication is successful, data owner nodes and data requester nodes join the blockchain. Data owner nodes upload the names, descriptions, and summaries of the data they own to the blockchain. There may be multiple data owner nodes in the blockchain, each of which can be a different enterprise and upload data-related information from different fields to the blockchain, allowing data requester nodes to select according to their computing needs.

[0044] Users of the data requester node browse data information uploaded by data owner nodes in the blockchain, determine the target data and the data owner node to which the target data belongs based on the content to be calculated, generate a data request and upload it to the blockchain. The data request is a kind of smart contract that includes the data calculation method and the task allocation method. The calculation method can be a calculation formula, and the task allocation method specifies how much data the data requester node and the data owner node should calculate respectively.

[0045] The target data owner node obtains the data request uploaded by the data requester node in the blockchain and verifies its legality and correctness. The blockchain may include ledger nodes, which are used to verify the legality and correctness of the data information.

[0046] S12, Receive the target encrypted data fed back by the target data owner node.

[0047] The target encrypted data is obtained by encrypting the target data by the target data owner node. The target encrypted data includes the calculation result of the first encrypted sub-data and the second encrypted sub-data. The first encrypted sub-data and the second encrypted sub-data are obtained by dividing the encrypted target data based on the task allocation method. The calculation result of the first encrypted sub-data is calculated based on the calculation method of the first encrypted sub-data.

[0048] The task allocation method in the data request uploaded by the data requester node specifies the proportion of target data that the data requester node and the data owner node need to calculate respectively. The data owner node can also negotiate with the data requester node based on its own computing capabilities, or the data requester node can calculate all the content.

[0049] After the data owner node obtains the data request uploaded by the data requester node from the blockchain, it encrypts the target data. This encryption can be performed using the encryption / decryption key corresponding to the data requester node uploaded to the blockchain by the key management node; the encryption method is not limited. Based on the task allocation method in the data request, the target encrypted data is divided into a first encrypted sub-data and a second encrypted sub-data. The first encrypted sub-data is then calculated according to the calculation method in the data request, yielding a result. This result, along with the second encrypted sub-data, is sent to the data requester node. Data transmission can be achieved through a data pipeline contract, a smart contract deployed on the blockchain that defines the rules for data transmission between nodes, thus improving data transmission security to a certain extent.

[0050] S13, calculate the second encrypted sub-data based on the calculation method to obtain the calculation result of the second encrypted sub-data.

[0051] After the data requester node obtains the target encrypted data sent by the data owner node, it performs calculations on the second encrypted sub-data to obtain the calculation result of the second encrypted sub-data.

[0052] S14, the calculation results of the first encrypted sub-data and the second encrypted sub-data are merged and decrypted to obtain the calculation result of the target data.

[0053] The method of merging the calculation results is related to the calculation method and task allocation method in the data request. Taking the calculation of the average value of the target data as an example, if the task allocation method stipulates that the data owner node and the data requester node each undertake 50% of the calculation, and the calculation results of the first encrypted sub-data and the second encrypted sub-data are respectively 50% of the target data, then the calculation results of the first encrypted sub-data and the second encrypted sub-data are added together and divided by the total number to obtain the calculation result of the encrypted target data. The calculation result is then decrypted using the decryption key of the data requester node to obtain the calculation result of the target data.

[0054] The blockchain-based data interaction method provided in this invention includes a data owner node and a data requester node that uploads its data request to the blockchain. After verifying the data request, the target data owner node encrypts the target data required by the data requester node and divides the encrypted target data according to the task allocation method in the data request. It then performs calculations on the first encrypted sub-data based on the calculation method in the data request, and sends the calculation result of the first encrypted sub-data along with a second encrypted sub-data to the data requester node. The data requester node performs calculations on the second encrypted sub-data, merges and decrypts the calculation results of the first and second encrypted sub-data, and finally obtains the calculation result of the target data. The transmitted data is encrypted, and two nodes can undertake part of the calculation task, improving computational efficiency and enhancing the security of data interaction.

[0055] In one implementation, before uploading a data request for target data of a target data owner node to the blockchain, the method further includes: in response to a selection operation of a data owner node in the blockchain, determining a target data owner node to upload the data request to the blockchain.

[0056] After successful identity authentication, data owner nodes and data requester nodes join the blockchain. Data owner nodes upload the name, description, and summary of the data they own to the blockchain. Multiple data owner nodes may exist in the blockchain, each potentially representing a different enterprise and uploading data-related information from different fields. Data requester nodes can then select the appropriate node based on their computational needs. Users of the data requester nodes browse the data uploaded by data owner nodes in the blockchain, determine the target data and its associated data owner node based on the computational requirements (i.e., select the target data owner node), and generate a data request to upload to the blockchain.

[0057] In one implementation, please refer to Figure 2 , Figure 1 S14 in the formula includes the following steps:

[0058] S21, the calculation results of the first encrypted sub-data and the second encrypted sub-data are fused based on the calculation method to obtain the encrypted calculation result of the target data.

[0059] The method of merging the calculation results is related to the calculation method and task allocation method in the data request. Taking the calculation of the average value of the target data as an example, if the task allocation method stipulates that the data owner node and the data requester node shall each undertake 50% of the calculation, and the calculation results of the first encrypted sub-data and the second encrypted sub-data are 50% of the target data respectively, then the calculation results of the first encrypted sub-data and the second encrypted sub-data are added together and divided by the total number to obtain the encrypted calculation result of the target data.

[0060] S22, decrypt the encrypted calculation result based on the key corresponding to the data requester node uploaded to the blockchain by the key management node to obtain the calculation result of the target data.

[0061] Specifically, including:

[0062] (1) Obtain the encryption / decryption key corresponding to the data requester node from the blockchain. The encryption / decryption key is generated by the key management node and uploaded to the blockchain.

[0063] The blockchain also includes key management nodes. These nodes generate encryption / decryption keys (e.g., public-private key pairs) for the data requester nodes and upload these keys to the blockchain. The data owner nodes retrieve the encryption / decryption keys from the blockchain to encrypt the target data, for example, using homomorphic encryption.

[0064] (2) Obtain the decryption key and decrypt the encrypted calculation result based on the decryption key to obtain the calculation result of the target data.

[0065] The data requester node obtains the decryption key from the corresponding encryption / decryption key in the blockchain, and decrypts the encrypted calculation result based on the decryption key to obtain the calculation result of the target data.

[0066] This embodiment provides a blockchain-based data interaction method that can be used on terminals such as mobile phones, tablets, and computers. Figure 3 This is a flowchart of a blockchain-based data interaction method according to an embodiment of the present invention. The method is applied to data owner nodes, such as... Figure 3 As shown, the process includes the following steps:

[0067] S31, Upload target data, obtain and verify the data request uploaded by the data requester node.

[0068] After identity authentication is successful, data owner nodes and data requester nodes join the blockchain. Data owner nodes upload the names, descriptions, and summaries of the data they own to the blockchain. There may be multiple data owner nodes in the blockchain, each of which can be a different enterprise and upload data-related information from different fields to the blockchain, allowing data requester nodes to select according to their computing needs.

[0069] Users of the data requester node browse data information uploaded by the data owner node in the blockchain, determine the target data and the data owner node to which the target data belongs based on the content to be calculated, generate a data request and upload it to the blockchain. The data request is a kind of smart contract. The data request includes the calculation method of the target data and the task allocation method for the target data. The calculation method can be a calculation formula, and the task allocation method specifies how much data the data requester node and the data owner node should calculate respectively.

[0070] The target data owner node obtains the data request uploaded by the data requester node in the blockchain and verifies its legality and correctness. The blockchain may include ledger nodes, which are used to verify the legality and correctness of the data information.

[0071] S32, encrypt the target data, and divide the encrypted target data into first encrypted sub-data and second encrypted sub-data based on the task allocation method.

[0072] In one implementation, encrypting the target data includes the following steps:

[0073] (1) Obtain the encryption key of the data requester node from the blockchain.

[0074] (2) Encrypt the target data based on the encryption key to obtain the encrypted target data.

[0075] The blockchain also includes key management nodes. These nodes generate encryption / decryption keys (e.g., public-private key pairs) for the data requester nodes and upload these keys to the blockchain. The data owner nodes retrieve the encryption / decryption keys from the blockchain to encrypt the target data, for example, using homomorphic encryption.

[0076] The encrypted target data is divided according to the task allocation method to obtain the first encrypted sub-data and the second encrypted sub-data.

[0077] S33, perform calculations on the first encrypted sub-data based on the calculation method, and send the calculation result of the first encrypted sub-data and the second encrypted sub-data to the data requester node.

[0078] The data owner node performs calculations on the first encrypted sub-data according to the computation method in the data request, obtains the calculation result of the first encrypted sub-data, and sends the calculation result of the first encrypted sub-data along with the second encrypted sub-data to the data requester node. Data can be transmitted through a data pipeline contract, which is a type of smart contract deployed in the blockchain that defines the rules for data transmission between nodes, thus improving the security of data transmission to a certain extent.

[0079] After the data requester node obtains the target encrypted data sent by the data owner node, it performs calculations on the second encrypted sub-data based on the calculation method, merges and decrypts the calculation results of the first encrypted sub-data and the second encrypted sub-data, and then determines the calculation result of the target data.

[0080] This embodiment provides a blockchain-based data interaction method. Taking the scenario of a power equipment company requesting the average electricity consumption data of a residential community in the first quarter as an example, the data owner node refers to a local power supply company, and the data requester node refers to a power equipment company. The method includes the following steps:

[0081] Step 101: After identity authentication, the data owner node and the data requester node join the data security sharing network built on the consortium blockchain. The unique identifier of the data owner node is... ID DO The unique identifier of the data requester node is ID DR .

[0082] Step 102: The key management node generates public-private key pairs for homomorphic encryption for both the data owner node and the data requester node joining the blockchain. PK DO SK DO )and( PK DR SK DR The key management and distribution nodes upload relevant information to the blockchain network. The uploaded content is as follows:

[0083]

[0084]

[0085] in, Upload For upload operation, timestamp Using timestamps, key management and distribution nodes identify users. ID The public and private key pairs and timestamps are uploaded to the blockchain network, and the ledger nodes upload them to the keychain after verification.

[0086] Step 103: The data owner node uploads the data name, data description, and data summary to the blockchain network. The uploaded content is shown below:

[0087]

[0088] in, Upload For upload operation, d_name For data name, d_description For data description, d_hash The data digest, calculated using a hash function, is used to verify the information uploaded by the data owner node before being uploaded to the data chain by the accounting node. In this embodiment, the data owner uploads the first quarter residential electricity consumption data for a certain community, which includes the community's first quarter electricity consumption data. N The electricity consumption of each household in the residential area, that is, the data contains 2 N A data tuple.

[0089] Step 104: The data requester node browses the data description uploaded by the data owner node and requests the data owner node to upload the data for the first quarter of a certain community. N The average electricity consumption data of residential households is used as the basis for calculation. The data requester node generates a calculation method and writes it into the data requirement. The calculation method is a calculation function or formula. The data requirement is a computational contract in which the data requester node specifies the task allocation method and the interaction requirements of the intermediate computational products. In this embodiment, the data requirement stipulates that the data owner node and the data requester node each perform calculations. N The data owner node calculates the sum of the encrypted data and then sends the result to the data requester node.

[0090] Step 105: The data requester node uploads its data request to the blockchain. The uploaded content is shown below:

[0091]

[0092] in, Upload It's an upload operation. ID DR This serves as the identity identifier for the data requester node. ID DU This serves as the identifier for the data owner node requested by the data requester node. d_name For data name, CC For data requirements.

[0093] Step 106: The ledger node verifies the legality and correctness of the data request uploaded by the data requester, and the data owner node verifies the correctness and reasonableness of the data request. After both parties pass the verification, the ledger node uploads the calculation contract to the contract chain.

[0094] Step 107: The data owner node uses the public key of the data requester node. PK DR Encrypt the data and send the ciphertext Cipher The encrypted message is sent to the data requester node via the data pipeline contract. Cipher As shown below:

[0095]

[0096] in, Indicates use PK DR plaintext The ciphertext obtained after encryption, and Indicating data N A data tuple. The data pipeline contract uploads the identity identifiers of both parties involved in the data exchange, the interaction content, and the timestamp to the contract chain, i.e., uploads ( ID DR , ID DU , Cipher , timestamp ).

[0097] Step 108: The data owner node and the data requester node execute the data request. The computation part of the data requester node is shown below:

[0098]

[0099] The computational portion of the data owner node is shown below:

[0100]

[0101] Step 109, the data owner node transmits data through the data pipeline contract. The result is sent to the data requester node, which decrypts it using its private key to obtain the plaintext computation result, as shown below:

[0102]

[0103] in, For use SK DR Perform the decryption operation. The data requester node obtains the average residential electricity consumption for the first quarter of a certain community, as shown below:

[0104]

[0105] As an optional implementation of this invention, the blockchain network can be constructed based on the Chameleon Hash algorithm to create an editable blockchain network. The Chameleon Hash algorithm is a special hash algorithm that includes a trapdoor. Users possessing this trapdoor can easily find hash collisions, while for users without the trapdoor, the hash algorithm remains collision-resistant. In the blockchain network, the trapdoor is held by a trusted arbitrator node, which, as an administrator, has the authority to modify malicious or illegal data already uploaded to the blockchain.

[0106] In this method, the computational task is distributed to two nodes, which can improve computational efficiency, reduce the time required for data sharing, and increase the system throughput.

[0107] In one implementation, the blockchain-based data interaction method provided by this method may further include: a key chain and a contract chain, which are independent of each other and serve as blockchains for storing different information. The key chain stores the correspondence between nodes and their keys. After distributing keys to nodes joining the network, the key management node packages the node's identity and key information into a block and uploads it to the key chain. The contract chain stores computation contract information, i.e., data requirements. After the data requirements generated by the data requester node are verified and confirmed by the ledger node and the data owner node, the ledger node packages relevant information about the data requirements, such as the identity of the data requester node and the data owner node, the contract generation time, the verification pass time, content, and summary, into a block and uploads it to the contract chain.

[0108] In one implementation, the blockchain-based data interaction method provided by this method may also include a secure data interaction channel, which is composed of, maintained and managed by the nodes in the blockchain, to ensure a closed loop of information within the channel, preventing potential external adversaries from obtaining any information flowing within the channel.

[0109] This embodiment also provides a blockchain-based data interaction system. This device is used to implement the above embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0110] This embodiment provides a blockchain-based data interaction system, such as Figure 4 As shown, it includes:

[0111] Data requester nodes are used to execute blockchain-based data interaction methods in any of the following implementations.

[0112] At least one data owner node is connected to a data requester node, and the data owner node is used to execute a blockchain-based data interaction method in any of the following implementations.

[0113] In one implementation, the system further includes a key management node connected to a data requester node. The key management node is used to generate encryption and decryption keys corresponding to the data requester node and upload them to the blockchain.

[0114] In one implementation, the system further includes: ledger nodes and blockchain trusted arbitration nodes. Ledger nodes are responsible for generating blocks and packaging them for uploading to a designated blockchain. Blockchain trusted arbitration nodes, as nodes with administrator privileges, have the power to monitor the behavior of nodes within the channel.

[0115] In this embodiment, the blockchain-based data interaction system is presented in the form of functional units. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0116] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0117] This invention also provides an electronic device having the above-described features. Figure 5 The data interaction system based on blockchain is shown.

[0118] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the electronic device may include: at least one processor 601, such as a CPU (Central Processing Unit), at least one communication interface 603, memory 604, and at least one communication bus 602. The communication bus 602 is used to enable communication between these components. The communication interface 603 may include a display screen and a keyboard; optionally, the communication interface 603 may also include a standard wired interface or a wireless interface. The memory 604 may be high-speed RAM (Random Access Memory) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 604 may also be at least one storage device located remotely from the aforementioned processor 601. The processor 601 may be combined with... Figure 4In the described system, an application program is stored in memory 604, and processor 601 calls the program code stored in memory 604 to perform any of the above method steps.

[0119] The communication bus 602 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 602 can be divided into an address bus, a data bus, and a control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0120] The memory 604 may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 604 may also include a combination of the above types of memory.

[0121] The processor 601 can be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.

[0122] The processor 601 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0123] Optionally, the memory 604 is also used to store program instructions. The processor 601 can invoke the program instructions to implement the blockchain-based data interaction system method as shown in the embodiments of this application.

[0124] This invention also provides a non-transitory computer storage medium storing computer-executable instructions that can execute the blockchain-based data interaction system method in any of the above method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.

[0125] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A data interaction method based on blockchain, characterized in that, Applied to the data requester node, the method includes: Upload a data request to the blockchain for the target data of the target data owner node. The data request includes the calculation method of the target data and the task allocation method for the target data. The target encrypted data is received from the target data owner node. The target encrypted data includes the calculation result of the first encrypted sub-data and the second encrypted sub-data. The first encrypted sub-data and the second encrypted sub-data are obtained by dividing the encrypted target data based on the task allocation method. The calculation result of the first encrypted sub-data is calculated based on the calculation method. The second encrypted sub-data is calculated based on the aforementioned calculation method to obtain the calculation result of the second encrypted sub-data; The calculation results of the first encrypted sub-data and the second encrypted sub-data are fused and decrypted to obtain the calculation result of the target data.

2. The method according to claim 1, characterized in that, Before uploading the data request for the target data of the target data owner node to the blockchain, the process also includes: In response to the selection operation of the data owner node in the blockchain, a target data owner node is determined to upload the data request to the blockchain.

3. The method according to claim 1, characterized in that, The process of fusing and decrypting the calculation results of the first encrypted sub-data and the second encrypted sub-data to obtain the calculation result of the target data includes: Based on the calculation method, the calculation results of the first encrypted sub-data and the calculation results of the second encrypted sub-data are fused to obtain the encrypted calculation result of the target data; The encrypted calculation result is decrypted using the key corresponding to the data requester node uploaded to the blockchain by the key management node to obtain the calculation result of the target data.

4. The method according to claim 3, characterized in that, The step of decrypting the encrypted calculation result based on the key corresponding to the data requester node uploaded to the blockchain by the key management node to obtain the calculation result of the target data includes: Obtain the encryption / decryption key corresponding to the data requester node from the blockchain, wherein the encryption / decryption key is generated by the key management node and uploaded to the blockchain; Obtain the decryption key, and decrypt the encrypted calculation result based on the decryption key to obtain the calculation result of the target data.

5. A data interaction method based on blockchain, characterized in that, Applied to the data owner node, the method includes: Upload target data, obtain and verify the data request uploaded by the data requester node, the data request including the calculation method of the target data and the task allocation method of the target data; The target data is encrypted, and the encrypted target data is divided based on the task allocation method to obtain a first encrypted sub-data and a second encrypted sub-data; The first encrypted sub-data is calculated based on the calculation method. The calculation result of the first encrypted sub-data and the second encrypted sub-data are sent to the data requester node. The data requester node calculates the second encrypted sub-data based on the calculation method. After fusing and decrypting the calculation results of the first encrypted sub-data and the second encrypted sub-data, the calculation result of the target data is determined.

6. The method according to claim 5, characterized in that, The encryption of the target data includes: Obtain the encryption key of the data requester node from the blockchain; The target data is encrypted using the encryption key to obtain the encrypted target data.

7. A data interaction system based on blockchain, characterized in that, include: A data requester node, wherein the data requester node is used to execute the blockchain-based data interaction method according to any one of claims 1-4; At least one data owner node, which is connected to the data requester node, and the data owner node is used to execute the blockchain-based data interaction method according to any one of claims 5-6.

8. The system according to claim 7, characterized in that, The system also includes: A key management node is connected to the data requester node. The key management node is used to generate encryption and decryption keys corresponding to the data requester node and upload them to the blockchain.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the blockchain-based data interaction method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the blockchain-based data interaction method according to any one of claims 1-6.