CN112529711B - Transaction processing method and device based on block chain virtual machine multiplexing - Google Patents

Transaction processing method and device based on block chain virtual machine multiplexing Download PDF

Info

Publication number
CN112529711B
CN112529711B CN202110176859.8A CN202110176859A CN112529711B CN 112529711 B CN112529711 B CN 112529711B CN 202110176859 A CN202110176859 A CN 202110176859A CN 112529711 B CN112529711 B CN 112529711B
Authority
CN
China
Prior art keywords
virtual machine
target
intelligent contract
transaction
pool
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.)
Active
Application number
CN202110176859.8A
Other languages
Chinese (zh)
Other versions
CN112529711A (en
Inventor
崔嘉辉
孔利
刘区城
种衍雪
何畅
付博
时一防
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110176859.8A priority Critical patent/CN112529711B/en
Publication of CN112529711A publication Critical patent/CN112529711A/en
Application granted granted Critical
Publication of CN112529711B publication Critical patent/CN112529711B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The embodiment of the application discloses a transaction processing method and a device based on block chain virtual machine multiplexing, wherein the method comprises the following steps: acquiring a transaction to be processed; searching a target virtual machine from a virtual machine pool according to an intelligent contract identifier contained in the transaction, wherein the virtual machine pool is used for storing a block chain virtual machine loaded with an intelligent contract, and the target virtual machine is loaded with a target intelligent contract indicated by the intelligent contract identifier; invoking the target virtual machine to execute the transaction through a target smart contract loaded in the target virtual machine; terminating the invocation of the target virtual machine after the transaction is performed, the terminating invocation of the target virtual machine waiting for reuse in the pool of virtual machines. The technical scheme of the embodiment of the application can improve the execution efficiency of the transaction and correspondingly improve the performance of the block chain system.

Description

Transaction processing method and device based on block chain virtual machine multiplexing
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a transaction processing method and apparatus based on blockchain virtual machine multiplexing, an electronic device, and a computer-readable storage medium.
Background
The blockchain virtual machine is a sandbox for execution of intelligent contracts, and the blockchain virtual machine provides basic capabilities for the intelligent contracts, such as computing, acquiring data on a chain, database reading and writing and the like.
Before executing the transaction, it is usually necessary to create one blockchain virtual machine for each transaction and load the intelligent contract into the blockchain virtual machine to execute the transaction through the intelligent contract loaded in the blockchain virtual machine. However, the process of creating the blockchain virtual machine and the process of loading the intelligent contracts into the blockchain virtual machine are time-consuming, so that the efficiency of executing transactions by the intelligent contracts is low, and the performance of the whole blockchain system is low.
Disclosure of Invention
In order to solve the above technical problem, embodiments of the present application provide a transaction processing method and apparatus based on block chain virtual machine multiplexing, an electronic device, and a computer-readable storage medium.
According to an aspect of an embodiment of the present application, there is provided a transaction processing method based on blockchain virtual machine multiplexing, including: acquiring a transaction to be processed; searching a target virtual machine from a virtual machine pool according to an intelligent contract identifier contained in the transaction, wherein the virtual machine pool is used for storing a block chain virtual machine loaded with an intelligent contract, and the target virtual machine is loaded with a target intelligent contract indicated by the intelligent contract identifier; invoking the target virtual machine to execute the transaction through a target smart contract loaded in the target virtual machine; terminating the invocation of the target virtual machine after the transaction is performed, the terminating invocation of the target virtual machine waiting for reuse in the pool of virtual machines.
According to an aspect of an embodiment of the present application, there is provided a transaction processing apparatus based on blockchain virtual machine multiplexing, including: a transaction acquisition module configured to acquire a transaction to be processed; a virtual machine searching module configured to search a target virtual machine from a virtual machine pool according to an intelligent contract identifier included in the transaction, where the virtual machine pool is used to store a block chain virtual machine loaded with an intelligent contract, and the target virtual machine is loaded with a target intelligent contract indicated by the intelligent contract identifier; a transaction execution module configured to invoke the target virtual machine to execute the transaction through a target smart contract loaded in the target virtual machine; and the call termination module is configured to terminate calling the target virtual machine after the transaction is executed, and the target virtual machine terminating calling waits for multiplexing in the virtual machine pool.
According to an aspect of the embodiments of the present application, there is provided an electronic device, including a processor and a memory, where the memory stores thereon computer-readable instructions, and the computer-readable instructions, when executed by the processor, implement the transaction processing method based on block chain virtual machine multiplexing as described above.
According to an aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon computer-readable instructions, which, when executed by a processor of a computer, cause the computer to execute a transaction processing method based on blockchain virtual machine multiplexing as described above.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions 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 to enable the computer device to execute the transaction processing method based on the block chain virtual machine multiplexing provided in the above-mentioned various optional embodiments.
In the technical solution provided by the embodiment of the present application, a blockchain virtual machine is stored in a virtual machine pool, before a transaction is executed, a target virtual machine loaded with a target intelligent contract indicated by the transaction is searched and called from the virtual machine, so as to execute the transaction through the target intelligent contract loaded in the target virtual machine, after the transaction is executed, by terminating calling the target virtual machine, the target virtual machine is equivalently placed back into the virtual machine pool to wait for being called next time, thereby realizing multiplexing of blockchain virtual machines in the virtual machine pool, without creating a blockchain virtual machine for each transaction and loading an intelligent contract into the blockchain virtual machine, thereby improving the execution efficiency of the transaction and correspondingly improving the performance of a blockchain system.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a schematic illustration of an implementation environment to which the present application relates.
Fig. 2 is a flowchart illustrating a transaction processing method based on blockchain virtual machine multiplexing according to an exemplary embodiment of the present application.
Fig. 3 is a flow chart of step S130 in the embodiment shown in fig. 2 in an exemplary embodiment.
Fig. 4 is a flowchart illustrating a transaction processing method based on blockchain virtual machine multiplexing according to another exemplary embodiment of the present application.
Fig. 5 is a schematic diagram of a transaction parallel execution application scenario based on blockchain virtual machine multiplexing according to an exemplary embodiment of the present application.
Fig. 6 is a block diagram illustrating a transaction processing device based on blockchain virtual machine multiplexing according to an exemplary embodiment of the present application.
FIG. 7 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It should also be noted that: reference to "a plurality" in this application means two or more. "and/or" describe the association relationship of the associated objects, meaning that there may be three relationships, e.g., A and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring to fig. 1, fig. 1 is a schematic diagram of an implementation environment related to the present application. The implementation environment is a blockchain transaction system, as shown in fig. 1, the blockchain transaction system includes a blockchain system 100 and a transaction terminal 200, the transaction terminal 200 establishes a communication connection with the blockchain system 100 in a wired or wireless manner, and the blockchain system 100 is configured to process a transaction sent by the transaction terminal 200.
The blockchain system 100 shown in fig. 1 refers to a system for sharing data between the nodes 10 and 10, and in order to ensure information intercommunication in the blockchain system 100, an information connection may exist between the nodes 10 in the blockchain system 100, so that information transmission may be performed between the nodes 10 through the information connection.
The node 10 included in the block chain system 100 stores a block chain 11, as shown in fig. 1, the block chain 11 is composed of a plurality of blocks, each block includes a block header and a block body, and information such as a block height and a time stamp is stored in the block header.
At least one intelligent contract is deployed on the blockchain 11 to specifically execute the transaction sent by the transaction terminal 200 through the intelligent contract. The deployment and the execution of the intelligent contract are all through the consensus of the nodes 10 in the blockchain system 100, and the malicious nodes cannot influence the overall consensus result of the blockchain system 100, so that the intelligent contract has the characteristics of decentralization and distrust. The blockchain virtual machine provides basic capabilities for intelligent contracts, such as computation, obtaining data on the chain, database reading, and the like, so the intelligent contracts need to be loaded into the blockchain virtual machine.
Specifically, when the node 10 included in the blockchain system 100 acquires a transaction to be processed, a target virtual machine is searched from a virtual machine pool according to an intelligent contract identifier included in the transaction, where the virtual machine pool is used to store a blockchain virtual machine loaded with an intelligent contract, and the target virtual machine is a blockchain virtual machine loaded with a target intelligent contract indicated by the intelligent contract identifier. And after the target virtual machine is found from the virtual machine pool, calling the target virtual machine to execute transaction through the target intelligent contract loaded in the target virtual machine. The call to the target virtual machine is terminated after the transaction is performed such that the target virtual machine that terminated the call waits in the pool of virtual machines for reuse.
Based on the above proposed multiplexing mechanism of the blockchain virtual machine in the virtual machine pool, the node 10 does not need to create a blockchain virtual machine for each transaction and load a target intelligent contract into the blockchain virtual machine, and the number of times that the node 10 executes the creation of the blockchain virtual machine and loads the intelligent contract into the blockchain virtual machine can be reduced, so that the execution efficiency of the transaction is improved, and the overall performance of the blockchain system 100 can be improved.
It should be noted that the transaction terminal 200 shown in fig. 1 may be a terminal device such as a smart phone, a tablet, a notebook, a computer, etc.; the node 10 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and an artificial intelligence platform, which is not limited herein.
Fig. 2 is a flowchart illustrating a transaction processing method based on blockchain virtual machine multiplexing according to an exemplary embodiment of the present application. The method may be applied to the implementation environment shown in fig. 1 and is specifically performed by the node 10 in the implementation environment shown in fig. 1. In other embodiments, the method may be performed by other devices, and is not limited in this respect.
It should be noted that, in the prior art implementation, a blockchain virtual machine is created for each transaction before the transaction is processed, and a target smart contract for processing the transaction is loaded into the created blockchain virtual machine. The time cost required for the two steps is very high, for example, in a scenario where an electronic invoice transaction is executed by using an intelligent contract for a blockchain electronic invoice, the time required for executing the two steps accounts for 71.5% of the total time required for executing the electronic invoice transaction, which results in low efficiency in processing the transaction in the prior art implementation and thus low performance of the whole blockchain system.
To solve the technical problem, the present embodiment provides a transaction processing method based on block chain virtual machine multiplexing. The multiplexing of the blockchain virtual machine in this embodiment means that the blockchain virtual machine is not destroyed after the transaction is completed, but continues to be recycled and reused. Wherein the multiplexing of the blockchain virtual machine is due to the following considerations:
firstly, for any transaction, the creation flow of the blockchain virtual machine is consistent, for example, taking the blockchain virtual machine implemented as a JavaScript (JS for short, which is a lightweight, interpreted, or just-in-time compiled high-level programming language) virtual machine as an example, besides creating a JavaScript virtual machine Object, a large number of global variables such as Date, Math, String, Object, and the like need to be generated and mounted on the JavaScript virtual machine Object;
second, for transactions executed by the same intelligent contract, the process of loading the intelligent contract into the blockchain virtual machine is consistent, for example, the process compiles the code of the intelligent contract into instruction code that can be recognized by the blockchain virtual machine and then executes the instruction code;
based on the above consideration, in the embodiment, the virtual machine pool is introduced to recycle the block chain virtual machine after executing the Transaction, the recycled block chain virtual machine can be reused by the subsequent exchange, and the subsequent Transaction does not need to create the block chain virtual machine and load the intelligent contract, so that TPS (Transaction Per Second, the number of transactions processed Per Second) for executing the Transaction is improved, the memory size and the memory allocation frequency required for executing the Transaction are reduced, and the efficiency of executing the Transaction and the performance of the block chain system are improved.
As shown in fig. 2, the transaction processing method based on multiplexing of the blockchain virtual machine according to the embodiment at least includes steps S110 to S170, which are described in detail as follows:
step S110, a transaction to be processed is acquired.
In this embodiment, the pending transaction may refer to any type of transaction, such as a transfer transaction or an electronic ticket transaction, which is not limited herein. The transaction to be processed may be a real-time transaction initiated by the transaction terminal, or may be a transaction stored in the transaction pool, which is not limited in this embodiment.
Step S130, searching a target virtual machine from a virtual machine pool according to the intelligent contract identifier contained in the transaction, wherein the virtual machine pool is used for storing the block chain virtual machine loaded with the intelligent contract, and the target virtual machine is loaded with the target intelligent contract indicated by the intelligent contract identifier.
Intelligent contracts are stored on blockchains and are typically composed of two parts, executable code and the contract's own state. The flow of smart contracts executed via transactional triggering is generally abstracted as the following formula:
Figure 985882DEST_PATH_IMAGE001
where TX represents an incoming transaction and S represents an intelligent contract before executing the transactionThe former state, F, represents the execution logic of the intelligent contract, typically determined by the executable code of the intelligent contract,
Figure 591438DEST_PATH_IMAGE002
it indicates a state after the smart contract has executed the transaction. The deployment and the execution of the intelligent contract are both subjected to consensus of the blockchain nodes, and the malicious nodes cannot influence the overall consensus result of the blockchain system, so that the intelligent contract deployed on the blockchain has the characteristics of decentralization and distrust.
In this embodiment, the transaction carries an intelligent contract identifier of a target intelligent contract used for executing the transaction, for example, the intelligent contract identifier includes a name and a version number of the target intelligent contract, and the target intelligent contract deployed on the blockchain may be correspondingly obtained according to the intelligent contract identifier included in the transaction.
The block chain virtual machine is a sandbox executed by the intelligent contract codes, so that the intelligent contracts can execute the same transaction under the same initial state, and finally the same transaction execution result can be obtained. The intelligent contract code exists in the blockchain virtual machine in the form of instruction codes, and the instruction codes can be identified and executed by the blockchain virtual machine. The blockchain virtual machine provides basic capabilities for the intelligent contracts, such as computation, acquisition of data on the chain, database reading and writing and the like, so that the intelligent contracts need to be loaded into the blockchain virtual machine for execution. The intelligent contract cannot use functions, such as network access, that are not supported by the blockchain virtual machine.
In this embodiment, a virtual machine pool for storing the blockchain virtual machine loaded with the intelligent contract is provided, that is, the virtual machine pool is one or more segments of storage space for storing the blockchain virtual machine loaded with the intelligent contract. After determining a target intelligent contract for executing a transaction according to an intelligent contract identifier contained in the transaction, a target virtual machine corresponding to the target intelligent contract can be searched from a virtual machine pool, and the target virtual machine is also a block chain virtual machine loaded with the target intelligent contract.
And if the block chain virtual machine loaded with the target intelligent contract and waiting for multiplexing currently exists in the virtual machine pool, directly taking the block chain virtual machine as the target virtual machine, so that the corresponding target virtual machine can be found in the virtual machine pool.
If the virtual machine pool does not have the block chain virtual machine loaded with the target intelligent contract waiting for multiplexing currently, the block chain virtual machine loaded with the target intelligent contract is newly built in the virtual machine pool, and the newly built block chain virtual machine is used as the target virtual machine, so that the target virtual machine can be found in the virtual machine pool.
It should be understood that the blockchain virtual machine waiting for multiplexing refers to a situation that the blockchain virtual machine currently is in an idle state, and if the blockchain virtual machine loaded with the target intelligent contract does not exist in the virtual machine pool or the blockchain virtual machine loaded with the target intelligent contract stored in the virtual machine pool is in the idle state, the situation that the blockchain virtual machine waiting for multiplexing does not exist in the virtual machine pool currently.
And step S150, calling the target virtual machine to execute the transaction through the target intelligent contract loaded in the target virtual machine.
After the target virtual machine is found from the virtual machine pool, the target virtual machine is called, the transaction to be processed is transmitted into a target intelligent contract loaded by the target virtual machine, and the transaction can be executed through the target intelligent contract. It should be noted that after the target virtual machine is called, the target virtual machine is in a non-idle state, that is, the target virtual machine is not in a state of waiting for multiplexing.
Step S170, terminating the call to the target virtual machine after the transaction is executed, and the target virtual machine terminating the call waits for reuse in the virtual machine pool.
After the intelligent contract finishes executing the transaction, a corresponding transaction execution result is obtained, and meanwhile, the calling of the target virtual machine is stopped, so that the target virtual machine is in an idle state, namely, the target virtual machine is recycled to the virtual machine pool, and the multiplexing of the subsequent transaction is waited in the virtual machine pool.
Therefore, in the embodiment, the blockchain virtual machine is stored in the virtual machine pool, before the transaction is executed, the target virtual machine loaded with the target intelligent contract indicated by the transaction is searched and called from the virtual machine, so as to execute the transaction through the target intelligent contract loaded in the target virtual machine, after the transaction is executed, the target virtual machine is called by terminating, so that the target virtual machine is placed back into the virtual machine pool to wait for multiplexing of subsequent transactions, and therefore, based on multiplexing of the blockchain virtual machine in the virtual machine pool, the blockchain virtual machine does not need to be created for each transaction to be processed and the intelligent contract is loaded into the blockchain virtual machine, so that the execution efficiency of the transaction is improved, and the performance of a blockchain system is correspondingly improved.
Fig. 3 is a flow chart of step S130 in the embodiment shown in fig. 2 in an exemplary embodiment. As shown in fig. 3, the process of searching for the target virtual machine from the virtual machine pool according to the intelligent contract identifier contained in the transaction may include steps S131 to S133, which are described in detail as follows:
step S131, searching a target virtual machine loaded with the target intelligent contract indicated by the intelligent contract identification in the virtual machine pool.
As described above, if there is a blockchain virtual machine loaded with a target intelligent contract in an idle state in the virtual machine pool, the target virtual machine loaded with the target intelligent contract can be directly found in the virtual machine pool according to the intelligent contract identifier included in the transaction.
Considering the problem of possible pollution between blockchain virtual machines loaded with different intelligent contracts, for example, a function of an intelligent contract B may be hung on a blockchain virtual machine loaded with the intelligent contract a and searched from a virtual machine pool, so that the intelligent contract a may call the function of the intelligent contract B when executing. To solve this problem, this embodiment further introduces a virtual machine pool, that is, a plurality of virtual machine pools are provided, where each virtual machine pool is used to store a blockchain virtual machine loaded with the same intelligent contract. Because the intelligent contracts loaded by the blockchain virtual machines stored in the same virtual machine pool are the same, the problem of pollution among contracts does not exist among the blockchain virtual machines stored in the same virtual machine pool.
Therefore, the target virtual machine can be obtained by searching the virtual machine pool associated with the intelligent contract identifier contained in the transaction and acquiring the block chain virtual machine in the idle state from the searched virtual machine pool.
The virtual machine pools may be stored in the memory space in a key-value pair manner, for example, a cache is maintained in the memory space with the smart contract identifier as a key and the virtual machine pool as a value. When the virtual machine pool associated with the intelligent contract identifier is searched, the intelligent contract identifier can be used as a key, and a corresponding value is searched in the memory space, so that the virtual machine pool associated with the intelligent contract identifier is obtained.
Searching the block chain virtual machine in the idle state in the searched virtual machine pool, if the block chain virtual machine in the idle state is determined not to be stored, newly building a block chain virtual machine loaded with a target intelligent contract in the virtual machine pool, acquiring the newly-built block chain virtual machine as the block chain virtual machine in the idle state, or waiting for the block chain virtual machine in the virtual machine pool to be switched from the non-idle state to the idle state.
It should be noted that the manner of obtaining the block chain virtual machine in the free state in the virtual machine pool may make a decision according to a first time length required for newly building the block chain virtual machine in the virtual machine pool and a second time length required for executing the transaction. The first duration and the second duration can be obtained by counting the duration consumed by the historical creation of the blockchain virtual machine and the duration consumed by the historical execution of the transaction.
For example, if the first duration is longer than the second duration, which indicates that the duration consumed by newly building the blockchain virtual machine in the virtual machine pool is longer than the duration consumed by executing the transaction, after the blockchain virtual machine loaded with the target intelligent contract in the virtual machine pool finishes executing the transaction being executed and is recycled into the virtual machine pool, the blockchain virtual machine is used as the target virtual machine for executing the transaction to be processed. If the first time length is less than the second time length, the time length consumed by newly building the block chain virtual machine in the virtual machine pool is less than the time length consumed by executing the transaction, so that a block chain virtual machine loaded with a target intelligent contract can be newly built in the virtual machine pool, and the newly built block chain virtual machine is used as a target virtual machine for executing the transaction to be processed.
Or in some embodiments, considering that the blockchain virtual machine in the virtual machine pool in the non-idle state has consumed a period of time for the transaction being executed, the period of time may be considered when deciding the manner of obtaining the blockchain virtual machine in the virtual machine pool in the idle state according to the first period of time and the second period of time. For example, the duration consumed by the blockchain virtual machine in the non-idle state in the virtual machine pool for the executed transaction is characterized by a preset duration threshold, and if the first duration is greater than the difference between the second duration and the duration threshold, the blockchain virtual machine in the virtual machine pool is waited to be switched from the non-idle state to the idle state. Since each virtual machine pool usually includes a plurality of blockchain virtual machines, and the execution schedules of the blockchain virtual machines for the transactions are not completely the same, the embodiment may set an appropriate duration threshold value in consideration of the execution schedules of the blockchain virtual machines.
Therefore, the blockchain virtual machines in the idle state in the virtual machine pool are obtained in a decision-making manner, and the blockchain virtual machines can be newly built in the virtual machine pool as few as possible, so that the number of the blockchain virtual machines is reduced, the memory space and the memory allocation times required by transaction execution are reduced, and the transaction execution efficiency of the blockchain system is not influenced, so that the performance of the blockchain system is further improved.
Step S133, if the target virtual machine is not found, creating a block chain virtual machine in the virtual machine pool, and loading the target intelligent contract into the created block chain virtual machine, so that the block chain virtual machine loaded with the target intelligent contract is used as the target virtual machine.
Creating a blockchain virtual machine in the virtual machine pool, and loading the target intelligent contract into the created blockchain virtual machine typically includes the following processes:
creating a virtual machine object in a virtual machine pool; compiling codes of the target intelligent contract into instruction codes, and configuring the instruction codes into a virtual machine object; and controlling the virtual machine object to execute the instruction codes so as to initialize the target intelligent contract in the virtual machine object, and taking the virtual machine object after the initialization as the block chain virtual machine loaded with the target intelligent contract.
The created virtual machine object may be, for example, a JavaScript object, and the compiled instruction code can be recognized and executed by the virtual machine object. The intelligent contract usually contains a large number of global variables such as Date, Math, String, Object, etc., and also contains a large number of public/private functions, for example, a complex intelligent contract may contain more than 80 functions, so the initialization of the target intelligent contract is performed in the virtual machine Object, and usually includes the initialization of the global variables and the declaration of the functions, etc.
The global variables are also mounted on the blockchain virtual machine, for example, all the global variables are mounted by specific fields contained in the blockchain virtual machine, so that the global variables can be conveniently inquired from the blockchain virtual machine.
Therefore, no matter whether the virtual machine pool has the blockchain virtual machine loaded with the target intelligent contract or not currently, one target virtual machine is finally searched from the virtual machine pool, and the to-be-processed transaction is executed through the target intelligent contract loaded in the target virtual machine, so that the reliability of transaction execution is ensured.
In another exemplary embodiment, based on the embodiment shown in fig. 2, the transaction processing method based on the blockchain virtual machine multiplexing further includes steps S210 to S230 shown in fig. 4, which are described in detail as follows:
step S210, obtaining the state information of the target virtual machine.
In order to prevent the pollution problem of the same intelligent contract between different transactions, in this embodiment, a multiplexing condition is also set for the recycling multiplexing of the blockchain virtual machine, and if the blockchain virtual machine does not meet the multiplexing condition, the blockchain virtual machine is not recycled.
The state information of the target virtual machine may include the global variables mounted in the target virtual machine and associated with the target intelligent contract, as described above, each blockchain virtual machine mounts the global variables of the intelligent contract loaded by itself through the specific field; the state information of the target virtual machine may further include an execution state of the target virtual machine, which is not limited in this embodiment.
In step S230, if it is determined that the target virtual machine does not meet the multiplexing condition according to the state information, the target virtual machine is deleted from the virtual machine pool.
In this embodiment, if it is determined that the target virtual machine does not meet the reuse condition, it indicates that the target virtual machine has been contaminated by the executed transaction. By deleting the target virtual machine from the virtual machine pool, the target virtual machine is destroyed, so that the target virtual machine is not reused.
For example, if the global variable mounted in the target virtual machine is different from the global variable mounted in the target virtual machine before being called, it indicates that the transaction modifies the global variable mounted in the target virtual machine, that is, modifies the intelligent contract loaded in the target virtual machine, and thus it is determined that the target virtual machine does not meet the multiplexing condition.
If the execution state of the target virtual machine indicates that the target virtual machine fails to execute the transaction, the target virtual machine is in an intermediate execution state, for example, the target virtual machine is abnormal when executing some instructions, and the target virtual machine is in a state when executing the instructions, thereby causing the target virtual machine to be contaminated by the executed transaction. In this case, it is also necessary to determine that the target virtual machine does not meet the multiplexing condition, and thus the target virtual machine is not multiplexed.
Therefore, the multiplexing condition is set for the recycling and multiplexing of the blockchain virtual machine in the embodiment, and the blockchain virtual machine multiplexed by the virtual pool can be ensured to be accurate, so that errors can not occur in the multiplexing process of the blockchain virtual machine, and the reliability of executing transactions by a blockchain system is further improved.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a transaction parallel execution application scenario based on blockchain virtual machine multiplexing according to an exemplary embodiment of the present application.
In the application scenario shown in fig. 5, the pending transaction includes multiple transactions contained in the pending chain block, and the multiple transactions are executed in parallel by multiple threads. Specifically, each thread takes an intelligent contract name and a version number contained in the transaction as keys, searches a corresponding virtual machine pool in a cache, and acquires a block chain virtual machine in an idle state from the virtual machine pool, if the block chain virtual machine does not exist in the virtual machine pool or the block chain virtual machine in the idle state does not exist in the virtual machine pool, a block chain virtual machine is newly established, and a target intelligent contract capable of executing the current transaction is loaded. Each thread calls the blockchain virtual machine in an idle state to transfer the transaction into an intelligent contract loaded by the blockchain virtual machine, and the transaction is executed through the intelligent contract. And after each A and B is executed, obtaining a corresponding transaction execution result, and recycling the block chain virtual machine to the virtual machine pool for multiplexing of subsequent transactions. And finally, combining the transaction execution results corresponding to all transactions in series to obtain the transaction execution result corresponding to the whole block to be linked. The transaction execution result corresponding to the block to be uplink linked can act on the processes of common identification, uplink linking and the like of the block to be uplink linked, and the processes are not limited here.
In the application scenario shown in fig. 5, based on the multiplexing mechanism of the blockchain virtual machine, the multiple threads do not need to create a blockchain virtual machine loaded with the target intelligent contract for each transaction, but preferentially use the multiplexed blockchain virtual machine to execute the transaction, so that time consumed by transaction execution is greatly saved, and the memory space and the memory allocation frequency required to be allocated in the transaction execution process can also be greatly reduced. Meanwhile, by setting the virtual machine pool group in the cache, the problem of contract pollution in the block chain virtual machine can be avoided. In addition, the recycling and reusing of the block chain virtual machine which executes the transaction are also provided with reusing conditions, so that the problem that the block chain virtual machine is polluted by different transactions can be avoided. Therefore, a very reliable transaction parallel execution system can be obtained.
The inventor of the present application takes the transaction of the blockchain electronic invoice as an example, executes the transaction of the electronic invoice using an electronic device with an 8-core 16G memory according to the transaction processing method based on the blockchain virtual machine multiplexing proposed by the present application, and counts TPS, allocated memory space, and memory allocation times in the execution process of the transaction of the electronic invoice. The inventor also uses the same electronic equipment to execute the same electronic invoice transaction according to the prior art, namely, a block chain virtual machine is newly established for each transaction, and TPS, allocated memory space and memory allocation times in the electronic invoice transaction execution process are still counted. By comparing the data counted during the execution of the electronic invoice transaction, the information shown in table 1 below can be obtained.
Figure 761388DEST_PATH_IMAGE003
As can be seen from table 1, the transaction processing method based on the multiplexing of the blockchain virtual machine according to the present application can greatly improve the TPS for processing the transaction by the blockchain system, and can greatly reduce the memory space required to be allocated and the number of times of memory allocation in the transaction processing process, thereby greatly improving the performance of the blockchain system.
Fig. 6 is a block diagram illustrating a transaction processing device based on blockchain virtual machine multiplexing according to an exemplary embodiment of the present application. As shown in fig. 6, the apparatus includes:
a transaction acquisition module 310 configured to acquire a transaction to be processed; the virtual machine searching module 330 is configured to search a target virtual machine from a virtual machine pool according to an intelligent contract identifier included in the transaction, wherein the virtual machine pool is used for storing a block chain virtual machine loaded with an intelligent contract, and the target virtual machine is loaded with a target intelligent contract indicated by the intelligent contract identifier; a transaction execution module 350 configured to invoke the target virtual machine to execute a transaction through the target intelligent contract loaded in the target virtual machine; a call termination module 370 configured to terminate the call to the target virtual machine after the transaction is performed, the terminating called target virtual machine waiting for reuse in the pool of virtual machines.
In another exemplary embodiment, the virtual machine lookup module 330 includes:
the searching unit is configured to search a target virtual machine loaded with a target intelligent contract indicated by the intelligent contract identification in the virtual machine pool; and the newly-built unit is configured to create a block chain virtual machine in the virtual machine pool if the target virtual machine is not found, and load the target intelligent contract into the created block chain virtual machine so as to take the block chain virtual machine loaded with the target intelligent contract as the target virtual machine.
In another exemplary embodiment, the newly building unit includes:
a virtual machine object creating subunit configured to create a virtual machine object in the virtual machine pool; the instruction compiling subunit is configured to compile codes of the target intelligent contract into instruction codes and configure the instruction codes into the virtual machine object; and the initialization sub-unit is configured to control the virtual machine object to execute the instruction codes so as to initialize the target intelligent contract in the virtual machine object, and the virtual machine object after the initialization is used as the block chain virtual machine loaded with the target intelligent contract.
In another exemplary embodiment, the initialization of the target intelligent contract includes the initialization of global variables in the target intelligent contract and the declaration of functions in the target intelligent contract.
In another exemplary embodiment, the number of the virtual machine pools is multiple, and each virtual machine pool is used for storing the blockchain virtual machines loaded with the same intelligent contract; the search unit includes:
a virtual machine pool finding unit configured to find a virtual machine pool associated with the intelligent contract identifier; and the virtual machine obtaining unit is configured to obtain the block chain virtual machine in the idle state from the searched virtual machine pool, and take the obtained block chain virtual machine as a target virtual machine.
In another exemplary embodiment, a plurality of virtual machine pools are stored in a memory space in a key-value pair manner; the virtual machine pool searching unit comprises:
and the key value searching subunit is configured to search a value corresponding to the key in the memory space by taking the intelligent contract identifier as the key to obtain a virtual machine pool associated with the intelligent contract identifier.
In another exemplary embodiment, the virtual machine acquisition unit includes:
the virtual machine searching subunit is configured to search the block chain virtual machine in the idle state in the virtual machine pool; and the virtual machine selection subunit is configured to, if it is determined that the block chain virtual machine in the idle state does not exist, newly establish a block chain virtual machine loaded with the target intelligent contract in the virtual machine pool, acquire the newly established block chain virtual machine as the block chain virtual machine in the idle state, or wait for the block chain virtual machine in the virtual machine pool to be switched from the non-idle state to the idle state.
In another exemplary embodiment, the virtual machine selection subunit includes:
the decision subunit is configured to acquire a first time length required by a newly-built block chain virtual machine in the virtual machine pool, acquire a second time length required by transaction execution, and decide a way of acquiring a block chain virtual machine in an idle state in the virtual machine pool according to the first time length and the second time length.
In another exemplary embodiment, the apparatus further comprises:
the state information acquisition module is configured to acquire state information of the target virtual machine; and the virtual machine deleting module is configured to delete the target virtual machine from the virtual machine pool if the target virtual machine is determined not to meet the multiplexing condition according to the state information.
In another exemplary embodiment, the state information includes a global variable associated with the target intelligent contract mounted in the target virtual machine; the device also includes:
the first multiplexing condition judgment module is configured to determine that the target virtual machine does not meet the multiplexing condition if the global variable mounted in the target virtual machine is different from the global variable mounted by the target virtual machine before being called.
In another exemplary embodiment, the state information includes a transaction execution state of the target virtual machine; the device also includes:
and the second multiplexing condition judgment module is configured to determine that the target virtual machine does not accord with the multiplexing condition if the execution state of the target virtual machine indicates that the target virtual machine fails to execute the transaction.
In another exemplary embodiment, the pending transactions include a plurality of transactions contained in the pending chain block; the device also includes:
the execution result acquisition module is configured to acquire a transaction execution result corresponding to each transaction; and the execution result merging module is configured to serially merge the transaction execution results corresponding to the multiple transactions contained in the block to be uplink, so as to obtain the transaction execution result corresponding to the block to be uplink.
It should be noted that the apparatus provided in the foregoing embodiment and the method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit execute operations has been described in detail in the method embodiment, and is not described again here.
Embodiments of the present application further provide an electronic device, including a processor and a memory, where the memory has stored thereon computer-readable instructions, and the computer-readable instructions, when executed by the processor, implement the transaction processing method based on the blockchain virtual machine multiplexing as described above.
FIG. 7 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application. It should be noted that the computer system 1600 of the electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, computer system 1600 includes a Central Processing Unit (CPU) 1601, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1602 or a program loaded from a storage portion 1608 into a Random Access Memory (RAM) 1603. In the RAM 1603, various programs and data necessary for system operation are also stored. The CPU 1601, ROM 1602, and RAM 1603 are connected to each other via a bus 1604. An Input/Output (I/O) interface 1605 is also connected to the bus 1604.
The following components are connected to the I/O interface 1605: an input portion 1606 including a keyboard, a mouse, and the like; an output section 1607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 1608 including a hard disk and the like; and a communication section 1609 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1609 performs communication processing via a network such as the internet. The driver 1610 is also connected to the I/O interface 1605 as needed. A removable medium 1611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1610 as necessary, so that a computer program read out therefrom is mounted in the storage portion 1608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1609, and/or installed from the removable media 1611. When the computer program is executed by a Central Processing Unit (CPU) 1601, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the transaction processing method based on blockchain virtual machine multiplexing as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the transaction processing method based on the blockchain virtual machine multiplexing provided in the above embodiments.
The above description is only a preferred exemplary embodiment of the present application, and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A transaction processing method based on block chain virtual machine multiplexing is characterized by comprising the following steps:
acquiring a transaction to be processed;
searching a target virtual machine from a virtual machine pool according to an intelligent contract identifier contained in the transaction, wherein the virtual machine pool is used for storing a block chain virtual machine loaded with an intelligent contract, and the target virtual machine is loaded with a target intelligent contract indicated by the intelligent contract identifier;
invoking the target virtual machine to execute the transaction through a target smart contract loaded in the target virtual machine;
terminating the invocation of the target virtual machine after the transaction is executed, the target virtual machine terminating invocation waiting for reuse in the virtual machine pool;
acquiring state information of the target virtual machine;
if the target virtual machine is determined to be not in accordance with the multiplexing condition according to the state information, deleting the target virtual machine from the virtual machine pool;
the state information includes a global variable mounted in the target virtual machine and associated with the target intelligent contract, and if the global variable mounted in the target virtual machine is different from the global variable mounted before the target virtual machine is called, it is determined that the target virtual machine does not meet the multiplexing condition.
2. The method of claim 1, wherein said searching for a target virtual machine from a pool of virtual machines based on an intelligent contract identifier included in the transaction comprises:
searching a target virtual machine loaded with a target intelligent contract indicated by the intelligent contract identification in the virtual machine pool;
if the target virtual machine is not found, creating a block chain virtual machine in the virtual machine pool, and loading the target intelligent contract into the created block chain virtual machine so as to take the block chain virtual machine loaded with the target intelligent contract as the target virtual machine.
3. The method of claim 2, wherein creating a blockchain virtual machine in the pool of virtual machines, and loading the target smart contract into the created blockchain virtual machine comprises:
creating a virtual machine object in the pool of virtual machines;
compiling codes of the target intelligent contract into instruction codes, and configuring the instruction codes into the virtual machine object;
and controlling the virtual machine object to execute the instruction code so as to initialize the target intelligent contract in the virtual machine object, and taking the virtual machine object after the initialization as the block chain virtual machine loaded with the target intelligent contract.
4. The method in accordance with claim 3, wherein the initialization of the target intelligent contract comprises initialization of global variables in the target intelligent contract and declaration of functions in the target intelligent contract.
5. The method according to claim 2, wherein the number of the virtual machine pools is multiple, and each virtual machine pool is used for storing a blockchain virtual machine loaded with the same intelligent contract; the searching for the target virtual machine loaded with the target intelligent contract indicated by the intelligent contract identifier in the virtual machine pool includes:
searching a virtual machine pool associated with the intelligent contract identification;
and acquiring the block chain virtual machine in an idle state from the searched virtual machine pool, and taking the acquired block chain virtual machine as the target virtual machine.
6. The method of claim 5, wherein the plurality of virtual machine pools are stored in a memory space in a key-value pair manner; the searching for the virtual machine pool associated with the intelligent contract identification comprises:
and taking the intelligent contract identifier as a key, and searching a value corresponding to the key in the memory space to obtain a virtual machine pool associated with the intelligent contract identifier.
7. The method according to claim 5, wherein the obtaining the blockchain virtual machine in the free state from the searched virtual machine pool comprises:
searching a block chain virtual machine in an idle state in the virtual machine pool;
if the block chain virtual machine in the idle state is determined not to be stored, newly building a block chain virtual machine loaded with the target intelligent contract in the virtual machine pool, and acquiring the newly built block chain virtual machine as the block chain virtual machine in the idle state, or waiting for the block chain virtual machine in the virtual machine pool to be switched from the non-idle state to the idle state.
8. The method of claim 7, wherein after determining that there is no blockchain virtual machine in an idle state, the method further comprises:
acquiring a first time length required by a newly-built block chain virtual machine in the virtual machine pool and a second time length required by transaction execution;
and deciding to acquire the mode of the block chain virtual machine in the idle state in the virtual machine pool according to the first duration and the second duration.
9. The method of claim 1, wherein the state information includes a transaction execution state of the target virtual machine; the method further comprises the following steps:
and if the execution state of the target virtual machine indicates that the target virtual machine fails to execute the transaction, determining that the target virtual machine does not meet the multiplexing condition.
10. The method according to any one of claims 1 to 9, wherein the pending transactions include a plurality of transactions contained in a pending uplink block; the method further comprises the following steps:
acquiring a transaction execution result corresponding to each transaction;
and serially combining the transaction execution results corresponding to the multiple transactions contained in the block to be uplink-linked to obtain the transaction execution result corresponding to the block to be uplink-linked.
11. A transaction processing apparatus based on blockchain virtual machine multiplexing, comprising:
a transaction acquisition module configured to acquire a transaction to be processed;
a virtual machine searching module configured to search a target virtual machine from a virtual machine pool according to an intelligent contract identifier included in the transaction, where the virtual machine pool is used to store a block chain virtual machine loaded with an intelligent contract, and the target virtual machine is loaded with a target intelligent contract indicated by the intelligent contract identifier;
a transaction execution module configured to invoke the target virtual machine to execute the transaction through a target smart contract loaded in the target virtual machine;
a call termination module configured to terminate the call to the target virtual machine after the transaction is executed, the target virtual machine terminating the call waiting for reuse in the virtual machine pool;
the state information acquisition module is configured to acquire the state information of the target virtual machine;
the virtual machine deleting module is configured to delete the target virtual machine from the virtual machine pool if the target virtual machine is determined to be not in accordance with the multiplexing condition according to the state information;
the state information includes a global variable mounted in the target virtual machine and associated with the target intelligent contract, and if the global variable mounted in the target virtual machine is different from the global variable mounted before the target virtual machine is called, it is determined that the target virtual machine does not meet the multiplexing condition.
12. The apparatus of claim 11, wherein the virtual machine lookup module comprises:
a searching unit configured to search a target virtual machine loaded with a target intelligent contract indicated by the intelligent contract identifier in the virtual machine pool;
and the newly-built unit is configured to create a block chain virtual machine in the virtual machine pool if the target virtual machine is not found, and load the target intelligent contract into the created block chain virtual machine so as to take the block chain virtual machine loaded with the target intelligent contract as the target virtual machine.
13. The apparatus of claim 12 wherein said newly created unit comprises:
a virtual machine object creation subunit configured to create a virtual machine object in the virtual machine pool;
an instruction code compiling subunit configured to compile a code of the target intelligent contract into an instruction code, and configure the instruction code into the virtual machine object;
and the initialization subunit is configured to control the virtual machine object to execute the instruction code, so as to initialize the target intelligent contract in the virtual machine object, and use the virtual machine object after the initialization as the block chain virtual machine loaded with the target intelligent contract.
14. An electronic device, comprising:
a memory storing computer readable instructions;
a processor reading computer readable instructions stored by the memory to perform the method of any of claims 1-10.
15. A computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the method of any one of claims 1-10.
CN202110176859.8A 2021-02-07 2021-02-07 Transaction processing method and device based on block chain virtual machine multiplexing Active CN112529711B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110176859.8A CN112529711B (en) 2021-02-07 2021-02-07 Transaction processing method and device based on block chain virtual machine multiplexing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110176859.8A CN112529711B (en) 2021-02-07 2021-02-07 Transaction processing method and device based on block chain virtual machine multiplexing

Publications (2)

Publication Number Publication Date
CN112529711A CN112529711A (en) 2021-03-19
CN112529711B true CN112529711B (en) 2021-05-14

Family

ID=74975527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110176859.8A Active CN112529711B (en) 2021-02-07 2021-02-07 Transaction processing method and device based on block chain virtual machine multiplexing

Country Status (1)

Country Link
CN (1) CN112529711B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805889B (en) * 2021-08-27 2023-07-28 成都质数斯达克科技有限公司 Intelligent contract calling execution method, device, equipment and readable storage medium
CN115174589B (en) * 2022-05-20 2023-11-03 网易(杭州)网络有限公司 Selection method and device of blockchain virtual machine, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168310A (en) * 2014-07-24 2014-11-26 深圳天珑无线科技有限公司 Method and apparatus for scheduling cloud end vertual server
CN104281496A (en) * 2014-10-27 2015-01-14 深圳中兴网信科技有限公司 Virtual resource distribution method and virtual resource distribution device
CN106133688A (en) * 2014-03-28 2016-11-16 亚马逊技术有限公司 Coordinate the enforcement of the service of container layout and execution
CN107111507A (en) * 2014-09-30 2017-08-29 亚马逊技术有限公司 It is threading to be used as service
CN110297689A (en) * 2019-05-06 2019-10-01 百度在线网络技术(北京)有限公司 Intelligent contract executes method, apparatus, equipment and medium
CN110392052A (en) * 2019-07-22 2019-10-29 中国工商银行股份有限公司 A kind of block chain intelligence contract processing system and method
CN110704063A (en) * 2019-09-30 2020-01-17 支付宝(杭州)信息技术有限公司 Method and device for compiling and executing intelligent contract
CN111736954A (en) * 2020-06-24 2020-10-02 陈鹏 Multi-intelligent contract virtual machine implementation method, multi-intelligent contract virtual machine and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471775B1 (en) * 2015-02-04 2016-10-18 Amazon Technologies, Inc. Security protocols for low latency execution of program code
CN106598549B (en) * 2016-12-08 2019-02-01 天津米游科技有限公司 A kind of intelligent contract system and implementation method based on block chain
CN107707661B (en) * 2017-10-16 2020-10-16 中国银联股份有限公司 Load balancing resource management method and device
CN110602125B (en) * 2019-09-23 2021-04-13 腾讯科技(深圳)有限公司 Data processing method, device, terminal and storage medium
CN111124617B (en) * 2019-12-24 2021-03-16 腾讯科技(深圳)有限公司 Method and device for creating block chain system, storage medium and electronic device
CN111989663A (en) * 2020-06-08 2020-11-24 支付宝实验室(新加坡)有限公司 Intelligent contract pool based on block chain
CN111736957A (en) * 2020-06-29 2020-10-02 平安普惠企业管理有限公司 Multi-type service mixed deployment method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106133688A (en) * 2014-03-28 2016-11-16 亚马逊技术有限公司 Coordinate the enforcement of the service of container layout and execution
CN104168310A (en) * 2014-07-24 2014-11-26 深圳天珑无线科技有限公司 Method and apparatus for scheduling cloud end vertual server
CN107111507A (en) * 2014-09-30 2017-08-29 亚马逊技术有限公司 It is threading to be used as service
CN104281496A (en) * 2014-10-27 2015-01-14 深圳中兴网信科技有限公司 Virtual resource distribution method and virtual resource distribution device
CN110297689A (en) * 2019-05-06 2019-10-01 百度在线网络技术(北京)有限公司 Intelligent contract executes method, apparatus, equipment and medium
CN110392052A (en) * 2019-07-22 2019-10-29 中国工商银行股份有限公司 A kind of block chain intelligence contract processing system and method
CN110704063A (en) * 2019-09-30 2020-01-17 支付宝(杭州)信息技术有限公司 Method and device for compiling and executing intelligent contract
CN111736954A (en) * 2020-06-24 2020-10-02 陈鹏 Multi-intelligent contract virtual machine implementation method, multi-intelligent contract virtual machine and system

Also Published As

Publication number Publication date
CN112529711A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
EP2454666B1 (en) Fault tolerant batch processing
CN112529711B (en) Transaction processing method and device based on block chain virtual machine multiplexing
CN110225078B (en) Application service updating method, system and terminal equipment
CN110764913B (en) Data calculation method based on rule calling, client and readable storage medium
CN111694638A (en) Rule package loading method, rule package executing method and terminal equipment
CN110162344B (en) Isolation current limiting method and device, computer equipment and readable storage medium
CN113377348A (en) Task adjustment method applied to task engine, related device and storage medium
CN113360893B (en) Container-based intelligent contract execution method and device and storage medium
CN109683992B (en) Method and apparatus for managing objects
CN108520401B (en) User list management method, device, platform and storage medium
US9626213B2 (en) System and method for file injection in virtual machine configuration
CN107391539B (en) Transaction processing method, server and storage medium
CN107045452B (en) Virtual machine scheduling method and device
CN111988429A (en) Algorithm scheduling method and system
CN111176641A (en) Flow node execution method, device, medium and electronic equipment
CN113360251B (en) Intelligent contract execution and cross-contract calling method, device and storage medium
CN112115738A (en) Image identification method and device applied to browser end
CN115658332A (en) GPU (graphics processing Unit) sharing method and device, electronic equipment and storage medium
CN115185979A (en) Data access routing method, apparatus device, storage medium and program product
CN110033145B (en) Financial sharing job order separating method and device, equipment and storage medium
CN111897822A (en) Account state information processing method and device, electronic equipment and storage medium
CN111475226B (en) Electronic device, micro-service calling method, and computer-readable storage medium
CN112214287A (en) Service control method and device of application software and electronic equipment
CN115484149B (en) Network switching method, network switching device, electronic equipment and storage medium
CN113360252B (en) Container-based accelerated intelligent contract execution method and device and storage medium

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
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40041048

Country of ref document: HK