CN113222572A - Transaction execution method and device - Google Patents

Transaction execution method and device Download PDF

Info

Publication number
CN113222572A
CN113222572A CN202110507086.7A CN202110507086A CN113222572A CN 113222572 A CN113222572 A CN 113222572A CN 202110507086 A CN202110507086 A CN 202110507086A CN 113222572 A CN113222572 A CN 113222572A
Authority
CN
China
Prior art keywords
account
target
target transaction
transaction
deduction
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
Application number
CN202110507086.7A
Other languages
Chinese (zh)
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110507086.7A priority Critical patent/CN113222572A/en
Publication of CN113222572A publication Critical patent/CN113222572A/en
Pending legal-status Critical Current

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/085Payment architectures involving remote charge determination or related payment systems
    • G06Q20/0855Payment architectures involving remote charge determination or related payment systems involving a third party
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, 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/405Establishing or using transaction specific rules

Abstract

A transaction execution method and device are applied to node equipment on a blockchain, and the method comprises the following steps: receiving a target transaction to be executed sent by a client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction; deducting virtual resources corresponding to the target transaction from a target deduction account indicated by the first account identification; and, executing the target transaction.

Description

Transaction execution method and device
Technical Field
The present disclosure relates to the field of computer applications, and in particular, to a method and an apparatus for executing a transaction.
Background
The block chain technology, also called as distributed ledger technology, is an emerging technology in which a plurality of computing devices participate in 'accounting' together, and a complete distributed database is maintained together, and has the characteristics of decentralization, public transparency, participation of each computing device in database recording, and rapid data synchronization among the computing devices. The user can construct a standard transaction (transaction) supported by the blockchain and issue the transaction to the blockchain for execution, and information contained in the transaction is packaged into the block, so that persistent certificate storage in the blockchain can be completed.
In practical application, in order to prevent malicious users from abusing transactions on a blockchain, a virtual resource can be deducted from a user account initiating the transaction as a fee for each transaction to be executed, and the collected fee can be further distributed to a computing device participating in blockchain packaging as an award; although the mechanism achieves the purpose of blocking malicious users to a certain extent and stimulates the block packaging computing equipment, the threshold of initiating transactions on a block chain by a new user is also improved, and the expansion of services is not facilitated.
Disclosure of Invention
In view of the above, the present specification discloses a transaction execution method and apparatus.
According to a first aspect of embodiments herein, a transaction execution method is disclosed, which is applied to a node device on a blockchain, and the method includes:
receiving a target transaction to be executed sent by a client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction;
deducting virtual resources corresponding to the target transaction from a target deduction account indicated by the first account identification; and the number of the first and second groups,
the target transaction is executed.
According to a second aspect of the embodiments of the present specification, there is disclosed a transaction execution apparatus applied to a node device on a blockchain, the apparatus including:
the receiving module is used for receiving the target transaction to be executed sent by the client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction;
the deduction module deducts virtual resources corresponding to the target transaction from the target deduction account indicated by the first account identification;
and the execution module executes the target transaction.
In the above technical solution, since the target transaction to be executed carries the first account id indicating the target deduction account for deducting the virtual resources consumed for executing the target transaction, the node device in the block chain may deduct the virtual resources consumed for executing the target transaction from the target deduction account of the corresponding third party according to the first account id, but not limited to deduction from the user account corresponding to the client, so that the block chain usage threshold caused by deducting the virtual resources may be reduced, which is beneficial to expansion of the block chain service.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this specification and together with the description, serve to explain the principles.
FIG. 1 is a flow chart illustrating a method of performing a transaction as described herein;
FIG. 2 is a schematic diagram of an operation scenario of a decentralized application according to the present description;
FIG. 3 is a swim-lane diagram of the uplink transaction flow in a decentralized application scenario described herein;
FIG. 4 is a diagram illustrating an exemplary configuration of a transaction execution device according to the present disclosure;
fig. 5 is a diagram illustrating an exemplary configuration of a computer device for transaction execution according to the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure. It is to be understood that the described embodiments are only a few, and not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from one or more embodiments of the disclosure without making any creative effort shall fall within the scope of the disclosure.
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 specification. Rather, they are merely examples of systems and methods consistent with certain aspects of the present description, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The block chain is usually composed of a plurality of blocks, time stamps corresponding to the creation time of the block are recorded in the blocks, and all the blocks form a time-ordered data chain according to the time stamps recorded in the blocks. The real data generated by the physical world can be constructed into a standard transaction (transaction) format supported by a block chain, then is issued to the block chain, the node equipment in the block chain performs consensus processing on the received transaction, and after the consensus is achieved, the node equipment serving as an accounting node in the block chain packs the transaction into a block and performs persistent evidence storage in the block chain.
In practical application, in order to prevent malicious users from abusing transactions on a blockchain, a virtual resource can be deducted from a user account initiating the transaction as a fee for each transaction to be executed, and the collected fee can be further distributed to a computing device participating in blockchain packaging as an award;
for example, in an ethernet-based blockchain network, the virtual resource for performing transaction deduction is called a fuel Gas, and the fuel Gas has a certain value; when the transaction needs to be executed, the corresponding amount of fuel Gas can be collected from the account of the initiator of the transaction according to the amount of computing resources occupied by the transaction, and the collected fuel Gas is rewarded to the computing equipment which is packaged by the blocks corresponding to the transaction. For a malicious user trying to initiate a large amount of garbage transactions to consume the resources of the blockchain network, under the action of the above mechanism, the malicious user must pay a large amount of fuel Gas to actually "uplink" the large amount of garbage transactions; therefore, the mechanism can block malicious users to some extent.
Correspondingly, however, the mechanism also raises the threshold for a new user to initiate a transaction on the blockchain; for a new user who has just joined the blockchain, there may not be a sufficient amount of fuel Gas in his account, and therefore the kind and number of transactions he can initiate may be severely limited, in fact blocking the new user from using the blockchain, and thus not contributing to the expansion of the service.
Based on this, the present specification proposes a technical solution that, when executing a target transaction, a target deduction account different from a user account as a transaction initiator is used to complete deduction of virtual resources corresponding to the target transaction, so that the user account as the transaction initiator does not need to pay for the virtual resources corresponding to the target transaction.
In implementation, two different account identifiers can be carried in a target transaction to be executed, and are respectively used for indicating a user account used as a transaction initiator and a target deduction account used for deducting virtual resources consumed by executing the target transaction; when the target transaction is executed, the tasks of deducting the virtual resources and initiating the transaction are respectively and correspondingly completed by taking the two accounts as main bodies according to the two different account identifications.
In the above technical solution, since the target transaction to be executed carries the first account id indicating the target deduction account for deducting the virtual resources consumed for executing the target transaction, the node device in the block chain may deduct the virtual resources consumed for executing the target transaction from the target deduction account of the corresponding third party according to the first account id, but not limited to deduction from the user account corresponding to the client, so that the block chain usage threshold caused by deducting the virtual resources may be reduced, which is beneficial to expansion of the block chain service.
The present specification is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 1, fig. 1 is a flowchart illustrating a transaction execution method according to the present disclosure; the method can be applied to a node device on a block chain, and the method can include the following steps:
s101, receiving a target transaction to be executed sent by a client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction;
s102, deducting virtual resources corresponding to the target transaction from the target deduction account indicated by the first account identification; and the number of the first and second groups,
s103, executing the target transaction.
The block chain can comprise any form of block chain; those skilled in the art can select the type of blockchain to which the present scheme is applied according to specific requirements and characteristics of different types of blockchains.
Blockchains are generally divided into three types: public chain (Public Blockchain), Private chain (Private Blockchain) and alliance chain (Consortium Blockchain). Furthermore, there may be a combination of the above types, such as private chain + federation chain, federation chain + public chain, and so on.
Among them, the most decentralized is the public chain. The public chain is represented by bitcoin and ether house, and participants (also called nodes in the block chain) joining the public chain can read data records on the chain, participate in transactions, compete for accounting rights of new blocks, and the like. Moreover, each node can freely join or leave the network and perform related operations.
Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain may be a weakly centralized system with strict restrictions on nodes and a small number of nodes. This type of blockchain is more suitable for use within a particular establishment.
A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; the nodes are authorized to join the network and form a benefit-related alliance, and block chain operation is maintained together.
In one embodiment shown, the blockchain may be a federation chain; a federation chain may be a compromise option because it may provide a higher specification of security and decentralization level than a private chain, with higher operating efficiency and lower operating cost than a purely public chain.
In this specification, as described in step S101, the above block chain node device may first receive a target transaction to be executed; the target transaction may carry two account identifiers, specifically, the second account identifier may indicate a user account used as a transaction initiator, and the first account identifier may indicate a target deduction account used for deducting virtual resources consumed for executing the target transaction; for example, if the user zhang san wishes to use its own account as an initiator of the target transaction and uses the account of lie si as a target deduction account for deducting the virtual resources consumed for executing the target transaction, the identifier of zhang san own account may be used as the second account identifier, and the identifier of lie si account may be carried in the target transaction as the first account identifier.
In practical applications, the initiator of the transaction may not be specified by the client; for example, for some target transactions with privacy requirements, the transaction initiator may use the default account provided by the blockchain system, so as to avoid revealing the privacy of the client, in this case, the client does not need to provide the user account as the transaction initiator; therefore, the target transaction initiated by the client may not carry the second account id.
It can be understood that, although the address of the account is usually used as the identifier of the account in the blockchain, in practical applications, the second account identifier and the first account identifier are not necessarily the plaintext of the account address in the blockchain, but may also be the encrypted ciphertext, so as to further ensure the security of the data and avoid the risk of information leakage after the target transaction is intercepted accidentally.
It can also be understood that the process of receiving the target transaction by the block link node device may be directly obtaining the target transaction from a client connected to the node device, or indirectly obtaining the target transaction constructed by a client connected to the server from a server connected to the node device.
For example, the server may be a BaaS (block chain as a Service) platform established by relying on a block chain, which may avoid performance and security problems caused by direct docking of too many clients to the block chain, and may also provide services related to the block chain for the clients at a lower cost.
In this specification, as stated in step S102, the blockchain node device may deduct a virtual resource corresponding to the target transaction from a target deduction account of a third party indicated by the first account identifier; specifically, the virtual resource corresponding to the target transaction may be a virtual resource that needs to be consumed to execute the target transaction; the target deduction account of the third party can be a target deduction account provided by a third party which is independent of the client terminal as the first party and the block chain device as the second party; the specific way of deducting the virtual resource may be to complete a transfer from the target deduction account indicated by the first account identifier to a public temporary account, or to directly delete part of the virtual resource to be deducted from the assets of the target deduction account; that is, the virtual resource may be a virtual token that is anchored to an offline asset and can only be transferred between accounts, a credit that can be directly deleted, or the like, and this specification does not need to be limited in detail.
It will be appreciated that although the foregoing related art mentions that virtual resources deducted as a result of performing a transaction may be issued to a computing device participating in tile packaging, this is only an alternative design; for example, the virtual resource may be a transaction execution count of 100 times for 00:00 completed transactions per day, which is deducted by 1 each time a transaction is executed, and the mechanism still satisfies the definition of deducting the virtual resource consumed by executing the target transaction, but it is obvious that the manager of the block chain may specify that the count cannot be transferred between accounts.
In a specific embodiment shown, a plurality of deduction accounts may be preset under the mechanism, a target deduction account corresponding to the first account identifier is determined from the plurality of deduction accounts according to the first account identifier, and then virtual resources corresponding to the target transaction are deducted from the determined target deduction account; continuing to take the example that the user zhang three wishes to execute the transaction built by himself on the blockchain, the user may agree in advance, if the first account identifier is "1", the corresponding virtual resource is deducted from the account of lie four, and if the first account identifier is "0", the corresponding virtual resource is deducted from the account of king five; although the above "1" and "0" are obviously not complete account addresses on the block chain, on the premise that the deduction account of lie four and king five is preset, the above first account identifier may also serve as the indication of the target deduction account.
It can be understood that if the above-mentioned scheme is generalized, for example, in the case of three Zhang needs to issue a large number of transactions, corresponding virtual resources can be deducted from a plurality of preset deduction accounts in turn, so that the number of accesses to the same deduction account in a short time can be reduced, which is beneficial to improving concurrency performance.
In an embodiment shown, the amount of the virtual resource corresponding to the target transaction may be obtained through a conversion relation carried in the target transaction; specifically, the target transaction also carries a conversion relationship between a virtual resource corresponding to the target transaction and a system resource of the node device consumed for executing the target transaction; before deducting the virtual resource corresponding to the target transaction, the blockchain device may first obtain the amount of the system resource of the node device consumed for executing the target transaction; and then, based on the conversion relation, converting the number of the system resources of the node equipment consumed by executing the target transaction to obtain the number of the virtual resources corresponding to the target transaction.
For example, assuming that the target transaction may carry a conversion relationship such as "the system resource consumed by executing 1 instruction corresponds to the virtual resource of X units", the number of the system resource of the node device consumed by executing the target transaction may be further converted by determining the number of the system resource of the node device consumed by executing the target transaction only through code analysis, execution counting, and the like.
In this way, the client can control the amount of the virtual resources corresponding to the target transaction by adjusting the conversion relation, so as to exercise a part of pricing right, and can obtain reasonable incentive for the computing equipment receiving the virtual resources under the condition that the virtual resources are transferable and valuable chain assets.
In another illustrated embodiment, the amount of the virtual resource corresponding to the target transaction may also be obtained through a conversion relationship corresponding to a value anchor relationship preset in the blockchain; specifically, the system resource carried by the node device may be value-anchored with a virtual resource published on the block chain; before deducting the virtual resource corresponding to the target transaction, the blockchain device may first obtain the amount of the system resource of the node device consumed for executing the target transaction; and then based on the conversion relation obtained by anchoring the value, the number of the system resources of the node equipment consumed by executing the target transaction is converted to obtain the number of the virtual resources corresponding to the target transaction.
For example, assuming that the conversion relationship obtained by the value anchoring is "virtual resources corresponding to Y units per 1KB of storage resources consumed", the amount of the storage resources of the node device consumed for executing the target transaction is determined only by code analysis, execution count, and the like, and the amount of the virtual resources corresponding to the target transaction can be further converted.
By the method, the block chain can exercise pricing right, the public reliability of the block chain as an internet infrastructure is improved, and the method is beneficial for business participants to reasonably estimate the consumption of virtual resources. In this specification, as described in step S103, the blockchain node device may perform the target transaction; specifically, when the blockchain node agrees with another node and executes the target transaction, it is usually necessary to record an initiator of the target transaction, so that, in a case that the target transaction also carries a second account identifier indicating a user account, the user account corresponding to the second account identifier in the target transaction may be used as the transaction initiator to complete execution of the target transaction. It will be understood, of course, that as described above, the initiator account for the target transaction may also be provided by the blockchain itself, so that the target transaction need not be required to carry the second account identifier; those skilled in the art can further refine the details of performing the target transaction according to specific needs and related technical documents, and further details need not be further described in this specification.
It is understood that, the execution sequence of the step S102 and the step S103 is not limited in this specification; that is, the step S102 may be executed first, and then the step S103 may be executed, the step S103 may be executed first, and then the step S102 may be executed, or both may be executed simultaneously; moreover, when the step S102 and the step S103 are executed successively, the time difference between the two steps can be flexibly designed according to specific requirements.
For example, when implementing the above scheme, a person skilled in the art may first complete the operation of deducting the virtual resource in step S102, and then execute the operation of executing the target transaction in step S103, so as to preferentially ensure smooth payment of the virtual resource; it may also be required to complete the operation of executing the target transaction in step S103 first and then execute the operation of deducting the virtual resource in step S102, so as to preferentially ensure the smooth execution of the target transaction.
As described above, the above scheme can transfer the obligation of deducting virtual resources when executing target transaction from the user's own account to other deduction accounts, thereby reducing the threshold of new user accessing the blockchain service; in practical applications, the above scheme may also be adopted in the operation of decentralized applications.
In an embodiment shown, please refer to fig. 2, fig. 2 is a schematic view of an operation scenario of the decentralized application described in this specification, in which a plurality of clients (Dapp clients) of the decentralized application may be connected to a service end (Dapp service end) of the decentralized application, and the service end may be connected to the blockchain; the client may include a decentralized application; the target deduction account may include a deduction account corresponding to the service provider of the decentralized application.
For example, a certain service of a decentralized application requires a client to package a plurality of transactions and send the transactions to a blockchain node through the server and execute the transactions, and for a user using the decentralized application, there may not be enough virtual resources for consumption; in this case, the operator of the decentralized application can provide the deduction account managed by the operator to the user to be used as the target deduction account, so that the user only needs to care about the service without actually paying corresponding virtual resources for executing the transaction, user experience is remarkably improved, and service expansion of the decentralized application is facilitated.
In one embodiment shown, the account may be further secured throughout the execution of the target transaction through an authorization and authentication mechanism; referring to FIG. 3, FIG. 3 is a swim-lane diagram of the uplink transaction flow in the decentralized application scenario; in the process, the user account serving as the transaction initiator includes a user account corresponding to a user of the decentralized application; the target deduction account comprises a deduction account corresponding to the service provider of the decentralized application, so that after a target transaction is established by the decentralized application client based on service content, the target transaction can be sent to the decentralized application server, so that the server authorizes the use of the target deduction account to deduct virtual resources in a private key signature mode, and after the signature is encrypted for the first time, the target transaction returns to the decentralized application client again, so that the use of a user account as a transaction method initiator to execute the target transaction is authorized through the private key signature; after the authorization process, after the target transaction is forwarded and linked, the node equipment of the block chain can complete the authentication of the two authorizations in a way of decrypting the signature and verifying by the public key, and after all the authorizations pass, the subsequent target transaction can be continuously executed by taking the user account as the transaction initiator, and the operation of deducting the corresponding virtual resource from the target deduction account.
It is understood that, although the above example adopts the operation scenario of the decentralized application to illustrate the authorization and authentication process, the authorization and authentication scheme may not depend on the relevant scenario of the district centralized application; that is, as long as the target transaction also carries a second authorization signature for authorizing the user account corresponding to the second account identifier to be used as a transaction initiator and executing the target transaction, the block chain node may execute the target transaction by using the user account corresponding to the second account identifier as a transaction initiator when the second authorization signature in the target transaction passes verification; correspondingly, as long as the target transaction also carries a first authorization signature for authorizing deduction of the virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identifier, the block link node may deduct the virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identifier when the first authorization signature in the target transaction passes verification.
Continuing to take the example that Zhang III hopes to execute self-constructed transaction on the block chain, Li IV and Wan V which provide the deduction account for the Zhang III can also finish the authorization of deduction in a private key signature mode; similarly, zhang san itself can prove to the blockchain node device that the user account of zhang san is the initiator of the target transaction as the identity authorization of zhang san itself by means of private key signature.
Therefore, the authorization and authentication mechanism can effectively ensure the security of the transaction execution scheme under various scenes, and avoid the condition of stealing the transaction execution or virtual resource deduction on behalf of others.
In an embodiment shown, the block link point device may further provide an alarm function for insufficient balance of the virtual resource; specifically, the virtual resource balance in the target deduction account may be obtained first; if the virtual resource balance is less than a preset alarm threshold, an alarm event carrying the first account identifier may be generated, so that the client or the server of the decentralized application responds to the alarm event and outputs alarm information that the virtual resource balance in the target deduction account is insufficient. It can be understood that, the specific pushing form of the alarm event and the specific output mode of the alarm information may be designed by those skilled in the art according to specific requirements, and the present specification is not limited in detail.
In an embodiment shown, the block link point device may further update the alarm threshold; in particular, the alarm threshold may be determined based on an estimated value of virtual resources consumed to perform the target transaction; that is, after obtaining the estimated value of the virtual resource consumed for executing the target transaction, the alarm threshold may be further updated based on the estimated value. By using the scheme, the client or the server of the decentralized application can be timely notified under the condition that the balance of the virtual resources in the target deduction account is insufficient or is about to be insufficient to support the consumption of executing the target transaction, and then the client or the server is output in the form of alarm information.
In one embodiment, the estimated value of the virtual resource may be calculated according to the number of virtual resource units consumed by the target transaction and the unit price of the virtual resource; the number of virtual resources consumed by the target transaction can be predicted based on the content of the target transaction, the more complex transactions generally consume more virtual resources, and the unit price of the virtual resources can be carried in the target transaction.
For example, in the ethernet-based blockchain, the virtual resource consumed during the execution of the transaction is referred to as a fuel Gas, which can be calculated by the consumed fuel fraction GasUsed and the unit price GasPrice of the fuel; assuming that a transaction requires 60 shares of fuel consumed, GasUsed, and 20gwei for GasPrice (gwei is one price unit in the ether), the estimated amount of Gas consumed when performing the transaction may be 20gwei 60 ═ 1200 gwei.
In one embodiment shown, the block link point device may also provide a spare account for deduction in case that the balance of the virtual resource in the current target deduction account is insufficient; specifically, the target transaction may further carry a third account identifier indicating a standby account corresponding to the target deduction account; and the block chain node may switch an account for deducting the virtual resource consumed by executing the target transaction to a standby account corresponding to the third account identifier, when determining that the balance of the virtual resource in the target deduction account is less than a preset alarm threshold value. For example, a target deduction account corresponding to a target transaction issued by a user of third party is an account of "lee four", and a standby account is an account of "wang five", and if a virtual resource balance in the "lee four" is already lower than a preset alarm threshold, an account for deducting a virtual resource for executing a target transaction minor account may be switched to the standby account of "wang five".
It is understood that the above solutions may also be further nested, for example, there is more than one spare account, and the skilled person may further complete the detailed solution design of multiple spare accounts according to the disclosure, and the present specification need not be further limited.
The above contents are all embodiments of the transaction execution method in this specification. The present specification also provides embodiments of a corresponding transaction execution apparatus as follows:
FIG. 4 is a diagram illustrating an exemplary configuration of a transaction execution device according to the present disclosure; the device can be applied to block link point equipment, and the device can comprise the following modules:
the receiving module 401 receives a target transaction to be executed sent by a client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction;
a deduction module 402, configured to deduct a virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identifier;
and an execution module 403 for executing the target transaction.
It is understood that the calling order of the deduction module 402 and the execution module 403 is not limited in this specification, and for specific logic analysis, reference is made to the corresponding method steps, which are not described herein again.
In one embodiment, the blockchain may be a federation chain; a federation chain may be a compromise option because it may provide a higher specification of security and decentralization level than a private chain, with higher operating efficiency and lower operating cost than a purely public chain.
In an embodiment shown, a plurality of deduction accounts may be preset under the mechanism, and the deduction module 402 may further determine, according to the first account identifier, a target deduction account corresponding to the first account identifier from the plurality of deduction accounts, and deduct the virtual resource corresponding to the target transaction from the target deduction account; by using the scheme, the access times of the same deduction account in a short time can be reduced, and the concurrency performance can be improved.
In a specific embodiment shown, the target transaction may further carry a second authorization signature for authorizing the user account corresponding to the second account identifier to be used as a transaction initiator to execute the target transaction, and the execution module 403 may execute the target transaction by using the user account corresponding to the second account identifier as the transaction initiator when the second authorization signature in the target transaction passes verification;
in an embodiment shown in the present disclosure, the target transaction may further carry a first authorization signature for authorizing deduction of a virtual resource corresponding to the target transaction from a target deduction account indicated by the first account identifier, and the deduction module 402 may deduct the virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identifier when the first authorization signature in the target transaction passes verification.
In one embodiment shown, a plurality of decentralized application clients (Dapp clients) may be interfaced to a decentralized application server (Dapp server) that may be interfaced to the blockchain; the client can comprise a client of the decentralized application; the target deduction account may include a deduction account corresponding to the service provider of the decentralized application.
In an embodiment shown, the apparatus may further include an alarm module for providing an alarm function of the insufficient balance of the virtual resource; specifically, the alarm module may first obtain a virtual resource balance in the target deduction account; if the virtual resource balance is less than a preset alarm threshold, an alarm event carrying the first account identifier may be generated, so that the client or the server of the decentralized application responds to the alarm event and outputs alarm information that the virtual resource balance in the target deduction account is insufficient.
In an embodiment shown in the foregoing description, the target transaction may also carry a conversion relationship between a system resource of the node device consumed for executing the target transaction and a virtual resource consumed for executing the target transaction; the apparatus may further include a first conversion module, which may obtain an amount of system resources of the node device consumed to perform the target transaction; and then, based on the conversion relation, converting the number of the system resources of the node equipment consumed for executing the target transaction to obtain the number of the virtual resources consumed for executing the target transaction.
In another embodiment shown, the system resource carried by the node device may be value-anchored with a virtual resource published on the blockchain; the apparatus may further include a second conversion module, which may obtain an amount of system resources of the node device consumed to perform the target transaction; and then based on the conversion relation obtained by anchoring the value, the number of the system resources of the node equipment consumed by executing the target transaction is converted to obtain the number of the virtual resources consumed by executing the target transaction.
In an embodiment shown, the apparatus may further include a switching module to provide a spare account for deduction in case that the balance of the virtual resource in the current target deduction account is insufficient; specifically, the target transaction may further carry a third account identifier indicating a standby account corresponding to the target deduction account; the switching module may switch an account for deducting virtual resources consumed for executing the target transaction to a standby account corresponding to the third account identifier, when it is determined that the balance of the virtual resources in the target deduction account is less than a preset alarm threshold.
Embodiments of the present specification further provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned transaction execution method when executing the program.
Fig. 5 is a schematic diagram illustrating a more specific hardware structure of a computing device according to an embodiment of the present disclosure, where the computing device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Embodiments of the present specification also provide a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the aforementioned transaction execution method.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The 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 Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
From the above description of the embodiments, it is clear to those skilled in the art that the embodiments of the present disclosure can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the embodiments of the present disclosure. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is only a specific embodiment of the embodiments of the present disclosure, and it should be noted that, for those skilled in the art, a plurality of modifications and decorations can be made without departing from the principle of the embodiments of the present disclosure, and these modifications and decorations should also be regarded as the protection scope of the embodiments of the present disclosure.

Claims (21)

1. A transaction execution method applied to a node device on a blockchain, the method comprising:
receiving a target transaction to be executed sent by a client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction;
deducting virtual resources corresponding to the target transaction from a target deduction account indicated by the first account identification; and the number of the first and second groups,
the target transaction is executed.
2. The method of claim 1, the deducting virtual resources corresponding to the target transaction from the target deduction account indicated by the first account identification, comprising:
and determining a target deduction account corresponding to the first account identifier from a plurality of preset deduction accounts, and deducting virtual resources corresponding to the target transaction from the target deduction account.
3. The method according to claim 1, wherein the target transaction further carries a first authorization signature for authorizing deduction of a virtual resource corresponding to the target transaction from a target deduction account indicated by the first account identifier;
deducting the virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identification, wherein the deduction comprises:
and under the condition that the first authorization signature in the target transaction passes the verification, deducting the virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identification.
4. The method of claim 1, wherein the target transaction carries a second account identifier indicating a user account for use as a transaction initiator;
the target transaction also carries a second authorization signature which is used for authorizing the user account corresponding to the second account identifier to be used as a transaction initiator and executing the target transaction;
the executing the target transaction includes:
and under the condition that the second authorization signature in the target transaction passes the verification, taking the user account corresponding to the second account identification as a transaction initiator to execute the target transaction.
5. The method of claim 1, the client comprising a decentralized application; and the target deduction account comprises a deduction account corresponding to the service provider of the decentralized application.
6. The method of claim 5, further comprising:
acquiring the balance of virtual resources in the target deduction account;
and if the balance of the virtual resources is less than a preset alarm threshold value, generating an alarm event carrying the first account identifier, so that the client or the server of the decentralized application responds to the alarm event and outputs alarm information of insufficient balance of the virtual resources in the target deduction account.
7. The method of claim 1, wherein the target transaction further carries a conversion relationship between a virtual resource corresponding to the target transaction and a system resource of the node device consumed for executing the target transaction;
the method further comprises the following steps:
obtaining an amount of system resources of the node device consumed to execute the target transaction;
and based on the conversion relation, converting the number of the system resources of the node equipment consumed by executing the target transaction to obtain the number of the virtual resources corresponding to the target transaction.
8. The method of claim 1, wherein the system resources hosted by the node device are value-anchored to virtual resources published on the blockchain;
the method further comprises the following steps: obtaining an amount of system resources of the node device consumed to execute the target transaction;
and based on the conversion relation obtained by the value anchoring, converting the number of the system resources of the node equipment consumed by executing the target transaction to obtain the number of the virtual resources corresponding to the target transaction.
9. The method of claim 6, wherein the target transaction further carries a third account identifier of a backup account corresponding to the target deduction account; the method further comprises the following steps:
and if the balance of the virtual resources is less than a preset alarm threshold value, switching the account for deducting the virtual resources consumed by executing the target transaction into a standby account corresponding to the third account identifier.
10. The method of claim 1, the blockchain is a federation chain.
11. A transaction execution apparatus applied to a node device on a blockchain, the apparatus comprising:
the receiving module is used for receiving the target transaction to be executed sent by the client; the target transaction carries a first account identifier indicating a target deduction account of a third party used for deducting virtual resources consumed by executing the target transaction;
the deduction module deducts virtual resources corresponding to the target transaction from the target deduction account indicated by the first account identification;
and the execution module executes the target transaction.
12. The apparatus of claim 11, the subtraction module further to:
and determining a target deduction account corresponding to the first account identifier from a plurality of preset deduction accounts, and deducting virtual resources corresponding to the target transaction from the target deduction account.
13. The apparatus according to claim 11, wherein the target transaction further carries a first authorization signature for authorizing deduction of a virtual resource corresponding to the target transaction from a target deduction account indicated by the first account identifier;
the deduction module further:
and under the condition that the first authorization signature in the target transaction passes the verification, deducting the virtual resource corresponding to the target transaction from the target deduction account indicated by the first account identification.
14. The apparatus of claim 11, the target transaction carrying a second account identifier indicating a user account for use as a transaction initiator;
the target transaction also carries a second authorization signature which is used for authorizing the user account corresponding to the second account identifier to be used as a transaction initiator and executing the target transaction;
the execution module further:
and under the condition that the second authorization signature in the target transaction passes the verification, taking the user account corresponding to the second account identification as a transaction initiator to execute the target transaction.
15. The apparatus of claim 11, the client comprising a decentralized application; and the target deduction account comprises a deduction account corresponding to the service provider of the decentralized application.
16. The apparatus of claim 15, the apparatus further comprising:
the alarm module acquires the balance of the virtual resources in the target deduction account; and if the balance of the virtual resources is less than a preset alarm threshold value, generating an alarm event carrying the first account identifier, so that the client or the server of the decentralized application responds to the alarm event and outputs alarm information of insufficient balance of the virtual resources in the target deduction account.
17. The apparatus of claim 11, wherein the target transaction further carries a conversion relationship between system resources of the node device consumed for executing the target transaction and virtual resources consumed for executing the target transaction;
the device further comprises:
the first conversion module is used for acquiring the quantity of the system resources of the node equipment consumed by executing the target transaction; and based on the conversion relation, converting the amount of the system resources of the node equipment consumed for executing the target transaction to obtain the amount of the virtual resources consumed for executing the target transaction.
18. The apparatus of claim 11, the system resource hosted by the node device being value-anchored with a virtual resource published on the blockchain;
the device further comprises:
the second conversion module is used for acquiring the quantity of the system resources of the node equipment consumed by executing the target transaction; and based on the conversion relation obtained by the value anchoring, converting the quantity of the system resources of the node equipment consumed by executing the target transaction to obtain the quantity of the virtual resources consumed by executing the target transaction.
19. The apparatus of claim 16, wherein the target transaction further carries a third account identifier of a backup account corresponding to the target deduction account; the device further comprises:
and if the balance of the virtual resources is less than a preset alarm threshold value, switching the account for deducting the virtual resources consumed by executing the target transaction into a standby account corresponding to the third account identifier.
20. The apparatus of claim 11, the blockchain is a federation chain.
21. A computer device comprising at least a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 11 when executing the program.
CN202110507086.7A 2021-05-10 2021-05-10 Transaction execution method and device Pending CN113222572A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110507086.7A CN113222572A (en) 2021-05-10 2021-05-10 Transaction execution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110507086.7A CN113222572A (en) 2021-05-10 2021-05-10 Transaction execution method and device

Publications (1)

Publication Number Publication Date
CN113222572A true CN113222572A (en) 2021-08-06

Family

ID=77094246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110507086.7A Pending CN113222572A (en) 2021-05-10 2021-05-10 Transaction execution method and device

Country Status (1)

Country Link
CN (1) CN113222572A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111383019A (en) * 2020-05-28 2020-07-07 支付宝(杭州)信息技术有限公司 Transaction execution method and system based on alliance link network
CN111966757A (en) * 2020-10-20 2020-11-20 支付宝(杭州)信息技术有限公司 Method and device for managing storage space of intelligent contract account
CN112581110A (en) * 2021-02-22 2021-03-30 支付宝(杭州)信息技术有限公司 Fuel deduction method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111383019A (en) * 2020-05-28 2020-07-07 支付宝(杭州)信息技术有限公司 Transaction execution method and system based on alliance link network
CN111966757A (en) * 2020-10-20 2020-11-20 支付宝(杭州)信息技术有限公司 Method and device for managing storage space of intelligent contract account
CN112581110A (en) * 2021-02-22 2021-03-30 支付宝(杭州)信息技术有限公司 Fuel deduction method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110163590B (en) Payment withholding method and device based on block chain, electronic equipment and storage medium
CN108876380B (en) Transaction method and system based on centralized settlement and block chain deposit certificate
KR102312781B1 (en) Offline payment, service processing, and method and apparatus for payment processing
CN109242453B (en) Transaction method and system based on centralized settlement and block chain deposit certificate
US9571991B1 (en) Opt-in tracking across messaging application platforms
CN111080275B (en) Cross-region resource transfer method, device, equipment and storage medium
US20170221053A1 (en) Digital asset conversion
CN111382168B (en) Node group creating method and node group-based transaction method in alliance chain network
TWI640937B (en) Online payment method and equipment
WO2021239066A1 (en) Consortium blockchain network-based transaction execution method, and system
EP4102768A1 (en) Blockchain-based transaction methods
CN109166027A (en) A kind of loaning bill contract processing method and processing device
CN111639932B (en) Offline resource transfer method and device based on block chain
CN111985007A (en) Contract signing and executing method and device based on block chain
CN111047443A (en) User scoring method and device, electronic equipment and computer readable storage medium
CN110766394A (en) Bus taking payment method and device based on credit degree, electronic equipment and storage medium
CN113221165B (en) User element authentication method and device based on block chain
CN111047327A (en) Intelligent contract execution method, device and equipment
CN106169137B (en) Resource transfer method, device and system
CN110175915B (en) Service execution result obtaining method and system based on block chain
CN113114678A (en) Service execution method and device
CN112511651B (en) Service access method and device based on block chain
CN113222572A (en) Transaction execution method and device
CN115330372A (en) Payment processing method and device based on prepaid voucher
CN108280645A (en) The acquisition of payment code, payment request response method, device and equipment

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

Ref country code: HK

Ref legal event code: DE

Ref document number: 40057867

Country of ref document: HK

RJ01 Rejection of invention patent application after publication

Application publication date: 20210806

RJ01 Rejection of invention patent application after publication