Transaction execution method and blockchain node in blockchain system
By introducing multiple management processes to execute transaction plaintexts concurrently in the blockchain system, the problem of low transaction execution efficiency is solved, and more efficient transaction processing and system performance improvement is achieved.
Patent Information
- Application Number
- CN202310493508.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-04-28
AI Technical Summary
In existing blockchain systems, transaction execution efficiency is low, the control process is too burdened, and it is difficult to effectively decouple control flows and data flows.
Multiple management processes are used to run concurrently, manage transaction plain text and provide analysis results. The control process is only responsible for the distribution of transaction hashing and indication information and consensus proposals, and the calculation process executes specific transactions.
It realizes more efficient transaction execution, reduces the burden on the control process, and improves the performance of the blockchain system.
Smart Images

Figure CN116431312B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification belong to the field of blockchain, and more particularly to a transaction execution method and blockchain node in a blockchain system. Background Art
[0002] Blockchain is a novel application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. In a blockchain system, data blocks are linked sequentially in chronological order to form a chain-like data structure, cryptographically guaranteeing an unalterable and unforgeable distributed ledger. Due to its decentralized, tamper-proof, and autonomous nature, blockchain is gaining increasing attention and application. Summary of the Invention
[0003] The object of the present invention is to provide a transaction execution method and a blockchain node in a blockchain system.
[0004] In a first aspect, a transaction execution method in a blockchain system is provided, the method being executed by a blockchain node in the blockchain system, the blockchain node comprising a control process, multiple management processes, and multiple computing processes. The method comprises: the control process obtaining multiple analysis results of multiple first transactions from the multiple management processes, the analysis results comprising a transaction hash, read / write information, and instruction information of the corresponding first transactions; the control process dividing the multiple analysis results into multiple data groups based on the read / write information included in each of the multiple analysis results, and distributing the multiple data groups to the multiple computing processes; the computing process determining, for any i-th analysis result in the received data group, a first management process for managing the corresponding first transaction based on the instruction information included in the i-th analysis result; obtaining, based on the transaction hash included in the i-th analysis result, a first transaction corresponding to the i-th analysis result from the first management process; and executing the first transaction corresponding to the i-th analysis result.
[0005] In a second aspect, a blockchain node in a blockchain system is provided, the blockchain node comprising a control process, multiple management processes, and multiple computing processes. The control process is configured to obtain multiple analysis results of multiple first transactions from the multiple management processes, the analysis results comprising a transaction hash, read / write information, and instruction information of the corresponding first transactions; the control process is further configured to divide the multiple analysis results into multiple data groups based on the read / write information included in each of the multiple analysis results, and distribute the multiple data groups to the multiple computing processes; the computing process is configured to determine, for any i-th analysis result in the received data group, a first management process for managing the corresponding first transaction based on the instruction information included in the i-th analysis result; obtain, from the first management process, a first transaction corresponding to the i-th analysis result based on the transaction hash included in the i-th analysis result; and execute the first transaction corresponding to the i-th analysis result.
[0006] In the embodiments of the present specification, a blockchain node includes at least a control process, multiple management processes, and multiple computing processes. The control process can obtain multiple analysis results of multiple first transactions from the multiple management processes. The analysis results include the transaction hash, read / write information, and instruction information of the corresponding first transactions. The control process can also divide the multiple analysis results into multiple data groups based on the read / write information included in each of the multiple analysis results, and distribute the multiple data groups to the multiple computing processes. Correspondingly, the computing process can determine the first management process for managing the corresponding first transaction for any i-th analysis result in the received data group based on the instruction information included in the i-th analysis result. Based on the transaction hash included in the i-th analysis result, the computing process obtains the first transaction corresponding to the i-th analysis result from the first management process and executes the first transaction corresponding to the i-th analysis result. In this way, the control process, which only supports running as a single instance, does not execute transactions related to the transaction plaintext. Instead, multiple management processes running concurrently are responsible for managing the transaction plaintext and providing transaction analysis results. This can achieve a greater degree of decoupling of the control flow and data flow of the control process, reduce the number of transactions required to be implemented by the control process, and improve the performance of the blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0008] Figure 1 This is an architecture diagram of a blockchain system provided in the embodiments of this specification;
[0009] Figure 2 This is one of the structural diagrams of a blockchain node in a blockchain system provided in an embodiment of this specification;
[0010] Figure 3 This is a flowchart of a transaction processing method in a blockchain system provided in an embodiment of this specification;
[0011] Figure 4 This is a flowchart of a transaction execution method in a blockchain system provided in an embodiment of this specification;
[0012] Figure 5 This is a schematic diagram of the structure of a blockchain node in a blockchain system provided in an embodiment of this specification. DETAILED DESCRIPTION
[0013] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.
[0014] Figure 1 This is an architectural diagram of a blockchain system provided as an example in the embodiments of this specification. The blockchain system may include N blockchain nodes, where Figure 1 8 blockchain nodes, Node 1 through Node 8, are shown as examples. The lines between the nodes schematically represent P2P (Peer to Peer) connections, which can be, for example, Transmission Control Protocol (TCP) connections, used to support data transmission between different nodes.
[0015] The system data that needs to be persistently stored in the blockchain system can be divided into two parts: block data and status data.
[0016] Block data includes one or more blocks incremented by block height (or block number). A single block can include a block header and a block body. The block header can include the previous block's block hash (or parent hash), timestamp, block number (BlockNum), state root hash (State_Root), transaction root hash (Transaction_Root), and receipt root hash (Receipt_Root). The block body can include a transaction set and a receipt set.
[0017] A transaction in a blockchain system is a unit of work performed and recorded within the blockchain system. A single transaction typically includes a sender (From), a recipient (To), and a data field (Data). The From field includes the account initiating the transaction, and the To field may include another account involved in or directed by the transaction.
[0018] For any k-th block, the state data at block height (or version) k-1 can be used to execute the multiple transactions included in the transaction set belonging to the k-th block in order to obtain the execution results of the multiple transactions. The state data at block height k-1 can then be updated based on the execution results of the multiple transactions to obtain the state data at block height k.
[0019] The embodiments of this specification provide at least one transaction execution method and blockchain system in a blockchain system. A blockchain node includes at least a control process, multiple management processes, and multiple computing processes. The control process can obtain multiple analysis results of multiple first transactions from the multiple management processes. The analysis results include the transaction hash, read / write information, and instruction information of the corresponding first transactions. The control process can also divide the multiple analysis results into multiple data groups based on the read / write information included in each of the multiple analysis results, and distribute the multiple data groups to the multiple computing processes. Correspondingly, the computing process can determine, for any i-th analysis result in the received data group, a first management process for managing the corresponding first transaction based on the instruction information included in the i-th analysis result, obtain the first transaction corresponding to the i-th analysis result from the first management process based on the transaction hash included in the i-th analysis result, and execute the first transaction corresponding to the i-th analysis result. In this way, the control process that only supports running as a single instance does not execute transactions related to the transaction plaintext. Instead, multiple management processes running concurrently are responsible for managing the transaction plaintext and providing transaction analysis results. This can achieve decoupling of the control flow and data flow of the control process to a greater extent, reduce the transactions that the control process needs to implement, and help improve the performance of the blockchain system.
[0020] Figure 2This is one of the structural diagrams of a blockchain node in a blockchain system provided in the embodiments of this specification. Figure 2 As shown, a blockchain node includes at least a controller process, multiple management processes (Txpool processes, also known as transaction pool processes), and multiple compute processes. The blockchain node may also include one or more of the following: a load balancer, one or more portal processes, a domain gateway process responsible for inter-node communication, and a storage process. The domain gateway process corresponds to the blockchain node's P2P service / module; one or more portal processes are primarily responsible for interacting with clients, while the domain gateway process is primarily responsible for interacting with other blockchain nodes in the blockchain system. It should be noted that a process is a single execution of a program with a specific independent function on a data set within a computer application. Specifically, a process is a process in a computer that is performed by the processor sequentially executing instructions in an application. Each process is allocated its own memory address space upon creation. The multiple processes within a single blockchain node can be multiple processes within multiple computing devices or virtual computing nodes.
[0021] Figure 3 This is a flow chart of a transaction processing method in a blockchain system provided in an embodiment of this specification. This method can be executed by a blockchain node in the blockchain system, for example, by the aforementioned Figure 2 The method exemplarily describes a management process in which a second transaction issued by a client is sent to a blockchain node, and the blockchain node implements a process of initiating a consensus proposal corresponding to a target block to be generated based on the second transaction.
[0022] See also Figure 3 As shown, the method may include but is not limited to part or all of the following steps S301 to S317.
[0023] When a blockchain node is configured with a load balancer and multiple access processes, the blockchain node may receive a second transaction to be executed from a client. In this case, the blockchain node may execute the following steps S301 to S307.
[0024] Step S301: The load balancer receives a second transaction from a client.
[0025] Step S303: The load balancer selects a first access process from multiple access processes.
[0026] The load balancer may schedule the second transaction it receives based on the load conditions of the multiple access processes, that is, after receiving the second transaction, the load balancer may select the access process with the lower current load as the first access process.
[0027] Step S305: The load balancer sends the second transaction to the first access process.
[0028] Step S307: The first access process obtains indication information of the second transaction based on the second transaction, and determines a second management process for managing the second transaction from a plurality of management processes according to the indication information of the second transaction.
[0029] The indication information of the second transaction may include the account initiating the second transaction. Alternatively, the indication information of the second transaction may be obtained based on the account initiating the second transaction, for example, the first byte of the account initiating the second transaction.
[0030] One or more indication information corresponding to each of the multiple management processes can be maintained through pre-stored configuration information. After receiving a second transaction, the first access process can extract the first byte of the account included in the From field of the second transaction (which can also be expressed as the first byte of the sender of the transaction) as the indication information of the transaction; then, based on the indication information of the transaction, the pre-stored configuration information is searched to determine the corresponding second management process from the multiple management processes.
[0031] Step S309: The first access process sends the second transaction to the second management process.
[0032] When the blockchain node is not configured with a load balancer and only has a single access process, the blockchain node may not execute the aforementioned steps S301 to S309, but may directly receive the aforementioned second transaction from the client through the single access process configured therein, and execute the functions implemented by the first access process in the aforementioned steps S307 and S309.
[0033] After receiving the second transaction from the client, the second management process may perform pre-verification on the second transaction, including verifying the signature and transaction format of the second transaction, and verifying whether the account initiating the second transaction has sufficient gas. After the second transaction passes verification, the second management process may proceed to step S311 and send the second transaction to the remaining blockchain nodes in the blockchain system.
[0034] The second management process can broadcast the second transaction to the remaining blockchain nodes by invoking the node gateway process. Corresponding to step S311, the management processes of the remaining blockchain nodes may receive the second transaction from the current blockchain node, which was received by the current blockchain node from the client. In other words, the current blockchain node may not receive the second transaction directly from the client, but instead receive the second transaction from the client from the remaining blockchain nodes. In this case, the blockchain node can, for example, receive the second transaction from the remaining blockchain nodes via the node gateway process, and the node gateway process implements the functions performed by the first access process in steps S307 and S309.
[0035] Regardless of whether the second transaction comes from the client or other blockchain nodes, the second management process that receives the second transaction can execute step S313 on it, obtain the indication information of the second transaction based on the second transaction, and calculate the transaction hash of the second transaction; in step S315, send the transaction hash and indication information of the second transaction to the control process.
[0036] The second management process may call the control process according to a specific algorithm to send the transaction hash and instruction information of the received second transaction to the control process. For example, the second management process may immediately execute steps S313 and S315 upon receiving the second transaction, or may periodically execute steps S313 and S315 for each second transaction received within the current time interval at a predetermined interval.
[0037] The transaction hash may be a hash value of the second transaction, or a short hash obtained based on the hash value of the second transaction.
[0038] The control process can initiate a consensus proposal corresponding to the target block to be generated using the transaction hash and instruction information of the second transactions from multiple management processes in accordance with the corresponding strategy.
[0039] Specifically, in step S317 , the control process reaches a consensus on the consensus proposal, which includes transaction hashes and indication information of multiple first transactions, where the multiple first transactions include the second transaction.
[0040] More specifically, the control process may receive transaction hashes and indication information of multiple second transactions from multiple management processes, and then select part or all of the transaction hashes and indication information of the second transactions from the transaction hashes and indication information of the multiple second transactions as the corresponding transaction hashes and indication information of the multiple first transactions, thereby generating a consensus proposal corresponding to the target block.
[0041] The Consensus module in the control process can use a consensus algorithm such as PBFT or MYPBFT to generate a consensus proposal corresponding to a target block to be generated, and then reach consensus on the consensus proposal with the other blockchain nodes in the blockchain system. The consensus proposal can specifically include a transaction hash list (txlist hash) composed of the transaction hashes of multiple first transactions in sequence, and an indication information list composed of the indication information of multiple first transactions in sequence. During the consensus process, after receiving a preprepare message, the Consensus module in the control process can notify the corresponding management process to check the existence of a single first transaction based on the transaction hash and indication information of the first transaction and the indication information and transaction hash of the first transaction. If the first transaction exists, the corresponding management process will persist the relevant first transaction. If it does not exist, the blockchain node may exit the consensus process or provide information indicating its disapproval of the consensus proposal.
[0042] The foregoing Figure 3 The method shown is merely exemplary, and the management process in the blockchain node may also obtain the second transaction from the client through other means, obtain the consensus proposal based on multiple first transactions through other means, and reach consensus on them.
[0043] When consensus is reached on a consensus proposal based on multiple first transactions, the blockchain node can complete the execution of the multiple first transactions by collaborating with a control process, multiple management processes, and multiple computing processes.
[0044] Figure 4 This is a flowchart of a transaction execution method in a blockchain system provided in an embodiment of this specification. The method exemplarily describes the process of executing multiple first transactions through the collaboration of a control process, multiple management processes, and multiple computing processes, when blockchain nodes reach consensus on consensus proposals based on multiple first transactions.
[0045] See also Figure 4 As shown, the method may include but is not limited to part or all of the following steps S319 to S335.
[0046] Step S319: The control process obtains multiple analysis results of multiple first transactions from multiple management processes, where the analysis results include transaction hashes, read / write information, and instruction information of the corresponding first transactions.
[0047] After reaching consensus on a consensus proposal based on multiple first transactions, the Consensus process in the control process can determine a third management process for managing each first transaction based on the transaction hash and instruction information of each first transaction in the consensus proposal, and send the transaction hash and instruction information of the first transaction to the third management process. After receiving the transaction hash and instruction information of the first transaction, the third management process can query the plaintext of the first transaction it manages based on the transaction hash of the first transaction and then perform post-verification on the first transaction, such as verifying the signature, transaction format, and anti-replay detection of the first transaction. The verification of the signature and transaction format of the first transaction can use the verification results of the pre-verification of the first transaction. After passing the verification, the third management process can obtain the read and write information of the first transaction by performing pre-execution or other analysis on the first transaction, and then use the transaction hash, read and write information, and instruction information of the first transaction to form an analysis result of the first transaction, and return the analysis result of the first transaction to the control process.
[0048] The read / write information of a single first transaction may include the key of a parameter that needs to be read from and written to the state data when executing the first transaction. More specifically, the read / write information of a single first transaction may include, for example, a pre-execution read set and a pre-execution write set.
[0049] Next, in step S321 , the control process divides the multiple analysis results into multiple data groups according to the read and write information included in each of the multiple analysis results.
[0050] In the process of obtaining the aforementioned multiple data groups, it is necessary to ensure that the first transactions corresponding to any two analysis results in any two data groups do not conflict with each other. Specifically, any two first transactions do not conflict with each other, which means that any two first transactions do not have any of the following situations: the pre-execution read set of one first transaction and the pre-execution write set of another first transaction include the same key, or the pre-execution write set of one first transaction and the pre-execution write set of another first transaction include the same key. For any two first transactions that conflict, their analysis results need to be divided into the same data group. In other words, if the pre-execution write sets of any two first transactions contain the same key, it is considered that the two first transactions accessed the same parameters and there is a conflict, and the analysis results of the two first transactions need to be divided into the same data group; if the pre-execution read set of one first transaction and the pre-execution write set of the other first transaction contain the same key, it is considered that the two first transactions accessed the same parameters and there is a conflict, and the analysis results of the two first transactions need to be divided into the same data group. In another possible implementation, in order to efficiently determine the grouping information of the aforementioned multiple first transactions or efficiently complete the division of the multiple analysis results of the aforementioned multiple first transactions into multiple data groups, the multiple analysis results of the aforementioned multiple first transactions can usually be grouped according to the requirement that the first transactions corresponding to any two analysis results in any two different data groups do not access the same parameters (i.e., do not contain the same key).
[0051] Next, in step S323, the control process distributes the multiple data packets to the multiple computing processes.
[0052] Different data packets can be distributed to different computing processes. When the number of computing processes is small, at least two different data packets can also be distributed to the same computing process.
[0053] Step S325 : The computing process determines, for any i-th analysis result in the received data group, a first management process for managing the corresponding first transaction according to the instruction information included in the i-th analysis result.
[0054] Step S327 : The calculation process obtains the first transaction corresponding to the i-th analysis result from the first management process according to the transaction hash included in the i-th analysis result.
[0055] Step S329: The calculation process executes the first transaction corresponding to the i-th analysis result.
[0056] The computing process can traverse the data groups it receives, call the storage interface / storage process to batch read the values of all keys in the read-write information, and then use the read key-value pairs to execute the first transactions corresponding to each analysis result included in the data groups it receives. After completing the execution of each first transaction, the execution write set consisting of key-value pairs corresponding to each first transaction can be obtained, and then the key-value pairs in the execution write set can be submitted by calling the storage interface.
[0057] After the computing process completes the execution of a single first transaction, a receipt and a transaction receipt of the first transaction may also be obtained.
[0058] For ease of description, the first transactions corresponding to the analysis results in the data group received by the computing process are referred to as a Tx group. After completing execution of each first transaction in the Tx group, the computing process may notify the control process that the Tx group for the current computing process has been completed. Furthermore, steps S331 through S335 may be executed.
[0059] Step S331: Send a transaction receipt of the first transaction corresponding to the i-th analysis result to the first management process.
[0060] Step S333: Calculate the receipt hash of the first transaction receipt corresponding to the i-th analysis result.
[0061] Step S335: Send the receipt hash to the control process.
[0062] The receipt hash is used to support the receipt root hash included in the block header of the control process to generate the target block.
[0063] The computing process can also call the storage interface to store block slices. The block slice includes several first transactions in the tx group and their corresponding receipts. The block slice is a component of the block body of the target block to be generated.
[0064] After the block slice is stored, the computation process notifies the control process that the computation process has persisted the block slice for the txgroup. Meanwhile, after waiting for all tx groups of the target block to complete execution, the control process calls the commit state storage interface to calculate the new state root hash, State_Root. After receiving notification that all tx groups of the target block have stored the block slice, the control process calls the write state storage interface to persist the state data. At this point, the control process begins calculating the blockheader (tx root, receipt root) for this block and writes it to the block header. Finally, the control process updates the newly generated write block number for the target block in MetaDB, commits and confirms the blockheader hash through the controller validator module, completes the blockheader hash validation, and notifies the management process of the stable block number. Upon receiving the stable block number notification, the management process pushes a transaction receipt for the first transaction in the target block to the relevant client, invoking the access process to return the receipt for the first transaction to the client.
[0065] Based on the same concept as the aforementioned method embodiment, this specification also provides a blockchain node 500 in a blockchain system. Figure 5 As shown, the blockchain node 500 includes a control process 501, multiple management processes 503 and multiple computing processes 505, wherein: the control process 501 is used to obtain multiple analysis results of multiple first transactions from the multiple management processes 503, and the analysis results include the transaction hash, read-write information and indication information of the corresponding first transactions; the control process 501 is also used to divide the multiple analysis results into multiple data groups according to the read-write information included in each of the multiple analysis results, and distribute the multiple data groups to the multiple computing processes 505; the computing process 505 is used to determine the first management process for managing the corresponding first transaction for any i-th analysis result in the received data group according to the indication information included in the i-th analysis result, obtain the first transaction corresponding to the i-th analysis result from the first management process according to the transaction hash included in the i-th analysis result, and execute the first transaction corresponding to the i-th analysis result.
[0066] In one possible implementation, the control process 501 is further configured to receive transaction hashes and indication information of the multiple first transactions from the multiple management processes; the control process 501 is further configured to generate a consensus proposal, which includes the transaction hashes and indication information of the multiple first transactions; and the control process 501 is further configured to reach consensus on the consensus proposal.
[0067] In one possible implementation, the management process 503 is further used to receive a second transaction, which belongs to the multiple first transactions; the management process 503 is further used to obtain indication information of the second transaction based on the second transaction, calculate the transaction hash of the second transaction, and send the transaction hash and indication information of the second transaction to the control process 501.
[0068] In one possible embodiment, the blockchain node 500 also includes a first access process; wherein, the first access process is used to obtain indication information of the second transaction based on the second transaction, and according to the indication information of the second transaction, determine the second management process for managing the second transaction from the multiple management processes 503, and send the second transaction to the second management process.
[0069] In one possible embodiment, the blockchain node 500 further includes a load balancer 507 and multiple access processes 509, wherein the multiple access processes 509 include the first access process; wherein the load balancer 507 is used to receive the second transaction from the client; the load balancer 507 is also used to select the first access process from the multiple access processes 509 and send the second transaction to the first access process.
[0070] In one possible implementation, the second management process is used to send the second transaction to other blockchain nodes in the blockchain system.
[0071] In one possible implementation, the calculation process 505 is also used to send a transaction receipt of the first transaction corresponding to the i-th analysis result to the first management process; the calculation process 505 is also used to calculate the receipt hash of the receipt of the first transaction corresponding to the i-th analysis result, and send the receipt hash to the control process 501.
[0072] In a possible implementation, the indication information of the first transaction includes the account that initiated the first transaction; or the indication information of the first transaction is obtained based on the account that initiated the first transaction.
[0073] The embodiments of this specification also provide a computer-readable storage medium storing a computer program / instruction. When the computer program / instruction is executed in a computer, the computer is caused to execute the various method steps performed by the blockchain node in the blockchain system in any of the aforementioned method embodiments.
[0074] An embodiment of this specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code / instructions, and when the processor executes the executable code / instructions, it implements the various method steps performed by the blockchain node in the blockchain system in any of the aforementioned method embodiments.
[0075] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
[0076] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.
[0077] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude that with the future development of computer technology, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, an in-vehicle human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0078] Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any particular order.
[0079] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more of the present specifications, the functions of each module can be implemented in the same or multiple software and / or hardware, or the module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0080] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0081] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0083] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0084] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0085] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0086] Those skilled in the art will appreciate that one or more embodiments of this specification may be provided as a method, system, or computer program product. Thus, one or more embodiments of this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0088] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments. In particular, since the system embodiments are generally similar to the method embodiments, the description is relatively simple. For relevant parts, reference can be made to the description of the method embodiments. Throughout this specification, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and integrate the different embodiments or examples, and features of different embodiments or examples, described in this specification, unless they conflict with each other.
[0089] The foregoing description is merely an example of one or more embodiments of this specification and is not intended to limit the one or more embodiments of this specification. Those skilled in the art will appreciate that various modifications and variations of one or more embodiments of this specification are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this specification are intended to be included within the scope of the claims.
Claims
1. A transaction execution method in a blockchain system, the method being executed by a blockchain node in the blockchain system, the blockchain node comprising a control process, multiple management processes, and multiple computing processes, the method comprising: The control process obtains multiple analysis results of multiple first transactions from the multiple management processes, the analysis results including a transaction hash, read / write information, and indication information of the corresponding first transactions, the indication information including an account initiating the first transactions, or the indication information is obtained based on the account initiating the first transactions; The control process divides the plurality of analysis results into a plurality of data groups according to the read and write information respectively included in the plurality of analysis results, and distributes the plurality of data groups to the plurality of computing processes; The computing process determines, for any i-th analysis result in the received data group, a first management process for managing the corresponding first transaction based on the indication information included in the i-th analysis result, obtains the first transaction corresponding to the i-th analysis result from the first management process based on the transaction hash included in the i-th analysis result, and executes the first transaction corresponding to the i-th analysis result.
2. The method according to claim 1, further comprising: The control process receives the transaction hashes and indication information of the plurality of first transactions from the plurality of management processes; The control process generates a consensus proposal, which includes transaction hashes and indication information of the plurality of first transactions; The control process reaches a consensus on the consensus proposal.
3. The method according to claim 1, further comprising: The management process receives a second transaction, where the second transaction belongs to the plurality of first transactions; The management process obtains indication information of the second transaction based on the second transaction, calculates a transaction hash of the second transaction, and sends the transaction hash and indication information of the second transaction to the control process.
4. The method according to claim 3, wherein the blockchain node further comprises a first access process; in, The method also includes: the first access process obtains indication information of the second transaction based on the second transaction, determines a second management process for managing the second transaction from the multiple management processes according to the indication information of the second transaction, and sends the second transaction to the second management process.
5. The method according to claim 4, wherein the blockchain node further comprises a load balancer and multiple access processes, wherein the multiple access processes include the first access process; The method further comprises: The load balancer receives the second transaction from the client; The load balancer selects the first access process from the multiple access processes and sends the second transaction to the first access process.
6. The method according to claim 4, further comprising: The second management process sends the second transaction to other blockchain nodes in the blockchain system.
7. The method according to claim 1, further comprising: The computing process sends a transaction receipt of the first transaction corresponding to the i-th analysis result to the first management process; The calculation process calculates a receipt hash of the receipt of the first transaction corresponding to the i-th analysis result, and sends the receipt hash to the control process.
8. A blockchain node in a blockchain system, the blockchain node comprising a control process, multiple management processes, and multiple computing processes, wherein: The control process is configured to obtain multiple analysis results of multiple first transactions from the multiple management processes, the analysis results including a transaction hash, read / write information, and indication information of the corresponding first transactions, the indication information including an account initiating the first transactions, or the indication information being obtained based on the account initiating the first transactions; The control process is further configured to divide the plurality of analysis results into a plurality of data groups according to the read and write information respectively included in the plurality of analysis results, and distribute the plurality of data groups to the plurality of computing processes; The computing process is used to determine, for any i-th analysis result in the data group it receives, a first management process for managing the first transaction corresponding to the i-th analysis result based on the indication information included in the i-th analysis result, obtain the first transaction corresponding to the i-th analysis result from the first management process based on the transaction hash included in the i-th analysis result, and execute the first transaction corresponding to the i-th analysis result.
9. The blockchain node according to claim 8, wherein: The control process is further configured to receive transaction hashes and indication information of the plurality of first transactions from the plurality of management processes; The control process is further configured to generate a consensus proposal, comprising transaction hashes and indication information of the plurality of first transactions; The control process is further configured to reach a consensus on the consensus proposal.
10. The blockchain node according to claim 8, wherein: The management process is further configured to receive a second transaction, where the second transaction belongs to the plurality of first transactions; The management process is further configured to obtain indication information of the second transaction based on the second transaction, calculate a transaction hash of the second transaction, and send the transaction hash and indication information of the second transaction to the control process.
11. The blockchain node according to claim 10, further comprising a first access process; in, The first access process is used to obtain indication information of the second transaction based on the second transaction, determine a second management process for managing the second transaction from the multiple management processes according to the indication information of the second transaction, and send the second transaction to the second management process.
12. The blockchain node according to claim 11, further comprising a load balancer and multiple access processes, wherein the multiple access processes include the first access process; The load balancer is configured to receive the second transaction from the client; The load balancer is further configured to select the first access process from the multiple access processes and send the second transaction to the first access process.
13. The blockchain node according to claim 11, wherein: The second management process is used to send the second transaction to other blockchain nodes in the blockchain system.
14. The blockchain node according to claim 8, wherein: The computing process is further configured to send a transaction receipt of the first transaction corresponding to the i-th analysis result to the first management process; The calculation process is further configured to calculate a receipt hash of the first transaction receipt corresponding to the i-th analysis result, and send the receipt hash to the control process.
Citation Information
Patent Citations
Transaction execution method in block chain system, node and block chain system
CN114936093A
Transaction execution method and block chain node
CN114942847A