CN116188016A - Transaction execution method and device in blockchain system - Google Patents
Transaction execution method and device in blockchain system Download PDFInfo
- Publication number
- CN116188016A CN116188016A CN202211740900.0A CN202211740900A CN116188016A CN 116188016 A CN116188016 A CN 116188016A CN 202211740900 A CN202211740900 A CN 202211740900A CN 116188016 A CN116188016 A CN 116188016A
- Authority
- CN
- China
- Prior art keywords
- instruction
- transaction
- contract
- basic block
- code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/405—Establishing or using transaction specific rules
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/14—Payment architectures specially adapted for billing systems
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Finance (AREA)
- Development Economics (AREA)
- Economics (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本说明书实施例提供了区块链系统中的交易执行方法及装置。区块链系统中部署有智能合约,该方法应用于区块链系统中的节点,包括:接收第一交易,第一交易调用该智能合约,并且包括第一交易对应的资源总额;在执行第一交易的过程中,基于该智能合约的第一合约代码中当前要执行的第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新第一交易对应的资源余额;确定更新后的资源余额是否小于零;若确定结果为否,则按先后顺序依次执行该各条第一指令。
The embodiment of this specification provides a transaction execution method and device in a blockchain system. Smart contracts are deployed in the blockchain system, and this method is applied to nodes in the blockchain system, including: receiving the first transaction, which invokes the smart contract, and includes the total amount of resources corresponding to the first transaction; During a transaction, update the resource balance corresponding to the first transaction based on the sum of the resource consumption corresponding to each first instruction in the first basic block currently to be executed in the first contract code of the smart contract; determine Whether the updated resource balance is less than zero; if the determined result is no, execute the first instructions sequentially.
Description
技术领域technical field
本说明书实施例属于区块链技术领域,尤其涉及区块链系统中的交易执行方法及装置。The embodiments of this specification belong to the technical field of blockchain, and in particular relate to a transaction execution method and device in a blockchain system.
背景技术Background technique
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。由于区块链具有去中心化、信息不可篡改、自治性等特性,区块链也受到人们越来越多的重视和应用。Blockchain is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. In the blockchain system, the data blocks are combined into a chained data structure in a sequentially connected manner in chronological order, and a non-tamperable and unforgeable distributed ledger is cryptographically guaranteed. Due to the characteristics of decentralization, non-tamperable information, and autonomy, the blockchain has also received more and more attention and application.
发明内容Contents of the invention
本发明的目的在于提供区块链系统中的交易执行方案,可以有效降低资源计费给智能合约的执行带来的性能开销。The purpose of the present invention is to provide a transaction execution scheme in the blockchain system, which can effectively reduce the performance overhead brought by resource billing to the execution of smart contracts.
本说明书第一方面提供一种区块链系统中的交易执行方法,所述区块链系统中部署有智能合约,所述方法应用于所述区块链系统中的节点,包括:接收第一交易,所述第一交易调用所述智能合约,并且包括所述第一交易对应的资源总额;在执行所述第一交易的过程中,基于所述智能合约的第一合约代码中当前要执行的第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新所述第一交易对应的资源余额;确定更新后的所述资源余额是否小于零;若确定结果为否,则按先后顺序依次执行所述各条第一指令。The first aspect of this specification provides a transaction execution method in a blockchain system, in which smart contracts are deployed, and the method is applied to nodes in the blockchain system, including: receiving the first transaction, the first transaction calls the smart contract, and includes the total amount of resources corresponding to the first transaction; in the process of executing the first transaction, the first contract code based on the smart contract is currently executed update the resource balance corresponding to the first transaction; determine whether the updated resource balance is less than zero; if the determination result is no, Then execute the first instructions sequentially in sequence.
本说明书第二方面提供一种区块链系统中的交易执行装置,所述区块链系统中部署有智能合约,所述装置应用于所述区块链系统中的节点,包括:接收单元,被配置成接收第一交易,所述第一交易调用所述智能合约,并且包括所述第一交易对应的资源总额;更新单元,被配置成在执行所述第一交易的过程中,基于所述智能合约的第一合约代码中当前要执行的第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新所述第一交易对应的资源余额;确定单元,被配置成确定更新后的所述资源余额是否小于零;执行单元,被配置成若所述确定单元的确定结果为否,则按先后顺序依次执行所述各条第一指令。The second aspect of this specification provides a transaction execution device in a blockchain system, where a smart contract is deployed in the blockchain system, and the device is applied to a node in the blockchain system, including: a receiving unit, configured to receive a first transaction, the first transaction invokes the smart contract, and includes the total amount of resources corresponding to the first transaction; the updating unit is configured to, during the execution of the first transaction, based on the The sum of resource consumption corresponding to each first instruction in the first basic block currently to be executed in the first contract code of the smart contract, and updating the resource balance corresponding to the first transaction; the determining unit is configured as It is determined whether the updated resource balance is less than zero; the execution unit is configured to execute the first instructions sequentially if the determination result of the determination unit is no.
本说明书第三方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行如第一方面描述的方法。A third aspect of the present specification provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed in a computer, the computer is instructed to execute the method described in the first aspect.
本说明书第四方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现如第一方面描述的方法。A fourth aspect of the specification provides a computing device, including a memory and a processor, where executable codes are stored in the memory, and when the processor executes the executable codes, the method described in the first aspect is implemented.
本说明书第五方面提供一种计算机程序,其中,当该计算机程序在计算机中执行时,令该计算机执行如第一方面描述的方法。A fifth aspect of the specification provides a computer program, wherein, when the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.
在本说明书实施例提供的方案中,可以对智能合约的合约代码进行基本块划分,在智能合约执行过程中可以基于基本块进行资源计费,无需单独为每条指令进行资源计费。相比于基于指令进行资源计费,该方案显著降低了资源计费在智能合约执行过程中发生的频率,从而能有效降低资源计费给智能合约的执行带来的性能开销,有效减小对智能合约执行速度的影响。In the solution provided by the embodiment of this specification, the contract code of the smart contract can be divided into basic blocks, and resource billing can be performed based on the basic blocks during the execution of the smart contract, without separate resource billing for each instruction. Compared with resource billing based on instructions, this scheme significantly reduces the frequency of resource billing in the execution of smart contracts, thereby effectively reducing the performance overhead brought by resource billing to the execution of smart contracts, and effectively reducing the impact on smart contracts. The impact of smart contract execution speed.
附图说明Description of drawings
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments recorded in this specification. , for those skilled in the art, other drawings can also be obtained according to these drawings without paying creative labor.
图1是一实施例中的区块链架构图;Fig. 1 is a blockchain architecture diagram in an embodiment;
图2是本说明书实施例可以应用于其中的一个应用场景的示意图;Fig. 2 is a schematic diagram of an application scenario to which the embodiment of this specification can be applied;
图3是本说明书实施例中区块链系统中的交易执行方法的流程图;Fig. 3 is a flow chart of the transaction execution method in the block chain system in the embodiment of this specification;
图4是基本块划分过程的一个示意图;Fig. 4 is a schematic diagram of the basic block division process;
图5是基本块划分过程的一个示意图;Fig. 5 is a schematic diagram of the basic block division process;
图6是本说明书实施例中区块链系统中的交易执行方法的流程图;Fig. 6 is a flow chart of the transaction execution method in the blockchain system in the embodiment of this specification;
图7是第二指令插入过程的一个示意图;Fig. 7 is a schematic diagram of the second instruction insertion process;
图8是本说明书实施例中区块链系统中的交易执行装置的结构示意图。Fig. 8 is a schematic structural diagram of the transaction execution device in the blockchain system in the embodiment of this specification.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described The embodiments are only some of the embodiments in this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.
图1示出了一实施例中的区块链架构图。在图1所示的区块链架构图中,区块链100中包括N个节点,图1中示意示出节点1-节点8。节点之间的连线示意性的表示P2P(Peer toPeer,点对点)连接,所述连接例如可以为TCP连接等,用于在节点之间传输数据。这些节点上可存储全量的账本,即存储全部区块和全部账户的状态。其中,区块链中的每个节点可通过执行相同的交易而产生区块链中的相同的状态,区块链中的每个节点可存储相同的状态数据库。Fig. 1 shows a block chain architecture diagram in an embodiment. In the blockchain architecture diagram shown in FIG. 1 , the blockchain 100 includes N nodes, and FIG. 1 schematically shows nodes 1 - 8 . The connection between the nodes schematically represents a P2P (Peer to Peer, point-to-point) connection, and the connection may be, for example, a TCP connection, etc., and is used to transmit data between the nodes. These nodes can store a full amount of books, that is, store the status of all blocks and all accounts. Wherein, each node in the blockchain can generate the same state in the blockchain by executing the same transaction, and each node in the blockchain can store the same state database.
区块链领域中的交易可以指在区块链中执行并记录在区块链中的任务单元。交易中通常包括发送字段(From)、接收字段(To)和数据字段(Data)。其中,在交易为转账交易的情况中,From字段表示发起该交易(即发起对另一个账户的转账任务)的账户地址,To字段表示接收该交易(即接收转账)的账户地址,Data字段中包括转账金额。A transaction in the blockchain field may refer to a unit of tasks performed and recorded in the blockchain. A transaction usually includes a sending field (From), a receiving field (To) and a data field (Data). Among them, when the transaction is a transfer transaction, the From field indicates the account address that initiated the transaction (that is, initiates a transfer task to another account), the To field indicates the account address that received the transaction (that is, received the transfer), and the Data field Include the transfer amount.
区块链中可提供智能合约的功能。区块链上的智能合约是在区块链系统上可以被交易触发执行的合约。智能合约可以通过代码的形式定义。在区块链中调用智能合约,是发起一笔指向智能合约地址的交易,使得区块链中每个节点分布式地运行智能合约代码。The function of smart contracts can be provided in the blockchain. Smart contracts on the blockchain are contracts that can be triggered by transactions on the blockchain system. Smart contracts can be defined in the form of code. Invoking a smart contract in the blockchain is to initiate a transaction pointing to the address of the smart contract, so that each node in the blockchain runs the smart contract code in a distributed manner.
在部署合约的场景中,例如,Bob将一个包含创建智能合约信息(即部署合约)的交易发送到如图1所示的区块链中,该交易的data字段包括待创建的合约的代码(如字节码或者机器码),交易的to字段为空,以表示该交易用于部署合约。节点间通过共识机制达成一致后,确定合约的合约地址“0x6f8ae93…”,各个节点在状态数据库中添加与该智能合约的合约地址对应的合约账户,分配与该合约账户对应的状态存储,并存储合约代码,将合约代码的哈希值保存在该合约的状态存储中,从而合约创建成功。In the scenario of deploying a contract, for example, Bob sends a transaction containing information about creating a smart contract (that is, deploying a contract) to the blockchain shown in Figure 1, and the data field of the transaction includes the code of the contract to be created ( Such as bytecode or machine code), the to field of the transaction is empty to indicate that the transaction is used to deploy the contract. After the nodes reach an agreement through the consensus mechanism, the contract address "0x6f8ae93..." is determined, each node adds the contract account corresponding to the contract address of the smart contract in the state database, allocates the state storage corresponding to the contract account, and stores Contract code, save the hash value of the contract code in the state storage of the contract, so that the contract is created successfully.
在调用合约的场景中,例如,Bob将一个用于调用智能合约的交易发送到如图1所示的区块链中,该交易的from字段是交易发起方(即Bob)的账户的地址,to字段为上述“0x6f8ae93…”,即被调用的智能合约的地址,交易的data字段包括调用智能合约的方法和参数。在区块链中对该交易进行共识之后,区块链中的各个节点可分别执行该交易,从而分别执行该合约,基于该合约的执行更新状态数据库。In the scenario of calling the contract, for example, Bob sends a transaction for calling the smart contract to the blockchain shown in Figure 1, the from field of the transaction is the address of the account of the transaction initiator (ie Bob), The to field is the above "0x6f8ae93...", which is the address of the called smart contract, and the data field of the transaction includes the method and parameters of calling the smart contract. After consensus is reached on the transaction in the blockchain, each node in the blockchain can respectively execute the transaction, thereby respectively executing the contract, and updating the state database based on the execution of the contract.
区块链技术区别于传统技术的去中心化特点之一,就是在各个节点上进行记账,或者称为分布式记账,而不是传统的集中式记账。区块链系统要成为一个难以攻破的、公开的、不可篡改数据记录的去中心化诚实可信系统,需要在尽可能短的时间内做到分布式数据记录的安全、明确及不可逆。不同类型的区块链网络中,为了在各个记录账本的节点中保持账本的一致,通常采用共识算法来保证,即前述提到的共识机制。例如,区块链节点之间可以实现区块粒度的共识机制,比如在节点(例如某个独特的节点)产生一个区块后,如果产生的这个区块得到其它节点的认可,其它节点记录相同的区块。再例如,区块链节点之间可以实现交易粒度的共识机制,比如在节点(例如某个独特的节点)获取一笔区块链交易后,如果这笔区块链交易得到其他节点的认可,认可该区块链交易的各个节点可以分别将该区块链交易添加至自身维护的最新区块中,并且最终能够确保各个节点产生相同的最新区块。共识机制是区块链节点就区块信息(或称区块数据)达成全网一致共识的机制,可以保证最新区块被准确添加至区块链。当前主流的共识机制包括:工作量证明(Proof ofWork,POW)、股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)、实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)算法等。其中,在各种共识算法中,通常在预设数目的节点对待共识的数据(即共识提议)达成一致之后,从而确定对该共识提议的共识成功。具体是,在PBFT算法中,对于N≥3f+1个共识节点,可容忍f个恶意节点,也就是说,当N个共识节点中2f+1个节点达成一致时,可确定共识成功。One of the decentralized features of blockchain technology that distinguishes it from traditional technologies is that bookkeeping is performed on each node, or called distributed bookkeeping, rather than traditional centralized bookkeeping. In order for the blockchain system to become a decentralized, honest and credible system that is difficult to break, open, and cannot be tampered with data records, it is necessary to make distributed data records safe, clear, and irreversible in the shortest possible time. In different types of blockchain networks, in order to maintain the consistency of the ledger in each node that records the ledger, a consensus algorithm is usually used to ensure it, that is, the aforementioned consensus mechanism. For example, a block-granularity consensus mechanism can be implemented between blockchain nodes. For example, after a node (such as a unique node) generates a block, if the generated block is recognized by other nodes, other nodes record the same block. For another example, a consensus mechanism of transaction granularity can be implemented between blockchain nodes. For example, after a node (such as a unique node) obtains a blockchain transaction, if the blockchain transaction is recognized by other nodes, Each node that approves the blockchain transaction can add the blockchain transaction to the latest block maintained by itself, and finally can ensure that each node generates the same latest block. The consensus mechanism is a mechanism for blockchain nodes to reach a consensus on block information (or block data) in the entire network, which can ensure that the latest block is accurately added to the blockchain. The current mainstream consensus mechanisms include: Proof of Work (POW), Proof of Stake (POS), Delegated Proof of Stake (DPOS), Practical Byzantine Fault Tolerance (PBFT) algorithm etc. Among them, in various consensus algorithms, usually after a preset number of nodes reach an agreement on the data to be consensused (that is, the consensus proposal), it is determined that the consensus on the consensus proposal is successful. Specifically, in the PBFT algorithm, for N≥3f+1 consensus nodes, f malicious nodes can be tolerated, that is, when 2f+1 nodes among the N consensus nodes reach a consensus, the consensus can be determined to be successful.
智能合约通常是由用户提交到区块链系统上,并且在区块链系统的各个节点上执行的一段程序。根据停机问题的不可判定性,我们无法预知用户提交的智能合约是否会陷入死循环。如果智能合约陷入死循环,会导致链上所有节点的计算资源都被占满,进入服务不可用的状态。为了避免此种状况的发生,智能合约虚拟机会在执行过程中实时检测合约消耗的计算资源量,这一过程可称为gas计费。智能合约一般基于某种虚拟机指令集,比如EVM(Ethereum Virtual Machine,以太坊虚拟机)指令集或者WebAssembly(wasm)指令集。取决于指令执行逻辑的复杂度,不同的指令往往会有不同的gas费用。虚拟机需要根据合约实际执行的指令来计算总的gas费用,当超出预定的额度时则立即停止执行。A smart contract is usually a program submitted by users to the blockchain system and executed on each node of the blockchain system. According to the undecidability of the halting problem, we cannot predict whether the smart contract submitted by the user will fall into an infinite loop. If the smart contract falls into an infinite loop, the computing resources of all nodes on the chain will be fully occupied, and the service will become unavailable. In order to avoid this situation, the smart contract virtual machine detects the amount of computing resources consumed by the contract in real time during execution. This process can be called gas billing. Smart contracts are generally based on some kind of virtual machine instruction set, such as EVM (Ethereum Virtual Machine, Ethereum Virtual Machine) instruction set or WebAssembly (wasm) instruction set. Depending on the complexity of the instruction execution logic, different instructions often have different gas costs. The virtual machine needs to calculate the total gas cost based on the instructions actually executed by the contract, and stop execution immediately when the predetermined amount is exceeded.
传统的gas计费方案是以智能合约执行的指令为单位,即每执行一条指令就计算一次gas费用,并且检查是否超额。EVM虚拟机和wasm虚拟机通常是这么做的。这样的好处是实现简单,缺点是性能开销大,尤其是对于计算资源已经十分紧张的区块链节点。The traditional gas billing scheme is based on the instruction executed by the smart contract, that is, the gas fee is calculated every time an instruction is executed, and whether it is exceeded is checked. EVM virtual machines and wasm virtual machines usually do this. The advantage of this is that it is simple to implement, but the disadvantage is that the performance overhead is high, especially for blockchain nodes whose computing resources are already very tight.
为了降低gas计费给智能合约的执行带来的性能开销,本说明书实施例提供了区块链系统中的交易执行方案。In order to reduce the performance overhead brought by gas billing to the execution of the smart contract, the embodiment of this specification provides a transaction execution scheme in the blockchain system.
参看图2,其是本说明书实施例可以应用于其中的一个应用场景的示意图。在图2所示的应用场景中,可以包括用户User1的用户设备21和区块链系统22。区块链系统22中可以包括N个节点(如图2中示意示出节点1-节点8),并且部署有智能合约A。其中,关于该N个节点的解释,可参考前文中的相关说明,在此不再赘述。Referring to FIG. 2 , it is a schematic diagram of an application scenario to which the embodiment of this specification can be applied. In the application scenario shown in FIG. 2 , a user device 21 of a user User1 and a blockchain system 22 may be included. The blockchain system 22 may include N nodes (as shown schematically in FIG. 2 , node 1 - node 8 ), and a smart contract A is deployed. Wherein, for the explanation of the N nodes, reference may be made to relevant descriptions above, and details are not repeated here.
User1可以通过用户设备21向区块链系统22发送交易Tx1,交易Tx1调用智能合约A,并且包括交易Tx1对应的资源总额(如gas limit)。其中,智能合约A的合约代码中的指令可以配置有对应的资源消耗量。该资源消耗量可以理解为,该指令的执行对资源(数字资源/计算资源,如前文中描述的gas)的消耗量。区块链系统22中的节点可以通过执行交易Tx1调用智能合约A,并且基于智能合约A的合约代码中的基本块进行资源计费。需要指出,在计算机程序中,基本块通常是一段线性的代码序列(或指令序列),它具有以下性质:只能从基本块的入口处开始执行,不能跳到基本块的中间开始执行;基本块内的代码必须顺序地执行到末尾,不能从基本块的中间跳出。User1 can send a transaction Tx1 to the blockchain system 22 through the user device 21, and the transaction Tx1 calls the smart contract A, and includes the total amount of resources (such as gas limit) corresponding to the transaction Tx1. Among them, the instructions in the contract code of smart contract A can be configured with corresponding resource consumption. The resource consumption can be understood as the consumption of resources (digital resources/computing resources, such as the gas described above) by the execution of the instruction. Nodes in the blockchain system 22 can call smart contract A by executing transaction Tx1, and perform resource billing based on the basic blocks in the contract code of smart contract A. It should be pointed out that in a computer program, a basic block is usually a linear code sequence (or instruction sequence), which has the following properties: it can only be executed from the entrance of the basic block, and cannot jump to the middle of the basic block to start execution; The code inside the block must be executed sequentially to the end, and cannot jump out from the middle of the basic block.
下面,结合具体的实施例,介绍本说明书实施例提供的方案。In the following, in combination with specific embodiments, the solutions provided by the embodiments of this specification are introduced.
参看图3,其是本说明书实施例中区块链系统中的交易执行方法的流程图。区块链系统中可以部署有智能合约A。该方法可以应用于区块链系统中的节点。进一步地,该方法可以应用于该节点中用于执行智能合约的虚拟机(如EVM虚拟机或Wasm虚拟机等)。Referring to FIG. 3 , it is a flow chart of the transaction execution method in the blockchain system in the embodiment of this specification. Smart contract A can be deployed in the blockchain system. This method can be applied to nodes in a blockchain system. Further, the method can be applied to the virtual machine (such as EVM virtual machine or Wasm virtual machine, etc.) used to execute the smart contract in the node.
如图3所示,首先,在步骤S301,接收交易Tx1,交易Tx1调用智能合约A,并且包括交易Tx1对应的资源总额。As shown in Figure 3, first, in step S301, a transaction Tx1 is received, and the transaction Tx1 calls the smart contract A, and includes the total amount of resources corresponding to the transaction Tx1.
在步骤S303,在执行交易Tx1的过程中,基于智能合约A的第一合约代码中当前要执行的第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新交易Tx1对应的资源余额。In step S303, in the process of executing transaction Tx1, based on the sum of resource consumption corresponding to each first instruction in the first basic block currently to be executed in the first contract code of smart contract A, update the corresponding resource balance.
在一种实施方式中,第一合约代码可以是在部署智能合约A时使用的合约代码(如合约字节码)。在执行交易Tx1的过程中,可以加载第一合约代码,而后利用基本块的如前所述的性质,现场对第一合约代码进行基本块划分,从而确定出当前要执行的第一基本块。其中,第一基本块中对应于资源消耗量的指令可称为第一指令。可以基于第一基本块中的各条第一指令各自对应的资源消耗量的总和S,更新交易Tx1对应的资源余额gas_left。具体地,可以使得gas_left减少S。其中,gas_left的初始值可以为交易Tx1对应的资源总额。In one embodiment, the first contract code may be the contract code (such as contract bytecode) used when deploying the smart contract A. In the process of executing the transaction Tx1, the first contract code can be loaded, and then the first contract code can be divided into basic blocks on the spot by using the properties of the basic block as mentioned above, so as to determine the first basic block to be executed currently. Wherein, the instruction corresponding to the resource consumption in the first basic block may be referred to as the first instruction. The resource balance gas_left corresponding to the transaction Tx1 may be updated based on the sum S of resource consumption corresponding to each first instruction in the first basic block. Specifically, gas_left can be reduced by S. Among them, the initial value of gas_left can be the total amount of resources corresponding to the transaction Tx1.
在另一种实施方式中,第一合约代码中的若干基本块各自的入口处插入有第二指令,第二指令用于基于所在基本块中的各条第一指令各自对应的资源消耗量的总和更新交易对应的资源余额。其中,区块链系统中可以存储有智能合约A的第二合约代码,第一合约代码可以基于第二合约代码生成。第二合约代码可以是在部署智能合约A时使用的合约代码(如合约字节码)。在一个例子中,在部署智能合约A后,可以在第二合约代码中确定出若干基本块,并在该若干基本块各自的入口处插入第二指令,从而得到第一合约代码,并存储第一合约代码。由此,后续执行调用智能合约A的交易时,可以加载第一合约代码。基于此,在基于交易Tx1执行第一合约代码的过程中,在执行到位于第一基本块入口处的第二指令时,可以通过执行该第二指令,基于第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新交易Tx1对应的资源余额。In another embodiment, a second instruction is inserted at each entry of several basic blocks in the first contract code, and the second instruction is used to determine the corresponding resource consumption based on each first instruction in the basic block. The resource balance corresponding to the sum update transaction. Wherein, the second contract code of smart contract A may be stored in the blockchain system, and the first contract code may be generated based on the second contract code. The second contract code may be the contract code (such as contract bytecode) used when deploying the smart contract A. In one example, after smart contract A is deployed, several basic blocks can be determined in the second contract code, and second instructions can be inserted at the respective entrances of the several basic blocks, so as to obtain the first contract code and store the first contract code. A contract code. Thus, when a transaction calling smart contract A is subsequently executed, the first contract code can be loaded. Based on this, in the process of executing the first contract code based on the transaction Tx1, when the second instruction located at the entry of the first basic block is executed, the second instruction can be executed based on each first basic block in the first basic block. The sum of resource consumption corresponding to each instruction updates the resource balance corresponding to transaction Tx1.
在步骤S305,确定更新后的资源余额是否小于零。In step S305, it is determined whether the updated resource balance is less than zero.
其中,当更新后的资源余额小于零时,可以表示交易Tx1的资源总消耗量超出了交易Tx1对应的资源总额,需要执行步骤S309。当更新后的资源余额不小于零时,可以表示交易Tx1的资源总消耗量未超出该资源总额,从而可以接着执行步骤S307。Wherein, when the updated resource balance is less than zero, it may indicate that the total resource consumption of the transaction Tx1 exceeds the total resources corresponding to the transaction Tx1, and step S309 needs to be executed. When the updated resource balance is not less than zero, it may indicate that the total resource consumption of the transaction Tx1 does not exceed the total resource amount, and step S307 may then be performed.
在步骤S307,若确定更新后的资源余额不小于零,则按先后顺序依次执行第一基本块中的各条第一指令。In step S307, if it is determined that the resource balance after the update is not less than zero, each first instruction in the first basic block is sequentially executed.
在步骤S309,若确定更新后的资源余额小于零,则结束对第一合约代码的执行。In step S309, if it is determined that the updated resource balance is less than zero, the execution of the first contract code ends.
在通过执行步骤S309结束对第一合约代码的执行时,意味着要结束对交易Tx1的执行,由此交易Tx1会执行失败。When step S309 is executed to end the execution of the first contract code, it means that the execution of the transaction Tx1 is to be ended, and thus the execution of the transaction Tx1 will fail.
图3对应的实施例提供的方案,可以对智能合约的合约代码进行基本块划分,在智能合约执行过程中可以基于基本块进行资源计费,无需单独为每条指令进行资源计费。相比于基于指令进行资源计费,该方案显著降低了资源计费在智能合约执行过程中发生的频率,从而能有效降低资源计费给智能合约的执行带来的性能开销,有效减小对智能合约执行速度的影响。The solution provided by the embodiment corresponding to Fig. 3 can divide the contract code of the smart contract into basic blocks, and can perform resource billing based on the basic blocks during the execution of the smart contract, without separately performing resource billing for each instruction. Compared with resource billing based on instructions, this scheme significantly reduces the frequency of resource billing in the execution of smart contracts, thereby effectively reducing the performance overhead brought by resource billing to the execution of smart contracts, and effectively reducing the impact on smart contracts. The impact of smart contract execution speed.
在一种实施方式中,第二合约代码中的若干函数可以分别对应于基本块信息,该基本块信息可以指示出从对应函数的函数代码中划分出的若干基本块。进一步地,该基本块信息可以包括该若干基本块各自的指令标识范围。其中,指令标识例如可以是指令的行号或内存地址等,在此不做具体限定。In an implementation manner, several functions in the second contract code may respectively correspond to basic block information, and the basic block information may indicate several basic blocks divided from the function code of the corresponding function. Further, the basic block information may include respective instruction identification ranges of the several basic blocks. Wherein, the instruction identifier may be, for example, a line number or a memory address of the instruction, etc., which are not specifically limited here.
实践中,可以在基于第二合约代码完成对智能合约A的部署后及调用智能合约A之前,对第二合约代码进行基本块划分。具体地,第二合约代码中可以包括若干函数的函数代码,可以对该若干函数中每个函数的函数代码进行基本块划分,并缓存该函数对应的基本块信息。该基本块信息可以指示出从该函数的函数代码中划分出的若干基本块。In practice, after the smart contract A is deployed based on the second contract code and before the smart contract A is invoked, the second contract code can be divided into basic blocks. Specifically, the second contract code may include function codes of several functions, the function codes of each of the several functions may be divided into basic blocks, and the basic block information corresponding to the functions may be cached. The basic block information may indicate several basic blocks divided from the function code of the function.
需要说明,区块链系统重启后,缓存的基本块信息一般会丢失。因此,在重启区块链系统后,也可以对第二合约代码进行基本块划分。It should be noted that after the blockchain system is restarted, the cached basic block information will generally be lost. Therefore, after restarting the blockchain system, the second contract code can also be divided into basic blocks.
参看图4,其是基本块划分过程的一个示意图。该基本块划分过程可由区块链系统中的节点执行。进一步地,可以由该节点中用于执行智能合约的虚拟机执行。Referring to FIG. 4 , it is a schematic diagram of a basic block division process. The basic block division process can be performed by nodes in the blockchain system. Furthermore, it can be executed by the virtual machine used to execute the smart contract in the node.
如图4所示,首先,在步骤S401,在第二合约代码中,针对若干函数中任意的第一函数的第一函数代码,检测用于跳转的指令和作为跳转目标的指令,并将检测到的指令确定为基本块边界。As shown in Figure 4, first, in step S401, in the second contract code, for the first function code of any first function among several functions, detect the instruction for jumping and the instruction as the jump target, and Identify detected instructions as basic block boundaries.
具体地,可以将检测到的指令标记为基本块边界。Specifically, detected instructions may be marked as basic block boundaries.
在步骤S403,基于第一函数代码中被确定为基本块边界的各条指令各自的指令标识,生成若干指令标识范围;其中,该若干指令标识范围各自对应的指令序列均为基本块,并且用于跳转的指令为所在基本块的最后一条指令,作为跳转目标的指令为所在基本块的第一条指令。In step S403, several instruction identifier ranges are generated based on the respective instruction identifiers of the instructions determined as basic block boundaries in the first function code; wherein, the instruction sequences corresponding to each of the several instruction identifier ranges are all basic blocks, and are used The instruction to jump is the last instruction of the basic block where it is located, and the instruction as the jump target is the first instruction of the basic block where it is located.
在一个例子中,对于第一函数代码中被确定为基本块边界的各条指令中相邻的两条指令,可以基于该两条指令的指令标识生成指令标识范围R1,指令标识范围R1以该两条指令中在前的指令的指令标识为下界且以该两条指令中在后的指令的指令标识为上界。其中,当该在前的指令为用于跳转的指令时,指令标识范围R1不包含其下界。当该在前的指令为作为跳转目标的指令时,指令标识范围R1包含其下界。当该在后的指令为用于跳转的指令时,指令标识范围R1包含其上界。当该在后的指令为作为跳转目标的指令时,指令标识范围R1不包含其上界。In an example, for two adjacent instructions among the instructions determined as the basic block boundary in the first function code, an instruction identifier range R1 can be generated based on the instruction identifiers of the two instructions, and the instruction identifier range R1 starts with the The instruction ID of the earlier instruction among the two instructions is the lower bound and the instruction ID of the later instruction among the two instructions is the upper bound. Wherein, when the preceding instruction is an instruction for jumping, the instruction identification range R1 does not include its lower bound. When the preceding instruction is an instruction to be a jump target, the instruction identification range R1 includes its lower bound. When the following instruction is an instruction for jumping, the instruction identification range R1 includes its upper bound. When the following instruction is a jump target instruction, the instruction identification range R1 does not include its upper bound.
在步骤S405,生成对应于第一函数且包括上述若干指令标识范围的基本块信息。In step S405, basic block information corresponding to the first function and including the ranges identified by the above-mentioned several instructions is generated.
在步骤S407,缓存所生成的基本块信息。In step S407, the generated basic block information is cached.
下面,结合图5,对图4所示的基本块划分过程进行举例说明。其中,图5是基本块划分过程的一个示意图。假设第一函数代码中包括如图5中所示的按先后顺序排列的指令1-指令10,其中指令4是用于跳转的指令,指令7是作为跳转目标的指令,指令1的指令标识为1,指令4的指令标识为4,指令7的指令标识为7,指令10的指令标识为10。通过按先后顺序扫描指令1-指令10来检测用于跳转的指令和作为跳转目标的指令,可以先后检测出指令4和指令7,并将指令4和指令7分别标记为基本块边界。而后,基于被标记为基本块边界的指令4和指令7各自的指令标识,可以生成如图5中所示的三个指令标识范围,也即[1,4]、(4,7)、[7,10]。其中,[1,4]包含其下界1和上界4,并且对应于由指令1-指令4形成的指令序列,该指令序列为一个基本块。(4,7)不包含其下界4和上界7,并且对应于由指令5-指令6形成的指令序列,该指令序列为一个基本块。[7,10]包含其下界7和上界10,并且对应于由指令7-指令10形成的指令序列,该指令序列为一个基本块。接着,可以生成对应于第二函数且包括这三个指令标识范围的基本块信息,并缓存该基本块信息。Next, with reference to FIG. 5 , the process of dividing the basic blocks shown in FIG. 4 will be described with an example. Wherein, FIG. 5 is a schematic diagram of a basic block division process. Assume that the first function code includes instruction 1-instruction 10 arranged in sequence as shown in Figure 5, wherein instruction 4 is an instruction for jumping, instruction 7 is an instruction as a jump target, and instruction 1 is an instruction The instruction ID of instruction 4 is 4, the instruction ID of instruction 7 is 7, and the instruction ID of instruction 10 is 10. By scanning instruction 1-instruction 10 sequentially to detect instructions for jumping and instructions as jump targets, instruction 4 and instruction 7 can be detected successively, and instruction 4 and instruction 7 are respectively marked as basic block boundaries. Then, based on the respective instruction identifiers of instruction 4 and instruction 7 marked as basic block boundaries, three instruction identifier ranges as shown in FIG. 5 can be generated, that is, [1,4], (4,7), [ 7,10]. Among them, [1,4] contains its lower bound 1 and upper bound 4, and corresponds to an instruction sequence formed by instruction 1-instruction 4, which is a basic block. (4,7) does not contain its lower bound 4 and upper bound 7, and corresponds to the instruction sequence formed by instruction 5-instruction 6, which is a basic block. [7,10] contains its lower bound 7 and upper bound 10, and corresponds to the instruction sequence formed by instruction 7-instruction 10, which is a basic block. Next, basic block information corresponding to the second function and including the three instruction identification ranges may be generated, and the basic block information may be cached.
在一种实施方式中,第一合约代码中的若干基本块各自的入口处可以插入有第二指令,且第一合约代码可以在执行交易Tx1的过程中基于第二合约代码生成。In one embodiment, a second instruction may be inserted at the entrances of several basic blocks in the first contract code, and the first contract code may be generated based on the second contract code during the execution of the transaction Tx1.
具体地,参看图6,其是本说明书实施例中区块链系统中的交易执行方法的流程图。区块链系统中可以部署有智能合约A。该方法可以应用于区块链系统中的节点。进一步地,该方法可以应用于该节点中用于执行智能合约的虚拟机(如EVM虚拟机或Wasm虚拟机等)。Specifically, refer to FIG. 6 , which is a flow chart of the transaction execution method in the blockchain system in the embodiment of this specification. Smart contract A can be deployed in the blockchain system. This method can be applied to nodes in a blockchain system. Further, the method can be applied to the virtual machine (such as EVM virtual machine or Wasm virtual machine, etc.) used to execute the smart contract in the node.
如图6所示,首先,在步骤S601,接收交易Tx1,交易Tx1调用智能合约A,并且包括交易Tx1对应的资源总额。As shown in Figure 6, first, in step S601, a transaction Tx1 is received, and the transaction Tx1 invokes the smart contract A, and includes the total amount of resources corresponding to the transaction Tx1.
在步骤S603,在执行交易Tx1的过程中,加载智能合约A的第二合约代码。In step S603, the second contract code of the smart contract A is loaded during the execution of the transaction Tx1.
在步骤S605,在第二合约代码中确定出若干基本块,并在该若干基本块各自的入口处插入第二指令,从而得到第一合约代码;其中,第二指令用于基于所在基本块中的各条第一指令各自对应的资源消耗量的总和更新交易Tx1对应的资源余额。In step S605, several basic blocks are determined in the second contract code, and second instructions are inserted at the respective entrances of the several basic blocks, thereby obtaining the first contract code; wherein, the second instruction is used to The resource balance corresponding to the transaction Tx1 is updated by the sum of the resource consumption corresponding to each of the first instructions.
根据前文中的描述,第二合约代码中的若干函数可以分别对应于基本块信息,该基本块信息可以指示出从对应函数的函数代码中划分出的若干基本块。基于此,可以基于该若干函数分别对应的基本块信息,在第二合约代码中确定出若干基本块,并在该若干基本块各自的入口处插入第二指令,从而得到第一合约代码。According to the foregoing description, several functions in the second contract code may respectively correspond to basic block information, and the basic block information may indicate several basic blocks divided from the function code of the corresponding function. Based on this, several basic blocks can be determined in the second contract code based on the basic block information corresponding to the several functions, and a second instruction can be inserted at the respective entrances of the several basic blocks, thereby obtaining the first contract code.
参看图7,其是第二指令插入过程的一个示意图。其中,图7中左侧部分示意性的示出了第二合约代码中某个原始的基本块,该原始的基本块中包括按先后顺序排列的三条指令,即图7中示出的“i32.const 123”、“i32.const 456”和“i32.add”。假设这三条指令各自对应的资源消耗量的总和为300,可以在该原始的基本块的入口处插入用于对交易Tx1对应的资源余额减少300的第二指令,如“gas_sub 300”,由此便可以得到如图7中右侧部分所示的转换后的基本块。Referring to FIG. 7 , it is a schematic diagram of the second instruction insertion process. Wherein, the left part in Fig. 7 schematically shows an original basic block in the second contract code, which includes three instructions arranged in sequence, that is, "i32" shown in Fig. 7 .
在得到第一合约代码后,可以正常执行第一合约代码,而且在执行到第二指令时,可以通过执行第二指令进行资源计费。After obtaining the first contract code, the first contract code can be executed normally, and when the second instruction is executed, resource billing can be performed by executing the second instruction.
具体地,在步骤S607,当执行到第一合约代码中的第二指令时,通过执行第二指令,基于其所在第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新交易Tx1对应的资源余额。Specifically, in step S607, when the second instruction in the first contract code is executed, by executing the second instruction, based on the sum of resource consumption corresponding to each first instruction in the first basic block where it is located, Update the resource balance corresponding to transaction Tx1.
在步骤S609,确定更新后的资源余额是否小于零。In step S609, it is determined whether the updated resource balance is less than zero.
在步骤S611,若确定更新后的资源余额不小于零,则按先后顺序依次执行第一基本块中的各条第一指令。In step S611, if it is determined that the resource balance after the update is not less than zero, each first instruction in the first basic block is sequentially executed.
在步骤S613,若确定更新后的资源余额小于零,则结束对第一合约代码的执行。In step S613, if it is determined that the updated resource balance is less than zero, the execution of the first contract code ends.
图6对应的实施例提供的方案,在基于交易Tx1加载智能合约A的第二合约代码的阶段,可以通过在第二合约代码的若干基本块各自的入口处插入第二指令,将第二合约代码转换成第一合约代码。由此,可以执行第一合约代码,并且在执行到第一合约代码中的第二指令时,可以通过执行该第二指令,基于其所在第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新交易Tx1对应的资源余额。这样,可以实现以基本块为单位进行资源计费,相比于以指令为单位进行资源计费,能显著降低资源计费给智能合约的执行带来的性能开销。In the solution provided by the embodiment corresponding to Figure 6, at the stage of loading the second contract code of the smart contract A based on the transaction Tx1, the second contract can be converted to The code is converted into the first contract code. Thus, the first contract code can be executed, and when the second instruction in the first contract code is executed, by executing the second instruction, based on the corresponding The sum of resource consumption, update the resource balance corresponding to transaction Tx1. In this way, resource billing can be implemented in units of basic blocks, compared to resource billing in units of instructions, which can significantly reduce the performance overhead that resource billing brings to the execution of smart contracts.
图8是本说明书实施例中区块链系统中的交易执行装置的结构示意图。区块链系统中部署有智能合约。该装置可以应用于区块链系统中的节点。在一个例子中,该装置例如可以是用于执行智能合约的虚拟机(例如EVM虚拟机或Wasm虚拟机等)。Fig. 8 is a schematic structural diagram of the transaction execution device in the blockchain system in the embodiment of this specification. Smart contracts are deployed in the blockchain system. The device can be applied to nodes in a blockchain system. In one example, the device may be, for example, a virtual machine (such as an EVM virtual machine or a Wasm virtual machine, etc.) for executing smart contracts.
如图8所示,本说明书实施例中区块链系统中的交易执行装置800可以包括:接收单元801、更新单元802、确定单元803和执行单元804。其中,接收单元801被配置成接收第一交易,第一交易调用智能合约,并且包括第一交易对应的资源总额;更新单元802被配置成在执行第一交易的过程中,基于智能合约的第一合约代码中当前要执行的第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新第一交易对应的资源余额;确定单元803被配置成确定更新后的资源余额是否小于零;执行单元804被配置成若确定单元803的确定结果为否,则按先后顺序依次执行第一基本块中的各条第一指令。As shown in FIG. 8 , the
在一些实施例中,执行单元804还可以被配置成:若确定单元803的确定结果为是,则结束对第一合约代码的执行。In some embodiments, the
在一些实施例中,第一基本块的入口处插入有第二指令;以及更新单元802可以进一步被配置成:通过执行该第二指令,基于第一基本块中的各条第一指令各自对应的资源消耗量的总和,更新第一交易对应的资源余额。In some embodiments, a second instruction is inserted at the entry of the first basic block; and the
在一些实施例中,区块链系统中存储有智能合约的第二合约代码,第一合约代码基于第二合约代码生成。In some embodiments, the second contract code of the smart contract is stored in the blockchain system, and the first contract code is generated based on the second contract code.
在一些实施例中,上述装置800还可以包括加载单元(图中未示出)。在执行第一交易的过程中,加载单元可以被配置成加载第二合约代码,在第二合约代码中确定出若干基本块,并在该若干基本块各自的入口处插入第二指令,从而得到第一合约代码;其中,第二指令用于基于所在基本块中的各条第一指令各自对应的资源消耗量的总和更新第一交易对应的资源余额。In some embodiments, the
在一些实施例中,第二合约代码中的若干函数分别对应于基本块信息,该基本块信息指示出从对应函数的函数代码中划分出的若干基本块。In some embodiments, several functions in the second contract code respectively correspond to basic block information, and the basic block information indicates several basic blocks divided from the function code of the corresponding function.
在一些实施例中,上述装置800还可以包括:检测单元(图中未示出),被配置成在第二合约代码中,针对若干函数中任意的第一函数的第一函数代码,检测用于跳转的指令和作为跳转目标的指令,并将检测到的指令确定为基本块边界;生成单元(图中未示出),被配置成基于第一函数代码中被确定为基本块边界的各条指令各自的指令标识,生成若干指令标识范围;其中,该若干指令标识范围各自对应的指令序列均为基本块,并且用于跳转的指令为所在基本块的最后一条指令,作为跳转目标的指令为所在基本块的第一条指令;该生成单元还可以被配置成:生成对应于第一函数且包括该若干指令标识范围的基本块信息。In some embodiments, the above-mentioned
在一些实施例中,上述装置800还可以包括:缓存单元(图中未示出),被配置成缓存上述生成单元所生成的基本块信息。In some embodiments, the foregoing
在一些实施例中,上述生成单元可以进一步被配置成:对于第一函数代码中被确定为基本块边界的各条指令中相邻的两条指令,基于该两条指令的指令标识生成第一指令标识范围,第一指令标识范围以该两条指令中在前的指令的指令标识为下界且以该两条指令中在后的指令的指令标识为上界;其中,当该在前的指令为用于跳转的指令时,第一指令标识范围不包含其下界;当该在前的指令为作为跳转目标的指令时,第一指令标识范围包含其下界;当该在后的指令为用于跳转的指令时,第一指令标识范围包含其上界;当该在后的指令为作为跳转目标的指令时,第一指令标识范围不包含其上界。In some embodiments, the generating unit may be further configured to: for two adjacent instructions among the instructions determined as the basic block boundary in the first function code, generate the first instruction based on the instruction identifiers of the two instructions Instruction identification range, the first instruction identification range takes the instruction identification of the previous instruction in the two instructions as the lower bound and takes the instruction identification of the subsequent instruction in the two instructions as the upper boundary; wherein, when the previous instruction When it is an instruction for jumping, the first instruction identification range does not include its lower bound; when the previous instruction is an instruction as a jump target, the first instruction identification range includes its lower bound; when the following instruction is When an instruction is used for jumping, the range identified by the first instruction includes its upper bound; when the subsequent instruction is an instruction as a jump target, the identified range of the first instruction does not include its upper bound.
在图8对应的装置实施例中,关于各单元的进一步解释,可参考前文中相关方法实施例中的相关说明,在此不再赘述。In the device embodiment corresponding to FIG. 8 , for further explanations of each unit, reference may be made to relevant descriptions in related method embodiments above, and details are not repeated here.
本说明书实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,其中,当该计算机程序在计算机中执行时,令计算机执行前文中任意的方法实施例描述的方法。The embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed in a computer, the computer is instructed to execute the method described in any of the above method embodiments.
本说明书实施例还提供了一种计算设备,包括存储器和处理器,其中,该存储器中存储有可执行代码,该处理器执行该可执行代码时,实现前文中任意的方法实施例描述的方法。The embodiment of this specification also provides a computing device, including a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, the method described in any of the above method embodiments is implemented .
本说明书实施例还提供了一种计算机程序,其中,当该计算机程序在计算机中执行时,令计算机执行如前文中任意的方法实施例描述的方法。The embodiment of the present specification also provides a computer program, wherein, when the computer program is executed in a computer, the computer is caused to execute the method described in any of the above method embodiments.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware DescriptionLanguage)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(RubyHardware Description Language)等,目前最普遍使用的是VHDL(Very-High-SpeedIntegrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished as an improvement in hardware (for example, improvements in circuit structures such as diodes, transistors, and switches) or improvements in software (improvement in method flow). However, with the development of technology, the improvement of many current method flows can be regarded as the direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (Programmable Logic Device, PLD) (such as a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)) is such an integrated circuit, and its logic function is determined by programming the device by a user. It is programmed by the designer to "integrate" a digital system on a PLD, instead of asking a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of making integrated circuit chips by hand, this kind of programming is mostly realized by "logic compiler (logic compiler)" software, which is similar to the software compiler used when writing programs. The original code of the computer must also be written in a specific programming language, which is called a hardware description language (Hardware Description Language, HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., currently the most commonly used is VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. It should also be clear to those skilled in the art that only a little logical programming of the method flow in the above-mentioned hardware description languages and programming into an integrated circuit can easily obtain a hardware circuit for realizing the logic method flow.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable way, for example the controller may take the form of a microprocessor or processor and a computer readable medium storing computer readable program code (such as software or firmware) executable by the (micro)processor , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers, and embedded microcontrollers, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic. Those skilled in the art also know that, in addition to realizing the controller in a purely computer-readable program code mode, it is entirely possible to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as structures within the hardware component. Or even, means for realizing various functions can be regarded as a structure within both a software module realizing a method and a hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of future computer technology, the computer that realizes the functions of the above embodiments can be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant , media players, navigation devices, email devices, game consoles, tablet computers, wearable devices, or any combination of these devices.
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although one or more embodiments of the present specification provide the operation steps of the method described in the embodiment or the flowchart, more or fewer operation steps may be included based on conventional or non-inventive means. The sequence of steps enumerated in the embodiments is only one of the execution sequences of many steps, and does not represent the only execution sequence. When an actual device or terminal product is executed, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (such as a parallel processor or multi-thread processing environment, or even a distributed data processing environment). The term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, product, or apparatus comprising a set of elements includes not only those elements, but also other elements not expressly listed elements, or also elements inherent in such a process, method, product, or apparatus. Without further limitations, it is not excluded that there are additional identical or equivalent elements in a process, method, product or device comprising said elements. For example, if the words first, second, etc. are used, they are used to indicate names and do not indicate any particular order.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, when describing the above devices, functions are divided into various modules and described separately. Of course, when implementing one or more of the present specification, the functions of each module can be realized in the same or more software and/or hardware, and the modules that realize the same function can also be realized by a combination of multiple submodules or subunits, etc. . The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape disk storage, graphene storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by computing devices. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that one or more embodiments of this specification may be provided as a method, system or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The form of the product.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书一个或多个实5施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在One or more embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. exist
分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment and
言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分0说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、In other words, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant information, please refer to the description of Part 0 of the method embodiment. In the description of this specification, reference is made to the terms "one embodiment", "some embodiments", "example",
“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特The description of "specific examples" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example in this specification. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, no particular feature, structure, material, or characteristic described
点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,5本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征Points may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may refer to different embodiments or examples and the features of different embodiments or examples described in this specification without conflicting with each other.
进行结合和组合。Combine and combine.
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。The above description is only an example of one or more embodiments of this specification, and is not intended to limit one or more embodiments of this specification. For those skilled in the art, various modifications and changes may occur in one or more embodiments of this description.
凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求0范围之内。Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included within the scope of the claims.
Claims (13)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211740900.0A CN116188016A (en) | 2022-12-31 | 2022-12-31 | Transaction execution method and device in blockchain system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211740900.0A CN116188016A (en) | 2022-12-31 | 2022-12-31 | Transaction execution method and device in blockchain system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116188016A true CN116188016A (en) | 2023-05-30 |
Family
ID=86441607
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211740900.0A Pending CN116188016A (en) | 2022-12-31 | 2022-12-31 | Transaction execution method and device in blockchain system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116188016A (en) |
Citations (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6182284B1 (en) * | 1998-09-30 | 2001-01-30 | Hewlett-Packard Company | Method and system for eliminating phi instruction resource interferences and redundant copy instructions from static-single-assignment-form computer code |
| CN101923481A (en) * | 2010-09-11 | 2010-12-22 | 上海交通大学 | Program execution optimization method based on code duplication super block |
| US20120017203A1 (en) * | 2010-07-14 | 2012-01-19 | International Business Machines Corporation | Path-Sensitive Analysis for Reducing Rollback Overheads |
| JP2012159936A (en) * | 2011-01-31 | 2012-08-23 | Toshiba Corp | Target code prior conversion method and emulation method |
| US20120331448A1 (en) * | 2011-06-27 | 2012-12-27 | Kabushiki Kaisha Toshiba | Coverage measurement apparatus and method and medium |
| US20200302067A1 (en) * | 2019-03-21 | 2020-09-24 | Commissariat A L'energie Atomique Et Aux Energies Alternatives | Method for executing a binary code of a function secured by a microprocessor |
| CN111738710A (en) * | 2020-07-23 | 2020-10-02 | 支付宝(杭州)信息技术有限公司 | Method and processor for resource deduction of execution of intelligent contract |
| CN112100054A (en) * | 2020-08-12 | 2020-12-18 | 北京大学 | A program static analysis method and system for data management and control |
| WO2021179736A1 (en) * | 2020-03-13 | 2021-09-16 | 江苏复杂美科技有限公司 | Method for pre-storing and deducting service charge, device, and storage medium |
| CN113419736A (en) * | 2021-06-08 | 2021-09-21 | 赵庆林 | Method for supporting intelligent contract protocol on Tangle block chain system |
| CN114327776A (en) * | 2021-12-30 | 2022-04-12 | 支付宝(杭州)信息技术有限公司 | Debugging method, debugging equipment and debugging system for intelligent contract |
| CN114327695A (en) * | 2021-12-29 | 2022-04-12 | 支付宝(杭州)信息技术有限公司 | Intelligent contract execution method and device |
| CN114385185A (en) * | 2021-12-24 | 2022-04-22 | 深圳前海微众银行股份有限公司 | A method and device for generating a control flow graph of a smart contract |
| CN114721595A (en) * | 2022-03-31 | 2022-07-08 | 深圳前海微众银行股份有限公司 | Data processing method, apparatus, medium, and program product |
-
2022
- 2022-12-31 CN CN202211740900.0A patent/CN116188016A/en active Pending
Patent Citations (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6182284B1 (en) * | 1998-09-30 | 2001-01-30 | Hewlett-Packard Company | Method and system for eliminating phi instruction resource interferences and redundant copy instructions from static-single-assignment-form computer code |
| US20120017203A1 (en) * | 2010-07-14 | 2012-01-19 | International Business Machines Corporation | Path-Sensitive Analysis for Reducing Rollback Overheads |
| CN101923481A (en) * | 2010-09-11 | 2010-12-22 | 上海交通大学 | Program execution optimization method based on code duplication super block |
| JP2012159936A (en) * | 2011-01-31 | 2012-08-23 | Toshiba Corp | Target code prior conversion method and emulation method |
| US20120331448A1 (en) * | 2011-06-27 | 2012-12-27 | Kabushiki Kaisha Toshiba | Coverage measurement apparatus and method and medium |
| US20200302067A1 (en) * | 2019-03-21 | 2020-09-24 | Commissariat A L'energie Atomique Et Aux Energies Alternatives | Method for executing a binary code of a function secured by a microprocessor |
| WO2021179736A1 (en) * | 2020-03-13 | 2021-09-16 | 江苏复杂美科技有限公司 | Method for pre-storing and deducting service charge, device, and storage medium |
| CN111738710A (en) * | 2020-07-23 | 2020-10-02 | 支付宝(杭州)信息技术有限公司 | Method and processor for resource deduction of execution of intelligent contract |
| US20210326132A1 (en) * | 2020-07-23 | 2021-10-21 | Alipay (Hangzhou) Information Technology Co., Ltd. | Methods and processors for performing resource deduction for execution of smart contract |
| CN112100054A (en) * | 2020-08-12 | 2020-12-18 | 北京大学 | A program static analysis method and system for data management and control |
| CN113419736A (en) * | 2021-06-08 | 2021-09-21 | 赵庆林 | Method for supporting intelligent contract protocol on Tangle block chain system |
| CN114385185A (en) * | 2021-12-24 | 2022-04-22 | 深圳前海微众银行股份有限公司 | A method and device for generating a control flow graph of a smart contract |
| CN114327695A (en) * | 2021-12-29 | 2022-04-12 | 支付宝(杭州)信息技术有限公司 | Intelligent contract execution method and device |
| CN114327776A (en) * | 2021-12-30 | 2022-04-12 | 支付宝(杭州)信息技术有限公司 | Debugging method, debugging equipment and debugging system for intelligent contract |
| CN114721595A (en) * | 2022-03-31 | 2022-07-08 | 深圳前海微众银行股份有限公司 | Data processing method, apparatus, medium, and program product |
Non-Patent Citations (2)
| Title |
|---|
| 徐国胜 等: "《软件安全》", 31 January 2020, 北京邮电大学出版社, pages: 244 - 251 * |
| 陈卷毛: "CoinEx Smart Chain 合约Gas计费解析", pages 1 - 7, Retrieved from the Internet <URL:https://juejin.cn/post/6844904158986764301> * |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6876806B2 (en) | Blockchain Consensus Formation Methods and Devices | |
| CN114827165B (en) | Method and block link point for grouping multiple transactions | |
| WO2023231336A1 (en) | Method for executing transaction and blockchain node | |
| WO2023160085A1 (en) | Method for executing transaction, blockchain, master node, and slave node | |
| CN114679457A (en) | Node grouping method in block chain and block chain link point | |
| WO2024001024A1 (en) | Method for executing transaction in blockchain system, and blockchain system and nodes | |
| CN115150409B (en) | Method for executing transaction in blockchain system, node and computer readable storage medium | |
| WO2023160083A1 (en) | Method for executing transactions, blockchain, master node, and slave node | |
| CN115098483A (en) | A pre-execution cache data cleaning method and blockchain node | |
| WO2025000878A1 (en) | Transaction execution method, node, and blockchain system | |
| CN116308372A (en) | Detection method and device for blockchain transaction | |
| WO2025139351A1 (en) | Calling of smart contract | |
| WO2024244342A1 (en) | Transaction processing method in blockchain, and blockchain node | |
| CN116188016A (en) | Transaction execution method and device in blockchain system | |
| CN116707891A (en) | Replay attack checking method and block link point | |
| CN116366666A (en) | Chain state updating method and block link point in block chain system | |
| CN116431312A (en) | Transaction execution method and block link point in block chain system | |
| CN116032756A (en) | Method and blockchain node for updating configuration information of application program based on blockchain | |
| WO2023231342A1 (en) | Method and apparatus for automatically executing contract on the basis of variable state | |
| EP3779691B1 (en) | Data processing method and apparatus | |
| CN115714652B (en) | Transaction execution methods and blockchain nodes | |
| CN115529352B (en) | Routing processing method and device for computing services | |
| CN115714652A (en) | Transaction execution method and block link point | |
| CN115865365B (en) | Block chain-based account dividing processing method, device and system | |
| CN115880071A (en) | Method for processing digital resources and nodes of block chain |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |