Blockchain data processing method and device, computer device, medium and product
By using blockchain technology to perform primary key intersection processing on consensus nodes for encrypted data, the problem of low data exchange efficiency between business nodes is solved, and fast and secure data sharing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-08-04
- Publication Date
- 2026-05-19
AI Technical Summary
In big data application scenarios, data exchange between business nodes is inefficient, and existing data exchange methods are time-consuming and labor-intensive.
By using blockchain technology, consensus nodes store encrypted data generated by business nodes, and data exchange is performed based on the intersection of primary keys, thereby achieving automated processing and intersection solving of encrypted data.
It enables automated data sharing between different business nodes, quickly completes the exchange of the same business data, and improves data exchange efficiency and security.
Smart Images

Figure CN117560165B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a blockchain data processing method, a blockchain data processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] In the era of big data and advanced internet technology, data exchange between different business nodes exists in various business scenarios. For example, business node 1 can obtain data A and data B from business 1, as well as data from business 2. Business node 2 can obtain data A and data C from business 1, as well as data from business 3. Since there is a common business 1, there is a need for data exchange between business node 1 and business node 2 in some cases so that each can obtain more complete data about business 1. That is, data A, data B, and data C can be obtained from both business node 1 and business node 2.
[0003] In the above scenario, if two business nodes need to exchange data to share more complete data, currently this can be done by filtering and exchanging data offline between the node objects. This data exchange method is time-consuming and labor-intensive, especially in big data application scenarios, and is inefficient. Summary of the Invention
[0004] This application proposes a blockchain data processing method, apparatus, computer equipment, medium, and product, which can quickly complete the data exchange function of the same business data by finding the intersection of the primary keys.
[0005] On one hand, embodiments of this application provide a blockchain data processing method. This method is applied to consensus nodes in a blockchain. Each consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting business data constructed based on key-value pairs using the key of a business node. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. The method includes:
[0006] Obtain business update data for each encrypted data, wherein the business update data for the target encrypted data in the n groups of encrypted data includes: data determined by the reference business nodes after encrypting the first primary key information of the target encrypted data according to their respective keys, the reference business nodes are the nodes among the n business nodes that have data update permissions for the target encrypted data, and the target encrypted data is any one of the n groups of encrypted data;
[0007] Based on the encrypted secondary primary key information of each data set, the business update data of n sets of encrypted data are subjected to data intersection processing to obtain business intersection data;
[0008] The business intersection data is sent to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data.
[0009] On one hand, embodiments of this application provide a blockchain data processing method. This method is applied to a target business node among n business nodes in a blockchain. Each business node stores encrypted data generated based on its own key into a consensus node. The n business nodes include the target business node and reference business nodes other than the target business node. The target business node generates target encrypted data, where n is a positive integer greater than 1. The method includes:
[0010] Retrieve encrypted data from n business nodes stored in the consensus node;
[0011] The first primary key information of the encrypted data of the reference business node is encrypted to generate the business update data corresponding to the encrypted data of the reference business node.
[0012] The business update data corresponding to the encrypted data of the reference business node is sent to the consensus node, so that the consensus node can determine the business intersection data based on the business update data corresponding to the encrypted data of the reference business node and the business update data sent to the consensus node by other business nodes.
[0013] Obtain business intersection data from consensus nodes, and determine the plaintext data to be supplemented based on the business intersection data.
[0014] On one hand, this application provides a blockchain data processing device applied to a consensus node in a blockchain. The consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting business data constructed based on key-value pairs using the key of a business node. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. The device includes:
[0015] The acquisition unit is used to acquire business update data for each encrypted data. The business update data of the target encrypted data in the n sets of encrypted data includes: the data determined by the reference business node after encrypting the first primary key information of the target encrypted data according to the key of each business node. The reference business node is the node with data update authority for the target encrypted data among the n business nodes. The target encrypted data is any one of the n sets of encrypted data.
[0016] The processing unit is used to perform data intersection processing on the business update data of n sets of encrypted data according to the second primary key information of each data encryption, so as to obtain business intersection data.
[0017] The sending unit is used to send the business intersection data to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data.
[0018] In one possible implementation, the target business node corresponds to the target encrypted data; before obtaining the business update data for each group of encrypted data, the processing unit is also used to perform the following operations:
[0019] Obtain the data authorization request sent by the target business node for the smart contract authorization interface. The target business node is any one of the n business nodes. The data authorization request includes node information of at least one reference business node. The reference business nodes include business nodes other than the target business node among the n business nodes.
[0020] In response to the data authorization request, determine that each reference business node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
[0021] In one possible implementation, the target encrypted data is stored in a data structure with a primary key K and a value V, and the value information of the target encrypted data is generated based on the business data of the target business node.
[0022] Among them, the first primary key information of the target encrypted data is determined by encrypting the curve points mapped on the elliptic curve using the key of the target business node.
[0023] The curve points mapped on the elliptic curve for the target business node are generated based on the object addresses obtained from the target business node.
[0024] In one possible implementation, the n business nodes include a first business node and a second business node; the first business node corresponds to the first encrypted data, and the second business node corresponds to the second encrypted data; the obtained business update data includes the first business update data and the second business update data; the first business update data is obtained by encrypting the first encrypted data, and the second business update data is obtained by encrypting the second encrypted data.
[0025] Specifically, the first business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data using the private key of the second business node; the second business update data is obtained by the first business node encrypting the second initial business update data using the public key and key exchange algorithm of the second business node; and the second initial business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data using the private key of the first business node.
[0026] Alternatively, the first business update data is obtained by the second business node encrypting the first initial business update data based on the public key and key exchange algorithm of the first business node; the first initial business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data based on the private key of the second business node; and the second business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data based on the private key of the first business node.
[0027] In one possible implementation, the processing unit performs data intersection processing on the business update data of n sets of encrypted data based on the encrypted second primary key information of each data set, to obtain business intersection data, which is used to perform the following operations:
[0028] Retrieve business update data with the same second primary key information from n sets of encrypted business update data;
[0029] The business update data that have the same secondary primary key information are combined into business intersection data.
[0030] On one hand, this application provides a blockchain data processing device. This device is applied to a target business node among n business nodes in a blockchain. Each business node stores encrypted data generated based on its own key into a consensus node. The n business nodes include the target business node and reference business nodes other than the target business node. The target business node generates target encrypted data, and n is a positive integer greater than 1. The device includes:
[0031] The acquisition unit is used to acquire encrypted data from n business nodes stored in the consensus node;
[0032] The processing unit is used to perform data encryption processing on the first primary key information of the encrypted data of the reference business node, and generate business update data corresponding to the encrypted data of the reference business node.
[0033] The sending unit is used to send the service update data corresponding to the encrypted data of the reference service node to the consensus node, so that the consensus node can determine the service intersection data based on the service update data corresponding to the encrypted data of the reference service node and the service update data of other service nodes.
[0034] The processing unit is also used to obtain business intersection data from consensus nodes and determine the plaintext data to be supplemented based on the business intersection data.
[0035] In one possible implementation, before the processing unit performs data encryption processing on the first primary key information of the encrypted data of the reference business node and generates the business update data corresponding to the encrypted data of the reference business node, it is also used to perform the following operations:
[0036] Send a data authorization request for the smart contract authorization interface to the consensus node. The data authorization request includes node information of at least one reference business node.
[0037] Among them, the data authorization request is used to trigger the consensus node to determine that the reference business node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
[0038] In one possible implementation, the processing unit performs data encryption processing on the first primary key information of the encrypted data of the reference service node to generate business update data corresponding to the encrypted data of the reference service node, which is used to perform the following operations:
[0039] Using the key of the target service node, the first primary key information of the encrypted data of the reference service node is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node; or,
[0040] Using the key of the target business node, the first primary key information of the encrypted data of the reference business node is encrypted to obtain the reference initial business update data;
[0041] Based on the public key and key exchange algorithm of the reference service node, the reference initial service update data is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node.
[0042] In one possible implementation, the processing unit determines the plaintext data to be supplemented based on the business intersection data, and performs the following operations:
[0043] The business intersection data is parsed based on the private key of the target business node to obtain the target parsed intersection data, and then the target parsed intersection data is sent to the consensus node.
[0044] Receive reference parsing intersection data sent by consensus nodes. The reference parsing intersection data is obtained by parsing the business intersection data based on the private key of the reference business node.
[0045] The reference parsing intersection data is decrypted using the private key of the target business node to obtain the plaintext data to be supplemented corresponding to the target business node.
[0046] In one possible implementation, the target encrypted data is stored in a data structure with a primary key K and a value V; the processing unit is also used to perform the following operations:
[0047] Map the object address obtained by the target business node to a target curve point on an elliptic curve;
[0048] Obtain the key of the target business node, and encrypt the target curve point based on the key of the target business node to obtain the first primary key information;
[0049] Target encrypted data is generated based on the primary key information and the business data of the target business node.
[0050] On one hand, embodiments of this application provide a computer device, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the aforementioned blockchain data processing method.
[0051] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when read and executed by a processor of a computer device, causes the computer device to perform the aforementioned blockchain data processing method.
[0052] On one hand, embodiments of this application provide a computer program product or computer program that 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 executes the computer instructions, causing the computer device to perform the aforementioned blockchain data processing method.
[0053] In this embodiment, for business data constructed based on key-value pairs, after encrypting and updating the primary key information, the intersection of the updated business data after the encryption data is updated can be ensured through steps such as finding the intersection of business data of different business nodes. This allows each business node to share the plaintext data that it needs to supplement from the business intersection data. Compared with manually filtering and exchanging data from various datasets, this application can automatically realize the sharing of business data between different business nodes, thereby quickly completing the data exchange function of the same business data. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic diagram of the structure of a blockchain data processing system provided in an embodiment of this application;
[0056] Figure 2 This is a schematic diagram of a blockchain structure provided in an embodiment of this application;
[0057] Figure 3 This is a flowchart illustrating a blockchain data processing method provided in an embodiment of this application;
[0058] Figure 4 This is a schematic diagram illustrating a scenario for acquiring business data provided in an embodiment of this application;
[0059] Figure 5 This is a flowchart illustrating another blockchain data processing method provided in an embodiment of this application;
[0060] Figure 6 This is a schematic diagram of the interaction flow of a blockchain data processing method provided in an embodiment of this application;
[0061] Figure 7 This is a schematic diagram of the structure of a blockchain data processing device provided in an embodiment of this application;
[0062] Figure 8 This is a schematic diagram of another blockchain data processing device provided in the embodiments of this application;
[0063] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0064] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0065] This application proposes a blockchain data processing scheme that conveniently performs intersection processing on encrypted data from multiple business nodes on the blockchain, thereby ensuring the reliability and privacy of the business intersection data. The general principle of this blockchain data processing scheme is as follows: A consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting key-value pairs of business data based on the keys of the corresponding business nodes. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. First, the consensus node can obtain business update data for each set of encrypted data. The business update data for the target encrypted data in the n sets of encrypted data includes: data determined by reference business nodes encrypting the first primary key information of the target encrypted data according to their respective keys. The reference business node is the node among the n business nodes that has data update permissions for the target encrypted data, and the target encrypted data is any one of the n sets of encrypted data. Then, the consensus node can perform data intersection processing on the business update data of the n sets of encrypted data according to the second primary key information of each encrypted data set, thereby obtaining the business intersection data. Finally, the consensus node can send the business intersection data to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data.
[0066] Therefore, for business data constructed based on key-value pairs, after encrypting and updating the primary key information, the process of finding the intersection of the business update data after the encryption data update can ensure that the business data of different business nodes are processed to find the intersection. This allows each business node to share the plaintext data that it needs to supplement from the business intersection data. Compared with manually filtering and exchanging data from various datasets, this application can automatically realize the sharing of business data between different business nodes, thereby quickly completing the data exchange function of the same business data.
[0067] The blockchain data processing solution in this application can be combined with blockchain technology. Next, in conjunction with the attached... Figure 1 -Appendix Figure 2 This application provides a detailed introduction to the blockchain-related technologies involved in the blockchain data processing solution:
[0068] I. Blockchain Data Processing System:
[0069] The data processing system involved in this application embodiment can be a blockchain data processing system formed by multiple nodes connected through network communication. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. It is mainly used to organize data in chronological order and encrypt it into a ledger, making it tamper-proof and forgery-proof, while also enabling data verification, storage, and updating. Essentially, a blockchain is a decentralized database where each node stores an identical blockchain record. The blockchain network includes consensus nodes, which are responsible for achieving consensus across the entire blockchain network.
[0070] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of a blockchain data processing system provided in an embodiment of this application. Figure 1 As shown, the blockchain data processing system involved in this application embodiment can be a system including a witness network and a consensus network. The witness network may include multiple business nodes 101, and the consensus network may include multiple consensus nodes 102 (also referred to as accounting nodes). It should be understood that the number of business nodes in the witness network and the number of consensus nodes in the consensus network in this application embodiment are merely illustrative, and this application embodiment does not specifically limit them. Furthermore, the business nodes 101 and consensus nodes 102 in the blockchain data processing system can be directly or indirectly connected via wired or wireless communication methods, and this application does not impose any restrictions here.
[0071] Understandably, each consensus node 102 in the consensus network can receive input information during normal operation: for example, any consensus node 102 can receive encrypted data sent by any business node 101; or, any consensus node 102 can receive encrypted business update data sent by any business node 101. Then, each consensus node 102 can maintain shared data within the consensus network based on the received input information. To ensure information interoperability within the consensus network, each consensus node 102 in the consensus network can have information connections (e.g., direct or indirect connections via wired or wireless communication), and nodes can transmit information through these connections. For example, when any consensus node 102 in the consensus network receives input information, other consensus nodes in the consensus network obtain the input information according to the consensus algorithm and store it as data in the shared data, ensuring that the data stored on all consensus nodes in the blockchain data processing system is consistent.
[0072] Understandably, a blockchain network can establish information connections between nodes based on node identifiers. Each node in the blockchain data processing system (business node 101, consensus node 102) has a corresponding node identifier. Furthermore, each node in the blockchain data processing system can store the node identifiers of other nodes in the system, so that the generated block can be broadcast to other nodes in the blockchain data processing system based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list.
[0073] The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify a node in the blockchain network. Table 1 uses IP addresses as an example. For instance, node 1 (e.g., node 1 can be...) Figure 1 The business node 101 shown can send data to node 2 (for example, node 2 can be identified by node identifier 000.000.000.000) via node identifier 000.000.000. Figure 1 The consensus node 102 shown sends information (e.g., a block), and node 2 can determine that the information was sent by node 1 through node identifier 111.111.111.111.
[0074] Table 1. Node Identifier List
[0075] Node Name Node identifier Node 1 000.000.000.000 Node 2 111.111.111.111 … … Node N xx.xx.xx.xx
[0076] Next, combined Figure 1 The data processing schemes mentioned above will be further elaborated.
[0077] like Figure 1As shown, consensus nodes in the consensus network are primarily responsible for packaging a batch of transactions to generate blocks, executing transactions, and participating in block consensus (reaching consensus with other consensus nodes to update the blockchain state). Business nodes in the witness network are primarily responsible for executing business logic related to business data (e.g., obtaining browsing data of object A on a shopping platform; or obtaining social interaction data of object B on a social platform, etc.), submitting business data to the consensus network, and synchronizing block data from consensus nodes. Specifically, business nodes in the witness network can submit business data to consensus nodes in the consensus network. This business data is then uploaded to the blockchain only after passing through the block consensus of various consensus nodes in the consensus network. Additionally, business nodes in the witness network can also obtain already uploaded business data from consensus nodes in the consensus network. Furthermore, the witness network and the consensus network operate in different network environments. Typically, the witness network is in a public network, while the consensus network is in a private network (e.g., the network of a government or commercial organization).
[0078] It is understood that the business nodes and consensus nodes in the blockchain data processing system provided in this application embodiment can all be collectively referred to as computer devices, which include, but are not limited to, terminal devices or servers. Terminal devices may include, but are not limited to: mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), smart voice interaction devices, vehicle terminals, roadside devices, aircraft, wearable devices, smart home appliances, or wearable devices with network configuration management functions such as smartwatches, smart bracelets, and pedometers, etc. Servers may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0079] In one possible implementation, combining Figure 1The business node 101 and consensus node 102 further elaborate on the aforementioned blockchain data processing scheme. Specifically, consensus node 102 can obtain the business update data of each encrypted data set. The business update data of the target encrypted data in the n sets of encrypted data includes: data determined by each business node with data update permissions encrypting the first primary key information of the target encrypted data according to their respective keys. The target encrypted data is any one of the n sets of encrypted data. Then, consensus node 102 can perform data intersection processing on the business update data of the n sets of encrypted data based on the second primary key information of each encrypted data set, obtaining business intersection data. Next, consensus node 102 can send the business intersection data to the target business node (e.g., business node 101) among the n business nodes, so that the target business node 101 can parse the corresponding plaintext data to be supplemented from the business intersection data.
[0080] In another possible implementation, the target service node 101 can obtain encrypted data from n service nodes stored in the consensus node 102. Then, the target service node 101 uses the key of a reference service node to encrypt the first primary key information of the target encrypted data, generating service update data for the target encrypted data. Next, the target service node 101 sends the service update data of the target encrypted data to the consensus node 102, so that the consensus node 102 can determine the service intersection data based on the service update data of the target encrypted data and the service update data of other service nodes. Finally, the target service node 101 obtains the service intersection data from the consensus node 102 and determines the plaintext data to be supplemented based on the service intersection data.
[0081] It is understood that the system architecture diagrams described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0082] II. The Structure of Blockchain:
[0083] Please see Figure 2 , Figure 2 This is a schematic diagram of a blockchain structure provided in an embodiment of this application. For example... Figure 2As shown, a blockchain consists of multiple blocks (including the genesis block). The genesis block includes a block header and a block body. The block header stores the input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values of the current block (e.g., the input information is encrypted data, business update data, business intersection data, etc.), the block header feature values of the parent block, the version number, the timestamp, and the difficulty value, and so on. This ensures that the block data stored in each block of the blockchain is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks.
[0084] It's understandable that a block is a data packet carrying transaction data on a blockchain network. It's a data structure marked with a timestamp and the hash value of the previous block. Blocks are verified and their transactions confirmed through the network's consensus mechanism. It should be understood that in a blockchain, before a block is added to the chain, it needs to pass consensus among the consensus nodes in the network. Only after consensus is reached can the block be added to the blockchain. It's also understandable that when blockchain is used in scenarios involving government or commercial institutions, not all participating nodes in the blockchain (i.e., the aforementioned business nodes and consensus nodes) have sufficient resources and the necessity to become consensus nodes.
[0085] III. Intelligent Transportation:
[0086] In one possible implementation, the blockchain data processing scheme provided in this application embodiment can be applied to the fields of smart transportation and intelligent driving. Intelligent Traffic System (ITS), also known as Intelligent Transportation System, effectively integrates advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) into transportation, service control, and vehicle manufacturing, strengthening the connection between vehicles, roads, and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, improves the environment, and saves energy.
[0087] Specifically, the n business nodes can include a first business node and a second business node. The first business node can be traffic management platform A, located in city A, and the second business node can be car dealership B, located in city A. The first business node can then obtain traffic flow information for city A, such as vehicle volume, morning peak hours, evening peak hours, and detailed vehicle information. The second business node can obtain vehicle sales information for city A, such as vehicle brands, daily sales volume of each brand, and target audience for each brand. Next, the first and second business nodes can encrypt their respective obtained business data (traffic flow information and vehicle sales information for city A) and upload them to a consensus node in the blockchain. The consensus node stores the encrypted data on the blockchain. Based on the blockchain data processing scheme provided in this application, the consensus node can obtain business intersection data from the encrypted traffic flow information and vehicle sales information for city A. For example, the business intersection data can include vehicle brands with higher and lower traffic volumes in city A during morning and evening peak hours. Subsequently, the second business node can obtain the data from the intersection of business operations, and then analyze it to determine which brand vehicle sales revenue and promotional efforts need to be increased. In this way, different business nodes can securely and conveniently obtain supplementary data that is difficult for them to acquire on their own, and then expand the promotional efforts of their business brands and improve the company's performance based on this supplementary data.
[0088] It should be noted that in the subsequent specific embodiments of this application, data related to object information (such as the identity information of the target object) is involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from the object is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0089] Based on the above description of blockchain data processing schemes and systems, this application proposes a blockchain data processing method. See also... Figure 3 As shown, Figure 3 This is a flowchart illustrating a blockchain data processing method provided in an embodiment of this application. The blockchain data processing method can be derived from the above... Figure 1 The consensus node (e.g., terminal device or server) in the mentioned blockchain data processing system executes the process. The blockchain data processing method may include the following steps S301–S303:
[0090] S301. Obtain the business update data for each encrypted data, wherein the business update data for the target encrypted data in the n groups of encrypted data includes: the data determined by the reference business node after encrypting the first primary key information of the target encrypted data according to the key of each business node, the reference business node is the node with data update authority for the target encrypted data among the n business nodes, and the target encrypted data is any one of the n groups of encrypted data.
[0091] In this embodiment, the consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting business data constructed based on key-value pairs using the key of a business node. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. It should be understood that the key can include a private key and a public key. A private key is owned solely by its holder and is not disclosed to the public; a public key is accessible to any object and is publicly available. Unless otherwise specified, the key mentioned in this embodiment specifically refers to the private key.
[0092] In this application, both consensus nodes and business nodes can be nodes within the blockchain network, or consensus nodes can be nodes within the blockchain network while business nodes are nodes outside the blockchain network. This embodiment does not impose specific limitations on either. It should be noted that consensus nodes and business nodes typically reside in different network environments; consensus nodes generally refer to nodes in private networks, while business nodes generally refer to nodes in public networks.
[0093] In one possible implementation, the n sets of encrypted data stored by the consensus node can be obtained by each business node through calling the data upload interface of the smart contract. Similarly, the consensus node can also obtain business update data for each encrypted data through the same method, where each business node calls the data upload interface of the smart contract.
[0094] Each business node can acquire corresponding business data. Specifically, if the business node is a social platform, it can acquire social interaction messages generated between multiple objects on that platform. For example, the conversation messages of multiple group members in a group chat can be used as the business data acquired by the business node. If the business node is a shopping platform, it can acquire detailed shopping information (e.g., browsing history, purchase history) corresponding to multiple objects on that shopping platform. For example, the product information (e.g., name, amount, product category, etc.) and object information (e.g., nickname, account, etc.) purchased by each object on the shopping platform can be used as the business data acquired by the business node. In one possible implementation, please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram illustrating a scenario for acquiring business data, provided in an embodiment of this application. For example... Figure 4As shown, before a business node can obtain the object information (business data) of a target object, it needs to send an authorization request to the target object. This authorization request is used to request authorization from the target object. Only after the target object agrees to the authorization can the target object's object information be obtained. For example, after receiving the authorization request sent by the business node, the terminal device used by the target object can display interface S400. This interface S400 displays a prompt asking the target object whether it confirms the authorization, and includes a confirmation control 401 and a rejection control 402. If the target object clicks the confirmation control 401, it means that the target object agrees to the authorization; if the target object clicks the rejection control 402, it means that the target object rejects the authorization. In this way, the security of the object information can be ensured.
[0095] In one possible implementation, there is a one-to-one correspondence between the target business node and the target encrypted data, where the target business node is any one of the n business nodes. Before obtaining the business update data for each set of encrypted data, the consensus node can also obtain the data authorization request sent by the target business node for the smart contract authorization interface. This data authorization request includes node information of at least one reference business node, such as a node identifier. The reference business nodes include business nodes other than the target business node among the n business nodes. Then, the consensus node can respond to the data authorization request and determine that each reference business node indicated by the node information in the data authorization request has the permission to update the target encrypted data. It should be understood that the number of reference business nodes in this embodiment can be one or more, specifically, the number of reference business nodes can be n-1.
[0096] For example, suppose n=2, where the target service node is Node 1, and the reference service nodes include Node 2. Then, Node 1 can send a data authorization request to the consensus node, carrying the node identifier of Node 2. After the consensus node responds to this request, it can determine that Node 2 has the authority to update Node 1's encrypted data. Similarly, Node 2 can also send a data authorization request to the consensus node, carrying the node identifier of Node 1. After the consensus node responds to this request, it can determine that Node 1 has the authority to update Node 2's encrypted data.
[0097] Furthermore, once the consensus node determines that each reference business node has the authority to update the target encrypted data, it can send an authorization success notification message to each reference business node. This message instructs each reference business node to update its corresponding encrypted data, thereby obtaining their respective updated business data. In this way, each business node, by calling the smart contract authorization interface, grants other business nodes the authority to update the encrypted data it uploads, ensuring security and reliability during data processing.
[0098] In one possible implementation, the data authorization request carries the node identifier of the target business node. When the consensus node receives the data authorization request, it can obtain the node identifier of the target business node. Then, it verifies the target business node based on the node identifier; this verification can include security and legitimacy checks. If the verification passes, the consensus node responds to the data authorization request; if the verification fails, the consensus node does not respond. In this way, the target business node can be verified, ensuring reliability and security during data processing.
[0099] In one possible implementation, the target encrypted data is stored in a primary key K (Key) - value V (Value) data structure. The value information of the target encrypted data is generated based on the business data of the target business node. Specifically, the first primary key information of the target encrypted data is determined by encrypting the curve point mapped to the target business node on an elliptic curve using the target business node's key. The curve point mapped to the target business node on the elliptic curve is generated based on the object address obtained by the target business node. For example, if the object address of the target business node is represented as addr, then the curve point mapped to this object address addr on the elliptic curve can be represented as P(addr). The key of the target business node can be a random number k generated by a random algorithm. Then, by encrypting P(addr) based on k, the first primary key information of the target encrypted data, Enc(addr) = k*P(addr), can be obtained.
[0100] It should be understood that the object address of any object is unique on the blockchain. Therefore, the business data of the target business node can use the object address obtained by the target business node as the primary key. The business data that each business node can obtain is limited. For example, the first business node can obtain attribute a and attribute c of addr1 (object 1) and addr3 (object 3); the second business node can obtain attribute a and attribute b of addr1 (object 1) and addr2 (object 2). The data structure of this business data can then be shown in Table 1 below:
[0101] Table 1. Data Structure of Business Data
[0102] object address Attribute a Attribute b Attribute c addr1 XXX XXX XXX addr2 XXX XXX XXX addr3 XXX XXX XXX
[0103] As shown in Table 1 above, the data structure of business data can be in the format of K(Key)-V(Value). Here, Key can refer to the object address; Value can refer to the specific content of the business data. For example, when Key = addr1, Value = the specific content included in attribute a, attribute b, and attribute c respectively.
[0104] Furthermore, if each business node wants to obtain the common attributes of each business and complete the attributes of the common object, it can encrypt the business data based on the key of each business node to obtain the encrypted data of each business node, and store each encrypted data on the blockchain. In this way, the privacy of business data can be protected and the leakage of business data can be prevented.
[0105] It should be noted that in the subsequent embodiments of this application, n service nodes, including the first service node and the second service node, are used as an example to describe in detail the relevant steps involved in the embodiments of this application:
[0106] 1) First encrypted data, second encrypted data:
[0107] On the blockchain, the encrypted data of the first business node (which can be called the first encrypted data) is stored in the smart contract with the data structure shown in Table 2.1 below. The object addresses (addr1, addr3) are protected by the key k1 of the first business node.
[0108] Table 2.1 First Encrypted Data
[0109] object address Attribute a Attribute c k1*P(addr1) XXX XXX k1*P(addr3) XXX XXX
[0110] Similarly, the encrypted data of the second business node (which can be called the second encrypted data) is stored in the smart contract with the data structure shown in Table 2.2 below. The object addresses (addr1, addr2) are protected by the key k2 of the second business node.
[0111] Table 2.2 Second Encrypted Data
[0112]
[0113]
[0114] As shown in Tables 2.1 and 2.2 above, the first primary key information of the encrypted data of the first service node refers to: k1*P(addr1) and k1*P(addr3). The first primary key information of the encrypted data of the second service node refers to: k2*P(addr1) and k2*P(addr2).
[0115] In this way, the business data of each business node stored in the consensus node is obtained after being encrypted using the key of the corresponding business node, thus ensuring the security of each business data.
[0116] 2) First business update data, second business update data:
[0117] In this embodiment of the application, the first business update data can be obtained by the second business node calling the data update interface of the smart contract to update the first encrypted data; similarly, the second business update data can be obtained by the first business node calling the data update interface of the smart contract to update the second encrypted data.
[0118] In one possible implementation, the first business node corresponds to the first encrypted data, and the second business node corresponds to the second encrypted data; the obtained business update data includes the first business update data and the second business update data. The first business update data is obtained by encrypting the first encrypted data, and the second business update data is obtained by encrypting the second encrypted data.
[0119] Specifically, the first business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data based on the private key of the second business node; the second business update data is obtained by the first business node encrypting the second initial business update data based on the public key and key exchange algorithm of the second business node, and the second initial business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data based on the private key of the first business node.
[0120] Alternatively, the first business update data is obtained by the second business node encrypting the first initial business update data based on the public key and key exchange algorithm of the first business node; the first initial business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data based on the private key of the second business node; the second business update data of the second business node is obtained by the first business node encrypting the first primary key information of the second encrypted data based on the private key of the first business node.
[0121] Specifically, the key exchange algorithm can be the Diffie-Hellman (DH) key exchange algorithm. This algorithm allows two communicating parties to create a key over an insecure channel without any prior information about each other. Specifically, the DH key exchange algorithm works as follows: First service node A has a private key x and a public key g^x; second service node B has a private key y and a public key g^y. Then, A and B exchange their public keys. For A, the new key is (g^y)^x = g^(yx); for B, the new key is (g^x)^y = g^(xy). In this way, A and B negotiate a new key g^(xy), which is determined based on the keys of A and B respectively.
[0122] Understandably, the key of the first business node can be represented as k1, and the key of the second business node can be represented as k2. The second primary key information of the first business update data, determined based on the DH key exchange algorithm, is the same as the second primary key information of the second business update data. For example, the second primary key information can be: k2*k1*P(addr); or, the second primary key information can be: k1*k2*P(addr). In this way, the business update data of each encrypted data is obtained after encryption by each business node with data update authority, ensuring data reliability. Furthermore, each business update data is encrypted using the keys of other business nodes and its own key, ensuring that the encryption keys of each business update data are the same.
[0123] S302. Based on the encrypted second primary key information of each data set, perform data intersection processing on the business update data of n sets of encrypted data to obtain business intersection data.
[0124] It is understandable that since each encrypted data is obtained by encrypting it using the key of each business node, and each business update data is obtained by encrypting it again using the keys of other business nodes, each business update data is actually obtained by encrypting it using the keys of all business nodes (its own business node and other business nodes), thus ensuring that the encryption keys of each business update data are the same. In other words, the second primary key information of each business update data is determined by the keys of all business nodes. Next, this application embodiment will illustrate this by taking the example that the second primary key information of each encrypted data is equal to k1*k2*P(addr):
[0125] For example, after updating the encrypted data of the first service node according to the key exchange algorithm, the data structure of the first service update data is shown in Table 3.1 below:
[0126] Table 3.1 First Business Update Data
[0127] object address Attribute a Attribute c k1*k2*P(addr1) XXX XXX k1*k2*P(addr3) XXX XXX
[0128] Similarly, after updating the encrypted data of the second service node, the data structure of the resulting updated data for the second service is shown in Table 3.2 below:
[0129] Table 3.2 Second Business Update Data
[0130] object address Attribute a Attribute b k1*k2*P(addr1) XXX XXX k1*k2*P(addr2) XXX XXX
[0131] As shown in Tables 3.1 and 3.2 above, the second primary key information of the first business update data refers to: k1*k2*P(addr1) and k1*k2*P(addr3). The second primary key information of the second business update data refers to: k1*k2*P(addr1) and k1*k2*P(addr2).
[0132] Alternatively, based on the key exchange algorithm, after updating the encrypted data of the first service node, the data structure of the first service update data is shown in Table 3.3 below:
[0133] Table 3.3 First Business Update Data
[0134] object address Attribute a Attribute c k2*k1*P(addr1) XXX XXX k2*k1*P(addr3) XXX XXX
[0135] Similarly, after updating the encrypted data of the second service node, the data structure of the resulting updated data for the second service is shown in Table 3.4 below:
[0136] Table 3.4 Second Business Update Data
[0137] object address Attribute a Attribute b k2*k1*P(addr1) XXX XXX k2*k1*P(addr2) XXX XXX
[0138] As shown in Tables 3.3 and 3.4 above, the second primary key information of the first business update data refers to: k2*k1*P(addr1) and k2*k1*P(addr3). The second primary key information of the second business update data refers to: k2*k1*P(addr1) and k2*k1*P(addr2).
[0139] In one possible implementation, the consensus node performs data intersection processing on the n sets of encrypted business update data based on the encrypted second primary key information of each data set, to obtain business intersection data. Specifically, this may include: obtaining business update data with the same second primary key information from the n sets of encrypted business update data; and determining the obtained business update data with the same second primary key information as the business intersection data. Specifically, the consensus node can obtain the same second primary key information k1*k2*P(addr1) from the first and second business update data. Then, the business update data with the second primary key information k1*k2*P(addr1) are combined to form the business intersection data. The data structure of the business intersection data is shown in Table 4 below.
[0140] Table 4 Business Intersection Data
[0141] object address Attribute a Attribute b Attribute c k1*k2*P(addr1) XXX XXX XXX
[0142] The consensus node can call the smart contract's data intersection interface and perform data intersection processing on the business update data of n sets of encrypted data based on the encrypted second primary key information of each data, thereby obtaining the business intersection data shown in Table 4 above. It can be seen that since the first business node can obtain attributes a and c of addr1 and addr3, and the second business node can obtain attributes a and b of addr1 and addr2, it should be understood that one addr corresponds to one identical business. Therefore, for the first and second business nodes, during the data sharing process, the method provided in this application embodiment allows the first business node to share attributes a and c of addr1, and the second business node to share attributes a and b of addr1. In this way, during the data sharing process, both parties share the business data of the same business (addr1), and will not expose or leak other business data in their respective datasets (e.g., attributes a and c of addr3 in the first business node; and attributes a and b of addr2 in the second business node), thereby ensuring data privacy and reliability.
[0143] It is understandable that the essence of business nodes updating their respective encrypted data is that each business node re-encrypts the primary key information in the encrypted data, thereby transforming the primary key information generated using the keys of each business node into secondary primary key information generated using the keys of all business nodes. In this way, the first and second business nodes can update their respective encrypted data based on a key exchange algorithm to obtain updated business data. This ensures that the secondary primary key information of all updated business data stored on-chain (consensus nodes) is identical, facilitating data intersection processing based on the same secondary primary key information to determine the business intersection data.
[0144] S303. Send the business intersection data to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data.
[0145] Specifically, consensus nodes can send the business intersection data to the first business node and the second business node respectively. The first and second business nodes can then parse the corresponding plaintext data to be supplemented from the business intersection data. For example, the first business node can parse the attribute b of addr1 to be supplemented from the business intersection data; the second business node can parse the attribute c of addr1 from the business intersection data. In this process, no other business node besides the first and second business nodes obtains the plaintext of the business intersection data; furthermore, the first and second business nodes only obtain the plaintext of the data between them, and they still cannot decrypt data outside the intersection.
[0146] In this embodiment, when n business nodes need to share their respective business data, they can generate encrypted data by encrypting the business data based on the keys of the business nodes, where n is a positive integer greater than 1. That is, the consensus node stores n sets of encrypted data generated by the n business nodes. The consensus node can obtain business update data for each encrypted data set. The business update data for the target encrypted data in the n sets of encrypted data includes: data determined by the reference business node encrypting the first primary key information of the target encrypted data according to its own key. The reference business node is the node among the n business nodes that has data update permissions for the target encrypted data, and the target encrypted data is any one of the n sets of encrypted data. Then, the consensus node can perform data intersection processing on the business update data of the n sets of encrypted data based on the second primary key information of each encrypted data set, thereby obtaining business intersection data. Finally, the consensus node can send the business intersection data to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data. Therefore, this application, by encrypting business data at each business node, setting data update permissions for business nodes, and re-encrypting the primary key information of any encrypted data, can ensure that the business data of different business nodes can be intersected on the blockchain. This allows each business node to share the plaintext data it needs to supplement from the business intersection data. Compared with manual data exchange, this application can automate data sharing, thereby improving the efficiency of data processing. Furthermore, the entire data sharing process is carried out on the blockchain, which can guarantee data privacy.
[0147] Please see Figure 5 , Figure 5 This is a flowchart illustrating another blockchain data processing method provided in an embodiment of this application. Figure 5 As shown, this blockchain data processing method can be derived from the above. Figure 1The target business node (e.g., any one of n business nodes) in the mentioned blockchain data processing system executes the process. The blockchain data processing method may include the following steps S501–S504:
[0148] S501. Obtain the encrypted data of n business nodes stored in the consensus node.
[0149] In one possible implementation, the consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting business data using the key of a business node. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. Any one of the n business nodes is represented as the target business node. Each business node stores the encrypted data generated based on its own key into the consensus node. The target business node generates target encrypted data, where n is a positive integer greater than 1.
[0150] It should be noted that the embodiments of this application take n service nodes, including target service nodes and reference service nodes, as an example for detailed description. In particular, it should be noted that the target service node in the embodiments of this application can be the first service node mentioned in the above embodiments, and the reference service node can be the second service node mentioned in the above embodiments.
[0151] In one possible implementation, the target encrypted data is stored as a primary key K (Key) - value V (Value) data structure. The process of generating the target encrypted data will be described below:
[0152] 1) Map the object address obtained by the target business node to the target curve point on the elliptic curve.
[0153] Specifically, assuming an object address is represented as `addr`, where an object address uniquely identifies an object, the target curve point mapped onto an elliptic curve by the target business node can be represented as `P(addr)`. Common elliptic curves include `Secp256k1` and `curve25519`. It should be understood that on an elliptic curve, calculating the product G*v of a point G and a scalar v is relatively easy, while finding the scalar v from point G and the product G*v, or vice versa, is extremely difficult, comparable to the discrete logarithm problem. Therefore, the encrypted target data obtained in this way is not easily decrypted by other business nodes, thus ensuring the security of the encrypted target data.
[0154] 2) Obtain the key of the target business node, and encrypt the target curve point based on the key of the target business node to obtain the first primary key information.
[0155] The key k of the target service node can be generated using a random algorithm. For example, the target service node can generate a random number and use this random number as its key k. Then, using k as the key, the object address can be encrypted to obtain the first primary key information: Enc(addr) = k*P(addr). For example, the key of the target service node can be k1, and the key of the reference service node can be k2.
[0156] 3) Generate target encrypted data based on the primary key information and the business data of the target business node.
[0157] The target encrypted data may include multiple primary key information entries, each corresponding to an object address, and the primary key information entries within the same business node share the same key. For example, the data structure of the target encrypted data may be as shown in Table 2.1 or Table 2.2 above.
[0158] It should be noted that after generating the target encrypted data, the target business node can send the target encrypted data to the consensus node for storage by calling the data upload interface of the smart contract. After receiving the target encrypted data, the consensus node can send it to other consensus nodes in the consensus network, allowing them to reach a consensus on the target encrypted data. If the consensus is successful, the target encrypted data can be stored on the blockchain.
[0159] S502. Perform data encryption processing on the first primary key information of the encrypted data of the reference business node to generate business update data corresponding to the encrypted data of the reference business node.
[0160] In one possible implementation, before the target business node encrypts the first primary key information of the encrypted data of the reference business node and generates the business update data corresponding to the encrypted data of the reference business node, the process further includes: sending a data authorization request to the consensus node for the smart contract authorization interface. The data authorization request includes node information of at least one reference business node, which includes n business nodes other than the target business node. The data authorization request triggers the consensus node to determine that each reference business node indicated by the node information in the data authorization request has the permission to update the encrypted data corresponding to the target business node.
[0161] In one possible implementation, the target service node performs data encryption processing on the first primary key information of the encrypted data of the reference service node to generate service update data corresponding to the encrypted data of the reference service node. This can include: using the key of the target service node to perform data encryption processing on the first primary key information of the encrypted data of the reference service node to obtain the service update data corresponding to the encrypted data of the reference service node; or, using the key of the target service node to perform data encryption processing on the first primary key information of the encrypted data of the reference service node to obtain reference initial service update data; and then, based on the public key and key exchange algorithm of the reference service node, performing data encryption processing on the reference initial service update data to generate the service update data corresponding to the encrypted data of the reference service node.
[0162] For example, suppose the target service node is represented as node 1, and the reference service node is represented as node 2. The first primary key information of the encrypted data of the reference service node can be represented as: Enc(addr1) = k2*P(addr1). Then, node 1 can encrypt the first primary key information k2*P(addr1) of the encrypted data of the reference service node based on node 1's key k1 to obtain the service update data k1*k2*P(addr1) corresponding to the encrypted data of the reference service node; or, based on the public key and key exchange algorithm of the reference service node (e.g., DH key exchange algorithm), encrypt k1*k2*P(addr1) to generate the service update data k2*k1*P(addr1) corresponding to the encrypted data of the reference service node.
[0163] S503. Send the business update data corresponding to the encrypted data of the reference business node to the consensus node, so that the consensus node can determine the business intersection data based on the business update data corresponding to the encrypted data of the reference business node and the business update data sent to the consensus node by other business nodes.
[0164] Similarly, the business update data of the target encrypted data includes: data determined by the reference business node encrypting the first primary key information of the target encrypted data according to the reference business node's key; or, the reference business node encrypting the first primary key information of the target encrypted data according to the reference business node's key to obtain the target initial business update data; then, the reference business node encrypts the target initial business update data based on the target business node's public key and key exchange algorithm to generate the business update data of the target encrypted data.
[0165] The business update data for the target encrypted data includes: data determined by the reference business nodes encrypting the first primary key information of the target encrypted data according to their respective keys. The reference business node is any one of the n business nodes that has the authority to update the target encrypted data, and the target encrypted data is any one of the n sets of encrypted data.
[0166] In this way, each business node can update the encrypted data of other business nodes, thereby obtaining the business update data of the encrypted data of other nodes. Finally, the business update data generated by each business node can be uploaded to the consensus node, so that the consensus node can determine the business intersection data based on the business update data.
[0167] For example, if the first primary key information of the target encrypted data can be represented as: Enc(addr1) = k1*P(addr1), then, based on the key k2 of the reference service node (node 2), after encrypting Enc(addr1) = k1*P(addr1), the resulting second primary key information is represented as: k1*k2*P(addr1). Alternatively, if the first primary key information of the target encrypted data can be represented as: Enc(addr1) = k2*P(addr1), then, based on the key k1 of the reference service node (node 1), after encrypting Enc(addr1) = k1*P(addr1), the resulting second primary key information is represented as: k2*k1*P(addr1).
[0168] In this way, each business node can encrypt its own encrypted data based on the keys of other business nodes to obtain its own encrypted business update data. Then, each business node can call the smart contract's data upload interface to send its encrypted business update data to the consensus node.
[0169] S504. Obtain the business intersection data from the consensus node, and determine the plaintext data to be supplemented based on the business intersection data.
[0170] It should be understood that the business intersection data obtained by finding the intersection of encrypted data on the blockchain has the following application scenarios:
[0171] 1) Multiple business nodes complete the attribute information of a common object without exposing any data in the dataset. Specifically, the first business node can provide attribute a and attribute b of object 1; the second business node can provide attribute a and attribute c of object 1. Then, through this application, the first and second business nodes can obtain the attributes a, attribute b, and attribute c of object 1 by performing data intersection processing.
[0172] 2) Multiple business nodes acquire overlapping object information from the dataset without exposing any data within the dataset. Specifically, the first business node can provide attribute a and attribute b of object 1; the second business node can provide attribute a and attribute c of object 1. Therefore, through this application, the first and second business nodes can determine the overlapping object information as attribute a of object 1 by performing data intersection processing.
[0173] In one possible implementation, the target service node can send a data acquisition request to the consensus node, carrying its node identifier. The consensus node can then verify the target service node based on this identifier, which may include security and legitimacy checks. If the verification passes, the consensus node responds to the data acquisition request and sends the intersecting business data to the target service node; if the verification fails, the consensus node does not respond to the request. This method effectively verifies the target service node, ensuring reliability and security during data processing.
[0174] In one possible implementation, the target business node determines the plaintext data to be supplemented based on the business intersection data, which may include the following process:
[0175] ① Based on the private key of the target business node, the business intersection data is parsed to obtain the target parsed intersection data, and the target parsed intersection data is sent to the consensus node.
[0176] For example, the business intersection data can be as shown in Table 4 above. Then, the target business node can call the smart contract's data parsing interface and parse the business intersection data based on the target business node's private key k1 to obtain the target parsed intersection data. The target parsed intersection data is shown in Table 5.1 below:
[0177] Table 5.1 Target Intersection Data
[0178] object address Attribute a Attribute b Attribute c k2*P(addr1) XXX XXX XXX
[0179] Understandably, the target parsed intersection data is encrypted using the reference business node's key (k2). Next, the target business node can call the smart contract's data upload interface to send the aforementioned target parsed intersection data to the consensus node.
[0180] ② Receive reference parsing intersection data sent by consensus nodes. The reference parsing intersection data is obtained by parsing the business intersection data based on the private key of the reference business node.
[0181] Similarly, for the reference business node, it can call the smart contract's data parsing interface and parse the business intersection data based on its private key k2 to obtain the reference parsed intersection data. The reference parsed intersection data is shown in Table 5.2 below:
[0182] Table 5.2 Reference Intersection Data
[0183] object address Attribute a Attribute b Attribute c k1*P(addr1) XXX XXX XXX
[0184] Understandably, the reference parsing intersection data is ciphertext data obtained by encrypting the target business node's key (k1). Next, the target business node can call the smart contract's data upload interface to send the aforementioned reference parsing intersection data to the consensus node.
[0185] ③ Decrypt the reference parsing intersection data based on the private key of the target business node to obtain the plaintext data to be supplemented corresponding to the target business node.
[0186] Specifically, after the target service node decrypts the reference parsing intersection data shown in Table 5.2 above using its private key k1, it can obtain the service intersection plaintext data shown in Table 6 below:
[0187] Table 6. Plaintext Data of Business Intersection
[0188] object address Attribute a Attribute b Attribute c P(addr1) XXX XXX XXX
[0189] As shown in Table 6 above, based on the plaintext data of the business intersection, the target business node can determine that the plaintext data to be supplemented for the target business node is attribute b of addr1. This shows that the target business node (the first business node) can obtain the business data including attributes a and c of addr1. After data intersection on the blockchain, the first business node can also obtain attribute b of addr1, thus enriching its own business data. Furthermore, the entire process is encrypted on the blockchain, ensuring data security.
[0190] Similarly, for the reference service node, the target parsing intersection data shown in Table 5.1 above can also be decrypted using the private key k2 to obtain the service intersection plaintext data shown in Table 6 above. Therefore, based on the service intersection plaintext data, the plaintext data to be supplemented for the reference service node can be determined to be attribute c of addr1.
[0191] It should be understood that in the above process, apart from the target business node (first business node) and the reference business node (second business node), other business nodes did not obtain the plaintext data of the business intersection data. Furthermore, for both the target business node (first business node) and the reference business node (second business node), they only obtained the plaintext data of the business intersection data; for data outside the intersection, neither the first nor the second business node could decrypt it. Therefore, through the embodiments of this application, the process of determining the business intersection data is carried out on the blockchain, ensuring the reliability of the business intersection data; and, not all business nodes can decrypt the business intersection data, thereby ensuring the security of the business intersection data.
[0192] Next, taking a specific business scenario and using n business nodes, including the first business node and the second business node, as an example, the blockchain data processing solution provided in this application embodiment will be described in detail again. Please refer to... Figure 6 , Figure 6 This is a schematic diagram of the interaction flow of a blockchain data processing method provided in an embodiment of this application. For example... Figure 6 As shown, this blockchain data processing method can be jointly executed by a first business node, a second business node, and a consensus node. Specifically, this blockchain data processing method may include the following steps S601 to S6013:
[0193] S601. The first service node obtains the first service data and generates the first encrypted data based on the first service data.
[0194] In this embodiment, if the first business node is a social platform, the first business node can obtain social interaction messages generated between multiple objects on the social platform. For example, the dialogue messages of multiple group members in a group chat session can be used as the first business data obtained by the first business node. The first business data can include all dialogue messages generated within the time period from the creation of the group chat session to the time of acquisition; the first business data can also include dialogue messages included within a fixed time period (e.g., January 1st to January 31st), and this embodiment does not specifically limit this.
[0195] In one possible implementation, the first service node generating the first encrypted data based on the first service data may include the following steps:
[0196] ① Map the object address of the first business node to the target curve point on the elliptic curve.
[0197] Specifically, assume the object address obtained by the first business node is addr1. An object address can be used to uniquely identify an object; for example, addr1 can be used to identify object 1. Then, the target curve point mapped by the first business node on the elliptic curve can be represented as: P(addr1).
[0198] ② Obtain the key of the first business node, and encrypt the target curve point based on the key of the first business node to obtain the first primary key information.
[0199] The key k1 of the first business node can be generated using a random algorithm. For example, the first business node can generate a random number using a random algorithm and use this random number as the key k1 of the target business node. Then, using k1 as the key, the object address can be encrypted to obtain the first primary key information: Enc(addr1) = k1*P(addr1).
[0200] ③ Generate the first encrypted data based on the first primary key information and the first business data.
[0201] For example, the first encrypted data can be in KV data format. For instance, the data structure of the first encrypted data can be as shown in Table 2.1 above, which will not be described again in the embodiments of this application.
[0202] S602, The first business node sends the first encrypted data to the consensus node.
[0203] Specifically, the first business node can call the smart contract's data upload interface to send the first encrypted data to the consensus node.
[0204] S603, the second service node obtains the second service data and generates the second encrypted data based on the second service data.
[0205] In this embodiment, if the second business node is a shopping platform, it can obtain detailed shopping information (e.g., browsing history, purchase history) corresponding to multiple objects on the shopping platform. For example, the product information (e.g., name, amount, product category, etc.) and browsing history of each object purchased on the shopping platform can be used as the second business data obtained by the second business node. The second business data may include all purchase records generated on the shopping platform within a certain time period (e.g., January 1st to January 31st); the second business data may also include all purchase records generated in a specific store, and this embodiment does not specifically limit this.
[0206] It should be noted that the execution process of "the second business node generating second encrypted data based on the second business data" can be referred to the execution process of "the first business node generating first encrypted data based on the first business data" shown in S601 above. This application embodiment will not repeat the details.
[0207] S604, The second business node sends the second encrypted data to the consensus node.
[0208] It should be noted that steps S601 and S603 can be executed sequentially or in parallel; similarly, steps S602 and S604 can be executed sequentially or in parallel. In other words, steps S601-S604 do not constitute a limitation on the specific execution order of each step.
[0209] S605, The first business node generates the second business update data.
[0210] In one possible implementation, before the first business node generates the first business update data, the first business node sends a data authorization request to the consensus node for the smart contract authorization interface. This data authorization request is used to trigger the consensus node to determine that the second business node has the authority to update the first encrypted data.
[0211] The second business update data includes: data obtained by encrypting the first primary key information of the second encrypted data based on the private key of the first business node. For example, if the private key of the first business node is represented as k1, and the first primary key information of the second encrypted data is represented as k2*P(addr1), then the second primary key information of the second business update data can be represented as: k1*k2*P(addr1).
[0212] Alternatively, the second service update data may include: second initial service update data encrypted using the public key and key exchange algorithm of the second service node. The second initial service update data is obtained by the first service node encrypting the first primary key information of the second encrypted data using its private key. For example, if the private key of the first service node is represented as k1, and the first primary key information of the second encrypted data is represented as k2*P(addr1), then the second primary key information of the second service update data can be represented as: k2*k1*P(addr1).
[0213] S606, The first service node sends the second service update data to the consensus node.
[0214] The first business node can call the smart contract's data upload interface to send the second business update data to the consensus node.
[0215] S607, The second business node generates the first business update data.
[0216] In one possible implementation, before the second business node generates the first business update data, the second business node sends a data authorization request to the consensus node for the smart contract authorization interface. This data authorization request is used to trigger the consensus node to determine that the first business node has the authority to update the second encrypted data.
[0217] The first business update data includes: data obtained by the second business node encrypting the first primary key information of the first encrypted data based on the private key of the second business node. For example, if the private key of the second business node is represented as k2, and the first primary key information of the first encrypted data is represented as k1*P(addr1), then the second primary key information of the first business update data can be represented as: k2*k1*P(addr1).
[0218] Alternatively, the first service update data includes: encrypted first initial service update data based on the public key and key exchange algorithm of the first service node; the first initial service update data is obtained by the second service node encrypting the first primary key information of the first encrypted data based on the private key of the second service node. For example, if the private key of the first service node is represented as k1, and the first primary key information of the second encrypted data is represented as k2*P(addr1), then the second primary key information of the first service update data can be represented as: k1*k2*P(addr1).
[0219] S608, the second service node sends the first service update data to the consensus node.
[0220] The second business node can call the smart contract's data upload interface to send the first business update data to the consensus node.
[0221] It should also be noted that steps S605 and S607 can be executed sequentially or in parallel; similarly, steps S606 and S608 can be executed sequentially or in parallel. In other words, steps S605-S608 do not constitute a limitation on the specific execution order of each step.
[0222] The second business node can call the smart contract's data upload interface to send the first business update data to the consensus node.
[0223] S609. The consensus node performs data intersection processing on the first service update data and the second service update data to obtain the service intersection data.
[0224] Specifically, consensus nodes can obtain business update data with the same second primary key information from the first and second business update data, and combine them into business intersection data. For example, the same second primary key information obtained from the first and second business update data can be represented as: k1*k2*P(addr1).
[0225] S6010, the consensus node sends business intersection data to the first business node.
[0226] S6011, the consensus node sends business intersection data to the second business node.
[0227] It should be understood that after receiving a data acquisition request from the first business node or the second business node, the consensus node can respond to the data acquisition request and send the business intersection data to the first business node or the second business node.
[0228] S6012, The first business node parses the corresponding plaintext data to be supplemented from the business intersection data.
[0229] In practice, the first business node can parse the second parsed intersection data from the business intersection data. The second parsed intersection data is ciphertext data obtained by encrypting the second business node's key k2.
[0230] Furthermore, the first business node can call the smart contract's data upload interface to send the second parsed intersection data to the consensus node. Subsequently, the second parsed intersection data can be used by the second business node for parsing, thereby obtaining the business intersection plaintext data.
[0231] Therefore, the first service node can obtain the first parsed intersection data from the consensus node. This first parsed intersection data is ciphertext data obtained by encrypting the data using the first service node's key k1. The first service node can then parse this first parsed intersection data to obtain the service intersection plaintext data. Finally, based on the service intersection plaintext data, the corresponding supplementary plaintext data for the first service node is obtained.
[0232] S6013, The second business node parses the corresponding plaintext data to be supplemented from the business intersection data.
[0233] Similarly, the second service node obtains the second parsed intersection data from the consensus node. This second parsed intersection data is ciphertext data obtained by encrypting the data using the second service node's key k2. The second service node can then parse this second parsed intersection data to obtain the service intersection plaintext data. Finally, based on the service intersection plaintext data, the second service node obtains the corresponding supplementary plaintext data.
[0234] In this embodiment, apart from the first business node and the second business node, other business nodes did not obtain the plaintext data of the business intersection data. Furthermore, both the first and second business nodes only obtained the plaintext data of the business intersection data; they were unable to decrypt data outside the intersection. Additionally, the process of determining the business intersection data was performed on the blockchain, ensuring the reliability of the business intersection data; and not all business nodes could decrypt the business intersection data, thus ensuring its security.
[0235] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a blockchain data processing device provided in an embodiment of this application. The blockchain data processing device 700 can be applied to the consensus node in the aforementioned embodiments. The blockchain data processing device 700 can be a computer program (including program code) running on a computer device; for example, the blockchain data processing device 700 is an application software. The blockchain data processing device 700 can be used to execute corresponding steps in the blockchain data processing method provided in the embodiments of this application.
[0236] The blockchain data processing device 700 is used in consensus nodes of a blockchain. Each consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting business data constructed based on key-value pairs using the key of a business node. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. The blockchain data processing device 700 includes:
[0237] The acquisition unit 701 is used to acquire business update data for each encrypted data. The business update data of the target encrypted data in the n groups of encrypted data includes: data determined by the reference business node after encrypting the first primary key information of the target encrypted data according to the key of each business node. The reference business node is the node with data update authority for the target encrypted data among the n business nodes. The target encrypted data is any one of the n groups of encrypted data.
[0238] Processing unit 702 is used to perform data intersection processing on the business update data of n sets of encrypted data according to the second primary key information of each data encryption, so as to obtain business intersection data;
[0239] The sending unit 703 is used to send the service intersection data to the target service node among the n service nodes, so that the target service node can parse the corresponding plaintext data to be supplemented from the service intersection data.
[0240] In one possible implementation, the target service node corresponds to the target encrypted data; before obtaining the service update data for each group of encrypted data, the processing unit 702 is also used to perform the following operations:
[0241] Obtain the data authorization request sent by the target business node for the smart contract authorization interface. The target business node is any one of the n business nodes. The data authorization request includes node information of at least one reference business node. The reference business nodes include business nodes other than the target business node among the n business nodes.
[0242] In response to the data authorization request, determine that each reference business node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
[0243] In one possible implementation, the target encrypted data is stored in a data structure with a primary key K and a value V, and the value information of the target encrypted data is generated based on the business data of the target business node.
[0244] Among them, the first primary key information of the target encrypted data is determined by encrypting the curve points mapped on the elliptic curve using the key of the target business node.
[0245] The curve points mapped on the elliptic curve for the target business node are generated based on the object addresses obtained from the target business node.
[0246] In one possible implementation, the n business nodes include a first business node and a second business node; the first business node corresponds to the first encrypted data, and the second business node corresponds to the second encrypted data; the obtained business update data includes the first business update data and the second business update data; the first business update data is obtained by encrypting the first encrypted data, and the second business update data is obtained by encrypting the second encrypted data.
[0247] Specifically, the first business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data using the private key of the second business node; the second business update data is obtained by the first business node encrypting the second initial business update data using the public key and key exchange algorithm of the second business node; and the second initial business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data using the private key of the first business node.
[0248] Alternatively, the first business update data is obtained by the second business node encrypting the first initial business update data based on the public key and key exchange algorithm of the first business node; the first initial business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data based on the private key of the second business node; and the second business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data based on the private key of the first business node.
[0249] In one possible implementation, the processing unit 702 performs data intersection processing on the business update data of n sets of encrypted data based on the encrypted second primary key information of each data set, to obtain business intersection data, which is used to perform the following operations:
[0250] Retrieve business update data with the same second primary key information from n sets of encrypted business update data;
[0251] The business update data that have the same secondary primary key information are combined into business intersection data.
[0252] In this embodiment, for business data constructed based on key-value pairs, after encrypting and updating the primary key information, the intersection of the updated business data after the encryption data is updated can be ensured through steps such as finding the intersection of business data of different business nodes. This allows each business node to share the plaintext data that it needs to supplement from the business intersection data. Compared with manually filtering and exchanging data from various datasets, this application can automatically realize the sharing of business data between different business nodes, thereby quickly completing the data exchange function of the same business data.
[0253] Please see Figure 8 , Figure 8 This is a schematic diagram of another blockchain data processing device provided in this application embodiment. The blockchain data processing device 800 can be applied to the business nodes in the aforementioned embodiments. The blockchain data processing device 800 can be a computer program (including program code) running on a computer device; for example, the blockchain data processing device 800 is an application software. The blockchain data processing device 800 can be used to execute corresponding steps in the blockchain data processing method provided in this application embodiment.
[0254] The blockchain data processing device 800 is applied to a target business node among n business nodes in the blockchain. Each business node stores encrypted data generated based on its own key into a consensus node. The n business nodes include the target business node and reference business nodes other than the target business node. The target business node generates target encrypted data, and n is a positive integer greater than 1. The blockchain data processing device 800 includes:
[0255] Acquisition unit 801 is used to acquire encrypted data from n business nodes stored in the consensus node;
[0256] The processing unit 802 is used to perform data encryption processing on the first primary key information of the encrypted data of the reference business node, and generate business update data corresponding to the encrypted data of the reference business node.
[0257] The sending unit 803 is used to send the service update data corresponding to the encrypted data of the reference service node to the consensus node, so that the consensus node can determine the service intersection data based on the service update data corresponding to the encrypted data of the reference service node and the service update data of other service nodes.
[0258] The processing unit 802 is also used to obtain business intersection data from the consensus node and determine the plaintext data to be supplemented based on the business intersection data.
[0259] In one possible implementation, before the processing unit 802 performs data encryption processing on the first primary key information of the encrypted data of the reference service node and generates the business update data corresponding to the encrypted data of the reference service node, it is also used to perform the following operations:
[0260] Send a data authorization request for the smart contract authorization interface to the consensus node. The data authorization request includes node information of at least one reference business node.
[0261] Among them, the data authorization request is used to trigger the consensus node to determine that the reference business node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
[0262] In one possible implementation, the processing unit 802 performs data encryption processing on the first primary key information of the encrypted data of the reference service node to generate business update data corresponding to the encrypted data of the reference service node, which is used to perform the following operations:
[0263] Using the key of the target service node, the first primary key information of the encrypted data of the reference service node is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node; or,
[0264] Using the key of the target business node, the first primary key information of the encrypted data of the reference business node is encrypted to obtain the reference initial business update data;
[0265] Based on the public key and key exchange algorithm of the reference service node, the reference initial service update data is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node.
[0266] In one possible implementation, processing unit 802 determines the plaintext data to be supplemented based on the business intersection data, and performs the following operations:
[0267] The business intersection data is parsed based on the private key of the target business node to obtain the target parsed intersection data, and then the target parsed intersection data is sent to the consensus node.
[0268] Receive reference parsing intersection data sent by consensus nodes. The reference parsing intersection data is obtained by parsing the business intersection data based on the private key of the reference business node.
[0269] The reference parsing intersection data is decrypted using the private key of the target business node to obtain the plaintext data to be supplemented corresponding to the target business node.
[0270] In one possible implementation, the target encrypted data is stored in a data structure with a primary key K and a value V; the processing unit 802 is also used to perform the following operations:
[0271] Map the object address obtained by the target business node to a target curve point on an elliptic curve;
[0272] Obtain the key of the target business node, and encrypt the target curve point based on the key of the target business node to obtain the first primary key information;
[0273] Target encrypted data is generated based on the primary key information and the business data of the target business node.
[0274] It should be understood that in the above process, apart from the target business node (first business node) and the reference business node (second business node), other business nodes did not obtain the plaintext data of the business intersection data. Furthermore, for both the target business node (first business node) and the reference business node (second business node), they only obtained the plaintext data of the business intersection data; for data outside the intersection, neither the first nor the second business node could decrypt it. Therefore, through the embodiments of this application, the process of determining the business intersection data is carried out on the blockchain, ensuring the reliability of the business intersection data; and, not all business nodes can decrypt the business intersection data, thereby ensuring the security of the business intersection data.
[0275] Please see Figure 9 , Figure 9This is a schematic diagram of a computer device provided in an embodiment of this application. The computer device 900 is used to execute the steps performed by the consensus node and service node in the aforementioned method embodiments. The computer device 900 includes: one or more processors 910; one or more input devices 920; one or more output devices 930; and a memory 940. The processors 910, input devices 920, output devices 930, and memory 940 are connected via a bus 950. The memory 940 is used to store a computer program, which includes program instructions. The processor 910 is used to call the program instructions stored in the memory 940 to perform the following operations:
[0276] Obtain business update data for each encrypted data. Among them, the business update data of the target encrypted data in the n sets of encrypted data includes: the data determined by the reference business node after encrypting the first primary key information of the target encrypted data according to the key of each business node. The reference business node is the node with data update authority for the target encrypted data among the n business nodes. The target encrypted data is any one of the n sets of encrypted data.
[0277] Based on the encrypted secondary primary key information of each data set, the business update data of n sets of encrypted data are subjected to data intersection processing to obtain business intersection data;
[0278] The business intersection data is sent to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data.
[0279] In one possible implementation, the target service node corresponds to the target encrypted data; before obtaining the service update data for each group of encrypted data, the processor 910 is also used to perform the following operations:
[0280] Obtain the data authorization request sent by the target business node for the smart contract authorization interface. The target business node is any one of the n business nodes. The data authorization request includes node information of at least one reference business node. The reference business nodes include business nodes other than the target business node among the n business nodes.
[0281] In response to the data authorization request, determine that each reference business node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
[0282] In one possible implementation, the target encrypted data is stored in a data structure with a primary key K and a value V, and the value information of the target encrypted data is generated based on the business data of the target business node.
[0283] Among them, the first primary key information of the target encrypted data is determined by encrypting the curve points mapped on the elliptic curve using the key of the target business node.
[0284] The curve points mapped on the elliptic curve for the target business node are generated based on the object addresses obtained from the target business node.
[0285] In one possible implementation, the n business nodes include a first business node and a second business node; the first business node corresponds to the first encrypted data, and the second business node corresponds to the second encrypted data; the obtained business update data includes the first business update data and the second business update data; the first business update data is obtained by encrypting the first encrypted data, and the second business update data is obtained by encrypting the second encrypted data.
[0286] Specifically, the first business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data using the private key of the second business node; the second business update data is obtained by the first business node encrypting the second initial business update data using the public key and key exchange algorithm of the second business node; and the second initial business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data using the private key of the first business node.
[0287] Alternatively, the first business update data is obtained by the second business node encrypting the first initial business update data based on the public key and key exchange algorithm of the first business node; the first initial business update data is obtained by the second business node encrypting the first primary key information of the first encrypted data based on the private key of the second business node; and the second business update data is obtained by the first business node encrypting the first primary key information of the second encrypted data based on the private key of the first business node.
[0288] In one possible implementation, the processor 910 performs data intersection processing on the business update data of the n sets of encrypted data based on the encrypted second primary key information of each data set, to obtain business intersection data, which is used to perform the following operations:
[0289] Retrieve business update data with the same second primary key information from n sets of encrypted business update data;
[0290] The business update data that have the same secondary primary key information are combined into business intersection data.
[0291] In one possible implementation, the processor 910 is used to call program instructions stored in the memory 940, and also to perform the following operations:
[0292] Retrieve encrypted data from n business nodes stored in the consensus node;
[0293] The first primary key information of the encrypted data of the reference business node is encrypted to generate the business update data corresponding to the encrypted data of the reference business node.
[0294] The business update data corresponding to the encrypted data of the reference business node is sent to the consensus node, so that the consensus node can determine the business intersection data based on the business update data corresponding to the encrypted data of the reference business node and the business update data of other business nodes.
[0295] Obtain business intersection data from consensus nodes, and determine the plaintext data to be supplemented based on the business intersection data.
[0296] In one possible implementation, before the processor 910 performs data encryption processing on the first primary key information of the encrypted data of the reference service node and generates the service update data corresponding to the encrypted data of the reference service node, it is also used to perform the following operations:
[0297] Send a data authorization request for the smart contract authorization interface to the consensus node. The data authorization request includes node information of at least one reference business node.
[0298] Among them, the data authorization request is used to trigger the consensus node to determine that the reference business node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
[0299] In one possible implementation, the processor 910 performs data encryption processing on the first primary key information of the encrypted data of the reference service node to generate service update data corresponding to the encrypted data of the reference service node, which is used to perform the following operations:
[0300] Using the key of the target service node, the first primary key information of the encrypted data of the reference service node is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node; or,
[0301] Using the key of the target business node, the first primary key information of the encrypted data of the reference business node is encrypted to obtain the reference initial business update data;
[0302] Based on the public key and key exchange algorithm of the reference service node, the reference initial service update data is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node.
[0303] In one possible implementation, processor 910 determines the plaintext data to be supplemented based on the business intersection data, for use in performing the following operations:
[0304] The business intersection data is parsed based on the private key of the target business node to obtain the target parsed intersection data, and then the target parsed intersection data is sent to the consensus node.
[0305] Receive reference parsing intersection data sent by consensus nodes. The reference parsing intersection data is obtained by parsing the business intersection data based on the private key of the reference business node.
[0306] The reference parsing intersection data is decrypted using the private key of the target business node to obtain the plaintext data to be supplemented corresponding to the target business node.
[0307] In one possible implementation, the target encrypted data is stored in a data structure with a primary key K and a value V; the processor 910 is also used to perform the following operations:
[0308] Map the object address obtained by the target business node to a target curve point on an elliptic curve;
[0309] Obtain the key of the target business node, and encrypt the target curve point based on the key of the target business node to obtain the first primary key information;
[0310] Target encrypted data is generated based on the primary key information and the business data of the target business node.
[0311] In this embodiment, for business data constructed based on key-value pairs, after encrypting and updating the primary key information, the intersection of the updated business data after the encryption data is updated can be ensured through steps such as finding the intersection of business data of different business nodes. This allows each business node to share the plaintext data that it needs to supplement from the business intersection data. Compared with manually filtering and exchanging data from various datasets, this application can automatically realize the sharing of business data between different business nodes, thereby quickly completing the data exchange function of the same business data.
[0312] Furthermore, it should be noted that this application also provides a computer storage medium storing a computer program, which includes program instructions. When the processor executes these program instructions, it can perform the methods described in the preceding embodiments. Therefore, further details will not be provided here. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, the program instructions can be deployed on a computer device, executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network.
[0313] According to one aspect of this application, a computer program product or computer program is provided, comprising 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 executes the computer instructions, causing the computer device to perform the methods described in the preceding embodiments; therefore, further details will not be provided here.
[0314] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0315] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A blockchain data processing method, characterized in that, This method is applied to consensus nodes in a blockchain. Each consensus node stores n sets of encrypted data generated by n business nodes. Each set of encrypted data is determined by encrypting key-value pairs of business data constructed using the key of a business node. There is a one-to-one correspondence between business nodes and encrypted data, where n is a positive integer greater than 1. The method includes: Obtain business update data for each encrypted data, wherein the business update data for the target encrypted data in the n groups of encrypted data includes: data determined by the reference business nodes after encrypting the first primary key information of the target encrypted data according to their respective keys, wherein the reference business nodes are the nodes among the n business nodes that have data update permissions for the target encrypted data, and the target encrypted data is any one of the n groups of encrypted data; From the business update data of the n sets of encrypted data, obtain business update data with the same second primary key information, and combine the obtained business update data with the same second primary key information into business intersection data; wherein, the second primary key information is determined jointly based on the keys of the n business nodes; The business intersection data is sent to the target business node among the n business nodes, so that the target business node can parse the corresponding plaintext data to be supplemented from the business intersection data.
2. The method as described in claim 1, characterized in that, The target service node corresponds to the target encrypted data; before obtaining the service update data for each group of encrypted data, the process further includes: Obtain a data authorization request sent by a target business node for a smart contract authorization interface. The target business node is any one of the n business nodes. The data authorization request includes node information of at least one reference business node. The reference business node includes business nodes other than the target business node among the n business nodes. In response to the data authorization request, it is determined that each reference service node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
3. The method as described in claim 2, characterized in that, The target encrypted data is stored in a data structure with primary key K and value V, and the value information of the target encrypted data is generated based on the business data of the target business node; The first primary key information of the target encrypted data is determined by encrypting the curve points mapped by the target business node on the elliptic curve using the key of the target business node. The curve points mapped on the elliptic curve by the target business node are generated based on the object address obtained by the target business node.
4. The method as described in any one of claims 2 or 3, characterized in that, The n service nodes include a first service node and a second service node; the first service node corresponds to the first encrypted data, and the second service node corresponds to the second encrypted data; the obtained service update data includes the first service update data and the second service update data; the first service update data is obtained by encrypting the first encrypted data, and the second service update data is obtained by encrypting the second encrypted data. Wherein, the first service update data is obtained by the second service node encrypting the first primary key information of the first encrypted data based on the private key of the second service node; the second service update data is obtained by the first service node encrypting the second initial service update data based on the public key and key exchange algorithm of the second service node, and the second initial service update data is obtained by the first service node encrypting the first primary key information of the second encrypted data based on the private key of the first service node; Alternatively, the first service update data is obtained by the second service node encrypting the first initial service update data based on the public key and key exchange algorithm of the first service node; the first initial service update data is obtained by the second service node encrypting the first primary key information of the first encrypted data based on the private key of the second service node; and the second service update data is obtained by the first service node encrypting the first primary key information of the second encrypted data based on the private key of the first service node.
5. A blockchain data processing method, characterized in that, The method is applied to a target business node among n business nodes in a blockchain. Each business node stores encrypted data generated based on its own key into a consensus node. The n business nodes include the target business node and reference business nodes other than the target business node. The target business node generates target encrypted data, and n is a positive integer greater than 1. The method includes: Obtain the encrypted data of n business nodes stored in the consensus node; Using the key of the target business node, the first primary key information of the encrypted data of the reference business node is encrypted to generate business update data corresponding to the encrypted data of the reference business node. The service update data corresponding to the encrypted data of the reference service node is sent to the consensus node, so that the consensus node can obtain the service update data with the same second primary key information from the service update data of the n sets of encrypted data corresponding to the n service nodes, and determine the obtained service update data with the same second primary key information as the service intersection data. Obtain the business intersection data from the consensus node, and determine the plaintext data to be supplemented based on the business intersection data.
6. The method as described in claim 5, characterized in that, Before using the key of the target service node to encrypt the first primary key information of the encrypted data of the reference service node, and generating the service update data corresponding to the encrypted data of the reference service node, the method further includes: Send a data authorization request for the smart contract authorization interface to the consensus node, the data authorization request including node information of at least one reference business node; The data authorization request is used to trigger the consensus node to determine that the reference service node indicated by the node information in the data authorization request has the authority to update the target encrypted data.
7. The method as described in claim 6, characterized in that, The step of using the key of the target service node to encrypt the first primary key information of the encrypted data of the reference service node, and generating the service update data corresponding to the encrypted data of the reference service node, includes: Using the key of the target service node, the first primary key information of the encrypted data of the reference service node is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node; or, Using the key of the target business node, the first primary key information of the encrypted data of the reference business node is encrypted to obtain the reference initial business update data; Based on the public key and key exchange algorithm of the reference service node, the reference initial service update data is encrypted to obtain the service update data corresponding to the encrypted data of the reference service node.
8. The method as described in claim 7, characterized in that, The step of determining the plaintext data to be supplemented based on the business intersection data includes: Based on the private key of the target service node, the service intersection data is parsed to obtain the target parsed intersection data, and the target parsed intersection data is sent to the consensus node; The system receives reference parsing intersection data sent by the consensus node. The reference parsing intersection data is obtained by parsing the service intersection data based on the private key of the reference service node. The reference parsing intersection data is decrypted using the private key of the target service node to obtain the plaintext data to be supplemented corresponding to the target service node.
9. The method as described in claim 5, characterized in that, The target encrypted data is stored in a data structure with primary key K and value V; the method further includes: The object address obtained by the target business node is mapped to a target curve point on an elliptic curve; Obtain the key of the target service node, and encrypt the target curve point based on the key of the target service node to obtain the first primary key information; Target encrypted data is generated based on the first primary key information and the business data of the target business node.
10. A blockchain data processing device, characterized in that, The device is applied to a consensus node, which stores n sets of encrypted data generated by n service nodes. Each set of encrypted data is determined by encrypting service data constructed based on key-value pairs using the service node's key. There is a one-to-one correspondence between the service nodes and the encrypted data, where n is a positive integer greater than 1. The device includes: The acquisition unit is used to acquire business update data for each encrypted data. The business update data of the target encrypted data in the n groups of encrypted data includes: data determined by the reference business node after encrypting the first primary key information of the target encrypted data according to the key of each business node. The reference business node is the node among the n business nodes that has the data update permission for the target encrypted data. The target encrypted data is any one of the n groups of encrypted data. The processing unit is configured to obtain business update data with the same second primary key information from the business update data of the n sets of encrypted data, and combine the obtained business update data with the same second primary key information into business intersection data; wherein, the second primary key information is determined jointly based on the keys of the n business nodes; The sending unit is used to send the service intersection data to the target service node among the n service nodes, so that the target service node can parse the corresponding plaintext data to be supplemented from the service intersection data.
11. A blockchain data processing device, characterized in that, The device is applied to a target service node among n service nodes. Each service node stores encrypted data generated based on its own key into a consensus node. The n service nodes include the target service node and reference service nodes other than the target service node. The target service node generates target encrypted data, and n is a positive integer greater than 1. The device includes: The acquisition unit is used to acquire the encrypted data of n business nodes stored in the consensus node; The processing unit is used to perform data encryption processing on the first primary key information of the encrypted data of the reference business node using the key of the target business node, and generate business update data corresponding to the encrypted data of the reference business node. The sending unit is used to send the service update data corresponding to the encrypted data of the reference service node to the consensus node, so that the consensus node can obtain the service update data with the same second primary key information from the service update data of the n sets of encrypted data corresponding to the n service nodes, and determine the obtained service update data with the same second primary key information as the service intersection data. The processing unit is further configured to obtain the business intersection data from the consensus node and determine the plaintext data to be supplemented based on the business intersection data.
12. A computer device, characterized in that, include: Memory and processor; A memory, wherein one or more computer programs are stored; A processor for loading one or more computer programs to implement the blockchain data processing method as described in any one of claims 1-4 or 5-9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-4 or 5-9.
14. A computer program product, characterized in that, The computer program product includes a computer program adapted to be loaded by a processor and execute the blockchain data processing method as described in any one of claims 1-4 or 5-9.