Block chain transaction processing method and device, electronic equipment and storage medium

Through the pre-execution process, all state data of the blockchain hardware board is obtained and written to the blockchain hardware board, and challenges in the execution efficiency and security of smart contracts in the blockchain ecosystem are solved, achieving more efficient and secure smart contract execution.

CN119515387APending Publication Date: 2025-02-25BEIJING MICROCHIP EDGE COMPUTING RES INST
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411584450.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the existing blockchain ecosystem, smart contracts access and processing on-chain state data relies on the software execution environment of blockchain virtual machines, resulting in security, scalability, and execution performance challenges.

Method used

Through the pre-execution process, all missing status data are determined and obtained at one time, reducing the number of interactions between the hardware and the blockchain state database, and writing the status data to the blockchain hardware board at one time, thereby improving the efficiency of smart contract execution and security.

Benefits of technology

It improves the efficiency and security of smart contract execution, reduces the number of interactions between hardware and blockchain state database, and improves the performance of blockchain transaction processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515387A_ABST
    Figure CN119515387A_ABST
Patent Text Reader

Abstract

The invention provides a block chain transaction processing method and device, electronic equipment and a storage medium, and the method comprises the steps that a block chain hardware board card sends a preprocessing result to an upper computer, and the preprocessing result is obtained by preprocessing initial transaction data packets of multiple to-be-executed transactions according to an intelligent contract; the preprocessing result is used for indicating the to-be-executed transaction lacking the state data of the smart contract in the execution process, receiving target state data corresponding to the preprocessing result and sent by the upper computer, writing the target state data into an initial transaction data packet of the corresponding to-be-executed transaction to obtain a target transaction data packet, and sending the target transaction data packet to the upper computer; and then batch processing is performed on the target transaction data packet and / or the initial transaction data packet according to the smart contract to perform the plurality of to-be-executed transactions in batches to obtain the transaction execution result, so that the number of times of interaction between hardware and the block chain state database can be reduced, and the efficiency and security of smart contract execution can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of blockchain technology, and in particular to a blockchain transaction processing method, device, electronic device and storage medium. Background Art

[0002] In the existing blockchain ecosystem, smart contracts access and process on-chain state data mainly relying on the software execution environment of the blockchain virtual machine. However, this software-dependent execution mode faces several challenges in terms of security, scalability, and execution performance: the software execution environment may be subject to various attacks, including but not limited to memory corruption, side channel attacks, and smart contract vulnerabilities. With the increase in network participants and transaction volume, software processing capabilities may become a bottleneck for system expansion. The software execution speed is limited by the computing power of the central processing unit (CPU).

[0003] Therefore, how to improve the efficiency of blockchain transaction processing and enhance the overall performance of the blockchain network has become a key research direction. Summary of the invention

[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0005] To this end, the purpose of the present disclosure is to propose a blockchain transaction processing method, device, electronic device and storage medium, whereby, through the pre-execution process of the transaction to be executed, all the missing status data can be determined at one time, and then, all the missing status data can be read at one time according to the preprocessing result of the pre-execution process, and the status data can be written to the blockchain hardware board at one time, thereby reducing the number of interactions between the hardware and the blockchain status database and improving the efficiency and security of smart contract execution.

[0006] The blockchain transaction processing method proposed in the first aspect of the present disclosure is executed by a blockchain hardware board, and the method includes:

[0007] Sending preprocessing results to the upper computer, wherein the preprocessing results are obtained by preprocessing the initial transaction data packets of multiple pending transactions according to the smart contract, and the preprocessing results are used to indicate pending transactions that lack the status data of the smart contract during the execution process;

[0008] Receive target state data corresponding to the preprocessing result sent by the host computer;

[0009] Writing the target state data into the initial transaction data packet of the corresponding transaction to be executed to obtain the target transaction data packet;

[0010] The target transaction data packet and / or the initial transaction data packet are batch processed according to the smart contract to batch execute multiple pending transactions to obtain transaction execution results.

[0011] The blockchain transaction processing method proposed in the second aspect of the present disclosure is executed by a host computer, and the method includes:

[0012] Receiving a preprocessing result sent by a blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks state data of the smart contract during execution;

[0013] Parsing the preprocessing result to obtain a target transaction identifier, wherein the target transaction identifier is an identifier of a transaction to be executed that lacks state data of a smart contract;

[0014] Query the target state data corresponding to the target transaction identifier from the blockchain;

[0015] Send target status data to the blockchain hardware board.

[0016] The blockchain transaction processing device proposed in the third aspect of the present disclosure is executed by a blockchain hardware board, and the device includes:

[0017] The first sending module is used to send a preprocessing result to the upper computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks the status data of the smart contract during the execution process;

[0018] A first receiving module, used for receiving target state data corresponding to the preprocessing result sent by the host computer;

[0019] A writing module, used for writing the target state data into the initial transaction data packet of the corresponding transaction to be executed, so as to obtain a target transaction data packet;

[0020] The first processing module is used to batch process the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple transactions to be executed to obtain transaction execution results.

[0021] The blockchain transaction processing device proposed in the fourth aspect of the present disclosure is executed by a host computer, and the device includes:

[0022] A second receiving module is used to receive a preprocessing result sent by a blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks the status data of the smart contract during the execution process;

[0023] A second processing module is used to parse the preprocessing result to obtain a target transaction identifier, wherein the target transaction identifier is an identifier of a transaction to be executed that lacks state data of a smart contract;

[0024] A query module, used to query the target state data corresponding to the target transaction identifier from the blockchain;

[0025] The second sending module is used to send target status data to the blockchain hardware board.

[0026] The electronic device proposed in the fifth aspect embodiment of the present disclosure includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the blockchain transaction processing method proposed in the first aspect embodiment of the present disclosure is implemented, or the blockchain transaction processing method proposed in the second aspect embodiment of the present disclosure is implemented.

[0027] The sixth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the blockchain transaction processing method proposed in the first aspect embodiment of the present disclosure, or implements the blockchain transaction processing method proposed in the second aspect embodiment of the present disclosure.

[0028] The seventh aspect embodiment of the present disclosure proposes a computer program product. When the instructions in the computer program product are executed by a processor, the blockchain transaction processing method proposed in the first aspect embodiment of the present disclosure is executed, or the blockchain transaction processing method proposed in the second aspect embodiment of the present disclosure is implemented.

[0029] The blockchain transaction processing method, device, electronic device and storage medium provided by the present disclosure have at least the following beneficial effects: the blockchain hardware board sends a preprocessing result to an upper computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks the status data of the smart contract during the execution process, and then receives the target status data corresponding to the preprocessing result sent by the upper computer, and then writes the target status data into the initial transaction data packet of the corresponding transaction to be executed to obtain the target transaction data packet, and then batch processes the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple transactions to be executed to obtain the transaction execution result, thereby, through the pre-execution process, all the missing status data can be determined at one time, and then, all the missing status data can be read at one time according to the preprocessing result of the pre-execution process, and the status data can be written to the blockchain hardware board at one time, thereby reducing the number of interactions between the hardware and the blockchain status database, and improving the efficiency and security of smart contract execution.

[0030] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0032] Figure 1 It is a flowchart of a blockchain transaction processing method proposed in an embodiment of the present disclosure;

[0033] Figure 2 is a flowchart of a blockchain transaction processing method proposed in another embodiment of the present disclosure;

[0034] Figure 3 is a flowchart of a blockchain transaction processing method proposed in another embodiment of the present disclosure;

[0035] Figure 4 is a schematic diagram of a target knowledge graph proposed in an embodiment of the present disclosure;

[0036] Figure 5 It is a structural diagram of a blockchain transaction processing device proposed in one embodiment of the present disclosure;

[0037] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0038] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and are not to be construed as limitations of the present disclosure. On the contrary, the embodiments of the present disclosure include all changes, modifications, and equivalents that fall within the spirit and connotation of the appended claims.

[0039] Figure 1 It is a flowchart of a blockchain transaction processing method proposed in an embodiment of the present disclosure.

[0040] Among them, it should be noted that the executor of the blockchain transaction processing method of this embodiment is a blockchain transaction processing device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, and the electronic device can include but is not limited to a terminal, a server, etc. For example, the terminal can be a mobile phone, a handheld computer, etc.

[0041] like Figure 1 As shown, the blockchain transaction processing method is executed by the blockchain hardware board, and the method includes:

[0042] The blockchain transaction processing method in the disclosed embodiment is executed by a blockchain hardware board. The blockchain hardware board is installed on a server running a blockchain node through a PCIE interface. The hardware board and the CPU and memory of the server host transmit data through the Peripheral Component Interconnect Express (PCIE) protocol. It uses a hardware board mode to replace the virtual machine in the Fabric smart contract. It can be directly used to execute smart contracts and can also support the expansion of the blockchain network to accommodate more users and smart contract applications.

[0043] S101: Sending a preprocessing result to a host computer, wherein the preprocessing result is obtained by preprocessing initial transaction data packets of multiple pending transactions according to the smart contract, and the preprocessing result is used to indicate: pending transactions that lack status data of smart contracts during execution.

[0044] Among them, the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract. The preprocessing result is used to indicate: the transactions to be executed lack the status data of the smart contract during the execution process.

[0045] Among them, a smart contract is a computer program that automatically executes, manages and enforces the terms of a contract. Specifically, a smart contract is a computer program or transaction protocol based on blockchain technology that allows trusted transactions without a third party.

[0046] In the blockchain, a transaction is a digital record that records the exchange of data or assets between participants in the network. It can be the transfer of ownership of cryptocurrency or the exchange of other types of data or assets.

[0047] Among them, the transactions currently to be executed in the blockchain are pending transactions.

[0048] The data packet consisting of data related to the transaction to be executed is the initial transaction data packet, which may include: transaction input parameters, calling methods and other data.

[0049] The state data of a smart contract refers to the current storage of the contract on the blockchain. These data represent the current state of the contract, including all variable values, balances, and other related information. These state data continue to change with the addition of each block.

[0050] For example, a transaction to be executed may be: "User A transfers x million yuan to user B". The initial transaction data may be, for example, transferor: user A, recipient: user B, transfer amount: x million yuan. The status data may be, for example, account balance of user A, account balance of user B, etc., without any restriction.

[0051] Optionally, in some embodiments, before sending the preprocessing result to the host computer, the blockchain hardware board may be a receiving device for an initial transaction data packet of a transaction to be executed sent by the host computer, wherein the transaction to be executed has a corresponding smart contract, and preprocessing multiple initial transaction data packets according to the smart contract to obtain the preprocessing result.

[0052] That is to say, in the embodiment of the present disclosure, the initial transaction data packet and the smart contract can be moved to the operating space of the blockchain hardware board for operation, so as to perform pre-execution processing on multiple transactions to be executed and obtain pre-processing results.

[0053] Optionally, in some embodiments, multiple initial transaction data are preprocessed according to the smart contract to obtain a preprocessing result. Multiple initial transaction data packets are preprocessed according to the smart contract, and during the preprocessing process, it is determined whether the corresponding transaction to be executed lacks status data. When it is determined that the transaction to be executed lacks status data, the target transaction identifier of the transaction to be executed is determined, and then the preprocessing result is generated based on at least one target transaction identifier.

[0054] Among them, the target transaction identifier is the identification information of the transaction to be executed that lacks the status data of the smart contract. The identification information can be, for example: transaction ID, transaction amount, etc., without limitation.

[0055] That is to say, in the embodiments of the present disclosure, the blockchain hardware board may perform pre-execution processing on multiple pending transactions. If, during the pre-execution process, it is found that the calculation parameters of the transaction lack the state necessary for the transaction execution, the target transaction identifier corresponding to the pending transaction may be determined. When the multiple pending transactions are pre-executed by the blockchain hardware board, all transactions lacking state data in the multiple pending transactions are marked (i.e., all target transaction identifiers of the pending transactions lacking state data may be determined). Then, the multiple target transaction identifiers may be packaged as pre-processing results according to the specified data structure and communication protocol, and the pre-processing results may be sent to the host computer so that the host computer can feedback the corresponding state data according to the pre-processing results. For details, please refer to the subsequent embodiments and will not be repeated here.

[0056] S102: Receive target state data corresponding to the preprocessing result sent by the host computer.

[0057] In the embodiment of the present disclosure, after the preprocessing result is sent to the host computer, status data corresponding to the preprocessing result sent by the host computer may be received.

[0058] S103: writing the target state data into the initial transaction data packet of the corresponding transaction to be executed to obtain the target transaction data packet.

[0059] Among them, after the target state data corresponding to the transaction to be executed is written into the corresponding initial transaction data packet, the target transaction data packet can be obtained.

[0060] In the disclosed embodiment, after receiving the target state data corresponding to the preprocessing result sent by the host computer, the target state data may be written into an initial transaction data packet of the corresponding transaction to be executed to obtain a target transaction data packet.

[0061] That is to say, in the embodiment of the present disclosure, after determining the target state data, the target state data may be written into the initial transaction data packet of the corresponding transaction to be executed in the blockchain hardware board to obtain the target transaction data packet.

[0062] S104: Batch process the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple pending transactions to obtain transaction execution results.

[0063] The transaction execution result refers to the final status of a transaction after it is processed and confirmed on the blockchain network. This status usually reflects whether the transaction is successfully completed and the impact of the transaction on the blockchain status, which is not restricted.

[0064] In the disclosed embodiment, after the target status data is written into the initial transaction data packet of the corresponding transaction to be executed to obtain the target transaction data packet, it can be ensured that the status data required for all transactions to be executed already exist. Thus, the target transaction data packet and / or the initial transaction data packet can be batch processed according to the smart contract to batch execute multiple transactions to be executed at one time and obtain the batch execution results of all transactions to be executed.

[0065] In the embodiment of the present disclosure, if the preprocessing result indicates that all pending transactions are not lacking in corresponding status data, that is, the initial transaction data packet can already support the execution of pending transactions, then the initial transaction data packet can be batch processed according to the smart contract to execute the pending transactions in batches. If the preprocessing result indicates that all pending transactions are lacking in corresponding status data, then the target transaction data packet can be batch processed according to the smart contract to execute the pending transactions in batches. If the preprocessing result indicates that some pending transactions are not lacking in corresponding status data, then the initial transaction data packet and the target transaction data packet can be batch processed according to the smart contract to execute the pending transactions in batches. There is no restriction on this.

[0066] In the disclosed embodiment, when accessing the status data, multiple pending transactions can be written into the blockchain hardware board at one time. During the calculation process, all the blockchain states to be accessed are marked at one time and returned to the host computer. After the host computer makes a unified query, it will return all the status data to the blockchain hardware board at one time, and the blockchain hardware board will batch execute all pending transactions accordingly. This simple and efficient access technology can greatly improve the performance of the blockchain hardware board in processing smart contract transactions. In addition, the blockchain hardware board has a proprietary memory protection mechanism that can prevent transaction data and status data from being stolen during the interaction between the two, which greatly improves the security of the status data.

[0067] Optionally, in some embodiments, after the target transaction data packet and / or the initial transaction data packet are batch processed according to the smart contract to batch execute multiple transactions to be executed to obtain transaction execution results, the transaction execution results can be sent to the host computer, thereby prompting the host computer to feed back the batch execution results of multiple transactions to be executed to the blockchain block.

[0068] In the disclosed embodiment, when the host computer queries the target status data according to the preprocessing result, the pre-execution process of the transaction to be executed will be released from the blockchain hardware board, thereby avoiding occupying the memory resources of the blockchain hardware board, optimizing process scheduling, reducing the system burden, and enhancing system stability.

[0069] In the disclosed embodiment, the blockchain hardware board sends a preprocessing result to the host computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks the status data of the smart contract during the execution process, and then receives the target status data corresponding to the preprocessing result sent by the host computer, and then writes the target status data into the initial transaction data packet of the corresponding transaction to be executed to obtain the target transaction data packet, and then batch processes the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple transactions to be executed to obtain the transaction execution result, thereby, through the pre-execution process, all the missing status data can be determined at one time, and then, all the missing status data can be read at one time according to the preprocessing result of the pre-execution process, and the status data can be written to the blockchain hardware board at one time, thereby reducing the number of interactions between the hardware and the blockchain status database, and improving the efficiency and security of smart contract execution.

[0070] Figure 2 It is a flowchart of a blockchain transaction processing method proposed in an embodiment of the present disclosure.

[0071] Among them, it should be noted that the executor of the blockchain transaction processing method of this embodiment is a blockchain transaction processing device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, and the electronic device can include but is not limited to a terminal, a server, etc. For example, the terminal can be a mobile phone, a handheld computer, etc.

[0072] like Figure 2 As shown, the blockchain transaction processing method includes:

[0073] S201: Receive a preprocessing result sent by a blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks status data of the smart contract during execution.

[0074] The blockchain transaction processing method described in the embodiments of the present disclosure may be executed by a host computer, which may include: a blockchain base chain and a smart contract parallel programming tool, and data transmission between the host computer and the blockchain hardware board is based on the PCIE protocol.

[0075] Optionally, in some embodiments, the host computer can also determine multiple transactions to be executed from the transaction pool of the blockchain, determine the initial transaction data packet corresponding to each transaction to be executed, and then send the initial transaction data packet corresponding to each transaction to be executed to the blockchain hardware board.

[0076] That is to say, in the embodiment of the present disclosure, the smart contract parallel programming tool in the host computer collects pending transactions from the transaction pool in an asynchronous manner, and determines the core information such as input parameters and calling methods corresponding to each pending transaction, and packages the aforementioned information into an initial transaction data packet according to the specified data structure and communication protocol, and sends the initial transaction data packet corresponding to each pending transaction to the blockchain hardware board based on the PCIE protocol, so that the blockchain hardware board can pre-process multiple initial transaction data packets according to the smart contract to obtain corresponding pre-processing results.

[0077] In the disclosed embodiment, the smart contract parallel programming tool in the host computer can receive the preprocessing results sent by the blockchain hardware board, and then trigger the execution of subsequent blockchain transaction processing methods according to the preprocessing results. For details, please refer to the subsequent embodiments and will not be repeated here.

[0078] S202: Parse the preprocessing result to obtain a target transaction identifier, wherein the target transaction identifier is an identifier of a transaction to be executed that lacks status data of a smart contract.

[0079] In the disclosed embodiment, after receiving the preprocessing result sent by the blockchain hardware board, the preprocessing result is parsed to obtain the target transaction identifier.

[0080] In the disclosed embodiment, since the preprocessing result is obtained by the blockchain hardware board packaging at least one target transaction identifier according to the specified data structure and communication protocol, the smart contract parallel programming tool in the host computer can receive the preprocessing result sent by the blockchain hardware board, and then parse the processing result according to the specified data structure and communication protocol to obtain the target transaction identifier.

[0081] S203: Query the target state data corresponding to the target transaction identifier from the blockchain.

[0082] In the disclosed embodiment, after the smart contract parallel programming tool in the host computer parses the preprocessing result to obtain the target transaction identifier, it can read the target state data corresponding to the target transaction identifier in the state database of the blockchain according to the target transaction identifier.

[0083] S204: Send target status data to the blockchain hardware board.

[0084] In the disclosed embodiment, after querying the target status data corresponding to the target transaction identifier from the blockchain, the smart contract parallel programming tool in the host computer can send the target status data to the blockchain hardware board based on the PCIE protocol to provide the necessary conditions for the blockchain hardware board to execute the pending transaction.

[0085] In the embodiments of the present disclosure, see Figure 3 , Figure 3 It is a schematic diagram of the blockchain transaction processing flow proposed by another embodiment of the present disclosure. The smart contract parallel programming tool in the upper computer can obtain multiple pending transactions from the transaction pool of the blockchain bottom chain, and write the initial transaction data packets of the pending transactions into the blockchain hardware board in batches. The blockchain hardware board will pre-process the initial transaction data packet according to the smart contract to obtain the pre-processing result, and feed the pre-processing result back to the smart contract parallel programming tool. Then, the smart contract parallel programming tool will parse the pre-processing result to obtain the target transaction identifier, and then obtain the target state data according to the target transaction identifier, and write the target state data into the blockchain hardware board in batches. The blockchain hardware board will batch process the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple pending transactions to obtain transaction execution results, and then send the transaction execution results to the smart contract parallel programming tool. The smart contract parallel programming tool will return the transaction execution results in batches to the candidate transaction blocks in the blockchain bottom chain. The blockchain bottom chain will execute consensus, generate new data blocks according to the transaction execution results, and then update the ledger according to the new data blocks to obtain a new ledger read-write set.

[0086] In the disclosed embodiment, the host computer receives the preprocessing result sent by the blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed that lacks the status data of the smart contract during the execution process, and then the preprocessing result is parsed to obtain the target transaction identifier, wherein the target transaction identifier is the identifier of the transaction to be executed that lacks the status data of the smart contract, and then the target status data corresponding to the target transaction identifier is queried from the blockchain, and then the target status data is sent to the blockchain hardware board. As a result, the host computer can query multiple target status data required for all transactions to be executed at one time according to the preprocessing result fed back by the blockchain hardware board, thereby reducing the number of visits to the blockchain status database, and the query efficiency of the target status data is relatively high.

[0087] Figure 4 It is a structural diagram of a blockchain transaction processing device proposed in one embodiment of the present disclosure.

[0088] like Figure 4 As shown, the blockchain transaction processing device 40 is executed by a blockchain hardware board, including:

[0089] The first sending module 401 is used to send a preprocessing result to the upper computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple pending transactions according to the smart contract, and the preprocessing result is used to indicate: pending transactions that lack the status data of the smart contract during the execution process;

[0090] The first receiving module 402 is used to receive target state data corresponding to the preprocessing result sent by the host computer;

[0091] The writing module 403 is used to write the target state data into the initial transaction data packet of the corresponding transaction to be executed, so as to obtain the target transaction data packet;

[0092] The first processing module 404 is used to batch process the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple transactions to be executed to obtain transaction execution results.

[0093] In some embodiments of the present disclosure, the first sending module 401 is further configured to:

[0094] Before sending the preprocessing result to the upper computer, receiving an initial transaction data packet of the transaction to be executed sent by the upper computer, wherein the transaction to be executed has a corresponding smart contract;

[0095] A plurality of initial transaction data packets are preprocessed according to the smart contract to obtain a preprocessing result.

[0096] In some embodiments of the present disclosure, the first sending module 401 is further configured to:

[0097] Preprocessing multiple initial transaction data packets according to the smart contract, and determining whether the corresponding pending transactions are missing status data during the preprocessing process;

[0098] In the case where it is determined that the transaction to be executed lacks status data, determining a target transaction identifier of the transaction to be executed;

[0099] A preprocessing result is generated according to at least one target transaction identifier.

[0100] In some embodiments of the present disclosure, the first processing module 404 is further configured to:

[0101] After batch processing of the target transaction data packet and / or the initial transaction data packet is performed according to the smart contract to batch execute multiple pending transactions to obtain transaction execution results, the transaction execution results are sent to the upper computer.

[0102] It should be noted that the aforementioned explanation of the blockchain transaction processing method is also applicable to the blockchain transaction processing device of this embodiment and will not be repeated here.

[0103] In the disclosed embodiment, the blockchain hardware board sends a preprocessing result to the host computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: a transaction to be executed that lacks the status data of the smart contract during the execution process, and then receives the target status data corresponding to the preprocessing result sent by the host computer, and then writes the target status data into the initial transaction data packet of the corresponding transaction to be executed to obtain the target transaction data packet, and then batch processes the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple transactions to be executed to obtain the transaction execution result, thereby, through the pre-execution process, all the missing status data can be determined at one time, and then, all the missing status data can be read at one time according to the preprocessing result of the pre-execution process, and the status data can be written to the blockchain hardware board at one time, thereby reducing the number of interactions between the hardware and the blockchain status database, and improving the efficiency and security of smart contract execution.

[0104] Figure 5 It is a structural diagram of a blockchain transaction processing device proposed in one embodiment of the present disclosure.

[0105] like Figure 5 As shown, the blockchain transaction processing device 50 is executed by a host computer and includes:

[0106] The second receiving module 501 is used to receive the preprocessing result sent by the blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed that lacks the status data of the smart contract during the execution process;

[0107] The second processing module 502 is used to parse the preprocessing result to obtain a target transaction identifier, wherein the target transaction identifier is an identifier of a transaction to be executed that lacks state data of a smart contract;

[0108] A query module 503, used to query the target state data corresponding to the target transaction identifier from the blockchain;

[0109] The second sending module 504 is used to send target state data to the blockchain hardware board.

[0110] It should be noted that the aforementioned explanation of the blockchain transaction processing method is also applicable to the blockchain transaction processing device of this embodiment and will not be repeated here.

[0111] In the disclosed embodiment, the host computer receives the preprocessing result sent by the blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed that lacks the status data of the smart contract during the execution process, and then the preprocessing result is parsed to obtain the target transaction identifier, wherein the target transaction identifier is the identifier of the transaction to be executed that lacks the status data of the smart contract, and then the target status data corresponding to the target transaction identifier is queried from the blockchain, and then the target status data is sent to the blockchain hardware board. As a result, the host computer can query multiple target status data required for all transactions to be executed at one time according to the preprocessing result fed back by the blockchain hardware board, thereby reducing the number of visits to the blockchain status database, and the query efficiency of the target status data is relatively high.

[0112] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 6 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0113] like Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0114] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0115] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0116] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive").

[0117] although Figure 6 Not shown, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (Compact Disc Read Only Memory; hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (Digital Video Disc Read Only Memory; hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0118] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0119] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable the human body to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0120] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the blockchain transaction processing method mentioned in the aforementioned embodiment.

[0121] In order to implement the above embodiments, the present disclosure also proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the blockchain transaction processing method proposed in the above embodiments of the present disclosure is implemented.

[0122] In order to implement the above embodiments, the present disclosure also proposes a computer program product. When the instruction processor in the computer program product is executed, the blockchain transaction processing method proposed in the above embodiments of the present disclosure is executed.

[0123] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0124] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0125] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.

[0126] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.

[0127] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0128] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0129] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0130] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0131] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0132] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.

Claims

1. A blockchain transaction processing method, characterized in that: The method is executed by a blockchain hardware board, and includes: Sending a preprocessing result to a host computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed that lacks the status data of the smart contract during the execution process; Receiving target state data corresponding to the preprocessing result sent by the host computer; Writing the target state data into the initial transaction data packet corresponding to the transaction to be executed to obtain a target transaction data packet; The target transaction data packet and / or the initial transaction data packet are batch processed according to the smart contract to batch execute a plurality of the to-be-executed transactions to obtain a transaction execution result.

2. The method according to claim 1, characterized in that Before sending the preprocessing result to the upper computer, the method further includes: Receiving an initial transaction data packet of the transaction to be executed sent by the host computer, wherein the transaction to be executed has a corresponding smart contract; Preprocessing the plurality of initial transaction data packets according to the smart contract to obtain a preprocessing result.

3. The method according to claim 2, characterized in that Preprocessing the plurality of initial transaction data according to the smart contract to obtain a preprocessing result includes: Preprocessing the plurality of initial transaction data packets according to the smart contract, and determining during the preprocessing process whether the corresponding to-be-executed transaction lacks the status data; In the case where it is determined that the transaction to be executed lacks the status data, determining a target transaction identifier of the transaction to be executed; The preprocessing result is generated according to at least one of the target transaction identifiers.

4. The method according to any one of claims 1 to 3, characterized in that: After batch processing the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute a plurality of the to-be-executed transactions to obtain transaction execution results, the method further includes: Send the transaction execution result to the host computer.

5. A blockchain transaction processing method, characterized in that: The method is executed by a host computer and includes: Receiving a preprocessing result sent by a blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed that lacks the status data of the smart contract during the execution process; Parsing the preprocessing result to obtain a target transaction identifier, wherein the target transaction identifier is an identifier of a transaction to be executed that lacks state data of a smart contract; Querying the target state data corresponding to the target transaction identifier from the blockchain; Send the target state data to the blockchain hardware board.

6. The method according to claim 5, characterized in that The method further comprises: Determine a plurality of pending transactions from a transaction pool of the blockchain; Determining an initial transaction data packet corresponding to each of the transactions to be executed; Sending the initial transaction data packet corresponding to each of the transactions to be executed to the blockchain hardware board.

7. The method according to claim 5 or 6, characterized in that The method further comprises: Receiving the transaction execution result sent by the blockchain hardware board; The transaction execution results are written in batches into blocks of the blockchain.

8. A blockchain transaction processing device, characterized in that: Executed by a blockchain hardware board, the device includes: A first sending module is used to send a preprocessing result to an upper computer, wherein the preprocessing result is obtained by preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed lacks the status data of the smart contract during the execution process; A first receiving module, used for receiving target state data corresponding to the preprocessing result sent by the host computer; A writing module, used for writing the target state data into the initial transaction data packet corresponding to the transaction to be executed, so as to obtain a target transaction data packet; The first processing module is used to batch process the target transaction data packet and / or the initial transaction data packet according to the smart contract to batch execute multiple transactions to be executed to obtain transaction execution results.

9. A blockchain transaction processing method, characterized in that: The method is executed by a host computer and includes: A second receiving module is used to receive a preprocessing result sent by a blockchain hardware board, wherein the preprocessing result is obtained by the blockchain hardware board preprocessing the initial transaction data packets of multiple transactions to be executed according to the smart contract, and the preprocessing result is used to indicate: the transaction to be executed lacks the status data of the smart contract during the execution process; A second processing module is used to parse the preprocessing result to obtain a target transaction identifier, wherein the target transaction identifier is an identifier of a transaction to be executed that lacks state data of a smart contract; A query module, used to query the target state data corresponding to the target transaction identifier from the blockchain; The second sending module is used to send the target state data to the blockchain hardware board.

10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Block chain contract processing method and device, electronic equipment and storage medium

    CN121255406A

  • Blockchain contract processing method and apparatus, electronic device, and storage medium

    CN121255406B