Data processing method and system based on block chain network
By introducing witness networks and consensus networks into blockchain networks, the complexity and flexibility of smart contracts when processing complex data is solved, efficient and flexible data processing is achieved, and the data processing process is simplified.
Patent Information
- Application Number
- CN202310610272.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2024-11-26
AI Technical Summary
When smart contracts process complex and massive data in blockchain networks, developers need to write multiple functions, resulting in high complexity and inflexibility of data processing, and it is impossible to directly query the data.
By introducing witness networks and consensus networks into the blockchain network, business nodes generate data processing requests, consensus nodes verify permissions and execute target operation statements, and the validator network performs data query or updates, reducing the complexity of data processing and improving the Timeliness and flexibility.
It realizes the direct execution of data processing requests in the blockchain network without re-editing the processing function, which improves the timeliness and flexibility of data processing and simplifies the data processing process.
Smart Images

Figure CN119030725A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a data processing method and system based on a blockchain network. Background Art
[0002] With the advent of the technological era and the development of mobile Internet, the pace of network change is getting faster and faster. The process of realizing information integration in the same field or multiple fields and providing customers with all-round information solutions is also facing new challenges such as system architecture improvement and support focus shift. Therefore, blockchain technology, as a specific implementation of distributed ledgers, has gradually become the preferred way to store and trade data in various fields with its natural advantages in storing and managing data.
[0003] A blockchain network is a distributed system formed by multiple nodes, which form a peer-to-peer (P2P) network. A smart contract is an automated computer program that runs on a blockchain and is used to perform predefined actions under the terms of a contract. These contracts are stored on the blockchain in the form of code and can be automatically executed by nodes on the blockchain. Smart contracts have a variety of applications on the blockchain, including identity verification, voting, supply chain management, and more. Since smart contracts are executed through code, they are able to execute automatically without human intervention, thereby eliminating intermediaries, improving efficiency, and reducing transaction costs.
[0004] With the development of blockchain, smart contracts are becoming more and more complex. Smart contracts need to store, read, and process data with more complex structures and larger volumes. Such data processing often brings additional complexity to the code of smart contracts. Developers need to write functions for data reading, data updating, and data filtering in the contracts. For data with different structures, multiple functions often need to be written.
[0005] In addition, another problem caused by the coupling of data and contracts is that data processing is not flexible enough. When developers need to use complex conditions to filter data, they need to add new functions to the smart contract instead of directly querying the data. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a data processing method and system based on a blockchain network to reduce the complexity of the smart contract writing process and improve the flexibility of database operations in the blockchain network.
[0007] An aspect of an embodiment of the present invention provides a data processing method based on a blockchain network, comprising:
[0008] Receive a data processing request sent by a target service node;
[0009] Verify the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node;
[0010] generating a data processing event according to the access permission and the target operation statement;
[0011] The target operation statement is executed according to the data processing event to obtain a data query result of a relational database or to update the data in the relational database.
[0012] On the other hand, an embodiment of the present invention provides a data processing method based on a blockchain network, comprising:
[0013] generating a data processing request in response to the data processing operation instruction;
[0014] The data processing request is sent to the target consensus node in the consensus network, so that after receiving the data processing request, the target consensus node executes the aforementioned data processing method based on the blockchain network, thereby obtaining the data query result of the relational database or updating the data in the relational database.
[0015] On the other hand, an embodiment of the present invention provides a data processing system based on a blockchain network, including a witness network and a consensus network isolated from each other, wherein the witness network is composed of a plurality of business nodes, the consensus network is composed of a plurality of consensus nodes, an on-chain registry and a validator network are deployed on the consensus nodes, and the witness network and the consensus network are connected via a gateway device;
[0016] The service node is used for:
[0017] generating a data processing request in response to the data processing operation instruction;
[0018] Sending the data processing request to a target consensus node in the consensus network;
[0019] The consensus node is used to:
[0020] receiving a data processing request sent by a target service node, the data processing request carrying data processing authority information and database operation information of the target service node; wherein the target service node is in the witness network;
[0021] Verify the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node;
[0022] A data processing event is generated according to the access permission and the target operation statement and sent to the verifier network, and then the verifier network executes the target operation statement according to the data processing event to obtain a data query result of the relational database or update the data in the relational database.
[0023] Optionally, the data processing system based on the blockchain network in the embodiment of the present invention,
[0024] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0025] Execute the data processing request through the first smart contract in the on-chain registry, and parse to obtain the second smart contract of the target business node and the target operation statement included in the data processing request;
[0026] According to the second smart contract, the authority information of the target business node is determined.
[0027] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0028] Execute the second smart contract and parse to obtain a third smart contract of the target service node;
[0029] Execute the third smart contract to obtain access control logic information of the target service node;
[0030] The access authority of the target service node is determined according to the access control logic information to obtain the authority information.
[0031] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0032] The verifier network executes the target operation statement according to the data processing event;
[0033] When the target operation statement is a data query statement, obtaining a data query result of a relational database;
[0034] When the target operation statement is a data update statement, the data in the relational database is updated.
[0035] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0036] When the verifier network parses the data processing event to determine that the target service node has write permission, the target operation statement is executed by the verifier;
[0037] When the verifier network determines from the data processing event that the target service node does not have the authority corresponding to the target operation statement, the relational database is not processed;
[0038] When the verifier network parses the data processing event and determines that the target operation statement of the target service node is a data query statement, the target operation statement is executed.
[0039] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0040] The data query result of the relational database or the result of updating the data in the relational database is broadcasted.
[0041] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0042] Receive a database update query request sent by the target business node, and send update information of the relational database in the consensus network to the target business node.
[0043] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the consensus node is further used for:
[0044] The relational database of the consensus network is decomposed into components to obtain an on-chain registry and a verifier network; wherein the on-chain registry is used to parse the permission information and target operation statements of the target business node in the data processing request; the verifier network is used to execute the target operation statement to update the data in the relational database.
[0045] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the business node is further used for:
[0046] Constructing a blockchain transaction according to the data processing request, and sending the blockchain transaction to the on-chain registry of the target consensus node;
[0047] Alternatively, based on the data processing request, the gateway device sends the data processing request to the on-chain registry of the target consensus node.
[0048] Optionally, in the data processing system based on the blockchain network in the embodiment of the present invention, the business node is further used for:
[0049] According to the data processing operation instruction, identifying a target operation statement of a target service node;
[0050] Sending the target operation statement to the gateway device;
[0051] The gateway device generates the data processing request according to the target operation statement, and then sends the data processing request to the on-chain registry of the target consensus node;
[0052] The data processing request carries the data processing authority information and database operation information of the target service node.
[0053] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory;
[0054] The memory is used to store programs;
[0055] The processor executes the program to implement the above method.
[0056] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.
[0057] The embodiments of the present application also disclose a computer program product or a computer program, which implements the above method when executed by a processor.
[0058] In an embodiment of the present invention, a business node generates a data processing request, and sends the data processing request to a target consensus node in a consensus network; the target consensus node then receives the data processing request sent by the target business node, and then verifies the data processing request according to an on-chain registry, and determines the access rights and target operation statements of the target business node; finally, a data processing event is generated according to the access rights and the target operation statement, and sent to a verifier network, and the verifier network executes the target operation statement according to the data processing event to obtain a data query result of a relational database or update the data in the relational database; the present invention can directly execute the target operation statement for the relational database carried in the data processing request without re-editing the processing function, thereby reducing the complexity of data processing. At the same time, since the data processing request sent by the target business node is performed in real time, the present invention processes the real-time data processing request in real time, thereby enhancing the timeliness and flexibility of data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0060] Figure 1A schematic diagram of the architecture of a distributed system provided by an embodiment of the present invention;
[0061] Figure 2 A network architecture diagram of a layered blockchain network provided by an embodiment of the present invention;
[0062] Figure 3 A specific network architecture of a layered blockchain network applied to an electronic invoice business application scenario provided by an embodiment of the present invention;
[0063] Figure 4 A flowchart of a data processing method based on a blockchain network provided by an embodiment of the present invention;
[0064] Figure 5 A flowchart of another data processing method based on a blockchain network provided by an embodiment of the present invention;
[0065] Figure 6 A flowchart of a data processing method based on a service node provided in an embodiment of the present invention;
[0066] Figure 7 A schematic diagram of the structure of a data processing system based on a blockchain network provided by an embodiment of the present invention;
[0067] Figure 8 A data processing flow chart of another data processing system based on a blockchain network provided by an embodiment of the present invention;
[0068] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0069] Fig.10 A schematic diagram of the structure of another electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] Before describing the embodiments of the present application in detail, necessary explanations are given to the technical terms or characteristic terms that may be involved in the embodiments of the present application:
[0072] The public key certificate system (PKI) mainly includes public and private key cryptography, x509 certificates, CA certificate issuance center, etc. In the certificate system, a certificate is the identity proof of a public key owner and is issued by a relevant organization (such as CA). Asymmetric encryption and digital signature can be implemented based on the public key certificate system.
[0073] Peer-to-peer network (P2P): A peer-to-peer network based on a specific type of network protocol. Network nodes do not require a central node to maintain the network status. Instead, each node maintains the node status of the entire network or the connection status of its adjacent nodes through broadcast interactions with adjacent nodes.
[0074] Layered blockchain: In industrial architecture applications, the consensus network and the witness network are separated; the consensus network mainly performs the core consensus algorithm, the witness network performs data clearing and synchronization, and completes related specific business based on the SPV node.
[0075] Alliance chain: a blockchain with an access mechanism, with consensus nodes and other nodes (business nodes). Generally speaking, any smart contract on the chain needs to be executed by all consensus nodes. If the execution results are consistent, the consensus nodes can reach a consensus. Business nodes generally do not execute smart contracts, but will synchronize the execution results of smart contracts through consensus nodes.
[0076] Local contract: In the blockchain, a smart contract runs on a business node. This type of smart contract has independent local storage and is only executed on a single business node. The consensus node will not execute the local contract. The execution result of the local contract can be submitted to the chain through the business node in the transaction.
[0077] Transaction clearing: After receiving the request for transaction synchronization from the business node, the consensus node synchronizes the transactions that the business node has the authority to read to the business node.
[0078] Symbols related to encryption and decryption: Enc(sk,msg) represents the ciphertext value obtained by encrypting the plaintext message msg using the key sk; Dec(pk,cipher) represents the plaintext value obtained by decrypting the ciphertext cipher using the key pk.
[0079] Subchain: A concept related to the parent chain. It can be understood that a subchain is a blockchain built on the underlying parent chain. Subchains are representatives of various industries or vertical fields of blockchains, and are also a general term for various blockchain projects in various fields. When a subchain is created, the relevant information of the subchain will be recorded in the parent chain, which means that data on the chain needs to rely on the parent chain for storage, verification, and traceability.
[0080] Trusted Execution Environment (TEE): Trusted Execution Environment is a hardware-based privacy computing solution. A secure area is built in the CPU through software and hardware methods, so that the programs and data loaded inside are protected in terms of confidentiality and integrity. TEE divides the system's hardware and software resources into two execution environments, the trusted part and the untrusted part (ordinary part). The two environments are isolated, and the untrusted part cannot access the storage and memory of the trusted part.
[0081] Instruction set extensions (SGX, software guard extensions): A trusted execution environment solution proposed by Intel that can support a trusted execution environment on specific models of CPUs produced by Intel. Other trusted execution environment solutions parallel to it include the ARM trustzone solution and AMD's sev solution. The trusted execution environment solution used in the embodiments of the present invention is the Intel SGX solution.
[0082] Trusted Execution Environment Hardware Key: When Intel produces the CPU, it burns the hardware key into the CPU. Its private key cannot be exported under any circumstances, but its public key can be exported in specific usage scenarios.
[0083] Trusted execution environment enclave program: The part of the SGX program that runs in the trusted execution environment, which is protected by the CPU hardware. The enclave can store data, and the stored data is encrypted by the private key of the trusted execution environment hardware key.
[0084] Authentication response quote: The quote contains some key information about the enclave. For example, the key information includes: the measurement value of the enclave program, the enclave program publisher information, a piece of information that can be specified by the requester to generate the response (i.e., the challenge), etc.
[0085] Enclave program metric: A unique value used to characterize each enclave program, calculated using the program's binary file and the program's initialization data. Any changes to the program will cause the metric to change.
[0086] SGX remote attestation: A method to prove the authenticity of a quote. The reliability of remote attestation is guaranteed by Intel. If a quote passes the attestation, it means: 1) the enclave program has not been tampered with; 2) the enclave program is really running on the SGX platform.
[0087] like Figure 1As shown in the figure, the nodes in the blockchain network include consensus nodes (i.e., accounting nodes that run the blockchain consensus protocol) and other types of nodes. Consensus nodes are nodes in the blockchain network that have block generation and consensus functions, and can be full nodes that store complete blockchains in the blockchain network. Consensus nodes in the blockchain network can be divided into master nodes and slave nodes. The so-called master node refers to the consensus node responsible for block generation (i.e., generating blocks) at the current stage, and the so-called slave node refers to the consensus node other than the master node in the blockchain network. The current stage can refer to the current block height.
[0088] Based on the blockchain network shown in the embodiment of the present invention, a data processing method is proposed. In the method, the embodiment of the present invention generates a data processing request through a business node, and sends the data processing request to a target consensus node in the consensus network; then the target consensus node receives the data processing request sent by the target business node, and then verifies the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node; finally, a data processing event is generated according to the access rights and the target operation statement and sent to the verifier network, and the verifier network executes the target operation statement according to the data processing event to obtain the data query result of the relational database or update the data in the relational database; the present invention can directly execute the target operation statement for the relational database carried in the data processing request without re-editing the processing function, thereby reducing the complexity of data processing. At the same time, since the data processing request sent by the target business node is performed in real time, the present invention processes the real-time data processing request in real time, thereby enhancing the timeliness and flexibility of data processing.
[0089] It should be noted that the relevant data acquisition process and data processing requests involved in the various embodiments of the present invention should strictly comply with the requirements of relevant national laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0090] In addition, consensus nodes and other types of nodes can be computer devices such as terminals or servers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms based on cloud computing services. The terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The nodes can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.
[0091] based on Figure 1 As shown in the blockchain network, the blockchain network is a distributed system formed by multiple nodes, and a peer-to-peer network is formed between the nodes. A smart contract is an automated computer program running on a blockchain that is used to perform predefined operations under the terms of a contract. These contracts are stored on the blockchain in the form of code and can be automatically executed by nodes on the blockchain. Smart contracts have a variety of applications on the blockchain, including identity authentication, voting, supply chain management, and more. Since smart contracts are executed by code, they can be automatically executed without human intervention, thereby eliminating intermediaries, improving efficiency, and reducing transaction costs. As blockchain develops, smart contracts have become more and more complex. Smart contracts need to store, read, and process more complex and massive data. These data processing often bring additional complexity to the code; developers need to write data reading, data updating, and data filtering functions in the contract themselves. For data of different structures, multiple functions often need to be written.
[0092] In addition, another problem caused by the coupling of data and contracts is that data processing is not flexible enough. When developers need to use complex conditions to filter data, they need to add new functions to the smart contract instead of directly querying the data.
[0093] Based on this, the embodiment of the present invention proposes a blockchain network, and proposes a data processing solution based on the blockchain network. Figure 2 , the blockchain network proposed in the embodiment of the present application includes a witness network and a consensus network, and the witness network and the consensus network are connected through a gateway device. Among them, the gateway device is a computer system or device that provides data conversion services between multiple networks. Exemplarily, the gateway device can be a network switch with a three-layer switching function, the gateway device can also be a router, the gateway device can also be a firewall or a host with a routing function enabled by software. The present invention does not limit the specific manifestation of the gateway device. It should be noted that the witness network is composed of a plurality of business node networks, and the consensus network is composed of a plurality of consensus node networks. The consensus nodes participate in the accounting consensus. The business nodes are light nodes, which are mainly used for business execution and do not participate in the accounting consensus. The business nodes can obtain the corresponding data from the consensus network through identity authentication (the data includes public data (such as block headers), or personal data of business nodes (such as partially authorized visible transaction data)).
[0094] It is understandable that the blockchain network proposed in the embodiment of the present application can be regarded as a layered blockchain network, including two single-layer blockchain networks: a witness network and a consensus network. The business nodes in the witness network and the consensus nodes in the consensus network can refer to the basic equipment used for data processing in the witness network and the consensus network, respectively, which may include but are not limited to: smart terminals, tablet computers, desktop computers, servers and other electronic devices.
[0095] Among them, the witness network and the consensus network are in different network security environments. In one embodiment, the witness network is in a public network, and the consensus network is in a private network. Since the consensus network is in a relatively secure private network, the mutual access between consensus nodes in the consensus network has a consensus mechanism to ensure security, and no additional identity management and network control are required. However, the business node is in a public network and may be accessed by other uncertain network terminals. In order to improve the security of data in the consensus network, the behavior of business nodes and other possible nodes accessing the consensus network needs to be strictly controlled (for example, access is allowed only after identity authentication is passed).
[0096] like Figure 3 As shown in the figure, the specific network architecture of the layered blockchain network applied to the electronic invoice business application scenario is shown. The business layer is in the witness network and will submit business operation interactions to the core consensus network layer. The business layer, routing proxy layer, and core consensus network layer constitute a complete blockchain business system. Among them, the routing proxy layer plays a role in isolating the business layer and the core consensus network layer. The routing proxy layer is in the routing proxy network. The routing device and content distribution network device can be Figure 3 The proxy node shown in , or set in Figure 3 In the agent node shown in .
[0097] It can be understood that the embodiment of the present invention is based on data processing of a layered blockchain network, in which the business node is a light node (SPV node) for business execution and payment verification. Specifically, the SPV node generally sets a BoomFi lter in the connection with the adjacent node (it should be noted that the BoomFi lter only receives transactions containing wallets and public key addresses). When the adjacent node sees that a transaction (TX) meets the BoomFi lter condition of the SPV node, it sends a block to the SPV node through a merkleb lock message (i.e., merkleb lock: a Merkle path containing BlockHead and a MerkleRoot connected to the TX); the SPV node can use the merkle path to link the TX with the block containing the TX, and use the BlockHead to verify that the Block containing the TX is on the BlockChiain and has been confirmed by 6 times. After these two verifications, it can be obtained that the TX exists on the blockchain. It should be noted that the SPV only needs to receive BlockHead and merkle path data less than 1KB. For example, the SPV verification process is as follows:
[0098] Obtain and save all block headers of the longest chain from the network to the local; calculate the hash value tx_hash of the transaction; locate the block containing the tx_hash, and verify whether the block header is included in the known longest chain; obtain the hash value required to build the merkle tree from the block; calculate merkle_root_hash based on the hash value; if the calculation result is equal to the merkle_root_hash in the block header, the transaction really exists. According to the location of the blockheader, determine how many confirmations the transaction has received. For example, the process of verifying whether the H(K) transaction has been paid is as follows: First, the node obtains the authentication path of the transaction to be verified from the network and generates the corresponding path on the node. In the case of path confirmation, the node only needs to calculate the hash values of H(KL), H(IJKL), H(IJKLMNOP), and H(ABCDEFGHIJKLMNOP) twice, so as to obtain a copy of the merkle root. Since the SPV node stores all the block headers of the entire blockchain, it only needs to compare this copy with the merkle root in the block header. If it exists, it means that the transaction payment is successful. Through the SPV node, payment verification in the light wallet is realized.
[0099] It is understandable that the data processing method based on the blockchain network provided by the embodiment of the present invention is executed based on a trusted execution environment. The trusted execution environment is a "region" that is independently divided at the chip level. This area does not necessarily occupy the physical position of the chip, but only occupies the execution space logically. This space is called Enclave in Intel SGX and Secure World in ARM TrustZone. This area is responsible for providing a more secure center for code execution and data storage, thereby improving its confidentiality and non-tamperability. It is understandable that in the absence of TEE, the chip executes the code, and the code needs to be stored in the external cache of the chip, or in the "memory" or hard disk inside the chip. However, whether it is stored in the cache or in the memory, all the code and execution process can be read by other programs, resulting in the code execution process There is no privacy, which is unfavorable for some applications that need to hide code and code flow. TEE provides an independent area for code execution at the chip level. This independent area cannot be obtained by other programs from the software and hardware level, thereby improving the security performance of the code executed in this area. TEE is a code execution area that is not affected by internal factors. By putting sensitive information, such as plain code, into TEE, the plain code is verified through the interface provided by TEE. In this way, as long as the data outside TEE is not covered or the chip containing TEE is not lost, TEE can always provide verification of the plain code, and the plain code cannot be obtained by external programs. On the other hand, TEE will also periodically provide data integrity verification through the API interface, so that the external environment can know whether the stored value outside TEE has changed. It can be understood that the main core capabilities of TEE are:
[0100] 1. Signature key
[0101] The signing key must be randomly generated and cannot be changed. The private key must be kept securely and cannot be obtained by any means except for calling the specified interface. The public key is used to authenticate and encrypt sensitive data to be sent.
[0102] 2. Safety input and output
[0103] Input and output refer to the interaction between the terminal and the system, and its channels include keyboard, peripherals, network interface, etc. Secure input and output means that there is a protected path from the terminal to the accessed process.
[0104] 3. Storage shielding
[0105] Storage shielding extends general storage protection technology and provides completely independent storage areas. Even the operating system itself does not have full access to the shielded area, so even if an intruder controls the operating system, the runtime data is safe.
[0106] 4. Sealed storage
[0107] Sealed storage protects private information by bundling it with the platform environment configuration information used by the terminal. It is understandable that the data in sealed storage can only be read in the same security environment.
[0108] 5. Remote authentication
[0109] Remote authentication means that a software certificate of the current system is generated by signing a key. Any changes on the system can be perceived and verified by the remote authorization party through the certificate, making the execution logic of the system safe and reliable.
[0110] like Figure 4 As shown, the embodiment of the present application provides a data processing method based on a blockchain network, wherein, with reference to Figure 2 As shown in the figure, the blockchain network includes a mutually isolated witness network and a consensus network. The witness network is composed of a plurality of business nodes, and the consensus network is composed of a plurality of consensus nodes. The consensus nodes are deployed with on-chain registry and validator network, and the witness network and the consensus network are connected through a gateway device. Among them, the business nodes are deployed in the witness network in the public network, while the accounting nodes running the blockchain consensus protocol are deployed in the private consensus network, and the two interact through the routing boundary. It is understandable that the consensus network is in a relatively secure private cloud, and its mutual access is guaranteed by the consensus mechanism, and no additional identity management and network control are required. However, the business nodes are in the public network and may be accessed by other uncertain network terminals. Therefore, the behavior of the business nodes and other possible nodes accessing the consensus network needs to be strictly controlled.
[0111] refer to Figure 4 The data processing method based on the blockchain network provided by the embodiment of the present invention specifically includes but is not limited to steps S100-S400:
[0112] S100, receiving a data processing request sent by a target service node, where the data processing request carries data processing authority information and database operation information of the target service node;
[0113] Among them, the target business node is in the witness network;
[0114] In some possible implementations, based on Figure 2In the network architecture diagram of the blockchain in the embodiment of the present invention, the business node is located in the witness network, which is in a public network environment and may be accessed by other network terminals, and has low security performance; therefore, when the target business node accesses data, it is necessary to verify the data processing authority of the target business node. Only the target business node with data processing authority can read and write to the database in the consensus node. Therefore, the data processing request needs to carry the data processing authority of the target business node and the operation information on the database. It can be understood that the data processing request issued by the target business node is received by the consensus node, and the data processing request is verified and executed to complete the data processing. At the same time, it can be understood that the number of business nodes in the embodiment of the present invention can be multiple, and the present invention does not make specific restrictions. Among them, in the current data interaction process, the node that issues the data processing request is regarded as the target business node.
[0115] For example, refer to Figure 5 In the data processing method based on blockchain network in one embodiment shown, the business node can be the client of DApp. Specifically, Decentralized Application (DApp) is a new software application mode with blockchain technology as the application environment. It is understandable that the current mature software applications generally have one or more central nodes, such as smartphone APP, Web server nodes, while DApp does not have such a central node. DApp is an application software built and able to run on the blockchain environment, and the users of DApp jointly maintain and manage the life cycle of DApp. Generally speaking, DApp refers to an application that runs on a distributed network, the information of the participants is securely protected (it may also be anonymous), and decentralized operations are performed by different people through network nodes. From a relevant perspective, it is a transaction protocol, a contract or a group of contracts executed according to the conditions set on the blockchain. It is understandable that there are currently some application cases of DApp, such as online games, virtual digital assets, etc. Since the DApp application model has no central node, it is necessary to improve the reliability of DApp users. In the embodiment of the present invention, the DApp terminal is regarded as the target business node. When the operator interacts with the DApp terminal visually and attempts to update or read some information in the database stored in the consensus node, a data processing request is issued. The consensus node in the consensus network receives the data processing request and processes the data processing request through the data processing method provided by the present invention. In the embodiment of the present invention, the security and confidentiality of the data can be improved by distinguishing each node according to its function.
[0116] S200, verifying the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node;
[0117] In some possible implementations, the on-chain registry is used to verify the data processing request to obtain the access rights of the target business node and the target operation statement of the target business node. Exemplarily, the on-chain registry may have access control logic (Access Control Lists, ACL), that is, by associating policies with resources to manage access to resources, each policy is used to specify a rule for which the evaluation result of a preset identifier is true or false. In an embodiment of the present invention, by using an on-chain registry with access control logic, the data processing request is verified by setting ACL permissions for the on-chain registry to determine whether the target business node has read and write permissions. At the same time, the target operation statement is determined to update or read the database. It can be understood that the target operation statement at least includes a data update statement for the database or a data query statement for the database. The present invention does not limit the specific execution logic of the target operation statement.
[0118] S300, generating a data processing event according to the access authority and the target operation statement and sending it to the verifier network, and then the verifier network executes the target operation statement according to the data processing event to obtain the data query result of the relational database or update the data in the relational database.
[0119] In some possible implementations, refer to Figure 5 As shown, a validator network is deployed on the consensus network. It is understandable that a validator refers to an entity (individual or enterprise, organization, etc.) that proposes a new block for the blockchain, or an entity that confirms / proves blocks proposed by other validators. In some possible implementations, a validator is used to characterize a node, that is, a computer that proposes and proves blocks. The embodiment of the present invention identifies access rights through a validator network, and executes a target operation statement when the target business node has access rights. It is understandable that when the target operation statement is a data query statement for a database, the validator network performs a data query on the relational database to obtain a data query result; when the target operation statement is a data update statement for a database, the validator network performs a data update operation on the relational database to respond to the data processing request of the target business node. It can be known that a relational database is a database created on the basis of a relational model, and uses mathematical concepts and methods such as set algebra to process data in the database. The standard data query language SQL is a language based on a relational database, which performs retrieval and various operations on data in a relational database. Exemplarily, referring to Figure 5As shown in the figure, during the electronic transaction process, if the target business node needs to read transaction information within a period of time, it can issue a data processing request through the relational data read and write gateway (i.e., gateway device). The consensus node reads the data and executes the SQL language to respond to the data processing request and generate an SQL transaction event. It should be noted that Figure 5 The data processing process shown is an illustrative example, and the present invention does not limit the specific form of the execution statement.
[0120] It can be seen that the blockchain network of the embodiment of the present invention includes a witness network and a consensus network that are isolated from each other. The witness network is composed of a plurality of business nodes, and the consensus network is composed of a plurality of consensus nodes. The consensus nodes are deployed with an on-chain registry and a verifier network, and the witness network and the consensus network are connected through a gateway device. The present invention divides the blockchain network into a witness network and a consensus network, and can distinguish each node according to its function. On the one hand, a layered blockchain network can be realized, and only some nodes in the blockchain network need to be used as consensus nodes, which is conducive to improving the consensus efficiency. On the other hand, nodes in different networks can be made to store different data, thereby realizing a blockchain deployment method with unequal data, and improving the security and confidentiality of data. In addition, the present invention generates a data processing request through a business node, and sends the data processing request to a target consensus node in the consensus network; the target consensus node then receives the data processing request sent by the target business node, and then verifies the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node; finally, a data processing event is generated according to the access rights and the target operation statement and sent to the verifier network, and the verifier network executes the target operation statement according to the data processing event to obtain a data query result of the relational database or update the data in the relational database; the present invention can directly execute the target operation statement for the relational database carried in the data processing request without re-editing the processing function, thereby reducing the complexity of data processing. At the same time, since the data processing request sent by the target business node is performed in real time, the present invention processes the real-time data processing request in real time, thereby enhancing the timeliness and flexibility of data processing.
[0121] In some embodiments, the step S200 of the above embodiment, verifying the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node, may include but is not limited to steps S210-S220:
[0122] S210: Execute the data processing request through the first smart contract in the on-chain registry, and parse to obtain the second smart contract of the target business node and the target operation statement included in the data processing request;
[0123] S220. Determine the authority information of the target business node according to the second smart contract.
[0124] In some possible implementations, it is understood that a smart contract may be included in a blockchain system. A smart contract is a computer protocol designed to disseminate, verify or execute a contract in an information-based manner, which allows trusted transactions to be conducted without a third party, and these transactions are traceable and cannot be tampered with. A smart contract may refer to a code that can be understood and executed by each node in a blockchain system, which can execute any logic and obtain results. It should be understood that a blockchain system may include one or more smart contracts, which may be distinguished by an identification number (ID) or name, and the business request may carry the identification number or name of the smart contract to specify the smart contract that the blockchain system needs to run. In an embodiment of the present invention, the data processing request issued by the target business node is parsed by the first smart contract of the on-chain registry to obtain a second smart contract corresponding to the target business node; wherein the second smart contract includes permission information for the target business node. At the same time, the first smart contract can also obtain the target operation statement contained in the data processing request by parsing the data processing request. For example, in a shopping scenario, if the terminal corresponding to the target business node has received the goods sent by the seller, the transaction needs to be settled, the payment needs to be deposited into the seller's account, and a write operation is performed on the database corresponding to the transaction to record the transaction process. In this scenario, the data processing request issued by the target business node should include a data update statement for updating the database. After the consensus network receives the data processing request, the target operation statement parsed from the data processing request through the first smart contract in the on-chain registry is a data update statement. It can be understood that if in the electronic ticketing scenario, Company A needs to query the taxes paid, it needs to issue a data processing request through the corresponding target business node. The data processing request includes a data query statement for querying the database to implement a query operation on the taxes paid. At this time, the target operation statement parsed by the first smart contract in the on-chain registry is a data query statement.
[0125] It is understandable that the embodiment of the present invention performs permission verification through the on-chain registry deployed on the consensus node in the consensus network, and after determining the permissions of the business node, the subsequent steps can execute the corresponding SQL query statement. Specifically, only the terminal with the corresponding on-chain permission can perform relevant operations on a specific registry.
[0126] Exemplarily, the on-chain registry in the embodiment of the present invention can be a related contract deployed on the chain. The smart contract deployment address is initially set to the on-chain registry owner, who can set permissions for any other terminal that attempts to interact with the registry with variable capabilities. Specifically, the owner can set permission rules, exemplarily setting the business nodes that are allowed to update / insert / delete value operations, or setting which data the business nodes can modify; the owner can also decide whether to transfer the ownership table, and the transferee of the transfer. It should be noted that for complex data queries, data from multiple registries (owned or not) can be connected to create a fully dynamic and composable relational data layer to implement data update or data query operations on the database.
[0127] In some embodiments, the step S220 of the above embodiment, determining the authority information of the target business node according to the second smart contract, may include but is not limited to steps S221-S223:
[0128] S221. Execute the second smart contract and parse to obtain a third smart contract of the target business node;
[0129] S222. Execute the third smart contract to obtain access control logic information of the target business node;
[0130] S223: Determine the access rights of the target service node according to the access control logic information, and obtain the permission information.
[0131] In some possible implementations, the third smart contract of the target business node is obtained by parsing the second smart contract; the access control logic (ACL) corresponding to the target business node is obtained through the third smart contract, and the access rights of the target business node are obtained through the ACL, thereby obtaining the permission information. It is understandable that the target operation statement can only be executed when the target business node has access rights to the corresponding consensus node. For example, referring to Figure 5 In the data processing method of one embodiment shown, the DApp terminal calls the second smart contract corresponding to the relational data registry (i.e., the on-chain registry) to run SQL statements, and the second smart contract checks the third smart contract of the DApp, which contains a custom ACL that defines the permissions of this new account. It should be noted that the custom ACL in the third smart contract of the DApp terminal is a completely optional but advanced use case; specifically, the developer does not need to implement a custom ACL, and can use the default policy of the third smart contract corresponding to the registry to implement the reading of permission information (only the owner has full permissions). In this embodiment of the present invention, the custom ACL is parsed through a smart contract. In this process, the developer does not need to customize the ACL, which greatly reduces the complexity of the data processing process.
[0132] Exemplarily, for the metadata of the relevant smart contract, the data processing method provided by the embodiment of the present invention can be used, using the native dynamic metadata of the table hosted on the relational data access service, where each row contains the metadata (name, image, attributes, etc.) of the specific smart contract, and these metadata will change over time (i.e., the smart contract updates the table value according to the owner's contribution); through the above settings, the metadata of the relevant smart contract can be read or modified through the data processing method provided by the embodiment of the present invention. For in-game inventory / assets, the terminal is allowed to add the property of the corresponding character to the table or select equipment specific attributes / customization (i.e., granting the terminal write permission to the columns and rows of a specific table); through the above settings, the corresponding data in the game scene can be read or modified through the data processing method provided by the embodiment of the present invention. For DAO shared state and access, the table deployed on this service is used as a cross-organizational shared knowledge base or shared data set, where only DAO members have the right to update the table (for example, non-members can only read data, DAO members can update, and the permissions of members who leave the DAO will be revoked); through the above settings, the DAO can be accessed through the data processing method provided by the embodiment of the present invention.
[0133] In some embodiments, the step S300 of the above embodiment, in which the verifier network executes the target operation statement according to the data processing event to obtain the data query result of the relational database or update the data in the relational database, may include but is not limited to steps S310-S330:
[0134] S310, the verifier network executes the target operation statement according to the data processing event;
[0135] S320, when the target operation statement is a data query statement, obtaining a data query result of the relational database;
[0136] S330: When the target operation statement is a data update statement, update the data in the relational database.
[0137] In some possible implementations, the verifier network selects a feasible way to execute the target operation statement according to the specific form of the target operation statement. Specifically, the target operation statement can be executed by directly accessing the smart contract of the on-chain registry. Exemplarily, for the electronic transaction process, the data modification is fed back in the form of constructing a blockchain transaction and sending the transaction. The target operation statement can also be executed by means of a gateway device. In this process, there is no need to construct a blockchain transaction, only to submit an SQL statement, and then the gateway device parses the SQL statement into transaction construction and submission actions. It should be noted that the above two execution methods are finally submitted to the smart contract of the on-chain registry. It can be understood that executing the target operation statement by means of a gateway device provides a way for standard query and writing of relational databases for the embodiments of the present invention. Through a variety of implementation methods, the selectivity of the data processing method provided by the present invention is improved, so that the data processing method provided by the present invention can adapt to a variety of application scenarios.
[0138] It is understandable that when the target operation statement is a data query statement, the data query result of the relational database is obtained through the verifier network. Generally, read queries are free. When the target operation statement is a data update statement, the data update result of the relational database is obtained through the verifier network. Exemplarily, the business node in the witness network determines the storage data update information, and uses the data update information as the target operation statement to generate a data processing request. Specifically, the storage data update information may include: relevant information of the data stored in the current memory, relevant information of the data cached in the current cache, data adjustment information in the memory, and one or more of the data adjustment information in the cache. Among them, the data adjustment information includes relevant information of the added data and relevant information of the cleared data. The relevant information can be the data itself, or it can be characteristic information such as the identification of the data. It is understandable that the business node in the witness network sends the data processing request carrying the storage data update information to the gateway device, and the gateway device responds to the data synchronization request, updates the data storage information of the business node recorded based on the storage data update information, updates the data in the relational database, and feeds back the processing result to the business node.
[0139] In some embodiments, the above-mentioned step S310, the step of executing the target operation statement by the verifier network according to the data processing event, may include but is not limited to steps S311-S313:
[0140] S311. When the verifier network determines from the data processing event that the target business node has write permission, the target operation statement is executed through the verifier;
[0141] S312: When the verifier network determines from the data processing event that the target business node does not have the authority corresponding to the target operation statement, the relational database is not processed;
[0142] S313: When the verifier network parses the data processing event and determines that the target operation statement of the target business node is a data query statement, the target operation statement is executed.
[0143] In some possible implementations, when the target business node has different permissions on the consensus network, the validator network will take different processing measures. It is understandable that when the target business node has write permission, the target operation statement is executed by the validator to obtain the data query result of the relational database or update the relational database. When the target business node does not have the corresponding permission, the validator network does not process the relational database. When the target operation statement of the target business node is a data query statement, the data query operation is executed. For example, refer to Figure 5 As shown, the smart contract corresponding to the on-chain registry obtains the SQL statement and permissions of the business terminal, and merges the SQL statement and permissions into the issued data processing request, which includes the SQL-based operations that need to be taken. The validator network listens to the above data processing request and then performs one of the following operations:
[0144] a. If the target business node has the correct permissions to write to the registry, the validator will run the SQL command (exemplarily, insert a new row into a table or update an existing value) and broadcast the confirmation data to the validator network.
[0145] b. If the target business node does not have the corresponding authority, the validator network will not take any action on the table.
[0146] c. If the request is only a read query (data query statement), the data query operation is executed and the corresponding data is returned. Therefore, the embodiment of the present invention can directly execute the target operation statement for the relational database carried in the data processing request without re-editing the processing function, thereby reducing the complexity of data processing.
[0147] In some embodiments, the data processing method based on the blockchain network provided by the embodiment of the present invention further includes step S340:
[0148] S340: Broadcast the data query result of the relational database or the result of updating the data in the relational database.
[0149] In some possible implementations, the embodiments of the present invention broadcast the results of data queries on a relational database or the results of updating data in a relational database to the verifier network and thus to the target business nodes.
[0150] In some embodiments, the data processing method based on the blockchain network provided by the embodiment of the present invention further includes step S400:
[0151] S400, receiving a database update query request sent by a target business node, and sending update information of the relational database in the consensus network to the target business node.
[0152] In some possible implementations, when the target business node needs to perform an update query on the database, it can issue an update query request. After receiving the update query request, the consensus network queries the updates made to the relational database in the consensus network and sends the update information to the target business node to complete the database update query. It should be noted that the target business node can perform any update query on the relational database it is concerned about. For example, refer to Figure 5 In one embodiment shown, the DApp terminal can obtain any updates that occur in the relational database table that the current DApp terminal is concerned about on the validator network through the gateway device. The embodiment of the present invention can perform real-time processing for update query operations, thereby enhancing the timeliness and flexibility of data processing.
[0153] In some embodiments, the data processing method based on the blockchain network provided by the embodiment of the present invention further includes step S500:
[0154] S500. The relational database of the consensus network is decomposed into components to obtain an on-chain registry and a verifier network; wherein the on-chain registry is used to parse the permission information and target operation statements of the target business node in the data processing request; the verifier network is used to execute the target operation statement to update the data in the relational database.
[0155] In some possible implementations, the relational database of the consensus network is split to obtain an on-chain registry and a verifier network. It is understandable that the on-chain registry parses the permission information and target operation statement of the target business node in the data processing request through the data processing method shown in steps S210 to S220 above. The verifier network executes the target operation statement through the data processing method shown in steps S310 to S330 above to update the data in the relational database. For example, referring to Figure 5As shown, the embodiment of the present invention decomposes the traditional relational database into two main components: an on-chain registry with access control logic (ACL) and a relational data validator network. Read and write access to the relational database is provided by the validator network, and its data is on the core chain (in the consensus network). There is no independent relational database in the blockchain network in the embodiment of the present invention. Data reading and writing are interactively executed with the on-chain smart contract, but a layer of read and write gateway is provided by the present invention, so that the application can complete data reading and writing operations like accessing a relational database. Exemplarily, each table in the architecture is initially set up as a related digital asset on the basic compatibility layer. Therefore, the on-chain registry owner can set ACL permissions for the table, and the off-chain relational data validator cluster manages the creation and subsequent changes of the registry itself. The links between the on-chain and off-chain are processed at the contract level, and all contract-level processing is converted into states in the relational database maintained by the validator through events.
[0156] The data processing method provided by the embodiment of the present invention alleviates the problem of insufficient flexibility of data processing caused by the coupling of data and smart contracts. In the related art, when developers need to use complex conditions to filter data, they need to add new functions to the smart contract, and cannot directly query the data. Through the embodiment provided by the present invention, the complex data application of the web2 model and the decentralized security of web3 that relies on blockchain smart contracts to maintain status can be simply and efficiently combined, helping developers to open on-chain applications more conveniently. At the same time, there are problems in the related art that on-chain data storage costs are higher and contract logic execution and writing are difficult. The embodiment provided by the present invention can transfer some data modification, authentication and storage methods to the off-chain database, effectively reducing the cost of application.
[0157] Reference Figure 6 is a flow chart of another data processing method based on a blockchain network provided in an embodiment of the present application, such as Figure 6 As shown, the blockchain network includes a mutually isolated witness network and a consensus network, the witness network is composed of a plurality of business nodes, the consensus network is composed of a plurality of consensus nodes, the consensus nodes are deployed with an on-chain registry and a validator network, and the witness network and the consensus network are connected via a gateway device; the data processing method includes steps T100-T200:
[0158] T100, generating a data processing request in response to the data processing operation instruction;
[0159] T200, sending a data processing request to a target consensus node in the consensus network, so that the target consensus node executes the above data processing method after receiving the data processing request, thereby obtaining a data query result of the relational database or updating the data in the relational database.
[0160] In some possible implementations, when data reading or writing operations are required, the business node of the witness network generates a data processing request in response to the data processing operation instruction. The data processing request is sent to the target consensus node in the consensus network. The target consensus node in the consensus network processes the data processing request through the data processing method shown in steps S100 to S300 above to obtain the data query result of the relational database or update the data in the relational database. It can be understood that, referring to Figure 2 As shown in the network structure diagram, the target business node can be any terminal with data processing capabilities, and accordingly, the target consensus node can also be any terminal with data processing capabilities. Exemplarily, in an electronic transaction scenario, the target consensus node can also be regarded as an accounting node, representing a node that performs read operations on the accounting database. It can be understood that the present invention can directly execute the target operation statement for the relational database carried in the data processing request without re-editing the processing function, thereby reducing the complexity of data processing. At the same time, since the data processing request sent by the target business node is carried out in real time, the present invention processes the real-time data processing request in real time, thereby enhancing the timeliness and flexibility of data processing.
[0161] In some embodiments, the step T200 of the above embodiment, the step of sending the data processing request to the target consensus node in the consensus network, may include but is not limited to steps T210 and T220:
[0162] T210, construct a blockchain transaction according to the data processing request, and send the blockchain transaction to the on-chain registry of the target consensus node;
[0163] or,
[0164] T220. Based on the data processing request, the gateway device sends the data processing request to the on-chain registry of the target consensus node.
[0165] In some possible implementations, the target consensus node in the consensus network selects a feasible way to execute the target operation statement according to the specific form of the target operation statement. Specifically, the target operation statement can be executed by directly accessing the smart contract of the on-chain registry. Exemplarily, for the electronic transaction process, data modifications are fed back in the form of constructing a blockchain transaction and sending the transaction. The target operation statement can also be executed by means of a gateway device. In this process, there is no need to construct a blockchain transaction, only to submit an SQL statement, which is then parsed by the gateway device into transaction construction and submission actions. It should be noted that the above two execution methods are finally submitted to the smart contract of the on-chain registry. It can be understood that the gateway device method provides a way for standard query and writing of relational databases for the embodiments of the present invention. Through a variety of implementation methods, the selectivity of the data processing method provided by the present invention is improved, so that the data processing method provided by the present invention can adapt to a variety of application scenarios.
[0166] In some embodiments, the step T220 of the above embodiment, in which the gateway device sends the data processing request to the on-chain registry of the target consensus node according to the data processing request, may include but is not limited to steps T221-T223:
[0167] T221. Identify a target operation statement of a target business node according to the data processing operation instruction;
[0168] T222, sending the target operation statement to the gateway device;
[0169] T223. The gateway device generates a data processing request according to the target operation statement, and then sends the data processing request to the on-chain registry of the target consensus node;
[0170] The data processing request carries the data processing authority information and database operation information of the target business node.
[0171] In some possible implementations, when the target operation statement is a data query statement, the query operation on the database can also be performed using a gateway device, without directly calling the smart contract of the registry. Specifically, the target operation statement is sent to the gateway device; the gateway device generates a data processing request based on the target operation statement, and then sends the data processing request to the on-chain registry of the target consensus node. It can be understood that, referring to Figure 5As shown, the path for data query can be selected through the DApp terminal, that is, the DApp terminal can choose to directly call the relational data registry smart contract to perform data query operations, or it can perform data query operations through a gateway device, and the present invention does not impose specific restrictions. When performing data query through a gateway device, the data to be queried can be sent through the gateway device, and the gateway device will relay the query to the smart contract itself in a way of subsidizing transaction fees. Among them, the way of subsidizing transaction fees means that if the write performed through the gateway requires the construction of a blockchain transaction chain, the relevant transaction fees are paid by the gateway side.
[0172] Reference Figure 7 , is a data processing system 800 based on a blockchain network provided in an embodiment of the present application, such as Figure 7 As shown, the system includes a mutually isolated witness network and consensus network. The witness network is composed of a plurality of business nodes, and the consensus network is composed of a plurality of consensus nodes. The consensus nodes are deployed with an on-chain registry and a validator network. The witness network and the consensus network are connected through a gateway device.
[0173] The service node 810 is used for:
[0174] generating a data processing request in response to the data processing operation instruction;
[0175] Send the data processing request to the target consensus node in the consensus network;
[0176] Consensus node 820 is used to:
[0177] receiving a data processing request sent by a target business node, the data processing request carrying data processing authority information and database operation information of the target business node; wherein the target business node is in a witness network;
[0178] Verify the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node;
[0179] A data processing event is generated based on the access rights and the target operation statement and sent to the validator network. The validator network then executes the target operation statement based on the data processing event to obtain the data query result of the relational database or update the data in the relational database.
[0180] Combination Figure 8 , taking the electronic transaction scenario as an example, the specific implementation process of the data processing system based on the blockchain network in the technical solution of the present invention is described:
[0181] First, when company A needs to inquire about the tax payment status of the previous quarter, the operation terminal corresponding to the company can be regarded as a business node. The operator issues a data processing operation instruction for tax payment inquiry through the operation terminal. The business node responds to the data processing operation instruction and generates a data processing request; and sends the data processing request to the target consensus node in the consensus network, so that the target consensus node in the consensus network processes the quantity processing request and obtains the data processing result. Secondly, the consensus node receives the data processing request sent by the target business node. It can be known that the data processing request carries the data processing permission information and database operation information of the target business node. The consensus node verifies the data processing request according to the on-chain registry, determines the access rights and target operation statements of the target business node; and generates a data processing event based on the access rights and target operation statements and sends it to the verifier network, and then the verifier network executes the target operation statement according to the data processing event to obtain the data query result of the relational database or update the data in the relational database. Finally, the consensus node sends the data query result of the relational database or the update data of the relational database to the business node; the company obtains the query result through the operation terminal. It is understandable that the data processing method based on blockchain provided by the present invention can also be used in other fields such as shared ledgers, smart contracts, shared economy and digital assets. Through the data processing process between the business node and the consensus node, the target operation statement for the relational database carried in the data processing request is directly executed without re-editing the processing function, which reduces the complexity of data processing. At the same time, since the data processing request sent by the target business node is carried out in real time, the present invention processes the real-time data processing request in real time, which enhances the timeliness and flexibility of data processing.
[0182] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory;
[0183] The memory stores a program;
[0184] The processor executes the program to perform the data processing method based on the blockchain network as described in the aforementioned embodiments.
[0185] The electronic device for executing the above-mentioned data processing method based on the blockchain network provided in the embodiment of the present invention may be a terminal. Fig. 9 , Fig. 9This is a partial structural block diagram of a terminal provided in an embodiment of the present application. The terminal includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art can understand that Fig. 9 The terminal structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0186] The RF circuit can be used to receive and send signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor for processing; in addition, the designed uplink data is sent to the base station.
[0187] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory.
[0188] The input unit can be used to receive input digital or character information and generate key signal input related to the setting and function control of the mobile phone. Specifically, the input unit can include a touch panel 1031 and other input devices 1032.
[0189] The display unit 1040 may be used to display input information or provided information and various menus of the mobile phone. The display unit 1040 may include a display panel 1041 .
[0190] The audio circuit 1060 , the speaker 1061 , and the microphone 1062 may provide an audio interface.
[0191] In this embodiment, the processor included in the terminal can execute the data processing method based on the blockchain network of the previous embodiment.
[0192] The electronic device for executing the above-mentioned data processing method based on the blockchain network provided in the embodiment of the present application may also be a server, referring to Fig.10 , Fig.10This is a partial structural block diagram of a server provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1122 (for example, one or more processors) and a memory 1132, and one or more storage media 1130 (for example, one or more mass storage devices) storing application programs 1142 or data 1144. Among them, the memory 1132 and the storage medium 1130 can be short-term storage or permanent storage. The program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server 1100. Furthermore, the central processing unit 1122 can be configured to communicate with the storage medium 1130 and execute a series of instruction operations in the storage medium 1130 on the server 1100.
[0193] The server may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM, etc.
[0194] The processor in the server can be used to execute the above blockchain network-based data processing method.
[0195] An embodiment of the present application also provides a computer-readable storage medium, which stores a program, and the program is executed by a processor to complete the data processing method based on the blockchain network as in the aforementioned embodiments.
[0196] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data processing method based on the blockchain network as described in the above embodiments.
[0197] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0198] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features described may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0199] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0200] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0201] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0202] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0203] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0204] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0205] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A data processing method based on a blockchain network, characterized in that: include: Receive a data processing request sent by a target service node; Verify the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node; Generate a data processing event according to the access authority and the target operation statement; wherein the data processing event represents the database operation intention of the target service node; The target operation statement is executed according to the data processing event to obtain a data query result of a relational database or to update the data in the relational database.
2. A data processing method based on a blockchain network according to claim 1, characterized in that: The verifying the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node includes: Execute the data processing request through the first smart contract in the on-chain registry, and parse to obtain the second smart contract of the target business node and the target operation statement included in the data processing request; According to the second smart contract, the authority information of the target business node is determined.
3. A data processing method based on a blockchain network according to claim 2, characterized in that: The determining, according to the second smart contract, the authority information of the target service node includes: Execute the second smart contract and parse to obtain a third smart contract of the target service node; Execute the third smart contract to obtain access control logic information of the target service node; The access authority of the target service node is determined according to the access control logic information to obtain the authority information.
4. A data processing method based on a blockchain network according to claim 1, characterized in that: The step of executing the target operation statement according to the data processing event to obtain a data query result of a relational database or updating the data in the relational database includes: Execute the target operation statement according to the data processing event; When the target operation statement is a data query statement, obtaining a data query result of a relational database; When the target operation statement is a data update statement, the data in the relational database is updated.
5. A data processing method based on a blockchain network according to claim 4, characterized in that: The executing the target operation statement according to the data processing event includes: When it is determined from the data processing event that the target service node has write permission, executing the target operation statement through the validator; When it is determined from the data processing event that the target service node does not have the authority corresponding to the target operation statement, no processing is performed on the relational database; When it is determined through parsing the data processing event that the target operation statement of the target service node is a data query statement, the target operation statement is executed.
6. A data processing method based on a blockchain network according to claim 4 or 5, characterized in that: The method further comprises: The data query result of the relational database or the result of updating the data in the relational database is broadcasted.
7. A data processing method based on a blockchain network according to claim 1, characterized in that: The method further comprises: Receive a database update query request sent by the target business node, and send update information of the relational database in the consensus network to the target business node.
8. A data processing method based on a blockchain network according to claim 1, characterized in that: The blockchain network includes a mutually isolated witness network and a consensus network, the witness network is composed of a plurality of business nodes, the consensus network is composed of a plurality of consensus nodes, an on-chain registry and a validator network are deployed on the consensus nodes, the witness network and the consensus network are connected via a gateway device, and the method further includes: The relational database of the consensus network is decomposed into components to obtain the on-chain registry and the verifier network; wherein the on-chain registry is used to parse the access rights and target operation statements of the target business node in the data processing request; and the verifier network is used to execute the target operation statement to update the data in the relational database.
9. A data processing method based on a blockchain network, characterized in that: include: generating a data processing request in response to the data processing operation instruction; The data processing request is sent to a target consensus node in the consensus network, so that after receiving the data processing request, the target consensus node executes the data processing method as described in any one of claims 1 to 8, thereby obtaining a data query result of a relational database or updating the data in the relational database.
10. A data processing method based on a blockchain network according to claim 9, characterized in that: The sending the data processing request to a target consensus node in the consensus network includes: Constructing a blockchain transaction according to the data processing request, and sending the blockchain transaction to the on-chain registry of the target consensus node; or, According to the data processing request, the gateway device sends the data processing request to the on-chain registry of the target consensus node.
11. A data processing method based on a blockchain network according to claim 10, characterized in that: According to the data processing request, the gateway device sends the data processing request to the on-chain registry of the target consensus node, including: According to the data processing operation instruction, identifying a target operation statement of a target service node; Sending the target operation statement to the gateway device; The gateway device generates the data processing request according to the target operation statement, and then sends the data processing request to the on-chain registry of the target consensus node; The data processing request carries the data processing authority information and database operation information of the target service node.
12. A data processing system based on a blockchain network, characterized in that: It includes a mutually isolated witness network and consensus network, wherein the witness network is composed of a plurality of business nodes, and the consensus network is composed of a plurality of consensus nodes. On-chain registry and validator network are deployed on the consensus nodes, and the witness network and the consensus network are connected via a gateway device; The service node is used for: generating a data processing request in response to the data processing operation instruction; Sending the data processing request to a target consensus node in the consensus network; The consensus node is used to: receiving a data processing request sent by a target service node, wherein the target service node is in the witness network; Verify the data processing request according to the on-chain registry to determine the access rights and target operation statements of the target business node; Generate a data processing event according to the access permission and the target operation statement and send it to the verifier network, and then the verifier network executes the target operation statement according to the data processing event to obtain a data query result of the relational database or update the data in the relational database; The data processing event represents the database operation intention of the target service node.
13. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
