Blockchain transaction execution method and device, electronic equipment and storage medium
By combining the historical transaction information of the blockchain transaction requester with the content of the smart contract, and designing contract execution conditions, the problem of unfair blockchain transaction execution is solved, and fairer and more secure transaction execution is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2026-04-10
AI Technical Summary
In existing blockchain transaction execution methods, attackers can influence the execution order by controlling transaction gas fees, leading to unfair transaction execution and making it difficult to effectively mitigate the impact of malicious attacks on the execution results.
By combining the historical transaction information of the transaction requester with the contract content of the smart contract, the contract execution conditions are designed so that the transaction request is successfully executed only when the conditions set in the contract content are met, thereby increasing the attack cost for attackers. The contract content is designed from multiple dimensions such as transaction time, transaction fees, and number of transactions to alleviate the unfairness caused by the transaction execution order depending on transaction fees.
This effectively prevents attackers from influencing transaction execution results by increasing transaction fees, improves the fairness of transaction execution and the transaction experience of the requesting party, and ensures the fairness and security of transaction execution.
Smart Images

Figure CN115660846B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchains, in particular, to a transaction execution method and device of a blockchain, an electronic device and a storage medium. BACKGROUND
[0002] When a blockchain executes a transaction, it usually calls a smart contract deployed on a blockchain node to execute the corresponding transaction.
[0003] In the prior art, a smart contract executes a transaction according to the gas fee (i.e., the computing workload required to execute a specific operation on an Ethereum blockchain network) of the transaction, and transactions with high gas fees are executed first. Therefore, an attacker can affect the execution order of transactions by controlling the gas fee, thereby maliciously attacking the execution result. Therefore, it is particularly important to effectively mitigate the impact of malicious attacks on the execution result. SUMMARY
[0004] The present application aims to alleviate the impact of malicious attacks on the execution result and improve the fairness of transaction execution by providing a transaction execution method and device of a blockchain, an electronic device and a storage medium.
[0005] To achieve the above-mentioned purpose, the technical solutions adopted by the embodiments of the present application are as follows:
[0006] In a first aspect, the embodiments of the present application provide a transaction execution method of a blockchain, applied to a blockchain node, wherein a smart contract is deployed on the blockchain node, and the method comprises:
[0007] receiving a transaction request submitted by a transaction requester, wherein the transaction request comprises a transaction content, a transaction fee and a transaction time;
[0008] pre-executing the transaction request submitted by the transaction requester according to the transaction request submitted by the transaction requester and contract content of the smart contract corresponding to the transaction request and historical transaction information of the transaction requester recorded in the smart contract, to obtain a pre-execution result of the transaction request;
[0009] if cumulative pre-execution information of transaction requests with the same transaction content of the transaction requester meets a contract execution condition in the contract content of the smart contract, executing the transaction requests with the same transaction content of the transaction requester to obtain an execution result of the transaction requests with the same transaction content of the transaction requester.
[0010] In a second aspect, the embodiments of the present application further provide a transaction execution apparatus of a blockchain, applied to a blockchain node, wherein the blockchain node is deployed with a smart contract, and the apparatus comprises a receiving module, a pre-execution module and an execution module.
[0011] The receiving module is configured to receive a transaction request submitted by a transaction requestor currently, wherein the transaction request comprises transaction content, a transaction fee and a transaction time.
[0012] The pre-execution module is configured to pre-execute the transaction request submitted by the transaction requestor currently according to the transaction request submitted by the transaction requestor currently, contract content of the smart contract corresponding to the transaction request and historical transaction information of the transaction requestor recorded in the smart contract, to obtain a pre-execution result of the transaction request.
[0013] The execution module is configured to execute the transaction request of the same transaction content of the transaction requestor if cumulative pre-execution information of the transaction request of the same transaction content of the transaction requestor meets a contract execution condition in the contract content of the smart contract, to obtain an execution result of the transaction request of the same transaction content of the transaction requestor.
[0014] In a third aspect, the embodiments of the present application provide an electronic device, comprising a processor, a storage medium and a bus, wherein the storage medium stores machine readable instructions executable by the processor, the processor communicates with the storage medium through the bus when the electronic device is running, and the processor executes the machine readable instructions to execute the steps of the transaction execution method of the blockchain provided in the first aspect.
[0015] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to execute the steps of the transaction execution method of the blockchain provided in the first aspect.
[0016] The present application has the following beneficial effects:
[0017] The application provides a blockchain transaction execution method and device, electronic equipment and a storage medium. When executing a current transaction request of a transaction request party, the application combines historical transaction information of the transaction request party executing a transaction request with the same transaction content as the current transaction request and contract content of a smart contract to make a judgment on transaction execution. When a contract execution condition set in the contract content of the smart contract is met, the current transaction request submitted by the transaction request party is successfully executed. The method increases the attack cost of an attacker, designs the contract content of the smart contract from multiple dimensions such as transaction time, transaction fee and transaction frequency, to alleviate the influence of the attacker on the contract execution result by increasing the transaction fee to make his own transaction be executed preferentially. By combining the historical transaction information, the transaction request with the same transaction content is successfully executed when the cumulative execution information of the transaction request meets the set condition of the smart contract, so as to avoid the unfair phenomenon of transaction execution caused by the successful execution of the transaction only through one execution when the execution order of the transaction depends on the transaction fee, thereby effectively avoiding the influence of the attacker on the transaction execution result caused by maliciously increasing the transaction fee, and improving the transaction experience of the transaction request party. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0019] Figure 1 Flowchart of the blockchain transaction execution method provided by the embodiments of the application Figure One ;
[0020] Figure 2 Flowchart of the blockchain transaction execution method provided by the embodiments of the application Figure Two ;
[0021] Figure 3 Flowchart of the blockchain transaction execution method provided by the embodiments of the application Figure Three ;
[0022] Figure 4 Flowchart of the blockchain transaction execution method provided by the embodiments of the application Figure Four ;
[0023] Figure 5 Flowchart of the blockchain transaction execution method provided by the embodiments of the application Figure Five ;
[0024] Figure 6A flowchart of a transaction execution method of a blockchain provided for an embodiment of the present application Figure Six ;
[0025] Figure 7 A schematic diagram of a transaction execution device of a blockchain provided for an embodiment of the present application
[0026] Figure 8 A structural schematic diagram of an electronic device provided for an embodiment of the present application DETAILED DESCRIPTION
[0027] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. It should be understood that the accompanying drawings in the present application are only intended to illustrate and describe the present application, and are not intended to limit the scope of the present application. In addition, it should be understood that the accompanying drawings are not drawn to scale. The flowcharts show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can not be implemented in sequence, and the steps without logical context relationship can be reversed in sequence or implemented simultaneously. In addition, one or more other operations can be added to the flowcharts or one or more operations can be removed from the flowcharts under the guidance of the content of the present application.
[0028] In addition, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0029] It should be noted that the term “comprising” will be used in the embodiments of the present application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0030] Firstly, the process of executing transactions on a blockchain is simply described. Generally, a smart contract is deployed on each chain node of the blockchain, and the smart contracts deployed on each chain node are the same. The smart contract can be divided into multiple categories, and a smart contract can be generated for different business logic, for example, auction business, transfer business, etc.
[0031] Optionally, the smart contract usually contains contract content, which can be understood as business execution logic. When the execution logic of the transaction request meets the contract content, the smart contract will take effect, and the transaction execution is successful.
[0032] The contract content of the smart contract can be preset, so that the smart contract meeting the demand is generated in advance, and the generated smart contract can be deployed in advance to each node of the blockchain, so that the smart contract is directly called in the process of executing the transaction using the blockchain, and the transaction is completed.
[0033] The existing validity rules of the smart contract can include two kinds:
[0034] The first kind is similar to the "first come, first served" rule, that is, who executes a certain function in the contract first, whose transaction execution is successful. This rule has a strong dependence on the transaction order. The transaction execution order of the blockchain itself is based on the principle of maximizing benefits. As long as the attacker pays a high transaction fee (gas fee), the transaction execution order can be influenced to a certain extent.
[0035] The second kind is that if there is no transaction request party executing the contract in a certain period of time, the last transaction executing the contract 24 hours ago is successfully executed. This rule also has a strong dependence on the transaction order. Attackers can send a large number of high-gas-fee transactions to cause congestion of the entire blockchain network, so that no ordinary transaction is executed, and finally no one executes the contract for more than 24 hours, and the attacker finally wins.
[0036] The scheme of the present application designs the contract content of the smart contract in different dimensions to alleviate the influence of the attacker on the transaction execution order and improve the fairness of transaction execution.
[0037] Figure 1 The flowchart of the transaction execution method of the blockchain provided for the embodiments of the present application Figure One The execution subject of the method can be a chain node of the blockchain, and one chain node can correspond to one server. It can be understood that the execution subject is the server, and the chain node of the block is deployed with a smart contract. The chain node executes the transaction by calling the smart contract. As shown in Figure 1 The method can include:
[0038] S101, receiving a transaction request currently submitted by a transaction request party, the transaction request including: transaction content, transaction fee, and transaction time.
[0039] The transaction request party here is also referred to as the transaction initiator. Optionally, the transaction request currently submitted by the transaction request party is received. The transaction request usually includes: transaction content, transaction fee, and transaction time.
[0040] The transaction content can refer to a transaction to be executed, for example, transferring money to which account, auctioning a house, purchasing an article, etc. The transaction fee herein does not refer to the fee involved in the transaction content, but refers to the gas fee, which refers to the computing workload required for performing a specific operation on the blockchain network, which can be understood as the computing workload required for executing the transaction content. The transaction time can refer to the submission time of the currently submitted transaction request.
[0041] S102, according to the transaction request submitted by the transaction request party currently, and the contract content of the smart contract corresponding to the transaction request and the historical transaction information of the transaction request party recorded in the smart contract, pre-executing the transaction request submitted by the transaction request party currently, obtaining the pre-execution result of the transaction request.
[0042] In an implementable manner, the pre-execution result of the transaction request can be obtained by pre-executing the currently submitted transaction request according to the information contained in the transaction request and the historical transaction information of the transaction request party. It should be noted that the pre-execution is performed according to the information contained in the transaction request submitted by the same transaction request party currently and the historical transaction information.
[0043] The transaction information generated after each execution of the transaction request of the transaction request party is stored in the smart contract, specifically in the smart contract corresponding to the transaction request. When obtaining the historical transaction information, the smart contract corresponding to the transaction request is determined according to the transaction request submitted by the transaction request party currently, and further, the historical transaction information of the transaction request party can be obtained from the smart contract corresponding to the transaction request according to the identifier of the transaction request party, for example, the identity information of the transaction request party.
[0044] It should be noted that the pre-execution herein is not to directly execute the transaction request to obtain the execution result, which can be understood as only accepting the transaction request, but not actually processing it. Taking the transaction request of transferring money to user A as an example, the pre-execution of the transaction request can be understood as: accepting the transaction request, but not transferring the money to the account of user A; for example, only auditing the relevant information of the transaction request party, but not processing the money transfer.
[0045] Then, the obtained pre-execution result is not the result of successful transfer, and the pre-execution result herein is used to store in the smart contract, so as to facilitate the recording of the historical transaction information of the transaction request party.
[0046] S103, if the cumulative pre-execution information of the transaction request of the same transaction content of the transaction request party satisfies the contract execution condition in the contract content of the smart contract, executing the transaction request of the same transaction content of the transaction request party, obtaining the execution result of the transaction request of the same transaction content of the transaction request party.
[0047] Optionally, whether the transaction request submitted by the transaction requestor currently meets the contract execution condition of the smart contract can be determined according to the cumulative pre-execution information of the transaction request of the same transaction content of the same transaction requestor, specifically, whether the pre-execution information of the transaction request (the transaction content is the same as that of the transaction request submitted currently) of the transaction requestor historically pre-executed by the transaction requestor meets the contract execution condition set in the smart contract can be determined according to the transaction content of the transaction request submitted by the transaction requestor currently, when the condition is met, the contract takes effect, the transaction request submitted by the transaction requestor currently is successfully executed, and an execution result is obtained.
[0048] Still taking the above-mentioned transfer as an example, when the condition is met, the contract takes effect, the transaction request submitted by the transaction requestor currently is successfully executed, the transfer requested by the transaction requestor is successfully transferred to the account of the A user, and the execution result obtained can include: the transaction requestor transfers XX yuan to the A user.
[0049] In summary, the transaction execution method of the blockchain provided in the embodiment can, when executing the transaction request submitted by the transaction requestor currently, determine whether to execute the transaction by combining the historical transaction information of the transaction requestor executing the transaction request with the same transaction content as the transaction content of the current transaction request and the contract content of the smart contract, and when the contract execution condition set in the contract content of the smart contract is met, the transaction request submitted by the transaction requestor currently is successfully executed. By combining the historical transaction information, the transaction request is successfully executed only when the cumulative execution information of the transaction request of the same transaction content meets the set condition of the smart contract, which can avoid the unfair phenomenon of transaction execution caused by the fact that the transaction execution order depends on the transaction fee and the transaction is successfully executed only once, thereby effectively avoiding the influence of the malicious increase of the transaction fee by an attacker on the execution result of the transaction and improving the transaction experience of the transaction requestor.
[0050] Figure 2 Flowchart of the transaction execution method of the blockchain provided in the embodiment of the application Figure Two Optionally, in step S102, the transaction request submitted by the transaction requestor currently can be pre-executed according to the transaction request submitted by the transaction requestor currently, the contract content of the smart contract corresponding to the transaction request, and the historical transaction information of the transaction requestor recorded in the smart contract, and can include the following steps:
[0051] S201, whether the transaction request submitted by the transaction requestor currently meets the smart contract can be determined according to the transaction request submitted by the transaction requestor currently, the transaction information of the transaction request historically executed by the transaction requestor recorded in the smart contract, and the contract content of the smart contract.
[0052] First, when the chain node of the blockchain receives the transaction request currently submitted by the transaction request party, the chain node will first sort the transaction request according to the transaction fee contained in the transaction request, and package multiple transaction requests to generate a block according to the sorting result, and send the block to other chain nodes for block consensus; the chain node sequentially pre-executes each transaction request according to the arrangement order of each transaction request in the block.
[0053] Optionally, when the chain node currently processes the pre-execution of the transaction request currently submitted by the transaction request party, the chain node can first determine whether the currently submitted transaction request satisfies the smart contract according to the currently submitted transaction request of the transaction request party, the transaction information of the historical execution of the transaction request of the transaction request party, and the contract content of the smart contract.
[0054] S202, if yes, pre-execute the transaction request currently submitted by the transaction request party, and record the transaction information of the transaction request currently submitted by the transaction request party in the smart contract.
[0055] When the smart contract is satisfied, the transaction request currently submitted by the transaction request party is pre-executed, and the pre-execution can be realized by recording the transaction information of the transaction request currently submitted by the transaction request party in the smart contract, including recording the transaction fee, the transaction content, and the transaction time of the pre-executed transaction request.
[0056] It is worth noting here that the transaction time of the pre-executed transaction request is different from the transaction time contained in the transaction request. The transaction time contained in the transaction request is only the time of submitting the transaction request, and the time recorded here is the time of pre-executing the transaction request. The transaction request is not pre-executed immediately after being submitted, but there is a time difference.
[0057] Figure 3 Flowchart of the transaction execution method of the blockchain provided by the embodiment of the application Figure Three Optionally, in step S201, whether the transaction request currently submitted by the transaction request party satisfies the smart contract is determined according to the transaction request currently submitted by the transaction request party, the transaction information of the historical execution of the transaction request of the transaction request party recorded in the smart contract, and the contract content of the smart contract, including:
[0058] S301, whether the transaction request currently submitted by the transaction request party satisfies the smart contract is determined according to the transaction time of the transaction request currently submitted by the transaction request party and the transaction time of the last pre-executed transaction request of the transaction request party recorded in the smart contract.
[0059] In an implementable manner, whether the currently submitted transaction request satisfies the smart contract can be determined according to a transaction time of the currently submitted transaction request of the transaction request party, transaction information of the transaction request of the transaction request party recorded in the smart contract, and contract content of the smart contract.
[0060] S302, if yes, the currently submitted transaction request of the transaction request party is pre-executed to obtain a pre-execution result of the transaction request.
[0061] Optionally, when the currently submitted transaction request satisfies the contract execution logic of the smart contract, the currently submitted transaction request is pre-executed to obtain a pre-execution result of the transaction request, and transaction information of this time of pre-executing the transaction request is recorded in the smart contract, wherein the pre-execution times of the transaction request of the same transaction content of the same user can be accumulated in the smart contract.
[0062] Figure 4 Flowchart of a transaction execution method of a block chain provided by an embodiment of the present application Figure Four Optionally, in step S301, whether the currently submitted transaction request of the transaction request party satisfies the smart contract can be determined according to a transaction time of the currently submitted transaction request of the transaction request party and a transaction time of the last execution of the transaction request of the transaction request party recorded in the smart contract, and can include the following steps.
[0063] S401, determining whether a difference between a transaction time of the currently submitted transaction request and a transaction time of the last pre-execution of the transaction request satisfies a preset time difference value included in contract content of the smart contract.
[0064] In an implementable manner, the pre-execution interval time of the two transaction requests of the same transaction content submitted by the transaction request party can be increased to slow down the attack of the attacker who frequently sends transaction requests to interfere with the normal execution of the transaction.
[0065] In this case, the preset time difference value can be set in the contract content of the smart contract, and if the pre-execution interval time of the two transaction requests of the same transaction content of the same transaction request party is too short, the pre-execution of the currently submitted transaction request fails, no pre-execution result is generated, and no new information is recorded in the smart contract.
[0066] Optionally, the difference between the transaction time of the currently submitted transaction request and the transaction time of the last pre-execution of the transaction request can be calculated to determine whether the difference satisfies the preset time difference value set in the contract content.
[0067] S402, if yes, determining whether the currently submitted transaction request of the transaction request party satisfies the smart contract.
[0068] When the difference meets the preset time difference set in the contract content, it is considered that the transaction request currently submitted by the transaction request party meets the smart contract, and the currently submitted transaction request can be pre-executed.
[0069] Figure 5 Flowchart of the transaction execution method of the blockchain provided for the embodiments of the present application Figure Five Optionally, in step S201, whether the transaction request currently submitted by the transaction request party meets the smart contract can be determined according to the transaction request currently submitted by the transaction request party, the transaction information of the historical execution transaction request of the transaction request party recorded in the smart contract, and the contract content of the smart contract, and can include:
[0070] S501, whether the transaction request currently submitted by the transaction request party meets the smart contract is determined according to the transaction fee of the transaction request currently submitted by the transaction request party and the transaction fee of the last pre-executed transaction request of the transaction request party recorded in the smart contract.
[0071] In another implementable manner, whether the currently submitted transaction request meets the smart contract can be determined according to the transaction fee of the transaction request currently submitted by the transaction request party, the transaction fee of the historical pre-executed transaction request of the transaction request party recorded in the smart contract, and the contract content of the smart contract.
[0072] S502, if yes, the transaction request currently submitted by the transaction request party is pre-executed to obtain a pre-execution result of the transaction request.
[0073] Optionally, when the currently submitted transaction request meets the contract execution logic of the smart contract, the currently submitted transaction request is pre-executed to obtain a pre-execution result of the transaction request, and the transaction information of the current pre-execution of the transaction request is recorded in the smart contract, wherein the transaction fee of the transaction request of the same transaction content of the same user can be recorded in the smart contract.
[0074] Figure 6 Flowchart of the transaction execution method of the blockchain provided for the embodiments of the present application Figure Six ; optionally, in step S501, whether the transaction request currently submitted by the transaction request party meets the smart contract can be determined according to the transaction fee of the transaction request currently submitted by the transaction request party and the transaction fee of the last pre-executed transaction request of the transaction request party recorded in the smart contract.
[0075] S601, it is determined whether the difference between the transaction fee of the currently submitted transaction request and the transaction fee of the last executed transaction request meets the preset fee difference included in the contract content of the smart contract.
[0076] In another implementable manner, the cost paid by the attacker for frequently sending transaction requests can be increased by increasing the transaction fee required when the transaction request party resubmits the same transaction content again, so as to slow down the attacker's frequent sending of transaction requests to interfere with the normal execution of transactions.
[0077] In this case, a preset fee difference value can be set in the contract content of the smart contract. If the transaction fee difference of the same transaction content of the transaction request of the same transaction request party twice (this time and last time) is small, the pre-execution of the current submitted transaction request fails, no pre-execution result is generated, and no new information is recorded in the smart contract.
[0078] That is, the transaction request party wants the current submitted transaction request to be pre-executed, and the transaction fee of the current submitted transaction request is higher than the last time, and a higher transaction fee is paid to be pre-executed.
[0079] S602, if yes, it is judged that the transaction request submitted by the transaction request party meets the smart contract.
[0080] When the difference in transaction fees meets the preset fee difference value set in the contract content, it is considered that the transaction request submitted by the transaction request party meets the smart contract, and the current submitted transaction request can be pre-executed.
[0081] Optionally, in step S103, if the cumulative pre-execution information of the same transaction content of the transaction request of the transaction request party meets the contract execution condition in the contract content of the smart contract, the same transaction content of the transaction request of the transaction request party is executed, and the execution result of the same transaction content of the transaction request of the transaction request party is obtained, which can include: if the cumulative pre-execution times of the same transaction content of the transaction request of the transaction request party meet the contract execution trigger times in the contract content of the smart contract, the same transaction content of the transaction request of the transaction request party is executed, and the execution result of the same transaction content of the transaction request of the transaction request party is obtained.
[0082] In some embodiments, the fairness of transaction execution can be improved by increasing the number of times the transaction request party executes the same transaction content.
[0083] When the same transaction content of the transaction request of the same transaction request party is pre-executed once, it is not considered as final execution success, only the result of each pre-execution is recorded, and the cumulative number of historical pre-executions is recorded. When the same transaction content of the transaction request of the same transaction request party is pre-executed for many times, it is considered as final execution success, and the execution result is obtained.
[0084] In an implementable manner, for a transaction request currently submitted by a transaction request party, the cumulative pre-execution number of transaction requests with the same transaction content as the transaction request currently submitted can be found from the historical transaction information of the transaction request party recorded in the smart contract, and when the cumulative pre-execution number meets the contract execution trigger number in the contract content of the smart contract, the transaction request is executed, wherein executing the transaction request can be understood as executing the transaction content in the transaction request, for example, executing a transfer transaction, or executing an auction transaction to obtain an execution result, which can be similar to: transferring x yuan to an x account, or bidding for an x house.
[0085] The method increases the attack cost of the attacker, designs the contract content of the smart contract from multiple dimensions such as transaction time, transaction fee, and transaction number, to alleviate the influence of the attacker on the contract execution result by increasing the transaction fee to make his own transaction be executed preferentially.
[0086] In summary, the transaction execution method of the blockchain provided in the embodiment executes the current transaction request of the transaction request party, and judges the transaction execution by combining the historical transaction information of the transaction request party executing the transaction request with the same transaction content as the current transaction request and the contract content of the smart contract. When the contract execution condition set in the contract content of the smart contract is met, the current transaction request submitted by the transaction request party is successfully executed. The method increases the attack cost of the attacker, designs the contract content of the smart contract from multiple dimensions such as transaction time, transaction fee, and transaction number, to alleviate the influence of the attacker on the contract execution result by increasing the transaction fee to make his own transaction be executed preferentially. By combining the historical transaction information, the transaction request is successfully executed when the cumulative execution information of the transaction request with the same transaction content meets the set condition of the smart contract, which can avoid the unfair phenomenon of transaction execution caused by the fact that the transaction execution order depends on the transaction fee and the transaction is successfully executed only once, thereby effectively avoiding the influence of the attacker on the transaction execution result caused by maliciously increasing the transaction fee, and improving the transaction experience of the transaction request party.
[0087] The following describes the device, equipment, and storage medium for executing the transaction execution method of the blockchain provided in the present application. The specific implementation process and technical effects are described above, and will not be described again.
[0088] Figure 7 A schematic diagram of a transaction execution device of a blockchain provided in an embodiment of the present application is shown in FIG. 1. The functions implemented by the transaction execution device of the blockchain correspond to the steps of the method described above. The device can be understood as the server described above, or the processor of the server, and can also be understood as a component independent of the server or the processor, which implements the functions of the present application under the control of the server, such as a chip. Figure 7As shown, the apparatus can include: a receiving module 710, a pre-execution module 720, an execution module 730;
[0089] The receiving module 710 is configured to receive a transaction request currently submitted by a transaction requester, the transaction request including: transaction content, a transaction fee, and a transaction time;
[0090] The pre-execution module 720 is configured to pre-execute the transaction request currently submitted by the transaction requester according to the transaction request currently submitted by the transaction requester, and contract content of a smart contract corresponding to the transaction request and historical transaction information of the transaction requester recorded in the smart contract, to obtain a pre-execution result of the transaction request.
[0091] The execution module 730 is configured to execute the transaction request of the same transaction content of the transaction requester if cumulative pre-execution information of the transaction request of the same transaction content of the transaction requester meets a contract execution condition in the contract content of the smart contract, to obtain an execution result of the transaction request of the same transaction content of the transaction requester.
[0092] Optionally, the pre-execution module 720 is specifically configured to
[0093] determine whether the transaction request currently submitted by the transaction requester meets the smart contract according to the transaction request currently submitted by the transaction requester, historical execution transaction information of the transaction requester recorded in the smart contract, and the contract content of the smart contract.
[0094] If yes, pre-execute the transaction request currently submitted by the transaction requester, and record transaction information of the transaction request currently submitted by the transaction requester in the smart contract.
[0095] Optionally, the pre-execution module 720 is specifically configured to
[0096] determine whether the transaction request currently submitted by the transaction requester meets the smart contract according to the transaction time of the transaction request currently submitted by the transaction requester and a transaction time of a last pre-execution transaction request of the transaction requester recorded in the smart contract.
[0097] If yes, pre-execute the transaction request currently submitted by the transaction requester, to obtain a pre-execution result of the transaction request.
[0098] Optionally, the pre-execution module 720 is specifically configured to
[0099] determine whether a difference between the transaction time of the transaction request currently submitted and the transaction time of the last pre-execution transaction request meets a preset time difference value included in the contract content of the smart contract.
[0100] If yes, it is determined that the transaction request currently submitted by the transaction requester meets the smart contract.
[0101] Optionally, the pre-execution module 720 is specifically configured to
[0102] determine whether the transaction request currently submitted by the transaction requestor satisfies the smart contract according to a transaction fee of the transaction request currently submitted by the transaction requestor and a transaction fee of the transaction request last executed by the transaction requestor recorded in the smart contract;
[0103] if yes, pre-execute the transaction request currently submitted by the transaction requestor to obtain a pre-execution result of the transaction request
[0104] Optionally, the pre-execution module 720 is specifically configured to
[0105] determine whether a difference between the transaction fee of the transaction request currently submitted and the transaction fee of the transaction request last executed satisfies a preset fee difference included in the contract content of the smart contract;
[0106] if yes, determine that the transaction request currently submitted by the transaction requestor satisfies the smart contract.
[0107] Optionally, the execution module 730 is specifically configured to
[0108] if the cumulative pre-execution number of the transaction request with the same transaction content of the transaction requestor satisfies the contract execution trigger number in the contract content of the smart contract, execute the transaction request with the same transaction content of the transaction requestor to obtain an execution result of the transaction request with the same transaction content of the transaction requestor.
[0109] By the above device, after receiving the transaction request submitted by the transaction request party, the receiving module; the pre-execution module pre-executes the transaction request submitted by the transaction request party according to the transaction request submitted by the transaction request party, the contract content of the smart contract corresponding to the transaction request and the historical transaction information of the transaction request party recorded in the smart contract, and obtains the pre-execution result of the transaction request; the execution module executes the transaction request of the same transaction content of the transaction request party when the cumulative pre-execution information of the transaction request of the same transaction content of the transaction request party meets the contract execution condition in the contract content of the smart contract, and obtains the execution result of the transaction request of the same transaction content of the transaction request party. The method increases the attack cost of the attacker, designs the contract content of the smart contract from multiple dimensions such as transaction time, transaction fee and transaction times, so as to alleviate the phenomenon that the attacker increases the transaction fee to make his own transaction preferentially executed and thus affects the contract execution result; by combining the historical transaction information, the transaction request is successfully executed only when the cumulative execution information of the transaction request of the same transaction content meets the set condition of the smart contract, which can avoid the unfair phenomenon of transaction execution caused by the fact that the transaction execution order depends on the transaction fee and the transaction is successfully executed only by one execution, so as to effectively avoid the influence of the attacker on the transaction execution result caused by maliciously increasing the transaction fee, and improve the transaction experience of the transaction request party.
[0110] The above modules can be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. For example, when a certain module above is implemented in the form of a processing element scheduling code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call code. For another example, these modules can be integrated together to implement in the form of a system on a chip (SOC).
[0111] The above modules can be connected or communicate with each other via wired connection or wireless connection. The wired connection can include metal cable, optical cable, hybrid cable, etc., or any combination thereof. The wireless connection can include connection in the form of LAN, WAN, Bluetooth, ZigBee, or NFC, etc., or any combination thereof. Two or more modules can be combined into a single module, and any one module can be divided into two or more units. It can be clearly understood by those skilled in the art that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, which will not be repeated herein.
[0112] Figure 8 A structural schematic diagram of an electronic device provided in an embodiment of the present application includes a processor 801, a storage medium 802, and a bus 803. The storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs a transaction execution method of a blockchain as in an embodiment, the processor 801 and the storage medium 802 communicate through the bus 803. The processor 801 executes the machine-readable instructions to perform the following steps:
[0113] receiving a transaction request currently submitted by a transaction requester, the transaction request including: transaction content, a transaction fee, and a transaction time;
[0114] pre-executing the transaction request currently submitted by the transaction requester according to the transaction request currently submitted by the transaction requester and contract content of a smart contract corresponding to the transaction request and historical transaction information of the transaction requester recorded in the smart contract, to obtain a pre-execution result of the transaction request;
[0115] if cumulative pre-execution information of the transaction request with the same transaction content of the transaction requester meets a contract execution condition in the contract content of the smart contract, executing the transaction request with the same transaction content of the transaction requester to obtain an execution result of the transaction request with the same transaction content of the transaction requester.
[0116] In a feasible implementation, when the processor 801 performs pre-execution of the transaction request currently submitted by the transaction requester according to the transaction request currently submitted by the transaction requester and the contract content of the smart contract corresponding to the transaction request and the historical transaction information of the transaction requester recorded in the smart contract, it is specifically used for:
[0117] judging whether the transaction request currently submitted by the transaction requester meets the smart contract according to the transaction request currently submitted by the transaction requester, the historical execution transaction information of the transaction request of the transaction requester recorded in the smart contract, and the contract content of the smart contract;
[0118] If yes, the current transaction request of the transaction request party is pre-executed, and the transaction information of the current transaction request of the transaction request party is recorded in the smart contract.
[0119] In a feasible implementation, when the processor 801 executes the smart contract to determine whether the current transaction request of the transaction request party satisfies the smart contract according to the current transaction request of the transaction request party, the transaction information of the historical execution transaction request of the transaction request party recorded in the smart contract, and the contract content of the smart contract, the processor 801 is specifically configured to:
[0120] determine whether the current transaction request of the transaction request party satisfies the smart contract according to the transaction time of the current transaction request of the transaction request party and the transaction time of the last pre-executed transaction request of the transaction request party recorded in the smart contract.
[0121] If yes, the current transaction request of the transaction request party is pre-executed to obtain a pre-execution result of the transaction request.
[0122] In a feasible implementation, when the processor 801 executes the smart contract to determine whether the current transaction request of the transaction request party satisfies the smart contract according to the transaction time of the current transaction request of the transaction request party and the transaction time of the last pre-executed transaction request of the transaction request party recorded in the smart contract, the processor 801 is specifically configured to:
[0123] determine whether a difference between the transaction time of the current transaction request and the transaction time of the last pre-executed transaction request satisfies a preset time difference value included in the contract content of the smart contract.
[0124] If yes, it is determined that the current transaction request of the transaction request party satisfies the smart contract.
[0125] In a feasible implementation, when the processor 801 executes the smart contract to determine whether the current transaction request of the transaction request party satisfies the smart contract according to the current transaction request of the transaction request party, the transaction information of the historical execution transaction request of the transaction request party recorded in the smart contract, and the contract content of the smart contract, the processor 801 is specifically configured to:
[0126] determine whether the current transaction request of the transaction request party satisfies the smart contract according to the transaction fee of the current transaction request of the transaction request party and the transaction fee of the last execution transaction request of the transaction request party recorded in the smart contract.
[0127] If yes, the current transaction request of the transaction request party is pre-executed to obtain a pre-execution result of the transaction request.
[0128] In an implementable embodiment, when the processor 801 determines whether the transaction request currently submitted by the transaction request party satisfies the smart contract by executing the transaction fee of the transaction request currently submitted by the transaction request party and the transaction fee of the transaction request last executed by the transaction request party recorded in the smart contract, the processor 801 is specifically configured to:
[0129] determine whether the difference between the transaction fee of the transaction request currently submitted and the transaction fee of the transaction request last executed satisfies the preset fee difference included in the contract content of the smart contract;
[0130] If yes, it is determined that the transaction request currently submitted by the transaction request party satisfies the smart contract.
[0131] In an implementable embodiment, when the processor 801 executes the transaction request of the same transaction content of the transaction request party if the cumulative pre-execution information of the transaction request of the same transaction content of the transaction request party satisfies the contract execution condition in the contract content of the smart contract, and obtains the execution result of the transaction request of the same transaction content of the transaction request party, the processor 801 is specifically configured to:
[0132] If the cumulative pre-execution times of the transaction request of the same transaction content of the transaction request party satisfy the contract execution trigger times in the contract content of the smart contract, the transaction request of the same transaction content of the transaction request party is executed, and the execution result of the transaction request of the same transaction content of the transaction request party is obtained.
[0133] In the above manner, when the server executes the current transaction request of the transaction request party, the server determines the execution of the transaction by combining the historical transaction information of the transaction request of the same transaction content as the current transaction request executed by the transaction request party and the contract content of the smart contract, and successfully executes the transaction request currently submitted by the transaction request party when the contract execution condition set in the contract content of the smart contract is satisfied. The method increases the attack cost of the attacker, designs the contract content of the smart contract from multiple dimensions such as transaction time and transaction fee, and transaction times, to alleviate the influence of the attacker on the contract execution result by increasing the transaction fee to make his own transaction priority execution; by combining the historical transaction information, the transaction request of the same transaction content is successfully executed when the cumulative execution information of the transaction request of the same transaction content satisfies the set condition of the smart contract, which can avoid the unfair phenomenon of transaction execution caused by the fact that the transaction execution order depends on the transaction fee and the transaction is successfully executed only once, thereby effectively avoiding the influence of the attacker on the transaction execution result caused by maliciously increasing the transaction fee, and improving the transaction experience of the transaction request party.
[0134] The storage medium 802 stores program codes, which, when executed by the processor 801, cause the processor 801 to perform various steps in the transaction execution method of the blockchain according to various exemplary embodiments of the present application described in the "Exemplary Method" section of the present specification.
[0135] The processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.
[0136] The storage medium 802 is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The storage medium can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, and the like. The storage medium is any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The storage medium 802 in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, for storing program instructions and / or data.
[0137] Optionally, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to perform the following steps:
[0138] receiving a transaction request currently submitted by a transaction requester, the transaction request comprising: transaction content, a transaction fee, and a transaction time;
[0139] pre-executing the transaction request currently submitted by the transaction requester according to the transaction request currently submitted by the transaction requester and contract content of a smart contract corresponding to the transaction request and historical transaction information of the transaction requester recorded in the smart contract, to obtain a pre-execution result of the transaction request;
[0140] if cumulative pre-execution information of transaction requests of the same transaction content of the transaction requester meets a contract execution condition in the contract content of the smart contract, executing the transaction request of the same transaction content of the transaction requester to obtain an execution result of the transaction request of the same transaction content of the transaction requester.
[0141] In a possible implementation, when the processor 801 executes the pre-execution of the transaction request currently submitted by the transaction requester according to the transaction request currently submitted by the transaction requester and the contract content of the smart contract corresponding to the transaction request and the historical transaction information of the transaction requester recorded in the smart contract, the processor 801 is specifically configured to:
[0142] judging whether the transaction request currently submitted by the transaction requester meets the smart contract according to the transaction request currently submitted by the transaction requester, the historical execution transaction information of the transaction request of the transaction requester recorded in the smart contract, and the contract content of the smart contract.
[0143] if yes, pre-executing the transaction request currently submitted by the transaction requester and recording transaction information of the transaction request currently submitted by the transaction requester in the smart contract.
[0144] In a possible implementation, when the processor 801 executes the judging of whether the transaction request currently submitted by the transaction requester meets the smart contract according to the transaction request currently submitted by the transaction requester, the historical execution transaction information of the transaction request of the transaction requester recorded in the smart contract, and the contract content of the smart contract, the processor 801 is specifically configured to:
[0145] judging whether the transaction request currently submitted by the transaction requester meets the smart contract according to the transaction time of the transaction request currently submitted by the transaction requester and the last pre-execution transaction time of the transaction request of the transaction requester recorded in the smart contract.
[0146] if yes, pre-executing the transaction request currently submitted by the transaction requester to obtain a pre-execution result of the transaction request.
[0147] In one feasible implementation, when the processor 801 determines whether the transaction request currently submitted by the transaction requester satisfies the smart contract based on the transaction time of the transaction request currently submitted by the transaction requester and the transaction time of the transaction requester's last pre-execution transaction request recorded in the smart contract, it is specifically used for:
[0148] Determine whether the difference between the transaction time of the currently submitted transaction request and the transaction time of the last pre-executed transaction request meets the preset time difference included in the contract content of the smart contract;
[0149] If so, then the transaction request submitted by the transaction requester is deemed to satisfy the smart contract.
[0150] In a feasible implementation, when the processor 801 determines whether the transaction request currently submitted by the transaction requester satisfies the smart contract based on the transaction request currently submitted by the transaction requester, the transaction information of the transaction requester's historical execution of transaction requests recorded in the smart contract, and the contract content of the smart contract, it is specifically used for:
[0151] Based on the transaction fee of the transaction request currently submitted by the transaction requester and the transaction fee of the transaction requester's last execution of the transaction request recorded in the smart contract, determine whether the transaction request currently submitted by the transaction requester satisfies the smart contract.
[0152] If so, the transaction request currently submitted by the transaction requester is pre-executed to obtain the pre-execution result of the transaction request.
[0153] In one feasible implementation, when the processor 801 determines whether the transaction request currently submitted by the transaction requester satisfies the smart contract based on the transaction fee of the transaction request currently submitted by the transaction requester and the transaction fee of the transaction requester's last executed transaction request recorded in the smart contract, it is specifically used for:
[0154] Determine whether the difference between the transaction fee of the currently submitted transaction request and the transaction fee of the last executed transaction request meets the preset fee difference included in the smart contract's contract content;
[0155] If so, then the transaction request submitted by the transaction requester is deemed to satisfy the smart contract.
[0156] In a feasible implementation, when the processor 801 executes the transaction request with the same transaction content from the transaction requester if the cumulative pre-execution information of the transaction requester satisfies the contract execution conditions in the contract content of the smart contract, and obtains the execution result of the transaction request with the same transaction content from the transaction requester, it is specifically used for:
[0157] If the cumulative pre-execution times of the transaction request of the same transaction content of the transaction request party meet the contract execution trigger times in the contract content of the smart contract, the transaction request of the same transaction content of the transaction request party is executed, and an execution result of the transaction request of the same transaction content of the transaction request party is obtained.
[0158] In the above manner, when executing the current transaction request of the transaction request party, the server combines the historical transaction information of the transaction request of the same transaction content as the current transaction request executed by the transaction request party and the contract content of the smart contract to make a judgment on transaction execution, and when the contract execution condition set in the contract content of the smart contract is met, the current transaction request submitted by the transaction request party is successfully executed. The method increases the attack cost of the attacker, designs the contract content of the smart contract from multiple dimensions such as transaction time and transaction fee, and transaction times, to alleviate the influence of the attacker on the contract execution result by increasing the transaction fee to make his own transaction preferentially executed; by combining the historical transaction information, the transaction request of the same transaction content is successfully executed only when the cumulative execution information of the transaction request of the same transaction content meets the set condition of the smart contract, so as to avoid the unfair phenomenon of transaction execution caused by the fact that the transaction execution order depends on the transaction fee and the transaction is successfully executed only once, thereby effectively avoiding the influence of the attacker on the transaction execution result caused by maliciously increasing the transaction fee, and improving the transaction experience of the transaction request party.
[0159] In the embodiments of the present application, the computer program can also execute other machine-readable instructions when executed by the processor to perform the methods described in the embodiments. For specific method steps and principles, refer to the description of the embodiments, which will not be described in detail here.
[0160] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0161] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place, or distributed on multiple network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0162] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software functional units.
[0163] The integrated unit realized in the form of software functional units can be stored in a computer readable storage medium. The software functional units stored in a storage medium include a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
Claims
1. A method for executing a transaction of a blockchain, characterized in that, The method is applied to a blockchain node, and a smart contract is deployed on the blockchain node, and the method comprises: receiving a transaction request submitted by a transaction requestor, the transaction request comprising: transaction content, a transaction fee, and a transaction time; pre-executing the transaction request submitted by the transaction requestor according to the transaction request submitted by the transaction requestor, contract content of a smart contract corresponding to the transaction request, and historical transaction information of the transaction requestor recorded in the smart contract, to obtain a pre-execution result of the transaction request; if cumulative pre-execution information of transaction requests with the same transaction content of the transaction requestor meets a contract execution condition in the contract content of the smart contract, executing the transaction requests with the same transaction content of the transaction requestor to obtain an execution result of the transaction requests with the same transaction content of the transaction requestor.
2. The method of claim 1, wherein, The pre-execution of the transaction request submitted by the transaction requestor according to the transaction request submitted by the transaction requestor, the contract content of the smart contract corresponding to the transaction request, and the historical transaction information of the transaction requestor recorded in the smart contract comprises: judging whether the transaction request submitted by the transaction requestor meets the smart contract according to the transaction request submitted by the transaction requestor, transaction information of the transaction request historically executed by the transaction requestor recorded in the smart contract, and the contract content of the smart contract; if yes, pre-executing the transaction request submitted by the transaction requestor, and recording transaction information of the transaction request submitted by the transaction requestor in the smart contract.
3. The method of claim 2, wherein, The judgment of whether the transaction request submitted by the transaction requestor meets the smart contract according to the transaction request submitted by the transaction requestor, the transaction information of the transaction request historically executed by the transaction requestor recorded in the smart contract, and the contract content of the smart contract comprises: judging whether the transaction request submitted by the transaction requestor meets the smart contract according to a transaction time of the transaction request submitted by the transaction requestor and a transaction time of the transaction request last pre-executed by the transaction requestor recorded in the smart contract; if yes, pre-executing the transaction request submitted by the transaction requestor to obtain a pre-execution result of the transaction request.
4. The method of claim 3, wherein, The judgment of whether the transaction request submitted by the transaction requestor meets the smart contract according to the transaction time of the transaction request submitted by the transaction requestor and the transaction time of the transaction request last pre-executed by the transaction requestor recorded in the smart contract comprises: determining whether a difference between the transaction time of the transaction request submitted by the transaction requestor and the transaction time of the transaction request last pre-executed by the transaction requestor meets a preset time difference included in the contract content of the smart contract; if yes, judging that the transaction request submitted by the transaction requestor meets the smart contract.
5. The method of claim 2, wherein, The step of determining whether the transaction request currently submitted by the transaction requester satisfies the smart contract based on the transaction request currently submitted by the transaction requester, the transaction information of the transaction requester's historical execution of the transaction request recorded in the smart contract, and the contract content of the smart contract includes: Based on the transaction fee of the transaction request currently submitted by the transaction requester and the transaction fee of the transaction requester's last execution of the transaction request recorded in the smart contract, it is determined whether the transaction request currently submitted by the transaction requester satisfies the smart contract. If so, the transaction request currently submitted by the transaction requester is pre-executed to obtain the pre-execution result of the transaction request.
6. The method of claim 5, wherein, The step of determining whether the transaction request currently submitted by the transaction requester satisfies the smart contract based on the transaction fee of the transaction request currently submitted by the transaction requester and the transaction fee of the transaction requester's last execution of the transaction request recorded in the smart contract includes: Determine whether the difference between the transaction fee of the currently submitted transaction request and the transaction fee of the last executed transaction request satisfies the preset fee difference included in the contract content of the smart contract; If so, it is determined that the transaction request currently submitted by the transaction requester satisfies the smart contract.
7. The method of claim 1, wherein, If the cumulative pre-execution information of the same transaction requests from the transaction requester satisfies the contract execution conditions in the smart contract's contract content, then the same transaction requests from the transaction requester are executed to obtain the execution result of the same transaction requests from the transaction requester, including: If the cumulative pre-execution count of the same transaction request from the transaction requester meets the contract execution trigger count in the contract content of the smart contract, then the same transaction request from the transaction requester is executed, and the execution result of the same transaction request from the transaction requester is obtained. 8.A transaction execution apparatus of a blockchain, characterized by, Applied to blockchain nodes, on which smart contracts are deployed, the device includes: a receiving module, a pre-execution module, and an execution module; The receiving module is used to receive the transaction request currently submitted by the transaction requester. The transaction request includes: transaction content, transaction fee, and transaction time. The pre-execution module is used to pre-execute the transaction request currently submitted by the transaction requester based on the transaction request currently submitted by the transaction requester, the contract content of the smart contract corresponding to the transaction request, and the historical transaction information of the transaction requester recorded in the smart contract, so as to obtain the pre-execution result of the transaction request. The execution module is used to execute the transaction request of the same transaction content of the transaction requester if the cumulative pre-execution information of the transaction requester for the same transaction content meets the contract execution conditions in the contract content of the smart contract, and obtain the execution result of the transaction request of the same transaction content of the transaction requester.
9. An electronic device, comprising: include: The device includes a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus. The processor executes the program instructions to perform the steps of the blockchain transaction execution method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, performs the steps of the blockchain transaction execution method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Contract execution method and device based on block chain, equipment and storage medium
CN112070503A