Block chain-based data processing method and related device

Through the corresponding relationship between smart contracts and blockchain nodes, the isolation of blockchain data is achieved, which solves the problem of resource waste caused by establishing channels or sub-chains in the existing technology, and achieves efficient data isolation effects.

CN119337410APending Publication Date: 2025-01-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310885521.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-18
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When the existing technology realizes blockchain data isolation, it is necessary to establish channels or sub-chains, resulting in waste of system resources and manpower.

Method used

Through the corresponding relationship between smart contracts and blockchain nodes, determine the blockchain nodes corresponding to the smart contracts that execute each transaction, delete transaction information related to non-target transactions, and generate desensitized data for the target blockchain nodes to realize data isolation.

Benefits of technology

There is no need to establish channels or sub-chains, which reduces the waste of manpower and resources and achieves efficient isolation of blockchain data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337410A_ABST
    Figure CN119337410A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a block chain-based data processing method and a related device, and the method comprises the steps: obtaining block data used for describing a block, the block data comprising transaction information related to a plurality of transactions; according to the corresponding relationship between the smart contract and the block chain node, determining the block chain node corresponding to the smart contract used for executing each transaction; wherein the block chain node having the corresponding relationship with the smart contract has the authority of running the smart contract; determining a target transaction corresponding to the target block chain node; transaction information related to non-target transactions in the block data is deleted, desensitization data for the target block chain node is obtained, and the non-target transactions are transactions except the target transaction in the multiple transactions; and sending the desensitization data for the target block chain node to the target block chain node. Therefore, data isolation is realized based on the corresponding relationship between the smart contract and the block chain node, a channel or a sub-chain does not need to be established, and the waste of manpower and resources is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based data processing method and related devices. Background Art

[0002] Blockchain technology is a decentralized, open and transparent distributed data storage technology with the characteristics of being unforgeable, traceable, traceable, open and transparent, and collectively maintained. Each blockchain node on the blockchain stores the same block ledger and status data. However, in many actual application scenarios, the data generated by some businesses may not be stored by all blockchain nodes to improve data privacy.

[0003] In related technologies, data isolation is generally achieved by establishing channels or sub-chains. Taking channel establishment as an example, the public channel is a non-business transaction channel that does not participate in actual business transactions between organizations in the alliance chain. It is only used to synchronize the desensitized data of all organizations so that the desensitized data of any organization joining the channel can be fully disclosed to the public. At the same time, since the channel does not participate in actual business transactions between organizations, it can also ensure the data security of business transactions between organizations in the alliance chain.

[0004] However, establishing a channel or sub-chain will not only consume a large amount of system resources, but also require a large amount of manpower to maintain an extremely large number of sub-chains or channels, resulting in serious waste of manpower and resources. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a blockchain-based data processing method and related devices, which can achieve data isolation without establishing channels or sub-chains, reducing the waste of manpower and resources.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a data processing method based on blockchain, the method comprising:

[0008] Obtaining block data for describing a block, wherein the block data includes transaction information related to a plurality of transactions;

[0009] According to the correspondence between the smart contract and the blockchain node, determine the blockchain nodes corresponding to the smart contracts used to execute each of the transactions; wherein the blockchain node having the correspondence with the smart contract has the authority to run the smart contract;

[0010] Determine a target transaction corresponding to a target blockchain node, wherein the target blockchain node is a blockchain node other than a primary collaborative blockchain node among multiple blockchain nodes, and the primary collaborative blockchain node is a blockchain node that obtains the block data;

[0011] Deleting transaction information related to non-target transactions in the block data to obtain desensitized data for the target blockchain node, wherein the non-target transactions are transactions other than the target transaction in the multiple transactions;

[0012] Sending desensitized data for the target blockchain node to the target blockchain node.

[0013] On the other hand, an embodiment of the present application provides a data processing device based on blockchain, the device comprising: an acquisition unit, a determination unit, a deletion unit and a sending unit;

[0014] The acquisition unit is used to acquire block data for describing a block, wherein the block data includes transaction information related to a plurality of transactions;

[0015] The determining unit is used to determine the blockchain nodes corresponding to the smart contracts used to execute each of the transactions according to the corresponding relationship between the smart contracts and the blockchain nodes; wherein the blockchain nodes having the corresponding relationship with the smart contracts have the authority to run the smart contracts;

[0016] The determination unit is further used to determine a target transaction corresponding to a target blockchain node, wherein the target blockchain node is a blockchain node other than a primary collaborative blockchain node among multiple blockchain nodes, and the primary collaborative blockchain node is a blockchain node that obtains the block data;

[0017] The deleting unit is used to delete the transaction information related to the non-target transaction in the block data to obtain the desensitized data for the target blockchain node, wherein the non-target transaction is a transaction other than the target transaction in the multiple transactions;

[0018] The sending unit is used to send desensitized data for the target blockchain node to the target blockchain node.

[0019] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:

[0020] The memory is used to store a computer program and transmit the computer program to the processor;

[0021] The processor is configured to execute the method described in the above aspects according to the instructions in the computer program.

[0022] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.

[0023] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above aspects.

[0024] It can be seen from the above technical solution that the block data used to describe the block is obtained, and the block data includes transaction information related to multiple transactions. The correspondence between smart contracts and blockchain nodes is used to describe the correspondence between each smart contract and the blockchain node with the authority to run the smart contract, and the transaction is executed based on the smart contract. According to the correspondence, the blockchain nodes corresponding to the smart contracts used to execute each transaction can be determined, thereby obtaining an indirect correspondence between each blockchain node and each transaction. Taking the target blockchain node among multiple blockchain nodes as an example, the target blockchain node has the authority to execute at least one smart contract, and can execute transactions based on the smart contract, that is, the target transaction, so that the target blockchain node has the authority to obtain transaction data related to the target transaction. Therefore, the transaction information related to non-target transactions in the block data is deleted, and the desensitized data for the target blockchain node is obtained. The desensitized data includes transaction information related to the target transaction, but does not include transaction information related to non-target transactions, so that the block data obtained by the target blockchain node cannot view the transaction information related to the transaction executed by the smart contract that it does not have the running authority. Therefore, for the block data of each block, each blockchain node obtains the corresponding desensitized data, so that each blockchain node cannot obtain transaction information related to non-target transactions, that is, transaction information related to transactions executed by smart contracts that have no corresponding relationship with it, thus achieving data isolation. Therefore, data isolation is achieved based on the corresponding relationship between smart contracts and blockchain nodes, without the need to establish channels or sub-chains, reducing the waste of manpower and resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1Ais a schematic diagram of a data sharing system;

[0027] Figure 1B A schematic diagram of a blockchain structure;

[0028] Figure 1C A schematic diagram generated for one type of block;

[0029] Figure 2 A schematic diagram of an application scenario of a blockchain-based data processing method provided in an embodiment of the present application;

[0030] Figure 3 A flowchart of a blockchain-based data processing method provided in an embodiment of the present application;

[0031] Figure 4 A schematic diagram of a blockchain provided in an embodiment of the present application;

[0032] Figure 5 A schematic diagram of block data provided in an embodiment of the present application;

[0033] Figure 6 A schematic diagram of block data provided in an embodiment of the present application;

[0034] Figure 7 A schematic diagram of the internal structure of a storage node provided in an embodiment of the present application;

[0035] Figure 8A-8C , which is a schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application;

[0036] Figure 9A-9C , which is a schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application;

[0037] Figure 10A-10C , which is a schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application;

[0038] Figure 11A-11C , which is a schematic diagram of a data processing method based on blockchain provided in an embodiment of the present application;

[0039] Fig.12 A schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application;

[0040] Fig.13 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0041] Fig.14 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0043] Before explaining the blockchain-based data processing method provided in the embodiment of the present application, the relevant content of the blockchain is first explained.

[0044] See also Figure 1A , which is a schematic diagram of a data sharing system. In Figure 1, the data sharing system 100 refers to a system for sharing data between blockchain nodes and blockchain nodes. The data sharing system may include multiple blockchain nodes 101, and multiple blockchain nodes 101 may refer to each client in the data sharing system. Each blockchain node 101 can receive input information when performing normal work, and maintain the shared data in the data sharing system based on the received input information. In order to ensure the information intercommunication within the data sharing system, there may be an information connection between each blockchain node in the data sharing system, and information can be transmitted between blockchain nodes through the above information connection. For example, when any blockchain node in the data sharing system receives input information, other blockchain nodes in the data sharing system obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all blockchain nodes in the data sharing system are consistent.

[0045] Each blockchain node in the data sharing system has a node identifier corresponding to it, and each blockchain node in the data sharing system can store the node identifiers of other blockchain nodes in the data sharing system, so that the generated blocks can be broadcast to other blockchain nodes in the data sharing system according to the node identifiers of other blockchain nodes. A node identifier list as shown in the following table can be maintained in each blockchain node, and the node name and node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be the Internet Protocol (IP) address of the interconnection between networks and any other information that can be used to identify the node. Table 1 only takes the IP address as an example for explanation.

[0046] Table 1

[0047] Blockchain node name Node ID Blockchain Node 1 117.114.151.174 Blockchain Node 2 117.116.189.145 … … Blockchain Node N 119.123.789.255

[0048] Each blockchain node in the data sharing system stores the same blockchain. The blockchain consists of multiple blocks. Figure 1B , which is a schematic diagram of a blockchain structure. Figure 1BIn the blockchain, the blockchain includes 3 blocks. The genesis block includes a block header and a block body. The block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information characteristic value of the current block, the block header characteristic value, version number, timestamp and difficulty value of the parent block, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0049] See also Figure 1C , which is a schematic diagram of block generation. When generating each block in the blockchain, the blockchain node where the blockchain is located verifies the input information when it receives it. After the verification is completed, the input information is stored in the memory pool and the hash tree used to record the input information is updated; then, the update timestamp is updated to the time when the input information is received, and different random numbers are tried to calculate the eigenvalue multiple times. As a possible implementation method, if the SHA256 algorithm is used to calculate the eigenvalue, the calculated eigenvalue can satisfy the following formula:

[0050] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET

[0051] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0052] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the blockchain node where the blockchain is located sends the newly generated block to other blockchain nodes in the data sharing system where it is located according to the node identification of other blockchain nodes in the data sharing system. Other blockchain nodes verify the newly generated block and add the newly generated block to the blockchain stored in it after the verification is completed.

[0053] Based on the above introduction, it can be known that each blockchain node on the blockchain saves the same block ledger and status data and other data related to the newly generated blocks. However, in many actual application scenarios, the data generated by certain businesses may not want to be saved by all blockchain nodes to improve the privacy of the data. In related technologies, establishing a channel or sub-chain to achieve data isolation on the blockchain will not only consume a large amount of system resources, but also require a lot of manpower to maintain an extremely large number of sub-chains or channels, resulting in serious waste of manpower and resources.

[0054] Based on this, the embodiments of the present application provide a blockchain-based data processing method and related devices, which realize data isolation based on the correspondence between smart contracts and blockchain nodes, without the need to establish channels or sub-chains, thereby reducing the waste of manpower and resources.

[0055] The data processing method based on blockchain provided in this application can be applied to computer devices with data processing capabilities based on blockchain, such as terminal devices and servers. Among them, the terminal device can be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an Internet of Things device and a portable wearable device. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart car device, etc. The smart car device can be a car navigation terminal and a car computer, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc., but it is not limited to this; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Terminal devices and servers can be directly or indirectly connected by wired or wireless communication, and this application does not limit this.

[0056] In order to facilitate understanding of the blockchain-based data processing method provided in the embodiment of the present application, the following takes the execution subject of the blockchain-based data processing method as an example of a server to exemplify the application scenario of the blockchain-based data processing method.

[0057] To facilitate subsequent explanations, the functions of various blockchain nodes included in the data sharing system are first explained below.

[0058] (1) Collaborative blockchain node: a blockchain node that has the authority to run a certain smart contract, including a first collaborative blockchain node and a second collaborative blockchain node. The first collaborative blockchain node and the second collaborative blockchain node are different. The first collaborative blockchain node is the collaborative blockchain node before the collaborative blockchain node is modified for a certain smart contract, and the second collaborative blockchain node is the collaborative blockchain node after the collaborative blockchain node is modified for a certain smart contract.

[0059] (2) Primary collaborative blockchain node: The blockchain node that first receives the operation request from the user. The primary collaborative blockchain node generally generates blocks based on the operation request from the user and obtains block data used to describe the blocks. It is a blockchain node with the authority to run a certain smart contract. The number of primary collaborative blockchain nodes in a data sharing system is generally one.

[0060] (3) Slave collaborative blockchain node: a blockchain node with the authority to run a certain smart contract, used to verify the block data from the master collaborative blockchain node. The number of slave collaborative blockchain nodes in the data sharing system can be 0, 1, or more. The slave collaborative block node includes a first slave collaborative blockchain node and a second slave collaborative blockchain node. The first slave collaborative blockchain node is a blockchain node other than the master collaborative blockchain node in the first collaborative blockchain node, and the second slave collaborative blockchain node is a blockchain node other than the master collaborative blockchain in the second collaborative blockchain node.

[0061] (4) Non-collaborative blockchain nodes: among the multiple blockchain nodes included in the data sharing system, for a certain smart contract, the blockchain nodes other than the main collaborative blockchain node and the slave collaborative blockchain node among the multiple blockchain nodes, that is, the non-collaborative blockchain nodes are blockchain nodes that do not have the authority to run the certain smart contract, and the number of non-collaborative blockchain nodes in the data sharing system can be 0, 1, or more. The non-collaborative blockchain nodes include a first non-collaborative blockchain node and a second non-collaborative blockchain node. The first non-collaborative blockchain node is a blockchain node other than the main collaborative blockchain node and the first slave collaborative blockchain node among the multiple blockchain nodes, or the first non-collaborative blockchain node is a blockchain node other than the first collaborative blockchain node among the multiple blockchain nodes. The second non-collaborative blockchain node is a blockchain node other than the main collaborative blockchain node and the second slave collaborative blockchain node among the multiple blockchain nodes, or the second non-collaborative blockchain node is a blockchain node other than the second collaborative blockchain node among the multiple blockchain nodes.

[0062] (5) Other blockchain nodes: The number of blockchain nodes other than the main collaborative blockchain node included in the data sharing system can be 0, 1 or more.

[0063] (6) Target blockchain node: belongs to other blockchain nodes, which can be any blockchain node among other blockchain nodes. Generally, the number of target blockchain nodes in a data sharing system is 1.

[0064] See also Figure 2 , which is a schematic diagram of an application scenario of the blockchain-based data processing method provided in the embodiment of the present application. Figure 2 As shown, the application scenario includes a terminal device 210 and a data sharing system 220. The data sharing system 220 includes a server 221, a server 222, and a server 223. The terminal device 210 and the data sharing system 220 can communicate through a network, and the multiple servers included in the data sharing system 220 can also communicate through a network.

[0065] The terminal device 210 is also called the user end, and the user can upload a new smart contract, modify the smart contract already deployed on the blockchain, and other operation requests through the terminal device 210. The data sharing system 220 is also called the service end, and the servers 221, 222, and 223 included therein are all blockchain nodes.

[0066] It is understandable that the master collaborative blockchain node, the slave collaborative blockchain node and the non-collaborative blockchain node are all relative concepts for a smart contract. Figure 2 For example, for smart contract A, server 222 may be a slave collaborative blockchain node; for smart contract B, server 222 may be a non-collaborative blockchain node. For the convenience of explanation, the following describes the blockchain-based data processing method provided in the embodiment of the present application, taking server 221 as the master collaborative blockchain node.

[0067] The server 221 stores the correspondence between smart contracts and blockchain nodes in advance. The correspondence is used to describe the correspondence between each smart contract and the blockchain node with the authority to run the smart contract. That is, based on the correspondence, the slave collaborative blockchain node for a smart contract can be determined from multiple blockchain nodes. Figure 2 As shown, the correspondence between the smart contracts and the blockchain nodes is stored in the server 221 in the form of a table. The smart contract A has a corresponding relationship with the server 221 and the server 222, and the smart contract B has a corresponding relationship with the server 221 and the server 223.

[0068] In the process of executing multiple transactions based on the smart contract, the server 221 generates a new block and obtains block data for describing the block, which includes transaction information related to the multiple transactions. Figure 2As shown, transaction A is executed based on smart contract A, and transaction information related to transaction A is obtained. Transaction B is executed based on smart contract B, and transaction information related to transaction B is obtained. Therefore, the block data includes transaction information related to transaction A and transaction information related to transaction B.

[0069] Based on the correspondence between smart contracts and blockchain nodes, the server 221 can determine the blockchain nodes corresponding to the smart contracts used to execute each transaction, thereby obtaining an indirect correspondence between each blockchain node and each transaction. Figure 2 As shown, transaction A has an indirect correspondence relationship with server 222 , and transaction B has an indirect correspondence relationship with server 223 .

[0070] Taking the target blockchain node among multiple blockchain nodes as an example, the target blockchain node has the authority to execute at least one smart contract, based on which a transaction, namely the target transaction, can be executed, so that the target blockchain node has the authority to obtain transaction data related to the target transaction. Figure 2 , taking server 222 as the target blockchain node as an example, the target transaction corresponding to server 222 is transaction A, and server 222 has the authority to obtain transaction information related to transaction A, but does not have the authority to obtain transaction information related to transaction B. Similarly, when server 223 is the target blockchain node, the target transaction corresponding to server 223 is transaction B, and server 223 has the authority to obtain transaction information related to transaction B, but does not have the authority to obtain transaction information related to transaction A.

[0071] In order to improve the privacy of data, the transaction information related to each transaction can be sent to the corresponding blockchain node. Therefore, the server 221 does not send block data to each blockchain node, but sends corresponding desensitized data to each blockchain node in a targeted manner. Continuing with the target blockchain node as an example, it has the function of obtaining transaction information related to the target transaction, deleting transaction information related to non-target transactions from the block data, and obtaining desensitized data for the target blockchain node. The desensitized data includes transaction information related to the target transaction, but does not include transaction information related to non-target transactions, so that the block data obtained by the target blockchain node cannot view transaction information related to transactions executed by smart contracts that it does not have the running authority to execute. Figure 2 As shown, server 221 deletes the transaction information related to transaction A from the block data, obtains the desensitized data for server 222, and sends it to server 222. Similarly, server 221 deletes the transaction information related to transaction B from the block data, obtains the desensitized data for server 223, and sends it to server 223.

[0072] Thus, for the block data of each block, each blockchain node obtains the corresponding desensitized data, so that each blockchain node cannot obtain transaction information related to non-target transactions, that is, transaction information related to transactions executed by smart contracts that have no corresponding relationship with it, thereby achieving data isolation. In this way, the blockchain-based data processing method provided by the embodiment of the present application achieves data isolation based on the corresponding relationship between smart contracts and blockchain nodes, without the need to establish channels or sub-chains, thereby reducing the waste of manpower and resources.

[0073] The data processing method based on blockchain provided in the embodiment of the present application can be executed by the server. However, in other embodiments of the present application, the terminal device may also have similar functions as the server, thereby executing the data processing method based on blockchain provided in the embodiment of the present application, or the terminal device and the server jointly execute the data processing method based on blockchain provided in the embodiment of the present application, which is not limited in the present embodiment.

[0074] The blockchain-based data processing method provided by this application is introduced in detail below through a method embodiment.

[0075] See also Figure 3 , which is a flow chart of a data processing method based on blockchain provided in an embodiment of the present application. For ease of description, the following embodiment is still introduced by taking the execution subject of the data processing method based on blockchain as a server (a blockchain node, such as a primary collaborative blockchain node) as an example.

[0076] like Figure 3 As shown, the blockchain-based data processing method includes the following steps:

[0077] S301: Obtain block data for describing a block.

[0078] The blockchain is called a blockchain because it is a chain structure consisting of a bunch of blocks containing transaction information, connected end to end, and each block is a section of the chain structure. Figure 4 , which is a schematic diagram of a blockchain provided by an embodiment of the present application. Block 0 (generally referred to as the genesis block) is followed by block 1, and block 1 is followed by block 2, and so on, and each block is connected end to end to form a blockchain. Among them, block 0 can be called the parent block of block 1, and block 2 can be called the child block of block 1.

[0079] Block data is used to describe the data of the block. Figure 5 , which is a schematic diagram of a block data provided by an embodiment of the present application. A block is connected to a parent block and a child block respectively. The block mainly includes two parts, a block header and a block body, which are described below.

[0080] The block header is mainly used to store data related to some attributes of the block. For example, the parent block hash value, based on the negative block hash value, the block can be connected to its previous block. Another example is difficulty, timestamp and random number (Nonce). Another example is the version used to describe the version of the block.

[0081] The block body is used to store transaction information related to the transaction, or all transaction records generated during the block creation process that have been verified in the current block. In the embodiment of the present application, the block body includes transaction information related to each transaction, that is, multiple transaction information corresponding to multiple transactions. Figure 5 The middle block contains 4 transactions. Transaction information may include, for example, the transferee and the transferor.

[0082] The embodiments of the present application do not specifically limit the way in which blockchain nodes obtain block data. For example, a blockchain node (such as a main collaborative blockchain node) maintains a transaction pool, in which transactions waiting to be processed are stored, and new transactions will be submitted to the transaction pool, waiting to be packaged into a block. The blockchain node can schedule a batch of transactions from the transaction pool it maintains, wherein the basis for scheduling can be determined by the transaction fee, transaction size or other priority rules. When a transaction in this batch of transactions begins to execute, the smart contract corresponding to the transaction is started as a contract process, and the transaction is executed based on the pre-set calling method and parameters corresponding to the smart contract, and the transaction information related to the transaction is obtained. Thus, the smart contract corresponding to each transaction is called in turn, the transaction information related to each transaction is obtained, and it is added to the transaction list of the block body, and then a new block is generated to obtain the block data used to describe the block.

[0083] S302: According to the correspondence between smart contracts and blockchain nodes, determine the blockchain nodes corresponding to the smart contracts used to execute each transaction.

[0084] Each blockchain node can store the correspondence between smart contracts and blockchain nodes in a limited manner, and can also obtain the correspondence between smart contracts and blockchain nodes from the database when in use. Among them, smart contracts are a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. Smart contracts allow trusted transactions without a third party, and these transactions are traceable and irreversible. Since smart contracts cannot be modified once they are executed, they can be used to automate and fully supervise transactions on the blockchain, ensuring the security and credibility of transactions.

[0085] It should be noted that in order to achieve data isolation, each blockchain can be set to use smart contracts, rather than all blockchain nodes being able to use all smart contracts. In other words, in the correspondence between smart contracts and blockchain nodes, the blockchain nodes that have a corresponding relationship with the smart contract have the authority to run the smart contract.

[0086] Therefore, in the process of executing a transaction, the smart contract required to execute the transaction is called. Based on the correspondence between the smart contract and the blockchain node, the blockchain node corresponding to the smart contract required to execute the transaction can be determined, that is, the blockchain node with the authority to execute the transaction. Therefore, based on the correspondence between the smart contract and the blockchain node, the indirect correspondence between each transaction and the blockchain node can be obtained, that is, the blockchain node corresponding to the smart contract used to execute each transaction. The following takes the example of the main collaborative blockchain node sending data to the target blockchain node as an example.

[0087] S303: Determine the target transaction corresponding to the target blockchain node.

[0088] The master collaborative blockchain node is a blockchain node that obtains block data, that is, the blockchain node that executes S301 and S302. In other words, the master collaborative blockchain node is one of multiple blockchain nodes that can execute a smart contract. In addition, the blockchain nodes other than the master collaborative blockchain node among the multiple blockchain nodes that execute a smart contract are slave collaborative blockchain nodes.

[0089] The target blockchain node is a blockchain node other than the main collaborative blockchain node among the multiple blockchain nodes. The target transaction is a transaction executed by a smart contract that has a corresponding relationship with the target blockchain node, which can be one or more.

[0090] S304: Delete transaction information related to non-target transactions in the block data to obtain desensitized data for the target blockchain node.

[0091] Since the block data includes transaction information related to multiple transactions respectively, and the target blockchain node only has the function of obtaining transaction information related to the target transaction, when sending data related to the block to the target blockchain node, it is necessary to delete transaction information related to non-target transactions in the block data, wherein non-target transactions are transactions other than the target transactions among the multiple transactions included in the block data, that is, transactions executed by smart contracts that the target blockchain node does not have the authority to obtain.

[0092] Thus, transaction information related to non-target transactions is deleted from the block data, and transaction information related to the target transaction is retained, thereby obtaining desensitized data for the target blockchain node. The desensitized data deletes transaction information related to transactions that the target blockchain node does not have access to, thereby ensuring data isolation.

[0093] S305: Sending desensitized data for the target blockchain node to the target blockchain node.

[0094] As a possible implementation method, the blockchain includes multiple blockchain nodes, one of which serves as the main collaborative blockchain node. The main collaborative blockchain node obtains block data based on the user's operation request, and then uses the remaining blockchain nodes as target blockchain nodes to determine the desensitized data corresponding to each blockchain node and send it to the corresponding blockchain node, thereby achieving data desensitization.

[0095] It can be seen from the above technical solution that the block data used to describe the block is obtained, and the block data includes transaction information related to multiple transactions. The correspondence between smart contracts and blockchain nodes is used to describe the correspondence between each smart contract and the blockchain node with the authority to run the smart contract, and the transaction is executed based on the smart contract. According to the correspondence, the blockchain nodes corresponding to the smart contracts used to execute each transaction can be determined, thereby obtaining an indirect correspondence between each blockchain node and each transaction. Taking the target blockchain node among multiple blockchain nodes as an example, the target blockchain node has the authority to execute at least one smart contract, and can execute transactions based on the smart contract, that is, the target transaction, so that the target blockchain node has the authority to obtain transaction data related to the target transaction. Therefore, the transaction information related to non-target transactions in the block data is deleted, and the desensitized data for the target blockchain node is obtained. The desensitized data includes transaction information related to the target transaction, but does not include transaction information related to non-target transactions, so that the block data obtained by the target blockchain node cannot view the transaction information related to the transaction executed by the smart contract that it does not have the running authority. Therefore, for the block data of each block, each blockchain node obtains the corresponding desensitized data, so that each blockchain node cannot obtain transaction information related to non-target transactions, that is, transaction information related to transactions executed by smart contracts that have no corresponding relationship with it, thus achieving data isolation. Therefore, data isolation is achieved based on the corresponding relationship between smart contracts and blockchain nodes, without the need to establish channels or sub-chains, reducing the waste of manpower and resources.

[0096] As a possible implementation method, the block data includes not only transaction information related to multiple transactions, but also identification information generated for each transaction, each identification information is used to identify each transaction, and each transaction can be verified based on the identification information. Based on this, the embodiment of the present application provides a specific implementation method of the aforementioned S304, that is, deleting the transaction information related to non-target transactions in the block data to obtain a specific implementation method for desensitized data for the target blockchain node.

[0097] Specifically, the transaction information related to the non-target transaction in the block data is deleted, and the identification information of the non-target transaction is retained to obtain the desensitized data for the target blockchain node. That is, in the block data, only the transaction information related to the non-target transaction is deleted, and the identification information related to the non-target transaction is retained, so that when the target blockchain node verifies the desensitized data, the target blockchain will verify each transaction one by one.

[0098] Taking the ith transaction as an example, if the desensitized data includes transaction information related to the ith transaction, it means that the ith transaction is the target transaction, and the target blockchain node has the authority to obtain transaction information related to the ith transaction, then the ith transaction information is verified based on the identification information of the ith transaction. For example, the target blockchain node obtains whether the identification information to be verified is consistent with the identification information of the ith transaction included in the desensitized data based on the transaction information of the ith transaction. If they are consistent, the verification passes; if they are inconsistent, the verification fails, and an error prompt indicating that the node mark verification result is inconsistent can be returned. If the ith transaction does not include transaction information related to the ith transaction, it means that the ith transaction is not the target transaction, and the target blockchain node does not have the authority to obtain transaction information related to the ith transaction. At this time, there is no need to verify the ith transaction, and the verification of the ith transaction can be skipped, where i is an integer greater than 0.

[0099] Thus, while deleting the transaction information related to non-target transactions in the block data, the identification information related to non-target transactions can be retained, and the desensitized data for the target blockchain node can be obtained, which not only makes it impossible for the target blockchain node to obtain transaction information related to non-transactions, but also makes it possible for transaction verification to be performed only in the collaborative blockchain nodes (the main collaborative blockchain node and the slave collaborative blockchain node for a certain smart contract), thus achieving data isolation. Moreover, in the process of verifying based on the desensitized data, the target blockchain node can also skip transactions with only identification information and only verify transactions with both identification information and transaction information, thereby increasing the verification speed of transactions.

[0100] The embodiment of the present application does not specifically limit the identification information. For example, the identification information may be a hash value obtained based on the transaction information. As a possible implementation method, if the identification information is a hash value obtained based on the transaction information, after obtaining the hash value corresponding to each transaction, the hash values ​​may be calculated in pairs in the form of a binary tree to obtain a Merkle tree, and the Merkle root of the Merkle tree may be written into the block header.

[0101] Among them, the Merkle tree (also called hash tree) is a typical binary tree structure, consisting of a root node, a set of intermediate nodes and a set of leaf nodes. Its main features are: (1) the bottom leaf node contains stored data or its hash value; (2) non-leaf nodes (including intermediate nodes and root nodes) are the hash values ​​of the contents of its two child nodes. Furthermore, the Merkle tree can be extended to the case of a multi-branch tree, in which case the content of a non-leaf node is the hash value of the content of all its child nodes.

[0102] The Merkle tree records hash values ​​layer by layer, which gives it some unique properties. For example, any changes to the underlying data will be passed to its parent node, layer by layer along the path to the root of the tree. This means that the value of the root of the tree actually represents a "digital summary" of all the underlying data.

[0103] See also Figure 6 , which is a schematic diagram of a block data provided by an embodiment of the present application. Figure 6 In the block, 4 transactions are included. After calculating the hash value based on each transaction information, hash value 1, hash value 2, hash value 3 and hash value 4 are obtained. The hash values ​​are calculated two by two, that is, hash value 12 is obtained based on hash value 1 and hash value 2, hash value 34 is calculated based on hash value 3 and hash value 4, and finally hash value 1234 is obtained based on hash value 12 and hash value 34, and hash value 1234 is written into the block header as the Merkle root.

[0104] Based on this, the main collaborative blockchain node can call the smart contract corresponding to each transaction based on each transaction included in the block, and execute the corresponding transactions respectively. As a possible implementation method, if the transaction execution fails, an error prompt of contract execution failure is returned; if the transaction execution is successful, a transaction read-write set is generated, that is, a set of reads and writes of blockchain state data generated by the transaction. After the transaction is executed, the transaction information related to each transaction is obtained. According to the transaction information related to each transaction, the corresponding hash value is generated to obtain the complete Merkle tree for the block. The Merkle root is written into the block header, and the block is generated to obtain the block data.

[0105] The main collaborative blockchain node can determine the desensitized data of the target blockchain node based on the correspondence between the smart contract and the blockchain node. Since the desensitized data only deletes the transaction information related to non-target transactions compared to the block data, the desensitized data includes a complete Merkle tree. Although the desensitized data includes a complete Merkle tree, each device cannot reversely deduce the transaction information corresponding to each hash value based on the hash value, thereby ensuring the security of the transaction information related to each transaction. Moreover, the target blockchain node can verify all block data based on the Merkle tree (such as whether all transaction information received based on the Merkle root is consistent with the main collaborative blockchain node), and then verify each target transaction based on the transaction information related to the target transaction in the desensitized data and the hash value of each node in the Merkle tree, so as to achieve the purpose of rapid verification.

[0106] As a possible implementation method, after the main collaborative blockchain node uses other blockchain nodes as target blockchain nodes, it obtains the desensitized data for other blockchain nodes and sends the corresponding desensitized data to other blockchain nodes. Among them, other blockchain nodes are blockchain nodes other than the main collaborative blockchain node among multiple blockchain nodes.

[0107] The other blockchain nodes perform verification based on the received desensitized data to obtain verification results, which are used to identify whether the desensitized data received by other blockchain nodes has passed the verification. For example, the target blockchain node is based on the transaction information in the received desensitized data. If the identification information to be verified obtained by the target blockchain node based on the transaction information is consistent with the identification information in the received desensitized data, the verification passes, otherwise, the verification fails. The other blockchain nodes send the verification results to the main collaborative blockchain node respectively. As a possible implementation method, the other blockchain nodes send the verification results to each blockchain node, including the main collaborative blockchain node, by broadcasting.

[0108] The main collaborative blockchain node stores the block data based on the received multiple verification results, if the number of blockchain nodes that pass the verification is greater than the first preset threshold value based on the multiple verification results. For example, the block data is stored in the block ledger and the status data respectively. The embodiment of the present application does not specifically limit the size of the first preset threshold value, and those skilled in the art can set it according to actual needs.

[0109] As a possible implementation, if other blockchain nodes send verification results to each blockchain node based on broadcasting, other blockchain nodes can also determine based on multiple verification results that the number of blockchain nodes that pass the verification is greater than the first preset threshold, and then store the desensitized data in the block. For example, the desensitized data is stored in the block ledger and the status data respectively.

[0110] As a possible implementation method, if it is determined based on multiple verification results that the number of blockchain nodes that have passed the verification is less than or equal to a first preset threshold, an error prompt indicating that the node authentication has failed may be returned.

[0111] Therefore, the main collaborative blockchain node sends its corresponding desensitized data to each blockchain node, and each blockchain node verifies based on the desensitized data and sends the verification result to the main collaborative blockchain node. If the number of blockchain nodes that pass the verification is greater than the first preset threshold based on the verification result, it means that the blockchain nodes that pass the verification account for the majority of the multiple blockchain nodes. Based on the principle of minority obeys majority, the block data can be stored in the block. While ensuring data isolation, data security is guaranteed.

[0112] As a possible implementation method, before calling a smart contract to execute a transaction, the smart contract needs to be deployed in the blockchain. The following is an example of the smart contract to be deployed as the target smart contract.

[0113] The main collaborative blockchain node obtains a smart contract deployment request, wherein the smart contract deployment request includes a target smart contract and a first collaborative blockchain node with the ability to run the target smart contract, the first collaborative blockchain node is a blockchain node with the authority to run the target smart contract, and the first collaborative blockchain node includes the main collaborative blockchain node. The main collaborative blockchain node establishes a first target correspondence between the target smart contract and the first collaborative blockchain node, and the first target correspondence refers to the correspondence between the target smart contract and the first collaborative blockchain node. The first target correspondence is written into the correspondence between the smart contract and the blockchain node, so that the blockchain node corresponding to the target smart contract can be obtained based on the correspondence between the smart contract and the blockchain node.

[0114] For example, if the user wants to deploy a smart contract, namely the target smart contract, then a smart contract deployment request is sent to any blockchain node in the first collaborative blockchain node that has the authority to run the target smart contract. Among them, the node that receives the smart contract deployment request is the main collaborative blockchain node. The correspondence between smart contracts and blockchain nodes pre-saved by the main collaborative blockchain node records the correspondence between smart contracts and blockchain nodes that have the authority to run them. If a new target smart contract is added, a first target correspondence is established between the target smart contract and the first collaborative blockchain node that has a corresponding relationship with it, and the first target correspondence is written into the correspondence between the smart contract and the blockchain node, so that the blockchain node with the authority to run the smart contract can be determined based on the correspondence between the smart contract and the blockchain node.

[0115] It should be noted that if there is no corresponding relationship between the smart contract and the blockchain node after the first target corresponding relationship is established, an empty corresponding relationship between the smart contract and the blockchain node can be established, and then the first target corresponding relationship can be written into the corresponding relationship between the smart contract and the blockchain node.

[0116] Therefore, the main collaborative blockchain node can establish a first target correspondence relationship between the target smart contract and the first collaborative blockchain node with the authority to run the target smart contract based on the smart contract deployment request sent by the user terminal, and write the first target correspondence relationship into the correspondence relationship between the smart contract and the blockchain node, so that the first collaborative blockchain node that has a correspondence with the target smart contract can be determined based on the correspondence relationship between the smart contract and the blockchain node, thereby continuously maintaining the correspondence between the smart contract and the blockchain node based on the newly added smart contract.

[0117] As the usage time of the correspondence between smart contracts and blockchain nodes increases, the correspondence between smart contracts and blockchain nodes will include more and more content, which is not conducive to storage or quick search. Based on this, the first smart contract to be deleted can be identified from multiple deployed smart contracts, that is, the smart contract whose difference between the last call time and the current time is greater than the preset time threshold, or the smart contract that has not been used for a long time is the first smart contract to be deleted. The embodiment of the present application does not specifically limit the size of the preset time threshold, and those skilled in the art can set it according to actual needs. From the correspondence between smart contracts and blockchain nodes, delete the first smart contract to be deleted and its corresponding blockchain node, that is, delete the corresponding relationship established with the first smart contract to be deleted.

[0118] Therefore, through the last call time of the smart contract, the smart contract that has not been used for a long time can be identified and regarded as the first smart contract to be deleted. The correspondence between the first smart contract to be deleted and its corresponding blockchain node is deleted from the correspondence between the smart contract and the blockchain node, thereby reducing the amount of content stored in the correspondence between the smart contract and the blockchain node, which not only saves storage space but also allows the corresponding smart contract to be quickly found based on the blockchain node in less content.

[0119] As a possible implementation method, since the target smart contract is newly added, the target smart contract can be initialized and a separate block can be generated to let the cooperative blockchain node corresponding to the target smart contract know that the target smart contract has been newly added. Specifically, the target smart contract is initialized to obtain the initial transaction information of the transaction corresponding to the target smart contract; the initial block data is generated based on the initial transaction information; and the initial block data is sent to the first slave cooperative blockchain node.

[0120] The initial transaction information is the transaction information related to the transaction corresponding to the first execution of the target smart contract. The block described by the initial block data includes the transaction corresponding to the first execution of the target smart contract. The first slave collaborative blockchain node is the blockchain node other than the master collaborative blockchain node in the first collaborative blockchain node. The first slave collaborative blockchain node and the master collaborative blockchain node constitute the collaborative blockchain node corresponding to the target smart contract.

[0121] For example, the main collaborative blockchain node schedules the initial transaction corresponding to the target smart contract and stores the target smart contract in the contract warehouse, where the contract warehouse stores the smart contracts deployed in the blockchain. The main collaborative blockchain node starts the target smart contract as a contract process and initializes it based on the preset initialization method and parameters. If the initialization is successful, the initial block data can be obtained, and the initial block data includes the transaction information of the initial transaction corresponding to the target smart contract. A transaction read-write set can be generated based on the transaction information related to the initial transaction. A Merkle tree can also be generated based on the transaction information related to the initial transaction. Finally, the block including the initial transaction is produced to obtain the initial block data used to describe the block. The main collaborative blockchain node sends the initial block data to the first collaborative blockchain node so that the first collaborative blockchain node can verify and deploy it.

[0122] It should be noted that since the first collaborative blockchain node has the authority to run the target smart contract, in addition to the main collaborative blockchain node, only the first collaborative blockchain node has the authority to obtain the initial block data. After the initial block data is generated, the initial block data is only sent to the first collaborative blockchain node to achieve data isolation.

[0123] Therefore, the main collaborative blockchain node initializes the newly added target smart contract, and blocks the obtained initial transaction information separately, and sends the initial block data to the first collaborative blockchain node, but does not send the initial block data to the first non-collaborative blockchain node. In this way, while achieving data isolation, the first slave collaborative blockchain node can not only know that it has execution authority for the target smart contract, but also can perform verification based on the initial block data, thereby ensuring data security.

[0124] As a possible implementation method, the initial block data can be generated not only based on the initial transaction information, but also based on the first identification information, wherein the first identification information is generated based on the initial transaction information and is used to identify the initial transaction information. In this way, while achieving data isolation, data verification can also be achieved, and the corresponding desensitized data can be sent to the first non-collaborative blockchain node. The following is a detailed description.

[0125] Since the initial block data only includes transaction information related to the initial transaction corresponding to the target smart contract, and no transaction information related to other transactions, the initial transaction information in the initial block data can be deleted, and the first identification information is retained to obtain the initial desensitized data. The initial desensitized data is sent to the first non-cooperative blockchain node, that is, the blockchain node other than the first cooperative blockchain node among the multiple blockchain nodes, that is, the blockchain node that does not have the permission to run the target smart contract.

[0126] Thus, the main collaborative blockchain node sends the initial block data to the first collaborative blockchain node, and sends the corresponding initial desensitized data to the first non-collaborative blockchain node, and sends different data to blockchain nodes with different permissions to achieve data isolation. Moreover, the desensitized data received by the first non-collaborative blockchain node includes the transaction identifier of each transaction, and each transaction can be quickly verified based on the transaction identifier without knowing the specific content of the transaction.

[0127] Furthermore, the first non-collaborative blockchain node can perform verification based on the initial desensitized data, obtain a verification result, and send the verification result to the main collaborative blockchain node; the first collaborative blockchain node can perform verification based on the initial blockchain data, obtain a verification result, and send the verification result to the main collaborative blockchain node.

[0128] It should be noted that after receiving the initial desensitized data, the first non-collaborative blockchain node can skip the transactions that only include identification information in the initial desensitized data and do not verify them, but only verify the transactions that have both identification information and transaction information, so as to speed up the verification.

[0129] The main collaborative blockchain node receives the verification results sent by other blockchain nodes, wherein the other blockchain nodes include a first collaborative blockchain node and a first non-collaborative blockchain node. The verification result is used to identify whether the data received by other blockchain nodes has passed the verification. For example, the verification result is used to identify whether the initial block data received by the first collaborative blockchain node has passed the verification. As another example, the verification result is used to identify whether the initial desensitized data received by the first non-collaborative blockchain node has passed the verification. If the main collaborative blockchain node determines based on the verification result that the number of blockchain nodes that have passed the verification is greater than the second preset threshold, the initial block number is stored in the block. The embodiment of the present application does not specifically limit the size of the second preset threshold, and those skilled in the art can set it according to actual needs. For example, the second preset threshold is consistent with the size of the first preset threshold.

[0130] Therefore, the main collaborative blockchain node sends its corresponding initial desensitized data to each first non-collaborative blockchain node, each first non-collaborative blockchain node verifies based on the initial desensitized data, and sends the verification result to the main collaborative blockchain node. If the number of blockchain nodes that pass the verification is greater than the first preset threshold value based on the verification result, it means that the blockchain nodes that pass the verification account for the majority of the multiple blockchain nodes. Based on the principle of minority obeys majority, the block data can be stored in the block. While ensuring data isolation, data security is guaranteed.

[0131] As a possible implementation method, the correspondence between the smart contract and the blockchain node can be modified to adjust the correspondence between the deployed smart contract and the blockchain node. Specifically, a collaborative blockchain node modification request is obtained, and the collaborative blockchain node modification request includes a second collaborative blockchain node and a historical smart contract. A second target correspondence between the historical smart contract and the second collaborative blockchain node is established, and the correspondence between the smart contract and the blockchain node is modified based on the second target correspondence.

[0132] The second collaborative blockchain node is a blockchain node with the authority to run the historical smart contract. Before the collaborative blockchain node is obtained, the blockchain node with the authority to run the historical smart contract is different from the second collaborative blockchain node. For example, the collaborative blockchain nodes corresponding to the historical smart contract were originally blockchain node 1 and blockchain node 2. After the collaborative blockchain node is obtained, the collaborative blockchain nodes corresponding to the historical smart contract may be blockchain node 2 and blockchain node 3. At this time, the second blockchain node is blockchain node 2 and blockchain node 3.

[0133] A historical smart contract is a smart contract that already exists in the corresponding relationship between smart contracts and blockchain nodes, that is, the historical smart contract has been deployed in the blockchain and already has a corresponding collaborative blockchain node. It is understandable that the collaborative blockchain node modification request can carry the contract identifier of the historical smart contract, so as to determine the historical smart contract based on the contract identifier, and this application does not make specific limitations on this.

[0134] It should be noted that the collaborative blockchain node modification request may include a collaborative blockchain node addition request, a collaborative blockchain node deletion request, and a collaborative blockchain node addition and deletion request. Since the second collaborative blockchain node may have added at least one blockchain node, deleted at least one blockchain node, or added and deleted at the same time compared to the blockchain node that has the authority to run the historical smart contract before obtaining the collaborative blockchain node, based on this, when modifying the correspondence between the smart contract and the blockchain node based on the second target correspondence, the blockchain node originally corresponding to the historical smart contract may be added, deleted, or added and deleted at least one blockchain node in the correspondence between the smart contract and the blockchain node, so that the correspondence between the smart contract and the blockchain node includes the second target correspondence, that is, the historical smart contract corresponds to the second collaborative blockchain node. Alternatively, in the correspondence between the smart contract and the blockchain node, the blockchain node corresponding to the historical smart contract may be deleted first, and then the second target correspondence may be added.

[0135] Therefore, if you want to modify the collaborative blockchain node corresponding to a historical smart contract, you do not need to revise the historical smart contract or recreate the smart contract. Instead, you can modify the collaborative blockchain node corresponding to the historical smart contract in the correspondence between the smart contract and the blockchain during the operation of the historical smart contract, thereby dynamically modifying (such as adding or deleting collaborative blockchain nodes) the collaborative blockchain node corresponding to the historical smart contract, which is convenient and fast and does not affect the use of the historical smart contract.

[0136] As a possible implementation method, in order to prevent the correspondence between smart contracts and blockchain nodes from being modified at will, permissions can be set for blockchain nodes to ensure that only authorized blockchain nodes can change the correspondence between smart contracts and blockchain nodes. Specifically, the collaborative blockchain node modification request also includes permission information, which is used to identify the permission of the sender of the collaborative blockchain node modification request. Based on the permission information, it can be determined whether the user end (the sender of the collaborative blockchain node modification request) has the permission to modify the correspondence between the smart contract and the blockchain node. If it is determined based on the permission information that the sender has the permission to modify the correspondence between the smart contract and the blockchain node, the correspondence between the smart contract and the blockchain node is modified based on the second target correspondence.

[0137] It should be noted that whether the user terminal has the right to modify the correspondence between the smart contract and the blockchain node can be determined based on the type and permission information of the transaction corresponding to the historical smart contract. For example, if the type of transaction corresponding to the historical smart contract is a configuration type transaction, if the user terminal that sends the collaborative blockchain node modification request does not have the permission to execute the configuration type transaction, an error prompt that it has no right to configure is sent to the user terminal. If the user terminal that sends the collaborative blockchain node modification request has the permission to execute the configuration type transaction, the correspondence between the smart contract and the blockchain node is modified based on the second target correspondence.

[0138] As a possible implementation method, after obtaining the collaborative blockchain node modification request, the main collaborative blockchain node obtains the change transaction information of the transaction corresponding to the historical smart contract based on the historical smart contract, generates change block data based on the change transaction information, and sends the change block data to the second slave collaborative blockchain node, wherein the second slave collaborative blockchain node is a blockchain node in the second collaborative blockchain node except the main collaborative blockchain node.

[0139] For example, the main collaborative blockchain node calls the historical smart contract as a contract process, and executes the transaction corresponding to the historical smart contract based on the preset calling method and parameters, obtains the change transaction information, and can generate a Merkle tree based on the change transaction information. Finally, the block including the transaction corresponding to the historical smart contract is generated, and the change block data used to describe the block is obtained. The main collaborative blockchain node sends the change block data to the second collaborative blockchain node so that the second collaborative blockchain node can verify and deploy it.

[0140] It should be noted that since the second collaborative blockchain node has the authority to run historical smart contracts, in addition to the main collaborative blockchain node, only the second collaborative blockchain node has the authority to obtain the changed block data. After the changed block data is generated, the changed block data is only sent to the second collaborative blockchain node to achieve data isolation.

[0141] Therefore, after obtaining the modification request from the collaborative blockchain node, the main collaborative blockchain node runs the historical smart contract again, and blocks the obtained change transaction information separately, and only sends the change block data to the second slave collaborative blockchain node, but does not send the change block data to the second non-collaborative blockchain node. In this way, while achieving data isolation, the second slave collaborative blockchain node can not only know that the corresponding collaborative blockchain node has been modified for the historical smart contract, but also can perform verification based on the change block data, thereby ensuring data security.

[0142] As a possible implementation method, the change block data can be generated not only based on the change transaction information, but also based on the second identification information, wherein the second identification information is generated based on the change transaction information and is used to identify the change transaction information. In this way, data isolation can be achieved while data verification can be achieved, and the corresponding desensitized data can be sent to the second non-cooperative blockchain node. The following is a detailed explanation.

[0143] Since the change block data only includes the change transaction information related to the transaction corresponding to the historical smart contract, and no transaction information related to other transactions, the change transaction information in the change block data can be deleted, and the second identification information is retained to obtain the change desensitized data. The change desensitized data is sent to the second non-cooperative blockchain node, that is, the blockchain node other than the second cooperative blockchain node among the multiple blockchain nodes, that is, the blockchain node without the permission to run the historical smart contract.

[0144] Thus, the main collaborative blockchain node sends the changed block data to the second collaborative blockchain node, and sends the corresponding changed desensitized data to the second non-collaborative blockchain node, and sends different data to blockchain nodes with different permissions to achieve data isolation. Moreover, the changed desensitized data received by the second non-collaborative blockchain node includes the transaction identifier of each transaction, so that each transaction can be quickly verified based on the transaction identifier without knowing the specific content of the transaction.

[0145] Furthermore, the second non-collaborative blockchain node can perform verification based on the changed desensitized data, obtain the verification result, and send the verification result to the main collaborative blockchain node; the second collaborative blockchain node can perform verification based on the changed blockchain data, obtain the verification result, and send the verification result to the main collaborative blockchain node.

[0146] It should be noted that after receiving the change-masked data, the second non-collaborative blockchain node can skip the transactions that only include identification information in the change-masked data and do not verify them, but only verify the transactions that have both identification information and transaction information, so as to speed up the verification.

[0147] The main collaborative blockchain node receives the verification results sent by other blockchain nodes, wherein the other blockchain nodes include a second collaborative blockchain node and a second non-collaborative blockchain node. The verification result is used to identify whether the data received by other blockchain nodes has passed the verification. For example, the verification result is used to identify whether the changed block data received by the second collaborative blockchain node has passed the verification. As another example, the verification result is used to identify whether the changed desensitized data received by the second non-collaborative blockchain node has passed the verification. If the main collaborative blockchain node determines based on the verification result that the number of blockchain nodes that have passed the verification is greater than the third preset threshold, the block is stored in the changed block data. The embodiment of the present application does not specifically limit the size of the third preset threshold, and those skilled in the art can set it according to actual needs. For example, the third preset threshold is consistent with the size of the first preset threshold.

[0148] Therefore, after obtaining the modification request of the collaborative blockchain node, the main collaborative blockchain node sends the changed block data to the second slave collaborative blockchain node, and sends the corresponding changed desensitized data to the second non-collaborative blockchain node. The second non-collaborative blockchain node verifies based on the changed desensitized data, and sends the verification result to the main collaborative blockchain node. If the number of blockchain nodes that pass the verification is determined to be greater than the third preset threshold based on the verification result, it means that the blockchain nodes that pass the verification account for the majority of the multiple blockchain nodes. Based on the principle of minority obeys majority, the changed block data can be stored in the block. While ensuring data isolation, data security is guaranteed.

[0149] As a possible implementation, if the second collaborative blockchain node includes a newly added collaborative blockchain node, the newly added collaborative blockchain node refers to a blockchain node newly added to the second collaborative blockchain node compared to the collaborative blockchain node corresponding to the historical smart contract before receiving the collaborative blockchain node modification request. For example, if the collaborative blockchain nodes corresponding to the historical smart contract were originally blockchain node 1 and blockchain node 2, after obtaining the collaborative blockchain nodes, the collaborative blockchain nodes corresponding to the historical smart contract may be blockchain node 1, blockchain node 2, and blockchain node 3. At this time, the second blockchain nodes are blockchain node 1, blockchain node 2, and blockchain node 3, and the newly added blockchain node is blockchain node 3.

[0150] After multiple blockchain nodes including the main collaborative blockchain node store the changed block data, the newly added collaborative blockchain node sends the synchronization block data to the second collaborative blockchain node corresponding to the historical smart contract, so that the second collaborative blockchain node can synchronize the blockchain data based on the synchronization block data. For example, the main collaborative blockchain node obtains the synchronization block data from the newly added collaborative blockchain node, and synchronizes the blockchain data based on the synchronization block data. As a possible implementation method, if an exception occurs during the synchronization of blockchain data, an error prompt of the synchronization exception of the newly added blockchain node is sent to the user end. If no exception occurs during the synchronization of blockchain data, the synchronization of blockchain data is successful, and the addition of the collaborative blockchain node of the historical smart contract is completed.

[0151] Therefore, if the second collaborative blockchain node includes a newly added collaborative blockchain node, or in other words, the collaborative blockchain node modification request is used to add a new blockchain node with the authority to execute the historical smart contract, then after the changed block data is stored in the block, the synchronization block data from the newly added collaborative blockchain node is obtained, and the blockchain data is synchronized based on the synchronization block data, so that data can be shared between the second collaborative blockchain nodes.

[0152] As a possible implementation method, the number of blockchain nodes corresponding to each smart contract in the deployed smart contracts can be continuously detected. If the number of collaborative blockchain nodes corresponding to a smart contract is zero, or in other words, no blockchain node has the authority to execute a smart contract, then the smart contract is confirmed as the second smart contract to be deleted. The second smart contract to be deleted will not be used to execute transactions, so the second smart contract to be deleted is deleted to release memory and reduce storage space occupancy.

[0153] As a possible implementation method, in order to reduce the time of detecting the collaborative blockchain nodes corresponding to the smart contract, targeted detection can be performed. Specifically, if the second collaborative blockchain node includes a deleted collaborative blockchain node, or in other words, the collaborative blockchain node modification request is used to delete a blockchain node with the authority to execute a historical smart contract, the number of collaborative blockchain nodes corresponding to the historical smart contract may be zero during the deletion process. Therefore, if the second collaborative blockchain node includes a deleted collaborative blockchain node, the number of collaborative blockchain nodes of the historical smart contract is detected. If the number of collaborative blockchain nodes of the historical smart contract is 0, the historical smart contract is used as the second smart contract to be deleted, and the second smart contract to be deleted is deleted.

[0154] In order to facilitate further understanding of the technical solution provided in the embodiment of the present application, the following is an overall exemplary introduction to the blockchain-based data processing method provided in the embodiment of the present application, taking the execution subject of the blockchain-based data processing method provided in the embodiment of the present application as a server.

[0155] First, the internal structure of the blockchain node is explained.

[0156] See also Figure 7 , which is a schematic diagram of the internal structure of a storage node provided by an embodiment of the present application. The storage node 700 includes a network module 710, an authentication module 720, a consensus module 730, a storage module 740 and a virtual machine module 750. Each module is described below.

[0157] (1) Network module 710, used to communicate with other blockchain nodes and user terminals, for example, to obtain smart contract deployment requests from user terminals.

[0158] (2) Authentication module 720, used to verify the authority of the blockchain node, save digital certificates, etc. As a possible implementation, the authentication module 720 may also include a blockchain certificate submodule 721 and an authentication algorithm submodule 722.

[0159] Among them, the blockchain certificate submodule 721 is used to store the digital certificates of each blockchain node, such as the digital certificate of the blockchain node can be obtained when the blockchain node is registered. The authentication algorithm submodule 722 is used to verify the legitimacy of the digital certificate, user authority, etc., so as to verify whether the request such as the smart contract deployment request comes from a trusted blockchain node.

[0160] (3) A consensus module 730 is used to reach consensus on blocks from various blockchain nodes. As a possible implementation, the consensus module 730 may also include a block broadcast submodule 731 and a block verification submodule 732.

[0161] Among them, the block broadcast submodule 731 is used to broadcast the block generated or signed by the current blockchain node (such as the main collaborative blockchain node). The block verification submodule 732 is used to verify the transaction information related to each transaction, for example, whether the identification information to be verified based on the transaction information of the i-th transaction is consistent with the identification information of the i-th transaction included in the desensitized data.

[0162] (4) Storage module 740, used to store block data. As a possible implementation, storage module 740 may include contract node table 741, block ledger 742 and status data 743.

[0163] Among them, the contract node table 741 is used to store the corresponding relationship between smart contracts and blockchain nodes. The block ledger 742 is used to store data from block data, such as block data source data in block data. The state data 743 is used to store data from block data, such as state data in block data.

[0164] (5) Virtual machine module 750, used to execute operations related to smart contracts. As a possible implementation, virtual machine module 750 may include transaction scheduling submodule 751, contract repository 752, contract process 753, transaction read / write set 754 and Merkle tree 755.

[0165] Among them, the transaction scheduling submodule 751 is used to schedule the transactions of a block to different contract processes for execution. The contract warehouse 752 is used to store the smart contracts that have been deployed on the blockchain. The contract process 753 is used to run the smart contract. The transaction read and write set 754 is a set of reads and writes of the blockchain state data generated by the transaction. The Merkle tree 755 refers to the Merkle tree of the transaction, which stores the transaction information related to the transaction when it belongs to the collaborative blockchain node, and stores the identification information of the transaction when it does not belong to the collaborative blockchain node.

[0166] The following four embodiments are used to exemplify the blockchain-based data processing method provided in the embodiments of the present application.

[0167] Example 1 explains the smart contract deployment process. The smart contract deployment process refers to the process in which a user sends a new smart contract to be deployed on the blockchain, and the corresponding collaborative blockchain node verifies the transaction and writes the new smart contract and its corresponding collaborative blockchain node into the corresponding relationship between the smart contract and the blockchain node.

[0168] See also Figure 8A-8C , are schematic diagrams of a data processing method based on blockchain provided in the embodiments of the present application. Fig. 8A Node a in Figure 8B Node a in the connection, Figure 8B Node b in Figure 8C Node b in is connected.

[0169] S801: Start.

[0170] S802: The user terminal obtains the source code of the target smart contract.

[0171] The user writes the source code of the target smart contract locally through the user terminal. The target smart contract is the smart contract waiting to be deployed on the blockchain.

[0172] S803: The user terminal packages the source code of the target smart contract, the initialization method and parameters of the target smart contract, and the node identifier of the first collaborative blockchain node to obtain a data packet.

[0173] The user packages the source code of the target smart contract, the initialization method and parameters of the target smart contract, and all the collaborative blockchain nodes with the authority to run the target smart contract, that is, the node identifier of the first collaborative blockchain node, through the user terminal to obtain a data packet. It can be understood that the node identifier can be a node number, and the first collaborative blockchain node can be determined based on the node identifier.

[0174] S804: The user terminal signs the data packet to obtain a smart contract deployment data packet.

[0175] S805: The user terminal sends a smart contract deployment request to the main collaborative blockchain node.

[0176] It is understandable that the user terminal sends a smart contract deployment request to any collaborative blockchain node, which is the blockchain node that receives the smart contract deployment request, that is, the main collaborative blockchain node. The smart contract deployment request includes a target smart contract and a first collaborative blockchain node that runs the target smart contract. The first collaborative blockchain node includes the main collaborative blockchain node.

[0177] S806: The main collaborative blockchain node determines whether the certificate verification is passed based on the smart contract deployment request. If so, execute S808; if not, execute S807.

[0178] S807: The main collaborative blockchain node sends the result of authentication failure to the user terminal and executes S828.

[0179] S808: The main collaborative blockchain node determines whether the authority verification is passed. If so, execute S809; if not, execute S807.

[0180] S809: The main collaborative blockchain node schedules the initial transaction corresponding to the target smart contract.

[0181] S810: The main collaborative blockchain node stores the target smart contract in the contract warehouse.

[0182] S811: The main collaborative blockchain node starts the target smart contract as a contract process and initializes it based on the pre-set initialization method and parameters.

[0183] S812: The main collaborative blockchain node determines whether the initialization is successful. If so, execute S814; if not, execute S813.

[0184] S813: The main collaborative blockchain node sends an error message indicating that contract initialization failed to the user terminal, and executes S828.

[0185] S814: The main collaborative blockchain node generates a transaction read-write set based on the transaction information related to the initial transaction.

[0186] S815: The main collaborative blockchain node generates a Merkle tree based on the transaction information related to the initial transaction, and generates a block including the initial transaction to obtain initial block data for describing the block.

[0187] The initial block data includes initial transaction information and first identification information related to the initial transaction, and the first identification information is a Merkle tree generated based on the initial transaction information.

[0188] S816: The master collaborative blockchain node broadcasts the initial block data to the first slave collaborative blockchain node.

[0189] S817: First, determine whether the initial block data has passed the verification from the collaborative blockchain node. If so, execute S819; if not, execute S818.

[0190] The first slave collaborative blockchain node can perform a hash calculation based on the initial transaction data included in the initial block data. If the obtained hash value to be verified is consistent with the hash value (identification information) corresponding to the initial transaction in the Merkle tree, the verification is successful; otherwise, the verification fails.

[0191] S818: First, the collaborative blockchain node sends an error message indicating that the node tag verification result is inconsistent to the user terminal, and executes S828.

[0192] S819: The first slave collaborative blockchain node sends a correct prompt of verification passing to the master collaborative blockchain node.

[0193] S820: The main collaborative blockchain node deletes the initial transaction information in the initial block data to obtain initial desensitized data including the first identification information.

[0194] S821: The main collaborative blockchain node sends initial desensitized data to the first non-collaborative blockchain node.

[0195] S822: All blockchain nodes perform verification again based on the received data to obtain verification results.

[0196] All blockchain nodes refer to the master collaborative blockchain node, the first slave collaborative blockchain node, and the first non-collaborative blockchain node.

[0197] S823: All blockchain nodes broadcast the verification results.

[0198] S824: All blockchain nodes determine whether the number of blockchain nodes that have passed the verification is greater than a second preset threshold based on the verification result. If so, execute S826; if not, execute S825.

[0199] S825: All blockchain nodes send an error message indicating that the node authentication failed to the user end, and execute S828.

[0200] S826: All blockchain nodes store the received data.

[0201] S827: The collaborative blockchain node establishes a first target correspondence between the target smart contract and the first collaborative blockchain node, and writes the first target correspondence into the correspondence between the smart contract and the blockchain node.

[0202] S828: End.

[0203] Example 2 explains the smart contract calling process. The smart contract calling process refers to the process in which a user sends a smart contract to call the corresponding transaction, and the collaborative blockchain node of the smart contract verifies the transaction based on the corresponding relationship between the smart contract and the blockchain node and the Merkle tree.

[0204] See also Figure 9A-9C , are schematic diagrams of a data processing method based on blockchain provided in the embodiments of the present application. Fig.9A Node a in Fig. 9B Node a in the connection, Fig. 9B Node b in Fig. 9C Node b in is connected.

[0205] S901: Start.

[0206] S902: The user obtains the code for calling the smart contract.

[0207] The user writes code to call the smart contract locally through the user terminal, and the smart contract has been deployed on the blockchain.

[0208] S903: The user terminal packages the smart contract code, the calling method and parameters of the smart contract to obtain a data packet.

[0209] S904: The user terminal signs the data packet to obtain a smart contract calling data packet.

[0210] S905: The user terminal sends a smart contract call request to the main collaborative blockchain node.

[0211] The smart contract call request includes a smart contract call data packet, and the primary collaborative blockchain node refers to the first collaborative blockchain node that receives the smart contract call data packet sent by the user end.

[0212] S906: The main collaborative blockchain node determines whether the certificate verification is passed based on the smart contract call request. If so, execute S908; if not, execute S907.

[0213] S907: The main collaborative blockchain node sends the result of authentication failure to the user terminal and executes S928.

[0214] S908: The main collaborative blockchain node determines whether the authority verification is passed. If so, execute S909; if not, execute S907.

[0215] S909: The main collaborative blockchain node schedules a batch of transactions.

[0216] It can be understood that the batch of scheduled transactions includes transactions executed by the smart contract corresponding to the smart contract scheduling request received above.

[0217] S910: The main collaborative blockchain node executes each transaction in sequence.

[0218] S911: For the i-th transaction, the main collaborative blockchain node starts the smart contract corresponding to the i-th transaction as a contract process, and executes the i-th transaction using the calling method and parameters corresponding to the smart contract.

[0219] S912: The main collaborative blockchain node determines whether the transaction execution is successful. If not, execute S913; if so, execute S914.

[0220] S913: The main collaborative blockchain node sends an error message indicating that the contract execution failed to the user terminal, and executes S928.

[0221] S914: The main collaborative blockchain node generates a transaction read-write set based on transaction information related to multiple transactions.

[0222] S915: The main collaborative blockchain node generates a Merkle tree based on transaction information related to multiple transactions.

[0223] S916: The main collaborative blockchain node generates blocks based on the Merkle tree and obtains block data.

[0224] S917: The main collaborative blockchain node determines the blockchain nodes corresponding to the smart contracts used to execute each transaction based on the correspondence between the smart contracts and the blockchain nodes.

[0225] S918: The main collaborative blockchain node determines the desensitized data corresponding to each blockchain node.

[0226] The desensitized data includes the Merkle tree and transaction information related to the transaction.

[0227] S919: The main collaborative blockchain node sends the corresponding desensitized data to other blockchain nodes respectively.

[0228] Other blockchain nodes are blockchain nodes other than the main collaborative blockchain node among multiple blockchain nodes.

[0229] S920: Other blockchain nodes verify each transaction based on the corresponding desensitized data to obtain a verification result.

[0230] S921: Other blockchain nodes determine whether the verification is passed based on the verification results. If so, execute S923; if not, execute S922.

[0231] S922: Other blockchain nodes return an error message indicating that the node tag verification results are inconsistent to the user end, and execute S928.

[0232] S923: All blockchain nodes perform verification again based on the corresponding desensitized data to obtain verification results.

[0233] S924: All blockchain nodes broadcast the verification results.

[0234] S925: All blockchain nodes verify based on the verification result whether the number of blockchain nodes that have passed the verification is greater than the first preset threshold. If so, execute S927; if not, execute S926.

[0235] S926: All blockchain nodes send an error message indicating that the node authentication failed to the user end, and execute S928.

[0236] S927: All blockchain nodes store the received data.

[0237] Among them, the main collaborative blockchain node is based on the received multiple verification results. If it is determined based on the multiple verification results that the number of blockchain nodes that have passed the verification is greater than the first preset threshold, the block data is stored in the block. For example, the block data is stored in the block ledger and the status data respectively. The embodiment of the present application does not specifically limit the size of the first preset threshold, and those skilled in the art can set it according to actual needs.

[0238] If other blockchain nodes send verification results to each blockchain node in a broadcast manner, other blockchain nodes can also determine based on multiple verification results that the number of blockchain nodes that pass the verification is greater than the first preset threshold, and then store the desensitized data in a block. For example, the desensitized data is stored in the block ledger and the state data respectively.

[0239] S928: End.

[0240] Example 3: Add the collaborative blockchain node corresponding to the smart contract for illustration.

[0241] See also Figure 10A-10C , are schematic diagrams of a data processing method based on blockchain provided in the embodiments of the present application. Fig. 10A Node a in Fig. 10B Node a in the connection, Fig. 10BNode b in Fig. 10C Node b in is connected.

[0242] S1001: Start.

[0243] S1002: The user terminal initiates a request to add a collaborative blockchain node.

[0244] The user writes the code of the collaborative blockchain node addition request locally through the user terminal, which is used to add the corresponding collaborative blockchain node for the smart contract. The collaborative blockchain node addition request includes the second collaborative blockchain node and the historical smart contract. The second collaborative blockchain node is a blockchain node with the authority to run the historical smart contract. The historical smart contract is a smart contract that has been deployed on the blockchain.

[0245] For example, the user packaged the code of the historical smart contract and the calling method and parameters of the historical smart contract to obtain a data packet. The data packet is signed to obtain a request to add a collaborative blockchain node.

[0246] S1003: The user terminal sends a collaborative blockchain node addition request to the main collaborative blockchain node.

[0247] S1004: The main collaborative blockchain node determines whether the certificate verification is passed based on the collaborative blockchain node addition request. If so, execute S1006; if not, execute S1005.

[0248] S1005: The main collaborative blockchain node sends the result of authentication failure to the user terminal and executes S1025.

[0249] S1006: The main collaborative blockchain node determines whether the authority verification is passed. If so, execute S1007; if not, execute S1005.

[0250] S1007: The main collaborative blockchain node schedules the transaction corresponding to the historical smart contract.

[0251] S1008: The main collaborative blockchain node determines whether the user terminal has the authority to add a collaborative blockchain node corresponding to the historical smart contract. If so, execute S1010; if not, execute S1009.

[0252] S1009: The main collaborative blockchain node sends an error message to the user terminal indicating that it has no right to perform configuration, and executes S1025.

[0253] S1010: The main collaborative blockchain node obtains the changed transaction information of the transaction corresponding to the historical smart contract based on the historical smart contract.

[0254] S1011: The main collaborative blockchain node generates changed block data based on the changed transaction information and the second identification information.

[0255] S1012: The master collaborative blockchain node broadcasts the changed block data to the second slave collaborative blockchain node.

[0256] Among them, the second slave collaborative blockchain node is a blockchain node in the second collaborative blockchain node except the main collaborative blockchain node.

[0257] S1013: Second, the collaborative blockchain node determines whether the changed block data has passed the verification. If so, execute S1015; if not, execute S1014.

[0258] S1014: The second slave collaborative blockchain node sends an error message indicating that the node tag verification result is inconsistent to the user terminal, and executes S1025.

[0259] S1015: The second slave collaborative blockchain node sends a correct prompt of verification passing to the master collaborative blockchain node.

[0260] S1016: The main collaborative blockchain node deletes the changed transaction information in the changed transaction information to obtain the changed desensitized data including the second identification information.

[0261] S1017: The main collaborative blockchain node sends the change desensitized data to the second non-collaborative blockchain node.

[0262] S1018: All blockchain nodes perform verification again based on the received data to obtain verification results.

[0263] All blockchain nodes refer to the main collaborative blockchain node, the second slave collaborative blockchain node, and the second non-collaborative blockchain node.

[0264] S1019: All blockchain nodes broadcast the verification results.

[0265] S1020: All blockchain nodes determine whether the number of blockchain nodes that have passed the verification is greater than a third preset threshold based on the verification result. If so, execute S1022; if not, execute S1021.

[0266] S1021: All blockchain nodes send an error message indicating that node authentication failed to the user end, and execute S1025.

[0267] S1022: All blockchain nodes store the received data.

[0268] S1023: The collaborative blockchain node establishes a second target correspondence between the historical smart contract and the second collaborative blockchain node, and modifies the correspondence between the smart contract and the blockchain node based on the second target correspondence.

[0269] S1024: The newly added blockchain node sends synchronized block data to each collaborative blockchain node of the historical smart contract.

[0270] S1025: End.

[0271] Example 4: Deleting the collaborative blockchain node corresponding to the smart contract is used for illustration.

[0272] See also Figure 11A-11C , are schematic diagrams of a data processing method based on blockchain provided in the embodiments of the present application. Fig.11A Node a in Fig. 11B Node a in the connection, Fig. 11B Node b in Fig. 11C Node b in is connected.

[0273] S1101: Start.

[0274] S1102: The user terminal initiates a collaborative blockchain node deletion request.

[0275] The user writes the code of the collaborative blockchain node deletion request locally through the user terminal. The collaborative blockchain node deletion request includes the second collaborative blockchain node and the historical smart contract. The second collaborative blockchain node is a blockchain node with the authority to run the historical smart contract. The historical smart contract is a smart contract that has been deployed on the blockchain.

[0276] For example, the user packaged the code of the historical smart contract and the calling method and parameters of the historical smart contract to obtain a data packet. The data packet is signed to obtain a request to add a collaborative blockchain node.

[0277] S1103: The user terminal sends a collaborative blockchain node deletion request to the main collaborative blockchain node.

[0278] S1104: The main collaborative blockchain node determines whether the certificate verification is passed based on the smart contract deletion request. If so, execute S1106; if not, execute S1105.

[0279] S1105: The main collaborative blockchain node sends the result of authentication failure to the user terminal and executes S1126.

[0280] S1106: The main collaborative blockchain node determines whether the authority verification is passed. If so, execute S1107; if not, execute S1105.

[0281] S1107: The main collaborative blockchain node schedules the transaction corresponding to the historical smart contract.

[0282] S1108: The main collaborative blockchain node determines whether the user terminal has the authority to add a collaborative blockchain node corresponding to the historical smart contract. If so, execute S1110; if not, execute S1109.

[0283] S1109: The main collaborative blockchain node sends an error message to the user terminal indicating that it has no right to perform configuration, and executes S1126.

[0284] S1110: The main collaborative blockchain node obtains the changed transaction information of the transaction corresponding to the historical smart contract based on the historical smart contract.

[0285] S1111: The main collaborative blockchain node generates changed block data based on the changed transaction information and the second identification information.

[0286] S1112: The master collaborative blockchain node broadcasts the changed block data to the second slave collaborative blockchain node.

[0287] Among them, the second slave collaborative blockchain node is a blockchain node in the second collaborative blockchain node except the main collaborative blockchain node.

[0288] S1113: The second slave collaborative blockchain node determines whether the changed block data has passed verification, if so, execute S1115; if not, execute S1114.

[0289] S1114: The second slave collaborative blockchain node sends an error message indicating that the node tag verification result is inconsistent to the user terminal, and executes S1126.

[0290] S1115: The second slave collaboration block receives the order and sends a correct prompt of verification passing to the main collaboration blockchain node.

[0291] S1116: The main collaborative blockchain node deletes the changed transaction information in the changed transaction information to obtain the changed desensitized data including the second identification information.

[0292] S1117: The main collaborative blockchain node sends the change desensitized data to the second non-collaborative blockchain node.

[0293] S1118: All blockchain nodes perform verification again based on the received data to obtain verification results.

[0294] All blockchain nodes refer to the main collaborative blockchain node, the second slave collaborative blockchain node, and the second non-collaborative blockchain node.

[0295] S1119: All blockchain nodes broadcast the verification results.

[0296] S1120: All blockchain nodes determine whether the number of blockchain nodes that have passed the verification is greater than a third preset threshold based on the verification result. If so, execute S1122; if not, execute S1121.

[0297] S1121: All blockchain nodes send an error message indicating that node authentication failed to the user end, and execute S1126.

[0298] S1122: All blockchain nodes store the received data.

[0299] S1123: The collaborative blockchain node establishes a second target correspondence between the historical smart contract and the second collaborative blockchain node, and modifies the correspondence between the smart contract and the blockchain node based on the second target correspondence.

[0300] S1124: The collaborative blockchain node determines whether the number of collaborative blockchain nodes of the historical smart contract is zero. If so, execute S1125; if not, execute S1126.

[0301] S1125: The collaborative blockchain node deletes the historical smart contract from the contract repository.

[0302] S1126: End.

[0303] It can be seen from the above technical solution that the embodiment of the present application maintains the correspondence between smart contracts and blockchain nodes with the authority to execute smart contracts through the correspondence between smart contracts and blockchain nodes, and controls which blockchain nodes all transactions of each smart contract should be calculated and stored on through the correspondence between smart contracts and blockchain nodes.

[0304] In addition, the embodiment of the present application has modified the calculation of the Merkle tree. While deleting the transaction information related to the non-target transaction in the block data, the identification information related to the non-target transaction is retained to obtain desensitized data for each blockchain node. Not only data isolation is achieved, but also in the process of verification based on the desensitized data, transactions with only identification information can be skipped, and only transactions with both identification information and transaction information can be verified, thereby improving the verification speed of transactions.

[0305] In addition, the embodiment of the present application provides a process for dynamically adding and deleting corresponding collaborative blockchain nodes for historical smart contracts, ensuring that the collaborative blockchain nodes can be dynamically changed during the execution of historical smart contracts, thereby achieving more flexible smart contract granularity control.

[0306] As a result, not only can the data isolation granularity of the blockchain be ensured to be accurate to the smart contract, that is, unlike related technologies, data isolation is no longer implemented based on the chain level, but users can freely control data permissions, blockchain nodes can be exempted from storing redundant transaction data, and the blockchain can be highly trusted. In addition, through the certificate authority mechanism, the identity of all blockchain nodes can be guaranteed to be credible and can be widely reused in the industry.

[0307] With respect to the blockchain-based data processing method described above, the present application also provides a corresponding blockchain-based data processing device so that the above-mentioned blockchain-based data processing method can be applied and implemented in practice.

[0308] See also Fig.12 , which is a schematic diagram of the structure of a data processing device based on blockchain provided in an embodiment of the present application. Fig.12 As shown, the blockchain-based data processing device 1200 includes: an acquisition unit 1201, a determination unit 1202, a deletion unit 1203 and a sending unit 1204;

[0309] The acquisition unit 1201 is used to acquire block data for describing a block, wherein the block data includes transaction information related to a plurality of transactions;

[0310] The determining unit 1202 is used to determine the blockchain nodes corresponding to the smart contracts used to execute each of the transactions according to the corresponding relationship between the smart contracts and the blockchain nodes; wherein the blockchain nodes having the corresponding relationship with the smart contracts have the authority to run the smart contracts;

[0311] The determining unit 1202 is further used to determine a target transaction corresponding to a target blockchain node, wherein the target blockchain node is a blockchain node other than a primary collaborative blockchain node among multiple blockchain nodes, and the primary collaborative blockchain node is a blockchain node that obtains the block data;

[0312] The deleting unit 1203 is used to delete the transaction information related to the non-target transaction in the block data to obtain the desensitized data for the target blockchain node, wherein the non-target transaction is a transaction other than the target transaction in the multiple transactions;

[0313] The sending unit 1204 is used to send the desensitized data for the target blockchain node to the target blockchain node.

[0314] It can be seen from the above technical solution that the block data used to describe the block is obtained, and the block data includes transaction information related to multiple transactions. The correspondence between smart contracts and blockchain nodes is used to describe the correspondence between each smart contract and the blockchain node with the authority to run the smart contract, and the transaction is executed based on the smart contract. According to the correspondence, the blockchain nodes corresponding to the smart contracts used to execute each transaction can be determined, thereby obtaining an indirect correspondence between each blockchain node and each transaction. Taking the target blockchain node among multiple blockchain nodes as an example, the target blockchain node has the authority to execute at least one smart contract, and can execute transactions based on the smart contract, that is, the target transaction, so that the target blockchain node has the authority to obtain transaction data related to the target transaction. Therefore, the transaction information related to non-target transactions in the block data is deleted, and the desensitized data for the target blockchain node is obtained. The desensitized data includes transaction information related to the target transaction, but does not include transaction information related to non-target transactions, so that the block data obtained by the target blockchain node cannot view the transaction information related to the transaction executed by the smart contract that it does not have the running authority. Therefore, for the block data of each block, each blockchain node obtains the corresponding desensitized data, so that each blockchain node cannot obtain transaction information related to non-target transactions, that is, transaction information related to transactions executed by smart contracts that have no corresponding relationship with it, thus achieving data isolation. Therefore, data isolation is achieved based on the corresponding relationship between smart contracts and blockchain nodes, without the need to establish channels or sub-chains, reducing the waste of manpower and resources.

[0315] As a possible implementation manner, the block data also includes identification information generated for each of the transactions, and the deletion unit 1203 is specifically used to delete the transaction information related to the non-target transaction in the block data, retain the identification information of the non-target transaction, and obtain the desensitized data for the target blockchain node, so that in the process of the target blockchain node verifying the desensitized data, if the i-th transaction included in the desensitized data includes transaction information related to the i-th transaction, the i-th transaction information is verified based on the identification information of the i-th transaction; if the i-th transaction does not include the transaction information related to the i-th transaction, the verification of the i-th transaction is skipped, and i is an integer greater than 0.

[0316] As a possible implementation manner, the sending unit 1204 is further used to use other blockchain nodes as the target blockchain nodes, and send corresponding desensitized data to the other blockchain nodes respectively, and the other blockchain nodes are blockchain nodes other than the main collaborative blockchain node among the multiple blockchain nodes;

[0317] The blockchain-based data processing device 1200 further includes a voting unit, which is used to receive a verification result from the other blockchain nodes, and the verification result is used to identify whether the desensitized data received by the other blockchain nodes has passed the verification;

[0318] The voting unit is further configured to store the block data if it is determined based on the verification result that the number of blockchain nodes that have passed the verification is greater than a first preset threshold.

[0319] As a possible implementation, the blockchain-based data processing device 1200 further includes a generating unit, which is used to:

[0320] Obtaining a plurality of transactions included in the block;

[0321] Calling the smart contract of each transaction to execute each transaction respectively, and obtaining transaction information related to each transaction;

[0322] Generate a hash value of each transaction according to transaction information related to each transaction to obtain a Merkle tree, wherein the hash value is the identification information;

[0323] Based on the Merkle tree, the block data is generated.

[0324] As a possible implementation manner, the acquisition unit 1201 is further used to acquire a smart contract deployment request, where the smart contract deployment request includes a target smart contract and a first collaborative blockchain node that runs the target smart contract, where the first collaborative blockchain node includes the primary collaborative blockchain node;

[0325] The blockchain-based data processing device 1200 also includes a modification unit, which is used to establish a first target correspondence relationship between the target smart contract and the first collaborative blockchain node, and write the first target correspondence relationship into the correspondence relationship.

[0326] As a possible implementation manner, the deleting unit 1203 is further configured to:

[0327] Identify a first smart contract to be deleted from multiple deployed smart contracts, where the difference between the last call time of the first smart contract to be deleted and the current time is greater than a preset time threshold;

[0328] From the corresponding relationship, delete the first smart contract to be deleted and the blockchain node corresponding to the first smart contract to be deleted.

[0329] As a possible implementation, the blockchain-based data processing device 1200 further includes an initialization unit, which is used to:

[0330] Initialize the target smart contract to obtain initial transaction information of the transaction corresponding to the target smart contract;

[0331] Generate initial block data based on the initial transaction information;

[0332] The sending unit 1204 is also used to send the initial block data to a first slave collaborative blockchain node, where the first slave collaborative blockchain node is a blockchain node in the first collaborative blockchain node except the master collaborative blockchain node.

[0333] As a possible implementation, the blockchain-based data processing device 1200 further includes an initialization unit, configured to generate the initial block data based on the initial transaction information and first identification information, wherein the first identification information is generated according to the initial transaction information;

[0334] The deleting unit 1203 is further configured to delete the initial transaction information in the initial block data to obtain initial desensitized data including the first identification information;

[0335] The sending unit 1204 is also used to send the initial desensitized data to a first non-collaborative blockchain node, where the first non-collaborative blockchain node is a blockchain node among the multiple blockchain nodes except the first collaborative blockchain node.

[0336] As a possible implementation, the blockchain-based data processing device 1200 further includes a verification unit, which is used to:

[0337] Receiving verification results from the first slave collaborative blockchain node and the first non-collaborative blockchain node, the verification result received from the first slave collaborative blockchain node is used to identify whether the initial block data received by the first slave collaborative blockchain node has passed the verification, and the verification result received from the first non-collaborative blockchain node is used to identify whether the initial desensitized data received by the first non-collaborative blockchain node has passed the verification;

[0338] If it is determined based on the verification result that the number of blockchain nodes that have passed the verification is greater than a second preset threshold, the initial block data is stored in the block.

[0339] As a possible implementation manner, the obtaining unit 1201 is further configured to:

[0340] Obtaining a collaborative blockchain node modification request, the collaborative blockchain node modification request including a second collaborative blockchain node and a historical smart contract, the second collaborative blockchain node being a blockchain node with permission to run the historical smart contract, the second collaborative blockchain node including the main collaborative blockchain node, and the historical smart contract being the smart contract included in the corresponding relationship;

[0341] The blockchain-based data processing device 1200 also includes a modification unit, which is used to establish a second target correspondence relationship between the historical smart contract and the second collaborative blockchain node, and modify the correspondence relationship based on the second target correspondence relationship.

[0342] As a possible implementation method, the collaborative blockchain node modification request also includes permission information, and the permission information is used to identify the authority of the sender of the collaborative blockchain node modification request. The blockchain-based data processing device 1200 also includes a modification unit, which is used to execute the step of modifying the corresponding relationship based on the second target corresponding relationship if it is determined based on the permission information that the sender has the authority to modify the corresponding relationship.

[0343] As a possible implementation, the blockchain-based data processing device 1200 further includes a generating unit, which is used to:

[0344] After obtaining the modification request of the collaborative blockchain node, based on the historical smart contract, obtaining the change transaction information of the transaction corresponding to the historical smart contract;

[0345] Generate change block data based on the change transaction information;

[0346] The sending unit 1204 is also used to send the changed block data to a second slave collaborative blockchain node, where the second slave collaborative blockchain node is a blockchain node in the second collaborative blockchain node except the master collaborative blockchain node.

[0347] As a possible implementation, the blockchain-based data processing device 1200 further includes a generating unit, configured to generate the changed block data based on the changed transaction information and second identification information, wherein the second identification information is generated according to the changed transaction information;

[0348] The deleting unit 1203 is further configured to delete the changed transaction information in the changed transaction information to obtain the changed desensitized data including the second identification information;

[0349] The sending unit 1204 is also used to send the change desensitized data to a second non-collaborative blockchain node, where the second non-collaborative blockchain node is a blockchain node among the multiple blockchain nodes except the second collaborative blockchain node.

[0350] As a possible implementation, the blockchain-based data processing device 1200 further includes a verification unit, which is used to:

[0351] Receiving verification results from the second slave collaborative blockchain node and the second non-collaborative blockchain node, the verification result received from the second slave collaborative blockchain node is used to identify whether the changed block data received by the second slave collaborative blockchain node has passed the verification, and the verification result received from the second non-collaborative blockchain node is used to identify whether the changed desensitized data received by the second non-collaborative blockchain node has passed the verification;

[0352] If it is determined based on the verification result that the number of blockchain nodes that have passed the verification is greater than a third preset threshold, the changed block data is stored in a block.

[0353] As a possible implementation, if the second collaborative blockchain node includes a newly added collaborative blockchain node, the blockchain-based data processing device 1200 further includes a synchronization unit, which is used to:

[0354] After the changed block data is stored in the block, the synchronization block data from the newly added collaborative blockchain node is obtained;

[0355] Blockchain data synchronization is performed based on the synchronization block data.

[0356] As a possible implementation manner, the deleting unit 1203 is further configured to:

[0357] Identifying a second to-be-deleted smart contract from a plurality of deployed smart contracts, wherein the number of collaborative blockchain nodes of the second to-be-deleted smart contract is zero;

[0358] Delete the second smart contract to be deleted.

[0359] The present application also provides a computer device, which is the computer device described above. The computer device can be a server or a terminal device. The blockchain-based data processing device described above can be built into the server or the terminal device. The computer device provided by the present application will be introduced from the perspective of hardware entity. Fig.13 The following is a schematic diagram of the server structure. Fig.14 Shown is a schematic diagram of the structure of the terminal equipment.

[0360] See also Fig.13, which is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more processors 1422, such as central processing units (CPU), memory 1432, one or more application programs 1442 or storage media 1430 of data 1444 (for example, one or more massive storage devices). Among them, the memory 1432 and the storage medium 1430 may be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.

[0361] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0362] The steps performed by the server in the above embodiment can be based on the Fig.13 The server structure shown.

[0363] The CPU 1422 is used to execute the following steps:

[0364] Obtaining block data for describing a block, wherein the block data includes transaction information related to a plurality of transactions;

[0365] According to the correspondence between the smart contract and the blockchain node, determine the blockchain nodes corresponding to the smart contracts used to execute each of the transactions; wherein the blockchain node having the correspondence with the smart contract has the authority to run the smart contract;

[0366] Determine a target transaction corresponding to a target blockchain node, wherein the target blockchain node is a blockchain node other than a primary collaborative blockchain node among multiple blockchain nodes, and the primary collaborative blockchain node is a blockchain node that obtains the block data;

[0367] Deleting transaction information related to non-target transactions in the block data to obtain desensitized data for the target blockchain node, wherein the non-target transactions are transactions other than the target transaction in the multiple transactions;

[0368] Sending desensitized data for the target blockchain node to the target blockchain node.

[0369] Optionally, CPU 1422 can also execute the method steps of any specific implementation of the blockchain-based data processing method in the embodiments of the present application.

[0370] See also Fig.14 , which is a structural diagram of a terminal device provided in an embodiment of the present application. Fig.14 The block diagram shows a partial structure of a smart phone related to a terminal device provided in an embodiment of the present application, and the smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art can understand that Fig.14 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0371] Combine the following Fig.14 A detailed introduction to the various components of a smartphone:

[0372] The RF circuit 1510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station.

[0373] The memory 1520 may be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 1520 .

[0374] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect user touch operations on or near it and drive the corresponding connection device according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0375] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 1540 may include a display panel 1541, and the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0376] The smartphone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that may be configured in the smartphone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.

[0377] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the smartphone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another smartphone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.

[0378] The processor 1580 is the control center of the smartphone, and uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 1520, and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.

[0379] The smart phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.

[0380] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0381] In the embodiment of the present application, the memory 1520 included in the smart phone can store program codes and transmit the program codes to the processor.

[0382] The processor 1580 included in the smart phone can execute the blockchain-based data processing method provided in the above embodiment according to the instructions in the program code.

[0383] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, which is used to execute the blockchain-based data processing method provided in the above embodiment.

[0384] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the blockchain-based data processing method provided in various optional implementations of the above aspects.

[0385] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-Only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0386] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0387] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method based on blockchain, characterized in that: The method comprises: Obtaining block data for describing a block, wherein the block data includes transaction information related to a plurality of transactions; According to the correspondence between the smart contract and the blockchain node, determine the blockchain nodes corresponding to the smart contracts used to execute each of the transactions; wherein the blockchain node having the correspondence with the smart contract has the authority to run the smart contract; Determine a target transaction corresponding to a target blockchain node, wherein the target blockchain node is a blockchain node other than a primary collaborative blockchain node among multiple blockchain nodes, and the primary collaborative blockchain node is a blockchain node that obtains the block data; Deleting transaction information related to non-target transactions in the block data to obtain desensitized data for the target blockchain node, wherein the non-target transactions are transactions other than the target transaction in the multiple transactions; Sending desensitized data for the target blockchain node to the target blockchain node.

2. The method according to claim 1, characterized in that The block data also includes identification information generated for each of the transactions, and the deleting of transaction information related to non-target transactions in the block data to obtain desensitized data for the target blockchain node includes: Delete the transaction information related to the non-target transaction in the block data, retain the identification information of the non-target transaction, and obtain the desensitized data for the target blockchain node, so that in the process of the target blockchain node verifying the desensitized data, if the i-th transaction included in the desensitized data includes the transaction information related to the i-th transaction, then the i-th transaction information is verified based on the identification information of the i-th transaction; if the i-th transaction does not include the transaction information related to the i-th transaction, then the verification of the i-th transaction is skipped, and i is an integer greater than 0.

3. The method according to claim 2, characterized in that The method further comprises: Use other blockchain nodes as the target blockchain nodes respectively, and send corresponding desensitized data to the other blockchain nodes respectively, wherein the other blockchain nodes are blockchain nodes other than the main collaborative blockchain node among the multiple blockchain nodes; Receive a verification result from the other blockchain node, where the verification result is used to identify whether the desensitized data received by the other blockchain node has passed the verification; If it is determined based on the verification result that the number of blockchain nodes that have passed the verification is greater than a first preset threshold, the block data is stored in a block.

4. The method according to claim 2, characterized in that: The method further comprises: Obtaining a plurality of transactions included in the block; Calling the smart contract of each transaction to execute each transaction respectively, and obtaining transaction information related to each transaction; Generate a hash value of each transaction according to transaction information related to each transaction to obtain a Merkle tree, wherein the hash value is the identification information; Based on the Merkle tree, the block data is generated.

5. The method according to claim 1, characterized in that: The method further comprises: Obtain a smart contract deployment request, wherein the smart contract deployment request includes a target smart contract and a first collaborative blockchain node capable of running the target smart contract, wherein the first collaborative blockchain node includes the primary collaborative blockchain node; A first target correspondence relationship is established between the target smart contract and the first collaborative blockchain node, and the first target correspondence relationship is written into the correspondence relationship.

6. The method according to claim 5, characterized in that The method further comprises: Identify a first smart contract to be deleted from multiple deployed smart contracts, where the difference between the last call time of the first smart contract to be deleted and the current time is greater than a preset time threshold; From the corresponding relationship, delete the first smart contract to be deleted and the blockchain node corresponding to the first smart contract to be deleted.

7. The method according to claim 5, characterized in that The method further comprises: Initialize the target smart contract to obtain initial transaction information of the transaction corresponding to the target smart contract; Generate initial block data based on the initial transaction information; The initial block data is sent to a first slave collaborative blockchain node, where the first slave collaborative blockchain node is a blockchain node in the first collaborative blockchain node except the master collaborative blockchain node.

8. The method according to claim 7, characterized in that The generating initial block data based on the initial transaction information includes: Generate the initial block data based on the initial transaction information and first identification information, where the first identification information is generated according to the initial transaction information; The method further comprises: Deleting the initial transaction information in the initial block data to obtain initial desensitized data including the first identification information; The initial desensitized data is sent to a first non-collaborative blockchain node, where the first non-collaborative blockchain node is a blockchain node among the multiple blockchain nodes except the first collaborative blockchain node.

9. The method according to claim 8, characterized in that The method further comprises: Receiving verification results from the first slave collaborative blockchain node and the first non-collaborative blockchain node, the verification result received from the first slave collaborative blockchain node is used to identify whether the initial block data received by the first slave collaborative blockchain node has passed the verification, and the verification result received from the first non-collaborative blockchain node is used to identify whether the initial desensitized data received by the first non-collaborative blockchain node has passed the verification; If it is determined based on the verification result that the number of blockchain nodes that have passed the verification is greater than a second preset threshold, the initial block data is stored in the block.

10. The method according to claim 1, characterized in that The method further comprises: Obtaining a collaborative blockchain node modification request, the collaborative blockchain node modification request including a second collaborative blockchain node and a historical smart contract, the second collaborative blockchain node being a blockchain node with permission to run the historical smart contract, the second collaborative blockchain node including the main collaborative blockchain node, and the historical smart contract being the smart contract included in the corresponding relationship; A second target correspondence relationship is established between the historical smart contract and the second collaborative blockchain node, and the correspondence relationship is modified based on the second target correspondence relationship.

11. The method according to claim 10, characterized in that The collaborative blockchain node modification request also includes permission information, where the permission information is used to identify the permission of the sender of the collaborative blockchain node modification request, and the method further includes: If it is determined based on the permission information that the sending end has the permission to modify the corresponding relationship, the step of modifying the corresponding relationship based on the second target corresponding relationship is performed.

12. The method according to claim 10, characterized in that After obtaining the collaborative blockchain node modification request, the method further includes: Based on the historical smart contract, obtain the changed transaction information of the transaction corresponding to the historical smart contract; Generate change block data based on the change transaction information; The changed block data is sent to a second slave collaborative blockchain node, where the second slave collaborative blockchain node is a blockchain node in the second collaborative blockchain node other than the master collaborative blockchain node.

13. The method according to claim 12, characterized in that The generating the changed block data based on the changed transaction information includes: generating the changed block data based on the changed transaction information and second identification information, wherein the second identification information is generated according to the changed transaction information; The method further comprises: Deleting the changed transaction information in the changed transaction information to obtain the changed desensitized data including the second identification information; The change-masked data is sent to a second non-collaborative blockchain node, where the second non-collaborative blockchain node is a blockchain node among the multiple blockchain nodes except the second collaborative blockchain node.

14. The method according to claim 13, characterized in that The method further comprises: Receiving verification results from the second slave collaborative blockchain node and the second non-collaborative blockchain node, the verification result received from the second slave collaborative blockchain node is used to identify whether the changed block data received by the second slave collaborative blockchain node has passed the verification, and the verification result received from the second non-collaborative blockchain node is used to identify whether the changed desensitized data received by the second non-collaborative blockchain node has passed the verification; If it is determined based on the verification result that the number of blockchain nodes that have passed the verification is greater than a third preset threshold, the changed block data is stored in a block.

15. According to the method of claim 14, if the second collaborative blockchain node includes a newly added collaborative blockchain node, after storing the changed block data, the method further includes: Obtaining synchronized block data from the newly added collaborative blockchain node; Blockchain data synchronization is performed based on the synchronization block data.

16. The method according to claim 10, further comprising: Identifying a second to-be-deleted smart contract from a plurality of deployed smart contracts, wherein the number of collaborative blockchain nodes of the second to-be-deleted smart contract is zero; Delete the second smart contract to be deleted.

17. A data processing device based on blockchain, characterized in that: The equipment includes: an acquisition unit, a determination unit, a deletion unit and a sending unit; The acquisition unit is used to acquire block data for describing a block, wherein the block data includes transaction information related to a plurality of transactions; The determining unit is used to determine the blockchain nodes corresponding to the smart contracts used to execute each of the transactions according to the corresponding relationship between the smart contracts and the blockchain nodes; wherein the blockchain nodes having the corresponding relationship with the smart contracts have the authority to run the smart contracts; The determination unit is further used to determine a target transaction corresponding to a target blockchain node, wherein the target blockchain node is a blockchain node other than a primary collaborative blockchain node among multiple blockchain nodes, and the primary collaborative blockchain node is a blockchain node that obtains the block data; The deleting unit is used to delete the transaction information related to the non-target transaction in the block data to obtain the desensitized data for the target blockchain node, wherein the non-target transaction is a transaction other than the target transaction in the multiple transactions; The sending unit is used to send desensitized data for the target blockchain node to the target blockchain node.

18. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 16 according to the computer program.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 16.

20. A computer program product comprising a computer program, characterized in that When the method is executed on a computer device, the computer device is enabled to execute the method according to any one of claims 1 to 16.