Information processing method and device based on block chain, electronic equipment and readable medium
By using private keys and communication keys to encrypt and decrypt pending information on blockchain nodes and saving them in blockchain nodes in this region, the complexity of task processing on and off-chain tasks in blockchain networks is solved, reducing the number of tasks that are not processed on and off-chain in blockchain networks, and Development and maintenance costs are achieved and confidential communication is achieved.
Patent Information
- Application Number
- CN202310854117.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-14
AI Technical Summary
In the prior art, the on-chain and off-chain tasks in blockchain networks require the use of different systems respectively, resulting in increased system architecture complexity and communication link complexity, and high development and maintenance difficulty and cost.
By using the private key and communication key to encrypt and decrypt the operation on the blockchain node, the pending information is saved in the local independent local blockchain nodes, and confidential communication is used to achieve on-chain and The off-chain tasks are processed in the same system.
It reduces the complexity of the system architecture and communication links, reduces the difficulty and cost of development and maintenance, and realizes confidential communication between specific nodes.
Smart Images

Figure CN119316155A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a blockchain-based information processing method, device, electronic device and readable medium. Background Art
[0002] With the application of blockchain technology, the two communicating parties can build a blockchain network to transmit and share data through the blockchain. Due to the public nature of the blockchain data itself, not all communication information between the two communicating parties is suitable for public disclosure on the blockchain. Therefore, data that is not suitable for public disclosure needs to be processed separately.
[0003] In related technologies, the two communicating parties usually build two systems, one for off-chain collaboration through a dedicated line, and one for on-chain interaction, so as to transmit and analyze data between the two parties. In the dedicated line system, the two communicating parties are connected through a dedicated network, while in the on-chain system, data sharing and interaction are carried out through the blockchain.
[0004] However, using different systems to handle on-chain and off-chain tasks increases the complexity of the system architecture and the complexity of the communication links between the two parties, which increases the difficulty and cost of development and maintenance. Summary of the invention
[0005] Based on the above technical problems, the present application provides a blockchain-based information processing method, device, electronic device and readable medium to reduce the difficulty and cost of development and maintenance.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, a blockchain-based information processing method is provided, which is applied to a first node in a blockchain, and the method includes:
[0008] Obtaining a pending transaction set, where the pending transaction set includes transaction information sent by a second node in the blockchain to the first node;
[0009] Acquire target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes a first communication key encrypted by the public key of the first node and information to be processed encrypted by the first communication key;
[0010] Decrypting the target transaction information by using the private key of the first node and the first communication key to obtain the information to be processed;
[0011] The information to be processed is saved locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0012] According to one aspect of an embodiment of the present application, there is provided a blockchain-based information processing device, which is applied to a first node in a blockchain, and the device includes:
[0013] a set acquisition unit, configured to acquire a pending transaction set, wherein the pending transaction set includes transaction information sent by the second node in the blockchain to the first node;
[0014] an information acquisition unit, configured to acquire target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes the first communication key encrypted by the public key of the first node and the to-be-processed information encrypted by the first communication key;
[0015] a decryption unit, configured to decrypt the target transaction information by using the private key of the first node and the first communication key to obtain the information to be processed;
[0016] A storage unit is configured to store the to-be-processed information locally through a local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0017] In some embodiments of the present application, based on the above technical solution, the decryption unit is specifically configured as follows: decrypting the encrypted first communication key based on the private key of the first node through the local blockchain node to obtain the information key; decrypting the encrypted information to be processed based on the first communication key through the local blockchain node to obtain the information to be processed.
[0018] In some embodiments of the present application, based on the above technical solution, the target transaction information also includes signature information signed by the private key of the second node; the decryption unit is further configured to: decrypt the signature information by the public key of the second node to obtain a signature summary, wherein the information summary is obtained by the second node extracting the encrypted first communication key and the encrypted information to be processed according to the summary strategy of the blockchain; extracting the encrypted first communication key and the encrypted information to be processed according to the summary strategy of the blockchain to obtain an information summary; if the signature summary matches the information summary, the target transaction information is decrypted.
[0019] In some embodiments of the present application, based on the above technical solution, the storage unit is specifically configured as follows: constructing a local block of the blockchain according to the information to be processed through a local blockchain node; calling the first node through the local blockchain node to execute a transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed in the ledger information of the local blockchain node.
[0020] In some embodiments of the present application, based on the above technical solution, the information acquisition unit is specifically configured to: traverse the transaction information of the transaction set to be processed and parse each transaction information; if the transaction information contains the encrypted first communication key and the encrypted information to be processed, determine that the transaction information is the target transaction information.
[0021] In some embodiments of the present application, based on the above technical solution, the information acquisition unit is further configured to: add the target transaction information to a local transaction set, where the local transaction set includes transaction information sent by each node in the blockchain to the first node;
[0022] The target transaction information in the local transaction set is read through the local blockchain node.
[0023] In some embodiments of the present application, based on the above technical solution, the information acquisition unit is further configured to: if decryption of the target transaction information fails using the private key of the first node and the first communication key, delete the target transaction information from the local transaction set.
[0024] In some embodiments of the present application, based on the above technical solution, the set of pending transactions also includes blockchain transactions from other nodes in the blockchain; the set acquisition unit is also configured to: obtain each blockchain transaction in the set of pending transactions; construct a transaction block of the blockchain according to each blockchain transaction, and the transaction block includes each blockchain transaction; broadcast the transaction block to other nodes in the blockchain to reach a consensus between the nodes of the blockchain; based on the consensus result of the nodes in the blockchain, call the first node to execute the blockchain transaction in the transaction block, and save the execution result to the account information of the first node.
[0025] In some embodiments of the present application, based on the above technical solution, the information acquisition unit is also configured to: obtain information to be transmitted, the message to be transmitted is transaction information provided by the first node to the second node; generate a second communication key for the information to be transmitted; encrypt the second communication key by the public key of the second node to obtain an encrypted second communication key, and encrypt the information to be transmitted by the second communication key to obtain the encrypted information to be transmitted; package the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted; broadcast the transaction to be transmitted to each node of the blockchain through the blockchain to transmit the transaction to be transmitted to the set of pending transactions of the second node, and decrypt the transaction to be transmitted and save the information to be transmitted through the local blockchain node of the second node.
[0026] In some embodiments of the present application, based on the above technical solution, the information acquisition unit is also configured to: extract the summary of the encrypted second communication key and the encrypted information to be transmitted according to the summary strategy of the blockchain to obtain a signature summary; sign the signature summary with the private key of the first node to obtain a transaction signature; and package the encrypted second communication key, the encrypted information to be transmitted and the transaction signature into a transaction to be transmitted.
[0027] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the blockchain-based method in the above technical solution by executing the executable instructions.
[0028] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the blockchain-based information processing method in the above technical solution is implemented.
[0029] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the information processing method based on blockchain provided in the above-mentioned various optional implementations.
[0030] In an embodiment of the present application, the first node of the blockchain obtains a set of pending transactions, and obtains the target transaction information encrypted by the public key and the first communication key of the first node from the transaction information transaction provided by the second node to the first node in the pending transaction set, decrypts the target transaction information by the private key and the first communication key of the first node to obtain the pending information, and then saves the decrypted pending information locally through a local blockchain node that does not communicate with other nodes. The target transaction information provided to the first node is encrypted by the public key of the first node, thereby ensuring that only the first node holding the private key can decrypt and obtain the pending information, and then saves the pending information locally through an independent local blockchain node, and uses the communication link of the blockchain to perform confidential communication between specific nodes, so that the same system can be used to process the original on-chain and off-chain tasks, reducing the complexity of the system architecture and communication links, thereby reducing the difficulty and cost of development and maintenance.
[0031] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] In the attached picture:
[0034] Figure 1 The system architecture of the information processing solution based on blockchain according to the embodiment of the present application.
[0035] Figure 2 This is a schematic diagram of a blockchain network in an embodiment of the present application.
[0036] Figure 3 This is a schematic diagram of blocks in a blockchain network in an embodiment of the present application.
[0037] Figure 4 The present invention is a flowchart of a blockchain-based information processing method according to an embodiment of the present application.
[0038] Figure 5 The present invention is a flowchart of a blockchain-based information processing method according to an embodiment of the present application.
[0039] Figure 6 The present invention is a flowchart of a blockchain-based information processing method according to an embodiment of the present application.
[0040] Figure 7 The present invention is a flowchart of a blockchain-based information processing method according to an embodiment of the present application.
[0041] Figure 8 This is a schematic diagram of the structure of the blockchain system in the embodiment of the present application.
[0042] Fig. 9 It is a schematic flowchart of the transaction processing process in the embodiment of the present application.
[0043] Fig.10 It is a schematic flowchart of the specific process of transaction processing in the embodiment of the present application.
[0044] Fig.11 The block diagram schematically shows the composition of the information processing device based on blockchain in an embodiment of the present application.
[0045] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0046] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0047] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0048] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0049] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0050] It should be understood that this solution can be applied to bilateral communication based on blockchain, and is specifically applied in communication scenarios for business collaboration between two institutions. In such scenarios, the two communicating parties are usually two different institutions, and the two institutions will send various business information to each other to collaborate on business. In such scenarios, the systems of the two communicating parties usually build a blockchain network, and the two communicating parties each join the network as a node and communicate through the network. The information communicated by the two parties usually contains information that can be made public and information that is not suitable for public disclosure. Information about cooperation intentions, business introductions, negotiation progress, and the final results of cooperation will be made public. Communication of such information can be communicated on the chain through blockchain transactions. For information that is not suitable for public disclosure, such as cost accounting, bargaining process, process negotiation, and signing of additional agreements, it is necessary to keep the information confidential or encrypt it during the communication process. Due to the natural openness of blockchain data, such information is not suitable for being on the blockchain. In the solution of this application, by partially transforming the blockchain nodes, the existing blockchain network is used to carry out confidential communication between nodes. The content of the communication will not be made public in the blockchain, so that the original off-chain system collaboration process can be carried out in the on-chain system.
[0051] With the application of blockchain technology, the two communicating parties can build a blockchain network to transmit and share data through the blockchain. Due to the public nature of the blockchain data itself, not all communication information between the two communicating parties is suitable for disclosure on the blockchain. Therefore, data that is not suitable for disclosure needs to be processed separately. In related technologies, the two communicating parties usually build two systems, one for off-chain collaboration through a dedicated line, and one for on-chain interaction, so as to transmit and analyze data between the two parties. In the dedicated line system, the two communicating parties are connected through a dedicated network, while in the on-chain system, data sharing and interaction are carried out through the blockchain. However, using different systems to handle on-chain and off-chain tasks increases the complexity of the system architecture and the complexity of the communication link between the two communicating parties, thereby increasing the difficulty and cost of development and maintenance.
[0052] Based on this, the technical solution of the embodiment of the present application proposes an information processing solution based on blockchain. Specifically, Figure 1As shown, the system architecture 100 applied to the information processing scheme based on blockchain according to the embodiment of the present application may include a terminal device 110, a network 120 and a server 130. The terminal device 110 may include a smart phone, a tablet computer, a laptop computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc. The server 130 may be a server that provides various services, which may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms. The network 120 may be a communication medium of various connection types that can provide a communication link between the terminal device 110 and the server 130, such as a wired communication link or a wireless communication link.
[0053] According to the implementation needs, the system architecture in the embodiment of the present application can have any number of terminal devices, networks and servers. For example, the server 130 can be a server group composed of multiple server devices. In addition, the technical solution provided in the embodiment of the present application can be applied to the terminal device 110, can also be applied to the server 130, or can be implemented by the terminal device 110 and the server 130 together, and the present application does not make special restrictions on this. In the embodiment of the present application, a blockchain network can be constructed between the server 130 and the terminal device 110, and the server 130 and the terminal device 110 are both added to the blockchain network as nodes of the blockchain network.
[0054] In one embodiment of the present application, the server 130 is referred to as the first node in the blockchain network, and obtains a set of pending transactions, which includes transaction information sent by the second node in the blockchain to the first node. The second node can be the terminal device 110 or another server in the server 130. The server 130 obtains the target transaction information from the transaction information of the pending transaction set, and the target transaction information includes the first communication key encrypted by the public key of the first node and the pending information encrypted by the first communication key. Subsequently, the server 130 decrypts the target transaction information by the private key of the first node and the first communication key to obtain the pending information. An independent local blockchain node is also run in the server 130, and the local blockchain node does not communicate with other nodes in the blockchain. The server 130 saves the pending information locally through the local blockchain node, thereby completing the processing of the pending information.
[0055] Specifically, the first node and the second node can be any two blockchain nodes in the blockchain network. The pending transaction set is the blockchain transaction pool of the first node. The transaction pool will store the transaction information broadcast by other nodes. The target transaction information is the confidential information sent by the second node to the first node. The local blockchain node is a blockchain node running locally on the first node. Blockchain is a peer-to-peer distributed ledger consisting of multiple nodes. Each node contains all transaction records, and all nodes need to verify each transaction. Each node in the blockchain network can be a full node or a local blockchain node. A full node can be connected to other nodes, while a local blockchain node refers to an independent node running in the blockchain and is not connected to other nodes. The local blockchain node does not participate in the consensus mechanism of the blockchain network like a full node, but it can independently verify transactions and create new blocks. The confidential information sent by the second node to the first node can only be decrypted by the first node to obtain the content, thereby realizing confidential communication between the two nodes.
[0056] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks (i.e. blocks) generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain is maintained by the nodes in the blockchain network. For example, in Figure 2 The blockchain network shown may include multiple nodes 201, and the multiple nodes 201 may be the various clients forming the blockchain network. Each node 201 may receive input information during normal operation, and maintain the shared data in the blockchain network based on the received input information. In order to ensure the information intercommunication within the blockchain network, there may be an information connection between each node in the blockchain network, and information may be transmitted between nodes through the above information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network obtain the input information according to the consensus algorithm, and store the input information as shared data, so that the data stored on all nodes in the blockchain network are consistent.
[0057] Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. A node identifier list can be maintained in each node, and the node name and node identifier are stored in the node identifier list accordingly. The node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to identify the node.
[0058] Each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 3 As shown, the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version numbers, timestamps, and difficulty values, and the block body stores input information. The next block of the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores input information feature values of the current block, feature values of the block header of the parent block, version numbers, timestamps, and difficulty values, and so on. This ensures that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, thereby ensuring the security of the input information in the block.
[0059] The confidential information received or sent by the server 130 may be located at Figure 3 in the block body shown.
[0060] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0061] Figure 4 A flowchart of a blockchain-based information processing method according to an embodiment of the present application is shown. The virtual resource data processing method is applied to the first node in the blockchain and can be specifically executed by a device with a computing and processing function, such as a server or terminal device where the first node is located. Figure 4 As shown, the blockchain-based information processing method includes at least steps S410 to S440, which are described in detail as follows:
[0062] Step S410: obtaining a pending transaction set, wherein the pending transaction set includes transaction information sent by the second node in the blockchain to the first node.
[0063] The pending transaction set can specifically be the blockchain transaction pool of the first node. After the messages broadcast by other nodes in the blockchain arrive at the first node, they are first placed in the blockchain transaction pool for processing, that is, they will be added to the pending transaction set. The pending transaction set contains transaction information sent by the second node in the blockchain to the first node. It can be understood that the transaction information sent by the second node to the first node can be roughly divided into two categories, which can be called blockchain transactions and confidential transactions. Blockchain transactions are messages used in the blockchain to reach consensus on transaction information and upload them to the chain. The content of blockchain transactions is disclosed in the blockchain after being uploaded to the chain. Confidential transactions are private information sent by the second node to the first node. Only two nodes can know the messages. Therefore, after the first node processes these messages, they will not be disclosed to other nodes in the blockchain.
[0064] Step S420: acquiring target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes a first communication key encrypted by the public key of the first node and information to be processed encrypted by the first communication key.
[0065] The first node obtains the target transaction information from the transaction information of the pending transaction set. The target transaction information is the private information sent by the second node to the first node. The target transaction information contains the first communication key encrypted by the public key of the first node and the pending information encrypted by the first communication key. Since the first communication key is encrypted by the public key of the first node, only the first node holding the corresponding private key can decrypt the message and obtain the pending information contained in the target transaction information.
[0066] Step S430: decrypt the target transaction information using the private key of the first node and the first communication key to obtain the information to be processed.
[0067] The first node decrypts the target transaction information through the private key of the first node and the first communication key to obtain the information to be processed. The first communication key is the key generated by the second node when sending the target transaction information. The key can be a symmetric encryption key, and the first node can obtain the first communication key through private key decryption, and then decrypt the information to be processed through the first communication key. In some embodiments, depending on the different encryption methods, the decryption method and order can also be different. For example, the encrypted first communication key itself is encapsulated in a data envelope, and the integrity verification and the sender's verification process need to be performed simultaneously during the decryption process. In other embodiments, although the encrypted first communication key is encrypted, there is a specific mapping relationship between the encrypted first communication key and the original key. Based on the mapping relationship, it is not necessary to use the private key of the first node for decryption, but to directly decrypt the encrypted information to be processed together with the private key of the first node and the encrypted first communication key, and directly obtain the decrypted information to be processed.
[0068] Step S440: The information to be processed is saved locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0069] After receiving the pending message, the first node can save the pending information locally through the local blockchain node. The local blockchain node is a single node in the blockchain. This type of node does not communicate with other nodes in the blockchain, nor does it participate in the consensus process in the blockchain. However, the local blockchain node has the ability to independently verify transactions and create new blocks. The local blockchain node can upload the pending information to the local node in the form of a new block, thereby saving it in its exclusive database. The local blockchain node will not receive broadcasts or point-to-point communications from other blockchain nodes, nor will it directly access the blockchain transaction pool of the first node. Accordingly, the data of the local blockchain node is also stored independently of the data of the first node, for example, in different databases.
[0070] In an embodiment of the present application, the first node of the blockchain obtains a set of pending transactions, and obtains the target transaction information encrypted by the public key and the first communication key of the first node from the transaction information transaction provided by the second node to the first node in the pending transaction set, decrypts the target transaction information by the private key and the first communication key of the first node to obtain the pending information, and then saves the decrypted pending information locally through a local blockchain node that does not communicate with other nodes. The target transaction information provided to the first node is encrypted by the public key of the first node, thereby ensuring that only the first node holding the private key can decrypt and obtain the pending information, and then saves the pending information locally through an independent local blockchain node, and uses the communication link of the blockchain to perform confidential communication between specific nodes, so that the same system can be used to process the original on-chain and off-chain tasks, reducing the complexity of the system architecture and communication links, thereby reducing the difficulty and cost of development and maintenance.
[0071] In some optional embodiments, in the process of saving the information to be processed locally through the local blockchain node of the first node, the first node constructs a local block of the blockchain according to the information to be processed through the local blockchain node, and then calls the first node through the local blockchain node to execute the transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed to the account book information of the local blockchain node. The operation of constructing the local block is performed by the local blockchain node, and the first node can trigger the local blockchain node to construct the local block by means of instructions or timers. The structure of the local block is usually the same as the structure of the on-chain block of the blockchain. After the constructed block is verified by the local blockchain, the first node is called to execute the transaction in the local block to directly save the information to be processed to the account book information of the local blockchain node, which is equivalent to the local block being chained in the local blockchain node. The local blockchain node will call the virtual machine of the first node to execute the blockchain transaction. The virtual machine is a simulated transaction system or module used by the first node to execute blockchain transactions, which runs as part of the first node itself. The result of the virtual machine operation will be returned to the local blockchain node, and then packaged and chained by the local blockchain node. By calling the first node to execute the blockchain transaction, it is necessary to set up the execution logic separately in the local blockchain node, thereby further simplifying the blockchain node structure and reducing maintenance costs.
[0072] In some optional embodiments, the transaction set to be processed also includes blockchain transactions from other nodes in the blockchain. After obtaining the transaction set to be processed, the first node also obtains each blockchain transaction in the transaction set to be processed, and then constructs a transaction block of the blockchain according to each blockchain transaction. The transaction block contains each blockchain transaction, and broadcasts the transaction block to other nodes in the blockchain to reach a consensus between the nodes of the blockchain. Finally, the first node calls the first node to execute the blockchain transaction in the transaction block according to the consensus result of the nodes in the blockchain, and saves the execution result to the account information of the first node. For blockchain transactions that do not contain private information, the first node packages and broadcasts the transaction for consensus between nodes, and saves it on the chain after the consensus is successful, so that the first node has the ability to upload public information to the blockchain and save private information locally, and can realize private communication on the blockchain chain while reducing the existing blockchain structure, which is conducive to reducing the implementation cost of the solution.
[0073] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 5 As shown, in an information processing method based on blockchain in one embodiment of the present application, the following steps may be included:
[0074] Step S510: Obtain a set of pending transactions, where the set of pending transactions includes transaction information sent from the second node in the blockchain to the first node.
[0075] Optionally, the implementation details of step S510 are the same as Figure 4 The step S410 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0076] Step S520: acquiring target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes a first communication key encrypted by the public key of the first node and information to be processed encrypted by the first communication key.
[0077] Optionally, the implementation details of step S520 are the same as Figure 4 The step S420 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0078] Step S530: decrypt the encrypted first communication key based on the private key of the first node through the local blockchain node to obtain the information key.
[0079] Step S540: decrypt the encrypted information to be processed based on the first communication key through the local blockchain node to obtain the information to be processed.
[0080] In some optional embodiments, the decryption process is performed by the first node through the local blockchain node, for example, by calling the local blockchain node or triggering the execution of the local blockchain node through specific instructions. Specifically, the local blockchain node first decrypts the encrypted first communication key based on the private key of the first node to obtain the information key. The information key itself is a data encryption key, which is a symmetric key used to encrypt and decrypt actual data. The public key of the first node is a key encryption key, which encrypts and protects the information key. In the process of encrypted communication, the public key of the first node is used to encrypt the information key, and then the information to be processed is encrypted using the information key. The encryption process is reverse, and the information key is obtained by decrypting the private key of the first node, and then the information to be processed is decrypted by the information key. The information key can be temporarily generated or modified during this secret communication, while the public and private keys of the first node can remain unchanged. Once the information key is leaked, only the information key needs to be changed without changing the public and private keys of the first node, which is conducive to reducing the number of times the key is renegotiated during the communication process.
[0081] Step S550: The information to be processed is saved locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0082] Optionally, the implementation details of step S550 are the same as Figure 4 The step S440 shown in FIG. 1 is consistent with the step S440 shown in FIG. 1 and will not be
[0083] In an embodiment of the present application, the first node of the blockchain obtains a set of pending transactions, and obtains the target transaction information encrypted by the public key and the first communication key of the first node from the transaction information transaction provided by the second node to the first node in the pending transaction set, decrypts the target transaction information by the private key and the first communication key of the first node to obtain the pending information, and then saves the decrypted pending information locally through a local blockchain node that does not communicate with other nodes. The target transaction information provided to the first node is encrypted by the public key of the first node, thereby ensuring that only the first node holding the private key can decrypt and obtain the pending information, and then saves the pending information locally through an independent local blockchain node, and uses the communication link of the blockchain to perform confidential communication between specific nodes, so that the same system can be used to process the original on-chain and off-chain tasks, reducing the complexity of the system architecture and communication links, thereby reducing the difficulty and cost of development and maintenance.
[0084] In some optional embodiments, the target transaction information also includes signature information obtained by signing with the private key of the second node. Before decrypting the target transaction information with the private key of the first node and the first communication key to obtain the information to be processed, the first node also decrypts the signature information with the public key of the second node to obtain a signature summary, and the information summary is obtained by the second node extracting the encrypted first communication key and the encrypted information to be processed according to the summary strategy of the blockchain, and then extracting the encrypted first communication key and the encrypted information to be processed according to the summary strategy of the blockchain to obtain the information summary. The first node matches the obtained signature summary with the information summary. If the two match, it means that the content in the target transaction information has not been tampered with, and the target transaction information is continued to be decrypted. Otherwise, it means that the content in the target transaction information does not match the original content sent by the second node, and the target transaction information and further alarm notification operations can be selected. The accuracy of the information in the target transaction information is ensured by signature verification, and the data in the blockchain is polluted by erroneous data, which is beneficial to the information security of the scheme.
[0085] In some optional embodiments, in the process of saving the information to be processed locally through the local blockchain node of the first node, the first node constructs a local block of the blockchain according to the information to be processed through the local blockchain node, and then calls the first node through the local blockchain node to execute the transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed to the account book information of the local blockchain node. The operation of constructing the local block is performed by the local blockchain node, and the first node can trigger the local blockchain node to construct the local block by means of instructions or timers. The structure of the local block is usually the same as the structure of the on-chain block of the blockchain. After the constructed block is verified by the local blockchain, the first node is called to execute the transaction in the local block to directly save the information to be processed to the account book information of the local blockchain node, which is equivalent to the local block being chained in the local blockchain node. The local blockchain node will call the virtual machine of the first node to execute the blockchain transaction. The virtual machine is a simulated transaction system or module used by the first node to execute blockchain transactions, which runs as part of the first node itself. The result of the virtual machine operation will be returned to the local blockchain node, and then packaged and chained by the local blockchain node. By calling the first node to execute the blockchain transaction, it is necessary to set up the execution logic separately in the local blockchain node, thereby further simplifying the blockchain node structure and reducing maintenance costs.
[0086] In some optional embodiments, the transaction set to be processed also includes blockchain transactions from other nodes in the blockchain. After obtaining the transaction set to be processed, the first node also obtains each blockchain transaction in the transaction set to be processed, and then constructs a transaction block of the blockchain according to each blockchain transaction. The transaction block contains each blockchain transaction, and broadcasts the transaction block to other nodes in the blockchain to reach a consensus between the nodes of the blockchain. Finally, the first node calls the first node to execute the blockchain transaction in the transaction block according to the consensus result of the nodes in the blockchain, and saves the execution result to the account information of the first node. For blockchain transactions that do not contain private information, the first node packages and broadcasts the transaction for consensus between nodes, and saves it on the chain after the consensus is successful, so that the first node has the ability to upload public information to the blockchain and save private information locally, and can realize private communication on the blockchain chain while reducing the existing blockchain structure, which is conducive to reducing the implementation cost of the solution.
[0087] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 6 As shown, in an information processing method based on blockchain in one embodiment of the present application, the following steps may be included:
[0088] Step S610: Obtain a set of pending transactions, where the set of pending transactions includes transaction information sent from the second node in the blockchain to the first node.
[0089] Optionally, the implementation details of step S610 are the same as Figure 4 The step S410 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0090] Step S620, traversing the transaction information of the transaction set to be processed and parsing each transaction information;
[0091] Step S630: If the transaction information includes the encrypted first communication key and the encrypted information to be processed, the transaction information is determined to be the target transaction information.
[0092] In some optional embodiments, the first node or the blockchain transaction pool of the first node determines whether the transaction information is the target transaction information by the information contained in the transaction information in the pending transaction set. Specifically, in non-private communication, the transaction information usually does not contain the communication key used to encrypt the pending information. Therefore, the structure of the target transaction information used for private communication is different from the information contained in the transaction information used for blockchain transactions. The first node can traverse the transaction information in the pending transaction set and parse each transaction information. If it is found that the transaction information contains the encrypted first communication key and the encrypted pending information, it means that the transaction information is the target transaction information. The target transaction information is determined by the content of the transaction information, and no additional identification information is required, which is conducive to reducing the amount of communication data. In some embodiments, other methods can also be used to identify the target transaction information. For example, by adding a specific identification in the transaction information, such as a specific naming rule or a specific attribute field, the first node verifies the identification to confirm whether the transaction information is the transaction information, thereby simplifying the calculation amount of verification and improving the recognition efficiency of the target transaction information.
[0093] Step S640: decrypt the target transaction information using the private key of the first node and the first communication key to obtain the information to be processed.
[0094] Optionally, the implementation details of step S640 are the same as Figure 4 The step S430 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0095] Step S650: The information to be processed is saved locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0096] Optionally, the implementation details of step S650 are the same as Figure 4 The step S440 shown in FIG. 1 is consistent with the step S440 shown in FIG. 1 and will not be
[0097] In an embodiment of the present application, the first node of the blockchain obtains a set of pending transactions, and obtains the target transaction information encrypted by the public key and the first communication key of the first node from the transaction information transaction provided by the second node to the first node in the pending transaction set, and decrypts the target transaction information by the private key and the first communication key of the first node to obtain the pending information, and then saves the decrypted pending information locally through the local blockchain node that does not communicate with other nodes. The target transaction information provided to the first node is encrypted by the public key of the first node, so as to ensure that only the first node holding the private key can decrypt the pending information, and then save the pending information locally through an independent local blockchain node, and use the communication link of the blockchain to carry out confidential communication between specific nodes, so that the same system can be used to process the original tasks on and off the chain, reducing the complexity of the system architecture and communication links, thereby reducing the difficulty and cost of development and maintenance. Through the information exchange between the two transaction pools, the sources of data on and off the chain are consistent, and there is no need to maintain data consistency between systems, which is conducive to reducing the probability of data errors and improving the stability of system operation.
[0098] In some optional embodiments, in the process of saving the information to be processed locally through the local blockchain node of the first node, the first node constructs a local block of the blockchain according to the information to be processed through the local blockchain node, and then calls the first node through the local blockchain node to execute the transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed to the account book information of the local blockchain node. The operation of constructing the local block is performed by the local blockchain node, and the first node can trigger the local blockchain node to construct the local block by means of instructions or timers. The structure of the local block is usually the same as the structure of the on-chain block of the blockchain. After the constructed block is verified by the local blockchain, the first node is called to execute the transaction in the local block to directly save the information to be processed to the account book information of the local blockchain node, which is equivalent to the local block being chained in the local blockchain node. The local blockchain node will call the virtual machine of the first node to execute the blockchain transaction. The virtual machine is a simulated transaction system or module used by the first node to execute blockchain transactions, which runs as part of the first node itself. The result of the virtual machine operation will be returned to the local blockchain node, and then packaged and chained by the local blockchain node. By calling the first node to execute the blockchain transaction, it is necessary to set up the execution logic separately in the local blockchain node, thereby further simplifying the blockchain node structure and reducing maintenance costs.
[0099] In some optional embodiments, the transaction set to be processed also includes blockchain transactions from other nodes in the blockchain. After obtaining the transaction set to be processed, the first node also obtains each blockchain transaction in the transaction set to be processed, and then constructs a transaction block of the blockchain according to each blockchain transaction. The transaction block contains each blockchain transaction, and broadcasts the transaction block to other nodes in the blockchain to reach a consensus between the nodes of the blockchain. Finally, the first node calls the first node to execute the blockchain transaction in the transaction block according to the consensus result of the nodes in the blockchain, and saves the execution result to the account information of the first node. For blockchain transactions that do not contain private information, the first node packages and broadcasts the transaction for consensus between nodes, and saves it on the chain after the consensus is successful, so that the first node has the ability to upload public information to the blockchain and save private information locally, and can realize private communication on the blockchain chain while reducing the existing blockchain structure, which is conducive to reducing the implementation cost of the solution.
[0100] In some optional embodiments, after determining that the transaction information is the target transaction information, the first node will add the target transaction information to the local transaction set, which contains the transaction information sent to the first node by each node in the blockchain, and then read the target transaction information in the local transaction set through the local blockchain node. The local transaction set is specifically the local transaction pool of the first node, which is independent of the blockchain transaction pool and is used to temporarily store the target transaction information filtered from the blockchain transaction pool. The local blockchain node obtains the target transaction information to be processed from the local transaction pool. Through two transaction pools, the data sources for the processing of private communication and public communication are separated to avoid conflicts when reading data, which is conducive to improving data reading efficiency.
[0101] In some optional embodiments, when the first node decrypts the target transaction information, if the target transaction information fails to be decrypted by the private key of the first node and the first communication key, the target transaction information is deleted from the local transaction set. Decryption failure includes at least two situations, failure to decrypt the first communication key by the private key and failure to decrypt the information to be processed by the first communication key. In the case of failure to decrypt the first communication key, it means that the target transaction information is a private communication content provided to other nodes. This is because the node broadcasts the encrypted target transaction information through the communication link of the blockchain. Therefore, the target transaction information will reach the blockchain transaction pool of each node in the blockchain and will also be filtered into the local transaction pool. However, since the node without the corresponding private key cannot decrypt it, the target transaction information can be directly discarded, that is, the target transaction information is deleted from the local transaction set. If the first communication key fails to decrypt the information to be processed, it means that although the target transaction information is information sent to the first node, the data cannot be read due to reasons in the encryption and transmission process. The first node still needs to delete the target transaction information from the local transaction set, but it also needs to use private communication to inform the second node of the parsing failure through the blockchain to carry out the subsequent communication process. When decryption fails, the target transaction information is directly discarded to avoid excessive resource occupation by the local transaction set and improve the resource utilization efficiency of the node.
[0102] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 7 As shown, in an information processing method based on blockchain in one embodiment of the present application, the following steps may be included:
[0103] Step S710: Obtain a pending transaction set, where the pending transaction set includes transaction information sent by the second node in the blockchain to the first node.
[0104] Optionally, the implementation details of step S710 are the same as Figure 4 The step S410 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0105] Step S720: acquiring target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes a first communication key encrypted by the public key of the first node and information to be processed encrypted by the first communication key.
[0106] Optionally, the implementation details of step S720 are the same as Figure 4 The step S420 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0107] Step S730: decrypt the target transaction information using the private key of the first node and the first communication key to obtain the information to be processed.
[0108] Optionally, the implementation details of step S730 are the same as Figure 4 The step S430 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0109] Step S740: The information to be processed is saved locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0110] Optionally, the implementation details of step S740 are the same as Figure 4 The step S440 shown in FIG. 1 is consistent with the step S440 shown in FIG. 1 and will not be
[0111] Step S750: Acquire information to be transmitted, where the information to be transmitted is transaction information provided by the first node to the second node.
[0112] Step S760: Generate a second communication key for the information to be transmitted.
[0113] Step S770: encrypt the second communication key by using the public key of the second node to obtain an encrypted second communication key, and encrypt the information to be transmitted by using the second communication key to obtain encrypted information to be transmitted.
[0114] Step S780: Pack the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted.
[0115] Step S790, broadcasting the transaction to be transmitted to each node of the blockchain through the blockchain, so as to transmit the transaction to be transmitted to the set of pending transactions of the second node, and decrypting the transaction to be transmitted and saving the information to be transmitted through the local blockchain node of the second node.
[0116] The first node can also send private information to the second node. Specifically, the first node first obtains the message to be transmitted. The message to be transmitted is the transaction information provided by the first node to the second node. Subsequently, the first node generates a second communication key for the information to be transmitted. The second communication key is a key used to encrypt the information to be transmitted and send it to the second node. Subsequently, the first node encrypts the second communication key by the public key of the second node to obtain the encrypted second communication key, and encrypts the information to be transmitted by the second communication key to obtain the encrypted information to be transmitted. The public key of the second node is the public information of the second node in the blockchain. The second communication key encrypted by the public key of the second node can only be decrypted using the private key of the second node, so that only the second node can obtain the second communication key, and ensure that only the second node uses the decrypted second communication key to decrypt the information to be transmitted. The first node will package the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted, and then broadcast the transaction to be transmitted to each node of the blockchain through the blockchain. The transactions to be transmitted received by other nodes in the blockchain are placed in the set of pending transactions, and naturally reach the set of pending transactions of the second node. The second node decrypts the transaction to be transmitted through the local blockchain node of the second node and saves the information to be transmitted. The encrypted transaction to be transmitted is sent through the communication link of the blockchain, so there is no need to build a dedicated link under the chain to send private information, which is conducive to reducing the implementation cost of the solution.
[0117] In an embodiment of the present application, the first node of the blockchain obtains a set of pending transactions, and obtains the target transaction information encrypted by the public key and the first communication key of the first node from the transaction information transaction provided by the second node to the first node in the pending transaction set, decrypts the target transaction information by the private key and the first communication key of the first node to obtain the pending information, and then saves the decrypted pending information locally through a local blockchain node that does not communicate with other nodes. The target transaction information provided to the first node is encrypted by the public key of the first node, thereby ensuring that only the first node holding the private key can decrypt and obtain the pending information, and then saves the pending information locally through an independent local blockchain node, and uses the communication link of the blockchain to perform confidential communication between specific nodes, so that the same system can be used to process the original on-chain and off-chain tasks, reducing the complexity of the system architecture and communication links, thereby reducing the difficulty and cost of development and maintenance.
[0118] In some optional embodiments, in the process of saving the information to be processed locally through the local blockchain node of the first node, the first node constructs a local block of the blockchain according to the information to be processed through the local blockchain node, and then calls the first node through the local blockchain node to execute the transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed to the account book information of the local blockchain node. The operation of constructing the local block is performed by the local blockchain node, and the first node can trigger the local blockchain node to construct the local block by means of instructions or timers. The structure of the local block is usually the same as the structure of the on-chain block of the blockchain. After the constructed block is verified by the local blockchain, the first node is called to execute the transaction in the local block to directly save the information to be processed to the account book information of the local blockchain node, which is equivalent to the local block being chained in the local blockchain node. The local blockchain node will call the virtual machine of the first node to execute the blockchain transaction. The virtual machine is a simulated transaction system or module used by the first node to execute blockchain transactions, which runs as part of the first node itself. The result of the virtual machine operation will be returned to the local blockchain node, and then packaged and chained by the local blockchain node. By calling the first node to execute the blockchain transaction, it is necessary to set up the execution logic separately in the local blockchain node, thereby further simplifying the blockchain node structure and reducing maintenance costs.
[0119] In some optional embodiments, the transaction set to be processed also includes blockchain transactions from other nodes in the blockchain. After obtaining the transaction set to be processed, the first node also obtains each blockchain transaction in the transaction set to be processed, and then constructs a transaction block of the blockchain according to each blockchain transaction. The transaction block contains each blockchain transaction, and broadcasts the transaction block to other nodes in the blockchain to reach a consensus between the nodes of the blockchain. Finally, the first node calls the first node to execute the blockchain transaction in the transaction block according to the consensus result of the nodes in the blockchain, and saves the execution result to the account information of the first node. For blockchain transactions that do not contain private information, the first node packages and broadcasts the transaction for consensus between nodes, and saves it on the chain after the consensus is successful, so that the first node has the ability to upload public information to the blockchain and save private information locally, and can realize private communication on the blockchain chain while reducing the existing blockchain structure, which is conducive to reducing the implementation cost of the solution.
[0120] In some optional embodiments, before the first node packages the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted, it will extract the summary of the encrypted second communication key and the encrypted information to be transmitted according to the summary strategy of the blockchain to obtain a signature summary; the signature summary is signed by the private key of the first node to obtain a transaction signature; in the process of packaging the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted, the first node will package the encrypted second communication key, the encrypted information to be transmitted and the transaction signature into a transaction to be transmitted. Further adding the signature of the second node on the encrypted information to be transmitted and the second communication key in the transaction to be transmitted can prevent the encrypted information to be transmitted and the second communication key from being tampered with, thereby improving the security of the system.
[0121] The following is an example of the implementation details of the technical solution of the embodiment of the present application:
[0122] For ease of introduction, see Figure 8 , Figure 8 This is a schematic diagram of the structure of the blockchain system in the embodiment of this application. Figure 8 As shown in the figure, in addition to the chain transaction pool and consensus algorithm, each blockchain node also runs an independent local blockchain node and local transaction pool. The local transaction pool temporarily stores the private transactions filtered from the blockchain transaction pool. The local blockchain node does not communicate with other nodes and only processes private transactions in the local transaction pool.
[0123] See also Fig. 9 , Fig. 9 FIG. 1 is a schematic flow chart of the transaction processing flow in the embodiment of the present application. Fig. 9 As shown, each blockchain node is specifically divided into an application, a chain transaction pool, a local transaction pool, a consensus algorithm, a local node, a virtual machine, two independent databases, and a network layer. The private transactions and public blockchain transactions constructed by the application are temporarily stored in the chain transaction pool by the network layer and added to the chain transaction pool of other nodes through the network layer broadcast. The consensus algorithm of each node will obtain the blockchain transaction from the chain transaction pool, construct blocks based on the blockchain transaction, and broadcast the blocks to other nodes. After receiving the blocks, other nodes will execute the blocks through their own virtual machines, and save the data to the database storing public information according to the execution results. For private transactions, they will be filtered into the local transaction pool, and then the local node will obtain the private transactions from the local transaction pool and construct blocks based on the private transactions. The blocks of private transactions will not be broadcast, but will be directly executed by the local virtual machine, and the data will be saved in a database dedicated to storing private information.
[0124] Fig.10Schematic flow chart of the specific process of transaction processing in the embodiment of this application. Fig.10 As shown in the figure, first, the application generates a symmetric key DEK. Then, the application uses the public key KEK held by the message receiving node to encrypt DEK and output the encrypted key K. Then, the application constructs transaction tx and encrypts tx with DEK to obtain transaction T. The application uses the user's private key to decrypt the information composed of key K and transaction T, and outputs signature S. Finally, key K, transaction T and signature S are sent to the network layer of one of the blockchain nodes. The network layer sends the transaction to the transaction pool, which filters out the transaction and temporarily stores it in the local transaction pool. Then, the local node obtains the transaction from the local transaction pool, verifies the transaction signature S, decrypts DEK with the private key KEK, decrypts transaction tx with DEK, and then constructs a block with tx. Then, the local node calls the virtual machine to execute the block and saves the data in a database exclusive to privacy transactions.
[0125] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0126] The following introduces the device implementation of the present application, which can be used to execute the blockchain-based information processing method in the above embodiments of the present application. Fig.11 The block diagram of the information processing device based on blockchain in the embodiment of the present application is schematically shown, and the device is applied to the first node in the blockchain. Fig.11 As shown, the information processing device 1100 based on blockchain may mainly include:
[0127] A set acquisition unit 1110 is configured to acquire a pending transaction set, wherein the pending transaction set includes transaction information sent by the second node in the blockchain to the first node;
[0128] The information acquisition unit 1120 is configured to acquire target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes the first communication key encrypted by the public key of the first node and the to-be-processed information encrypted by the first communication key;
[0129] A decryption unit 1130 is configured to decrypt the target transaction information by using the private key of the first node and the first communication key to obtain the information to be processed;
[0130] The saving unit 1140 is configured to save the information to be processed locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
[0131] In some embodiments of the present application, based on the above technical solution, the decryption unit 1130 is specifically configured as: decrypting the encrypted first communication key based on the private key of the first node through the local blockchain node to obtain the information key; decrypting the encrypted information to be processed based on the first communication key through the local blockchain node to obtain the information to be processed.
[0132] In some embodiments of the present application, based on the above technical solution, the target transaction information also includes signature information obtained by signing with the private key of the second node; the decryption unit 1130 is also configured to: decrypt the signature information with the public key of the second node to obtain a signature summary, and the information summary is obtained by the second node extracting the encrypted first communication key and the encrypted information to be processed according to the summary strategy of the blockchain; extracting the encrypted first communication key and the encrypted information to be processed according to the summary strategy of the blockchain to obtain an information summary; if the signature summary matches the information summary, the target transaction information is decrypted.
[0133] In some embodiments of the present application, based on the above technical solution, the saving unit 1140 is specifically configured as: constructing a local block of the blockchain according to the information to be processed through a local blockchain node; calling the first node through the local blockchain node to execute a transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed in the ledger information of the local blockchain node.
[0134] In some embodiments of the present application, based on the above technical solution, the information acquisition unit 1120 is specifically configured to: traverse the transaction information of the transaction set to be processed and parse each transaction information; if the transaction information contains the encrypted first communication key and the encrypted information to be processed, determine that the transaction information is the target transaction information.
[0135] In some embodiments of the present application, based on the above technical solution, the information acquisition unit 1120 is further configured to: add the target transaction information to a local transaction set, where the local transaction set includes transaction information sent by each node in the blockchain to the first node;
[0136] The target transaction information in the local transaction set is read through the local blockchain node.
[0137] In some embodiments of the present application, based on the above technical solution, the information acquisition unit 1120 is also configured to: if decryption of the target transaction information fails using the private key of the first node and the first communication key, delete the target transaction information from the local transaction set.
[0138] In some embodiments of the present application, based on the above technical solution, the set of pending transactions also includes blockchain transactions from other nodes in the blockchain; the set acquisition unit 1110 is also configured to: obtain each blockchain transaction in the set of pending transactions; construct a transaction block of the blockchain according to each blockchain transaction, and the transaction block includes each blockchain transaction; broadcast the transaction block to other nodes in the blockchain to reach a consensus between the nodes of the blockchain; according to the consensus result of the nodes in the blockchain, call the first node to execute the blockchain transaction in the transaction block, and save the execution result to the account information of the first node.
[0139] In some embodiments of the present application, based on the above technical solution, the information acquisition unit 1120 is also configured to: obtain information to be transmitted, the message to be transmitted is transaction information provided by the first node to the second node; generate a second communication key for the information to be transmitted; encrypt the second communication key by the public key of the second node to obtain an encrypted second communication key, and encrypt the information to be transmitted by the second communication key to obtain the encrypted information to be transmitted; package the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted; broadcast the transaction to be transmitted to each node of the blockchain through the blockchain to transmit the transaction to be transmitted to the set of pending transactions of the second node, and decrypt the transaction to be transmitted through the local blockchain node of the second node and save the information to be transmitted.
[0140] In some embodiments of the present application, based on the above technical solution, the information acquisition unit 1120 is also configured to: extract the summary of the encrypted second communication key and the encrypted information to be transmitted according to the summary strategy of the blockchain to obtain a signature summary; sign the signature summary with the private key of the first node to obtain a transaction signature; and package the encrypted second communication key, the encrypted information to be transmitted and the transaction signature into a transaction to be transmitted.
[0141] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0142] Fig.12A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0143] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0144] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203. Various programs and data required for system operation are also stored in the RAM 1203. The CPU 1201, ROM 1202 and RAM 1203 are connected to each other through a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0145] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0146] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0147] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0150] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0151] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0152] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A blockchain-based information processing method, characterized in that: The method is applied to a first node in a blockchain, comprising: Obtaining a pending transaction set, where the pending transaction set includes transaction information sent by a second node in the blockchain to the first node; Acquire target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes a first communication key encrypted by the public key of the first node and information to be processed encrypted by the first communication key; Decrypting the target transaction information by using the private key of the first node and the first communication key to obtain the information to be processed; The information to be processed is saved locally through the local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
2. The information processing method according to claim 1, characterized in that: Decrypting the target transaction information by using the private key of the first node and the first communication key to obtain the information to be processed includes: Decrypting the encrypted first communication key based on the private key of the first node through the local blockchain node to obtain the information key; The encrypted information to be processed is decrypted by the local blockchain node based on the first communication key to obtain the information to be processed.
3. The information processing method according to claim 2, characterized in that: The target transaction information also includes signature information obtained by signing with the private key of the second node; before decrypting the target transaction information with the private key of the first node and the first communication key to obtain the information to be processed, the method further includes: Decrypting the signature information by using the public key of the second node to obtain a signature digest, where the signature digest is obtained by the second node extracting the encrypted first communication key and the encrypted information to be processed according to the digest strategy of the blockchain; Extracting the encrypted first communication key and the encrypted information to be processed through the summary strategy of the blockchain to obtain an information summary; If the signature digest matches the message digest, the target transaction information is decrypted.
4. The information processing method according to claim 1, characterized in that: The step of saving the information to be processed locally through the local blockchain node of the first node includes: Constructing a local block of the blockchain according to the information to be processed through a local blockchain node; The first node is called by the local blockchain node to execute a transaction according to the information to be processed in the constructed local block, so as to save the local block and the information to be processed into the account book information of the local blockchain node.
5. The information processing method according to claim 1, characterized in that: The acquiring target transaction information from the transaction information of the to-be-processed transaction set includes: Traversing the transaction information of the pending transaction set and parsing each transaction information; If the transaction information includes the encrypted first communication key and the encrypted information to be processed, the transaction information is determined to be the target transaction information.
6. The information processing method according to claim 5, characterized in that: After determining that the transaction information is the target transaction information, the method includes: Adding the target transaction information to a local transaction set, wherein the local transaction set includes transaction information sent by each node in the blockchain to the first node; The target transaction information in the local transaction set is read through the local blockchain node.
7. The information processing method according to claim 6, characterized in that: The method further comprises: If decryption of the target transaction information by using the private key of the first node and the first communication key fails, deleting the target transaction information from the local transaction set.
8. The information processing method according to claim 1, characterized in that: The transaction set to be processed also includes blockchain transactions from other nodes in the blockchain; after obtaining the transaction set to be processed, the method further includes: Obtain each blockchain transaction in the pending transaction set; Constructing a transaction block of the blockchain according to each blockchain transaction, wherein the transaction block includes each blockchain transaction; Broadcasting the transaction block to other nodes in the blockchain to reach consensus among the nodes of the blockchain; According to the consensus result of the nodes in the blockchain, the first node is called to execute the blockchain transaction in the transaction block, and the execution result is saved in the account book information of the first node.
9. The information processing method according to claim 1, characterized in that: The method further comprises: Acquire information to be transmitted, where the information to be transmitted is transaction information provided by the first node to the second node; Generating a second communication key for the information to be transmitted; Encrypting the second communication key by using the public key of the second node to obtain an encrypted second communication key, and encrypting the information to be transmitted by using the second communication key to obtain encrypted information to be transmitted; Packing the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted; The transaction to be transmitted is broadcasted to each node of the blockchain through the blockchain, so as to transmit the transaction to be transmitted to the set of pending transactions of the second node, and the transaction to be transmitted is decrypted and the information to be transmitted is saved through the local blockchain node of the second node.
10. The information processing method according to claim 9, characterized in that: Before packaging the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted, the method further includes: Extracting a summary of the encrypted second communication key and the encrypted information to be transmitted according to the summary strategy of the blockchain to obtain a signature summary; Sign the signature summary using the private key of the first node to obtain a transaction signature; The step of packaging the encrypted second communication key and the encrypted information to be transmitted into a transaction to be transmitted includes: The encrypted second communication key, the encrypted information to be transmitted and the transaction signature are packaged into a transaction to be transmitted.
11. An information processing device based on blockchain, characterized in that: The device is applied to a first node in a blockchain, and includes: a set acquisition unit, configured to acquire a pending transaction set, wherein the pending transaction set includes transaction information sent by the second node in the blockchain to the first node; an information acquisition unit, configured to acquire target transaction information from the transaction information of the to-be-processed transaction set, wherein the target transaction information includes the first communication key encrypted by the public key of the first node and the to-be-processed information encrypted by the first communication key; a decryption unit, configured to decrypt the target transaction information by using the private key of the first node and the first communication key to obtain the information to be processed; A storage unit is configured to store the to-be-processed information locally through a local blockchain node of the first node, and the local blockchain node does not communicate with other nodes in the blockchain.
12. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the blockchain-based information processing method described in any one of claims 1 to 10 by executing the executable instructions.
13. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the blockchain-based information processing method as described in any one of claims 1 to 10 is implemented.
14. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor of the electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the blockchain-based information processing method as described in any one of claims 1 to 10.