Data processing method and device based on blockchain system, equipment and medium
By introducing ledger identification information into the blockchain system, the problems of difficulty in assigning responsibility and low management efficiency in blockchain node data collaboration are solved, enabling rapid responsibility assignment and storage optimization, and improving the efficiency and security of data collaboration management.
Patent Information
- Application Number
- CN202210148918.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-02-17
AI Technical Summary
When existing blockchain nodes collaborate on data, centralized collaboration methods pose a risk of malicious actions by intermediaries, while decentralized collaboration methods may lead to data loss, leakage, and difficulty in assigning responsibility, resulting in high difficulty and low efficiency in data collaboration management.
By introducing ledger identification information into the blockchain system, the ledger identification information of the data source and destination is identified and associated with the data on the chain. This ensures that the data stored on the blockchain node is the data associated with that node, rather than the full data, thereby enabling rapid accountability and improving management efficiency.
It enables the rapid and accurate identification of responsible parties during data collaboration, reduces the management difficulty of data collaboration, improves management efficiency, and reduces the storage pressure and data security risks of blockchain nodes.
Smart Images

Figure CN116668029B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a data processing method and device based on a blockchain system, an electronic device and a computer readable storage medium. BACKGROUND
[0002] In the related art, when a blockchain node performs data collaboration, two ways are mainly used, including:
[0003] One is a centralized collaboration method, in which a data provider transmits data to a centralized intermediary, and then the intermediary transmits the data to a data user. However, if the intermediary is malicious, it may leak or tamper with the data, and the security of the data cannot be guaranteed. In addition, when a problem occurs, it is difficult to locate the responsible party, and the management of data collaboration is difficult.
[0004] The other is a decentralized collaboration method, in which data is only transmitted between a data provider and a data user. Although this method can avoid the problem of intermediary malpractice, it may still have problems such as data loss, leakage, tampering, etc. Once a problem occurs, it is also difficult to locate the responsible party, and the management of data collaboration is difficult.
[0005] Therefore, how to reduce the management difficulty of data collaboration to improve the management efficiency of data collaboration is a problem to be solved. SUMMARY
[0006] To solve the above technical problems, 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 at least reducing the management difficulty of data collaboration and improving the management efficiency of data collaboration.
[0007] According to an aspect of an embodiment of the present application, a data processing method based on a blockchain system is provided. A ledger maintained by a blockchain node in the blockchain system has ledger identification information. The method comprises: obtaining a first ledger corresponding to a first blockchain node triggering to-be-chained transaction data; determining, according to ledger identification information of the first ledger and a containing relationship between the ledger identification information, a second ledger whose ledger identification information contains the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger; performing associated chaining processing on the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data to obtain chained transaction data; sending the chained transaction data to the first blockchain node, so that the first blockchain node writes the chained transaction data into the first ledger; and sending the chained transaction data to the second blockchain node, so that the second blockchain node writes the chained transaction data into the second ledger.
[0008] According to an aspect of an embodiment of the present application, a data processing method based on a blockchain system is provided. A ledger maintained by a blockchain node in the blockchain system has ledger identification information. The method comprises: receiving chained transaction data; wherein the chained transaction data is obtained by a blockchain consensus node obtaining a first ledger corresponding to a first blockchain node triggering to-be-chained transaction data, determining, according to ledger identification information of the first ledger and a containing relationship between the ledger identification information, a second ledger whose ledger identification information contains the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger, and performing associated chaining processing on the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data to obtain and send the chained transaction data; and writing the chained transaction data into the second ledger.
[0009] According to an aspect of an embodiment of the present application, a data processing apparatus based on a blockchain system is provided. A ledger maintained by a blockchain node in the blockchain system has ledger identification information. The apparatus includes: an obtaining module configured to obtain a first ledger corresponding to a first blockchain node triggering to-be-chained transaction data; a determining module configured to determine, according to the ledger identification information of the first ledger and a containing relationship between the ledger identification information, a second ledger whose ledger identification information contains the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger; a chaining module configured to perform associated chaining processing on the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data to obtain chained transaction data; and a sending module configured to send the chained transaction data to the first blockchain node, so that the first blockchain node writes the chained transaction data into the first ledger, and send the chained transaction data to the second blockchain node, so that the second blockchain node writes the chained transaction data into the second ledger.
[0010] In an embodiment of the present application, based on the foregoing scheme, the apparatus further includes: a first receiving unit configured to receive an addition request sent by the second blockchain node; wherein the addition request includes ledger identification information of a second ledger of the second blockchain node; and an adding unit configured to add the second blockchain node on the blockchain system according to the ledger identification information of the second ledger.
[0011] In an embodiment of the present application, based on the foregoing scheme, the adding unit is specifically configured to: register the second blockchain node on the blockchain system according to the ledger identification information of the second ledger, and obtain a registered on-chain address; and associate the ledger identification information of the second ledger with the on-chain address to obtain an association result, so as to complete the addition of the second blockchain node.
[0012] In an embodiment of the present application, based on the foregoing scheme, the apparatus further includes: a second receiving unit configured to receive a ledger identification allocation request sent by the second blockchain node; a generating unit configured to generate ledger identification information matched with the second blockchain node according to the ledger identification allocation request; and a sending unit configured to send the ledger identification information matched with the second blockchain node to the second blockchain node, so that the second blockchain node obtains a second ledger having the ledger identification information matched with the second blockchain node.
[0013] In an embodiment of the present application, based on the foregoing scheme, the device further comprises: a third receiving unit configured to receive a first invocation request for the first contract sent by the first blockchain node; and a first triggering unit configured to trigger execution of the first contract according to the first invocation request to generate the to-be-chained transaction data.
[0014] In an embodiment of the present application, based on the foregoing scheme, the chained transaction data further comprises: operation permission information of the second blockchain node, the operation permission information comprising at least one of read operation permission and write operation permission; the device further comprises: a fourth receiving unit configured to receive a second invocation request for a second contract sent by the second blockchain node; a second triggering unit configured to, if the second invocation request satisfies the operation permission information, trigger execution of the second contract according to the second invocation request to perform operation processing corresponding to the operation permission information on the chained transaction data to obtain processed chained transaction data; and a chaining unit configured to perform association and chaining processing on the ledger identifier information of the second ledger and the processed chained transaction data.
[0015] In an embodiment of the present application, based on the foregoing scheme, the second invocation request comprises first version information of the chained transaction data written into the second ledger; and the second triggering unit is specifically configured to: compare the first version information with second version information of the chained transaction data stored by the blockchain system; and if the first version information matches the second version information, trigger execution of the second contract according to the second invocation request.
[0016] In an embodiment of the present application, based on the foregoing scheme, the chaining module comprises: a verification and consensus unit configured to perform verification processing and consensus processing on the to-be-chained transaction data; and a chaining unit configured to, if the verification processing and the consensus processing are both passed, perform association and chaining processing on the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data to obtain chained transaction data.
[0017] In an embodiment of the present application, based on the foregoing scheme, the verification and consensus unit is specifically configured to: receive signature data associated with the to-be-chained transaction data sent by the first blockchain node; perform verification processing on the to-be-chained transaction data according to the signature data; and if the verification processing is passed, perform consensus processing on the to-be-chained transaction data.
[0018] According to an aspect of some embodiments of the present application, a data processing apparatus based on a blockchain system is provided. A ledger maintained by a blockchain node in the blockchain system has ledger identification information. The apparatus comprises: a receiving module configured to receive chained transaction data; wherein the chained transaction data is obtained by a blockchain consensus node triggering a first ledger corresponding to a first blockchain node of to-be-chained transaction data, determining a second ledger whose ledger identification information contains the ledger identification information of the first ledger and the second ledger corresponding to a second blockchain node according to the ledger identification information of the first ledger and the containing relationship between the ledger identification information, and sending the chained transaction data obtained after the first ledger identification information, the second ledger identification information, and the to-be-chained transaction data are associated and chained; and a writing module configured to write the chained transaction data into the second ledger.
[0019] In an embodiment of the present application, based on the foregoing scheme, the receiving module comprises: a receiving and generating unit configured to receive chained transaction data and generate notification information corresponding to the chained transaction data; and a display unit configured to display the notification information to enable the second blockchain node to determine that there is chained transaction data arriving according to the notification information.
[0020] In an embodiment of the present application, based on the foregoing scheme, the apparatus further comprises: a receiving unit configured to receive an operation request for the chained transaction data written in the second ledger; wherein the operation request carries signature data; and an execution unit configured to allow a specified operation to be performed on the chained transaction data written in the second ledger if the signature data passes the verification.
[0021] According to an aspect of some embodiments of the present application, an electronic device is provided, comprising one or more processors; a storage apparatus configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the data processing method based on the blockchain system as described above.
[0022] According to an aspect of some embodiments of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the data processing method based on the blockchain system as described above.
[0023] According to an aspect of some embodiments of the present application, a computer program product is provided, comprising computer instructions which, when executed by a processor, implement the data processing method based on the blockchain system as described above.
[0024] In the technical scheme provided in the embodiments of the present application:
[0025] By determining the first account book corresponding to the first blockchain node initiating the contract calling request, i.e., determining the data source (also referred to as the data provider), and determining the second account book corresponding to the second blockchain node to which the to-be-chained transaction data is to be written, i.e., determining the data destination (also referred to as the data user), and associating and chaining the identification information of the first account book corresponding to the data source, the identification information of the second account book corresponding to the data destination, and the to-be-chained transaction data, the to-be-chained transaction data is obtained. In this way, if a problem occurs in the data cooperation process, the responsible party can be quickly and accurately located according to the identification information of the first account book and / or the identification information of the second account book in the to-be-chained transaction data, thereby facilitating the management of data cooperation, reducing the difficulty of data cooperation, and improving the management efficiency of data cooperation.
[0026] By sending / channelling the to-be-chained transaction data to the account books 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 node, the data associated therewith is stored, and the full amount of data is not stored, thereby avoiding the problem of poor data security caused by storing the full amount of data and bypassing the permission control by the blockchain node; on the other hand, since the amount of data of the stored associated data is less than the amount of data of the stored full amount of data, the storage pressure of the blockchain node is also reduced to a certain extent, and the storage space is saved.
[0027] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained from these drawings without creative labor for those skilled in the art. In the drawings:
[0029] Figure 1 is a structural schematic diagram of a blockchain network;
[0030] Figure 2 is a connection relationship schematic diagram of blocks in a blockchain;
[0031] Figure 3 is a process schematic diagram of generating a block;
[0032] Figures 4 to 6 is a system architecture diagram of a blockchain system to which the embodiments of the present application are applied;
[0033] 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;
[0034] Figure 8 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0035] Figure 9 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0036] Figure 10 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0037] Figure 11 is Figure 10 is a flowchart of step S1002 in the embodiment shown in FIG. 10;
[0038] Figure 12 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0039] Figure 13 is a schematic diagram of the constitution of ledger identification information according to an exemplary embodiment of the present application;
[0040] Figure 14 is a schematic diagram of the constitution of ledger identification information according to an exemplary embodiment of the present application;
[0041] Figure 15 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0042] Figure 16 is Figure 15 is a flowchart of step S1502 in the embodiment shown in FIG. 15;
[0043] Figure 17 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0044] Figure 18 is Figure 8 is a flowchart of step S802 in the embodiment shown in FIG. 8;
[0045] Figure 19 is Figure 18 is a flowchart of step S1801 in the embodiment shown in FIG. 18;
[0046] Figure 20 is Figure 18Step S1802 in the illustrated embodiment is a flowchart in an exemplary embodiment;
[0047] Figure 21 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0048] Figure 22 is Figure 8 Step S803 in the illustrated embodiment is a flowchart in an exemplary embodiment;
[0049] Figure 23 is Figure 22 Step S2202 in the illustrated embodiment is a flowchart in an exemplary embodiment;
[0050] Figure 24 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0051] Figure 25 is Figure 24 Step S2402 in the illustrated embodiment is a flowchart in an exemplary embodiment;
[0052] Figure 26 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0053] Figure 27 is Figure 26 Step S2601 in the illustrated embodiment is a flowchart in an exemplary embodiment;
[0054] Figure 28 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0055] Figure 29 is a flowchart of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0056] Figure 30 is a schematic diagram of a data processing method based on a blockchain system according to an exemplary embodiment of the present application;
[0057] Figure 31 is a block diagram of a data processing apparatus based on a blockchain system according to an exemplary embodiment of the present application;
[0058] Figure 32 is a block diagram of a data processing apparatus based on a blockchain system according to an exemplary embodiment of the present application;
[0059] Figure 33is a structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0060] The exemplary embodiments will be described in detail herein below with reference to the drawings. In the following description, the same numbers in different drawings represent the same or similar elements unless otherwise represented. The implementations described in the following exemplary embodiments are not meant to represent all implementations in which one could practice the present application. Rather, they are merely examples of apparatuses and methods in accordance with some aspects of the present application as detailed in the appended claims.
[0061] The block diagrams shown in the drawings are merely functional entities, and do not necessarily have to correspond to physically independent entities. That is, the functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0062] The flowcharts shown in the drawings are merely exemplary illustrations, and do not necessarily include all contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be further divided, and some operations / steps can be combined or partially combined, so that the actual execution order can be changed depending on the actual situation.
[0063] It should be noted that "a plurality of" as mentioned in the present application means two or more. The association relationship of "and / or" describes the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally means that the associated objects before and after it are in an "or" relationship.
[0064] Before introducing the technical solutions of the embodiments of the present application, the blockchain technology used in the embodiments of the present application is introduced.
[0065] The blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, and other computer technologies. The blockchain is essentially a decentralized database, which is a series of data blocks (i.e., blocks) associated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-fake) and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0066] As mentioned above, the blockchain is essentially a decentralized database, and the blockchain is maintained by the nodes in the blockchain network. For example, please refer to Figure 1 , in Figure 1The blockchain network shown can include a plurality of nodes 101, which can be various clients forming the blockchain network. Each node 101 can receive input information during normal operation and maintain shared data within the blockchain network based on the received input information. To ensure information exchange within the blockchain network, each node in the blockchain network can have an information connection between nodes, and information can be transmitted between nodes through the information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network obtain the input information according to a consensus algorithm, store the input information as shared data, and ensure that the data stored on all nodes in the blockchain network is consistent.
[0067] Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes to subsequently broadcast generated blocks to other nodes in the blockchain network according to the node identifiers of the other nodes. Each node can maintain a node identifier list, and the node name and node identifier are stored in the node identifier list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node.
[0068] Each node in the blockchain network stores a same blockchain. The blockchain is composed of a plurality of blocks, as shown in Figure 2 The blockchain is composed of a plurality of blocks, the genesis block includes a block header and a block body, the block header stores an input information feature value, a version number, a timestamp, and a difficulty value, and the block body stores input information; the next block of the genesis block takes the genesis block as the parent block, 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 of the parent block, the version number, the timestamp, and the difficulty value, 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.
[0069] When generating each block in the blockchain, please refer to Figure 3The node where the blockchain is located checks the input information when receiving the input information, stores the input information into the memory pool after completing the checking, and updates the hash tree used for recording the input information; then, the update time stamp is updated as the time when the input information is received, and different random numbers are tried to perform feature value calculation multiple times, when the random number meeting the condition is calculated, the information is stored correspondingly to generate the block header and the block body, and the current block is obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in the data sharing system according to the node identifiers of the other nodes in the data sharing system, and the other nodes check the newly generated block and add the newly generated block to the stored blockchain after completing the checking. The node can perform consensus checking on the newly generated block through a consensus algorithm, and the consensus algorithm can include but is not limited to: Pow (Proof of Work, proof of work), Pos (proof of stake, proof of stake), DPos (Delegated Proof of Stake, delegated proof of stake) share authorization proof mechanism, PBFT (Practical Byzantine Fault Tolerance, Byzantine Fault Tolerance algorithm), Paxos (a distributed algorithm) algorithm, and Raft (a distributed consensus algorithm) algorithm.
[0070] Optionally, each node in the blockchain network can be a server or a terminal device. The server can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Networks), and basic cloud computing services such as big data and intelligent platforms. The terminal device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart home, a vehicle-mounted terminal, and the like, but is not limited thereto. Each node can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0071] The aforementioned cloud computing refers to a delivery and use mode of IT infrastructure, specifically refers to obtaining required resources in a scalable manner on demand through a network; the broad sense of cloud computing refers to a delivery and use mode of services, specifically refers to obtaining required services in a scalable manner on demand through a network. Such services can be IT and software, Internet related, or other services. Cloud computing is a product of the development of grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, load balancing and other traditional computer and network technologies. With the development of the Internet, real-time data flow, and the diversification of connected devices, and the promotion of search services, social networks, mobile commerce and open collaboration, cloud computing has developed rapidly. Unlike previous parallel distributed computing, the generation of cloud computing will revolutionize the entire Internet model and enterprise management model from a conceptual point of view.
[0072] Based on the blockchain technology, the embodiments of the present application propose a system architecture of a blockchain system. As shown in Figure 4 The blockchain system includes a consensus network 2 and a business network 1 (also referred to as a witness network). The consensus network 2 includes a consensus node 21 that performs consensus on a data block and records the data block on a blockchain. The business network 1 includes a business node 11 that can verify the data block recorded on the blockchain by the consensus node 21, or can request the corresponding transaction data from the consensus node 21. It can be understood that the node 101 involved in the foregoing Figure 1 may be the consensus node 21 or the business node 11.
[0073] Specifically, the verification of the data block recorded on the blockchain by the consensus node 21 by the business node 11 can include the following steps: one of the consensus nodes 21 in the 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 the consensus node 21; the consensus node 21 adds the transaction information and the generated signature to the data block and adds it to the blockchain; the consensus node 21 sends the signature to the business node 11 in the business network 1, and the business node 11 verifies the signature according to the key specific to the consensus node 21 to achieve the verification of the data block recorded on the blockchain by the consensus node 21 by the business node 11. The consensus nodes 21 in the consensus network 2 are responsible for recording data blocks on the blockchain, and the business nodes 11 in the business network 1 are responsible for witnessing the results recorded by the consensus nodes 21. Specifically, the consensus node 21 generates a signature based on the transaction information to be included in a data block to be added to the blockchain, and then adds the transaction information and the generated signature to the data block for on-chain. And send the signature to the business node 11 in the business network 1, so that the business node 11 verifies the signature according to the key specific to the consensus node 21. The business node 11 in the business network 1 can witness all network transaction data by verifying the signature of the consensus node 21 on the block. Although the consensus network 2 has a monopoly on record-keeping, because the data block has a digital signature representing the identity of the record-keeper, all activities are open and traceable. If the consensus nodes 21 collectively commit fraud, all nodes in the business network 1 will retain evidence of the specific consensus node 21 committing fraud. Compared with traditional centralized systems and private chains, the operation of the system in the embodiment of the application is more transparent; and compared with traditional decentralized solutions, the present solution is more controllable and more conducive to regulation.
[0074] In an embodiment of the present application, the consensus network 2 and the business network 1 can be connected through a proxy node 12, which can be a business node 11 of the business network 1 responsible for delivering information from the consensus node 21 to the business node 11. The business node 11 is the terminal of the transaction party generating various transaction data to be on-chain, and can also be the terminal for querying 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 regulation of transaction data, and the business node 11 can also supervise and witness the on-chain transaction data through the information sent by the consensus node 21 through the proxy node 12, which has great significance in some scenarios that require unified regulation but are afraid of collective fraud by the nodes to be supervised.
[0075] In Figure 4In the architecture of the blockchain system shown, the business network 1 adopts a P2P (Peer to Peer) network mode. The P2P network is a distributed application architecture that distributes tasks and workloads among peers, and is a networking or network form formed by the peer-to-peer computing model in the application layer, i.e., a "point-to-point" or "end-to-end" network. It can be defined as: participants in the network share a part of the hardware resources (processing power, storage capacity, network connection capacity, printers, etc.) they own, and these shared resources provide services and content through the network, which can be directly accessed by other peer nodes without going through intermediate entities. In this network, participants are both providers of resources, services and content, and acquirers of resources, services and content. Therefore, in the business network 1, when the agent node 12 receives the message delivered from the consensus node 21, it propagates to the surrounding business nodes 11, and the surrounding business nodes 11 receive the message and deliver it to the surrounding business nodes 11, achieving the propagation of the message among each business node 11 in the business network 1.
[0076] Figure 5 Another architecture of a blockchain system to which embodiments of the present application are applied is shown. The architecture is different from the architecture shown in Figure 4 in that: in the business network 1, the P2P network mode is not adopted, but a broadcast network mode is adopted. Specifically, after receiving the message delivered from the consensus node 21, the agent node 12 broadcasts the message to other business nodes 11 in the business network 1. In this way, the propagation of the message among each business node 11 in the business network 1 is also achieved.
[0077] Figure 6 Another architecture of a blockchain system to which embodiments of the present application are applied is shown. The architecture is different from the architecture shown in Figure 4The difference between the system architecture shown in the figure is that the consensus network 2 is divided into multiple branch consensus networks 2. Each branch consensus network 2 can be responsible for recording a certain type of transaction information. For example, a certain enterprise may have supply chain finance business and may need to record contract information, information such as credit of goods money generated in the supply process, etc. on the blockchain, at the same time, the enterprise also needs to issue invoices and record invoice information, invoice reimbursement information, etc. on the blockchain. At this time, in order to facilitate the need for consensus nodes 21 to be supervised by the same department, the consensus nodes 21 recording supply chain finance business transactions and the consensus nodes 21 recording transactions in the invoice circulation process belong to different departments. For example, the consensus nodes 21 recording supply chain finance business transactions are accounting terminals set by the bank, and the consensus nodes 21 recording transactions in the invoice circulation process are accounting terminals set by the tax bureau. The supply chain finance business transactions and the transactions in the invoice circulation process may also eventually be recorded on different branch consensus networks 2. At this time, the proxy node 12 sends the transaction information to the branch consensus network 2 corresponding to the transaction type according to the transaction type carried in the transaction information sent from the business node 11.
[0078] It should be noted that in the system architecture of the blockchain system shown in the figure, Figures 4 to 6 In the system architecture of the blockchain system shown in the figure, the proxy node 12 is located in the business network 1, and in other embodiments of the present application, the proxy node 12 can also be located in the consensus network 2, or independent of the business network 1 and the consensus network 2.
[0079] It can be understood that in the system architecture of the blockchain system shown in the figure, Figures 4 to 6 In the system architecture of the blockchain system shown in the figure, the blockchain system can include a smart contract, which can be understood as a code that can be understood and executed by each node of the blockchain, and can perform any calculation logic and get the result. Among them, the smart contract deployed on the consensus node of the consensus network 2 is collectively referred to as an on-chain contract, and the smart contract deployed and only running on the business node of the business network 1 is collectively referred to as a business contract (also referred to as a local contract).
[0080] Optionally, the blockchain system can include one or more smart contracts, which can be distinguished by contract identification (such as identity document (ID) or name, and can also include contract address or contract function name (also referred to as contract method name)), and the contract calling request initiated by the terminal can also carry the identity number or name of the smart contract to specify the smart contract that the blockchain needs to run.
[0081] Based on the aforementioned blockchain technology, and addressing the challenges of managing data collaboration in blockchain systems and related technologies, this application provides a data processing method based on a blockchain system. Specifically, in one application scenario of this application, please refer to... Figure 7 It mainly includes the aforementioned Figures 4 to 6 The multiple business nodes involved 11 and as mentioned above Figures 4 to 6 The process involves multiple consensus nodes 21. Among them, multiple business nodes 11 and multiple consensus nodes 21 can communicate with each other arbitrarily.
[0082] Each of the multiple business nodes 11 can correspond to a different business network / blockchain; that is, each business node 11 corresponds to a different business network / blockchain. Furthermore, each business node 11 maintains its own ledger (also known as a local ledger). The multiple business nodes 11 can be business nodes with a hierarchical relationship; this hierarchical relationship can refer to a relationship such as that between an individual, an enterprise, and a management department. For example, the 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; where the first business node can be an individual, the second business node can be an enterprise, the third business node can be a district management department, the fourth business node can be a city management department, the fifth business node can be a provincial management department, and the sixth business node can be a general management department (also known as a central management department), etc.
[0083] Among them, multiple consensus nodes 21 can jointly correspond to a consensus network / blockchain, that is, the consensus network / blockchain corresponding to each consensus node 21 is the same; and each consensus node maintains its own ledger (also known as a shared ledger).
[0084] For ease of description in the following text, the embodiments of this application will use... Figure 7 In this blockchain architecture, the business node that triggers the on-chain transaction data is called the first blockchain node, the business node that receives the on-chain transaction data (obtained after the on-chain transaction data is uploaded) is called the second blockchain node, and the consensus node is called the blockchain consensus node. Optionally, there may be one or more second blockchain nodes. It is understood that the ledgers maintained by the first and second blockchain nodes have ledger identification information.
[0085] In an 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 triggering the to-be-chained transaction data; then determine, according to ledger identifier information of the first ledger and a containing relationship between the ledger identifier information, a second ledger containing the ledger identifier information of the first ledger and a second blockchain node corresponding to the second ledger; and perform associated chaining processing on the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data to obtain chained transaction data; then send the chained transaction data to the first blockchain node corresponding to the first ledger, and correspondingly, the first blockchain node writes the chained transaction data into the first ledger and sends the chained transaction data to the second blockchain node corresponding to the second ledger, and correspondingly, the second blockchain node writes the chained transaction data into the second ledger.
[0086] It should be noted that in the specific embodiments of the present application, data related to users (such as transaction data) is involved, and when the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of relevant countries and regions.
[0087] Based on Figure 7 As shown in the application scenario, after the technical solution of the embodiments of the present application is adopted, the identification information of the first ledger corresponding to the data source, the identification information of the second ledger corresponding to the data destination, and the to-be-chained transaction data are associated and chained, so that if a problem occurs in the data collaboration process, the responsible party can be quickly and accurately located according to the identification information of the first ledger and / or the identification information of the second ledger in the chained transaction data, thereby facilitating the management of data collaboration and reducing the difficulty of data collaboration. Moreover, since the chained transaction data is sent / cleared to the corresponding blockchain node, the blockchain node stores only the associated data, not the full amount of data, thereby avoiding the problem of poor data security caused by the blockchain node bypassing the permission control due to the storage of full amount of data; and since the amount of associated data stored is less than the amount of full amount of data stored, the storage pressure of the blockchain node is also reduced to a certain extent, thereby saving storage space.
[0088] The various implementation details of the technical solution of the embodiments of the present application are described in detail as follows:
[0089] Please refer to Figure 8 , Figure 8 is a flowchart of a data processing method based on a blockchain system according to an embodiment of the present application, which can be executed by a blockchain consensus node in a blockchain system. As shown inFigure 8 As shown, the data processing method based on the blockchain system at least includes steps S801 to S804, which are described in detail as follows:
[0090] In step S801, a first ledger corresponding to a first blockchain node triggering the to-be-chained transaction data is acquired.
[0091] The first blockchain node in the embodiment of the present application refers to the blockchain node triggering the to-be-chained transaction data, which can serve as a data provider.
[0092] 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, and the ledger identification information is information for uniquely representing the ledger.
[0093] In an embodiment of the present application, please refer to Figure 9 Before the process of acquiring the first ledger corresponding to the first blockchain node triggering the to-be-chained transaction data in step S801, steps S901 to S902 can also be included, which are described in detail as follows:
[0094] In step S901, a first invocation request for a first contract sent by the first blockchain node is received;
[0095] In step S902, execution of the first contract is triggered according to the first invocation request to generate the to-be-chained transaction data.
[0096] That is, in the optional embodiment, the generation process of the to-be-chained transaction data can be that the blockchain consensus node receives the first invocation request for the first contract sent by the first blockchain node, and then triggers the execution of the first contract according to the first invocation request, thereby generating the to-be-chained transaction data. In the optional embodiment, the first contract is the aforementioned smart contract, which is a contract located on the core chain, and is therefore also referred to as an on-chain contract.
[0097] In this way, the blockchain consensus node can quickly and conveniently generate the to-be-chained transaction data by triggering the execution of the first contract through the received first invocation request for the first contract.
[0098] In an embodiment of the present application, please refer to Figure 10 Before the process of acquiring the first ledger corresponding to the first blockchain node triggering the to-be-chained transaction data in step S801, steps S1001 to S1002 can also be included, which are described in detail as follows:
[0099] In step S1001, an addition request sent by the first blockchain node is received; wherein the addition request includes ledger identification information of the first ledger of the first blockchain node;
[0100] At step S1002, the first blockchain node is added on the blockchain system according to the ledger identification information of the first ledger.
[0101] That is, in an optional embodiment, the first blockchain node is first added in the blockchain system, and the process of adding the first blockchain node in the blockchain system can be that the blockchain consensus node receives an addition request sent by the first blockchain node and carrying the ledger identification information of the first ledger of the first blockchain node, and then adds the first blockchain node on the blockchain system according to the ledger identification information of the first ledger.
[0102] In this way, if an entity needs to be added in 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.
[0103] In an embodiment of the present application, please refer to Figure 11 The process of adding the first blockchain node on the blockchain system according to the ledger identification information of the first ledger at step S1002 can include steps S1101 to S1102, which are described in detail as follows:
[0104] At step S1101, the first blockchain node is registered on the blockchain system according to the ledger identification information of the first ledger, and the registered on-chain address is obtained;
[0105] At step S1102, the ledger identification information of the first ledger is associated with the on-chain address to obtain an association result, so as to complete the addition of the first blockchain node.
[0106] That is, in an optional embodiment, the process of adding the first blockchain node on the blockchain system according to the ledger identification information of the first ledger can be that the blockchain consensus node registers the first blockchain node on the blockchain system according to the ledger identification information of the first ledger, and 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, so as to complete the addition of the first blockchain node.
[0107] In this way, by associating the ledger identification information of the first ledger with the on-chain address, the addition of the first blockchain node can be accurately realized, and the first blockchain node can be found according to the ledger identification and / or on-chain address of the first ledger in the future.
[0108] In an embodiment of the present application, please refer to Figure 12 Before the process of associating the ledger identification information of the first ledger with the on-chain address to obtain an association result at step S1102, steps S1201 to S1203 can also be included, which are described in detail as follows:
[0109] Step S1201, receiving a ledger identifier allocation request sent by the first blockchain node.
[0110] Step S1202, generating ledger identifier information matched with the first blockchain node according to the ledger identifier allocation request.
[0111] Step S1203, sending the ledger identifier information matched with the first blockchain node to the first blockchain node, so that the first blockchain node obtains the first ledger with the ledger identifier information matched with the first blockchain node.
[0112] That is, in the optional embodiment, the derivation process of the ledger identifier information of the first ledger of the first blockchain node can be that the blockchain consensus node receives a ledger identifier allocation request sent by the first blockchain node, then generates ledger identifier information matched with the first blockchain node according to the ledger identifier allocation request, and sends the generated ledger identifier information matched with the first blockchain node to the first blockchain node. Correspondingly, the first blockchain node can set the first ledger according to the received ledger identifier information, so as to obtain the first ledger with the ledger identifier information matched with the first blockchain node.
[0113] In this way, by determining the ledger identifier information of the first blockchain node registered in the blockchain system by the blockchain consensus node, the unified management of the ledger identifier information is facilitated, and the efficiency of the ledger identifier information management is improved.
[0114] Step S802, determining, according to the ledger identifier information of the first ledger and the containing relationship between the ledger identifier information, a second ledger containing the ledger identifier information of the first ledger, and a second blockchain node corresponding to the second ledger.
[0115] In the embodiment of the application, the first ledger corresponding to the first blockchain node triggering the to-be-chained transaction data is obtained, and then the second ledger containing the ledger identifier information of the first ledger can be determined according to the ledger identifier information of the first ledger and the containing relationship between the ledger identifier information, and the second blockchain node corresponding to the second ledger.
[0116] The plurality of ledger identification information managed by the blockchain consensus node in the embodiment of the application has a containing relationship, which to some extent reflects the upper and lower containing relationship between the various blockchain nodes (the first blockchain node, the second blockchain, and the blockchain consensus node). For example, assume that the first blockchain node is an individual, the second blockchain node has a plurality of nodes, which are an enterprise, a district management department business management center, a city management department business management center, and a provincial management department business management center, and the blockchain consensus node is a general management department business 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 plurality of second blockchain nodes, and the ledger identification information of the shared ledger corresponding to the blockchain consensus node have a containing relationship.
[0117] The ledger identification information in the embodiment of the application includes but is not limited to 4-bit description information code + 2-bit version number code + 2-bit business type code + 6-bit region code + 2-bit entity type code + 16-bit entity id code (first 8-bit entity id / agency code + last 8-bit entity id / agency code). It can be understood that in actual application, the content included in the ledger identification information can be flexibly adjusted, for example, part of the content can be added or reduced on the basis of the content introduced in the foregoing ledger identification information, and the number of bits of each content can also be flexibly adjusted.
[0118] In an embodiment of the application, please refer to Figure 13 , for a constituent diagram of an example of ledger identification information, as Figure 13 shown, the ledger identification information includes 4-bit description information code + 2-bit version number code + 2-bit business type code + 6-bit region code + 2-bit entity type code + 16-bit entity id code (first 8-bit entity id / agency code + last 8-bit entity id / agency code) arranged in sequence.
[0119] In an embodiment of the application, please refer to Figure 14 , for a constituent diagram of an example of ledger identification information, as Figure 14 shown, the description information code can refer to the name code of the business, for example, there are business 1, business 2, business 3, etc., wherein business 1, business 2, and business 3 are three different types of businesses; the version number code can refer to the version code to which the business belongs, and the version number is mainly used to reserve the number of bits in advance when the business is too much; the business type code can refer to the type code of the business; the region code refers to the complete region code, for example, a province, a city, a district; the entity type refers to the enterprise, the agency, the individual, etc., which corresponds to the first 8-bit code and the last 8-bit code.
[0120] For example, taking the business as Figure 14The business 1 example described in the embodiment, specifically, the ledger identification information of the blockchain node associated with the business 1 is shown in Table 1.
[0121]
[0122] Table 1
[0123] As can be seen from Table 1, the inclusion relationship between the ledger identification information is that the ledger identification information corresponding to the employee tom of the company contains the ledger identification information corresponding to the company, the Shenzhen business 1 management center, the Guangdong Province business 1 management center and the business 1 management center headquarters. Correspondingly, the ledger identification information corresponding to the company contains the ledger identification information corresponding to the Shenzhen business 1 management center, the Guangdong Province business 1 management center and the business 1 management center headquarters. Correspondingly, the ledger identification information corresponding to the Shenzhen business 1 management center contains the ledger identification information corresponding to the Guangdong Province business 1 management center and the business 1 management center headquarters. Correspondingly, the ledger identification information corresponding to the Guangdong Province business 1 management center contains the ledger identification information corresponding to the business 1 management center headquarters.
[0124] It can be understood that the headquarters is usually on the core chain, such as the business 1 management center headquarters shown in Table 1, which corresponds to the blockchain consensus node, while the employee tom of the company, the company, the Shenzhen business 1 management center and the Guangdong Province business 1 management center are not on the core chain. Among them, if the employee tom of the company initiates a first calling request for the first contract to the business 1 management center headquarters, the employee tom of the company is the first blockchain node triggering the to-be-chained transaction data, and correspondingly, the company, the Shenzhen business 1 management center and the Guangdong Province business 1 management center are the second blockchain nodes. Among them, if the company initiates a first calling request for the first contract to the business 1 management center headquarters, the company is the first blockchain node triggering the to-be-chained transaction data, and correspondingly, the Shenzhen business 1 management center and the Guangdong Province business 1 management center are the second blockchain nodes, and based on the specific employee triggered by the to-be-chained transaction data of the company, correspondingly, the to-be-chained transaction data after the to-be-chained transaction data is chained will be sent to the specific employee.
[0125] In an embodiment of the present application, please refer to Figure 15 Before the process of determining the second ledger whose ledger identification information contains the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger according to the ledger identification information of the first ledger and the inclusion relationship between the ledger identification information in step S802, steps S1501 to S1502 can also be included, which are described in detail as follows:
[0126] Step S1501, receiving an adding request sent by the second blockchain node; wherein the adding request comprises account book identification information of the second account book of the second blockchain node;
[0127] Step S1502, adding the second blockchain node on the blockchain system according to the account book identification information of the second account book.
[0128] That is, in the optional embodiment, the second blockchain node is first added in the blockchain system, wherein the process of adding the second blockchain node in the blockchain system can be that the blockchain consensus node receives an adding request sent by the second blockchain node, the adding request carrying account book identification information of the second account book of the second blockchain node, and then adding the second blockchain node on the blockchain system according to the account book identification information of the second account book.
[0129] In this way, if an entity needs to be added in the blockchain system to become a second blockchain node, it can quickly and easily complete the addition by initiating an adding request, and the adding process is simple.
[0130] In an embodiment of the present application, please refer to Figure 16 The process of adding the second blockchain node on the blockchain system according to the account book identification information of the second account book in step S1502 can include steps S1601 to S1602, which are described in detail as follows:
[0131] Step S1601, registering the second blockchain node on the blockchain system according to the account book identification information of the second account book, and obtaining the registered on-chain address;
[0132] Step S1602, associating the account book identification information of the second account book with the on-chain address to obtain an association result, so as to complete the addition of the second blockchain node.
[0133] That is, in the optional embodiment, the process of adding the second blockchain node on the blockchain system according to the account book identification information of the second account book can be that the blockchain consensus node registers the second blockchain node on the blockchain system according to the account book identification information of the second account book, and obtains the registered on-chain address, and then associates the account book identification information of the second account book with the on-chain address to obtain an association result, so as to complete the addition of the second blockchain node.
[0134] In this way, by associating the account book identification information of the second account book with the on-chain address, the addition of the second blockchain node can be accurately realized, and the second blockchain node can be found according to the account book identification information of the second account book and / or the on-chain address in the future.
[0135] In an embodiment of the present application, please refer to Figure 17Before the process of associating the ledger identification information of the second ledger with the on-chain address in step S1602 to obtain an association result, steps S1701 to S1703 can also be included, which are described in detail as follows:
[0136] Step S1701, receiving a ledger identification allocation request sent by the second blockchain node;
[0137] Step S1702, generating ledger identification information matched with the second blockchain node according to the ledger identification allocation request;
[0138] Step S1703, sending the ledger identification information matched with the second blockchain node to the second blockchain node, so that the second blockchain node obtains the second ledger with the ledger identification information matched with the second blockchain node.
[0139] That is, in the optional embodiment, the process of obtaining the ledger identification information of the second ledger of the second blockchain node can be that the blockchain consensus node receives a ledger identification allocation request sent by the second blockchain node, then generates ledger identification information matched with the second blockchain node according to the ledger identification allocation request, and sends the generated ledger identification information matched with the second blockchain node to the second blockchain node. Correspondingly, the second blockchain node can set the second ledger according to the received ledger identification information, so as to obtain the second ledger with the ledger identification information matched with the second blockchain node.
[0140] In this way, by determining the ledger identification information of the second blockchain node registered in the blockchain system by the blockchain consensus node, the unified management of the ledger identification information is facilitated, and the efficiency of the ledger identification information management is improved.
[0141] It should be noted that the process of adding the second blockchain node in the blockchain system described herein is similar to the process of adding the first blockchain node in the blockchain system described above.
[0142] In an embodiment of the present application, please refer to Figure 18 The process of determining, in step S802, the second ledger whose ledger identification information contains the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger according to the ledger identification information of the first ledger and the containing relationship between the ledger identification information can include steps S1801 to S1802, which are described in detail as follows:
[0143] Step S1801, performing analysis processing on the ledger identification information of the first ledger according to the coding rule of the ledger identification information to obtain a plurality of node identification information;
[0144] At step S1802, the blockchain consensus node determines, according to the inclusion relationship between the account book identifier information and the plurality of node identifier information, a second account book in which the account book identifier information of the first account book is included, and a second blockchain node corresponding to the second account book.
[0145] That is, in an optional embodiment, the blockchain consensus node can parse the account book identifier information of the first account book according to the coding rule of the account book identifier information to obtain the plurality of node identifier information, and then determine, according to the inclusion relationship between the account book identifier information and the plurality of node identifier information, a second account book in which the account book identifier information of the first account book is included, and a second blockchain node corresponding to the second account book.
[0146] In this way, the second account book of the second blockchain node to which the to-be-chained transaction data is to be written can be quickly and accurately determined according to the coding rule of the account book identifier information.
[0147] In an embodiment of the present application, the coding rule includes a coding bit number corresponding to each blockchain node; please refer to Figure 19 In step S1801, the process of parsing the account book identifier information of the first account book according to the coding rule of the account book identifier information to obtain the plurality of node identifier information can include steps S1901 to S1902, which are described in detail as follows:
[0148] At step S1901, the account book identifier information of the first account book is split according to the coding bit number to obtain a plurality of coding fields.
[0149] At step S1902, the plurality of coding fields are respectively identified to obtain identification results corresponding to the plurality of coding fields, and the identification results corresponding to the plurality of coding fields are taken as the plurality of node identifier information.
[0150] That is, in an optional embodiment, the blockchain consensus node can split the account book identifier information of the first account book according to the coding bit number to obtain a plurality of coding fields, and then respectively identify the plurality of coding fields to obtain identification results corresponding to the plurality of coding fields, and take the identification results corresponding to the plurality of coding fields as the plurality of node identifier information. In an optional embodiment, the blockchain consensus node pre-provisions a coding field for each blockchain node when managing the account book identifier information. For example, as introduced in Table 1, the coding field corresponding to the business 1 is 01, the coding field corresponding to the general office area is 000000, the coding field corresponding to the Guangdong Province is 44, the coding field corresponding to the Shenzhen City is 0300, the coding field corresponding to the company entity type is 02, the coding field corresponding to the company entity is company, and the coding field corresponding to the individual entity is tom.
[0151] In this way, by respectively identifying the plurality of encoding fields, the plurality of node identification information can be obtained to support the subsequent determination of the second account book and the second blockchain node corresponding to the second account book.
[0152] In an embodiment of the present application, the process of respectively identifying the plurality of encoding fields in step S1902 to obtain the identification results corresponding to the plurality of encoding fields can include the following steps:
[0153] According to the preset mapping relationship between the blockchain nodes and the encoding fields, the blockchain nodes corresponding to the plurality of encoding fields are respectively determined, and the blockchain nodes corresponding to the encoding fields are taken as the identification results of the encoding fields.
[0154] That is, in the optional embodiment, the blockchain consensus node can obtain the plurality of encoding fields, and then can respectively search for the blockchain nodes corresponding to each encoding field in the preset mapping relationship between the blockchain nodes and the encoding fields. At this time, the blockchain nodes corresponding to the encoding fields are the identification results of the encoding fields. In the optional embodiment, the preset mapping relationship between the blockchain nodes and the encoding fields has a plurality of blockchain nodes and a plurality of encoding fields corresponding to the plurality of blockchain nodes.
[0155] In this way, by using the preset mapping relationship between the blockchain nodes and the encoding fields, the identification results corresponding to the encoding fields can be quickly and accurately obtained, that is, the plurality of node identification information can be quickly and accurately obtained.
[0156] In an embodiment of the present application, before the process of respectively determining the blockchain nodes corresponding to the plurality of encoding fields according to the preset mapping relationship between the blockchain nodes and the encoding fields, the following steps can be further included:
[0157] Receiving a setting request, the setting request carrying the name of the blockchain node and the encoding field matched with the name of the blockchain node;
[0158] Storing the name of the blockchain node and the encoding field matched with the name of the blockchain node in association to generate the preset mapping relationship between the blockchain nodes and the encoding fields.
[0159] That is, in an optional embodiment, the process of generating the preset mapping relationship between the blockchain node and the encoding field can be that the blockchain consensus node receives a setting request carrying the name of the blockchain node and the encoding field matched with the name of the blockchain node, and then stores the name of the blockchain node and the encoding field matched with the name of the blockchain node in association, thereby generating the preset mapping relationship between the blockchain node and the encoding field. In an optional embodiment, the setting request can be issued in any manner, and the manner of issuing the setting request includes but is not limited to input (text input, voice input), click, slide, selection, etc.
[0160] In this way, by storing the name of the blockchain node corresponding to the setting request and the encoding field matched with the name of the blockchain node in association, the preset mapping relationship between the blockchain node and the encoding field can be quickly and simply generated to provide support for obtaining the recognition result corresponding to the encoding field, that is, to provide support for obtaining the multiple node identification information.
[0161] In an embodiment of the present application, the number of second ledgers is multiple, that is, the second blockchain nodes are multiple, and the second blockchain nodes have a one-to-one relationship with the second ledgers.
[0162] In an embodiment of the present application, the inclusion relationship between the ledger identification information includes 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 the individuals.
[0163] In an embodiment of the present application, please refer to Figure 20 The process of determining, in step S1802, the second ledger of which the ledger identification information contains the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger according to the inclusion relationship between the ledger identification information and the multiple node identification information can include steps S2001 to S2002, which are described in detail as follows:
[0164] In step S2001, the target inclusion relationship is selected from 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 the individuals according to the ledger attribution information represented by the ledger identification information of the first ledger.
[0165] In step S2002, the second ledger to which the on-chain transaction data is to be written is determined according to the target inclusion relationship and the multiple node identification information.
[0166] That is, in an optional embodiment, the blockchain consensus node can select a target inclusion relationship from the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals according to the account belonging information represented by the account identification information of the first account, and then determine the second account of the second blockchain node to which the transaction data after being chained is to be written according to the target inclusion relationship and the plurality of node identification information. In an optional embodiment, the target inclusion relationship refers to the inclusion relationship selected from the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals.
[0167] In an embodiment of the present application, if the account identification information of the first account represents that the first account belongs to the blockchain node corresponding to the management department, the inclusion relationship among the management departments is selected as the target inclusion relationship from the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals; and then the second account of the second blockchain node to which the transaction data after being chained is to be written is obtained by combining the plurality of node identification information according to the inclusion relationship among the management departments.
[0168] In an embodiment of the present application, if the account identification information of the first account represents that the first account belongs to the blockchain node corresponding to the enterprise, the inclusion relationship among the management departments and the inclusion relationship between the management departments and the enterprises are selected as the target inclusion relationship from the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals; and then the second account of the second blockchain node to which the transaction data after being chained is to be written is obtained by combining the plurality of node identification information according to the inclusion relationship among the management departments and the inclusion relationship between the management departments and the enterprises.
[0169] In an embodiment of the present application, if the account identification information of the first account represents that the first account belongs to the blockchain node corresponding to the individual, the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals are selected as the target inclusion relationship from the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals; and then the second account of the second blockchain node to which the transaction data after being chained is to be written is obtained by combining the plurality of node identification information according to the inclusion relationship among the management departments, the inclusion relationship between the management departments and the enterprises, and the inclusion relationship between the enterprises and the individuals.
[0170] In an embodiment of the present application, please refer to Figure 21Before the process of determining, in step S1802, the second account book containing the account book identification information of the first account book according to the containing relationship between the account book identification information and the plurality of node identification information, and the second blockchain node corresponding to the second account book, the process can further include steps S2101 to S2103, which are described in detail as follows:
[0171] In step S2101, the business type information corresponding to the plurality of blockchain nodes is obtained.
[0172] In step S2102, the blockchain nodes belonging to the same type of business type information in the plurality of business type information are divided into a group to obtain a plurality of groups of blockchain nodes; wherein each group of blockchain nodes includes at least two blockchain nodes.
[0173] In step S2103, the account book identification information with the containing relationship corresponding to the at least two blockchain nodes is generated.
[0174] That is, in the optional embodiment, the blockchain consensus node can obtain the business type information corresponding to the plurality of blockchain nodes, then divide the blockchain nodes belonging to the same type of business type information in the plurality of business type information into a group to obtain a plurality of groups of blockchain nodes, wherein each group of blockchain nodes includes at least two blockchain nodes, and then generate the account book identification information with the containing relationship corresponding to the at least two blockchain nodes. In the optional embodiment, the blockchain nodes in the same group correspond to the same type of business, so the account book identification information of the account books 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, wherein group 1 is for business 1 and includes a plurality of blockchain nodes corresponding to the account book identification information of the account books of the plurality of blockchain nodes with a containing relationship, and group 2 is for business 2 and includes a plurality of blockchain nodes corresponding to the account book identification information of the account books of the plurality of blockchain nodes with a containing relationship.
[0175] In step S803, the account book identification information of the first account book, the account book identification information of the second account book, and the to-be-chained transaction data are associated and chained to obtain the chained transaction data.
[0176] The process of determining, in steps S801 to S802, the second account book containing the account book identification information of the first account book and the second blockchain node corresponding to the second account book can be executed in parallel with the process of associating and chaining, in step S803, the account book identification information of the first account book, the account book identification information of the second account book, and the to-be-chained transaction data to obtain the chained transaction data, or can be executed in any order.
[0177] In an embodiment of the present application, please refer to Figure 22, the process of associating the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data in step S803 to obtain the chained transaction data can include steps S2201 to S2202, which are described in detail as follows:
[0178] In step S2201, the to-be-chained transaction data is subjected to verification processing and consensus processing.
[0179] In step S2202, if the verification processing and the consensus processing are both passed, the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data are subjected to associated chaining processing to obtain the chained transaction data.
[0180] That is, in the optional embodiment, the blockchain consensus node can perform verification processing and consensus processing on the to-be-chained transaction data. If the verification processing and the consensus processing are both passed, the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data are subjected to associated chaining processing to obtain the chained transaction data. If any of the verification processing and the consensus processing is not passed, the chaining processing is not performed at this time.
[0181] In this way, only when the verification processing and the consensus processing are both passed, the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data are subjected to associated chaining processing to obtain the chained transaction data, thereby ensuring the security of the chained transaction data.
[0182] In an embodiment of the present application, please refer to Figure 23 , the process of associating the ledger identifier information of the first ledger, the ledger identifier information of the second ledger, and the to-be-chained transaction data in step S2202 to obtain the chained transaction data can include steps S2301 to S2303, which are described in detail as follows:
[0183] In step S2301, the signature data associated with the to-be-chained transaction data sent by the first blockchain node is received.
[0184] In step S2302, the to-be-chained transaction data is subjected to verification processing according to the signature data.
[0185] In step S2303, if the verification processing is passed, the to-be-chained transaction data is subjected to consensus processing.
[0186] That is, in the optional embodiment, the blockchain consensus node can receive the signature data associated with the to-be-chained transaction data sent by the first blockchain node, and then perform verification processing on the to-be-chained transaction data according to the signature data. If the verification processing is passed, the to-be-chained transaction data is subjected to consensus processing. If the verification processing is not passed, the to-be-chained transaction data is not subjected to consensus processing at this time.
[0187] In this way, the consensus processing is performed on the chained transaction data only when the verification processing is passed, so that the efficiency of the consensus processing is improved, and the phenomenon of consensus processing failure caused by the consensus processing performed due to the verification processing not being passed is avoided.
[0188] In step S804, the chained transaction data is sent to the first blockchain node, so that the first blockchain node writes the chained transaction data into the first ledger, and the chained transaction data is sent to the second blockchain node, so that the second blockchain node writes the chained transaction data into the second ledger.
[0189] In the embodiment of the present application, the second ledger in which the ledger identification information includes the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger are determined, and the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data are associated and chained to obtain the chained transaction data. Then, the chained transaction data can be sent to the first blockchain node. Correspondingly, the first blockchain node writes the chained transaction data into the first ledger, and sends the chained transaction data to the second blockchain node. Correspondingly, the second blockchain node writes the chained transaction data into the second ledger.
[0190] In an embodiment of the present application, the chained transaction data further includes operation permission information of the second blockchain node, and the operation permission information includes at least one of read operation permission and write operation permission. Please refer to Figure 24 After the chained transaction data is sent to the second blockchain node in step S804, steps S2401 to S2403 can be further included, which are described in detail as follows:
[0191] In step S2401, a second calling request for the second contract sent by the second blockchain node is received.
[0192] In step S2402, if the second calling request meets the operation permission information, the execution of the second contract is triggered according to the second calling request to perform the operation processing corresponding to the operation permission information on the chained transaction data, so as to obtain the processed chained transaction data.
[0193] In step S2403, the ledger identification information of the second ledger and the processed chained transaction data are associated and chained.
[0194] That is, in an optional embodiment, the blockchain consensus node receives the second calling request for the second contract sent by the second blockchain node, if the second calling request meets the operation permission information, the execution of the second contract can be triggered according to the second calling request, so as to perform the operation processing corresponding to the operation permission information on the on-chain transaction data, and obtain the processed on-chain transaction data, and then the ledger identifier information of the second ledger and the processed on-chain transaction data are associated and chained; if the second calling request does not meet the operation permission information, the execution of the second contract is not triggered at this time.
[0195] In this way, by matching the second calling request with the corresponding operation permission information, the execution of the second contract is triggered according to the second calling request only when the second calling request meets the operation permission information, so as to realize the operation processing corresponding to the operation permission information on the on-chain transaction data, and ensure the security of the data.
[0196] In an embodiment of the present application, the second calling request includes first version information of the on-chain transaction data written into the second ledger; please refer to Figure 25 If the second calling request meets the operation permission information in step S2402, the process of triggering the execution of the second contract according to the second calling request can include steps S2501 to S2502, which are described in detail as follows:
[0197] Step S2501, comparing the first version information with second version information of the on-chain transaction data stored by the blockchain system;
[0198] Step S2502, if the first version information matches the second version information, triggering the execution of the second contract according to the second calling request.
[0199] That is, in an optional embodiment, the second calling request received by the blockchain consensus node includes the first version information of the on-chain transaction data written into the second ledger, so that the first version information can be compared with the second version information of the on-chain transaction data stored by 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 calling 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.
[0200] In this way, by comparing the version information, the phenomenon that the second blockchain node still performs operation processing on the on-chain transaction data before updating after other blockchain nodes update the on-chain transaction data stored by the blockchain system, resulting in operation processing error can be avoided.
[0201] Figure 8 The embodiments shown are described from the perspective of the blockchain consensus node, and the followingFigure 26 The implementation details of the technical solutions of the embodiments of the application from the perspective of the second blockchain node are described in detail as follows:
[0202] Please refer to Figure 26 , Figure 26 is a flowchart of a data processing method based on a blockchain system according to an embodiment of the application, which can be executed by a second blockchain node in the blockchain system. As shown in Figure 26 , the data processing method based on the blockchain system at least includes steps S2601 to S2602, which are described in detail as follows:
[0203] Step S2601, receiving the post-uplink transaction data; wherein the post-uplink transaction data is obtained by the blockchain consensus node triggering the first blockchain node corresponding to the first account book, and determining the second account book containing the account book identifier information of the first account book according to the account book identifier information of the first account book and the containing relationship between the account book identifier information, and the second blockchain node corresponding to the second account book, and the post-uplink transaction data obtained and sent after the post-uplink transaction data is processed.
[0204] In the embodiment of the application, the second blockchain node receives the post-uplink transaction data sent by the blockchain consensus node. Specifically, the process of how the blockchain consensus node determines the second blockchain node is described in the foregoing embodiments, which will not be repeated here.
[0205] In an embodiment of the application, please refer to Figure 27 , the process of receiving the post-uplink transaction data in step S2601 can include the following steps S2701 to S2702, which are described in detail as follows:
[0206] Step S2701, receiving the post-uplink transaction data and generating the notification information corresponding to the post-uplink transaction data;
[0207] Step S2702, displaying the notification information so that the second blockchain node determines that there is post-uplink transaction data arrival according to the notification information.
[0208] That is, in the optional embodiment, the second blockchain node can receive the post-uplink transaction data, generate the notification information corresponding to the post-uplink transaction data, and display the notification information. The second blockchain node can determine that there is post-uplink transaction data arrival according to the notification information.
[0209] In this way, through the reminder of the notification information, the second blockchain node can determine that there is post-uplink transaction data arrival, so as to take corresponding operation processing, and improve the timeliness of data processing.
[0210] Step S2602, write the post-chain transaction data into the second ledger.
[0211] The second blockchain node receives the post-chain transaction data sent by the blockchain consensus node, and then writes the post-chain transaction data into the second ledger.
[0212] In an embodiment of the present application, please refer to Figure 28 Before the process of receiving the post-chain transaction data in step S2601, steps S2801 to S2802 can also be included, which are described in detail as follows:
[0213] Step S2801, receive a ledger identifier setting request; wherein the ledger identifier setting request carries ledger identifier information;
[0214] Step S2802, obtain the second ledger with the ledger identifier information according to the ledger identifier information; wherein the ledger identifier information corresponding to the ledgers of the same type of business information of different blockchain nodes has a containing relationship.
[0215] That is, in the optional embodiment, the blockchain consensus node can actively send the ledger identifier information, and accordingly, the second blockchain node receives the ledger identifier setting request sent by the blockchain consensus node carrying the ledger identifier information, obtains the second ledger with the ledger identifier information according to the ledger identifier information, wherein the ledger identifier information corresponding to the ledgers of the same type of business information of different blockchain nodes has a containing relationship.
[0216] In this way, by receiving the ledger identifier setting request sent by the blockchain consensus node carrying the ledger identifier information, the second ledger with the ledger identifier information can be obtained simply and conveniently.
[0217] In an embodiment of the present application, please refer to Figure 29 After the process of writing the post-chain transaction data into the second ledger in step S2602, steps S2901 to S2902 can also be included, which are described in detail as follows:
[0218] Step S2901, receive an operation request; wherein the operation request carries signature data;
[0219] Step S2902, if the verification of the signature data is passed, the specified operation on the post-chain transaction data written in the second ledger is allowed.
[0220] That is, in an optional embodiment, the second blockchain node can receive an operation request sent by another blockchain node and carrying signature data, and then check the signature data. If the signature data passes the check, the specified operation is allowed to be performed on the written transaction data in the second ledger. If the signature data fails the check, the specified operation is not allowed to be performed on the written transaction data in the second ledger. In an optional embodiment, the operation includes but is not limited to a viewing operation, an obtaining operation, etc. In actual application, it can be flexibly adjusted according to the specific application scenario.
[0221] In this way, the specified operation is allowed to be performed on the written transaction data in the second ledger only when the signature data passes the check, thereby ensuring the security of the data.
[0222] In the embodiment of the present application, the identity information of the first ledger corresponding to the data source, the identity information of the second ledger corresponding to the data destination, and the to-be-chained transaction data are associated and chained, so that if a problem occurs in the data collaboration process, the responsible party can be quickly and accurately located according to the identity information of the first ledger and / or the identity information of the second ledger in the chained transaction data, thereby facilitating the management of data collaboration and reducing the difficulty of data collaboration.
[0223] The following describes one specific application scenario of the embodiment of the present application in detail:
[0224] Please refer to Figure 30 There are three participants 1-3, among which participant 1 corresponds to ledger 1, participant 2 corresponds to ledger 2, and participant 3 corresponds to ledger 3. The participants are the blockchain nodes in the foregoing embodiments, and none of them is on the core chain. On the core chain are a plurality of blockchain consensus nodes 1-4, each of which corresponds to a collaboration contract (also referred to as a shared contract).
[0225] Please refer to Figure 30 In the embodiment of the present application, the data processing process based on the blockchain system is as follows:
[0226] 1. The blockchain consensus node obtains the first ledger corresponding to the first blockchain node triggering the to-be-chained transaction data.
[0227] Optionally, the first blockchain node is participant 1, that is, the data source.
[0228] Optionally, participant 1 initiates collaboration, thereby triggering the to-be-chained transaction data, and at this time, the ledger 1 corresponding to the participant is obtained.
[0229] 2. Based on the ledger identification information of the first ledger and the inclusion relationship between ledger identification information, the blockchain consensus node determines 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.
[0230] Optionally, based on the ledger identification information of ledger 1 and the inclusion relationship between ledger identification information, the second ledger whose ledger identification information includes the ledger identification information of ledger 1 is determined to be ledger 2-3. Therefore, the second blockchain node is determined to be participant 2-3, which is the data destination.
[0231] 3. The blockchain consensus node associates the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the transaction data to be uploaded to the chain for on-chain processing, thus obtaining the on-chain transaction data.
[0232] Optionally, the ledger identifiers of ledgers 1-3 are associated with the transaction data to be uploaded to the blockchain for on-chain processing to obtain the on-chain transaction data.
[0233] 4. The blockchain consensus node sends the transaction data after it is uploaded to the chain to the first blockchain node, so that the first blockchain node writes the transaction data after it is uploaded to the chain into the first ledger, and sends the transaction data after it is uploaded to the chain to the second blockchain node, so that the second blockchain node writes the transaction data after it is uploaded to the chain into the second ledger.
[0234] Optionally, the on-chain transaction data is sent to participant 1, and participant 1 writes the on-chain transaction data into ledger 1 accordingly. Figure 30 (not shown in the diagram); and send the on-chain transaction data to participant 2, and accordingly, participant 2 writes the on-chain transaction data into ledger 2; and send the on-chain transaction data to participant 3, and accordingly, participant 3 writes the on-chain transaction data into ledger 3.
[0235] Optionally, participant 2 may also initiate a data update request. The process of initiating the data update request is similar to that of participant 1 initiating the collaboration, and will not be described in detail here.
[0236] Optionally, when the blockchain consensus node sends / clears the on-chain transaction data to participant 2-3, participant 2-3 can automatically generate and display the corresponding notification information. In this way, participant 2-3 can determine that there is on-chain transaction data based on the notification information.
[0237] Alternatively, other specific implementation processes can be found in the foregoing embodiments, and will not be repeated here.
[0238] The identifier information of the first account book corresponding to the participant 1, the identifier information of the second account book corresponding to the participants 2-3, and the to-be-chained transaction data are associated and chained in the embodiment of the present application, so that if a problem occurs in the data cooperation process, the responsible party can be quickly and accurately located according to the identifier information of the first account book and / or the identifier information of the second account book in the chained transaction data, for example, the participant 2 performs incorrect data processing, or the participant 3 performs delayed processing, so that the data cooperation process can be better managed.
[0239] Figure 31 is a block diagram of a data processing apparatus based on a blockchain system according to an embodiment of the present application. As shown in Figure 31 The account book maintained by the blockchain node in the blockchain system has account book identifier information, and the apparatus comprises:
[0240] The obtaining module 3101 is configured to obtain a first account book corresponding to a first blockchain node triggering to-be-chained transaction data;
[0241] The determining module 3102 is configured to determine, according to the account book identifier information of the first account book and the inclusion relationship between the account book identifier information, a second account book whose account book identifier information includes the account book identifier information of the first account book, and a second blockchain node corresponding to the second account book;
[0242] The chaining module 3103 is configured to associate and chain the account book identifier information of the first account book, the account book identifier information of the second account book, and the to-be-chained transaction data to obtain chained transaction data;
[0243] The sending module 3104 is configured to send the chained transaction data to the first blockchain node, so that the first blockchain node writes the chained transaction data into the first account book, and send the chained transaction data to the second blockchain node, so that the second blockchain node writes the chained transaction data into the second account book.
[0244] In an embodiment of the present application, the apparatus further comprises:
[0245] The first receiving unit is configured to receive an addition request sent by the second blockchain node; wherein the addition request includes the account book identifier information of the second account book of the second blockchain node;
[0246] The adding unit is configured to add the second blockchain node on the blockchain system according to the account book identifier information of the second account book.
[0247] In an embodiment of the present application, the adding unit is specifically configured to:
[0248] Register the second blockchain node on the blockchain system according to the account book identifier information of the second account book, and obtain the registered on-chain address.
[0249] The account book identification information of the second account book is associated with the on-chain address to obtain an association result, so as to complete the addition of the second blockchain node.
[0250] In an embodiment of the present application, the device further comprises:
[0251] The second receiving unit is configured to receive an account book identification allocation request sent by the second blockchain node.
[0252] The generating unit is configured to generate account book identification information matched with the second blockchain node according to the account book identification allocation request.
[0253] The sending unit is configured to send the account book identification information matched with the second blockchain node to the second blockchain node, so that the second blockchain node obtains the second account book with the account book identification information matched with the second blockchain node.
[0254] In an embodiment of the present application, the device further comprises:
[0255] The third receiving unit is configured to receive a first invocation request for the first contract sent by the first blockchain node.
[0256] The first triggering unit is configured to trigger the execution of the first contract according to the first invocation request, to generate the to-be-chained transaction data.
[0257] In an embodiment of the present application, the chained transaction data further comprises operation permission information of the second blockchain node, and the operation permission information comprises at least one of read operation permission and write operation permission; the device further comprises:
[0258] The fourth receiving unit is configured to receive a second invocation request for the second contract sent by the second blockchain node.
[0259] The second triggering unit is configured to, if the second invocation request meets the operation permission information, trigger the execution of the second contract according to the second invocation request, to perform operation processing corresponding to the operation permission information on the chained transaction data, to obtain processed chained transaction data.
[0260] The chaining unit is configured to perform association chaining processing on the account book identification information of the second account book and the processed chained transaction data.
[0261] In an embodiment of the present application, the second invocation request comprises first version information of the chained transaction data written into the second account book; and the second triggering unit is specifically configured to:
[0262] Compare the first version information with second version information of the chained transaction data stored by the blockchain system.
[0263] If the first version information matches the second version information, execution of the second contract is triggered according to the second invocation request.
[0264] In an embodiment of the present application, the upper chain module 3103 includes:
[0265] The verification and consensus unit is configured to perform verification processing and consensus processing on the to-be-uploaded transaction data.
[0266] The upper chain unit is configured to, if the verification processing and the consensus processing are both passed, perform association and uploading processing on the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-uploaded transaction data, to obtain the uploaded transaction data.
[0267] In an embodiment of the present application, the verification and consensus unit is specifically configured to:
[0268] Receive signature data associated with the to-be-uploaded transaction data sent by the first blockchain node;
[0269] Perform verification processing on the to-be-uploaded transaction data according to the signature data;
[0270] If the verification processing is passed, perform consensus processing on the to-be-uploaded transaction data.
[0271] Figure 32 is a block diagram of a data processing apparatus based on a blockchain system according to an embodiment of the present application. As shown in Figure 32 The ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the apparatus includes:
[0272] The receiving module 3201 is configured to receive the uploaded transaction data; wherein the uploaded transaction data is obtained by the blockchain consensus node triggering the first ledger corresponding to the first blockchain node, and determining the second ledger whose ledger identification information contains the ledger identification information of the first ledger according to the ledger identification information of the first ledger and the containing relationship between the ledger identification information, the second blockchain node corresponding to the second ledger, and the first ledger identification information, the second ledger identification information, and the to-be-uploaded transaction data are associated and uploaded to obtain and send the uploaded transaction data after processing.
[0273] The writing module 3202 is configured to write the uploaded transaction data into the second ledger.
[0274] In an embodiment of the present application, the receiving module 3201 includes:
[0275] The receiving and generating unit is configured to receive the uploaded transaction data and generate notification information corresponding to the uploaded transaction data;
[0276] The display unit is configured to display the notification information, so that the second blockchain node determines that the on-chain transaction data arrives according to the notification information.
[0277] In an embodiment of the present application, the apparatus further comprises:
[0278] The receiving unit is configured to receive an operation request for the on-chain transaction data written in the second ledger, wherein the operation request carries signature data.
[0279] The execution unit is configured to allow the specified operation on the on-chain transaction data written in the second ledger if the verification on the signature data is passed.
[0280] It should be noted that the apparatus provided in the above embodiments and the method provided in the above embodiments belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiments, which will not be described here.
[0281] Embodiments of the present application also provide an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the preceding data processing method based on the blockchain system.
[0282] Figure 33 The structure of the computer system of the electronic device suitable for implementing the embodiments of the present application is shown.
[0283] It should be noted that, Figure 33 The computer system 3300 of the electronic device shown is only an example, and should not limit the functions and use range of the embodiments of the present application.
[0284] As Figure 33 shown, the computer system 3300 includes a central processing unit (CPU) 3301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 3302 or programs loaded from a storage part 3308 to a random access memory (RAM) 3303, such as performing the method in the above embodiments. In the RAM 3303, various programs and data required for system operation are also stored. The CPU 3301, the ROM 3302, and the RAM 3303 are connected to each other through a bus 3304. An input / output (I / O) interface 3305 is also connected to the bus 3304.
[0285] The following components are connected to the I / O interface 3305: an input part 3306 including a keyboard, a mouse, etc.; an output part 3307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage part 3308 including a hard disk, etc.; and a communication part 3309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part 3309 performs communication processing via a network such as the Internet. A drive 3310 is also connected to the I / O interface 3305 as necessary. A removable medium 3311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 3310 as necessary, so that a computer program read out therefrom is installed in the storage part 3308 as necessary.
[0286] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication part 3309, and / or installed from the removable medium 3311. When the computer program is executed by the central processing unit (CPU) 3301, various functions defined in the system of the present application are executed.
[0287] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by an instruction execution system, apparatus or device to use or combine with the program. In this application, the computer-readable signal medium can include a data signal that carries computer-readable computer programs in a baseband or as a part of a carrier wave. Such a propagated data signal can take on various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can transmit, propagate or transmit programs for use by an instruction execution system, apparatus or device. The computer programs contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.
[0288] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order from that noted in the drawings. For example, two blocks represented in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0289] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0290] Another aspect of the present application also provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the data processing method based on the blockchain system as described above. The computer readable storage medium can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device.
[0291] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the data processing method based on the blockchain system provided in each of the above embodiments.
[0292] The above is only a preferred exemplary embodiment of the present application, and is not intended to limit the implementation of the present application. Those skilled in the art can easily make corresponding modifications or variations according to the main idea and spirit of the present application. Therefore, the protection scope of the present application should be subject to the protection scope 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 comprises: Obtaining a first ledger corresponding to a first blockchain node triggering the to-be-chained transaction data; According to the ledger identification information of the first ledger and the containing relationship between the ledger identification information, determining a second ledger whose ledger identification information contains the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger; Correlating the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data for chained processing to obtain post-chaining transaction data; Sending the post-chaining transaction data to the first blockchain node to enable the first blockchain node to write the post-chaining transaction data into the first ledger, and sending the post-chaining transaction data to the second blockchain node to enable the second blockchain node to write the post-chaining transaction data into the second ledger; According to the ledger identification information of the first ledger and the containing relationship between the ledger identification information, determining a second ledger whose ledger identification information contains the ledger identification information of the first ledger, and a second blockchain node corresponding to the second ledger. According to the encoding rule of the ledger identification information, the ledger identification information of the first ledger is parsed to obtain a plurality of node identification information; According to the containing relationship between the ledger identification information and the plurality of node identification information, a second ledger whose ledger identification information contains the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger are determined.
2. The method of claim 1, wherein, Before the second blockchain node corresponding to the second ledger to which the to-be-chained transaction data is to be written is determined according to the ledger identification information of the first ledger and the containing relationship between the ledger identification information, the method further comprises: Receiving an addition request sent by the second blockchain node; wherein the addition request comprises the ledger identification information of the second ledger of the second blockchain node; According to the ledger identification information of the second ledger, adding the second blockchain node on the blockchain system.
3. The method of claim 2, wherein, According to the ledger identification information of the second ledger, adding the second blockchain node on the blockchain system comprises: Registering the second blockchain node on the blockchain system according to the ledger identification information of the second ledger, and obtaining a registered on-chain address; Associating the ledger identification information of the second ledger with the on-chain address to obtain an association result to complete the addition of the second blockchain node.
4. The method of claim 3, wherein, Before the association result is obtained by associating the ledger identification information of the second ledger with the on-chain address, the method further comprises: Receiving a ledger identification allocation request sent by the second blockchain node; According to the ledger identification allocation request, generating ledger identification information matched with the second blockchain node; sending the ledger identification information matching the second blockchain node to the second blockchain node, so that the second blockchain node obtains the second ledger with the ledger identification information matching the second blockchain node.
5. The method of any one of claims 1 to 4, wherein, Before obtaining the first ledger corresponding to the first blockchain node triggering the to-be-chained transaction data, the method further comprises: receiving a first invocation request for a first contract sent by the first blockchain node; triggering execution of the first contract according to the first invocation request to generate the to-be-chained transaction data.
6. The method of any one of claims 1 to 4, wherein, The post-chaining transaction data further comprises operation permission information of the second blockchain node, and the operation permission information comprises at least one of read operation permission and write operation permission; after sending the post-chaining transaction data to the second blockchain node, the method further comprises: receiving a second invocation request for a second contract sent by the second blockchain node; if the second invocation request meets the operation permission information, triggering execution of the second contract according to the second invocation request to perform operation processing corresponding to the operation permission information on the post-chaining transaction data to obtain processed post-chaining transaction data; associating and chaining the ledger identification information of the second ledger and the processed post-chaining transaction data.
7. The method of claim 6, wherein, The second invocation request comprises first version information of the post-chaining transaction data written into the second ledger; triggering execution of the second contract according to the second invocation request comprises: comparing the first version information with second version information of the post-chaining transaction data stored in the blockchain system; if the first version information matches the second version information, triggering execution of the second contract according to the second invocation request.
8. The method of any one of claims 1 to 4, wherein, The association and chaining processing of the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data to obtain post-chaining transaction data comprises: verifying and consensus processing the to-be-chained transaction data; if the verification processing and the consensus processing are passed, associating and chaining the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data to obtain post-chaining transaction data.
9. The method of claim 8, wherein, The verification processing and the consensus processing of the to-be-chained transaction data comprise: receiving signature data associated with the to-be-chained transaction data sent by the first blockchain node; verifying the to-be-chained transaction data according to the signature data; if the verification processing is passed, consensus processing the to-be-chained transaction data. 10.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 comprises: receive the post-chain transaction data; wherein the post-chain transaction data is obtained by a blockchain consensus node, a first ledger corresponding to a first blockchain node triggering the to-be-chained transaction data, and according to ledger identification information of the first ledger and a containing relationship between the ledger identification information, a second ledger whose ledger identification information contains the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger are determined, and the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data are associated and chained to obtain and send the post-chain transaction data; write the post-chain transaction data into the second ledger; wherein, according to the ledger identification information of the first ledger and the containing relationship between the ledger identification information, the second ledger whose ledger identification information contains the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger are determined, comprising: According to the coding rule of the ledger identification information, the ledger identification information of the first ledger is parsed to obtain a plurality of node identification information; According to the containing relationship between the ledger identification information and the plurality of node identification information, the second ledger whose ledger identification information contains the ledger identification information of the first ledger and the second blockchain node corresponding to the second ledger are determined.
11. The method of claim 10, wherein, The method of receiving post-chain transaction data comprises: receive the post-chain transaction data, and generate the notification information corresponding to the post-chain transaction data; display the notification information to make the second blockchain node determine that there is post-chain transaction data according to the notification information.
12. The method of claim 10, wherein, After the post-chain transaction data is written into the second ledger, the method further comprises: receive an operation request for the post-chain transaction data written in 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-chain transaction data written in the second ledger. 13.A data processing apparatus based on a blockchain system, characterized by comprising: The ledger maintained by the blockchain node in the blockchain system has ledger identification information, and the device comprises: an acquisition module configured to acquire a first ledger corresponding to a first blockchain node triggering to-be-chained transaction data; a determination module configured to parse the ledger identification information of the first ledger according to the coding rule of the ledger identification information to obtain a plurality of node identification information, and determine a second ledger whose ledger identification information contains the ledger identification information of the first ledger and a second blockchain node corresponding to the second ledger according to the containing relationship between the ledger identification information and the plurality of node identification information; a chaining module configured to associate and chain the ledger identification information of the first ledger, the ledger identification information of the second ledger, and the to-be-chained transaction data to obtain post-chain transaction data; The sending module is configured to send the on-chain transaction data to the first blockchain node, so that the first blockchain node writes the on-chain transaction data into the first ledger, and send the on-chain transaction data to the second blockchain node, so that the second blockchain node writes the on-chain transaction data into the second ledger.
14. An electronic device, comprising: Comprising: one or more processors; a storage device for storing one or more programs, which, when executed by the electronic device, cause the electronic device to implement the data processing method based on the blockchain system as claimed in any one of claims 1 to 12.
15. A computer readable medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the data processing method based on the blockchain system as claimed in any one of claims 1 to 12.
16. A computer program product, characterised in that, The computer program, when executed by the processor, implements the data processing method based on the blockchain system as claimed in any one of claims 1 to 12. The computer program, when executed by the processor, implements the data processing method based on the blockchain system as claimed in any one of claims 1 to 12.
Citation Information
Patent Citations
Transaction processing method and related device
CN110473106A