WO2023016164A1 - 一种基于智能合约的数据处理方法、装置、电子设备、计算机可读存储介质及计算机程序产品 - Google Patents
一种基于智能合约的数据处理方法、装置、电子设备、计算机可读存储介质及计算机程序产品 Download PDFInfo
- Publication number
- WO2023016164A1 WO2023016164A1 PCT/CN2022/104894 CN2022104894W WO2023016164A1 WO 2023016164 A1 WO2023016164 A1 WO 2023016164A1 CN 2022104894 W CN2022104894 W CN 2022104894W WO 2023016164 A1 WO2023016164 A1 WO 2023016164A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- contract
- local
- node
- consensus
- identifier
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/12—Accounting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0876—Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Definitions
- the present application relates to the technical field of blockchain, and in particular to a data processing method, device, electronic equipment, computer-readable storage medium and computer program product based on smart contracts.
- a smart contract is a code that can be understood and executed by each node on the blockchain, and can execute arbitrary logic and obtain results; a smart contract can be understood as an executable program, and a blockchain can be understood as It is the operating system that provides the operating environment for the program. In practical applications, smart contracts can be managed and tested through transactions on the blockchain.
- business objects can invoke smart contracts that have been deployed on the blockchain by initiating a transaction.
- all smart contracts are deployed and run on the consensus nodes in the blockchain network.
- Each consensus node runs the smart contract specified by the exchange respectively.
- each consensus node will access its own ledger.
- each consensus node will verify whether the execution results are consistent with each other (consensus). If they are consistent, the execution results will be stored in their respective ledgers, and the execution results will be returned to the business object.
- the execution results can also be synchronized to other types of nodes. , which makes the amount of data storage and computing workload of the consensus node larger, and then the load of the consensus node is larger, which affects the data processing efficiency.
- Embodiments of the present application provide a smart contract-based data processing method, device, electronic device, computer-readable storage medium, and computer program product, which can reduce the load on consensus nodes and improve data processing efficiency.
- An embodiment of the present application provides a data processing method based on a smart contract, the method is executed by a service node in a service network, and the service node includes at least one electronic device, including:
- the initial contract call request includes the first contract identifier used to call the contract on the target chain; the contract on the target chain is deployed on the consensus node of the core consensus network, the The core consensus network is independent of the business network; both the consensus node and the business node store the first mapping relationship between the first contract identifier and the second contract identifier; the second contract identifier is a deployment The contract identifier of the target local contract on the service node;
- the embodiment of the present application provides a smart contract-based data processing method, the method is executed by a consensus node in the core consensus network, and the consensus node includes at least one electronic device, including:
- the target contract call request for executing the transaction business;
- the target contract call request is sent by the service node based on the local transaction execution result and the initial contract call request, and the service node is located in the service network independent of the core consensus network middle;
- the local transaction execution result is obtained by the service node executing the local service indicated by the transaction service by calling the target local contract;
- the target local contract is obtained by the service node based on the second contract identifier ;
- the second contract identifier is queried by the service node based on the first contract identifier and the first mapping relationship;
- the first contract identifier refers to the contract used to call the contract on the target chain in the initial contract call request identification;
- the initial contract call request is used to execute the transaction business;
- the contract on the target chain is deployed on the consensus node; both the consensus node and the service node store the first contract identification and
- the second contract identifier is the contract identifier of the target
- An embodiment of the present application provides a first data processing device based on a smart contract, the first data processing device is stored in a service node of a service network, including:
- the first obtaining module is used to obtain an initial contract call request for executing transaction services;
- the initial contract call request includes a first contract identifier for calling a contract on the target chain;
- the contract on the target chain is deployed on the core consensus network
- the core consensus network is independent of the business network; both the consensus node and the business node store the first mapping relationship between the first contract identifier and the second contract identifier;
- the second contract identifier is the contract identifier of the target local contract deployed on the service node;
- the second execution module is configured to query the second contract identifier based on the first contract identifier and the first mapping relationship, determine the target local contract based on the second contract identifier, and call the target local
- the contract executes the local business indicated by the transaction business, and obtains the execution result of the local transaction
- a forwarding module configured to send a target contract call request to the consensus node based on the local transaction execution result and the initial contract call request, where the target contract call request is used by the consensus node based on the first contract identification Obtain the contract on the target chain, and execute the consensus service indicated by the transaction service by calling the contract on the target chain.
- An embodiment of the present application provides a second data processing device based on a smart contract, the second data processing device is stored in a consensus node of the core consensus network, including:
- the second obtaining module is used to obtain the target contract call request for executing the transaction business; the target contract call request is sent by the service node based on the local transaction execution result and the initial contract call request, and the service node is located independently of the In the business network of the core consensus network; the local transaction execution result is obtained by the business node by calling the target local contract to execute the local business indicated by the transaction business; the target local contract is obtained by the business node based on The second contract identifier is obtained; the second contract identifier is queried by the service node based on the first contract identifier and the first mapping relationship; the first contract identifier refers to the initial contract call request for Call the contract identifier of the contract on the target chain; the initial contract call request is used to execute the transaction business; the contract on the target chain is deployed on the consensus node; both the consensus node and the business node store The first mapping relationship between the first contract identifier and the second contract identifier; the second contract identifier is the contract identifier of the target local contract deployed on
- the second execution module is configured to call the target on-chain contract based on the first contract identifier in the target contract call request, and execute the consensus service indicated by the transaction service by calling the target on-chain contract, Get the transaction execution result on the chain.
- An embodiment of the present application provides an electronic device, including: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, and the memory is used to store
- the computer program, the above-mentioned processor is used to call the above-mentioned computer program to execute the data processing method based on the smart contract executed by the business node in the business network provided by the embodiment of the application, or to execute the data processing method provided by the core consensus network provided by the embodiment of the application.
- An embodiment of the present application provides a computer-readable storage medium.
- the above-mentioned computer-readable storage medium stores a computer program, and the above-mentioned computer program is suitable for being loaded by a processor and executing the service node in the service network provided by the embodiment of the present application.
- An embodiment of the present application provides a computer program product, the computer program product includes a computer program or an instruction, and when the computer program or instruction is executed by a processor, it executes the service node in the service network provided by the embodiment of the present application.
- the data processing method of the smart contract, or the data processing method based on the smart contract executed by the consensus nodes in the core consensus network provided by the embodiment of the application.
- the business node in the business network can first obtain the initial contract call for executing the transaction business Request, execute the local business indicated by the transaction business, and get the execution result of the local transaction.
- the business node can determine the target contract call request based on the local transaction execution result and the initial contract call request, and forward the target contract call request to the consensus node to execute the consensus business indicated by the transaction business, that is, to execute the consensus business Previously, the business node could process the received contract call request before the consensus node, so that the local business executed on the consensus node was moved to the business node for processing, reducing the resource consumption of the consensus node to execute local business, so that Reduce the load of consensus nodes and improve the transaction processing efficiency of the blockchain network.
- FIG. 1 is a schematic diagram of a layered structure of a blockchain network provided by an embodiment of the present application
- FIGS. 2a-2b are schematic diagrams of a data processing scenario provided by an embodiment of the present application.
- FIG. 3 is a schematic flow diagram of a smart contract-based data processing method provided by an embodiment of the present application.
- FIG. 4 is a schematic flow diagram of a smart contract-based data processing method provided by an embodiment of the present application.
- 5a-5c are schematic diagrams of a data processing scenario provided by an embodiment of the present application.
- FIG. 6 is a schematic flow diagram of a smart contract-based data processing method provided by an embodiment of the present application.
- Fig. 7 is a schematic flowchart of another smart contract-based data processing method provided by the embodiment of the present application.
- FIG. 8 is a schematic flowchart of a data processing method provided in an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of a first data processing device based on a smart contract provided by an embodiment of the present application.
- Fig. 10 is a schematic structural diagram of a second data processing device based on a smart contract provided by an embodiment of the present application.
- FIG. 11 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
- Transaction which is equivalent to the computer term "transaction”. Transactions include operations that need to be submitted to the blockchain network for execution, not just transactions in a business context. In view of the conventional use of The term “transaction” follows this practice in the embodiment of this application.
- the deployment (Deploy) transaction is used to install the specified smart contract to the node in the blockchain network and is ready to be called;
- the call (Invoke) transaction is used to add the record of the transaction in the blockchain by calling the smart contract, and
- Operations on the state database of the blockchain include update operations (including write operations (including adding key-value pair data and deleting key-value pair data) and delete operations) and query operations (that is, querying key-value pairs in the state database).
- Blockchain is an encrypted and chained transaction storage structure formed by blocks.
- the header of each block can include not only the hash value of all transactions in the block, but also the hash value of all transactions in the previous block, so that the transactions in the block can be tamper-proof based on the hash value And anti-counterfeiting; newly generated transactions are filled into the block and after the consensus of the nodes in the blockchain network, they will be appended to the end of the blockchain to form a chain growth.
- Blockchain Network (Blockchain Network), a collection of nodes that incorporate new blocks into the blockchain through consensus.
- Smart contracts also known as chain code (Chaincode) or application code
- Chain code Chain code
- application code programs deployed in the nodes of the blockchain network, and the nodes execute the smart contracts called in the received transactions to update the state database. Key-value data update or query operations.
- FIG. 1 is a schematic diagram of a blockchain network layered structure provided by an embodiment of the present application.
- Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. and forgery, while data verification, storage and updating can be performed.
- the blockchain is essentially a decentralized database, and each node in the database stores the same blockchain. Among them, the nodes in the blockchain network are at the logical level and can be composed of one or more Devices (servers) are mapped.
- servers Devices
- the hierarchical structure of the blockchain network in the embodiment of this application can be the blockchain network 1W shown in Figure 1, and the complete blockchain business system corresponding to the blockchain network 1W can be represented by the business network 1 shown in Figure 1 -1.
- the core consensus network 1-2 and the routing network 1-3 where the routing node 10D is located also called routing agent network).
- the embodiment of the present application takes the routing node 10D as an example for illustration, and the routing node 10D can be used for network isolation of the service network 1-1 and the core consensus network 1-2.
- the routing node 10D can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, Cloud servers for basic cloud computing services such as cloud communications, middleware services, domain name services, security services, content delivery network (Content Delivery Network, CDN), and big data and artificial intelligence platforms are not limited here.
- the routing node 10D can layer the peer-to-peer (Peer To Peer, P2P) network to form a layered structure of "business network 1-1-core consensus network 1-2", which can further improve the data on the blockchain. confidentiality and security.
- the business network 1-1 (that is, the witness network) shown in Figure 1 and the core consensus network 1-2 are independent of each other, and the blockchain node system corresponding to the business network 1-1 (that is, the first blockchain node system)
- the first blockchain system may specifically include a node 110a, a node 110b, a node 110c, ..., a node 110n.
- the blockchain nodes in the business network 1-1 can be called business nodes, and the business nodes do not need to participate in the bookkeeping consensus, and are used to execute the transaction business, so as to obtain information related to the transaction business.
- Linked transaction data can be a full node (Full Node) that contains a complete blockchain database, or a lightweight node (Simplified Payment Verification, SPV) that stores part of the data in the blockchain database. It defines.
- the service nodes in the embodiment of this application can be described by taking lightweight nodes as an example.
- the service nodes store part of the transaction data, and through the routing node 10D, from the In the core consensus network 1-2, block header data and partially authorized block data (for example, transactions associated with the business node itself) are obtained.
- the blockchain node system corresponding to the core consensus network 1-2 shown in Figure 1 may also include one or more blockchain nodes, and the second blockchain node system will not be used here.
- the number of nodes in the chain node system is limited.
- the second blockchain system may specifically include a node 120a, a node 120b, a node 120c, ..., a node 120m.
- the nodes in the core consensus network 1-2 may be referred to as consensus nodes (ie accounting nodes), and the consensus nodes may run a blockchain consensus protocol.
- the consensus node in the embodiment of the present application can be a full node including a complete blockchain database.
- the consensus node can participate in verification, broadcast transaction data and block information, and will discover and maintain connections with other nodes.
- routing nodes, service nodes, and consensus nodes may be collectively referred to as blockchain nodes in the blockchain network 1W.
- the blockchain node may be a server connected to the blockchain network 1W, or a user terminal connected to the blockchain network 1W, and the specific form of the blockchain node is not limited here.
- the service network 1-1 and the core consensus network 1-2 shown in FIG. The consensus nodes running the blockchain consensus protocol are deployed in the private core consensus network 1-2, and the two can interact through the routing boundary.
- the service node and the consensus node can directly transmit data without going through the routing node.
- the blockchain system can include smart contracts, which are codes that can be understood and executed by each node of the blockchain (including consensus nodes) in the blockchain system, and can execute arbitrary logic and got the answer.
- the smart contracts deployed and only run on the business nodes of the business network 1-1 are collectively referred to as local contracts
- the smart contracts deployed on the consensus nodes of the core consensus network 1-2 are collectively referred to as on-chain contracts.
- the business object (which can be the user who requests to execute the transaction business or the user who requests to deploy the smart contract) can initiate a contract call request (also called a transaction service request) through the client on the user terminal to call the blockchain system Smart contracts that have been deployed (can be local contracts or on-chain contracts).
- one or more smart contracts can be included in the blockchain system, and these smart contracts can be identified by a contract (such as an identification number (Identity document, ID) or name, and can also include a contract address or a contract function name (also called It is the contract method name)) to distinguish, and the contract call request initiated by the client can also carry the identification number or name of the smart contract, so as to specify the smart contract that the blockchain needs to run. And if the smart contract specified by the client is a contract that needs to read data, the relevant node will access the local storage to read the data. For transactions that need to be uploaded to the chain, each consensus node will verify whether the execution results are consistent with each other (that is, consensus), and if they are consistent, they can store the execution results in their respective local ledgers and return the execution results to the client.
- a contract such as an identification number (Identity document, ID) or name, and can also include a contract address or a contract function name (also called It is the contract method name)
- the contract call request initiated by the client can
- the on-chain contract specified and invoked by the business object can be called the target on-chain contract, and the contract ID of the target on-chain contract can be called the first contract ID.
- the contract related to the target on-chain contract can be The linked local contract is called the target local contract, and the contract identifier of the target local contract is called the second contract identifier.
- the first mapping relationship between the contract identifier and the second contract identifier can be referred to as the first mapping relationship, wherein the business node here specifically refers to the node in the business network 1-1 that has the execution authority for the target local contract, A node (such as node 110a shown in FIG. 1 ) can be designated by the business object in the business network 1-1 shown in FIG. 1 as the business node, that is, the target local contract is deployed and runs on the business node.
- the service node may first obtain the initial contract invocation request sent by the first user terminal, wherein the first user terminal here refers to the user terminal that sends the initial contract invocation request, and the initial contract invocation request includes the first
- the contract identifier can be used to execute related transactions, and then based on the first contract identifier and the first mapping relationship, the second contract identifier associated with the contract on the target chain can be queried in the node memory of the business node, and then based on the first
- the second contract identifier obtains the target local contract, and calls the target local contract to execute the local business indicated by the transaction business, so as to obtain the local transaction execution result.
- the business node can determine the target contract call request based on the local transaction execution result and the initial contract call request. It should be noted that after executing the local business, the target contract call request obtained may be the same request as the initial Might be a different request than the initial contract call request. Subsequently, the business node can forward the target contract call request to the consensus node.
- the consensus node After receiving the target contract call request, the consensus node can obtain the contract on the target chain based on the first contract identifier in the target contract call request, and then call the target chain The contract executes the consensus business indicated by the transaction business, and obtains the transaction execution result on the chain; finally, the block to be added to the blockchain (that is, the block to be chained) can be generated according to the transaction execution result on the chain, and the Blocks are uploaded to the chain.
- the blockchain is the blockchain to which the contract on the target chain belongs.
- the local contract provided by the embodiment of this application is a special contract that is not executed on the consensus node but only executed on the business node.
- the business node can first call the target local contract to execute the corresponding local business, and then the consensus node calls the contract on the target chain to execute the corresponding consensus business.
- each province can have its own different policies. At this time, the business nodes of each province can deploy different Local contracts, only serve this province.
- local contracts can be checked and calculated in advance to reduce the pressure on consensus nodes; on the other hand, local contracts can access and utilize local business data, so that local business data does not need to be uploaded to the chain, reducing the storage pressure of consensus nodes and making it easier Protect your privacy well.
- FIG. 2a-FIG. 2b are schematic diagrams of a data processing scenario provided by an embodiment of the present application.
- the user terminal 20a in Fig. 2a-2b has a binding relationship with the business object A, and the user terminal 20a can invoke the deployed smart contract (on-chain contract or local contract) by initiating a contract invocation request.
- the business node 20b in Figure 2a- Figure 2b can be a business node with a local contract deployed in the business network, and the business node 20b can be any business node in the business network 1-1 shown in Figure 1 above, for example, node 110a.
- the consensus node 20c in Figure 2b can be a consensus node with on-chain contracts deployed in the core consensus network, and the consensus node 20c can be any consensus node in the core consensus network 1-2 shown in Figure 1 above, for example, node 120a.
- the transaction service here can be an asset transfer service, wherein the asset transfer service can be used to transfer virtual assets such as game gold coins, game diamonds, and electronic bills, and the type of virtual assets will not be limited here.
- the transaction service here may be a file transfer service, where the file transfer service may be used to transfer various forms of electronic documents such as electronic contracts and electronic documents.
- the transaction service here may also be query service, storage service, etc., which is not limited in this application. It should be noted that when deploying a local contract on a business node, the associated on-chain contract can be specified, so that some data of the on-chain contract can be reused.
- any service node (for example, service node 20b) in the service network can deploy one or more local contracts (called preset local contracts), and each local contract can perform different functions.
- the business node has the execution authority for the one or more local contracts, that is, the business node can call the local contracts deployed on the business node.
- each local contract can be distinguished by a unique contract identifier (such as an identification number or name), for example, the local The contract identifier corresponding to contract 201b is contract identifier 1b, the contract identifier corresponding to local contract 205b is contract identifier 5b, and the contract identifier corresponding to local contract 210b is contract identifier 10b.
- any consensus node (for example, consensus node 20c) in the core consensus network can deploy one or more on-chain contracts, and the on-chain contracts deployed on each consensus node are the same, each On-chain contracts can also perform different functions.
- the consensus node 20c as an example, multiple (for example, 30) on-chain contracts can be deployed on the consensus node 20c, including on-chain contracts 201c, on-chain contracts 202c, ..., on-chain contracts 230c, these on-chain
- the relevant information of the contract can be stored in the node memory 20f of the consensus node 20c, and can also be stored in other storage modules of the consensus node 20c; wherein, each contract on the chain can use a unique contract identifier (such as an identification number or name)
- the contract identifier corresponding to the on-chain contract 201c is the contract identifier 1c
- the contract identifier corresponding to the on-chain contract 210c is the contract identifier 10c
- the contract identifier 10c the contract
- each local contract can establish an association relationship with one or more contracts on the chain;
- the mapping relationship between them is used to characterize the association relationship between the two, and these mapping relationships can be stored in the form of a relational mapping table in the node memory or other storage modules of consensus nodes and related business nodes. Please refer to FIG. 2a again. As shown in FIG.
- a relationship mapping table 20e is stored in the node memory 20d of the service node 20b, and one or more mapping relationships can be stored in the relationship mapping table 20e; for example, contract identifier 3c and contract identifier 1b
- the mapping relationship between on-chain contract 203c and local contract 201b; the mapping relationship between contract identifier 20c and contract identifier 2b indicates that on-chain contract 220c is associated with local contract 202b.
- a relationship mapping table 20e may also be stored in the node memory 20f of the consensus node 20c.
- relationship mapping table 20e only includes the mapping relationship related to the service node 20b, and the node memory 20f may also store To store mapping relationships related to other service nodes, the embodiment of the present application only uses the relationship mapping table 20e as an example for illustration.
- business object A can send a contract invocation request B (referred to as an initial contract invocation request) to a service node 20b through a user terminal 20a (referred to as a first user terminal); wherein, the contract invocation request B can be used for Execute the transaction business initiated by business object A (for example, business object A transfers virtual assets equal to the amount of assets to be transferred from business object A to business object F, such as transferring 500 yuan), business object A can select the already deployed chain through the user terminal 20a
- the contract (called the target on-chain contract, for example, the on-chain contract 210c), that is, the contract identifier of the on-chain contract (called the first contract identifier, for example, the contract identifier 10c) can be specified in the contract call request B.
- the contract identifier 10c (called the first contract identifier) of the on-chain contract 210c and the contract identifier 5b of the local contract 205b (referred to as the second contract identifier) there is a mapping relationship 201e (referred to as the first mapping relationship).
- the service node 20b When the service node 20b receives the contract invocation request B sent by the user terminal 20a, it can query the contract identifier having a mapping relationship 201e with the contract identifier 10c in the relationship mapping table 20e, and then can determine the queried contract identifier 5b as the second contract identifier 5b ID, and the local contract 205b can be obtained based on the contract ID 5b.
- the business node 20b can call the local contract 205b to execute the local business indicated by the above transaction business (for example, check in advance whether the remaining asset amount of the business object A meets the transfer condition, that is, whether the remaining asset amount of the business object A is greater than or equal to the value to be transferred asset amount (such as 500 yuan)), get the transaction execution result C (called the local transaction execution result), and then determine the contract call request D (called the local transaction execution result) for sending to the consensus node based on the transaction execution result C and the contract call request B is the target contract call request), the final service node 20b can forward the contract call request D to the consensus node (such as the consensus node 20c) through the routing node in the routing network, or the service node 20b can directly forward the contract call request D to the consensus node node.
- the contract call request D still includes the contract identifier 10c.
- the service node before one or more contract call requests are forwarded from the service node to the core chain (ie, the core consensus network), the service node can execute the corresponding local contract to pre-check these contract call requests And filtering (called pre-check processing), only the contract call request that meets the on-chain conditions will be finally forwarded to the core chain for processing.
- the core chain ie, the core consensus network
- the contract invocation request D may be a request in the contract invocation request B that satisfies the transfer condition (referred to as the on-chain condition); for another example, the business node 20b checks that the remaining assets of the business object A are greater than 500 yuan, That is, if the contract call request B meets the transfer conditions, the contract call request B can be forwarded to the consensus node 20c as the contract call request D, and then the consensus node 20c will perform the operation of transferring 500 yuan to the business object F; on the contrary, if the business object A’s If the remaining asset amount is less than 500 yuan, that is, the contract call request B does not meet the transfer conditions, then the service node 20b can generate request failure information (for example, information for prompting that the remaining asset amount of the business object A is insufficient) according to the transaction execution result C, and send The request failure information is returned to the user terminal 20a.
- request failure information for example, information for prompting that the remaining asset amount of the business object A is insufficient
- the local services indicated by different transaction services may also include different content, such as information completion processing, statistical classification processing, etc., which are not limited in this embodiment of the application .
- the consensus node 20c can obtain the on-chain contract 210c based on the contract identifier 10c in the contract invocation request D, and then can invoke the on-chain contract 210c to execute the above transaction
- the consensus business indicated by the business for example, the transfer business of transferring 500 yuan from business object A to business object F can be executed), so as to obtain the transaction execution result E (called the on-chain transaction execution result).
- the block chain 20g shown in Figure 2b can be the same block chain shared by each consensus node in the core consensus network where the consensus node 20c is located, and each consensus node can be in the block chain 20g
- the block chain 20g may include multiple (for example, 101) blocks, which are respectively block 1, block 2, ..., block 100 and target Blocks, for example, the block 1 can be called the genesis block of the block chain 20g.
- the target block in the block chain 20g contains the transaction execution result E.
- the consensus node 20c is a consensus node with the function of generating blocks in the core consensus network
- the consensus node 20c can generate a block to be added to the block chain 20g according to the transaction execution result E, and treat the block on the chain
- the block is processed on the chain, that is, the consensus node 20c can send the block to be chained to other consensus nodes in the core consensus network, so that other consensus nodes can perform block consensus on the block to be chained, and obtain the block for returning to the consensus node.
- the consensus node 20c can use the block to be uploaded as the target block to write it into the block chain 20g shown in Figure 2b, and also That is, the target block is set as the next block of block 100.
- the consensus node 20c can call the on-chain contract 210c to perform the transfer business, and modify the remaining assets of business object A and business object F, and generate chain block, and add the block to be linked to the blockchain 20g, so as to complete the writing of the latest remaining assets of the business object A and the latest remaining assets of the business object F into the blockchain 20g.
- the consensus node 20c can return the transaction execution result (such as the successful transfer result) to the user terminal 20a and the user terminal 20h bound to the business object F through the business node 20b, and the business object A can query its own remaining assets through the user terminal 20a , the displayed remaining asset volume is the latest remaining asset volume of business object A; when business object F inquires its own remaining asset volume through the user terminal 20h, the presented remaining asset volume is the latest remaining asset volume of business object F .
- the smart contract-based data processing method provided in the embodiment of the present application can be applied to business scenarios such as transferring virtual assets (such as game gold coins, game diamonds, electronic bills) or transferring electronic documents (such as electronic contracts, electronic documents), or Other business scenarios for checking and calculating in advance through local contracts. Since the business node can call the local contract before the consensus node to process the received contract call request accordingly, there is no need to backlog all the operations related to the contract call request on the consensus node, which can reduce the data of the consensus node. Handle pressure, reduce the load on consensus nodes, and improve the overall transaction processing efficiency of the blockchain network.
- business scenarios such as transferring virtual assets (such as game gold coins, game diamonds, electronic bills) or transferring electronic documents (such as electronic contracts, electronic documents), or Other business scenarios for checking and calculating in advance through local contracts. Since the business node can call the local contract before the consensus node to process the received contract call request accordingly, there is no need to backlog all the operations related to the contract call request on the consensus node, which can reduce
- FIG. 3 is a schematic flowchart of a smart contract-based data processing method provided by an embodiment of the present application.
- the method can be executed by a service node in the service network, and the service node can be a server connected to the service network, or a user terminal connected to the service network.
- the service The specific form of the node is not limited.
- the service node may be a service node deployed with a target local contract in the service network 1-1 shown in FIG. 1 , for example, node 110a.
- the smart contract-based data processing method may at least include step S101-step S103, each step will be described below.
- Step S101 obtain the initial contract call request for executing the transaction business; the initial contract call request includes the first contract identifier used to call the contract on the target chain; both the consensus node and the business node store the first contract identifier and the second contract identifier The first mapping relationship between the identifiers.
- the target local contract is deployed on the specified business node in the business network
- the target on-chain contract is deployed on the consensus node of the core consensus network.
- the core consensus network is independent of the business network. Perform network isolation.
- the service node can receive the transaction request sent from the user terminal (for example, a contract deployment request or an initial contract call request), and the consensus node can receive the transaction request forwarded by the service node, where the transaction request can be the user terminal according to the business object The request generated by the initiated transaction business.
- the user terminal that sends the initial contract invocation request can be called the first user terminal, and the user terminal that sends the contract deployment request is called the second user terminal; where the first user terminal and the second user terminal It can be the same user terminal or different user terminals.
- the business object can deploy one or more local contracts on the business node by initiating a contract deployment request.
- deploying the target local contract as an example.
- the business object can initiate a contract deployment request through the second user terminal.
- the business object can deploy the target local contract on the specified business node; where the specified business node Can include one or more business nodes in the core consensus network.
- the business object can uniquely identify the smart contract by specifying the contract identifier (eg, ID or name) of the smart contract, and the blockchain node (business node or consensus node) can call the corresponding smart contract through the contract identifier.
- the contract identifier corresponding to the contract on the target chain is the first contract identifier
- the contract identifier corresponding to the target local contract is the second contract identifier.
- the business object can also specify the contract identifiers of one or more on-chain contracts associated with the target local contract in the contract deployment request; wherein, the one or more on-chain contracts include the target on-chain contract.
- the first mapping relationship between the first contract identifier and the second contract identifier can be stored in the node memory of the consensus node and the designated service node or other storage modules (for example, hard disk, storage or database, etc.). It can be understood that the process of deploying other local contracts is consistent with the process of deploying the target local contract. For the implementation of deploying local contracts, refer to step S201 corresponding to subsequent FIG. 4 and step S401 corresponding to FIG. 7 .
- the business object can initiate an initial contract invocation request for executing transaction services (for example, asset transfer service, file transfer service, query service, storage service, etc.) through the first user terminal, and the initial contract invocation request can carry the business object
- transaction services for example, asset transfer service, file transfer service, query service, storage service, etc.
- the initial contract invocation request can carry the business object
- the first contract identifier corresponding to the contract on the specified target chain the first user terminal can send the initial contract call request to one or more service nodes deployed with the target local contract, the one or more service nodes receive
- the target local contract associated with the target on-chain contract can be called according to the initial contract call request, and the implementation method of calling the target local contract can refer to step S102.
- only one of the service nodes is used as an example for the following steps.
- the first user terminal and the second user terminal may be different user terminals.
- the second user terminal is user terminal A
- the first user terminal is user terminal B.
- the service node may deploy The successful result is sent to user terminal A; the service node can also send the successful deployment result to user terminal B, so that user terminal B can send an initial contract call request to the service node based on the successful deployment result.
- user terminal A after receiving the successful deployment result sent by the service node, user terminal A can send a notification that the service node has been deployed to user terminal B, and then user terminal B can send an initial contract call request to the service node.
- Step S102 based on the first contract identifier and the first mapping relationship, query the second contract identifier, determine the target local contract based on the second contract identifier, execute the local business indicated by the transaction service by calling the target local contract, and obtain the local transaction execution result.
- local contract information is stored in the service node (for example, in the node memory), and the local contract information refers to information related to the local contract (including the target local contract) deployed on the service node; wherein, the local contract information It can include the mapping relationship between the contract identifiers of these local contracts and the contract identifiers of the associated on-chain contracts.
- local contract A1 and local contract A2 are deployed on business node A, and the local contract A1 and the specified on-chain contract B1 is associated, the local contract A2 is associated with the specified on-chain contract B2, and both the on-chain contract B1 and the on-chain contract B2 are deployed on the consensus node B, then the business node A can store the local The mapping relationship between the contract identifier of contract A1 and the contract identifier of contract B1 on the chain, and the mapping relationship between the contract identifier of local contract A2 and the contract identifier of contract B2 on the chain.
- consensus node B can also These mappings are stored in memory.
- mapping relationship may be stored in a relationship mapping table, where the relationship mapping table includes a first mapping relationship between the first contract identifier and the second contract identifier.
- An optional form of the relationship mapping table can refer to the relationship mapping table 20e shown in FIG. 2a above.
- other forms can also be used to store the above mapping relationship, which is not limited in this application.
- the business node can query the contract ID that has the first mapping relationship with the first contract ID in the relationship mapping table, and then can determine the queried contract ID as the second contract ID associated with the target chain contract.
- the contract identifier can be determined as the target local contract.
- a local contract has a unique mapping relationship with an on-chain contract
- the relationship mapping table can include one or more mapping relationship columns, and a mapping relationship column can be used to store a mapping relationship; therefore, the business node can use the relationship mapping table
- the mapping relationship column in which the first contract identifier and the first mapping relationship are stored is determined as the target mapping relationship column, and the contract identifier different from the first contract identifier stored in the target mapping relationship column may be determined as the second contract identifier.
- the service node 20b can query the contract identifier 5b having the mapping relationship 201e with the contract identifier 10c in the relationship mapping table 20e based on the contract identifier 10c and the mapping relationship 201e in the contract invocation request B.
- the local contract information can also include the local contract function corresponding to the target local contract, and the business node can execute the local business indicated by the transaction business by calling the local contract function; in the embodiment of this application, the business node can first call the target The local contract can read the local contract function in the local contract information, and then the local business data associated with the local business can be accessed from the node memory of the business node through the local contract function, and then the transaction business can be executed through the local business data Indicated local business, get local transaction execution result.
- the local contract information can also include contract codes
- the business object can deploy the contract code (that is, the contract program statement) written by the business object in the target local contract.
- the contract program statement of the business the contract code can include the contract function name corresponding to the local contract function and the function statement corresponding to the contract function name, and the business node can call the target local contract to obtain the contract corresponding to the local contract function in the local contract information The function name, and then the function statement corresponding to the contract function name can be obtained.
- the function statement can indicate the storage location of the local service data associated with the local service in the service node (for example, in the node memory), that is, the service node can send data to the node memory of the service node through the function statement
- the read request can further obtain the local service data on the storage location, and the local service data can be used to execute the local service indicated by the transaction service.
- the local business data can refer to the data related to the business object served by the business node, and the local business data can come from the relevant user terminal, or from other blockchain nodes in the blockchain network ( For example, other business nodes participating in the transaction business, or the superior node of the business node, or the consensus node in the core consensus network).
- local business refers to the business that business nodes can use local business data to perform, for example, check whether a contract call request meets the on-chain conditions (called pre-check processing, such as checking whether the contract call request meets the relevant policies of the province ), or complete some information unique to business nodes (called information completion processing, such as assigning invoice numbers, completing official seals or signatures, etc.), or counting and categorizing relevant transaction data, and according to the specified Format output (called statistical classification processing, such as counting the number of transfer transactions performed by a certain company on the day), this application does not limit this.
- pre-check processing such as checking whether the contract call request meets the relevant policies of the province
- information completion processing such as assigning invoice numbers, completing official seals or signatures, etc.
- statistical classification processing such as counting the number of transfer transactions performed by a certain company on the day
- the local contract function can include a pre-check function associated with the local business, and the service node can access the The first local business data, and then based on the first local business data, the request parameter in the initial contract call request can be pre-checked; at this time, the local business data includes the first local business data.
- relevant request parameters can be generated, and the business node can search the historical transaction information of the electronic note in its own node memory, for example, to determine whether the account of enterprise A exists This electronic bill, whether the accounts of enterprise A and enterprise B are wrong, the source of this electronic bill owned by enterprise A, whether the number of the electronic bill is judged is wrong, etc. If the pre-detection result indicates that the request parameter meets the on-link condition indicated by the local service, the request parameter meeting the on-link condition indicated by the local service can be determined as a legal request parameter, and then the legal request parameter can be used as the local service corresponding The local transaction execution result of .
- the request parameters that do not meet the uplink conditions indicated by the local service can be determined as illegal request parameters, and the illegal request parameters are used as The local transaction execution result corresponding to the local business, and then the business node can generate request failure information according to the illegal request parameter, and then return the request failure information to the first user terminal that sent the initial contract call request; that is, the business node can send Contract call requests that do not meet the on-chain conditions are filtered or intercepted.
- the request failure information is used to indicate that the initial contract call request is rejected, and may include specific reasons for rejection, error messages, and the like.
- pre-checking the initial contract call request on the business node can intercept some malicious or problematic requests. On the one hand, it can reduce the amount of calculation on the consensus node, reduce the data processing pressure of the consensus node, and reduce the consensus The number of contract calls requested by the node; on the other hand, when the consensus node does not have the relevant judgment ability, the business node can use its own local business data to make judgments.
- the business node can be a business node with target area attributes (such as province, city, district, etc.), and the consensus node can be the superior node of the business node.
- Target area attributes such as province, city, district, etc.
- Policies associated with the attributes of the target area such as national policies, city policies, district policies, etc.).
- the business node in province A can pre-check whether the contract call request B (that is, the initial contract call request) for issuing electronic bills meets the relevant policies of province A, and only the contract call request B meets the relevant policies of province A (for example, for single Only when there is no limit policy on the amount of a single transaction), the business node in province A will forward the contract call request B to the national chain composed of consensus nodes for subsequent processing.
- the contract call request B that is, the initial contract call request
- the relevant policies of province A for example, for single Only when there is no limit policy on the amount of a single transaction
- the on-chain condition can be that the transaction initiator has enough remaining assets, that is, when the transaction initiator's remaining assets are greater than or equal to the amount of assets to be transferred, the business node can use the The transfer contract call request C is forwarded to the consensus node, and the consensus node continues to perform the transfer operation, otherwise, the business node will intercept the contract call request C.
- the request parameters may refer to parameters related to transaction services, and the specific content contained in the request parameters is different for different transaction services.
- the request parameters may include parameters related to the flow logic of the entire life cycle of the electronic bill; for example, electronic bill issuance information, electronic bill application information, electronic bill status, and data access rights , keywords on the electronic bill, etc.
- the request parameters can include the remaining assets of the transaction initiator, signature information, the amount of assets to be transferred, the identifier of the transaction recipient (such as the account number of the transaction recipient), etc.
- the request parameters can include official seal information, signature information, status information, etc. of the electronic file.
- the local contract function can include the information completion function associated with the local business, and the business node can access the local business from the business node (for example, in the node memory) through the information completion function
- the associated second local business data can then complete the request parameters in the initial contract call request based on the second local business data, and then use the completed request parameters as the local transaction corresponding to the local business Execution result; at this time, the local service data includes the second local service data.
- the local taxation bureau can be used as a business node. When issuing an electronic bill, the business node can complete some information only available to the civil taxation bureau, such as assigning the invoice number.
- the district court serves as a business node to transfer an electronic document to the Supreme Court (ie consensus node), it can complete the local court's own official seal or signature and other information.
- the blockchain network can store part of the data originally stored on the consensus node on the business node, so as to use the data or unique capabilities of the business node itself (such as the ability that the contract on the chain does not have) ) to do information completion (that is, data completion), which can reduce multi-party interactions, reduce the storage pressure and calculation pressure of consensus nodes, and can also improve the privacy and security of business node data.
- Step S103 based on the local transaction execution result and the initial contract call request, send the target contract call request to the consensus node, the target contract call request is used for the consensus node to obtain the contract on the target chain based on the first contract identifier, and execute the contract by calling the contract on the target chain The consensus business indicated by the transaction business.
- the blockchain network where the business network and the core consensus network are located may also include a routing network for network isolation, and the business node may determine the method for sending The target contract call request to the consensus node, and then the target contract call request can be forwarded to the consensus node.
- step S102 In conjunction with the above step S102, the following still uses the pre-check processing and information completion processing as examples for illustration.
- the business node can determine the initial contract call request containing the legal request parameter as the target contract call request; that is, when the initial contract call request When the request parameters in meet the on-chain conditions indicated by the local business, the initial contract call request and the target contract call request are the same contract call request.
- the service node can intercept the initial contract call request, and can return request failure information to the first user terminal. It can be understood that if the number of initial contract call requests is one or more, the service node may determine the contract call request that meets the on-chain condition among the one or more initial contract call requests as the target contract call request.
- the service node can forward the target contract call request to the consensus node through the routing nodes in the routing network; in addition, the service node can also directly send the target contract call request to the consensus node.
- the business node can generate the target contract call request according to the local transaction execution result and the initial contract call request, and the target contract call request can include the request parameters after the information completion; among them, the information complement
- the completed request parameters can include the original request parameters in the initial contract call request and the updated request parameters generated after information completion processing (that is, the request parameters with the business node's own information added); that is, the business node can Add the updated request parameters to the request parameters of the initial contract call request, so that the target contract call request containing the information-completed request parameters can be obtained, and then the target contract call request can be forwarded to the consensus through the routing nodes in the routing network
- the node or directly sends the target contract call request to the consensus node without going through the routing node. It can be understood that at this time, the initial contract call request and the target contract call request are different contract call requests.
- user terminal X1 when issuing electronic bills, user terminal X1 (referred to as the first user terminal) may initiate a contract call request Y1 (referred to as an initial contract call request) for issuing electronic bills, and the contract call request Y1 includes request parameters Z1 ;
- the business node X2 After the business node X2 receives the contract call request Y1, it can assign an invoice number to the electronic bill based on its local business data, and then generate a request parameter Z2 (called an updated request parameter) according to the invoice number, and send the request parameter Z2 Added to the request parameter Z1 of the contract call request Y1, so that the request parameter Z3 (called the request parameter after information completion) can be obtained; here, the contract call request Y1 containing the request parameter Z3 can be called the contract call request Y2 ( called the target contract call request); then, the business node can send the contract call request Y2 to the consensus node X4 through the routing node X3.
- the contract call request Y1 referred to as an
- the business node can also update the relevant fields in the initial contract call request according to the local transaction execution result, and obtain the target contract call request containing the updated field, and then can send the target contract call request (through the routing node Or not through the routing node) to the consensus node, so that the consensus node can call the contract on the target chain to parse the update field into an updated request parameter.
- the business nodes in the business network can correspond to different levels; for example, the upper-lower relationship (such as county level, city level, provincial level), after the lower-level nodes receive the initial contract call request , the local contract deployed on the lower node can be invoked to obtain the first contract invocation request, and then the first contract invocation request can be sent to the upper-level node, and the upper-level node can invoke the local contract deployed on the upper-level node to obtain the first contract invocation request 2.
- Contract call request; and so on, the contract call request obtained by the last level business node can be used as the target contract call request sent to the consensus node (with the highest level).
- the consensus node after the consensus node receives the target contract call request, it can obtain the contract on the target chain based on the first contract identifier in the target contract call request, and then call the contract on the target chain to execute the consensus indicated by the transaction business. business.
- the consensus node executing the consensus service please refer to step S302 corresponding to the subsequent FIG. 6 .
- the contract on the target chain can be a contract that has been successfully deployed on the consensus node, or it can be an empty contract on the chain; in the embodiment of this application, when the contract on the target chain is an empty contract, the consensus node will not Any contract on the chain will be called.
- the business object can also directly specify the target local contract in the contract call request through the first user terminal, that is, the first user terminal can send the contract call request containing the second contract identifier to the target local contract deployed.
- the business node of the contract which can obtain the target local contract based on the second contract identifier, and then call the target local contract to execute the local business, so as to obtain the local transaction execution result, and then return the local transaction execution result to the first user terminal .
- a contract call request B for calculating the tax amount can be initiated through the user terminal A1 (referred to as the first user terminal), and in the contract call request B
- the contract identifier C1 (called the second contract identifier) corresponding to the local contract C (called the target local contract) related to tax calculation can be specified
- the user terminal A1 can send the contract call request B to the service node A2
- the service node A2 can obtain the local contract C through the contract identifier C1
- the local business data D related to tax calculation from the node memory of the business node A2 through the local contract C (for example, tax policy, tax formula, income of business object A, Various expenditures, the area of cultivated land occupied, etc.)
- the final business node A2 can calculate the tax payable E of the business object A based on the local business data D (called the local transaction execution result), and return the tax payable E to the user terminal A1.
- the contract calling method provided by the embodiment of the present application can reduce the error rate of the contract calling, and facilitate the management of the smart contract, thereby improving the calling efficiency of the smart contract.
- each province has its own different policies, and the local contracts deployed by the business nodes in province A only serve province A, which can solve the problem of people in province B mistakenly calling local contracts in province A.
- FIG. 4 is a schematic flowchart of a smart contract-based data processing method provided by an embodiment of the present application.
- the smart contract-based data processing method can be executed by service nodes in the service network.
- the method may at least include step S201-step S203, each step will be described respectively below.
- Step S201 obtaining a contract deployment request sent by a second user terminal for deploying one or more preset local contracts, and forwarding the contract deployment request to a consensus node.
- the business object can initiate a contract deployment request for deploying one or more preset local contracts through the second user terminal; wherein, the contract deployment request can be used to add a contract to each preset local contract function (for example, the local contract function corresponding to the target local contract) to achieve the corresponding function, and can also be used to specify the business node that can execute each preset local contract in the business network (called the business node that deploys the preset local contract) ) corresponding to the node ID; in addition, the contract deployment request is also used to specify the associated on-chain contract for the preset local contract (it can be an already deployed on-chain contract or an empty on-chain contract on the consensus node).
- the contract deployment request can be used to add a contract to each preset local contract function (for example, the local contract function corresponding to the target local contract) to achieve the corresponding function, and can also be used to specify the business node that can execute each preset local contract in the business network (called the business node that deploys the preset local contract) ) corresponding to
- the information specified by the contract deployment request can be represented by the key field of the contract, and the second user terminal can generate a corresponding contract deployment request based on the key field of the contract, and then send the contract deployment request to the business Any service node in the network.
- the service node after the service node receives the contract deployment request, it can forward the contract deployment request to any consensus node in the core consensus network through the routing node in the routing network, or directly send The contract deployment request is sent to any consensus node.
- the consensus node After the consensus node receives the contract deployment request, it can perform consensus on the contract deployment request.
- the consensus node can generate one or more local contract summaries corresponding to the contract deployment request Information, the local contract summary information includes information corresponding to each preset local contract, and then the local contract summary information can be stored in the consensus node (for example, in the node memory); at this time, one or more The preset local contract is successfully deployed on the core chain.
- one or more preset local contracts include the target local contract; correspondingly, the summary information of the local contract generated by the consensus node includes information corresponding to the target local contract.
- the implementation of the consensus node consensus on the contract deployment request and the generation of local contract summary information can refer to the subsequent step S401 corresponding to FIG. 7 .
- the local contract summary information can be stored in the consensus node (for example, in the node memory) in the form of table storage, key-value storage (Key-Value storage, KV storage), file storage, etc. This application does not do this limited.
- the local contract summary information can be stored in the form of key-value storage, so that when the local contract is subsequently synchronized or called, the set Key (for example, the contract of the contract on the chain in the relationship mapping table ID) to quickly query the corresponding Value (for example, the contract ID of the local contract in the relational mapping table).
- FIG. 5a-FIG. 5c are schematic diagrams of a data processing scenario provided by an embodiment of the present application.
- the user terminal 30a (referred to as the second user terminal) initiates a contract deployment request A, and the contract deployment request A is used to deploy two local contracts (referred to as preset local contracts), which are local contracts L1 And the local contract L2; among them, the contract identifier of the local contract L1 is "Local_A", and the local contract L1 is associated with the on-chain contract C1 whose contract identifier is "Invoice”; the contract identifier of the local contract L2 is "Local_B", and the local contract L2 Associated with the on-chain contract C2 whose contract ID is "collaboration”.
- preset local contracts which are local contracts L1 And the local contract L2
- the contract identifier of the local contract L1 is "Local_A”
- the local contract L1 is associated with the on-chain contract C1 whose contract identifier is "Invoice”
- the contract C1 on the chain can be used to handle business related to invoices (ie, electronic bills), such as invoice issuance, invoice reimbursement, etc.; and the contract C2 on the chain can be used to handle transactions between different business objects/enterprises/institutions/units Collaborative business (such as multi-party collaborative processing of electronic documents), for example, business object 1 and business object 2 need to sign a contract together, then call the contract C2 on the chain, and the contract signed by business object 1 can be transferred to business object 2 to continue signing .
- invoices ie, electronic bills
- invoice reimbursement issuance
- Collaborative business such as multi-party collaborative processing of electronic documents
- the user terminal 30a can send the contract deployment request A to the service network 30b, wherein the service network 30b can include a service node 301b and a service node 302b; it can be understood that the service network 30b can also include other The service nodes in Fig. 5a, for example, service node 303b, ..., service node 30mb.
- Any service node (for example, service node 301b) in the service network 30b can obtain the contract deployment request A; in this application embodiment, if the service node 301b successfully receives the contract deployment request A, the service node 301b can send the contract
- the deployment request A is forwarded to the core consensus network 30c, wherein the core consensus network 30c may include multiple consensus nodes not shown in Figure 5a, such as consensus node 301c, consensus node 302c, ..., consensus node 30nc, and Each consensus node can obtain the contract deployment request A.
- the consensus node 301c can broadcast the contract deployment request A to other consensus nodes in the core consensus network 30c , so that each consensus node can verify the contract deployment request A (for example, terminal signature verification, deployment authority verification, etc.), when the verification is successful (called consensus passed), the consensus node 301c can generate a local contract based on the contract deployment request A contract summary information 30d, and store the local contract summary information 30d in the node memory of the consensus node 301c; it can be understood that the same data as the local contract summary information 30d is also stored in the node memory of other consensus nodes.
- each consensus node can verify the contract deployment request A (for example, terminal signature verification, deployment authority verification, etc.), when the verification is successful (called consensus passed)
- the consensus node 301c can generate a local contract based on the contract deployment request A contract summary information 30d, and store the local contract summary information 30d in the node memory of the consensus node 301c; it can be understood that the same data as the local contract summary information 30d is also
- the local contract summary information 30d may include a summary contract information table 30e and a summary relationship mapping table 30f.
- both the summary contract information table 30e and the summary relationship mapping table 30f are stored in the form of key-value storage.
- the summary contract information table 30e can store the corresponding contract information of the local contract L1 and the local contract L2, for example, the corresponding contract identifier, contract code (including the code of the contract function), the contract identifier of the associated on-chain contract, and the execution Identification list;
- the execution identification list (referred to as the executable node identification list) may include the node identification corresponding to the business node that specifies the deployment of the local contract, for example, the contract deployment request A specifies that the local contract L1 is deployed on the business node 301b and the 302b, at this time, the execution identifier list corresponding to the local contract L1 may include the node identifier ID1 corresponding to the service node 301b and the node identifier ID2 corresponding to the service node 302b; and when the contract deployment request A specifies that the local contract L2 is deployed on the service node 303b
- the execution identification list corresponding to the local contract L2 may include the node identification ID3 corresponding to the service node
- the summary relationship mapping table 30f can store the mapping relationship related to the local contract L1 and the local contract L2.
- the mapping relationship between the contract identifier "invoice” and the contract identifier "Local_A” can be stored in ; in addition, in order to facilitate subsequent contract synchronization, the node identifier (such as ID1, ID2) of the business node deployed with the local contract L1 can also be combined with The mapping relationship between the contract identifiers "Local_A" is also stored in the summary relationship mapping table 30f.
- Step S202 send a contract synchronization request to the consensus node, so that the consensus node can reach a consensus on the contract synchronization request; when the contract synchronization request consensus is passed, obtain the local contract information sent by the consensus node; store the local contract information in the node memory of the business node In , the target local contract is deployed based on the local contract information.
- any business node in the business network can transfer to the consensus node in the core consensus network through the routing node in the routing network Send a contract synchronization request, or directly send the contract synchronization request to the consensus node in the core consensus network without routing nodes, so as to synchronize the contract information corresponding to the preset local contract that needs to be deployed on the business node; the core consensus network After receiving the contract synchronization request, any one of the consensus nodes can broadcast the contract synchronization request to other consensus nodes, so that the consensus nodes can agree on the contract synchronization request; wherein, the contract synchronization request includes the business node corresponding to Node ID.
- the consensus node can obtain the local contract information related to the business node ID from the local contract summary information stored in its node memory based on the business node ID, and then can use the local contract information Return (or directly return) to the service node via the routing node.
- the service node can store the received local contract information in the node memory of the service node, and can create a corresponding preset local contract (for example, a target local contract) based on the local contract information.
- the local contract information sent by the consensus node can be obtained.
- the local contract information can include the target local contract and the information of other local contracts also deployed on the business node; Therefore, the local contract information may include a relationship mapping table and a local contract information table; wherein, the relationship mapping table may store the first mapping relationship between the first contract identifier and the second contract identifier, and the second contract identifier and the service node
- the second mapping relationship between identifiers (that is, the node identifier of the service node), and the local contract information table may include a contract information column corresponding to the target local contract.
- the service node that obtains and forwards the contract deployment request can be called the first service node (for example, the service node 301b in Figure 5a), and the service node that sends the contract synchronization request (for example, , service node 301b and service node 303b) in Fig. 5b are referred to as the second service node, and both the first service node and the second service node can be any service node in the service network, the first service node and the second service node It can be the same service node or different service nodes.
- the consensus node (for example, consensus node 301c) in the core consensus network 30c is based on the contract deployment request forwarded by the service node 301b A generates local contract summary information 30d; in addition, service nodes (for example, service node 301b, service node 303b) in the service network 30b can synchronize relevant contract information locally.
- the business node 301b sends a contract synchronization request B carrying the node identifier ID1 to the core consensus network 30c, and the consensus nodes in the core consensus network 30c can agree on the contract synchronization request B.
- any consensus node (such as Consensus node 301c) can query the information related to node identifier ID1 in local contract summary information 30d; column as a relationship mapping table 301f; wherein, the relationship mapping table 301f stores the mapping relationship between the node identifier ID1 and the contract identifier "Local_A", and the mapping relationship between the contract identifier "invoice” and the contract identifier "Local_A”; furthermore, The consensus node can query the contract information column with the contract identifier "Local_A" in the summary contract information table 30e based on the contract identifier "Local_A", and use the contract information column as the local contract information table 301e; wherein, the local contract information table 301e stores There is contract information related to the local contract L1.
- the consensus node 301c can return the relationship mapping table 301f and the local contract information table 301e as local contract information to the service node 301b, and the service node 301b can deploy the local contract L1 based on the relationship mapping table 301f and the local contract information table 301e.
- the business node 303b can also send the contract synchronization request C carrying the node ID ID3 to the core consensus network 30c, and finally can obtain the relationship mapping table 302f and the local contract information table 302e, and then can based on the relationship mapping table 302f and the local contract information table
- the information table 302e deploys the local contract L2. It can be understood that after a similar process, the local contract L1 and the local contract L2 can also be deployed on the service node 302b.
- Step S203 obtaining the initial contract call request for executing the transaction business; querying the contract identifier having the first mapping relationship with the first contract identifier in the relationship mapping table, and determining the queried contract identifier as being associated with the contract on the target chain
- the second contract identifier of the second contract identifier determine the local contract corresponding to the second contract identifier as the target local contract, call the target local contract to execute the local business indicated by the transaction business, and obtain the local transaction execution result; based on the local transaction execution result and the initial contract call Request, determine the target contract call request to be sent to the consensus node, and forward the target contract call request to the consensus node.
- step S203 is similar to the implementation process of step S103, and will not be repeated here.
- the service node 301b has successfully deployed the local Contract L1 (called the target local contract), and then the user terminal 30g (called the first user terminal) can call the contract call request D (called the initial contract call) carrying the contract identifier "invoice" (called the first contract identifier) request) to the service node 301b; thus, the service node 301b can find the contract identifier "Local_A” (called the second contract identifier) that has a mapping relationship with the contract identifier "invoice” in the relationship mapping table 301f, and then can according to the contract Identify "Local_A", find the contract information column with the contract identifier "Local_A" in the local contract information table 301e, so the local contract L1 can be obtained according to the contract identifier "Local_A", and the local contract L1 can be called in the contract information
- the service node 301b can obtain the contract call request D' (called the target contract call request) based on the local transaction execution result R and the contract call request D. It can be understood that the contract call request D' and the contract call request D are the same at this time request.
- the business node 301b can forward the contract call request D' to the core consensus network 30c for further processing, and the subsequent consensus nodes in the core consensus network 30c can call the on-chain contract C1 corresponding to the contract identifier "invoice" to perform business related to the invoice (for example, consensus business), so that the invoice data 30h can be obtained (called the transaction execution result on the chain); for example, it can include invoice 1, invoice 2, and invoice 3, and then the consensus node can pack the invoice data 30h into the block to be chained , and perform on-chain processing on the block to be on-chain.
- the service node 302b deployed with the local contract L1 can also process the contract call request D through a similar process, and the service node 302b and the service node 301b are not aware of each other, and each independently executes the corresponding pre-check processing.
- the local contract-based data processing method provided in the embodiment of the present application can be applied to a blockchain system with asymmetric nodes. And, in the embodiment of this application, the local contract can be executed on different levels of service nodes, and the service node can call the local contract before the consensus node to perform corresponding processing on the received contract call request (for example, pre-check processing , information completion processing, etc.), instead of backlogging all operations related to contract call requests on the consensus node, it can reduce the computing pressure of the consensus node and improve the overall transaction processing efficiency of the blockchain network.
- the business node uses the data of its own node (called local business data), which can reduce the resource consumption caused by the local business data on the chain, and can reduce the resource consumption caused by the interaction of multiple parties. And it can improve data privacy and security, and reduce the storage pressure of consensus nodes.
- FIG. 6 is a schematic flowchart of a smart contract-based data processing method provided by an embodiment of the present application.
- the smart contract-based data processing method can be executed by a consensus node in the core consensus network.
- the consensus node can be a server connected to the core consensus network, or a server connected to the core consensus network.
- User terminals in the network there is no limitation on the form of consensus nodes.
- the consensus node can be any node in the core consensus network shown in FIG. 1 above, and the target on-chain contract is deployed on the consensus node, for example, node 120a.
- the consensus node method may at least include step S301-step S303, each step will be described below.
- Step S301 acquiring a target contract invocation request for executing transaction business.
- the consensus node can receive the target contract call request for executing the transaction business.
- the target contract invocation request refers to the request determined by the business node in the business network independent of the core consensus network based on the local transaction execution result and the initial contract invocation request.
- the local transaction execution result is that the business node invokes the target local contract to execute the transaction
- the local service indicated by the service is obtained; the target local contract is obtained by the service node based on the second contract identifier; the second contract identifier refers to the service node based on the first contract identifier and the first mapping relationship, in the service node (for example, In the node memory), the contract identifier associated with the contract on the target chain is queried; the first contract identifier refers to the contract identifier used to call the contract on the target chain in the initial contract call request; the initial contract call request is used to execute the transaction business; The contract on the target chain is deployed on the consensus node; both the consensus node and the business node (for example, in the memory of the node) store the first mapping relationship between the first contract identifier and the second contract identifier; the second contract identifier is the deployment The contract identifier of the target local contract on the business node. For the data processing process performed by the business node based on the smart
- Step S302 based on the first contract identifier in the call request of the target contract, call the contract on the target chain, and obtain the transaction execution result on the chain by calling the contract on the target chain to execute the consensus business indicated by the transaction business.
- the consensus node can search multiple deployed on-chain contracts based on the first contract identifier, and then can determine the on-chain contract corresponding to the first contract identifier as the target on-chain contract; thus, the consensus node can call the target
- the on-chain contract can read the on-chain contract function in the consensus node (for example, in the node memory), and then can access the consensus associated with the consensus business in the consensus node (for example, in the node memory) through the on-chain contract function Business data, and the consensus business indicated by the transaction business can be executed through the consensus business data, and the transaction execution result on the chain can be obtained.
- the consensus business refers to the business performed by the consensus node (such as transferring virtual assets, issuing electronic bills, etc.), and the content of the consensus business is related to the transaction business, which is not limited in this application.
- each consensus node can read data by accessing its own ledger during business execution.
- step S303 a block to be added to the target blockchain is generated according to the transaction execution result on the chain, and the block is processed on the chain; the target blockchain is the blockchain to which the contract on the target chain belongs.
- the consensus node can generate the target transaction data according to the transaction execution result on the chain, and can broadcast the target transaction data to other consensus nodes, and then each consensus node can put the target transaction data into its own transaction The pool is waiting for subsequent packaging processing.
- a node among multiple consensus nodes can be selected as the first consensus node (also called a packaging node, a block node) through a consensus algorithm (for example, the leader produces blocks, turns out blocks, computing power competes to produce blocks, etc.). ), after the first consensus node obtains the bookkeeping right, it can extract a certain amount of transaction data from its transaction pool for packaging.
- the first consensus node can broadcast the block to be linked to the second consensus node (that is, the core consensus network except the first nodes other than the consensus node), and then the second consensus node can carry out block consensus on the block to be chained, obtain the block consensus result, and return the block consensus result to the first consensus node, if the block consensus
- the result is that the consensus is passed, and the first consensus node can add the block to be uploaded to the blockchain to which the contract on the target chain belongs.
- FIG. 7 is a schematic flowchart of another smart contract-based data processing method provided by an embodiment of the present application. As shown in Figure 7, the smart contract-based data processing method can be executed by consensus nodes in the core consensus network. The smart contract-based data processing method may at least include step S401-step S403, each step will be described below.
- Step S401 obtain the contract deployment request sent by the second user terminal forwarded by the service node, and perform consensus on the contract deployment request.
- the contract deployment request consensus is passed, generate one or more preset local contracts corresponding to the contract deployment request.
- Local contract summary information store the local contract summary information in the consensus node.
- the second user terminal can send a contract deployment request for deploying one or more preset local contracts to the service node.
- the service node After the service node successfully receives the contract deployment request, it can pass the contract deployment request through the The routing node forwards (or directly sends) to the consensus node, and then the consensus node can receive the contract deployment request.
- the one or more preset local contracts include the target local contract.
- the contract deployment request may include contract key fields corresponding to each preset local contract, wherein the contract key fields may include at least the following fields, which are Local Contract ID (Local Contract ID, also known as Local contract number), local contract version number (Version), local contract type (Type), local contract code (Code), local contract description information (Desc), associated contract identification (Chain Contract ID) and executable node identification list ( Executable Node List).
- the local contract type can be used to mark the call timing of each preset local contract.
- the local contract type of A type can be called before forwarding the data to the core consensus network, while the local contract type of B type
- the contract can be called after the data is synchronized back to the business node;
- the local contract description information can be used to describe the function of each preset local contract, of course, the key field of the contract may not include the local contract description information;
- the associated contract identifier refers to the The contract identifier of the on-chain contract associated with each preset local contract on the node;
- the list of executable node identifiers can include one or more executable node identifiers, and the executable node identifier refers to the The node ID corresponding to the node with execution authority (that is, the business node that needs to deploy each preset local contract specified by the business object), wherein the list of executable node IDs corresponding to the target local contract includes the business node ID.
- the contract deployment request may also include general fields such as terminal signature information corresponding to the second user terminal (that is, the request initiator), terminal identifier, and request timestamp.
- the consensus node can reach a consensus on both the terminal signature information and the terminal identification; here, the consensus node can recalculate the expected contract deployment request based on the private key used by the second user terminal to sign the contract deployment request. Signature information, and then compare the signature information with the terminal signature information. If the comparison results are consistent, it is determined that the contract deployment request has passed the security verification (called consensus pass), which means that the contract deployment request has not been passed during network transmission.
- consensus pass security verification
- the consensus node can reject the contract deployment request, and can return request rejection information to the second user terminal according to the comparison result; in addition, the consensus node can also obtain the deployment authority of the second user terminal through the terminal identification, and verify the deployment If it is recognized that the deployment authority is legal, it can be determined that the contract deployment request has passed the authority verification (called consensus pass), which means that the second user terminal has the authority to deploy the local contract to the specified business node, otherwise The consensus node can reject the contract deployment request, and can return request rejection information to the second user terminal according to the identification result. It can be understood that the deployment of local contracts in different business scenarios will have different levels, so the deployment authority of the second user terminal may be related to its level.
- the consensus node when both the terminal signature information and the terminal identification pass the consensus, the consensus node can generate summary A relational mapping table, the summary relational mapping table may include a mapping relation column corresponding to each preset local contract, and each mapping relation column may be used to store the relationship between the local contract identifier and the associated contract identifier of the corresponding preset local contract Mapping relationship, and the mapping relationship between the local contract ID and the corresponding executable node ID.
- the local contract L1 and the local contract L2 are two preset local contracts
- the consensus node for example, consensus node 301c
- the consensus node in the core consensus network 30c can deploy the request A according to the contract Generate a summary relationship mapping table 30f;
- the summary relationship mapping table 30f can include the contract identifier "Local_A" (ie, the local contract identifier corresponding to the local contract L1) and the contract identifier "invoice” (ie, the associated contract identifier corresponding to the local contract L1)
- the consensus node can generate a summary contract information table according to the local contract ID, local contract code, associated contract ID, and executable node ID list corresponding to all preset local contracts.
- the summary contract information table can include each preset local contract The corresponding contract information column.
- the consensus node (for example, consensus node 301c) in the core consensus network 30c can generate a summary contract information table 30e according to the contract deployment request A; the summary contract information table 30e stores the local contract L1 and the local contract L2 corresponding to contract information column; for example, the contract information column corresponding to the local contract L1 may include the contract identifier "Local_A" (that is, the local contract identifier), the contract code "XXXXXX" (that is, the local contract code), the contract identifier "invoice” (that is, the associated contract ID), executable node ID list [ID1, ID2].
- the contract information column corresponding to the local contract L1 may include the contract identifier "Local_A" (that is, the local contract identifier), the contract code "XXXXXX" (that is, the local contract code), the contract identifier "invoice” (that is, the associated contract ID), executable node ID list [ID1, ID2].
- the consensus node can determine the above summary relationship mapping table and summary contract information table as the local contract summary information corresponding to one or more preset local contracts (for example, the local contract summary information 30d shown in Figure 5a ), and then the local contract summary information can be stored in the node memory of the consensus node.
- Step S402 obtain the contract synchronization request sent by the business node, and perform consensus on the contract synchronization request.
- the contract synchronization request consensus is passed, based on the business node identification, obtain the local contract information in the local contract summary information, and send the local contract information to the business node.
- the consensus node is used to synchronize the local contract to the business node that can execute the local contract; during synchronization, the consensus node can quickly calculate the local contract information by accessing the list of executable node identifiers when the local contract is deployed.
- business nodes including: the consensus node can obtain the contract synchronization request sent by the business node, and the contract synchronization request can include the business node ID and node signature information of the business node, and then can reach a consensus on the node signature information and business node ID;
- the consensus node can recalculate the expected signature information of the contract synchronization request based on the private key used by the business node to sign the contract synchronization request, and then compare the signature information with the node signature information.
- the consensus node can reject the contract synchronization request and return it to the business node according to the comparison result request rejection information; in addition, the consensus node can also obtain the execution authority of the business node through the business node identifier, and identify the execution authority. Check whether the business node ID exists in the ID list.
- the consensus node can reject the contract synchronization request, and can return request rejection information to the business node according to the identification result.
- the consensus node when both the node signature information and the business node ID pass the consensus, the consensus node can query the summary relationship mapping table based on the business node ID, and the node ID that is queried has the same ID as the business node
- the mapping relationship column is determined as a relationship mapping table. Therefore, the consensus node can determine the local contract identifier in the relationship mapping table as the key contract identifier, and based on the key contract identifier, query in the summary contract information table, and the contract identifier that is the same as the key contract identifier can be queried
- the contract information column is determined as a local contract information table.
- the consensus node can determine the relationship mapping table and the local contract information table as the local contract information, and can send the local contract information to the above-mentioned service node.
- the relationship mapping table stores the first mapping relationship between the first contract identifier and the second contract identifier and the second mapping relationship between the second contract identifier and the service node identifier
- the local contract information table may include the target local contract The corresponding contract information column.
- the business node 301b can send a contract synchronization request B to the consensus node (such as the consensus node 301c) in the core consensus network 30c.
- the consensus node 301c can first query the contract identifier "Local_A" (that is, the key contract identifier) that has a mapping relationship with the node identifier ID1 of the service node 301b in the summary relationship mapping table 30f, and can determine the mapping relationship column that stores the mapping relationship as The relationship mapping table 301f, and then can be queried in the summary contract information table 30e according to the contract identifier "Local_A", and the contract information column with the contract identifier "Local_A" is determined as the local contract information table 301e, and then the relationship mapping table 301f can be And the local contract information table 301e is returned to the service node 301b.
- the contract identifier "Local_A" that is, the key contract identifier
- a long-term connection can be established between the business node and the consensus node, and the consensus node can actively report to the business node with execution authority (that is, the executable node identifier stored in the local contract summary information) at regular intervals.
- execution authority that is, the executable node identifier stored in the local contract summary information
- business nodes push the corresponding local contract information, so that these business nodes can store the local contract information in the node memory of the business node, and deploy the specified local contract based on the local contract information.
- the consensus node can delete the local contract information in its node memory to reduce the pressure on data storage; , may be accessed by other network terminals, causing the local contract information to be tampered with. Therefore, after the local contract information is successfully synchronized, the consensus node can still retain the local contract information in its node memory, and subsequent operations can be performed based on the stored local contract information. related verification.
- the execution logic of the local contract can also be changed by initiating a request, which is similar to the process of deploying a local contract.
- Step S403 obtain the target contract call request for executing the transaction business, call the contract on the target chain based on the first contract identifier in the call request of the target contract, and execute the consensus business indicated by the transaction business by calling the contract on the target chain to obtain the chain According to the execution result of the transaction on the chain, a block to be added to the target blockchain is generated according to the execution result of the transaction on the chain, and the block is processed on the chain.
- step S403 For the implementation process of step S403, reference may be made to step S303 corresponding to the above-mentioned FIG. 6 , and repeated descriptions will not be repeated here.
- FIG. 8 is a schematic flowchart of a data processing method provided in an embodiment of the present application.
- the data processing method can be executed by any consensus node in the blockchain network.
- the data processing method may include steps S1-S5, and each step will be described below.
- Step S1 the remote procedure call (Remote Procedure Call, RPC) layer of each consensus node (for example, node 1 to node N) obtains the user request (for example, the target contract call request); wherein, the user request is also called a transaction; the RPC layer It is an external interface provided by each consensus node, which can be used to obtain the target contract call request.
- RPC Remote Procedure Call
- Step S2 each consensus node broadcasts transactions to each other, and one of the consensus nodes packs several transactions into a block (called a block to be uploaded), and broadcasts to other consensus nodes.
- the selection of the block producing node (called the first consensus node) varies depending on the consensus algorithm, and can include the leader (Leader) producing blocks, taking turns to produce blocks, computing power competition to produce blocks, etc.
- the blockchain consensus network in Figure 8 is the above-mentioned core consensus network.
- Step S3 after each consensus node receives the block, it starts to execute the transactions in the block.
- the transaction parameters are parsed and the contract is executed (called the contract on the target chain).
- the execution process includes the processing of reading data in storage (such as node memory), for example, node 1 in Figure 8 reads historical transaction data (called consensus business data) from storage.
- Step S4 after the execution of the contract is completed, each consensus node checks the execution result (that is, the execution result of the above-mentioned on-chain transaction) with each other.
- the verification method can be to organize the execution results or changes to the storage into a result tree (for example, Merkle), store the result tree root in the block header through the result tree root hash, and finally verify each consensus node The block hashes are consistent.
- Step S5 after the consensus is successful, each consensus node writes the data related to the block into storage; including the block header, all transactions contained in the block, execution results, etc.
- step S1-step S5 For the detailed process of the above step S1-step S5, reference may be made to the corresponding step S301-step S303 in FIG. 6, and the description will not be repeated here.
- consensus nodes can join business nodes to quickly implement the deployment and synchronization of local contracts.
- FIG. 9 is a schematic structural diagram of a first data processing device based on a smart contract provided by an embodiment of the present application.
- the first data processing device 9-1 may be a computer program (including program code) running in a computer device; for example, the first data processing device 9-1 is an application software; the first data processing device 9-1 1 can be used to execute the corresponding steps in the method provided by the embodiment of this application.
- the first data processing device 9-1 may run on a service node in a service network.
- the first data processing device 9-1 may include: a first acquisition module 11, a first execution module 12, and a forwarding module 13;
- the first acquisition module 11 is configured to acquire an initial contract call request for executing transaction services; the initial contract call request includes a first contract identifier for calling a contract on the target chain; the contract on the target chain is deployed in the core consensus On the consensus node of the network, the core consensus network is independent of the business network; both the consensus node and the business node store a first mapping relationship between the first contract identifier and the second contract identifier; The second contract identifier is the contract identifier of the target local contract deployed on the service node;
- the first execution module 12 is configured to query the second contract identifier based on the first contract identifier and the first mapping relationship, determine the target local contract based on the second contract identifier, and call the target
- the local contract executes the local business indicated by the transaction business, and obtains the execution result of the local transaction;
- the forwarding module 13 is configured to send a target contract call request to the consensus node based on the local transaction execution result and the initial contract call request, and the target contract call request is used by the consensus node to Identify and obtain the contract on the target chain, and execute the consensus service indicated by the transaction service by calling the contract on the target chain;
- the blockchain network where the business network and the core consensus network are located also includes a routing network for network isolation;
- the above-mentioned forwarding module 13 is further configured to send the target contract call request to the consensus node through the routing node in the routing network based on the local transaction execution result and the initial contract call request.
- the first data processing device 9 - 1 may further include: a request feedback module 14 .
- the request feedback module 14 is configured to determine the request parameter that does not meet the on-link condition as an illegal request parameter if the pre-check result indicates that the request parameter does not meet the on-link condition, and The request parameter is used as the execution result of the local transaction corresponding to the local service; request failure information is generated according to the illegal request parameter, and the request failure information is returned to the first user terminal that sent the initial contract call request.
- the first data processing device 9 - 1 may further include: a first contract deployment module 15 and a first contract synchronization module 16 .
- the first contract deployment module 15 is configured to forward the contract deployment request sent by the second user terminal to the consensus node, and the contract deployment request is used for the consensus node to generate local contract information corresponding to one or more preset local contracts ;
- the one or more preset local contracts include the target local contract;
- the first contract synchronization module 16 is configured to send a contract synchronization request to the consensus node, and the contract synchronization request is used for the consensus node to agree on the contract synchronization request; the contract synchronization request includes the corresponding
- the contract synchronization request consensus is passed, the local contract information sent by the consensus node is received; the local contract information means that the consensus node is based on the business node identifier and is summarized in the local contract The information obtained in the information; deploy the target local contract based on the local contract information.
- the above-mentioned first execution module 12 may include: a third query unit 121 , a reading unit 122 , and an execution unit 123 .
- local contract information is stored in the service node; the local contract information includes a relationship mapping table; and the relationship mapping table includes the first mapping relationship.
- the third query unit 121 is configured to query the contract identifier having the first mapping relationship with the first contract identifier in the relationship mapping table, determine the queried contract identifier as the second contract identifier, and The local contract corresponding to the second contract identifier is determined as the target local contract.
- the reading unit 122 is configured to read the local contract information by calling the target local contract;
- the execution unit 123 is configured to execute the local service indicated by the transaction service through the local service data, and obtain the local transaction execution result.
- the execution unit 123 may include: a pre-check subunit 1231 and an information completion subunit 1232 .
- the pre-check subunit 1231 is configured to, based on the first local business data, perform Pre-check; if the pre-check result indicates that the request parameter meets the on-link condition, then determine the request parameter that meets the on-link condition as a legal request parameter, and use the legal request parameter as the corresponding to the local service
- the local transaction execution result, the on-chain condition is the condition for on-chain indicated by the local business.
- the information completion subunit 1232 is configured to invoke the request parameters in the request for the initial contract based on the second local business data Carry out information completion; use the request parameter after information completion as the execution result of the local transaction corresponding to the local business.
- FIG. 10 is a schematic structural diagram of a second data processing device based on a smart contract provided by an embodiment of the present application.
- the second data processing device 10-2 may be a computer program (including program code) running in a computer device, for example, the data processing device 10-2 is an application software; the second data processing device 10-2 may be It is used to execute the corresponding steps in the method provided by the embodiment of the present application. As shown in FIG. 10, the second data processing device 10-2 can run on a consensus node in the core consensus network.
- the second data processing device 10-2 may include: a second acquisition module 21, a second execution module 22, and an uplink module 23;
- the second obtaining module 21 is configured to obtain a target contract call request for executing transaction services; the target contract call request is sent by a service node based on the local transaction execution result and the initial contract call request, and the service node is located independently of In the business network of the core consensus network; the local transaction execution result is obtained by the business node by calling the target local contract to execute the local business indicated by the transaction business; the target local contract is the business node Obtained based on the second contract identifier; the second contract identifier is queried by the service node based on the first contract identifier and the first mapping relationship; the first contract identifier refers to the initial contract call request used is used to call the contract identifier of the contract on the target chain; the initial contract call request is used to execute the transaction business; the contract on the target chain is deployed on the consensus node; both the consensus node and the business node store There is the first mapping relationship between the first contract identifier and the second contract identifier; the second contract identifier is the contract identifier of the target
- the second execution module 22 is configured to call the contract on the target chain based on the first contract identifier in the call request of the target contract, and execute the consensus business indicated by the transaction business by calling the contract on the target chain , to get the transaction execution result on the chain.
- the second data processing device 10 - 2 may further include: a second contract deployment module 24 and a second contract synchronization module 25 .
- the second contract deployment module 24 is configured to perform consensus on the contract deployment request forwarded by the service node, and when the contract deployment request consensus is passed, generate one or more local contracts corresponding to the preset local contracts according to the contract deployment request. Contract summary information; the contract deployment request is sent to the service node by the second user terminal, and the one or more preset local contracts include the target local contract;
- the second contract synchronization module 25 is configured to perform consensus on the contract synchronization request sent by the service node; the contract synchronization request includes the service node identification corresponding to the service node; when the contract synchronization request consensus is passed, based on the The service node identifier, obtain local contract information from the local contract summary information, send the local contract information to the service node, and use the local contract information for the service node to deploy the target local contract.
- the contract deployment request includes contract key fields corresponding to each preset local contract, and the contract key fields include local contract identifier, local contract version number, local contract type, local contract code, and local contract description Information, associated contract identifiers, and executable node identifier lists; associated contract identifiers refer to the contract identifiers of on-chain contracts associated with each preset local contract deployed on the consensus node; the executable node identifier list includes one or more Executable node identification; executable node identification refers to the node identification corresponding to the node with execution authority for each preset local contract; the executable node identification list corresponding to the target local contract includes the service node logo.
- the contract deployment request also includes terminal signature information and terminal identification corresponding to the second user terminal; please refer to FIG. 10 , the second contract deployment module 24 may include: a first consensus unit 241, a mapping table generation unit 242. Information table generation unit 243, determination storage unit 244;
- the first consensus unit 241 is configured to perform consensus on terminal signature information and terminal identification;
- the mapping table generation unit 242 is configured to generate a summary relationship mapping table according to the local contract identification, associated contract identification and executable node identification list when the terminal signature information and the terminal identification pass the consensus; the summary relationship mapping table includes one or more Preset the mapping relationship column corresponding to the local contract respectively; the mapping relationship column is used to store the mapping relationship between the local contract ID and the associated contract ID, and the mapping relationship between the local contract ID and the executable node ID;
- the information table generating unit 243 is configured to generate a summary contract information table according to the local contract identifier, the local contract code, the associated contract identifier and the list of executable node identifiers; the summary contract information table includes contracts corresponding to one or more preset local contracts Information Bar;
- the determining storage unit 244 is configured to determine the summary relationship mapping table and the summary contract information table as local contract summary information corresponding to one or more preset local contracts.
- the contract synchronization request may also include node signature information
- the above-mentioned second contract synchronization module 25 may include: a second consensus unit 251, a first query unit 252, a second query unit 253, and a determination sending unit 254;
- the second consensus unit 251 is configured to perform consensus on node signature information and service node identifiers
- the first query unit 252 is configured to perform a query in the summary relationship mapping table based on the service node ID when both the node signature information and the service node ID have passed the consensus, and to query the mapping relationship column of the node ID that is the same as the service node ID. Determined as a relationship mapping table; the relationship mapping table stores the first mapping relationship and the second mapping relationship between the second contract identifier and the service node identifier;
- the second query unit 253 is configured to determine the local contract identifier in the relational mapping table as the key contract identifier, perform a query in the summary contract information table based on the key contract identifier, and search for contracts with the same contract identifier as the key contract identifier.
- the information column is determined as the local contract information table; the local contract information table includes the contract information column corresponding to the target local contract;
- the determining and sending unit 254 is configured to determine the relationship mapping table and the local contract information table as the local contract information, and send the local contract information to the service node.
- the on-chain module 23 is configured to generate a block to be added to the target blockchain according to the transaction execution result on the chain, and perform on-chain processing on the block;
- the target blockchain is the blockchain to which the contract on the target chain belongs.
- FIG. 11 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
- the computer device 1000 can be a service node in the business network or a consensus node in the core consensus network, and the computer device 1000 can include: a processor 1001, a network interface 1004 and a memory 1005.
- the above computer device 1000 may also include: a user interface 1003 , and at least one communication bus 1002 .
- the communication bus 1002 is used to realize connection and communication between these components.
- the user interface 1003 may include a display screen (Display) and a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
- the network interface 1004 may include a standard wired interface and a wireless interface (such as a WI-FI interface).
- the memory 1004 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.
- the memory 1005 may also be at least one storage device located away from the aforementioned processor 1001 .
- the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
- the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control stored in the memory 1005
- the application program is used to execute the description of the data processing method based on the smart contract provided by the embodiment of the present application, and the description will not be repeated here. In addition, the description of beneficial effects using the same method will not be repeated.
- the embodiment of the present application also provides a computer-readable storage medium, and the above-mentioned computer-readable storage medium stores the first data processing device 9-1 based on the smart contract or the second data processing device 9-1 based on the smart contract.
- the computer program executed by the device 10-2, and the above-mentioned computer program includes program instructions, when the above-mentioned processor executes the above-mentioned program instructions, it can execute the smart contract-based data processing method provided by the embodiment of the present application. Repeat the description. In addition, the description of beneficial effects using the same method will not be repeated.
- program instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or, alternatively, on multiple electronic devices distributed across multiple locations and interconnected by a communication network
- program instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or, alternatively, on multiple electronic devices distributed across multiple locations and interconnected by a communication network
- multiple electronic devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
- the above-mentioned computer-readable storage medium may be the data processing device based on the smart contract provided by the embodiment of the present application or the internal storage unit of the above-mentioned computer equipment, such as the hard disk or memory of the computer equipment.
- the computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc.
- the computer-readable storage medium may also include both an internal storage unit of the computer device and an external storage device.
- the computer-readable storage medium is used to store the computer program and other programs and data required by the computer device.
- the computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
- the embodiment of the present application also provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
- a processor of an electronic device such as a computer device reads the computer instruction from a computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the smart contract-based data processing method provided by the embodiment of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Theoretical Computer Science (AREA)
- Finance (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Power Engineering (AREA)
- Computer Hardware Design (AREA)
- Technology Law (AREA)
- Marketing (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims (19)
- 一种基于智能合约的数据处理方法,所述方法由业务网络中的业务节点执行,所述业务节点包括至少一个电子设备,包括:获取用于执行交易业务的初始合约调用请求;所述初始合约调用请求包括用于调用目标链上合约的第一合约标识;所述目标链上合约部署在核心共识网络的共识节点上,所述核心共识网络独立于所述业务网络;所述共识节点和所述业务节点中均存储有所述第一合约标识与第二合约标识之间的第一映射关系;所述第二合约标识为部署在所述业务节点上的目标本地合约的合约标识;基于所述第一合约标识和所述第一映射关系,查询所述第二合约标识,基于所述第二合约标识确定所述目标本地合约,通过调用所述目标本地合约执行所述交易业务所指示的本地业务,得到本地交易执行结果;基于所述本地交易执行结果和所述初始合约调用请求,向所述共识节点发送目标合约调用请求,所述目标合约调用请求用于所述共识节点基于所述第一合约标识调用所述目标链上合约,并通过调用所述目标链上合约执行所述交易业务所指示的共识业务。
- 根据权利要求1所述的方法,其中,所述业务节点中存储有本地合约信息;所述本地合约信息包括关系映射表;所述关系映射表包括所述第一映射关系;所述基于所述第一合约标识和所述第一映射关系,查询所述第二合约标识,基于所述第二合约标识确定所述目标本地合约,包括:在所述关系映射表中查询与所述第一合约标识具有所述第一映射关系的合约标识,将查询到的合约标识确定为所述第二合约标识,将所述第二合约标识所对应的本地合约确定为所述目标本地合约。
- 根据权利要求2所述的方法,其中,所述通过调用所述目标本地合约执行所述交易业务所指示的本地业务,得到本地交易执行结果,包括:通过调用所述目标本地合约读取所述本地合约信息;通过读取所述本地合约信息,获取与所述本地业务相关联的本地业务数据;通过所述本地业务数据执行所述交易业务所指示的所述本地业务,得到所述本地交易执行结果。
- 根据权利要求3所述的方法,其中,当所述本地业务数据包括第一本地业务数据时,所述通过所述本地业务数据执行所述交易业务所指示的所述本地业务,得到所述本地交易执行结果,包括:基于所述第一本地业务数据,对所述初始合约调用请求中的请求参数进行预检查;若预检查结果表示所述请求参数满足上链条件,则将满足所述上链条件的所述请求参数确定为合法请求参数,将所述合法请求参数作为所述本地业务对应的所述本地交易执行结果,所述上链条件为所述本地业务所指示的用于上链的条件。
- 根据权利要求4所述的方法,其中,所述方法还包括:若所述预检查结果表示所述请求参数不满足所述上链条件,则将不满足所述上链条件的所述请求参数确定为非法请求参数,将所述非法请求参数作为所述本地业务对应的所述本地交易执行结果;根据所述非法请求参数生成请求失败信息,将所述请求失败信息返回至发送所述初始合约调用请求的第一用户终端。
- 根据权利要求3所述的方法,其中,当所述本地业务数据包括第二本地业务数据时,所述通过所述本地业务数据执行所述交易业务所指示的所述本地业务,得到所述本地交易执行结果,包括:基于所述第二本地业务数据,对所述初始合约调用请求中的请求参数进行信息补全;将信息补全后的请求参数作为所述本地业务对应的所述本地交易执行结果。
- 根据权利要求1所述的方法,其中,所述业务网络与所述核心共识网络所在的区块链网络中还包括用于进行网络隔离的路由网络;所述基于所述本地交易执行结果和所述初始合约调用请求,向所述共识节点发送目标合约调用请求,包括:基于所述本地交易执行结果和所述初始合约调用请求,通过所述路由网络中的路由节点向所述共识节点发送所述目标合约调用请求。
- 根据权利要求1所述的方法,其中,所述方法还包括:向所述共识节点转发第二用户终端发送的合约部署请求,所述合约部署请求用于所述共识节点生成一个或多个预置本地合约对应的本地合约信息;所述一个或多个预置本地合约包括所述目标本地合约;向所述共识节点发送合约同步请求,所述合约同步请求用于所述共识节点对所述合约同步请求进行共识;所述合约同步请求包括所述业务节点对应的业务节点标识;当所述合约同步请求共识通过时,接收所述共识节点发送的本地合约信息;所述本地合约信息是指所述共识节点基于所述业务节点标识,在所述本地合约汇总信息中获取到的信息;基于所述本地合约信息部署所述目标本地合约。
- 一种基于智能合约的数据处理方法,所述方法由核心共识网络中的共识节点执行,所述共识节点包括至少一个电子设备,包括:获取用于执行交易业务的目标合约调用请求;所述目标合约调用请求是业务节点基于本地交易执行结果和初始合约调用请求所发送的,所述业务节点位于独立于所述核心共识网络的业务网络中;所述本地交易执行结果是由所述业务节点通过调用目标本地合约执行所述交易业务所指示的本地业务得到的;所述目标本地合约是所述业务节点基于第二合约标识获取到的;所述第二合约标识是所述业务节点基于第一合约标识和第一映射关系查询到的;所述第一合约标识是指所述初始合约调用请求中用于调用目标链上合约的合约标识;所述初始合约调用请求用于执行所述交易业务;所述目标链上合约部署在所述共识节点上;所述共识节点和所述业务节点中均存储有所述第一合约标识与所述第二合约标识之间的所述第一映射关系;所述第二合约标识为部署在所述业务节点上的所述目标本地合约的合约标识;基于所述目标合约调用请求中的所述第一合约标识,调用所述目标链上合约,通过调用所述目标链上合约执行所述交易业务所指示的共识业务,得到链上交易执行结果。
- 根据权利要求9所述的方法,其中,还包括:对所述业务节点转发的合约部署请求进行共识,当所述合约部署请求共识通过时,根据所述合约部署请求生成一个或多个预置本地合约对应的本地合约汇总信息;所述合约部署请求由第二用户终端向所述业务节点发送,所述一个或多个预置本地合约包括所述目标本地合约;对所述业务节点发送的合约同步请求进行共识;所述合约同步请求包括所述业务节点对应的业务节点标识;当所述合约同步请求共识通过时,基于所述业务节点标识,从所述本地合约汇总信息中获取本地合约信息,将所述本地合约信息发送至所述业务节点,所述本地合约信息用于所述业务节点部署所述目标本地合约。
- 根据权利要求10所述的方法,其中,所述合约部署请求包括每个预置本地合约分别对应的合约关键字段,所述合约关键字段包括本地合约标识、本地合约版本号、 本地合约类型、本地合约代码、本地合约描述信息、关联合约标识以及可执行节点标识列表;所述关联合约标识是指部署在所述共识节点上的与所述每个预置本地合约相关联的链上合约的合约标识;所述可执行节点标识列表包括一个或多个可执行节点标识;所述可执行节点标识是指针对所述每个预置本地合约具有执行权限的节点所对应的节点标识;所述目标本地合约对应的所述可执行节点标识列表包括所述业务节点标识。
- 根据权利要求11所述的方法,其中,所述合约部署请求还包括所述第二用户终端对应的终端签名信息以及终端标识;所述对所述业务节点转发的合约部署请求进行共识,当所述合约部署请求共识通过时,根据所述合约部署请求生成一个或多个预置本地合约对应的本地合约汇总信息,包括:对所述终端签名信息以及所述终端标识进行共识;当所述终端签名信息以及所述终端标识均共识通过时,根据所述本地合约标识、所述关联合约标识以及所述可执行节点标识列表,生成汇总关系映射表;所述汇总关系映射表包括所述一个或多个预置本地合约分别对应的映射关系栏;所述映射关系栏用于存储所述本地合约标识与所述关联合约标识之间的映射关系,以及所述本地合约标识与所述可执行节点标识之间的映射关系;根据所述本地合约标识、所述本地合约代码、所述关联合约标识以及所述可执行节点标识列表,生成汇总合约信息表;所述汇总合约信息表包括所述一个或多个预置本地合约分别对应的合约信息栏;将所述汇总关系映射表以及所述汇总合约信息表确定为所述一个或多个预置本地合约对应的所述本地合约汇总信息。
- 根据权利要求12所述的方法,其中,所述合约同步请求还包括节点签名信息;所述对所述业务节点发送的合约同步请求进行共识,当所述合约同步请求共识通过时,基于所述业务节点标识,从所述本地合约汇总信息中获取本地合约信息,包括:对所述节点签名信息以及所述业务节点标识进行共识;当所述节点签名信息以及所述业务节点标识均共识通过时,基于所述业务节点标识在所述汇总关系映射表中进行查询,将查询到的与所述业务节点标识相同的节点标识的映射关系栏确定为关系映射表;所述关系映射表存储有所述第一映射关系、以及所述第二合约标识与所述业务节点标识之间的第二映射关系;将所述关系映射表中的本地合约标识确定为关键合约标识,基于所述关键合约标识在所述汇总合约信息表中进行查询,将查询到的与所述关键合约标识相同的合约标识的合约信息栏确定为本地合约信息表;所述本地合约信息表包括所述目标本地合约对应的合约信息栏;将所述关系映射表以及所述本地合约信息表确定为所述本地合约信息。
- 根据权利要求9所述的方法,其中,所述通过调用所述目标链上合约执行所述交易业务所指示的共识业务,得到链上交易执行结果之后,所述方法还包括:根据所述链上交易执行结果生成待添加至目标区块链的区块,对所述区块进行上链处理;所述目标区块链为所述目标链上合约所属的区块链。
- 一种基于智能合约的第一数据处理装置,所述第一数据处理装置存储在业务网络的业务节点中,包括:第一获取模块,配置为获取用于执行交易业务的初始合约调用请求;所述初始合约调用请求包括用于调用目标链上合约的第一合约标识;所述目标链上合约部署在核心共识网络的共识节点上,所述核心共识网络独立于所述业务网络;所述共识节点和所述业 务节点中均存储有所述第一合约标识与第二合约标识之间的第一映射关系;所述第二合约标识为部署在所述业务节点上的目标本地合约的合约标识;第二执行模块,配置为基于所述第一合约标识和所述第一映射关系,查询所述第二合约标识,基于所述第二合约标识确定所述目标本地合约,通过调用所述目标本地合约执行所述交易业务所指示的本地业务,得到本地交易执行结果;转发模块,配置为基于所述本地交易执行结果和所述初始合约调用请求,向所述共识节点发送目标合约调用请求,所述目标合约调用请求用于所述共识节点基于所述第一合约标识获取所述目标链上合约,并通过调用所述目标链上合约执行所述交易业务所指示的共识业务。
- 一种基于智能合约的第二数据处理装置,所述第二数据处理装置存储在在核心共识网络的共识节点中,包括:第二获取模块,配置为获取用于执行交易业务的目标合约调用请求;所述目标合约调用请求是业务节点基于本地交易执行结果和初始合约调用请求所发送的,所述业务节点位于独立于所述核心共识网络的业务网络中;所述本地交易执行结果是由所述业务节点通过调用目标本地合约执行所述交易业务所指示的本地业务得到的;所述目标本地合约是所述业务节点基于第二合约标识获取到的;所述第二合约标识是所述业务节点基于第一合约标识和第一映射关系查询到的;所述第一合约标识是指所述初始合约调用请求中用于调用目标链上合约的合约标识;所述初始合约调用请求用于执行所述交易业务;所述目标链上合约部署在所述共识节点上;所述共识节点和所述业务节点中均存储有所述第一合约标识与所述第二合约标识之间的所述第一映射关系;所述第二合约标识为部署在所述业务节点上的所述目标本地合约的合约标识;第二执行模块,配置为基于所述目标合约调用请求中的所述第一合约标识,调用所述目标链上合约,通过调用所述目标链上合约执行所述交易业务所指示的共识业务,得到链上交易执行结果。
- 一种电子设备,包括:处理器、存储器以及网络接口;所述处理器与所述存储器、所述网络接口相连,其中,所述网络接口用于提供数据通信功能,所述存储器用于存储程序代码,所述处理器用于调用所述程序代码,以执行权利要求1-8任一项所述的由业务网络中的业务节点执行的基于智能合约的数据处理方法,或者以执行权利要求9-14任一项所述的由核心共识网络中的共识节点执行的基于智能合约的数据处理方法。
- 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序适于由处理器加载并执行权利要求1-8任一项所述的由业务网络中的业务节点执行的基于智能合约的数据处理方法,或者以执行权利要求9-14任一项所述的由核心共识网络中的共识节点执行的基于智能合约的数据处理方法。
- 一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时,实现权利要求1-8任一项所述的由业务网络中的业务节点执行的基于智能合约的数据处理方法,或者以执行权利要求9-14任一项所述的由核心共识网络中的共识节点执行的基于智能合约的数据处理方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP22855147.9A EP4300398A4 (en) | 2021-08-12 | 2022-07-11 | Smart contract-based data processing method and apparatus, electronic device, computer-readable storage medium, and computer program product |
| US18/196,878 US20230289782A1 (en) | 2021-08-12 | 2023-05-12 | Smart contract-based data processing |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110923438.7 | 2021-08-12 | ||
| CN202110923438.7A CN113379422B (zh) | 2021-08-12 | 2021-08-12 | 基于智能合约的数据处理方法、设备以及可读存储介质 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US18/196,878 Continuation US20230289782A1 (en) | 2021-08-12 | 2023-05-12 | Smart contract-based data processing |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023016164A1 true WO2023016164A1 (zh) | 2023-02-16 |
Family
ID=77576994
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/104894 Ceased WO2023016164A1 (zh) | 2021-08-12 | 2022-07-11 | 一种基于智能合约的数据处理方法、装置、电子设备、计算机可读存储介质及计算机程序产品 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20230289782A1 (zh) |
| EP (1) | EP4300398A4 (zh) |
| CN (2) | CN113379422B (zh) |
| WO (1) | WO2023016164A1 (zh) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113379422B (zh) * | 2021-08-12 | 2021-10-15 | 腾讯科技(深圳)有限公司 | 基于智能合约的数据处理方法、设备以及可读存储介质 |
| CN117131079B (zh) * | 2022-05-19 | 2025-08-08 | 腾讯科技(深圳)有限公司 | 一种基于区块链的数据处理方法、装置、设备及介质 |
| CN117675242A (zh) * | 2022-08-26 | 2024-03-08 | 抖音视界有限公司 | 业务请求处理方法、装置、电子设备及存储介质 |
| CN115658806A (zh) * | 2022-09-30 | 2023-01-31 | 蚂蚁区块链科技(上海)有限公司 | 区块链系统中的交易执行方法和节点 |
| CN117931933B (zh) * | 2022-10-14 | 2025-10-14 | 腾讯科技(深圳)有限公司 | 多区块链数据处理方法、装置、设备、系统以及介质 |
| CN119006150A (zh) * | 2023-05-17 | 2024-11-22 | 腾讯科技(深圳)有限公司 | 区块链网络的交易处理方法、装置、产品、设备和介质 |
| CN117118632B (zh) * | 2023-08-28 | 2024-06-11 | 财智共享(北京)技术服务有限公司 | 一种基于区块链的函证管理一体机设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111429254A (zh) * | 2020-03-19 | 2020-07-17 | 腾讯科技(深圳)有限公司 | 一种业务数据处理方法、设备以及可读存储介质 |
| CN112685505A (zh) * | 2021-01-07 | 2021-04-20 | 腾讯科技(深圳)有限公司 | 一种交易数据处理方法、装置、计算机设备及存储介质 |
| US20210203509A1 (en) * | 2019-09-12 | 2021-07-01 | Tencent Technology (Shenzhen) Company Limited | Data processing method and apparatus in blockchain network, storage medium, and computer device |
| CN113379422A (zh) * | 2021-08-12 | 2021-09-10 | 腾讯科技(深圳)有限公司 | 基于智能合约的数据处理方法、设备以及可读存储介质 |
Family Cites Families (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180365201A1 (en) * | 2017-06-14 | 2018-12-20 | Clause, Inc. | System and method for compound data-driven contracts and documentation |
| CN107507005B (zh) * | 2017-08-01 | 2020-09-11 | 众安信息技术服务有限公司 | 一种基于联盟链的链外数据访问方法和系统 |
| CN109003078B (zh) * | 2018-06-27 | 2021-08-24 | 创新先进技术有限公司 | 基于区块链的智能合约调用方法及装置、电子设备 |
| US11276056B2 (en) * | 2018-08-06 | 2022-03-15 | Inveniam Capital Partners, Inc. | Digital contracts in blockchain environments |
| CN110851496B (zh) * | 2018-12-07 | 2023-03-14 | 深圳市智税链科技有限公司 | 在区块链网络中查询交易信息的方法、装置、记账节点和介质 |
| CN109840429B (zh) * | 2019-01-08 | 2020-04-14 | 北京众享比特科技有限公司 | 智能合约部署、调用方法和装置 |
| CN110730204B (zh) * | 2019-09-05 | 2022-09-02 | 创新先进技术有限公司 | 区块链网络中删除节点的方法和区块链系统 |
| CN113691597B (zh) * | 2019-11-27 | 2022-06-14 | 腾讯科技(深圳)有限公司 | 区块链合约部署方法、装置、设备以及存储介质 |
| CN113032490B (zh) * | 2019-12-05 | 2022-07-12 | 腾讯科技(深圳)有限公司 | 一种合约数据处理方法、相关设备及介质 |
| CN111461878A (zh) * | 2020-03-10 | 2020-07-28 | 杭州溪塔科技有限公司 | 一种基于链外智能合约的区块链交易处理方法和系统 |
| CN111401903B (zh) * | 2020-06-03 | 2020-09-11 | 腾讯科技(深圳)有限公司 | 区块链消息处理方法、装置、计算机以及可读存储介质 |
| CN111770198B (zh) * | 2020-08-31 | 2020-12-18 | 支付宝(杭州)信息技术有限公司 | 一种信息共享方法、装置及设备 |
| CN112199186B (zh) * | 2020-12-07 | 2021-03-02 | 腾讯科技(深圳)有限公司 | 基于智能合约的数据处理方法、装置、设备及存储介质 |
| CN112632573B (zh) * | 2020-12-15 | 2024-06-21 | 东软集团股份有限公司 | 智能合约执行方法、装置、系统、存储介质及电子设备 |
| CN112700246B (zh) * | 2020-12-31 | 2023-11-28 | iCALC控股有限公司 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
| CN112380149B (zh) * | 2021-01-18 | 2021-04-06 | 腾讯科技(深圳)有限公司 | 基于节点内存的数据处理方法、装置、设备以及介质 |
| CN112926982B (zh) * | 2021-01-20 | 2022-08-02 | 腾讯科技(深圳)有限公司 | 一种交易数据处理方法、装置、设备及存储介质 |
| CN112907244B (zh) * | 2021-02-10 | 2023-11-28 | iCALC控股有限公司 | 基于区块链的数据处理方法、装置、设备及可读存储介质 |
-
2021
- 2021-08-12 CN CN202110923438.7A patent/CN113379422B/zh active Active
- 2021-08-12 CN CN202111229632.1A patent/CN113988845B/zh active Active
-
2022
- 2022-07-11 WO PCT/CN2022/104894 patent/WO2023016164A1/zh not_active Ceased
- 2022-07-11 EP EP22855147.9A patent/EP4300398A4/en active Pending
-
2023
- 2023-05-12 US US18/196,878 patent/US20230289782A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210203509A1 (en) * | 2019-09-12 | 2021-07-01 | Tencent Technology (Shenzhen) Company Limited | Data processing method and apparatus in blockchain network, storage medium, and computer device |
| CN111429254A (zh) * | 2020-03-19 | 2020-07-17 | 腾讯科技(深圳)有限公司 | 一种业务数据处理方法、设备以及可读存储介质 |
| CN112685505A (zh) * | 2021-01-07 | 2021-04-20 | 腾讯科技(深圳)有限公司 | 一种交易数据处理方法、装置、计算机设备及存储介质 |
| CN113379422A (zh) * | 2021-08-12 | 2021-09-10 | 腾讯科技(深圳)有限公司 | 基于智能合约的数据处理方法、设备以及可读存储介质 |
| CN113988845A (zh) * | 2021-08-12 | 2022-01-28 | 腾讯科技(深圳)有限公司 | 基于智能合约的数据处理方法、设备以及可读存储介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4300398A4 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113379422A (zh) | 2021-09-10 |
| CN113988845A (zh) | 2022-01-28 |
| CN113988845B (zh) | 2022-07-12 |
| US20230289782A1 (en) | 2023-09-14 |
| EP4300398A1 (en) | 2024-01-03 |
| EP4300398A4 (en) | 2024-05-01 |
| CN113379422B (zh) | 2021-10-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023016164A1 (zh) | 一种基于智能合约的数据处理方法、装置、电子设备、计算机可读存储介质及计算机程序产品 | |
| CN111488393B (zh) | 虚拟区块链 | |
| CN111989705B (zh) | 有许可区块链中的优先级 | |
| US20240235817A9 (en) | Asset transferring method and apparatus based on multiple blockchains, device, medium, and product | |
| CN110135860B (zh) | 一种基于区块链技术的农作物种子安全溯源系统 | |
| CN111144881A (zh) | 对资产转移数据的选择性访问 | |
| KR102139551B1 (ko) | 유언장을 관리하는 서버 및 방법 | |
| JP2022504348A (ja) | ブロックチェーン・リソースを格納するブロックチェーン通知ボード | |
| CN111798233B (zh) | 令牌的链接 | |
| CN112084186B (zh) | 拆分和合并存储 | |
| CN113255014A (zh) | 一种基于区块链的数据处理方法以及相关设备 | |
| CN111340628A (zh) | 基于区块链的资产信息管理方法和装置 | |
| KR20250038702A (ko) | 멀티-블록체인 데이터 처리 방법 및 장치, 그리고 디바이스, 컴퓨터가 판독 가능한 저장 매체 및 컴퓨터 프로그램 제품 | |
| WO2024082818A1 (zh) | 基于多区块链的跨链处理方法、装置、设备、系统及介质 | |
| CN116467062A (zh) | 一种基于区块链的数据处理方法、设备以及可读存储介质 | |
| CN112883117A (zh) | 一种数据同步方法、设备以及计算机可读存储介质 | |
| CN117938867A (zh) | 一种多区块链数据处理方法、装置、设备、介质及产品 | |
| CN112084187B (zh) | 存储的拆分和合并 | |
| CN120433962A (zh) | 一种面向无人机的跨域协作的去中心化数据访问控制方法 | |
| CN117931933B (zh) | 多区块链数据处理方法、装置、设备、系统以及介质 | |
| CN115250354A (zh) | 基于区块链网络的资源分配方法、装置、设备及存储介质 | |
| WO2024153001A1 (zh) | 一种基于分层链网络的数据处理方法、装置、设备及介质 | |
| HK40051779B (zh) | 基於智能合约的数据处理方法、设备以及可读存储介质 | |
| HK40051779A (zh) | 基於智能合约的数据处理方法、设备以及可读存储介质 | |
| CN113420083A (zh) | 一种具有可拓展分布式账本的异构并行区块链结构 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22855147 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 22855147.9 Country of ref document: EP Ref document number: 2022855147 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 2022855147 Country of ref document: EP Effective date: 20230925 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 11202306404S Country of ref document: SG |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |