Data processing method, device, equipment, and medium based on blockchain system
By using ledger identification information and written ledgers to determine transaction data in the blockchain system, the security and storage pressure problems caused by blockchain nodes storing full data are solved, and the effect of higher security and lower storage pressure is achieved.
Patent Information
- Application Number
- CN202210148755.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-02-17
AI Technical Summary
Since nodes store all data in blockchain systems, data security is poor and storage pressure is high, and the existing technology is difficult to effectively solve.
The ledger maintained by the blockchain node has ledger identification information, and the written ledger of transaction data to be linked based on the ledger identification information and the inclusion relationship is determined, and sent to the associated blockchain node for storage, to avoid full data storage.
It improves the data security of the blockchain system, reduces the storage pressure of nodes, and saves storage space.
Smart Images

Figure CN116668028B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a data processing method, device, electronic device, and computer-readable storage medium based on a blockchain system. Background Art
[0002] The relevant technology uses a centralized approach to control permissions, but each blockchain node has full data. Therefore, some blockchain nodes may circumvent permission control by bypassing it, resulting in poor data security.
[0003] It can be seen that how to improve the security of data in the blockchain system is an urgent problem to be solved. Summary of the Invention
[0004] To solve the above technical problems, the embodiments of the present application provide a data processing method and device based on a blockchain system, an electronic device, and a computer-readable storage medium, thereby improving the security of data in the blockchain system at least to a certain extent.
[0005] According to one aspect of an embodiment of the present application, a data processing method based on a blockchain system is provided, wherein the ledgers maintained by the blockchain nodes in the blockchain system have ledger identification information, and the method includes: obtaining a first ledger corresponding to a first blockchain node that triggers transaction data to be uploaded to the chain; determining, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger; performing on-chain processing on the transaction data to be uploaded to the chain to obtain transaction data after being uploaded to the chain; sending the transaction data after being uploaded to the chain to the first blockchain node so that the first blockchain node writes the transaction data after being uploaded to the chain into the first ledger, and sending the transaction data after being uploaded to the chain to the second blockchain node so that the second blockchain node writes the transaction data after being uploaded to the chain into the second ledger.
[0006] According to one aspect of an embodiment of the present application, a data processing method based on a blockchain system is provided, wherein the ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the method includes: receiving transaction data after being uploaded to the chain; wherein the transaction data after being uploaded to the chain is obtained by the blockchain consensus node from a first ledger corresponding to a first blockchain node that triggers the transaction data to be uploaded to the chain, and based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, determining a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger, and obtaining and sending the transaction data to be uploaded to the chain after being uploaded to the chain; and writing the transaction data after being uploaded to the chain into the second ledger.
[0007] According to one aspect of an embodiment of the present application, a data processing device based on a blockchain system is provided, wherein the ledgers maintained by the blockchain nodes in the blockchain system have ledger identification information, and the device includes: an acquisition module, configured to acquire a first ledger corresponding to a first blockchain node that triggers transaction data to be on-chain; a determination module, configured to determine, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger; an on-chain module, configured to perform on-chain processing on the transaction data to be on-chain to obtain transaction data after on-chaining; and a sending module, configured to send the transaction data after on-chaining to the first blockchain node so that the first blockchain node writes the transaction data after on-chaining into the first ledger, and to send the transaction data after on-chaining to the second blockchain node so that the second blockchain node writes the transaction data after on-chaining into the second ledger.
[0008] In one embodiment of the present application, based on the aforementioned solution, the determination module includes: a parsing unit, configured to parse the ledger identification information of the first ledger according to an encoding rule of the ledger identification information to obtain multiple node identification information; a determining unit, configured to determine, based on the inclusion relationship between the ledger identification information and the multiple node identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0009] In one embodiment of the present application, based on the aforementioned scheme, the encoding rule includes the number of encoding bits corresponding to each blockchain node; the parsing unit is specifically configured to: split the account identification information of the first account book according to the number of encoding bits to obtain multiple encoding fields; perform identification processing on the multiple encoding fields respectively to obtain identification results corresponding to the multiple encoding fields, and use the identification results corresponding to the multiple encoding fields as the multiple node identification information.
[0010] In one embodiment of the present application, based on the aforementioned scheme, the parsing unit is further specifically configured to: determine the blockchain nodes corresponding to the multiple coding fields respectively according to the preset blockchain node and coding field mapping relationship, and use the blockchain node corresponding to the coding field as the identification result corresponding to the coding field; wherein, the preset blockchain node and coding field relationship is pre-set with multiple blockchain nodes, and the coding fields corresponding to the multiple blockchain nodes respectively.
[0011] In one embodiment of the present application, based on the aforementioned scheme, the parsing unit is further specifically configured to: receive a setting request, the setting request carrying the name of the blockchain node and a coding field that matches the name of the blockchain node; associate and store the name of the blockchain node and the coding field that matches the name of the blockchain node to generate a mapping relationship between the preset blockchain node and the coding field.
[0012] In one embodiment of the present application, based on the aforementioned solution, the number of the second ledgers is multiple, and the inclusion relationships between the ledger identification information include: the inclusion relationship between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals; the determination unit is configured to: select a target inclusion relationship from the inclusion relationships between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals based on the ledger ownership information represented by the ledger identification information of the first ledger; and determine the second ledger of the second blockchain node to which the transaction data after being uploaded to the chain is to be written based on the target inclusion relationship and the multiple node identification information.
[0013] In one embodiment of the present application, based on the aforementioned scheme, the determination unit is further specifically configured as follows: if the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the management department, then the inclusion relationship between the management departments is selected as the target inclusion relationship from the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual; according to the inclusion relationship between the management departments, the multiple node identification information is combined to obtain the second account book of the second blockchain node to which the transaction data after being uploaded to the chain is to be written.
[0014] In one embodiment of the present application, based on the aforementioned scheme, the determination unit is further specifically configured as follows: if the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the enterprise, then the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual are selected as the target inclusion relationship; according to the inclusion relationship between the management departments and the inclusion relationship between the management department and the enterprise, the multiple node identification information are combined to obtain the second account book of the second blockchain node to which the transaction data after being uploaded to the chain is to be written.
[0015] In one embodiment of the present application, based on the aforementioned scheme, the determination unit is further specifically configured as follows: if the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the individual, then the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual are selected as the target inclusion relationship from the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual; according to the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual, the multiple node identification information are combined to obtain the second account book of the second blockchain node to which the transaction data after being uploaded to the chain is to be written.
[0016] In one embodiment of the present application, based on the aforementioned scheme, the device further includes: an acquisition unit, configured to acquire business type information corresponding to multiple blockchain nodes; a division unit, configured to divide the blockchain nodes belonging to the same type of business type information in the multiple business type information into a group to obtain multiple groups of blockchain nodes; wherein each group of blockchain nodes includes at least two blockchain nodes; and a generation unit, configured to generate ledger identification information having an inclusion relationship corresponding to the at least two blockchain nodes.
[0017] According to one aspect of an embodiment of the present application, a data processing device based on a blockchain system is provided, wherein the ledgers maintained by the blockchain nodes in the blockchain system have ledger identification information, and the device includes: a receiving module, configured to receive transaction data after being put on the chain; wherein the transaction data after being put on the chain is obtained by the blockchain consensus node from a first ledger corresponding to a first blockchain node that triggers the transaction data to be put on the chain, and based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger, and the transaction data to be put on the chain is obtained and sent after being put on the chain; and a writing module, configured to write the transaction data after being put on the chain into the second ledger.
[0018] In one embodiment of the present application, based on the aforementioned solution, the apparatus further includes: a first receiving unit configured to receive a ledger identification setting request; wherein the ledger identification setting request carries ledger identification information; an obtaining unit configured to obtain a second ledger having the ledger identification information based on the ledger identification information; wherein the ledger identification information corresponding to ledgers of the same type of business type information on different blockchain nodes has an inclusion relationship.
[0019] In one embodiment of the present application, based on the aforementioned solution, the apparatus further includes: a second receiving unit, configured to receive an operation request for the on-chain transaction data written in the second ledger; wherein the operation request carries signature data; and an execution unit, configured to allow execution of a specified operation on the on-chain transaction data written in the second ledger if verification of the signature data is successful.
[0020] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the data processing method based on the blockchain system as described above.
[0021] 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-readable instructions are executed by a processor of a computer, the computer executes the data processing method based on the blockchain system as described above.
[0022] According to one aspect of an embodiment of the present application, a computer program product is provided, including computer instructions, which, when executed by a processor, implement the data processing method based on the blockchain system as described above.
[0023] In the technical solution provided in the embodiments of the present application, by determining the ledgers (i.e., the first ledger and the second ledger) to which the transaction data to be uploaded to the chain is to be written, and after the transaction data to be uploaded to the chain is uploaded to the chain, the transaction data after being uploaded to the chain is sent / cleared to the ledgers of the corresponding blockchain nodes (i.e., the first blockchain node and the second blockchain node) for storage. In this way, on the one hand, for the blockchain nodes, only the data associated with it is stored, rather than the full data, thereby avoiding the problem of poor data security caused by the blockchain node bypassing the permission control due to the storage of the full data; on the other hand, because the amount of data stored for the associated data is smaller than the amount of data stored for the full data, the storage pressure of the blockchain node is reduced to a certain extent, saving storage space.
[0024] 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
[0025] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0026] Figure 1 It is a schematic diagram of the structure of the blockchain network;
[0027] Figure 2 It is a schematic diagram of the connection relationship between each block in the blockchain;
[0028] Figure 3 It is a schematic diagram of the process of generating a block;
[0029] Figures 4 to 6 This is a system architecture diagram of the blockchain system used in the embodiments of the present application;
[0030] Figure 7 is a schematic diagram of an exemplary blockchain system to which the technical solutions of the embodiments of the present application can be applied;
[0031] Figure 8 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0032] Figure 9 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0033] Figure 10This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0034] Figure 11 yes Figure 10 A flowchart of step S1002 in the illustrated embodiment in an exemplary embodiment;
[0035] Figure 12 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0036] Figure 13 This is a schematic diagram of the composition of account book identification information shown in an exemplary embodiment of the present application;
[0037] Figure 14 This is a schematic diagram of the composition of account book identification information shown in an exemplary embodiment of the present application;
[0038] Figure 15 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0039] Figure 16 yes Figure 15 A flowchart of step S1502 in the illustrated embodiment in an exemplary embodiment;
[0040] Figure 17 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0041] Figure 18 yes Figure 8 A flow chart of step S802 in the illustrated embodiment in an exemplary embodiment;
[0042] Figure 19 yes Figure 18 A flowchart of step S1801 in the illustrated embodiment in an exemplary embodiment;
[0043] Figure 20 yes Figure 18 A flowchart of step S1802 in the illustrated embodiment in an exemplary embodiment;
[0044] Figure 21 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0045] Figure 22 yes Figure 8 A flow chart of step S803 in the illustrated embodiment in an exemplary embodiment;
[0046] Figure 23 yes Figure 22A flowchart of step S2202 in the illustrated embodiment in an exemplary embodiment;
[0047] Figure 24 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0048] Figure 25 yes Figure 24 A flowchart of step S2402 in the illustrated embodiment in an exemplary embodiment;
[0049] Figure 26 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0050] Figure 27 yes Figure 26 A flowchart of step S2601 in the illustrated embodiment in an exemplary embodiment;
[0051] Figure 28 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0052] Figure 29 This is a flowchart of a data processing method based on a blockchain system, shown in an exemplary embodiment of the present application;
[0053] Figure 30 This is a schematic diagram of a four-layer ledger clearing structure shown in an exemplary embodiment of the present application;
[0054] Figure 31 is a schematic diagram of different business structures shown in an exemplary embodiment of the present application;
[0055] Figure 32 is a block diagram of a data processing device based on a blockchain system, shown as an exemplary embodiment of the present application;
[0056] Figure 33 is a block diagram of a data processing device based on a blockchain system, shown as an exemplary embodiment of the present application;
[0057] Figure 34 It is a structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present application. DETAILED DESCRIPTION
[0058] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments applicable to the present application. Rather, they are merely examples of apparatus and methods applicable to certain aspects of the present application, as detailed in the appended claims.
[0059] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0060] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0061] It should be noted that the term "plurality" used in this application refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0062] Before introducing the technical solutions of the embodiments of the present application, the blockchain technology used in the embodiments of the present application is first introduced.
[0063] Blockchain is a new application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a series of data blocks (i.e., blocks) generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of that information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product and service layer, and the application service layer.
[0064] As mentioned above, blockchain is essentially a decentralized database, and the blockchain is maintained by the nodes in the blockchain network. For example, see Figure 1 ,exist Figure 1The blockchain network shown may include multiple nodes 101, each of which may be the individual clients that form the blockchain network. Each node 101 may receive input information during normal operation and, based on the received input information, maintain shared data within the blockchain network. To ensure information interoperability within the blockchain network, information connections may exist between each node in the blockchain network, allowing nodes to transmit information through these connections. For example, when any node in the blockchain network receives input information, the other nodes in the blockchain network obtain the input information according to a consensus algorithm and store it as shared data, ensuring that the data stored on all nodes in the blockchain network is consistent.
[0065] Each node in a blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes so that it can subsequently broadcast generated blocks to other nodes in the blockchain network based on the node identifiers of other nodes. Each node can maintain a node identifier list, storing the node name and node identifier in the node identifier list. 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.
[0066] Each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 2 The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp, and difficulty value, etc., and the block body stores the input information; the next block of the genesis block uses the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value, version number, timestamp, and difficulty value of the parent block, etc., and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.
[0067] When generating each block in the blockchain, refer to Figure 3When a blockchain node receives input information, it verifies it. After verification, it stores the input information in the memory pool and updates the hash tree used to record the input information. It then updates the timestamp to the time the input information was received, tries different random numbers, and performs eigenvalue calculations multiple times. When a random number that meets the conditions is calculated, the information is stored accordingly, and a block header and block body are generated to obtain the current block. Subsequently, the blockchain node sends the newly generated block to other nodes in the data sharing system based on their node identifiers. These other nodes then verify the newly generated block and, after verification, add it to their stored blockchain. Among them, the nodes can perform consensus verification on the newly generated blocks through the consensus algorithm, and the consensus algorithm may include but is not limited to: Pow (Proof of Work), Pos (proof of stake), DPos (Delegated Proof of Stake) share authorization proof mechanism, PBFT (Practical Byzantine Fault Tolerance), Paxos (a distributed algorithm) algorithm, and Raft (a distributed consensus algorithm) algorithm.
[0068] Optionally, each node in the blockchain network can be a server or a terminal device. The server can be an independent physical server, 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), and big data and intelligent platforms. The terminal device can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart home, car terminal, etc., but is not limited to this. The nodes can be directly or indirectly connected through wired or wireless communication, which is not limited in this application.
[0069] Cloud computing, as mentioned above, refers to the delivery and usage model of IT infrastructure. Specifically, it refers to the on-demand, scalable access to required resources over the Internet. Broadly speaking, cloud computing refers to the delivery and usage model of services, meaning the on-demand, scalable access to required services over the Internet. These services can be IT-related, software-related, internet-related, or other services. Cloud computing is the product of the convergence of traditional computer and network technologies, including grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. Driven by the growth of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has rapidly developed. Unlike previous parallel and distributed computing, the emergence of cloud computing will fundamentally revolutionize the entire Internet model and enterprise management model.
[0070] Based on blockchain technology, the embodiment of this application proposes a blockchain system architecture. Figure 4 As shown, the blockchain system includes a consensus network 2 and a business network 1 (also called a witness network). The consensus network 2 includes a consensus node 21 that reaches consensus on data blocks and records the data blocks on the blockchain; the business network 1 includes a business node 11, which can verify the data blocks recorded on the blockchain by the consensus node 21, or request corresponding transaction data from the consensus node 21. It is understandable that the aforementioned Figure 1 The node 101 involved can be a consensus node 21 or a business node 11.
[0071] Specifically, business node 11 verifies the data block recorded on the blockchain by consensus node 21, including the following steps: Consensus node 21 in consensus network 2 generates a signature based on the transaction information to be included in a data block to be added to the blockchain, using a key specific to consensus node 21; consensus node 21 adds the transaction information and the generated signature to the data block, which is then added to the blockchain; consensus node 21 sends the signature to business node 11 in business network 1, which verifies the signature using the key specific to consensus node 21, thereby verifying the data block recorded by consensus node 21 on the blockchain. Consensus node 21 in consensus network 2 is responsible for recording the data block on the blockchain, while business node 11 in business network 1 is responsible for witnessing the result recorded by consensus node 21. Specifically, consensus node 21 generates a signature based on the transaction information to be included in the data block to be added to the blockchain, then adds the transaction information and the generated signature to the data block for uploading to the blockchain. The signature is then sent to the business node 11 in the business network 1, so that the business node 11 verifies the signature based on the key specific to the consensus node 21. The business node 11 in the business network 1 can witness the transaction data of the entire network by verifying the signature of the consensus node 21 on the block. Although the consensus network 2 has a monopoly on the bookkeeping right, because the data block has a digital signature representing the identity of the bookkeeper, all activities are publicly traceable. If the consensus node 21 collectively acts maliciously, then all nodes in the business network 1 will retain evidence of the malicious behavior of the specific consensus node 21. Compared with traditional centralized systems and private chains, the operation of the system in the embodiment of the present application is more transparent; and compared with traditional decentralized solutions, this solution is more controllable and easier to regulate.
[0072] In one embodiment of the present application, the consensus network 2 and the business network 1 can be connected through a proxy node 12. The proxy node 12 can be a business node 11 of the business network 1, which is responsible for transmitting the information that the consensus node 21 wants to transmit to the business node 11. The business node 11 is the terminal of the transaction party that generates various transaction data that need to be uploaded to the chain, and can also be a terminal that queries transaction data from the consensus network 2. The transaction data generated by the business node 11 is transmitted to the consensus node 21 through the proxy node 12, and then recorded on the blockchain after consensus, which is conducive to the unified processing and supervision of transaction data. The business node 11 can also supervise and witness the upload of transaction data to the chain through the information sent by the consensus node 21 via the proxy node 12. This is of great significance in some scenarios where unified supervision is required but supervision is required because the nodes under supervision are afraid of collective cheating.
[0073] exist Figure 4In the illustrated blockchain system architecture, business network 1 employs a P2P (peer-to-peer) network model. A P2P network is a distributed application architecture that distributes tasks and workloads among peers. It is a networking or network form of the peer-to-peer computing model at the application layer, known as a "point-to-point" or "end-to-end" network. It can be defined as a network in which participants share a portion of their hardware resources (processing power, storage capacity, network connectivity, printers, etc.). These shared resources provide services and content through the network and can be directly accessed by other peer nodes without going through an intermediary entity. Participants in this network are both providers and recipients of resources, services, and content. Therefore, in business network 1, when a proxy node 12 receives a message from a consensus node 21, it propagates it to surrounding business nodes 11. The surrounding business nodes 11 receive the message and then propagate it to their surrounding business nodes 11, ensuring that the message is propagated among every business node 11 in business network 1.
[0074] Figure 5 The system architecture of another blockchain system used in the embodiment of this application is shown. Figure 4 The architecture shown in Figure 1 differs in that it uses a broadcast network model instead of a P2P network model in business network 1. Specifically, after receiving a message from consensus node 21, proxy node 12 broadcasts the message to other business nodes 11 in business network 1. This ensures that the message is propagated among all business nodes 11 in business network 1.
[0075] Figure 6 The system architecture of another blockchain system used in the embodiment of this application is shown. Figure 4The architecture shown differs in that its consensus network 2 is divided into multiple branch consensus networks 2. Each branch consensus network 2 can be responsible for recording a specific type of transaction information. For example, a company may engage in supply chain finance and may need to record contract information, outstanding payments, and other information generated during the supply and marketing process on the blockchain. At the same time, the company also issues invoices and needs to record invoicing information and invoice reimbursement information on the blockchain. In this case, to facilitate oversight of consensus nodes 21 by the same department, the consensus nodes 21 recording supply chain finance transactions and the consensus nodes 21 recording transactions during the invoice circulation process may belong to different departments. For example, the consensus node 21 recording supply chain finance transactions may be a bank's accounting terminal, while the consensus node 21 recording transactions during the invoice circulation process may be a accounting terminal set up by the State Taxation Administration. Supply chain finance transactions and transactions during the invoice circulation process may ultimately be recorded on different branch consensus networks 2. In this case, the proxy node 12 will send the transaction information sent from the business node 11 to the branch consensus network 2 corresponding to the transaction type.
[0076] It should be noted that in Figures 4 to 6 In the architecture of the blockchain system shown, the proxy node 12 is located in the business network 1. In other embodiments of the present application, the proxy node 12 may also be located in the consensus network 2, or independent of the business network 1 and the consensus network 2.
[0077] It is understandable that in Figures 4 to 6 In the illustrated blockchain system architecture, the blockchain system can include smart contracts. These smart contracts can be understood as code that can be understood and executed by all blockchain nodes, executing arbitrary computational logic and generating results. Smart contracts deployed on consensus nodes in consensus network 2 are collectively referred to as on-chain contracts, while smart contracts deployed and executed only on service nodes in service network 1 are collectively referred to as service contracts (also known as local contracts).
[0078] Optionally, the blockchain system may include one or more smart contracts, which may be distinguished by contract identifiers (such as identification numbers (ID) or names, and may also include contract addresses or contract function names (also known as contract method names). The contract call request initiated by the terminal may also carry the identification number or name of the smart contract to specify the smart contract that the blockchain needs to run.
[0079] Based on the aforementioned blockchain technology and the problem of poor data security in blockchain systems in related technologies, the embodiment of this application provides a data processing method based on a blockchain system. Specifically, in an application scenario of this application, please refer to Figure 7 , mainly including the above Figures 4 to 6 The multiple business nodes 11 involved in the above Figures 4 to 6 The multiple consensus nodes 21 involved in the process. Among them, the multiple business nodes 11 and the multiple consensus nodes 21 can communicate with each other arbitrarily.
[0080] Among them, multiple business nodes 11 can each correspond to a business network / a blockchain, that is, each business node 11 corresponds to a different business network / blockchain; and, multiple business nodes 11 each maintain an account book (also called a local account book). Multiple business nodes 11 can be business nodes with a hierarchical inclusion relationship; it can be understood that the hierarchical inclusion relationship can refer to a hierarchical inclusion relationship such as that between an individual, an enterprise, and an administrative department. Exemplarily, multiple business nodes 11 can be a first business node, a second business node, a third business node, a fourth business node, a fifth business node, and a sixth business node; wherein the first business node can be an individual, the second business node can be an enterprise, the third business node can be a district administrative department, the fourth business node can be a municipal administrative department, the fifth business node can be a provincial administrative department, the sixth business node can be a general administrative department (also called a general administrative department), etc.
[0081] Among them, multiple consensus nodes 21 can correspond to a consensus network / blockchain together, that is, the consensus network / blockchain corresponding to each consensus node 21 is the same; and, multiple consensus nodes each maintain an account book (also called a shared account book).
[0082] For the convenience of description in the following text, Figure 7 The business node that triggers the transaction data to be uploaded is called the first blockchain node, the business node that receives the transaction data to be uploaded (obtained after the transaction data is uploaded) is called the second blockchain node, and the consensus node is called the blockchain consensus node. Optionally, there are one or more second blockchain nodes. It is understood that the ledgers maintained by the first blockchain node and the second blockchain node have ledger identification information.
[0083] In one embodiment of the present application, taking transaction data as an example, the blockchain consensus node can obtain a first ledger corresponding to a first blockchain node that triggers the transaction data to be on-chain; then, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, determine a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger; and perform on-chain processing on the transaction data to be on-chain to obtain transaction data after on-chain; then, send the transaction data after on-chain to the first blockchain node corresponding to the first ledger, and accordingly, the first blockchain node writes the transaction data after on-chain into the first ledger, and send the transaction data after on-chain to the second blockchain node corresponding to the second ledger, and accordingly, the second blockchain node writes the transaction data after on-chain into the second ledger.
[0084] It should be noted that in the specific implementation of this application, user-related data (such as transaction data) is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0085] based on Figure 7 In the application scenario shown, after adopting the technical solution of the embodiment of the present application, since the blockchain node stores the data associated with it instead of the full data, it avoids the problem of poor data security caused by the blockchain node bypassing the permission control due to the storage of the full data; and since the amount of stored associated data is less than the amount of stored full data, it also reduces the storage pressure of the blockchain node to a certain extent and saves storage space.
[0086] The following describes in detail the various implementation details of the technical solutions of the embodiments of the present application:
[0087] See also Figure 8 , Figure 8 This is a flowchart of a data processing method based on a blockchain system according to an embodiment of the present application. The data processing method based on a blockchain system can be executed by a blockchain consensus node in the blockchain system. Figure 8 As shown, the data processing method based on the blockchain system includes at least steps S801 to S804, which are described in detail as follows:
[0088] Step S801: Obtain a first ledger corresponding to a first blockchain node that triggers transaction data to be uploaded.
[0089] In the embodiment of the present application, the first blockchain node refers to the blockchain node that triggers the transaction data to be uploaded to the chain, which can serve as a data provider.
[0090] In the embodiment of the present application, the ledger maintained by the first blockchain node is referred to as the first ledger, wherein the first ledger has ledger identification information, which is information used to uniquely represent the ledger.
[0091] In one embodiment of the present application, see Figure 9 Before obtaining the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded in step S801, steps S901 to S902 may also be included, which are described in detail as follows:
[0092] Step S901: receiving a first call request for a first contract sent by a first blockchain node;
[0093] Step S902: trigger the execution of the first contract according to the first call request to generate transaction data to be uploaded to the chain.
[0094] That is, in an optional embodiment, the process for generating the transaction data to be uploaded to the blockchain may include: a blockchain consensus node receiving a first call request for a first contract from a first blockchain node, and then triggering execution of the first contract based on the first call request, thereby generating the transaction data to be uploaded to the blockchain. In this optional embodiment, the first contract is the smart contract described above, which is located on the core chain and is therefore also called an on-chain contract.
[0095] In this way, the blockchain consensus node triggers the execution of the first contract by receiving the first call request for the first contract, and can quickly and easily generate transaction data to be uploaded to the chain.
[0096] In one embodiment of the present application, see Figure 10 Before obtaining the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded in step S801, steps S1001 to S1002 may also be included, which are described in detail as follows:
[0097] Step S1001: receiving an add request sent by a first blockchain node; wherein the add request includes account identification information of a first account of the first blockchain node;
[0098] Step S1002: Add a first blockchain node to the blockchain system according to the ledger identification information of the first ledger.
[0099] That is, in an optional embodiment, the first blockchain node must be added to the blockchain system first. The process of adding the first blockchain node to the blockchain system can be that the blockchain consensus node receives an addition request sent by the first blockchain node that carries the account identification information of the first ledger of the first blockchain node, and then adds the first blockchain node to the blockchain system according to the account identification information of the first ledger.
[0100] In this way, if an entity needs to be added to the blockchain system to become the first blockchain node, it can quickly and easily complete the addition by initiating an addition request, and the addition process is simple.
[0101] In one embodiment of the present application, see Figure 11 The process of adding the first blockchain node to the blockchain system according to the ledger identification information of the first ledger in step S1002 may include steps S1101 to S1102, which are described in detail as follows:
[0102] Step S1101: registering a first blockchain node on a blockchain system according to the ledger identification information of the first ledger, and obtaining the registered on-chain address;
[0103] Step S1102: Associating the account identification information of the first account book with the on-chain address to obtain an association result to complete the addition of the first blockchain node.
[0104] That is, in an optional embodiment, the process of adding the first blockchain node to the blockchain system according to the ledger identification information of the first ledger can specifically be: the blockchain consensus node registers the first blockchain node on the blockchain system according to the ledger identification information of the first ledger, obtains the registered on-chain address, and then associates the ledger identification information of the first ledger with the on-chain address to obtain an association result, thereby completing the addition of the first blockchain node.
[0105] In this way, by associating the account identification information of the first ledger with the on-chain address, the first blockchain node can be accurately added, and the first blockchain node can be subsequently found according to the account identification and / or on-chain address of the first ledger.
[0106] In one embodiment of the present application, see Figure 12 Before associating the account identification information of the first account book with the on-chain address in step S1102 and obtaining the association result, the process may further include steps S1201 to S1203, which are described in detail as follows:
[0107] Step S1201: receiving a ledger identifier allocation request sent by a first blockchain node;
[0108] Step S1202: Generate ledger identification information matching the first blockchain node according to the ledger identification allocation request;
[0109] Step S1203: Send the ledger identification information that matches the first blockchain node to the first blockchain node, so that the first blockchain node obtains the first ledger with the ledger identification information that matches the first blockchain node.
[0110] That is, in an optional embodiment, the process of obtaining the ledger identification information of the first ledger of the first blockchain node may be that the blockchain consensus node receives the ledger identification allocation request sent by the first blockchain node, and then generates ledger identification information that matches the first blockchain node according to the ledger identification allocation request, and sends the generated ledger identification information that matches the first blockchain node to the first blockchain node. Accordingly, the first blockchain node can set the first ledger according to the received ledger identification information, thereby obtaining the first ledger with ledger identification information that matches the first blockchain node.
[0111] In this way, by having the blockchain consensus node determine the ledger identification information of the first blockchain node registered in the blockchain system, unified management of the ledger identification information is facilitated, thereby improving the efficiency of ledger identification information management.
[0112] Step S802: Determine, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0113] In the embodiment of the present application, a first ledger corresponding to a first blockchain node that triggers transaction data to be uploaded is obtained. Then, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger are determined.
[0114] In the embodiments of the present application, the multiple ledger identification information managed by the blockchain consensus node has an inclusion relationship, which to a certain extent reflects the upper and lower inclusion relationship between the various blockchain nodes (the first blockchain node, the second blockchain, and the blockchain consensus node). For example, if the first blockchain node is an individual, there are multiple second blockchain nodes, namely an enterprise, a district management department business 1 management center, a municipal management department business 1 management center, and a provincial management department business 1 management center, and the blockchain consensus node is the general management department business 1 management center; then the ledger identification information of the first ledger corresponding to the first blockchain node, the ledger identification information of the second ledger corresponding to the multiple second blockchain nodes, and the ledger identification information of the shared ledger corresponding to the blockchain consensus node have an inclusion relationship.
[0115] In the embodiments of the present application, the ledger identification information includes, but is not limited to, a 4-bit description information code + a 2-bit version number code + a 2-bit business type code + a 6-bit region code + a 2-bit entity type code + a 16-bit entity ID code (the first 8 digits of the entity ID / organization code + the last 8 digits of the entity ID / organization code). It will be appreciated that in actual applications, the content included in the ledger identification information can be flexibly adjusted. For example, some content can be added or removed based on the content included in the ledger identification information described above, and the number of bits of each content can also be flexibly adjusted.
[0116] In one embodiment of the present application, see Figure 13 , is a schematic diagram of the composition of an example ledger identification information, such as Figure 13 As shown, the account book identification information includes a 4-digit description information code + a 2-digit version number code + a 2-digit business type code + a 6-digit region code + a 2-digit entity type code + a 16-digit entity ID code (the first 8 digits of entity ID / institution code + the last 8 digits of entity ID / institution code) arranged in sequence.
[0117] In one embodiment of the present application, see Figure 14 , is a schematic diagram of the composition of an example ledger identification information, such as Figure 14 As shown, the description information code may refer to the name of the service, such as Service 1, Service 2, Service 3, etc., where Service 1, Service 2, and Service 3 are three different types of services respectively; the version number code may refer to the version code of the service, and the version number is mainly used to reserve digits in advance when there are too many services; the service type code may refer to the type code of the service; the region code refers to the code of the entire region, such as a province, a city, or a district; the entity type refers to the enterprise, institution, individual, etc., which corresponds to the first 8-digit code and the last 8-digit code of the entity.
[0118] For example, taking business as Figure 14 For the example of business 1 described in the preceding text, specifically, the ledger identification information of the blockchain node associated with business 1 is shown in Table 1.
[0119]
[0120] Table 1
[0121] As can be seen from Table 1, the inclusion relationship between account identification information is that the account identification information corresponding to a certain company's employee Tom includes the account identification information corresponding to the certain company, Shenzhen Business 1 Management Center, Guangdong Business 1 Management Center, and the Business 1 Management Center Headquarters; accordingly, the account identification information corresponding to a certain company includes the account identification information corresponding to Shenzhen Business 1 Management Center, Guangdong Business 1 Management Center, and the Business 1 Management Center Headquarters; accordingly, the account identification information corresponding to Shenzhen Business 1 Management Center includes the account identification information corresponding to Guangdong Business 1 Management Center and the Business 1 Management Center Headquarters; accordingly, the account identification information corresponding to Guangdong Business 1 Management Center includes the account identification information corresponding to the Business 1 Management Center Headquarters.
[0122] It's understandable that headquarters are typically on the core chain. For example, the Business 1 Management Center headquarters in Table 1 is on the core chain and corresponds to a blockchain consensus node. However, company employee Tom, company A, Shenzhen Business 1 Management Center, and Guangdong Business 1 Management Center are not on the core chain. If company employee Tom initiates a first call request for a first contract to the Business 1 Management Center headquarters, then company employee Tom serves as the first blockchain node triggering the transaction data to be uploaded to the blockchain. Accordingly, company A, Shenzhen Business 1 Management Center, and Guangdong Business 1 Management Center serve as second blockchain nodes. If company A initiates a first call request for a first contract to the Business 1 Management Center headquarters, then company A serves as the first blockchain node triggering the transaction data to be uploaded to the blockchain. Accordingly, Shenzhen Business 1 Management Center and Guangdong Business 1 Management Center serve as second blockchain nodes. Based on the specific employee targeted by the company's transaction data to be uploaded, the uploaded transaction data, after being uploaded to the blockchain and processed, will be sent to that specific employee.
[0123] In one embodiment of the present application, see Figure 15 Before determining, in step S802, the second ledger whose ledger identification information includes the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, and the second blockchain node corresponding to the second ledger, the process may further include steps S1501 and S1502, which are described in detail as follows:
[0124] Step S1501: receiving an add request sent by a second blockchain node; wherein the add request includes account identification information of a second account of the second blockchain node;
[0125] Step S1502: Add a second blockchain node to the blockchain system according to the ledger identification information of the second ledger.
[0126] That is, in an optional embodiment, a second blockchain node must first be added to the blockchain system, wherein the process of adding the second blockchain node to the blockchain system can be that the blockchain consensus node receives an addition request sent by the second blockchain node that carries the account identification information of the second ledger of the second blockchain node, and then adds the second blockchain node to the blockchain system according to the account identification information of the second ledger.
[0127] In this way, if an entity needs to be added to the blockchain system to become a second blockchain node, it can quickly and easily complete the addition by initiating an addition request, and the addition process is simple.
[0128] In one embodiment of the present application, see Figure 16 The process of adding the second blockchain node to the blockchain system according to the ledger identification information of the second ledger in step S1502 may include steps S1601 to S1602, which are described in detail as follows:
[0129] Step S1601: registering a second blockchain node on the blockchain system according to the ledger identification information of the second ledger, and obtaining the registered on-chain address;
[0130] Step S1602: Associating the account identification information of the second account book with the on-chain address to obtain an association result to complete the addition of the second blockchain node.
[0131] That is, in an optional embodiment, the process of adding a second blockchain node to the blockchain system based on the account identification information of the second account book can specifically be that the blockchain consensus node registers the second blockchain node on the blockchain system based on the account identification information of the second account book, obtains the registered on-chain address, and then associates the account identification information of the second account book with the on-chain address to obtain an association result, thereby completing the addition of the second blockchain node.
[0132] In this way, by associating the account identification information of the second ledger with the on-chain address, the second blockchain node can be accurately added, and the second blockchain node can be subsequently found based on the account identification and / or on-chain address of the second ledger.
[0133] In one embodiment of the present application, see Figure 17 Before associating the account identification information of the second account book with the on-chain address in step S1602 and obtaining the association result, the process may further include steps S1701 to S1703, which are described in detail as follows:
[0134] Step S1701: receiving a ledger identifier allocation request sent by a second blockchain node;
[0135] Step S1702: Generate ledger identification information matching the second blockchain node according to the ledger identification allocation request;
[0136] Step S1703: Send the ledger identification information that matches the second blockchain node to the second blockchain node, so that the second blockchain node obtains the second ledger with the ledger identification information that matches the second blockchain node.
[0137] That is, in an optional embodiment, the process of obtaining the ledger identification information of the second ledger of the second blockchain node may be that the blockchain consensus node receives the ledger identification allocation request sent by the second blockchain node, and then generates ledger identification information that matches the second blockchain node according to the ledger identification allocation request, and sends the generated ledger identification information that matches the second blockchain node to the second blockchain node. Accordingly, the second blockchain node can set the second ledger according to the received ledger identification information, thereby obtaining a second ledger with ledger identification information that matches the second blockchain node.
[0138] In this way, by having the blockchain consensus node determine the ledger identification information of the second blockchain node registered in the blockchain system, unified management of the ledger identification information is facilitated, thereby improving the efficiency of ledger identification information management.
[0139] It should be noted that the process of adding the second blockchain node in the blockchain system introduced here is similar to the process of adding the first blockchain node in the blockchain system introduced above.
[0140] In one embodiment of the present application, see Figure 18 In step S802, the process of determining, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger may include steps S1801 to S1802, which are described in detail as follows:
[0141] Step S1801: Parse the ledger identification information of the first ledger according to the coding rules of the ledger identification information to obtain multiple node identification information;
[0142] Step S1802: Determine, based on the inclusion relationship between the ledger identification information and the multiple node identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0143] That is, in an optional embodiment, the blockchain consensus node may parse the ledger identification information of the first ledger according to the encoding rules of the ledger identification information to obtain multiple node identification information, and then determine the second ledger whose ledger identification information includes the ledger identification information of the first ledger, and the second blockchain node corresponding to the second ledger based on the inclusion relationship between the ledger identification information and the multiple node identification information.
[0144] In this way, by using the encoding rules of the ledger identification information, the second ledger of the second blockchain node where the transaction data to be uploaded is to be written can be quickly and accurately determined.
[0145] In one embodiment of the present application, the encoding rule includes the number of encoding bits corresponding to each blockchain node; see Figure 19 The process of parsing the ledger identification information of the first ledger according to the encoding rules of the ledger identification information in step S1801 to obtain multiple node identification information may include steps S1901 to S1902, which are described in detail as follows:
[0146] Step S1901: split the account book identification information of the first account book according to the number of coding bits to obtain multiple coding fields;
[0147] Step S1902: perform identification processing on the multiple coding fields respectively to obtain identification results corresponding to the multiple coding fields, and use the identification results corresponding to the multiple coding fields as multiple node identification information.
[0148] That is, in an optional embodiment, the blockchain consensus node can split the ledger identification information of the first ledger based on the number of coded bits to obtain multiple coded fields, then perform identification processing on each of the multiple coded fields to obtain identification results corresponding to the multiple coded fields, and use the identification results corresponding to the multiple coded fields as multiple node identification information. In an optional embodiment, when managing ledger identification information, the blockchain consensus node pre-sets coded fields for each blockchain node. For example, as described in Table 1 above, the pre-set coded field corresponding to Business 1 is 01, the coded field corresponding to the General Administration Region is 000000, the coded field corresponding to Guangdong Province is 44, the coded field corresponding to Shenzhen City is 0300, the coded field corresponding to the company entity type is 02, the coded field corresponding to the company entity is "company", and the coded field corresponding to the individual entity is "tom".
[0149] In this way, by separately identifying and processing multiple coding fields, multiple node identification information can be obtained to provide support for the subsequent determination of a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0150] In one embodiment of the present application, the process of performing recognition processing on multiple coding fields respectively in step S1902 to obtain recognition results corresponding to the multiple coding fields may include the following steps:
[0151] According to the preset mapping relationship between blockchain nodes and coding fields, the blockchain nodes corresponding to multiple coding fields are determined respectively, and the blockchain nodes corresponding to the coding fields are used as the identification results corresponding to the coding fields.
[0152] That is, in an optional embodiment, a blockchain consensus node can obtain multiple encoding fields and then search for the blockchain node corresponding to each encoding field in the preset blockchain node-encoding field mapping relationship. The blockchain node corresponding to the encoding field is then the encoding field identification result. In this optional embodiment, the preset blockchain node-encoding field relationship is pre-set with multiple blockchain nodes and the encoding fields corresponding to the multiple blockchain nodes.
[0153] In this way, by presetting the mapping relationship between blockchain nodes and coding fields, the identification results corresponding to the coding fields can be obtained quickly and accurately, that is, multiple node identification information can be obtained quickly and accurately.
[0154] In one embodiment of the present application, before determining the blockchain nodes corresponding to the plurality of coding fields according to the preset mapping relationship between the blockchain nodes and the coding fields, the following steps may also be included:
[0155] Receive a setup request, the setup request carrying a name of a blockchain node and a code field matching the name of the blockchain node;
[0156] The name of the blockchain node and the encoding field that matches the name of the blockchain node are associated and stored to generate a preset mapping relationship between the blockchain node and the encoding field.
[0157] That is, in an optional embodiment, the process of generating a preset blockchain node-encoding field mapping relationship may be that the blockchain consensus node receives a setting request carrying the name of the blockchain node and the encoding field matching the blockchain node name, and then associates and stores the blockchain node name and the encoding field matching the blockchain node name, thereby generating a preset blockchain node-encoding field mapping relationship. In the optional embodiment, the setting request may be issued in any manner, including but not limited to input (text input, voice input), click, slide, selection, etc.
[0158] In this way, by associating and storing the name of the blockchain node corresponding to the setting request and the coding field that matches the name of the blockchain node, a preset blockchain node and coding field mapping relationship can be quickly and easily generated to provide support for obtaining the identification result corresponding to the coding field, that is, to provide support for obtaining multiple node identification information.
[0159] In one embodiment of the present application, there are multiple second ledgers, that is, there are multiple second blockchain nodes, and the relationship between the second blockchain nodes and the second ledgers is one-to-one.
[0160] In one embodiment of the present application, the inclusion relationship between account book identification information includes: the inclusion relationship between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals.
[0161] In one embodiment of the present application, see Figure 20 In step S1802, the process of determining, based on the inclusion relationship between the ledger identification information and the multiple node identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger, may include steps S2001 to S2002, which are described in detail as follows:
[0162] Step S2001: Select a target inclusion relationship from among inclusion relationships between management departments, inclusion relationships between management departments and enterprises, and inclusion relationships between enterprises and individuals, based on the account ownership information represented by the account identification information of the first account;
[0163] Step S2002: Determine the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain based on the target inclusion relationship and multiple node identification information.
[0164] That is, in an optional embodiment, the blockchain consensus node may select a target inclusion relationship from among the inclusion relationships between administrative departments, the inclusion relationships between administrative departments and enterprises, and the inclusion relationships between enterprises and individuals based on the account ownership information represented by the account identification information of the first account. Then, based on the target inclusion relationship and multiple node identification information, the blockchain consensus node may determine the second account of the second blockchain node to which the transaction data is to be written after being uploaded to the blockchain. In this optional embodiment, the target inclusion relationship refers to the inclusion relationship selected from among the inclusion relationships between administrative departments, the inclusion relationship between administrative departments and enterprises, and the inclusion relationship between enterprises and individuals.
[0165] In one embodiment of the present application, if the ledger identification information of the first ledger indicates that the first ledger belongs to the blockchain node corresponding to the management department, then the inclusion relationship between the management departments is selected as the target inclusion relationship from the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual; then, based on the inclusion relationship between the management departments, multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
[0166] In one embodiment of the present application, if the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the enterprise, the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual are selected as the target inclusion relationship; then, based on the inclusion relationship between the management departments and the inclusion relationship between the management department and the enterprise, multiple node identification information is combined to obtain the second account book of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
[0167] In one embodiment of the present application, if the ledger identification information of the first ledger indicates that the first ledger belongs to the blockchain node corresponding to the individual, then the inclusion relationship between the management departments, the inclusion relationship between the management departments and the enterprise, and the inclusion relationship between the enterprise and the individual are selected as the target inclusion relationship from the inclusion relationship between the management departments, the inclusion relationship between the management departments and the enterprise, and the inclusion relationship between the enterprise and the individual; then, based on the inclusion relationship between the management departments, the inclusion relationship between the management departments and the enterprise, and the inclusion relationship between the enterprise and the individual, multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
[0168] In one embodiment of the present application, see Figure 21 Before determining, in step S1802, the second ledger whose ledger identification information includes the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger based on the inclusion relationship between the ledger identification information and the multiple node identification information, steps S2101 to S2103 may also be included, which are described in detail as follows:
[0169] Step S2101, obtaining business type information corresponding to multiple blockchain nodes;
[0170] Step S2102: Grouping blockchain nodes belonging to the same type of business type information among the multiple business type information into a group to obtain multiple groups of blockchain nodes; wherein each group of blockchain nodes includes at least two blockchain nodes;
[0171] Step S2103: Generate ledger identification information corresponding to at least two blockchain nodes with an inclusion relationship.
[0172] That is, in an optional embodiment, a blockchain consensus node can obtain business type information corresponding to multiple blockchain nodes, then group the blockchain nodes belonging to the same business type information into a group, thereby obtaining multiple groups of blockchain nodes, each group of which includes at least two blockchain nodes. Ledger identification information corresponding to the at least two blockchain nodes is then generated, each containing a corresponding account. In this optional embodiment, the blockchain nodes in the same group correspond to the same business type, so the ledger identification information of the blockchain nodes in the same group has a containing relationship; in short, the business codes of the blockchain nodes in the same group are the same. For example, there are Group 1 and Group 2. Group 1 is for Business 1, and the ledger identification information of the ledgers corresponding to the multiple blockchain nodes it includes has a containing relationship. Group 2 is for Business 2, and the ledger identification information of the ledgers corresponding to the multiple blockchain nodes it includes has a containing relationship.
[0173] Step S803: Process the transaction data to be uploaded to the chain to obtain the transaction data after being uploaded to the chain.
[0174] In the embodiment of the present application, the process of determining the second ledger whose ledger identification information includes the ledger identification information of the first ledger, and the second blockchain node corresponding to the second ledger in steps S801 and S802 can be performed in parallel with the process of uploading the transaction data to be uploaded to the chain and obtaining the uploaded transaction data in step S803, or can be performed in any order.
[0175] In one embodiment of the present application, see Figure 22 In step S803, the process of processing the transaction data to be uploaded to the chain and obtaining the transaction data after being uploaded to the chain may include steps S2201 to S2202, which are described in detail as follows:
[0176] Step S2201: Verify and reach consensus on the transaction data to be uploaded to the blockchain.
[0177] Step S2202: If both the verification process and the consensus process are passed, the transaction data to be uploaded to the chain will be processed on the chain to obtain the transaction data after being uploaded to the chain.
[0178] That is, in an optional embodiment, the blockchain consensus node can perform verification processing and consensus processing on the transaction data to be uploaded to the chain. If both the verification processing and the consensus processing are passed, the transaction data to be uploaded to the chain will be uploaded to obtain the transaction data after being uploaded to the chain. If either the verification processing or the consensus processing fails, the chain processing will not be performed at this time.
[0179] In this way, only when the verification process and consensus process are passed, the transaction data to be uploaded to the chain will be processed on the chain to obtain the transaction data after being uploaded to the chain, thereby ensuring the security of the transaction data after being uploaded to the chain.
[0180] In one embodiment of the present application, see Figure 23 In step S2202, the transaction data to be uploaded to the chain is processed on the chain to obtain the transaction data after being uploaded to the chain. The process may include steps S2301 to S2303, which are described in detail as follows:
[0181] Step S2301: receiving signature data associated with the transaction data to be uploaded to the blockchain, sent by the first blockchain node;
[0182] Step S2302: Verify the transaction data to be uploaded to the blockchain based on the signature data.
[0183] Step S2303: If the verification process is passed, consensus processing is performed on the transaction data to be uploaded to the chain.
[0184] That is, in an optional embodiment, the blockchain consensus node can receive signature data associated with the transaction data to be uploaded to the chain sent by the first blockchain node, and then verify the transaction data to be uploaded to the chain based on the signature data. If the verification process passes, the transaction data to be uploaded to the chain will be subjected to consensus processing. If the verification process fails, the transaction data to be uploaded to the chain will not be subjected to consensus processing at this time.
[0185] In this way, consensus processing is performed on the on-chain transaction data only when the verification process is passed, which improves the efficiency of consensus processing and avoids the phenomenon of consensus processing failure caused by consensus processing before the verification process is passed.
[0186] Step S804: Send the transaction data after being uploaded to the chain to the first blockchain node, so that the first blockchain node writes the transaction data after being uploaded to the chain into the first ledger, and send the transaction data after being uploaded to the chain to the second blockchain node, so that the second blockchain node writes the transaction data after being uploaded to the chain into the second ledger.
[0187] In the embodiment of the present application, after determining a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger, the transaction data to be uploaded to the chain is uploaded to obtain the uploaded transaction data. Then, the uploaded transaction data can be sent to the first blockchain node. Accordingly, the first blockchain node writes the uploaded transaction data to the first ledger, and the uploaded transaction data is sent to the second blockchain node. Accordingly, the second blockchain node writes the uploaded transaction data to the second ledger.
[0188] In one embodiment of the present application, the transaction data after being uploaded to the blockchain also includes: the operation permission information of the second blockchain node, the operation permission information includes at least one of the read operation permission and the write operation permission; Figure 24 After sending the transaction data on the blockchain to the second blockchain node in step S804, the process may further include steps S2401 to S2403, which are described in detail as follows:
[0189] Step S2401: receiving a second call request for a second contract sent by a second blockchain node;
[0190] Step S2402: If the second call request satisfies the operation permission information, the execution of the second contract is triggered according to the second call request to perform the operation corresponding to the operation permission information on the on-chain transaction data, thereby obtaining the processed on-chain transaction data;
[0191] Step S2403: The account identification information of the second account book and the processed transaction data after being uploaded to the chain are associated and uploaded to the chain.
[0192] That is, in an optional embodiment, the blockchain consensus node receives a second call request for the second contract sent by the second blockchain node. If the second call request satisfies the operation authority information, the execution of the second contract can be triggered according to the second call request, so as to perform operation processing corresponding to the operation authority information on the transaction data after being uploaded to the chain, obtain the processed transaction data after being uploaded to the chain, and then associate the account identification information of the second account book and the processed transaction data after being uploaded to the chain for chain processing; if the second call request does not satisfy the operation authority information, the execution of the second contract will not be triggered at this time.
[0193] In this way, by matching the second call request with the corresponding operation permission information, the execution of the second contract is triggered according to the second call request only when the second call request satisfies the operation permission information, thereby realizing the operation processing corresponding to the operation permission information of the transaction data after being uploaded to the chain, and ensuring the security of the data.
[0194] In one embodiment of the present application, the second call request includes the first version information of the on-chain transaction data written into the second ledger; see Figure 25 In step S2402, if the second call request satisfies the operation permission information, the process of triggering the execution of the second contract according to the second call request may include steps S2501 to S2502, which are described in detail as follows:
[0195] Step S2501: Compare the first version information with the second version information of the transaction data stored in the blockchain system after being uploaded to the blockchain;
[0196] Step S2502: If the first version information matches the second version information, the execution of the second contract is triggered according to the second call request.
[0197] That is, in the optional embodiment, the second call request received by the blockchain consensus node includes the first version information of the post-on-chain transaction data written into the second ledger. Therefore, it can compare the first version information with the second version information of the post-on-chain transaction data stored in the blockchain system. If the first version information matches the second version information, the execution of the second contract is triggered according to the second call request. If the first version information does not match the second version information, the execution of the second contract is not triggered at this time.
[0198] In this way, by comparing version information, it is possible to avoid the situation where other blockchain nodes update the post-on-chain transaction data stored in the blockchain system, but the second blockchain node has not updated and still operates with the post-on-chain transaction data before the update, resulting in operation errors.
[0199] Figure 8 The embodiment shown is explained from the perspective of blockchain consensus node. Figure 26 The implementation details of the technical solution of the embodiment of this application are elaborated in detail from the perspective of the second blockchain node:
[0200] See also Figure 26 , Figure 26 This is a flowchart of a data processing method based on a blockchain system according to an embodiment of the present application. The data processing method based on a blockchain system can be executed by a second blockchain node in the blockchain system. Figure 26 As shown, the data processing method based on the blockchain system includes at least steps S2601 to S2602, which are described in detail as follows:
[0201] Step S2601: Receive transaction data after being uploaded to the blockchain. The transaction data after being uploaded to the blockchain is obtained by the blockchain consensus node by obtaining the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded to the blockchain, and determining, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and the second blockchain node corresponding to the second ledger, and then uploading the transaction data to be uploaded to the blockchain and sending it.
[0202] In the embodiment of the present application, the second blockchain node receives the post-on-chain transaction data sent by the blockchain consensus node. Specifically, the process of how the blockchain consensus node determines the second blockchain node can be found in the aforementioned embodiment and will not be repeated here.
[0203] In one embodiment of the present application, see Figure 27The process of receiving the transaction data on the chain in step S2601 may include the following steps S2701 to S2702, which are described in detail as follows:
[0204] Step S2701: Receive transaction data after being uploaded to the blockchain and generate notification information corresponding to the transaction data after being uploaded to the blockchain;
[0205] Step S2702: Display notification information so that the second blockchain node can determine the arrival of transaction data after being uploaded to the chain based on the notification information.
[0206] That is, in an optional embodiment, the second blockchain node can receive the post-chain transaction data, generate notification information corresponding to the post-chain transaction data, and display the notification information. The second blockchain node can determine that there is currently post-chain transaction data arriving based on the notification information.
[0207] In this way, through the reminder of the notification information, the second blockchain node can determine that the transaction data has arrived after being uploaded to the chain, and thus take corresponding actions to improve the timeliness of data processing.
[0208] Step S2602: Write the transaction data after being uploaded to the chain into the second account book.
[0209] In the embodiment of the present application, the second blockchain node receives the post-on-chain transaction data sent by the blockchain consensus node, and then can write the post-on-chain transaction data into the second account book.
[0210] In one embodiment of the present application, see Figure 28 Before receiving the transaction data on the blockchain in step S2601, steps S2801 to S2802 may also be included, as detailed below:
[0211] Step S2801: Receive a request for setting an account identification; wherein the request for setting an account identification carries account identification information;
[0212] In step S2802, a second ledger having the ledger identification information is obtained based on the ledger identification information; wherein the ledger identification information corresponding to ledgers of the same business type information on different blockchain nodes has an inclusion relationship.
[0213] That is, in an optional embodiment, the blockchain consensus node can actively send the ledger identification information. Accordingly, the second blockchain node receives the ledger identification setting request carrying the ledger identification information sent by the blockchain consensus node, and obtains the second ledger with the ledger identification information according to the ledger identification information, wherein the ledger identification information corresponding to the ledgers of the same type of business type information of different blockchain nodes has an inclusion relationship.
[0214] In this way, by receiving the ledger identification setting request carrying the ledger identification information sent by the blockchain consensus node, the second ledger with the ledger identification information can be obtained simply and quickly.
[0215] In one embodiment of the present application, see Figure 29 After writing the transaction data on the blockchain into the second ledger in step S2602, the process may further include steps S2901 to S2902, which are described in detail as follows:
[0216] Step S2901: Receive an operation request; wherein the operation request carries signature data;
[0217] In step S2902, if the signature data is verified, the specified operation is allowed to be performed on the transaction data written into the second ledger after being uploaded to the blockchain.
[0218] Specifically, in an optional embodiment, a second blockchain node can receive an operation request carrying signature data from another blockchain node and then verify the signature data. If the signature data verification passes, the specified operation is allowed to be performed on the post-online transaction data written to the second ledger. If the signature data verification fails, the specified operation is not allowed to be performed on the post-online transaction data written to the second ledger. The operations performed in this optional embodiment include, but are not limited to, viewing operations and obtaining operations. In actual applications, these operations can be flexibly adjusted according to specific application scenarios.
[0219] In this way, only when the signature data is verified, the specified operation is allowed to be performed on the transaction data written in the second ledger after being uploaded to the chain, ensuring the security of the data.
[0220] In the embodiment of the present application, since the blockchain node stores data associated with it instead of the full data, the problem of poor data security caused by the blockchain node storing the full data by bypassing the permission control is avoided; and since the amount of stored associated data is less than the amount of stored full data, the storage pressure of the blockchain node is reduced to a certain extent, saving storage space.
[0221] The following is a detailed description of a specific application scenario of the embodiment of the present application:
[0222] See also Figure 30It mainly includes a four-layer account book clearing structure, among which the next layer of the general management department is management department 1-3, the next layer of management department 1 is enterprise 1-3, the next layer of management department 3 is enterprise 1-3, the next layer of enterprise 1 under management department 1 is managers and individuals 1-2, among which administrators can manage individuals 1-2, the next layer of enterprise 2 under management department 3 is managers and individuals 1-2, among which administrators can manage individuals 1-2.
[0223] See also Figure 31 For Business 1, the next level below the general management department is the corresponding provincial management department, the next level below the provincial management department is the corresponding institution 1, and the next level below institution 1 is institutions A and B. For Business 2, the next level below the general management department is the corresponding provincial management department, the next level below the provincial management department is the corresponding institution 2, and the next level below institution 2 is institutions A and B. In these two businesses 1-2, the provincial management department clearing node can clear the transaction data after being uploaded to the chain to the provincial management department of Business 1, the provincial management department of Business 2, Institution 1, and Institution 2. In addition, multiple businesses can be expanded horizontally, with one business corresponding to a tree structure, and management departments, institutions, enterprises, individuals, etc. can be expanded vertically.
[0224] In the embodiment of this application, taking business 1 as an example, please refer to Table 1 again. The data processing process based on the blockchain system is as follows:
[0225] 1. The blockchain consensus node obtains the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded.
[0226] Optionally, the blockchain consensus node is the headquarters of Business 1 Management Center, and the first blockchain node is a company.
[0227] Alternatively, a company processes Business 1 in Shenzhen for employee tom, triggering transaction data for Business 1 to be uploaded to the blockchain. The structure of Business 1's transaction data includes the operator (the company) and the target (employee tom). The account identifier for the first ledger corresponding to the company is obtained as Fbus000144030002company000000000. The account identifier for the target's local ledger is also obtained as Fbus001044030002company000000tom.
[0228] 2. The blockchain consensus node determines, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0229] Optionally, based on the account book identification information of the first account book corresponding to a certain company and the inclusion relationship between the account book identification information, it is possible to determine the second account books Fbus00014403000000000000000000000000 and Fbus0001440000000000000000000000000, whose account book identification information includes the account book identification information of the first account book. The corresponding second blockchain nodes are Shenzhen Business 1 Management Center and Guangdong Business 1 Management Center, respectively. It is understandable that in this embodiment of the present application, a shared account book Fbus000100000000000000000000000000 can also be determined, which is used for writing the transaction data of Business 1 to be uploaded to the chain during subsequent on-chain processing.
[0230] 3. The blockchain consensus node processes the transaction data to be uploaded to the chain and obtains the transaction data after being uploaded to the chain.
[0231] Optionally, the headquarters of the Business 1 Management Center uploads the transaction data of Business 1 processed by a company for employee Tom to the chain. Specifically, the chain processing is written into the shared ledger Fbus00010000000000000000000000000, thereby obtaining the transaction data of Business 1 after being uploaded to the chain.
[0232] 4. The blockchain consensus node sends the transaction data after being uploaded to the chain to the first blockchain node, so that the first blockchain node writes the transaction data after being uploaded to the chain into the first ledger, and sends the transaction data after being uploaded to the chain to the second blockchain node, so that the second blockchain node writes the transaction data after being uploaded to the chain into the second ledger.
[0233] Optionally, the Business 1 Management Center headquarters will send the on-chain transaction data for Business 1 to a certain company, the Shenzhen Business 1 Management Center, and the Guangdong Business 1 Management Center. As will be appreciated, since the on-chain transaction data relates to the target entity, the Business 1 Management Center headquarters will also send the on-chain transaction data to the target entity. This way, the company, the Shenzhen Business 1 Management Center, the Guangdong Business 1 Management Center, and their employees can all view the corresponding Business 1 transaction data in their local ledgers.
[0234] Optionally, for other specific implementation processes, please refer to the aforementioned embodiments and will not be repeated here.
[0235] In the embodiment of the present application, a certain company, Shenzhen Business 1 Management Center, Guangdong Business 1 Management Center and employees all store data associated with them, but do not store the full data, that is, they do not store data about Business 1 of other cities and provinces as in the related art, thereby avoiding the problem of poor data security caused by the blockchain node bypassing permission control due to the storage of full data; and because the amount of stored associated data is less than the amount of stored full data, the storage pressure of a certain company, Shenzhen Business 1 Management Center, Guangdong Business 1 Management Center and employees is reduced to a certain extent, saving storage space.
[0236] Figure 32 This is a block diagram of a data processing device based on a blockchain system, as shown in one embodiment of the present application. Figure 32 As shown, the ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the device includes:
[0237] An acquisition module 3201 is configured to acquire a first ledger corresponding to a first blockchain node that triggers transaction data to be uploaded to the blockchain;
[0238] Determining module 3202 is configured to determine, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger;
[0239] The on-chain module 3203 is configured to process the transaction data to be on-chain and obtain the transaction data after on-chain;
[0240] The sending module 3204 is configured to send the transaction data after being uploaded to the chain to the first blockchain node, so that the first blockchain node writes the transaction data after being uploaded to the chain into the first ledger, and send the transaction data after being uploaded to the chain to the second blockchain node, so that the second blockchain node writes the transaction data after being uploaded to the chain into the second ledger.
[0241] In one embodiment of the present application, the determination module 3202 includes:
[0242] a parsing unit configured to parse the account identification information of the first account book according to an encoding rule of the account identification information to obtain a plurality of node identification information;
[0243] The determining unit is configured to determine, based on the inclusion relationship between the ledger identification information and the plurality of node identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0244] In one embodiment of the present application, the encoding rule includes the number of encoding bits corresponding to each blockchain node; the parsing unit is specifically configured as follows:
[0245] Split the account identification information of the first account book according to the number of code bits to obtain multiple code fields;
[0246] Recognition processing is performed on the multiple coding fields respectively to obtain recognition results corresponding to the multiple coding fields, and the recognition results corresponding to the multiple coding fields are used as multiple node identification information.
[0247] In one embodiment of the present application, the parsing unit is further specifically configured as follows:
[0248] According to the preset mapping relationship between blockchain nodes and coding fields, the blockchain nodes corresponding to multiple coding fields are determined respectively, and the blockchain nodes corresponding to the coding fields are used as the identification results corresponding to the coding fields; wherein, the preset blockchain node and coding field relationship is pre-set with multiple blockchain nodes, and the coding fields corresponding to the multiple blockchain nodes respectively.
[0249] In one embodiment of the present application, the parsing unit is further specifically configured as follows:
[0250] Receive a setup request, the setup request carrying a name of a blockchain node and a code field matching the name of the blockchain node;
[0251] The name of the blockchain node and the encoding field that matches the name of the blockchain node are associated and stored to generate a preset mapping relationship between the blockchain node and the encoding field.
[0252] In one embodiment of the present application, there are multiple second ledgers, and the inclusion relationships between the ledger identification information include: an inclusion relationship between management departments, an inclusion relationship between a management department and an enterprise, and an inclusion relationship between an enterprise and an individual; the determination unit is configured as follows:
[0253] According to the account ownership information represented by the account identification information of the first account, select a target inclusion relationship from among the inclusion relationships between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals;
[0254] According to the target inclusion relationship and multiple node identification information, the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain is determined.
[0255] In one embodiment of the present application, the determining unit is further specifically configured to:
[0256] If the ledger identification information of the first ledger indicates that the first ledger belongs to the blockchain node corresponding to the management department, then the inclusion relationship between the management departments is selected as the target inclusion relationship from the inclusion relationships between the management departments, the inclusion relationship between the management departments and the enterprise, and the inclusion relationship between the enterprise and the individual;
[0257] According to the inclusion relationship between the management departments, multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
[0258] In one embodiment of the present application, the determining unit is further specifically configured to:
[0259] If the ledger identification information of the first ledger indicates that the first ledger belongs to the blockchain node corresponding to the enterprise, then the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual are selected as the target inclusion relationship.
[0260] Based on the inclusion relationship between management departments and the inclusion relationship between management departments and enterprises, multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
[0261] In one embodiment of the present application, the determining unit is further specifically configured to:
[0262] If the ledger identification information of the first ledger indicates that the first ledger belongs to the blockchain node corresponding to the individual, then the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual are selected as the target inclusion relationship from the inclusion relationships between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual;
[0263] Based on the inclusion relationship between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals, multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
[0264] In one embodiment of the present application, the apparatus further comprises:
[0265] An acquisition unit, configured to acquire business type information corresponding to multiple blockchain nodes;
[0266] A dividing unit is configured to divide the blockchain nodes belonging to the same type of business type information in the multiple business type information into a group to obtain multiple groups of blockchain nodes; wherein each group of blockchain nodes includes at least two blockchain nodes;
[0267] The generating unit is configured to generate ledger identification information corresponding to at least two blockchain nodes and having an inclusion relationship.
[0268] Figure 33 This is a block diagram of a data processing device based on a blockchain system, as shown in one embodiment of the present application. Figure 33 As shown, the ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the device includes:
[0269] Receiving module 3301 is configured to receive transaction data after being uploaded to the blockchain; wherein the transaction data after being uploaded to the blockchain is obtained by the blockchain consensus node obtaining the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded to the blockchain, and determining, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger, and then processing the transaction data to be uploaded to the blockchain and sending it;
[0270] The writing module 3302 is configured to write the transaction data after being uploaded to the chain into the second ledger.
[0271] In one embodiment of the present application, the apparatus further comprises:
[0272] A first receiving unit is configured to receive a ledger identification setting request, wherein the ledger identification setting request carries ledger identification information;
[0273] The obtaining unit is configured to obtain a second ledger having the ledger identification information according to the ledger identification information; wherein the ledger identification information corresponding to the ledgers of the same type of business type information on different blockchain nodes has an inclusion relationship.
[0274] In one embodiment of the present application, the apparatus further comprises:
[0275] a second receiving unit configured to receive an operation request for the on-chain transaction data written into the second ledger; wherein the operation request carries signature data;
[0276] The execution unit is configured to allow a specified operation to be performed on the on-chain transaction data written in the second ledger if the verification of the signature data is passed.
[0277] 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 and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0278] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the data processing method based on the blockchain system as described above.
[0279] Figure 34 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown.
[0280] It should be noted that Figure 34 The computer system 3400 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.
[0281] like Figure 34 As shown, computer system 3400 includes a central processing unit (CPU) 3401, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 3402 or programs loaded from storage unit 3408 into random access memory (RAM) 3403, such as executing the methods in the above embodiments. Various programs and data required for system operation are also stored in RAM 3403. CPU 3401, ROM 3402, and RAM 3403 are connected to each other via bus 3404. Input / output (I / O) interface 3405 is also connected to bus 3404.
[0282] The following components are connected to the I / O interface 3405: an input section 3406 including a keyboard, a mouse, and the like; an output section 3407 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 3408 including a hard disk and the like; and a communication section 3409 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 3409 performs communication processing via a network such as the Internet. A drive 3410 is also connected to the I / O interface 3405 as needed. Removable media 3411, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 3410 as needed, so that computer programs read from the removable media can be installed in the storage section 3408 as needed.
[0283] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart 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 includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 3409, and / or installed from a removable medium 3411. When the computer program is executed by the central processing unit (CPU) 3401, the various functions defined in the system of the present application are executed.
[0284] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, 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), 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 baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0285] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that 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 flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0286] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0287] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the aforementioned data processing method based on a blockchain system. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device.
[0288] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data processing method based on the blockchain system provided in each of the above embodiments.
[0289] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A data processing method based on a blockchain system, characterized in that: The ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the method includes: Obtaining the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded to the chain; Determining, based on the account identification information of the first account book and the inclusion relationship between the account identification information, a second account book whose account identification information includes the account identification information of the first account book, and a second blockchain node corresponding to the second account book; Processing the transaction data to be uploaded to the chain to obtain the transaction data after being uploaded to the chain; The transaction data after being uploaded to the chain is sent to the first blockchain node, so that the first blockchain node writes the transaction data after being uploaded to the first ledger, and the transaction data after being uploaded to the chain is sent to the second blockchain node, so that the second blockchain node writes the transaction data after being uploaded to the second ledger.
2. The method according to claim 1, wherein The determining, based on the account identification information of the first account book and the inclusion relationship between the account identification information, a second account book whose account identification information includes the account identification information of the first account book, and a second blockchain node corresponding to the second account book, includes: Parsing the account identification information of the first account book according to the encoding rules of the account identification information to obtain multiple node identification information; Based on the inclusion relationship between the ledger identification information and the multiple node identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger are determined.
3. The method according to claim 2, wherein The encoding rule includes the number of encoding bits corresponding to each blockchain node; the encoding rule of the ledger identification information is used to parse the ledger identification information of the first ledger to obtain multiple node identification information, including: Splitting the account identification information of the first account book according to the number of encoding bits to obtain multiple encoding fields; Identification processing is performed on the multiple coding fields respectively to obtain identification results corresponding to the multiple coding fields, and the identification results corresponding to the multiple coding fields are used as the multiple node identification information.
4. The method according to claim 3, wherein The performing identification processing on the multiple coding fields respectively to obtain identification results corresponding to the multiple coding fields includes: According to the preset mapping relationship between blockchain nodes and coding fields, the blockchain nodes corresponding to the multiple coding fields are determined respectively, and the blockchain nodes corresponding to the coding fields are used as the identification results corresponding to the coding fields; wherein, the preset blockchain node and coding field relationship is pre-set with multiple blockchain nodes, and the coding fields corresponding to the multiple blockchain nodes respectively.
5. The method according to claim 4, wherein Before determining the blockchain nodes corresponding to the plurality of coding fields according to the preset mapping relationship between blockchain nodes and coding fields, the method further includes: Receive a setup request, the setup request carrying a name of a blockchain node and a code field matching the name of the blockchain node; The name of the blockchain node and the coding field that matches the name of the blockchain node are associated and stored to generate the mapping relationship between the preset blockchain node and the coding field.
6. The method according to claim 2, wherein There are multiple second ledgers, and the inclusion relationships between the ledger identification information include: an inclusion relationship between management departments, an inclusion relationship between a management department and an enterprise, and an inclusion relationship between an enterprise and an individual; determining the second ledger of the second blockchain node to which the to-be-uploaded transaction data is to be written based on the inclusion relationship between the ledger identification information and the multiple node identification information includes: selecting, based on the account ownership information represented by the account identification information of the first account, a target inclusion relationship from among the inclusion relationships between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals; According to the target inclusion relationship and the multiple node identification information, the second ledger of the second blockchain node to which the transaction data after being uploaded to the chain is to be written is determined.
7. The method according to claim 6, wherein The selecting, based on the account ownership information represented by the account identification information of the first account, a target inclusion relationship from among the inclusion relationships between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals, includes: If the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the management department, then selecting the inclusion relationship between the management departments as the target inclusion relationship from among the inclusion relationships between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual; The determining, based on the target inclusion relationship and the plurality of node identification information, the second ledger of the second blockchain node into which the transaction data is to be written after being uploaded to the blockchain comprises: According to the inclusion relationship between the management departments, the multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data after being uploaded to the chain is to be written.
8. The method according to claim 6, wherein The selecting, based on the account ownership information represented by the account identification information of the first account, a target inclusion relationship from among the inclusion relationships between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals, includes: If the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the enterprise, then selecting the inclusion relationship between the management departments and the inclusion relationship between the management department and the enterprise as the target inclusion relationship from the inclusion relationships between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual; The determining, based on the target inclusion relationship and the plurality of node identification information, the second ledger of the second blockchain node into which the transaction data is to be written after being uploaded to the blockchain comprises: According to the inclusion relationship between the management departments and the inclusion relationship between the management departments and the enterprises, the multiple node identification information is combined to obtain the second ledger of the second blockchain node to which the transaction data is to be written after being uploaded to the chain.
9. The method according to claim 6, wherein The selecting, based on the account ownership information represented by the account identification information of the first account, a target inclusion relationship from among the inclusion relationships between management departments, the inclusion relationship between management departments and enterprises, and the inclusion relationship between enterprises and individuals, includes: If the account identification information of the first account book indicates that the first account book belongs to the blockchain node corresponding to the individual, selecting the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual as the target inclusion relationship from the inclusion relationship between the management departments, the inclusion relationship between the management department and the enterprise, and the inclusion relationship between the enterprise and the individual; The determining, based on the target inclusion relationship and the plurality of node identification information, the second ledger of the second blockchain node into which the transaction data is to be written after being uploaded to the blockchain comprises: According to the inclusion relationship between the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and individuals, the multiple node identification information is combined to obtain a second ledger of the second blockchain node to which the transaction data after being uploaded to the chain is to be written.
10. The method according to any one of claims 1 to 9, characterized in that Before determining the second ledger of the second blockchain node to which the to-be-uploaded transaction data is to be written based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, the method further includes: Obtain business type information corresponding to multiple blockchain nodes; Dividing the blockchain nodes belonging to the same type of business type information in the multiple business type information into a group to obtain multiple groups of blockchain nodes; wherein each group of blockchain nodes includes at least two blockchain nodes; Generate ledger identification information corresponding to the at least two blockchain nodes and having an inclusion relationship.
11. A data processing method based on a blockchain system, characterized in that: The ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the method includes: Receiving transaction data after being uploaded to the chain; wherein the transaction data after being uploaded to the chain is obtained by the blockchain consensus node by obtaining the first ledger corresponding to the first blockchain node that triggers the transaction data to be uploaded to the chain, and determining, based on the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information, a second ledger whose ledger identification information includes the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger, and then uploading the transaction data to be uploaded to the chain and sending it; The transaction data after being uploaded to the chain is written into the second account book.
12. The method according to claim 11, wherein Before receiving the transaction data on the chain, the method further includes: Receive a ledger identification setting request; wherein the ledger identification setting request carries ledger identification information; A second ledger having the ledger identification information is obtained according to the ledger identification information; wherein the ledger identification information corresponding to ledgers of the same type of business type information on different blockchain nodes has an inclusion relationship.
13. The method according to claim 11, wherein After writing the on-chain transaction data into the second account book, the method further includes: Receiving an operation request for the on-chain transaction data written into the second ledger; wherein the operation request carries signature data; If the signature data is verified, the specified operation is allowed to be performed on the post-on-chain transaction data written in the second ledger.
14. A data processing device based on a blockchain system, characterized in that: The ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the device includes: An acquisition module configured to acquire a first ledger corresponding to a first blockchain node that triggers transaction data to be uploaded to the blockchain; a determination module configured to determine, based on the account identification information of the first account book and the inclusion relationship between the account identification information, a second account book whose account identification information includes the account identification information of the first account book, and a second blockchain node corresponding to the second account book; The on-chain module is configured to process the transaction data to be on-chain and obtain the transaction data after on-chain; The sending module is configured to send the transaction data after being uploaded to the chain to the first blockchain node, so that the first blockchain node writes the transaction data after being uploaded to the chain into the first account book, and send the transaction data after being uploaded to the chain to the second blockchain node, so that the second blockchain node writes the transaction data after being uploaded to the chain into the second account book.
15. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the electronic device, enables the electronic device to implement the data processing method based on the blockchain system as described in any one of claims 1 to 13.
16. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method based on the blockchain system according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Blockchain-based private transaction method and apparatus
WO2020259156A1
Data storage and query
WO2021208762A1