Block chain batch transaction execution method, device and equipment

By constructing a directed acyclic graph using a transaction access information prediction model before blockchain transaction execution, the problem of low parallelism in traditional blockchain transaction execution is solved, achieving efficient parallel execution and high throughput, and ensuring the determinism and consistency of the system.

CN121724752APending Publication Date: 2026-03-24WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional blockchain transaction execution solutions have a low limit on parallelism in high-concurrency scenarios, which cannot effectively improve transaction throughput, and also result in a large waste of computing resources and increased latency.

Method used

By employing a pre-trained transaction access information prediction model, machine learning is used to identify user information of both parties in a transaction, construct a directed acyclic graph, plan the transaction execution order, avoid parallel conflicts, and improve parallel execution capabilities.

Benefits of technology

It significantly improves the transaction throughput of the blockchain network, reduces the overhead of transaction rollback and retry, ensures the determinism and consistency of the system, and enhances system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724752A_ABST
    Figure CN121724752A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain batch transaction execution method, device and equipment, and relates to the technical field of block chains, and the block chain batch transaction execution method comprises the steps: inputting parameters corresponding to a plurality of pieces of block chain transaction data of a current batch into a pre-trained transaction access information prediction model, predicting to obtain transaction access information corresponding to each piece of block chain transaction data; based on the transaction access information corresponding to each piece of block chain transaction data, analyzing a conflict condition between each piece of block chain transaction data, and constructing a directed acyclic graph, the directed acyclic graph at least comprising an execution sequence of each piece of block chain transaction data, and the execution sequence at least comprising parallel execution and serial execution; and executing each piece of block chain transaction data according to the directed acyclic graph to obtain a transaction result corresponding to each piece of block chain transaction data. According to the method, parallel conflicts can be prevented before transaction execution, and the upper limit of parallel execution of block chain transaction data and the transaction data throughput are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a method, apparatus and device for executing blockchain batch transactions. Background Technology

[0002] With the rapid development of Web 3.0 (the third generation of the Internet) and decentralized applications, the transaction throughput and processing latency of blockchain networks have become core bottlenecks restricting their large-scale application. Traditional blockchains (such as the early Ethereum) adopt a serial execution mode, in which all transactions are executed sequentially. Although this ensures the consistency and determinism of the state, its performance ceiling is extremely low and cannot meet the needs of high-concurrency scenarios.

[0003] To meet the demands of high-concurrency scenarios, the industry has proposed various parallel execution solutions for transactions. One is based on dependency graphs derived from static analysis. However, static analysis tools often fail to accurately infer actual behavior, resulting in numerous "false dependencies" in the analysis results. This leads to the vast majority of transactions being incorrectly marked as conflicting, ultimately forcing the system to revert to serial execution, failing to effectively improve parallelism and offering very limited performance gains. A second approach is based on locking mechanisms, but the locking process can trigger deadlocks or livelocks, causing transactions to wait indefinitely or the system to stagnate. A third approach is optimistic execution strategies, but in high-concurrency scenarios or where transaction patterns are highly correlated, the actual conflict rate between transactions increases dramatically, leading to numerous transaction rollbacks and retries. This repeated computation and state rollback result in significant waste of computational resources and increased latency; its worst-case performance may even be worse than simple serial execution, compromising system performance. In summary, traditional mainstream liveness detection technologies are all passive conflict management mechanisms, unable to prepare for parallel conflicts before transaction execution, resulting in a low upper limit for transaction parallelism. Summary of the Invention

[0004] The main objective of this application is to provide a method, apparatus, and device for executing blockchain batch transactions, which aims to prevent parallel conflicts before transaction execution and increase the upper limit of parallel execution of blockchain transaction data and transaction data throughput.

[0005] To achieve the above objectives, this application proposes a blockchain batch transaction execution method, which includes: The parameters corresponding to the multiple blockchain transaction data in the current batch are input into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data. The transaction access information includes at least the user information of the two parties to the transaction. Based on the transaction access information corresponding to each of the blockchain transaction data, the conflict between the blockchain transaction data is analyzed, and a directed acyclic graph is constructed. The directed acyclic graph includes at least the execution order of each of the blockchain transaction data, and the execution order includes at least parallel execution and serial execution. Execute each of the blockchain transaction data according to the directed acyclic graph to obtain the transaction result corresponding to each of the blockchain transaction data.

[0006] Furthermore, to achieve the above objectives, this application also proposes a blockchain batch transaction execution device, which includes: The model inference module is used to input the parameters corresponding to multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data. The transaction access information includes at least the user information of the two parties to the transaction. The transaction scheduling module is used to analyze the conflict between the blockchain transaction data based on the transaction access information corresponding to each blockchain transaction data, and construct a directed acyclic graph. The directed acyclic graph includes at least the execution order of each blockchain transaction data, and the execution order includes at least parallel execution and serial execution. The transaction execution module is used to execute each of the blockchain transaction data according to the directed acyclic graph, and obtain the transaction results corresponding to each of the blockchain transaction data.

[0007] Furthermore, to achieve the above objectives, this application also proposes a blockchain batch transaction execution device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the blockchain batch transaction execution method described above.

[0008] One or more technical solutions proposed in this application have at least the following technical effects: This application first inputs the parameters corresponding to multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data. The transaction access information includes at least the user information of both parties to the transaction. Then, based on the transaction access information corresponding to each blockchain transaction data, the conflict between the blockchain transaction data is analyzed, and a directed acyclic graph is constructed. The directed acyclic graph includes at least the execution order of each blockchain transaction data, and the execution order includes at least parallel execution and serial execution. Finally, each blockchain transaction data is executed according to the directed acyclic graph to obtain the transaction result corresponding to each blockchain transaction data.

[0009] Compared to traditional solutions, the technical solution of this application proactively predicts transaction access information in advance through a pre-trained machine learning model. Compared to conservative static analysis methods, it can more accurately identify truly parallelizable transaction pairs, effectively reduce the determination of "false dependencies," avoid most potential parallel execution conflicts, and reduce transaction rollback and retry overhead. This significantly improves the parallel execution capability of the system and greatly increases the transaction throughput of the blockchain network. Moreover, the technical solution of this application adopts a model of prediction, planning, and execution. It predicts transaction access information in advance, and the execution order is represented by a DAG (Directed Acyclic Graph). The entire transaction execution process is completely deterministic, which meets the blockchain's requirement for deterministic execution. Attached Figure Description

[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating an embodiment of the blockchain batch transaction execution method of this application. Figure 2 This is a schematic diagram illustrating the process of using various modules in a blockchain system to complete batch transaction execution and model updates, as provided in the embodiment of the blockchain batch transaction execution method of this application. Figure 3 This is a sequence diagram of data interaction between modules in a blockchain system provided in the embodiment of the blockchain batch transaction execution method of this application; Figure 4 This is a schematic diagram of the module structure of the blockchain batch transaction execution device according to an embodiment of this application; Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the blockchain batch transaction execution method in this application embodiment.

[0013] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0014] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0015] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0016] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, or an electronic device or a blockchain batch transaction execution device capable of performing the above functions. The following description uses a blockchain batch transaction execution device as an example to illustrate this embodiment and the subsequent embodiments.

[0017] Based on this, the embodiments of this application provide a blockchain batch transaction execution method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the blockchain batch transaction execution method of this application.

[0018] In this embodiment, the blockchain batch transaction execution method includes steps S10 to S30: Step S10: Input the parameters corresponding to the multiple blockchain transaction data in the current batch into the pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data. The transaction access information includes at least the user information of the two parties to the transaction. The blockchain batch transaction execution method provided in this application embodiment can be applied to a blockchain system with financial transaction functions. Taking a transfer transaction scenario in financial transactions as an example, multiple users transfer funds to each other in pairs. Each transfer process is a transaction, and the relevant information involved in each transfer process is the parameter corresponding to the blockchain transaction data. The blockchain system can process multiple blockchain transaction data included in each batch. The current batch refers to the batch that needs to be processed at the moment. The blockchain transaction data includes the purpose of the transaction (target contract address, recipient address), the input parameters of the transaction (method selector, specific parameters of the function interface), the sender of the transaction (externally owned account (EOA) or contract address that initiates the transaction), the amount of the transaction, and the type of transaction (such as a Blob transaction, an EIP-1559 transaction, or a predefined transaction fee mechanism).

[0019] The transaction access information prediction model is trained in advance using transaction data and real labels (i.e., real transaction access information) on a machine learning model. This model accurately predicts the transaction access information corresponding to each blockchain transaction based on the received input blockchain transaction data, enabling pre-prediction. Transaction access information reflects the user information of both parties in the transaction process, such as key-value (KV) pairs. Taking a transfer transaction scenario in financial transactions as an example, multiple users transfer funds to each other in pairs. Each transfer is a transaction, and each user's balance is a KV key-value pair. Each transaction corresponds to two KV key-value pairs (the sender's balance and the receiver's balance). As long as the sender's and receiver's balances in the KV key-value pairs of two transactions are different (i.e., the two transactions correspond to different senders and receivers), there is a possibility of parallel execution. These two transactions can be executed in parallel without conflict.

[0020] Step S20: Based on the transaction access information corresponding to each blockchain transaction data, analyze the conflict between each blockchain transaction data and construct a directed acyclic graph. The directed acyclic graph includes at least the execution order of each blockchain transaction data, and the execution order includes at least parallel execution and serial execution. After predicting and obtaining the transaction access information corresponding to each blockchain transaction, the system analyzes the transaction access information corresponding to each blockchain transaction to determine whether there is a conflict between the blockchain transaction data. For example, if the sender and receiver of two transactions have the same sender or receiver, it indicates that there is a conflict and they cannot be executed in parallel. The two conflicting transaction data need to be executed serially (i.e., executed one after the other).

[0021] DAG (Directed Acyclic Graph) is used to plan the execution order of various blockchain transactions. The execution order includes parallel execution and serial execution. Parallel execution is mainly used between blockchain transactions that do not conflict, while serial execution is mainly used between blockchain transactions that do not conflict.

[0022] Step S30: Execute each blockchain transaction data according to the directed acyclic graph to obtain the transaction results corresponding to each blockchain transaction data.

[0023] After generating the DAG graph, each blockchain transaction can be executed in parallel or sequentially according to the execution order represented in the DAG graph. The transaction results for each blockchain transaction can include information indicating whether the transaction was successful, balance information for both parties after the transaction is completed, and actual access information for each blockchain transaction. The transaction results can be recorded in the blockchain system's transaction log data for subsequent querying or verification by staff.

[0024] This application's embodiments utilize a machine learning model to proactively predict key-value pair accesses in advance. Compared to conservative static analysis methods, this approach more accurately identifies truly parallelizable transaction pairs, effectively reducing the identification of "false dependencies" and significantly improving the system's parallel execution capability, thereby greatly increasing the transaction throughput (TPS, Transactions Per Second) of the blockchain network. Furthermore, this application's embodiments employ a prediction-planning-execution model, eliminating the need for locking during execution and fundamentally avoiding non-deterministic issues such as deadlocks and livelocks. The execution path of blockchain transaction data is determined by the predicted transaction access information and DAG scheduling; the entire process is deterministic, fully meeting the core requirement of blockchain for deterministic execution and ensuring system consistency and security. Additionally, high-precision prediction using a pre-trained transaction access information prediction model effectively avoids most potential transaction read / write conflicts, resulting in a very high success rate for parallel execution. This significantly reduces the overhead of transaction rollbacks and retrying due to conflicts, avoiding the performance degradation problem of optimistic execution schemes in high-conflict scenarios. Therefore, the blockchain batch transaction execution method provided in this application embodiment can provide more stable, predictable and superior performance under various network loads.

[0025] Furthermore, in a feasible embodiment, the step of inputting the parameters corresponding to the multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data may include: Step S11: Extract the transaction purpose, transaction input parameters, transaction initiation parameters, transaction amount, and transaction type corresponding to each blockchain transaction data, and determine the corresponding input feature sequence; In this embodiment of the application, the output features of the transaction access information prediction model include: transaction purpose (target contract address, payee address), transaction input parameters (method selector, specific parameters of function interface), transaction initiation parameters (external account EOA or contract address that initiates the transaction), transaction amount, and transaction type (such as Blob transaction, EIP-1559 transaction).

[0026] Furthermore, the transaction purpose includes address parameters, the transaction input parameters include fields and function parameters of the method selector, the transaction initiation parameters include account parameters and address parameters, the transaction amount includes numeric parameters, and the transaction type includes category parameters; The step of extracting the transaction purpose, transaction input parameters, transaction initiation parameters, transaction amount, and transaction type corresponding to each blockchain transaction data, and determining the corresponding input feature sequence includes: Step S111: Process the address parameter using a preset hash function to obtain the corresponding string; Step S112: Select the first preset number of units digits from the string as the address feature; The contract address and sender address (both 40-bit hexadecimal strings) in the address parameters are processed by a hash function (such as SHA-256, a 256-bit secure hash algorithm) to obtain the corresponding string. The first N (i.e., the first preset number) bits are taken as the address feature so that they can be input into the model.

[0027] Step S113: Use the first second preset number of bytes of the field of the method selector as the field feature; For the method selector, the first second preset number (e.g., 4) bytes of the data field are used as the field feature.

[0028] Step S114: Perform word segmentation or hashing on the function parameters to obtain the corresponding function features; Step S115: Normalize the numerical parameters to obtain the corresponding numerical features. Step S116: Perform one-hot encoding on the classification parameters to obtain the corresponding type features; Step S117: Concatenate address features, field features, function features, numerical features, and type features according to a preset arrangement order to obtain the input feature sequence.

[0029] Step S12: Input the input feature sequence into the transaction access information prediction model. The long short-term memory network in the transaction access information prediction model captures the dependency relationship between the transaction input feature sequence and the transaction access information, and predicts the user information of the two parties corresponding to each blockchain transaction data. The user information includes at least the balance information.

[0030] In this embodiment, the transaction access information prediction model used to predict user information of both parties in a transaction can employ a Long Short-Term Memory (LSTM) network. LSTM is a special type of recurrent neural network that can effectively capture and learn the long-term dependencies and complex temporal patterns between the transaction input feature sequence and transaction access information (such as user information), thereby making more accurate predictions. Here, user information can refer to the balance information of both parties in the transaction.

[0031] When concatenating various features, all the features mentioned above can be concatenated in a fixed order to form a feature vector sequence of fixed length (i.e., the input feature sequence). If the number of obtained trading parameters is not fixed, a padding strategy can be used to supplement trading parameters or a truncation strategy can be used to reduce trading parameters to ensure that the length of the input feature sequence is fixed.

[0032] In one feasible embodiment, the step of analyzing the conflicts between blockchain transaction data based on the transaction access information corresponding to each blockchain transaction data and constructing a directed acyclic graph may include: Step S21: Identify two or more blockchain transaction data sets containing the same user information as conflicting blockchain transaction data sets. Step S22: The execution order of conflicting blockchain transaction data is determined as serial execution, and the execution order of non-conflicting blockchain transaction data is determined as parallel execution. Step S23: Generate a directed acyclic graph based on the execution order of each blockchain transaction.

[0033] Among them, user information can be balance information. Each blockchain transaction data predicts the user balance information of both parties through the transaction access information prediction model. For two blockchain transaction data, there are two sets of KV key-value pairs. Each KV key-value pair includes the balance information of the sender and the balance information of the receiver.

[0034] The existence of identical user information refers to the existence of identical balance values ​​among user balance information corresponding to two or more blockchain transaction data. This balance value is not limited to belonging to the sender or receiver. In this case, it indicates that within two or more blockchain transaction data sets (corresponding to a single blockchain transaction data group), a single user participated in two transactions (either as a sender or receiver). During each transaction, the user's balance information changes (the sender's balance decreases, the receiver's balance increases). If these two or more blockchain transaction data sets are executed in parallel, it will result in two different updates to the user's balance information. In this situation, it can be understood that the two or more blockchain transaction data sets conflict and can only be executed sequentially, not in parallel.

[0035] Therefore, in this embodiment of the application, transactions with conflicts are determined to be executed serially, while transactions without conflicts are determined to be executed in parallel, which can maximize the efficiency of transaction execution and avoid transaction conflicts.

[0036] A Directed Acyclic Graph (DAG) is a graph-theoretic data structure consisting of vertices and directed edges. Its characteristic is that there are no directed paths that form loops. In a DAG, each blockchain transaction corresponds to a node. The nodes of transactions executed sequentially are connected to each other to represent the order of execution. The nodes of transactions executed in parallel are not connected to each other, meaning they can be executed simultaneously, maximizing the throughput of transaction data.

[0037] In one feasible embodiment, the step of executing each blockchain transaction data according to the directed acyclic graph to obtain the transaction result corresponding to each blockchain transaction data includes: Step S31: Execute each blockchain transaction in a serial or parallel manner according to the execution order of each blockchain transaction in the directed acyclic graph. Step S32: During the execution of each blockchain transaction data, record the actual access information corresponding to each blockchain transaction data, and determine whether there is a conflict between the blockchain transaction data executed in parallel based on the actual access information. Step S33: If a conflict is detected between multiple blockchain transaction data executed in parallel, the transaction result corresponding to the first blockchain transaction data that ranks first among the blockchain transaction data executed in parallel is retained, and the transaction results of the second blockchain transaction data other than the first blockchain transaction data are discarded. Step S34: After the current batch of blockchain transaction data is completed, each second blockchain transaction data is placed in a preset retry queue, and each second blockchain transaction data in the retry queue is executed serially to obtain the transaction result corresponding to each second blockchain transaction data.

[0038] It should be noted that the transaction access information corresponding to each blockchain transaction data predicted by the transaction access information prediction model in step S10 may be incorrect. In the case of incorrect predicted transaction access information, two blockchain transaction data that are originally conflicting may be mistakenly represented in parallel execution in the DAG graph and executed in parallel in step S31. During the parallel execution, the actual access information corresponding to these two blockchain transaction data is recorded. If there is the same user information (such as balance information) between these two sets of transaction access information, it can be determined that there is a conflict between the multiple blockchain transaction data executed in parallel.

[0039] For example, for blockchain transaction data A and blockchain transaction data B, the key-value pairs representing the balance information in the predicted transaction access information are "1000 and 1200" and "1100 and 1300" respectively. This indicates that the two key-value pairs do not contain the same balance information, and blockchain transaction data A and blockchain transaction data B can be executed in parallel. However, during the actual execution of these two transactions, it was found that the actual key-value pair for blockchain transaction data A was "1000-1200", and the actual key-value pair for blockchain transaction data B was "1000-1300" (equivalent to the actual access information being inconsistent with the predicted transaction access information). This shows that both key-value pairs contain the same balance information "1000", which may correspond to the same user, meaning there is a conflict between blockchain transaction data A and blockchain transaction data B.

[0040] In the event of a conflict between blockchain transaction data A and blockchain transaction data B, the execution result of the blockchain transaction data that ranks higher (e.g., blockchain transaction data A, which is equivalent to the first blockchain transaction data) will be retained, while the execution result of the blockchain transaction data that ranks lower (e.g., blockchain transaction data B, which is equivalent to the second blockchain transaction data) will be discarded, in order to avoid errors in the user's balance information.

[0041] Finally, after the current batch of blockchain transaction data has been executed, that is, after all the blockchain transaction data represented in this DAG has been processed (processing here includes retaining the execution results and discarding the results), the blockchain transaction data whose execution results were discarded is then processed. These blockchain transaction data are placed in a preset retry queue and re-executed serially to avoid conflicts again, until all blockchain transaction data in the current batch has been executed.

[0042] For example, during the processing of batch transactions in a blockchain system, the model inference module loads a trained LSTM model (i.e., a transaction access information prediction model) from the model storage module. For each transaction in Batch 2 (i.e., the current batch), the inference module extracts its input features (purpose, parameters, sender, amount, type) and inputs them into the transaction access information prediction model. The model calculates and outputs a predicted list of key-value pairs (e.g., predicting that transaction TxM will access contract_C: slot_789 and contract_D: slot_012). Further, the scheduling and execution module receives Batch 2 and its predicted key-value access information. It then analyzes the predicted access lists of all transactions to identify potential read-write conflicts (e.g., both transaction A and transaction B are predicted to write to contract_X: slot_1). Based on the above analysis, a corresponding DAG graph is constructed, arranging conflict-free blockchain transaction data on parallel paths, while transactions with dependencies (i.e., conflicts) are arranged on serial paths. Then, the transactions in Batch 2 are executed in parallel according to the constructed DAG graph. During execution, the system monitors the actual access information of transactions in real time. Assuming that transaction TxM, when executed in parallel, accesses the same key-value pair as predicted without conflict, its execution is successful. However, if the prediction for another transaction TxN is inaccurate, and it actually accesses an unpredicted key-value pair, causing a write conflict with another parallel transaction, the system immediately detects the conflict, abandons the execution result of TxN, and, after the current batch is completed, places transaction TxN into a retry queue for serial re-execution to obtain the accurate result.

[0043] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description and will not be repeated hereafter. Furthermore, before the step of inputting the parameters corresponding to the multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data, the blockchain batch transaction execution method may further include: Step A10: Execute the first batch of multiple blockchain transaction data sequentially to obtain the input feature sequence and actual access information corresponding to each blockchain transaction data. Step A20: Take the input feature sequence corresponding to each blockchain transaction data as the input feature, and take the actual access information corresponding to each blockchain transaction data as the output label. Step A30: Based on each input feature and each output label, train the preset LSTM neural network model to obtain the transaction access information prediction model.

[0044] This application provides a method for training an LSTM neural network model before applying a transaction access information prediction model. Steps A10 to A30 can be applied to the model training module of a blockchain system. It is understood that even if the blockchain system's model storage module does not yet store a trained transaction access information prediction model, the blockchain system still needs to process batch transactions. In this case, the blockchain system directly executes the first batch of multiple blockchain transaction data sequentially, that is, it executes each blockchain transaction data in turn, and then records in detail the input feature sequence (corresponding to input features) and actual access information (corresponding to output labels) corresponding to each blockchain transaction data as the data basis for model training.

[0045] For example, the LSTM-based Ethereum transaction parallel execution system is a transaction parallel execution system applied to the Ethereum Virtual Machine (EVM) environment. The system is deployed on blockchain nodes as part of their execution engine. Upon system startup, the model storage module is empty. Therefore, the model inference module will output an empty prediction on its first run, and all transactions will be executed serially by the scheduling execution module. During serial execution, the system records the input characteristics of each transaction and the storage slots (key-value pairs) it actually accesses as an execution log.

[0046] Furthermore, the model training module uses the received execution logs as the training dataset. Each sample in the dataset takes an "input feature sequence" as input and an "actual list of accessed key-value pairs" as output labels. The model training module uses this dataset to train a pre-defined LSTM neural network model. After training, the generated transaction access information prediction model is stored in the model storage module.

[0047] For example, after the first batch of transactions (Batch 1) arrives in the blockchain system, the model inference module in the blockchain system outputs an empty prediction because it cannot call the trained model. The scheduling and execution module receives Batch 1 and the empty prediction. Since there is no prediction information, the module executes all transactions in Batch 1 sequentially. During execution, the module accurately records the complete input feature sequence of each transaction (Tx1, Tx2, ..., TxN) (e.g., to: 0x..., data: 0xa905..., from: 0x..., value: 1 ETH, type: EIP-1559) and its actual accessed key-value pairs (e.g., contract_A: slot_123, contract_B: slot_456). Then, the scheduling and execution module sends the complete execution log of Batch 1 (containing the input features and actual key-value access records of all transactions) to the model training module, which trains the LSTM neural network model into a transaction access information prediction model.

[0048] During the training of the LSTM neural network model, the following key hyperparameters are mainly optimized and updated: Optimizer: Employs the Adam optimizer (an adaptive learning rate optimization algorithm), which combines the advantages of momentum and adaptive learning rate, making it suitable for handling sparse gradients; Learning Rate: The initial learning rate can be set to 0.001 and can be dynamically adjusted according to the loss changes during training (learning rate decay). Batch Size: Can be set to 32 or 64 to balance training speed and gradient estimation stability; Number of training epochs: This can be dynamically determined based on the size of the training dataset and the model's convergence, and is usually between 50 and 200 epochs; Loss Function: Binary Cross-Entropy Loss is used because this is a multi-label classification problem (a transaction may access multiple key-value pairs). Regularization: To prevent overfitting, a Dropout layer is added between the LSTM layer and the fully connected layer, with the Dropout rate set to 0.2-0.5; The LSTM model in this embodiment, through the above architecture and parameter settings, can effectively learn complex access patterns from massive historical blockchain transaction data and provide high-precision prediction results for the scheduling and execution module. It is a core component for achieving efficient parallel execution in this embodiment.

[0049] Furthermore, in one feasible embodiment, the LSTM neural network model includes an input layer, an embedding layer, a bidirectional LSTM layer, a fully connected layer, and an output layer arranged in sequence.

[0050] Specifically, the LSTM model used in this application embodiment is a multi-layer bidirectional LSTM network, and its specific architecture includes the following: Input Layer: Used to receive preprocessed transaction feature vectors; Embedding Layer: For discrete features with high cardinality (such as contract addresses and method selectors), an embedding layer first maps them to a low-dimensional, dense vector space. This helps the model learn the latent semantic relationships between these entities. Bidirectional LSTM Layers: The core of these layers consists of 2-3 stacked bidirectional LSTM units. The bidirectional structure allows the model to consider both past (forward LSTM) and future (backward LSTM) information of the sequence when processing the current time step, which is crucial for understanding the context of the transaction parameter sequence. The number of hidden units in each LSTM layer is set to 128 or 256. Fully connected (Dense) Layer: Arranged after the bidirectional LSTM layer, connecting one or more fully connected (Dense) layers. The number of neurons in the last fully connected layer is equal to the total number of key-value pairs (or memory slots) that can be accessed in the system, used to output the probability of each key-value pair being accessed; Output Layer: This layer uses the sigmoid activation function to convert the output of each neuron into a probability value between 0 and 1, representing the likelihood of the transaction accessing the corresponding key-value pair. Finally, by setting a probability threshold (e.g., 0.5), the probability output is converted into a binary "access / non-access" prediction.

[0051] Based on the first and second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to the first and second embodiments described above can be referred to the above description and will not be repeated hereafter. Furthermore, after the step of executing each blockchain transaction data according to the directed acyclic graph to obtain the transaction results corresponding to each blockchain transaction data, the blockchain batch transaction execution method further includes: Step S40: Based on the transaction input feature sequence and actual access information corresponding to each blockchain transaction data, the transaction access information prediction model is trained to obtain the updated transaction access information prediction model.

[0052] This application provides a model training and iteration method. Specifically, the transaction input feature sequence and actual access information (e.g., actual key-value access information) collected during the execution of the current batch of blockchain transaction data can be used by the scheduling and execution module in the blockchain system as a training dataset and input into the model training module. The model training module uses this dataset to train or retrain the transaction access information prediction model, generating an updated transaction access information prediction model, and storing it in the model storage module for use in the next round of prediction, thereby achieving continuous learning and performance optimization of the transaction access information prediction model.

[0053] For example, the scheduling execution module sends the complete execution log of Batch 2 (i.e. the current batch) (including predicted transaction access information, actual access information, conflict records, etc.) to the model training module for the next round of model retraining, so that the model can learn the abnormal access patterns of TxN and improve the accuracy of the model's future predictions.

[0054] Based on the foregoing embodiments, this application essentially constructs a closed-loop feedback system. The real execution logs (containing actual transaction access information) collected by the scheduling and execution module are used as high-quality training data for continuous training and updating of the machine learning model. This enables the model to continuously learn the latest transaction patterns and user behaviors, and its prediction accuracy will continuously improve over time, giving the system performance the ability to self-evolve.

[0055] For ease of understanding, in conjunction with the content of the foregoing embodiments, refer to... Figure 2 The blockchain system utilizes a model inference module, a scheduling and execution module, a model training module, and a model storage module to execute blockchain batch transactions. Specifically, upon receiving the current batch of batch transaction tasks, the model inference module, in conjunction with the model storage module, determines whether the model has been trained. If so, it calls the model prediction stored in the model storage module to output the predicted key-value (KV) access information; otherwise, it outputs an empty prediction. The scheduling and execution module then calls the parallel execution engine to process the batch transactions, generate execution results, and generate actual KV access logs. These logs are fed back to the model training module, which trains and updates the model to obtain the updated model, which is then sent to the model storage module.

[0056] Furthermore, the data interaction between the user and various modules in the blockchain system, such as... Figure 3As shown, firstly, the client sends a batch of transactions to the model inference module. The model inference module checks if the model exists in the model storage module. If the model exists, the model storage module returns the model, and the model inference module analyzes the transaction characteristics, executes the LSTM model prediction, and returns the predicted key-value pairs (KV). If the model does not exist, an empty prediction is returned, the prediction / empty result is analyzed, and a DAG execution graph is constructed. The scheduling execution module sends the transactions and DAG to the parallel execution engine, which executes each transaction, including parallel execution of the transaction and recording the actual KV accesses. In the event of an actual conflict, the conflict is reported, the result is abandoned, and the transaction is retried serially. A batch receipt and execution log are returned to the scheduling execution module. The scheduling execution module sends the execution log containing the actual KV to the model training module. The model training module uses the log to train the LSTM model and stores the updated model in the model storage module. Finally, the scheduling execution module returns the final batch receipt to the client.

[0057] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the blockchain batch transaction execution method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0058] This application also provides a blockchain batch transaction execution device; please refer to... Figure 4 The blockchain batch transaction execution device includes: The model inference module 10 is used to input the parameters corresponding to the multiple blockchain transaction data in the current batch into the pre-trained transaction access information prediction model, and predict the transaction access information corresponding to each blockchain transaction data, wherein the transaction access information includes at least the user information of the two parties to the transaction. The transaction scheduling module 20 is used to analyze the conflict between the blockchain transaction data based on the transaction access information corresponding to each blockchain transaction data, and construct a directed acyclic graph, wherein the directed acyclic graph includes at least the execution order of each blockchain transaction data, and the execution order includes at least parallel execution and serial execution. The transaction execution module 30 is used to execute each of the blockchain transaction data according to the directed acyclic graph, and obtain the transaction results corresponding to each of the blockchain transaction data.

[0059] In one embodiment, the model inference module 10 is further configured to: Extract the transaction purpose, transaction input parameters, transaction initiation parameters, transaction amount, and transaction type corresponding to each blockchain transaction data, and determine the corresponding input feature sequence; The input feature sequence is input into the transaction access information prediction model. The long short-term memory network in the transaction access information prediction model captures the dependency relationship between the transaction input feature sequence and the transaction access information, and predicts the user information of the two parties corresponding to each blockchain transaction data. The user information includes at least balance information.

[0060] In one embodiment, the transaction purpose includes an address parameter, the transaction input parameters include fields and function parameters of a method selector, the transaction initiation parameters include account parameters and address parameters, the transaction amount includes a numerical parameter, and the transaction type includes a classification parameter; Model inference module 10 is also used for: The address parameter is processed by a preset hash function to obtain the corresponding string; Select the first preset number of units digits from the string as the address feature; The first second preset number of bytes of the field of the method selector are used as the field feature; The function parameters are processed by word segmentation or hashing to obtain the corresponding function features; The numerical parameters are normalized to obtain the corresponding numerical features; The classification parameters are one-hot encoded to obtain the corresponding type features; The address features, field features, function features, numerical features, and type features are concatenated according to a preset arrangement order to obtain the input feature sequence.

[0061] In one embodiment, the transaction scheduling module 20 is further configured to: Two or more blockchain transaction records containing the same user information are identified as conflicting blockchain transaction data groups; The execution order of conflicting blockchain transactions is determined as serial execution, while the execution order of non-conflicting blockchain transactions is determined as parallel execution. A directed acyclic graph is generated based on the execution order of each blockchain transaction.

[0062] In one embodiment, the transaction execution module 30 is further configured to: According to the execution order of each blockchain transaction in the directed acyclic graph, each blockchain transaction is executed in a serial or parallel manner. During the execution of each blockchain transaction, the actual access information corresponding to each blockchain transaction is recorded, and the conflict between the blockchain transactions executed in parallel is determined based on the actual access information. If a conflict is detected between multiple blockchain transaction data executed in parallel, the transaction result corresponding to the first blockchain transaction data that is ranked first among the blockchain transaction data executed in parallel will be retained, and the transaction result of the second blockchain transaction data other than the first blockchain transaction data will be discarded. After the current batch of blockchain transaction data is completed, each second blockchain transaction data is placed in a preset retry queue; Each second blockchain transaction in the retry queue is executed serially to obtain the transaction result corresponding to each second blockchain transaction.

[0063] In one embodiment, the blockchain batch transaction execution device further includes a model training module, which is used for: The first batch of multiple blockchain transaction data is executed serially to obtain the input feature sequence and actual access information corresponding to each blockchain transaction data. The input feature sequence corresponding to each blockchain transaction data is used as the input feature, and the actual access information corresponding to each blockchain transaction data is used as the output label. Based on the input features and output labels, a preset LSTM neural network model is trained to obtain a transaction access information prediction model.

[0064] In one embodiment, the LSTM neural network model includes an input layer, an embedding layer, a bidirectional LSTM layer, a fully connected layer, and an output layer arranged in sequence.

[0065] In one embodiment, the model training module is further configured to: Based on the transaction input feature sequence and actual access information corresponding to each of the blockchain transaction data, the transaction access information prediction model is trained to obtain the updated transaction access information prediction model.

[0066] The blockchain batch transaction execution device provided in this application, employing the blockchain batch transaction execution method in the above embodiments, can prevent parallel conflicts before transaction execution, thereby increasing the upper limit of parallel execution of blockchain transaction data and the throughput of transaction data. Compared with the prior art, the beneficial effects of the blockchain batch transaction execution device provided in this application are the same as those of the blockchain batch transaction execution method provided in the above embodiments, and other technical features in the blockchain batch transaction execution device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0067] This application provides a blockchain batch transaction execution device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable 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 execute the blockchain batch transaction execution method in the above embodiment 1.

[0068] The following is for reference. Figure 5 The diagram illustrates a structural schematic of a blockchain batch transaction execution device suitable for implementing embodiments of this application. The blockchain batch transaction execution device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, tablets, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital televisions and desktop computers. Figure 5 The blockchain bulk transaction execution device shown is merely an example and should not impose any limitations on the functionality and scope of the embodiments of this application.

[0069] like Figure 5As shown, the blockchain batch transaction execution device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the blockchain batch transaction execution device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the blockchain bulk transaction execution device to communicate wirelessly or wiredly with other devices to exchange data. While the figure shows blockchain bulk transaction execution devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0070] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0071] The blockchain batch transaction execution device provided in this application, employing the blockchain batch transaction execution method in the above embodiments, can prevent parallel conflicts before transaction execution, thereby increasing the upper limit of parallel execution of blockchain transaction data and the throughput of transaction data. Compared with the prior art, the beneficial effects of the blockchain batch transaction execution device provided in this application are the same as those of the blockchain batch transaction execution method provided in the above embodiments, and other technical features in this blockchain batch transaction execution device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0072] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0073] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0074] The above descriptions are merely some embodiments of this application and do not limit the scope of protection of this application. Any equivalent structural transformations made based on the technical concept of this application and the content of this specification and drawings, or direct / indirect applications in other related technical fields, are included within the scope of protection of this application. All actions involving the acquisition of signals, information, or data in this application are performed in accordance with the relevant data protection laws and policies of the country where the application is located and with authorization from the owner of the corresponding device.

Claims

1. A method for executing batch transactions in a blockchain, characterized in that, The blockchain batch transaction execution method includes: The parameters corresponding to the multiple blockchain transaction data in the current batch are input into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data. The transaction access information includes at least the user information of the two parties to the transaction. Based on the transaction access information corresponding to each of the blockchain transaction data, the conflict between the blockchain transaction data is analyzed, and a directed acyclic graph is constructed. The directed acyclic graph includes at least the execution order of each of the blockchain transaction data, and the execution order includes at least parallel execution and serial execution. Execute each of the blockchain transaction data according to the directed acyclic graph to obtain the transaction result corresponding to each of the blockchain transaction data.

2. The blockchain batch transaction execution method as described in claim 1, characterized in that, The step of inputting the parameters corresponding to multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data includes: Extract the transaction purpose, transaction input parameters, transaction initiation parameters, transaction amount, and transaction type corresponding to each blockchain transaction data, and determine the corresponding input feature sequence; The input feature sequence is input into the transaction access information prediction model. The long short-term memory network in the transaction access information prediction model captures the dependency relationship between the transaction input feature sequence and the transaction access information, and predicts the user information of the two parties corresponding to each blockchain transaction data. The user information includes at least balance information.

3. The blockchain batch transaction execution method as described in claim 2, characterized in that, The transaction purpose includes an address parameter; the transaction input parameters include fields and function parameters of the method selector; the transaction initiation parameters include account parameters and address parameters; the transaction amount includes a numerical parameter; and the transaction type includes a classification parameter. The step of extracting the transaction purpose, transaction input parameters, transaction initiation parameters, transaction amount, and transaction type corresponding to each blockchain transaction data, and determining the corresponding input feature sequence includes: The address parameter is processed by a preset hash function to obtain the corresponding string; Select the first preset number of units digits from the string as the address feature; The first second preset number of bytes of the field of the method selector are used as the field feature; The function parameters are processed by word segmentation or hashing to obtain the corresponding function features; The numerical parameters are normalized to obtain the corresponding numerical features; The classification parameters are one-hot encoded to obtain the corresponding type features; The address features, field features, function features, numerical features, and type features are concatenated according to a preset arrangement order to obtain the input feature sequence.

4. The blockchain batch transaction execution method as described in claim 1, characterized in that, The step of analyzing the conflicts between blockchain transaction data based on the transaction access information corresponding to each of the blockchain transaction data and constructing a directed acyclic graph includes: Two or more blockchain transaction records containing the same user information are identified as conflicting blockchain transaction data groups; The execution order of conflicting blockchain transactions is determined as serial execution, while the execution order of non-conflicting blockchain transactions is determined as parallel execution. A directed acyclic graph is generated based on the execution order of each blockchain transaction.

5. The blockchain batch transaction execution method as described in claim 1, characterized in that, The step of executing each blockchain transaction based on the directed acyclic graph to obtain the transaction result corresponding to each blockchain transaction includes: According to the execution order of each blockchain transaction in the directed acyclic graph, each blockchain transaction is executed in a serial or parallel manner. During the execution of each blockchain transaction, the actual access information corresponding to each blockchain transaction is recorded, and the conflict between the blockchain transactions executed in parallel is determined based on the actual access information. If a conflict is detected between multiple blockchain transaction data executed in parallel, the transaction result corresponding to the first blockchain transaction data that is ranked first among the blockchain transaction data executed in parallel will be retained, and the transaction result of the second blockchain transaction data other than the first blockchain transaction data will be discarded. After the current batch of blockchain transaction data is completed, each second blockchain transaction data is placed in a preset retry queue; Each second blockchain transaction in the retry queue is executed serially to obtain the transaction result corresponding to each second blockchain transaction.

6. The blockchain batch transaction execution method as described in claim 1, characterized in that, Before the step of inputting the parameters corresponding to the multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data, the blockchain batch transaction execution method further includes: The first batch of multiple blockchain transaction data is executed serially to obtain the input feature sequence and actual access information corresponding to each blockchain transaction data. The input feature sequence corresponding to each blockchain transaction data is used as the input feature, and the actual access information corresponding to each blockchain transaction data is used as the output label. Based on the input features and output labels, a preset LSTM neural network model is trained to obtain a transaction access information prediction model.

7. The blockchain batch transaction execution method as described in claim 6, characterized in that, The LSTM neural network model includes an input layer, an embedding layer, a bidirectional LSTM layer, a fully connected layer, and an output layer arranged in sequence.

8. The blockchain batch transaction execution method as described in claim 1, characterized in that, After the step of executing each blockchain transaction based on the directed acyclic graph to obtain the transaction result corresponding to each blockchain transaction, the blockchain batch transaction execution method further includes: Based on the transaction input feature sequence and actual access information corresponding to each of the blockchain transaction data, the transaction access information prediction model is trained to obtain an updated transaction access information prediction model.

9. A blockchain batch transaction execution device, characterized in that, The blockchain batch transaction execution device includes: The model inference module is used to input the parameters corresponding to multiple blockchain transaction data in the current batch into a pre-trained transaction access information prediction model to predict the transaction access information corresponding to each blockchain transaction data. The transaction access information includes at least the user information of the two parties to the transaction. The transaction scheduling module is used to analyze the conflict between the blockchain transaction data based on the transaction access information corresponding to each blockchain transaction data, and construct a directed acyclic graph. The directed acyclic graph includes at least the execution order of each blockchain transaction data, and the execution order includes at least parallel execution and serial execution. The transaction execution module is used to execute each of the blockchain transaction data according to the directed acyclic graph, and obtain the transaction results corresponding to each of the blockchain transaction data.

10. A blockchain batch transaction execution device, characterized in that, The blockchain batch transaction execution device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the blockchain batch transaction execution method as described in any one of claims 1 to 8.