Smart contract business processing method, device, medium and equipment

Through smart contract business processing methods, contract services are analyzed and constructed, and external key custody service signature processing is used to solve user interaction complexity and key management problems, and the processing efficiency of blockchain contract services is improved.

CN118642788BActive Publication Date: 2024-11-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411124906.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-26
Estimated Expiration
2044-08-16

Smart Images

  • Figure CN118642788B_ABST
    Figure CN118642788B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, medium and equipment for processing smart contract business, which relates to the field of blockchain technology. The method includes: responding to a business processing request submitted by a business account, parsing and processing the target smart contract to obtain contract parsing information; responding to an execution instruction triggered by a business account based on a contract interaction page, constructing a real contract business; the contract interaction page is an interactive page generated and displayed based on the contract parsing information and corresponding to the target smart contract; calling an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business; submitting the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract. The technical solution provided by the present application can optimize the interactive experience between users and smart contracts on the blockchain and improve the processing efficiency of contract business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and specifically to methods, devices, media and equipment for processing smart contract services. Background Art

[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. At present, when users interact with smart contracts on blockchain through the smart contract application of the terminal (smart contracts can operate on the data stored on the chain, and are an important way for business entities to interact with blockchain and use blockchain to implement business logic), they need to construct contract business by themselves and sign the contract business with the key through the smart contract application. The process is relatively cumbersome, and the key is difficult for users to remember and easy to lose, which greatly affects the processing of contract business. Summary of the invention

[0003] In order to optimize the user's interactive experience with smart contracts on the blockchain and improve the processing efficiency of contract services, this application provides a method, device, medium and equipment for processing smart contract services. The technical solution is as follows:

[0004] In a first aspect, the present application provides a method for processing a smart contract business, which is applied to a smart contract interaction platform, and the method includes:

[0005] In response to the business processing request submitted by the business account, the target smart contract is parsed and processed to obtain contract parsing information;

[0006] In response to the execution instruction triggered by the business account based on the contract interaction page, construct a real contract business; the contract interaction page is an interaction page generated and displayed according to the contract parsing information and corresponding to the target smart contract;

[0007] Calling an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business;

[0008] Submit the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

[0009] In an optional embodiment, in response to the business processing request submitted by the business account, parsing the target smart contract to obtain contract parsing information includes:

[0010] In response to the business processing request, the contract parsing engine of the smart contract interaction platform is called to parse the target smart contract stored in the target blockchain to obtain the contract parsing information.

[0011] In an optional embodiment, in response to the business processing request, calling the contract parsing engine of the smart contract interaction platform to parse the target smart contract stored in the target blockchain to obtain the contract parsing information includes:

[0012] In response to the business processing request, obtaining a bytecode file of the target smart contract from the target blockchain;

[0013] The bytecode file is parsed to determine the contract parsing information of the target smart contract.

[0014] In an optional embodiment, the parsing the bytecode file to determine the contract parsing information of the target smart contract includes:

[0015] Parsing the bytecode file to obtain first business interface attribute information of the target smart contract, where the first business interface attribute information includes interface function variables and function parameter variables of at least one contract business;

[0016] When the source code file of the target smart contract is obtained from the chain browser of the target blockchain, the source code file is parsed to obtain the second business interface attribute information of the target smart contract, where the second business interface attribute information includes a business interface name and a business parameter name of at least one historical business interface; the at least one historical business interface is part or all of at least one business interface;

[0017] The first service interface attribute information is updated according to the second service interface attribute information to obtain the contract resolution information.

[0018] In an optional embodiment, in response to the execution instruction triggered by the business account based on the contract interaction page, constructing a real contract business includes:

[0019] In response to the execution instruction triggered by the business account based on the contract interaction page, obtaining business processing data input by the business account based on the contract interaction page; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name;

[0020] Construct the real contract business according to the business processing data.

[0021] In an optional embodiment, the calling of an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business includes:

[0022] Calling the key escrow service to determine the escrow key corresponding to the business account;

[0023] The real contract business is signed using the escrow key to obtain the target contract business;

[0024] The escrow key is a complete key stored in a primary cloud server or multiple shard keys stored in multiple backup cloud servers.

[0025] In an optional embodiment, the method further includes:

[0026] In response to a pre-execution instruction triggered by the business account based on the contract interaction page, construct a simulated contract business, and perform pre-execution processing on the simulated contract business to obtain a pre-execution result;

[0027] The constructing of a real contract business in response to an execution instruction triggered by the business account based on the contract interaction page includes:

[0028] In response to the execution instruction triggered by the business account based on the contract interaction page when the pre-execution result is consistent with the expected execution result, the real contract business is constructed.

[0029] In an optional embodiment, in response to the pre-execution instruction triggered by the business account based on the contract interaction page, constructing a simulated contract business, and performing pre-execution processing on the simulated contract business to obtain a pre-execution result includes:

[0030] In response to the pre-execution instruction, the contract pre-execution engine of the smart contract interaction platform is called to construct the simulated contract business, and pre-execution processing is performed on the simulated contract business to obtain the pre-execution result.

[0031] In an optional embodiment, in response to the pre-execution instruction, calling the contract pre-execution engine of the smart contract interaction platform to construct the simulated contract business, and performing pre-execution processing on the simulated contract business to obtain the pre-execution result includes:

[0032] In response to the pre-execution instruction, obtaining business processing data input by the business account based on the contract interaction page; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name;

[0033] Constructing the simulated contract business according to the business processing data;

[0034] The chain data service of the target blockchain is called to generate a smart contract virtual machine to execute the simulated contract business based on the target smart contract in the smart contract virtual machine to obtain the pre-execution result.

[0035] In an optional embodiment, submitting the target contract business to a target blockchain so that the target blockchain executes the target contract business based on the target smart contract includes:

[0036] Determine the current network busy / idle status or current service execution cost of the target blockchain;

[0037] When the current network busy / idle status meets the preset network condition or the current business execution cost is not higher than the preset threshold, the target contract business is submitted to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

[0038] In an optional embodiment, in response to the business processing request submitted by the business account, parsing the target smart contract to obtain contract parsing information includes:

[0039] In response to the business processing request, traverse a locally stored historical smart contract parsing information set, wherein the historical smart contract parsing information set includes historical parsing information of at least one historical smart contract;

[0040] When traversing to the target smart contract from the at least one historical smart contract, historical parsing information of the target smart contract is obtained, and the historical parsing information of the target smart contract is used as the contract parsing information.

[0041] In an optional embodiment, the method further includes:

[0042] In response to the business processing request, obtaining at least one target historical contract business corresponding to the target smart contract from the target blockchain, wherein the at least one target historical contract business is a contract business executed based on the target smart contract within a target time period before the current moment;

[0043] Based on the at least one target historical contract business, determine the current business execution status information corresponding to the target smart contract;

[0044] The current business execution status information is displayed on the contract interaction page.

[0045] In a second aspect, the present application provides a processing device for a smart contract business, which is applied to a smart contract interaction platform, and the device includes:

[0046] The contract parsing module is used to respond to the business processing request submitted by the business account, parse the target smart contract, and obtain contract parsing information;

[0047] A contract business construction module, configured to construct a real contract business in response to an execution instruction triggered by the business account based on a contract interaction page; the contract interaction page is an interaction page generated and displayed based on the contract parsing information and corresponding to the target smart contract;

[0048] The signature module is used to call an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business;

[0049] A submission module is used to submit the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

[0050] In a third aspect, the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the processing method of the smart contract business as described in the first aspect.

[0051] In a fourth aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the processing method of the smart contract business as described in the first aspect.

[0052] In a fifth aspect, the present application provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, the method for processing the smart contract business as described in the first aspect is implemented.

[0053] The processing method, device, medium and equipment of the smart contract business provided by this application have the following technical effects:

[0054] The solution provided by the present application is to respond to the business processing request submitted by the business account through the smart contract interaction platform constructed in the blockchain application system, parse and process the target smart contract, and obtain the contract parsing information. The smart contract interaction platform can generate and display the contract interaction page corresponding to the target smart contract according to the contract parsing information, improve the business account's understanding of the target smart contract, and can help the business account enter relevant business processing data; the smart contract interaction platform responds to the execution instruction triggered by the business account based on the contract interaction page, constructs a real contract business, avoids constructing the real contract business at the terminal of the business account, and simplifies the processing flow on the business account side; the smart contract interaction platform performs key signature processing on the real contract business by calling an external key escrow service to obtain the target contract business, so that the business account does not need to remember the cumbersome key under the premise of escrow, and does not need to sign the real contract business at the terminal of the business account, which simplifies the processing flow on the business account side; the smart contract interaction platform submits the target contract business obtained after signing to the target blockchain, so that the target blockchain executes the target contract business based on the target smart contract, which can effectively improve the processing efficiency of the target contract business. The solution provided in this application can effectively optimize the interaction process between business accounts and smart contracts on the blockchain and improve the processing efficiency of contract business through the smart contract interaction platform built in the blockchain application system.

[0055] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0057] Figure 1 (1) is a schematic diagram of a blockchain network architecture provided in an embodiment of the present application;

[0058] FIG1 (2) is a schematic diagram of a blockchain business system architecture applied to tax business provided in an embodiment of the present application;

[0059] Figure 2 It is a flowchart of a method for processing a smart contract business provided by an embodiment of the present application;

[0060] Figure 3 It is a schematic diagram of a contract interaction page provided in an embodiment of the present application;

[0061] Figure 4 It is a flowchart of another method for processing smart contract business provided in an embodiment of the present application;

[0062] Figure 5 It is a flowchart of another contract interaction page provided in an embodiment of the present application;

[0063] Figure 6 It is a schematic diagram of the architecture of a smart contract interaction platform provided in an embodiment of the present application;

[0064] Figure 7 It is a schematic diagram of a processing device for a smart contract business provided in an embodiment of the present application;

[0065] Figure 8 It is a schematic diagram of the hardware structure of a device for implementing a processing method for a smart contract business provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] The embodiments of the present application provide a method, device, medium and equipment for processing smart contract business. The technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. Examples of the embodiments are shown in the drawings, where the same or similar numbers throughout represent the same or similar elements or elements with the same or similar functions.

[0067] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0068] In order to facilitate understanding of the technical solutions described in the embodiments of the present application and the technical effects produced therefrom, the embodiments of the present application explain the relevant professional terms involved:

[0069] Blockchain: Blockchain is essentially a decentralized database, a string of data blocks generated using cryptographic methods. Each data block contains multiple transaction data, which are used to verify the validity of the transaction data (anti-counterfeiting) and generate the next block.

[0070] Layered blockchain: A blockchain solution proposed in industrial architecture applications that separates the consensus network and the witness network. The consensus nodes of the consensus network mainly perform the core consensus algorithm, while the business nodes of the witness network perform data clearing and synchronization, and complete related specific businesses based on the SPV (Special Purpose Vehicle) nodes.

[0071] Smart contract: Smart contract, also known as chaincode or application code, is a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. It is a program deployed in the nodes of the blockchain network, carrying the business logic for executing transactions and running in an isolated operating environment (such as a container or virtual machine). Smart contracts can operate on data stored on the chain and are an important way for business entities to interact with the blockchain and use the blockchain to implement business logic. The purpose of smart contracts is to provide a security method that is superior to traditional contracts and reduce other transaction costs associated with contracts. It allows trusted transactions without a third party, and these transactions are traceable and irreversible.

[0072] Local contract: In the layered blockchain architecture, a smart contract that runs on a business node. This type of smart contract has independent local storage and is only executed on a single business node. The consensus node will not execute the local contract. The execution result of the local contract can be submitted to the chain by the business node.

[0073] External Account: Externally Owned Account, referred to as EOA; external accounts are the type of blockchain accounts currently used by most ordinary users. External accounts consist of private keys and public keys. The private key represents the control right, while the public key represents the account address. External accounts can actively initiate transactions and verify transactions through ECDSA (Elliptic Curve Digital Signature Algorithm), and can also initiate the deployment of smart contracts.

[0074] Contract Account: Contract Account, referred to as CA; Unlike external accounts, contract accounts do not have private keys, only addresses. Contract accounts are controlled by code and cannot actively initiate transactions.

[0075] Smart contract account: A type of account that combines the advantages of contract accounts and external accounts and can achieve account abstraction.

[0076] It is understandable that in the specific implementation of this application, data related to business accounts, etc. is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0077] Please refer to Figure 1 (1). Figure 1 (1) is a schematic diagram of a blockchain network architecture provided by an embodiment of the present application. As shown in Figure 1 (1), the consensus network and the witness network are separated. The accounting nodes of the consensus network mainly perform the core consensus algorithm, and the business nodes of the witness network perform data clearing and synchronization, and complete relevant specific services based on the SPV (Special Purpose Vehicle) node. When the business node is deployed in the witness network on the public network, and the accounting node running the blockchain consensus protocol is deployed in the private consensus network, the two need to interact through the routing boundary. The consensus network is in a relatively secure private cloud, and the security of mutual access between accounting nodes is guaranteed by the consensus mechanism, and no additional identity management and network control are required. However, the business node is in the public network and may be accessed by other uncertain network terminals. Therefore, the behavior of the business node and other network terminals accessing the consensus network needs to be strictly controlled.

[0078] Please refer to Figure 1 (2), which is a schematic diagram of a blockchain business architecture applied to taxation provided by an embodiment of the present application. As shown in Figure 1 (2), the business performed by the business node takes the electronic invoice business as an example. The business node in the business layer is in the witness network, receiving business processing requests related to electronic invoices submitted by Internet network terminals. The business node will also submit business operation interaction requests to the core consensus network layer; the core consensus network layer may include accounting nodes of multiple core chains associated with taxation (corresponding to TrustSQL nodes). The business layer, routing proxy layer, and core consensus network layer constitute the entire complete blockchain business system, in which the routing proxy layer plays an isolation role for the business layer and the core consensus network layer, and can provide point-to-point services, routing services, certificate cache and authentication services, etc.

[0079] In the network shown in Figure 1 (1) or Figure 1 (2), the smart contract interaction platform provided in the embodiment of the present application can be used as an interaction platform between the Internet network terminal and the business node, and can also be used as an interaction platform between the business node and the accounting node. In response to the business processing request submitted by the business account on the network terminal or the business node, the target smart contract is parsed and processed to obtain the contract parsing information; in response to the execution instruction triggered by the business account based on the contract interaction page, the real contract business is constructed; the contract interaction page is an interaction page generated and displayed based on the contract parsing information and corresponding to the target smart contract; an external key escrow service is called to perform key signature processing on the real contract business to obtain the target contract business; the target contract business is submitted to the target blockchain, so that the target business node or target consensus node of the target blockchain executes the target contract business based on the target smart contract. The smart contract interaction platform provided in the embodiment of the present application can optimize the interaction experience between the business account and the smart contract on the blockchain, and improve the processing efficiency of the contract business.

[0080] Specifically, the network terminal may include devices such as smartphones, desktop computers, tablet computers, laptops, vehicle-mounted terminals, digital assistants, smart wearable devices, and voice interaction devices, and may also include software running in the device, such as web pages provided to users by some service providers, or smart contract applications provided to users by some service providers, such as smart contract wallets. Specifically, the network terminal may be used to submit business processing requests to the smart contract interaction platform for business accounts, and display contract interaction pages generated by the smart contract interaction platform, trigger execution instructions, etc.

[0081] Specifically, a business node or accounting node can be any form of computing device in the access network, such as a server, terminal, etc. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer. The functions involved in the node include:

[0082] 1) Routing: A basic function of a node, used to support communication between nodes.

[0083] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs. They record data related to the implementation of functions to form record data. Digital signatures are carried in the record data to indicate the source of the task data. The record data is sent to other nodes in the blockchain system for other nodes to add the record data to a temporary block when the source and integrity of the record data are successfully verified.

[0084] For example, the services implemented by the application include:

[0085] 2.1) Wallet, used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After the other nodes successfully verify the transaction, as a response to acknowledge the validity of the transaction, the transaction record data is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;

[0086] 2.2) Shared ledger, which is used to provide functions such as storage, query and modification of account data. The record data of the operation on the account data is sent to other nodes in the blockchain system. After other nodes verify the validity, as a response to acknowledge the validity of the account data, the record data is stored in a temporary block, and a confirmation can also be sent to the node that initiated the operation.

[0087] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying code on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer, and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.

[0088] The embodiments of the present application can also be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software and network in a wide area network or a local area network to realize data calculation, storage, processing and sharing. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology and application technology based on cloud computing business model applications. Cloud technology needs to be supported by cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". Specifically, the business node or accounting node is located in the cloud, and the business node or accounting node can be a physical machine or a virtualized machine.

[0089] See also Figure 2 , Figure 2 A flowchart of a method for processing smart contract business provided in an embodiment of the present application. The present application provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment). Figure 2 As shown, a method for processing a smart contract business provided in an embodiment of the present application is applied to a smart contract interaction platform and may include the following steps:

[0090] S210: In response to the business processing request submitted by the business account, the target smart contract is parsed and processed to obtain contract parsing information.

[0091] In the embodiment of the present application, the business account can be a user account registered and logged in on the smart contract interaction platform. The user can register or log in to the account through the smart contract interaction application supported by the smart contract interaction platform or the platform webpage of the smart contract interaction platform; correspondingly, the business account can submit a business processing request through the smart contract interaction application supported by the smart contract interaction platform or the platform webpage of the smart contract interaction platform. It should be noted that the interaction between the business account and the target smart contract is carried out within the scope of the authority possessed by the business account.

[0092] In an embodiment of the present application, a business processing request is used to request the target blockchain to perform business processing based on the target smart contract. The target smart contract is stored in the target node of the target blockchain, and the target node can be a business node or a consensus node of the target blockchain. Specifically, the business processing request can be a business processing instruction containing the contract address of the target smart contract, and the contract address of the target smart contract points to the target node of the target blockchain.

[0093] In an embodiment of the present application, a server at the back end of the smart contract interaction platform can respond to a business processing request submitted by a business account, obtain file information corresponding to a target smart contract from a target blockchain, and parse the file information to obtain contract parsing information, which can indicate the attribute information of at least one contract business supported by the target smart contract. In an embodiment of the present application, a contract business refers to a business executed based on a smart contract, and the attribute information of the contract business can include the business name or business type of the contract business, the business parameter name or business parameter type of the contract business, etc.

[0094] In a specific embodiment, step S210 may be implemented as follows:

[0095] S310: In response to the business processing request, the contract parsing engine of the smart contract interaction platform is called to parse the target smart contract stored in the target blockchain to obtain contract parsing information.

[0096] Among them, the contract parsing engine is a contract parsing service configured in the smart contract interaction platform. It can be a program process written in a Turing-complete programming language and provide an engine interface for external calls.

[0097] In the above embodiment, by calling the contract parsing engine, complex contract parsing logic and algorithms can be implemented, and the processing efficiency of concurrent and diverse business processing requests can be improved.

[0098] In a specific embodiment, step S310 may be implemented as follows:

[0099] S311: In response to the business processing request, obtain the bytecode file of the target smart contract from the target blockchain.

[0100] It is feasible that the back-end server of the smart contract interaction platform has the communication function with each node in the target blockchain. The back-end server of the smart contract interaction platform responds to the business processing request, determines the contract address of the target smart contract from the business processing request, and communicates with the target node pointed to by the above contract address to obtain the bytecode file of the target smart contract stored in the target node.

[0101] The bytecode file is a binary file consisting of a sequence of op codes (opcodes) or data pairs. The bytecode file of the target smart contract can be obtained by compiling the source program of the target smart contract.

[0102] S312: Parse the bytecode file to determine the contract parsing information of the target smart contract.

[0103] If feasible, the bytecode file is decoded and the attribute information of each contract business supported by the target smart contract is identified in the bytecode file. The attribute information may include the business name or type of the contract business, the business parameter name or type of the contract business, etc. The attribute information of each contract business supported by the target smart contract is aggregated into the contract parsing information of the target smart contract.

[0104] In the above embodiment, by parsing the bytecode file of the target smart contract, the attribute information of at least one contract business supported by the target smart contract can be directly and completely determined, thereby improving the comprehensiveness and accuracy of the contract parsing information.

[0105] In a specific embodiment, step S312 may be implemented as follows:

[0106] S3121: Parse the bytecode file to obtain the first business interface attribute information of the target smart contract, where the first business interface attribute information includes interface function variables and function parameter variables of at least one contract business.

[0107] It can be understood that the bytecode file is a binary file obtained by compiling the source program of the target smart contract, and the first thing obtained after decoding is the source program of the target smart contract. Generally, the source program of the target smart contract indicates the business name or business type of the corresponding contract business through the interface function variable, and indicates the business parameter name or business parameter type of the corresponding contract business through the function parameter variable.

[0108] S3122: When the source code file of the target smart contract is obtained from the chain browser of the target blockchain, the source code file is parsed to obtain the second business interface attribute information of the target smart contract, where the second business interface attribute information includes a business interface name and a business parameter name of at least one historical business interface; the at least one historical business interface is part or all of at least one business interface.

[0109] It can be understood that the chain browser of the blockchain records and counts information such as each block, each transaction, and node address in the blockchain network. That is, by obtaining the source code file of the target smart contract from the chain browser of the target blockchain, at least one historical contract business executed based on the target smart contract can be determined, and the second business interface attribute information can be determined through the business interface of the target smart contract called by at least one historical contract business and the historical business parameters in at least one historical contract business.

[0110] S3123: Update the first business interface attribute information according to the second business interface attribute information to obtain contract resolution information.

[0111] It is feasible to update the interface function variables and function parameter variables of at least one contract business in the first business interface attribute information according to the business interface name and business parameter name of at least one historical business interface in the second business interface attribute information to obtain the contract parsing information. This can give the contract parsing information more business features, making it easier for business accounts to better understand at least one contract business supported by the target smart contract, as well as the business parameters that need to be input when each contract business in at least one contract business is executed.

[0112] In the above embodiment, by combining the bytecode file of the target smart contract and the source code file of the target smart contract stored in the chain browser, the target smart contract is parsed from the source program of the target smart contract itself and the historical contract business that has historically called the target smart contract, so as to obtain complete and accurate contract parsing information, while improving the readability of the contract parsing information and the guidance effect on the business account.

[0113] In a specific embodiment, step S210 may also be implemented as follows:

[0114] S411: In response to a business processing request, traverse a locally stored historical smart contract parsing information set, where the historical smart contract parsing information set includes historical parsing information of at least one historical smart contract.

[0115] S412: When traversing to a target smart contract from at least one historical smart contract, obtain historical parsing information of the target smart contract, and use the historical parsing information of the target smart contract as contract parsing information.

[0116] Among them, the historical smart contract is the smart contract parsed by the smart contract interaction platform in response to the historical business processing request before the current moment. In the above embodiment, the smart contract interaction platform stores the historical parsing information of the parsed historical smart contracts locally, which can avoid repeated parsing of the same smart contract in the subsequent interaction process and improve the processing efficiency of smart contract interaction.

[0117] In the embodiment of the present application, the smart contract interaction platform renders the page according to the contract parsing information, generates and displays the contract interaction page on the front end, and the contract interaction page is the interaction page corresponding to the target smart contract. Figure 3 is a schematic diagram of a contract interaction page provided in an embodiment of the present application, such as Figure 3 As shown in the figure, the target smart contract with the contract address "XXX" can support three types of contract services. The corresponding business interfaces (business interfaces are used to be called to enable the target smart contract to execute the corresponding contract services) are AAA, BBB and CCC respectively. The interface parameters corresponding to the three types of contract services can be as follows Figure 3 as shown in .

[0118] In a specific embodiment, the above method may further include:

[0119] S511: In response to the business processing request, obtain at least one target historical contract business corresponding to the target smart contract from the target blockchain.

[0120] At least one target historical contract business is a contract business that has been executed based on the target smart contract within a target time period before the current moment.

[0121] S512: Based on at least one target historical contract business, determine the current business execution status information corresponding to the target smart contract.

[0122] It is feasible to conduct statistical analysis on the at least one target historical contract business to determine indicator data such as time cost, economic cost, storage cost, etc. consumed by the target smart contract in executing the at least one target historical contract business. The above indicator data can indicate the current business execution status corresponding to the target smart contract.

[0123] It is feasible that the at least one target historical contract business mentioned above can be a historical contract business that has been recently executed by the target smart contract.

[0124] S513: Display the current business execution status information on the contract interaction page.

[0125] In the above embodiment, by displaying the current business execution status information of the target smart contract on the contract interaction page, the business account can increase its understanding of the current business execution status of the target smart contract, optimize the interaction experience between the business account and the target smart contract, and also facilitate the business account to reasonably arrange the execution progress of subsequent contract business and improve the processing efficiency of contract business.

[0126] S220: In response to the execution instruction triggered by the business account based on the contract interaction page, construct a real contract business.

[0127] In the embodiment of the present application, the business account can perform the input operation of business processing data based on the contract interaction page and trigger the execution instruction. Figure 3 As shown, a contract business interface can be selected based on the contract interaction page and interface parameters corresponding to the selected contract business interface can be input. The execution instructions for constructing a real contract business can be triggered by touch operations such as clicking or long pressing the "Execute" interactive control.

[0128] In a specific embodiment, step S220 may be implemented as follows:

[0129] S221: In response to an execution instruction triggered by the business account based on the contract interaction page, obtain business processing data input by the business account based on the contract interaction page.

[0130] The service processing data includes a target service interface name and a target service parameter value corresponding to the target service interface name.

[0131] S222: Construct real contract business based on business processing data.

[0132] It is feasible that the real contract business can be a program or instruction written in a programming language that can be parsed by the target smart contract and transmitted using the communication protocol of the target blockchain.

[0133] In the above embodiment, the contract interaction page can receive business processing data input by the business account and trigger the construction of real contract business on the basis of displaying the contract parsing information, eliminating the step of the business account constructing the contract business by itself in the smart contract application terminal, optimizing the interaction experience between the business account and the smart contract, and also improving the processing efficiency of the contract business.

[0134] S230: Call an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business.

[0135] In an embodiment of the present application, an external key hosting service can be provided by a key hosting service platform. After the user becomes a business account of the smart contract interaction platform, the smart contract interaction platform can guide the business account to the key hosting service platform to perform key initialization operations, including the creation of a key. The public key and address in the created key are visible to the business account. The private key in the key is stored in the IAM (Identity and Access Management) component of the business account, and the private key can be encrypted using the root key of the server hardware encryption machine. The key hosting service platform can also provide functions such as key use, key management, key backup and key recovery. Among them, the key hosting service platform can use multi-cloud hosting technology to back up the key. The business account can select a main cloud server and multiple backup cloud servers to store the key from multiple cloud servers. The main cloud server stores the complete key, and each of the multiple backup cloud servers stores a shard of the key.

[0136] In an embodiment of the present application, an external key hosting service is called, and an external professional key signing function is used to perform key signing processing on the real contract business, which can ensure the tamper-proof nature of the real contract business and improve the security of contract business processing.

[0137] In a specific embodiment, step S230 may be implemented as follows:

[0138] S231: Call the key escrow service to determine the escrow key corresponding to the business account.

[0139] The managed key is a complete key stored in the primary cloud server or multiple shard keys stored in multiple backup cloud servers.

[0140] S232: Use the escrow key to sign the real contract business to obtain the target contract business.

[0141] It is feasible that the key escrow service requests the key corresponding to the business account from the main cloud server according to the main cloud account corresponding to the business account and signs the real contract business; when the key stored in the main cloud server is not available, multiple backup cloud accounts corresponding to the business account are obtained through the database index of the key escrow service platform, and multiple shard keys are obtained from multiple backup cloud servers corresponding to the multiple backup cloud accounts, and the multiple shard keys are integrated to obtain the complete key. In this way, the real contract business is signed using the complete key to obtain the target contract business. The target contract business contains the information of the digital signature.

[0142] In the above embodiment, the smart contract interaction platform calls an external key escrow service to perform key signing processing on the real contract business to obtain the target contract business, so that the business account no longer needs to remember cumbersome keys after the keys are escrowed, and there is no need to sign the real contract business on the smart contract application terminal of the business account, which simplifies the processing flow on the business account side and effectively improves the processing efficiency of the contract business.

[0143] S240: Submit the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

[0144] In an embodiment of the present application, in response to an execution instruction, the smart contract interaction platform directly submits the target contract business obtained after signing to the target blockchain, so that the target node in the target blockchain executes the target contract business based on the target smart contract, which can effectively improve the processing efficiency of the target contract business.

[0145] In a specific embodiment, step S240 may be implemented as follows:

[0146] S241: Determine the current network busy / idle status or current business execution cost of the target blockchain.

[0147] Among them, the current network busy and idle status can be indicated by indicator data such as the number of contract businesses to be processed by the target node in the target blockchain and the number of contract businesses currently being processed. The current business execution cost can be expressed as Gas fees (the fees that need to be paid when conducting transactions or executing smart contracts on the blockchain, indicating the computing resources and network bandwidth required to complete specific operations). In the case of network congestion and busyness, general Gas fees will also rise accordingly.

[0148] S242: When the current network busy / idle status meets the preset network conditions or the current business execution cost is not higher than the preset threshold, the target contract business is submitted to the target blockchain so that the consensus network of the target blockchain executes the target contract business based on the target smart contract.

[0149] The preset network conditions may include a first preset number threshold of contract businesses to be processed by the target node in the target blockchain, a second preset number threshold of contract businesses currently being processed, etc. In the case where the actual number of contract businesses to be processed by the target node in the target blockchain is not higher than the first preset number threshold or the actual number of contract businesses currently being processed is not higher than the second preset number threshold, or the current business execution cost is not higher than the preset threshold, submitting the target contract business to the target blockchain can effectively ensure the processing efficiency of the target contract business, or can effectively control the processing cost of the target contract business.

[0150] In the above embodiment, the timing of submitting the target contract business to the target blockchain is determined according to the current network busy or idle status of the target blockchain or the current business execution cost, which can effectively ensure the processing efficiency of the target contract business, or effectively control the processing cost of the target contract business.

[0151] In a specific embodiment, the above method may further include:

[0152] S243: Obtain the execution result corresponding to the target contract business returned by the target blockchain.

[0153] The target node in the target blockchain may also include a contract status database or communicate with a contract status database, where the contract status database is used to record contract status data about the target smart contract, where the contract status data is the execution result obtained after the target smart contract executes the contract business.

[0154] S244: Display the execution result on the contract interaction page.

[0155] In the above embodiment, the smart contract interaction platform can request the target blockchain to obtain the execution result corresponding to the target contract business, and display the execution result on the contract interaction page, so that the business account can better understand the execution status of the target contract business. Figure 5 It is a schematic diagram of another contract interaction page provided in an embodiment of the present application, and the execution results of the target contract business corresponding to the contract business interface can be displayed in a preset area in the contract interaction page.

[0156] In a specific embodiment, before step S220, Figure 4 As shown, the above method may also include:

[0157] S250: In response to the pre-execution instruction triggered by the business account based on the contract interaction page, a simulated contract business is constructed, and pre-execution processing is performed on the simulated contract business to obtain a pre-execution result.

[0158] Accordingly, step S220 may be implemented as follows:

[0159] S260: In response to the execution instruction triggered by the business account based on the contract interaction page when the pre-execution result is consistent with the expected execution result, construct a real contract business.

[0160] The expected execution result is the ideal execution result of the contract business corresponding to the currently input business processing data by the business account.

[0161] In addition, when the pre-execution result is inconsistent with the expected execution result, the business account can adjust the input business processing data based on the contract interaction page.

[0162] Step S260 may refer to the aforementioned embodiment and will not be described in detail here.

[0163] In the above embodiment, the smart contract interaction platform also provides a pre-execution function for simulated contract business, which can construct a simulated contract business according to the business processing data input by the business account based on the contract interaction page, and perform pre-execution processing on the simulated contract business. The pre-execution results prompt the execution status of the contract business under the current input business processing data, which can avoid misoperation of the business account and reduce economic losses.

[0164] In a specific embodiment, step S250 may be implemented as follows:

[0165] S251: In response to the pre-execution instruction, the contract pre-execution engine of the smart contract interaction platform is called to construct a simulated contract business, and pre-execute the simulated contract business to obtain a pre-execution result.

[0166] Among them, the contract pre-execution engine is a contract business pre-execution service configured in the smart contract interaction platform. It can be a program process written in a Turing-complete programming language and provide an engine interface for external calls.

[0167] In the above embodiment, by calling the contract parsing engine, complex contract business pre-execution logic and algorithms can be implemented, and the pre-execution processing efficiency of concurrent and diverse simulated contract businesses can be improved.

[0168] In a specific embodiment, step S251 may be implemented as follows:

[0169] S2511: In response to the pre-execution instruction, obtain the business processing data input by the business account based on the contract interaction page.

[0170] The service processing data includes a target service interface name and a target service parameter value corresponding to the target service interface name.

[0171] S2512: Construct a simulated contract business based on the business processing data.

[0172] S2513: Call the chain data service of the target blockchain to generate a smart contract virtual machine to execute simulated contract business based on the target smart contract in the smart contract virtual machine to obtain a pre-execution result.

[0173] It is feasible that the contract pre-execution engine can link the chain data service of the target blockchain to generate a smart contract virtual machine, so that the simulated contract business can be executed based on the target smart contract in the smart contract virtual machine and the pre-execution result can be obtained.

[0174] It is feasible that the key signing step can be skipped during pre-execution processing, thereby saving costs for the business account.

[0175] Possible, such as Figure 5 As shown, the pre-execution results corresponding to the simulated contract business can be displayed in the preset area of ​​the contract interaction page.

[0176] In the above embodiment, by executing a simulated contract business based on the target smart contract in the smart contract virtual machine and obtaining a pre-execution result, the load pressure of the smart contract interaction platform can be reduced, and key signing can be skipped, which can save costs for the business account.

[0177] Figure 6 It is an architectural diagram of an intelligent interactive contract platform provided in an embodiment of the present application, wherein the intelligent contract interactive platform can provide functions or services including a contract parsing engine, a contract pre-execution engine, and an on-chain service. The specific functions or services can refer to the aforementioned embodiments and will not be described in detail here.

[0178] In addition, the smart interactive contract platform can also be linked with the key custody service platform, which can provide functions such as key usage, key use, key backup, and key recovery.

[0179] Key usage involves using keys already hosted in the system, completing digital signatures, and subsequently using the signatures in external services.

[0180] Key usage includes creating keys, deleting keys, and transferring keys. The user of the created key can only see the public key and address corresponding to the key, and cannot obtain the private key. The private key exists in each user's IAM. After deleting a key, the user cannot use the key again. This operation is risky and can be confirmed by the user twice. Transferring a key means transferring the control of the key to another user. After the transfer, the user can no longer see the key on his platform interface.

[0181] Key backup includes that users can set their own backup cloud account and main cloud account in this module. After the setting is completed, the key backup function module will divide the user's key into multiple encrypted fragments through the key management module, and then send the multiple encrypted fragments to the backup cloud server corresponding to the backup cloud account to complete the key backup.

[0182] Key recovery: In the event of an abnormality in the primary cloud server or loss of the stored key, users can obtain multiple key shards through the key backup service and decrypt them to obtain the original key.

[0183] The key hosting service platform mainly relies on two main components on the cloud service, including:

[0184] IAM: Identity and Access Management, which has functions such as single sign-on, strong authentication management, policy-based centralized authorization and auditing, dynamic authorization, and enterprise manageability. Cloud services can set up an IAM domain for each personal cloud account. In the user's IAM domain, only the user himself can access the files. The user's managed key is stored in the storage under the IAM domain.

[0185] Key management system and HSM: Corresponding to Hardware Security Module, it is a hardware-based key management service configured on the cloud service, that is, the key management system uses HSM as the root key, and all secondary keys are based on hardware security encryption. The key management system itself is responsible for communicating with HSM and accessing all IAMs, creating and hosting keys for each user, and when the user needs to use it, it accesses HSM again to decrypt the managed key in the user's IAM in the security domain and complete the signature, and then returns it to the user.

[0186] It can be seen from the above embodiments that the solution provided by the present application is to respond to the business processing request submitted by the business account through the smart contract interaction platform constructed in the blockchain application system, parse the target smart contract, and obtain the contract parsing information. The smart contract interaction platform can generate and display the contract interaction page corresponding to the target smart contract according to the contract parsing information, improve the business account's understanding of the target smart contract, and can help the business account enter relevant business processing data; the smart contract interaction platform responds to the execution instruction triggered by the business account based on the contract interaction page, constructs a real contract business, avoids constructing a real contract business at the terminal of the business account, and simplifies the processing flow on the business account side; the smart contract interaction platform performs key signature processing on the real contract business by calling an external key escrow service to obtain the target contract business, so that the business account does not need to remember the cumbersome key under the premise of escrow, and does not need to sign the real contract business at the terminal of the business account, which simplifies the processing flow on the business account side; the smart contract interaction platform submits the target contract business obtained after signing to the target blockchain, so that the target blockchain executes the target contract business based on the target smart contract, which can effectively improve the processing efficiency of the target contract business. The solution provided in this application can effectively optimize the interaction process between business accounts and smart contracts on the blockchain and improve the processing efficiency of contract business through the smart contract interaction platform built in the blockchain application system.

[0187] The present application also provides a processing device 700 for smart contract services, such as Figure 7 As shown, the device 700 may include:

[0188] The contract parsing module 710 is used to parse the target smart contract in response to the business processing request submitted by the business account to obtain contract parsing information;

[0189] The contract business construction module 720 is used to construct a real contract business in response to an execution instruction triggered by the business account based on a contract interaction page; the contract interaction page is an interaction page generated and displayed according to the contract parsing information and corresponding to the target smart contract;

[0190] The signature module 730 is used to call an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business;

[0191] The submission module 740 is used to submit the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

[0192] In one embodiment of the present application, the contract parsing module 710 may include:

[0193] The contract parsing engine module is used to call the contract parsing engine of the smart contract interaction platform in response to the business processing request to parse the target smart contract stored in the target blockchain to obtain the contract parsing information.

[0194] In one embodiment of the present application, the contract parsing engine module may include:

[0195] A bytecode file acquisition unit, configured to acquire the bytecode file of the target smart contract from the target blockchain in response to the business processing request;

[0196] The bytecode file parsing unit is used to parse the bytecode file and determine the contract parsing information of the target smart contract.

[0197] In one embodiment of the present application, the bytecode file parsing unit may include:

[0198] A first business interface attribute information determining unit, configured to parse the bytecode file to obtain first business interface attribute information of the target smart contract, wherein the first business interface attribute information includes interface function variables and function parameter variables of at least one contract business;

[0199] A second business interface attribute information unit is used to parse the source code file of the target smart contract when the source code file is obtained from the chain browser of the target blockchain, so as to obtain the second business interface attribute information of the target smart contract, wherein the second business interface attribute information includes a business interface name and a business parameter name of at least one historical business interface; the at least one historical business interface is part or all of at least one business interface;

[0200] An updating unit is used to update the first service interface attribute information according to the second service interface attribute information to obtain the contract resolution information.

[0201] In one embodiment of the present application, the contract business construction module 720 may include:

[0202] a first business processing data acquisition unit, configured to acquire, in response to the execution instruction triggered by the business account based on the contract interaction page, the business processing data input by the business account based on the contract interaction page; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name;

[0203] The first construction unit of the real contract business is used to construct the real contract business according to the business processing data.

[0204] In one embodiment of the present application, the signature module 730 may include:

[0205] an escrow key determination unit, configured to call the key escrow service to determine the escrow key corresponding to the business account;

[0206] A signing unit, used to use the escrow key to sign the real contract business to obtain the target contract business;

[0207] The escrow key is a complete key stored in a primary cloud server or multiple shard keys stored in multiple backup cloud servers.

[0208] In one embodiment of the present application, the device 700 may further include:

[0209] A pre-execution module, configured to construct a simulated contract business in response to a pre-execution instruction triggered by the business account based on the contract interaction page, and perform pre-execution processing on the simulated contract business to obtain a pre-execution result;

[0210] The contract business construction module 720 includes:

[0211] The second construction unit of the real contract business is used to construct the real contract business in response to the execution instruction triggered by the business account based on the contract interaction page when the pre-execution result is consistent with the expected execution result.

[0212] In one embodiment of the present application, the pre-execution module may include:

[0213] The contract pre-execution engine module is used to respond to the pre-execution instruction, call the contract pre-execution engine of the smart contract interaction platform to construct the simulated contract business, and perform pre-execution processing on the simulated contract business to obtain the pre-execution result.

[0214] In one embodiment of the present application, the contract pre-execution engine module may include:

[0215] A second business processing data acquisition unit is used to acquire, in response to the pre-execution instruction, business processing data input by the business account based on the contract interaction page; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name;

[0216] A simulated contract business construction unit, used to construct the simulated contract business according to the business processing data;

[0217] The pre-execution unit is used to call the chain data service of the target blockchain to generate a smart contract virtual machine to execute the simulated contract business based on the target smart contract in the smart contract virtual machine to obtain the pre-execution result.

[0218] In one embodiment of the present application, the submitting module 740 may include:

[0219] A current network busy / idle state or current service execution cost determination unit, used to determine the current network busy / idle state or current service execution cost of the target blockchain;

[0220] A submission unit is used to submit the target contract business to the target blockchain when the current network busy / idle status meets the preset network condition or the current business execution cost is not higher than a preset threshold, so that the target blockchain executes the target contract business based on the target smart contract.

[0221] In one embodiment of the present application, the device 700 may further include:

[0222] An execution result acquisition unit, used to acquire the execution result corresponding to the target contract business returned by the target blockchain;

[0223] An execution result display unit is used to display the execution result on the contract interaction page.

[0224] In one embodiment of the present application, the contract parsing module 710 may include:

[0225] A historical smart contract parsing information set traversal unit, configured to traverse a locally stored historical smart contract parsing information set in response to the business processing request, wherein the historical smart contract parsing information set includes historical parsing information of at least one historical smart contract;

[0226] A historical parsing information acquisition unit is used to acquire the historical parsing information of the target smart contract when traversing from the at least one historical smart contract to the target smart contract, and use the historical parsing information of the target smart contract as the contract parsing information.

[0227] In one embodiment of the present application, the device 700 may further include:

[0228] A historical contract business acquisition unit, configured to obtain, in response to the business processing request, at least one target historical contract business corresponding to the target smart contract from the target blockchain, wherein the at least one target historical contract business is a contract business executed based on the target smart contract within a target time period before a current moment;

[0229] A historical contract business analysis unit, configured to determine current business execution status information corresponding to the target smart contract based on the at least one target historical contract business;

[0230] The current business execution status information display unit is used to display the current business execution status information on the contract interaction page.

[0231] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0232] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0233] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a method for processing a smart contract business as provided in the above method embodiment.

[0234] Figure 8 A schematic diagram of the hardware structure of a device for implementing a method for processing a smart contract business provided in an embodiment of the present application is shown. The device may participate in or include the apparatus or system provided in an embodiment of the present application. Figure 8 As shown, the device 10 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 8 The structure shown is for illustration only and does not limit the structure of the electronic device. Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown.

[0235] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0236] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods in the embodiments of the present application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, to implement the above-mentioned processing method of a smart contract business. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0237] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0238] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).

[0239] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to a method for processing a smart contract business in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement a method for processing a smart contract business provided in the above method embodiment.

[0240] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0241] The embodiment of the present invention further provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes a method for processing a smart contract business provided in the above various optional implementations.

[0242] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0243] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0244] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0245] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for processing smart contract business, characterized in that: Applied to the smart contract interaction platform, the method includes: In response to a business processing request submitted by a business account, obtain a bytecode file of a target smart contract from a target blockchain; Parsing the bytecode file to obtain first business interface attribute information of the target smart contract, where the first business interface attribute information includes interface function variables and function parameter variables of at least one contract business; When the source code file of the target smart contract is obtained from the chain browser of the target blockchain, the source code file is parsed to obtain the second business interface attribute information of the target smart contract, where the second business interface attribute information includes a business interface name and a business parameter name of at least one historical business interface; the at least one historical business interface is part or all of at least one business interface; The first service interface attribute information is updated according to the second service interface attribute information to obtain contract parsing information; the contract parsing information includes a service interface name and a service parameter name of the at least one contract service; In response to an execution instruction triggered by the business account based on a contract interaction page, obtaining business processing data input by the business account based on the contract interaction page; the contract interaction page is an interaction page generated and displayed according to the contract parsing information and corresponding to the target smart contract; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name; Constructing real contractual business according to the business processing data; Calling an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business; Submit the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

2. The method according to claim 1, characterized in that The method further comprises: In response to the business processing request, the contract parsing engine of the smart contract interaction platform is called to parse the target smart contract stored in the target blockchain to obtain the contract parsing information.

3. The method according to claim 1, characterized in that: The calling of the external key escrow service, performing key signature processing on the real contract business, and obtaining the target contract business includes: Calling the key escrow service to determine the escrow key corresponding to the business account; The real contract business is signed using the escrow key to obtain the target contract business; The escrow key is a complete key stored in a primary cloud server or multiple shard keys stored in multiple backup cloud servers.

4. The method according to claim 1, characterized in that: The method further comprises: In response to a pre-execution instruction triggered by the business account based on the contract interaction page, construct a simulated contract business, and perform pre-execution processing on the simulated contract business to obtain a pre-execution result; The constructing of a real contract business in response to an execution instruction triggered by the business account based on the contract interaction page includes: In response to the execution instruction triggered by the business account based on the contract interaction page when the pre-execution result is consistent with the expected execution result, the real contract business is constructed.

5. The method according to claim 4, characterized in that The step of constructing a simulated contract business in response to the pre-execution instruction triggered by the business account based on the contract interaction page, and performing pre-execution processing on the simulated contract business to obtain a pre-execution result includes: In response to the pre-execution instruction, the contract pre-execution engine of the smart contract interaction platform is called to construct the simulated contract business, and pre-execution processing is performed on the simulated contract business to obtain the pre-execution result.

6. The method according to claim 5, characterized in that In response to the pre-execution instruction, calling the contract pre-execution engine of the smart contract interaction platform to construct the simulated contract business, and performing pre-execution processing on the simulated contract business to obtain the pre-execution result, including: In response to the pre-execution instruction, obtaining business processing data input by the business account based on the contract interaction page; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name; Constructing the simulated contract business according to the business processing data; The chain data service of the target blockchain is called to generate a smart contract virtual machine to execute the simulated contract business based on the target smart contract in the smart contract virtual machine to obtain the pre-execution result.

7. The method according to claim 1, characterized in that Submitting the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract includes: Determine the current network busy / idle status or current service execution cost of the target blockchain; When the current network busy / idle status meets the preset network condition or the current business execution cost is not higher than the preset threshold, the target contract business is submitted to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

8. The method according to claim 1, characterized in that In response to the business processing request submitted by the business account, the target smart contract is parsed to obtain contract parsing information, including: In response to the business processing request, traverse a locally stored historical smart contract parsing information set, wherein the historical smart contract parsing information set includes historical parsing information of at least one historical smart contract; When traversing to the target smart contract from the at least one historical smart contract, historical parsing information of the target smart contract is obtained, and the historical parsing information of the target smart contract is used as the contract parsing information.

9. The method according to claim 1, characterized in that: The method further comprises: In response to the business processing request, obtaining at least one target historical contract business corresponding to the target smart contract from the target blockchain, wherein the at least one target historical contract business is a contract business executed based on the target smart contract within a target time period before the current moment; Based on the at least one target historical contract business, determine the current business execution status information corresponding to the target smart contract; The current business execution status information is displayed on the contract interaction page.

10. A processing device for smart contract business, characterized in that: Applied to the smart contract interaction platform, the device includes: Contract parsing module, including: A bytecode file acquisition unit, configured to acquire a bytecode file of a target smart contract from a target blockchain in response to a business processing request submitted by a business account; A first business interface attribute information determining unit, configured to parse the bytecode file to obtain first business interface attribute information of the target smart contract, wherein the first business interface attribute information includes interface function variables and function parameter variables of at least one contract business; A second business interface attribute information unit is used to parse the source code file of the target smart contract when the source code file is obtained from the chain browser of the target blockchain, so as to obtain the second business interface attribute information of the target smart contract, wherein the second business interface attribute information includes a business interface name and a business parameter name of at least one historical business interface; the at least one historical business interface is part or all of at least one business interface; An updating unit, configured to update the first service interface attribute information according to the second service interface attribute information to obtain contract parsing information; the contract parsing information includes a service interface name and a service parameter name of the at least one contract service; The contract business construction module includes a first business processing data acquisition unit and a first real contract business construction unit. The first business processing data acquisition unit is used to respond to the execution instruction triggered by the business account based on the contract interaction page, and acquire the business processing data input by the business account based on the contract interaction page; the contract interaction page is an interaction page generated and displayed according to the contract parsing information and corresponding to the target smart contract; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name; The real contract business first construction unit is used to construct the real contract business according to the business processing data; The signature module is used to call an external key escrow service to perform key signature processing on the real contract business to obtain the target contract business; A submission module is used to submit the target contract business to the target blockchain so that the target blockchain executes the target contract business based on the target smart contract.

11. The device according to claim 10, characterized in that The device also includes: The contract parsing engine module is used to call the contract parsing engine of the smart contract interaction platform in response to the business processing request to parse the target smart contract stored in the target blockchain to obtain the contract parsing information.

12. The device according to claim 10, characterized in that The signature module includes: an escrow key determination unit, configured to call the key escrow service to determine the escrow key corresponding to the business account; A signing unit, used to use the escrow key to sign the real contract business to obtain the target contract business; The escrow key is a complete key stored in a primary cloud server or multiple shard keys stored in multiple backup cloud servers.

13. The device according to claim 10, characterized in that The device also includes: A pre-execution module, configured to construct a simulated contract business in response to a pre-execution instruction triggered by the business account based on the contract interaction page, and perform pre-execution processing on the simulated contract business to obtain a pre-execution result; The contract business construction module includes: The second construction unit of the real contract business is used to construct the real contract business in response to the execution instruction triggered by the business account based on the contract interaction page when the pre-execution result is consistent with the expected execution result.

14. The device according to claim 13, characterized in that The pre-execution module comprises: The contract pre-execution engine module is used to respond to the pre-execution instruction, call the contract pre-execution engine of the smart contract interaction platform to construct the simulated contract business, and perform pre-execution processing on the simulated contract business to obtain the pre-execution result.

15. The device according to claim 14, characterized in that The contract pre-execution engine module includes: A second business processing data acquisition unit, configured to acquire, in response to the pre-execution instruction, business processing data input by the business account based on the contract interaction page; the business processing data includes a target business interface name and a target business parameter value corresponding to the target business interface name; A simulated contract business construction unit, used to construct the simulated contract business according to the business processing data; The pre-execution unit is used to call the chain data service of the target blockchain to generate a smart contract virtual machine to execute the simulated contract business based on the target smart contract in the smart contract virtual machine to obtain the pre-execution result.

16. The device according to claim 10, characterized in that The submission module includes: A current network busy / idle state or current service execution cost determination unit, used to determine the current network busy / idle state or current service execution cost of the target blockchain; A submission unit is used to submit the target contract business to the target blockchain when the current network busy / idle status meets the preset network condition or the current business execution cost is not higher than a preset threshold, so that the target blockchain executes the target contract business based on the target smart contract.

17. The device according to claim 10, characterized in that The contract parsing module includes: A historical smart contract parsing information set traversal unit, configured to traverse a locally stored historical smart contract parsing information set in response to the business processing request, wherein the historical smart contract parsing information set includes historical parsing information of at least one historical smart contract; A historical parsing information acquisition unit is used to acquire the historical parsing information of the target smart contract when traversing from the at least one historical smart contract to the target smart contract, and use the historical parsing information of the target smart contract as the contract parsing information.

18. The device according to claim 10, characterized in that The device also includes: A historical contract business acquisition unit, configured to obtain, in response to the business processing request, at least one target historical contract business corresponding to the target smart contract from the target blockchain, wherein the at least one target historical contract business is a contract business executed based on the target smart contract within a target time period before a current moment; A historical contract business analysis unit, configured to determine current business execution status information corresponding to the target smart contract based on the at least one target historical contract business; The current business execution status information display unit is used to display the current business execution status information on the contract interaction page.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the processing method of the smart contract business as described in any one of claims 1 to 9.

20. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the processing method of the smart contract business as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data processing method and device, medium and terminal

    CN109753530A

  • Smart contract processing method and device, processor and electronic equipment

    CN114581241A

  • Block chain decentralized finance security detection method and device

    CN117521065A

  • Intelligent contract analysis method and device and computer equipment

    CN117850792A

  • Block chain data processing method and device, computer equipment, medium and product

    CN118353628A