Transaction processing method, electronic device, storage medium, and computer program product

CN122905660APending Publication Date: 2026-10-13MIGU CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610956752.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0002]当前区块链交易处理中,缺乏有效的激励机制,交易处理的主动权在旷工节点,旷工节点会优先处理交易费更高的交易,使得滞留的低交易费的交易难以得到及时处理

Benefits of technology

[0008]本申请实施例所提供的交易处理方法、电子设备、存储介质及计算机程序产品,通过将交易紧迫程度和交易费等多维信息与算力共同作为记账节点选择概率的依据,构建了兼顾交易时效性与公平性的多因素激励机制,有效解决了低交易费交易滞留、矿工选择性处理交易的问题,提升了区块链交易处理的整体效率与公平性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905660A_ABST
    Figure CN122905660A_ABST
Patent Text Reader

Abstract

The application provides a transaction processing method, an electronic device, a storage medium and a computer program product. The transaction processing method comprises: determining the probability of each absent worker node in a plurality of absent worker nodes being selected as a ledger node based on the computing power of each absent worker node and a first parameter; the first parameter of each absent worker node is related to first information of each absent worker node; the first information comprises the urgency of a processed transaction and the transaction fee of the processed transaction; the urgency of the transaction is related to the time to failure of the transaction; selecting a ledger node from the plurality of absent worker nodes through a consensus algorithm based on the probability of each absent worker node being selected as a ledger node; and processing transactions in a transaction pool to be processed through the ledger node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, specifically to a transaction processing method, electronic device, storage medium, and computer program product. Background Technology

[0002] Currently, blockchain transaction processing lacks an effective incentive mechanism, and the initiative in transaction processing lies with the miner nodes. Miner nodes will prioritize processing transactions with higher transaction fees, making it difficult for low-fee transactions to be processed in a timely manner. Summary of the Invention

[0003] This application provides a transaction processing method, a transaction processing apparatus, an electronic device, and a storage medium.

[0004] The transaction processing method provided in this application includes: Based on the computing power and first parameters of each of the multiple miner nodes, the probability of each miner node being selected as an accounting node is determined; the first parameters of each miner node are related to the first information of each miner node; the first information includes: the urgency of processed transactions and the transaction fee of processed transactions; the urgency of the transaction is related to the time before the transaction expires; Based on the probability of each miner node being selected as a record node, a consensus algorithm is used to select a record node from the multiple miners. Transactions in the pending transaction pool are processed through the accounting nodes.

[0005] The electronic device provided in this application includes: a first processor and a memory, the memory being used to store a computer program, and the first processor being used to call and run the computer program stored in the memory to execute the transaction processing method provided in any embodiment of this application.

[0006] The storage medium provided in this application embodiment is used to store a computer program, which causes a computer to execute the transaction processing method provided in any embodiment of this application.

[0007] The computer program product provided in the embodiments of this application includes a computer program that, when executed by a processor, implements the transaction processing method provided in any embodiment of this application.

[0008] The transaction processing method, electronic device, storage medium, and computer program product provided in this application construct a multi-factor incentive mechanism that balances transaction timeliness and fairness by using multi-dimensional information such as transaction urgency and transaction fees, along with computing power, as the basis for selecting ledger nodes. This effectively solves the problems of low-fee transaction delays and miners selectively processing transactions, thereby improving the overall efficiency and fairness of blockchain transaction processing. Attached Figure Description

[0009] Figure 1 A schematic diagram illustrating the implementation flow of the transaction processing method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the penalty processing provided in the embodiments of this application; Figure 3 A schematic diagram of the incentive mechanism provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the transaction processing apparatus provided in the embodiments of this application; Figure 5 A schematic structural diagram of an electronic device provided in the embodiments of this application; Figure 6 This is a schematic structural diagram of the chip provided in an embodiment of this application. Detailed Implementation

[0010] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0011] It should be noted that, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, in the embodiments of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0012] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0013] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and they all fall within the protection scope of the embodiments of this application.

[0014] In related technologies, the transaction processing flow of a blockchain system is as follows: First, the user initiates a transaction, combines the transaction structure and generates a digital signature. When combining the transaction structure, in addition to including the sender and receiver addresses, transaction amount, digital signature and other structural data, it should also include a transaction fee, which will be paid to the accounting node.

[0015] Subsequently, users broadcast their transactions. Upon receiving this broadcast, miner nodes verify the transactions and place valid transactions into a pending transaction pool. Then, they select a subset of transactions from this pool to form a new block. For security reasons, the number of transactions that can be recorded in each block is limited, and each miner is free to choose which transactions to process. Therefore, transaction fees are a crucial factor in transaction selection.

[0016] When a miner node is selected as a ledger node, the block it creates becomes a new valid block. This block is broadcast to the entire network, and the remaining nodes verify and update their ledgers. Transactions within the block are confirmed, and the transactions are successful. Simultaneously, the ledger node receives transaction fees recorded in the block as an incentive.

[0017] As explained above, users need to carefully select transaction fees based on the urgency of the transaction. Setting the transaction fee too high will result in unnecessary waste. Setting it too low will lead to increased transaction processing delays, as miner nodes may prioritize processing other transactions with higher fees.

[0018] In blockchain transaction processing, time-sensitive transactions (such as transactions in blockchain-based auction systems and combined transactions) need to be confirmed within a limited time. However, the relevant mechanisms have the following problems: First, miner nodes cannot quantify the time-sensitive value differences of transactions, resulting in highly time-sensitive transactions not being prioritized, while ordinary transactions are forced into transaction fee competition, causing resource misallocation. Second, even if a time-sensitive transaction is delayed, it still needs to pay the original transaction fee when it is processed later, which not only results in the ineffective occupation of the time window but also exacerbates the waste of user resources. In addition, the monopoly of transaction processing resources by miner nodes and the lack of effective incentive mechanisms make it difficult to process delayed transactions in a timely manner, further reducing the overall efficiency of the system.

[0019] refer to Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation flow of the transaction processing method provided in the embodiments of this application, such as... Figure 1 As shown, the transaction processing method provided in this embodiment includes the following steps: Step 101: Based on the computing power and first parameters of each miner node among multiple miner nodes, determine the probability that each miner node will be selected as an accounting node; the first parameters of each miner node are related to the first information of each miner node; the first information includes: the urgency of processed transactions and the transaction fee of processed transactions; the urgency of the transaction is related to the time before the transaction expires.

[0020] In this embodiment of the application, the first parameter can also be called the reputation value, which characterizes the reliability of the miner node in processing transactions.

[0021] In this embodiment of the application, the probability of a miner node being selected as an accounting node can be calculated using the following formula: ,in, It represents the probability that a miner node will be selected as a ledger node. As the first parameter, It is the computing power of the mining nodes. Let i be the first parameter of the i-th miner node. Let be the computing power of the i-th miner node. Computing power can be represented in different ways. For example, in a PoW consensus blockchain system, computing power refers to the mining machine's computing speed; in a PoS consensus blockchain system, computing power refers to collateral; and in a PoA consensus blockchain system, computing power refers to storage capacity. Since the primary function of a miner node is to maintain the state of the system ledger, which essentially involves transaction processing, the first parameter in this application is a parameter related to transaction processing. This application links the competition for the right to record transactions in the consensus mechanism with transaction processing, which is a reasonable design.

[0022] In this embodiment of the application, the transaction has a valid time limit. If the valid time limit is reached, the transaction will become an invalid transaction. The shorter the time before the transaction expires, the higher the urgency of the transaction.

[0023] In this embodiment of the application, the lower the urgency of the transactions already processed by the miner node and the higher the transaction fee of the processed transactions, the more it indicates that the miner node only cares about the profit and does not prioritize processing urgent transactions, and the smaller the first parameter value of the miner node is.

[0024] In this embodiment of the application, for newly added miner nodes in the blockchain, if the miner node has no historical transactions, the same initial value of the first parameter can be assigned to the miner node; if the miner node has historical transactions, the initial value of the first parameter can be assigned to the miner node based on the first information of the processed transactions of each miner node, according to the rule that the smaller the urgency of the processed transactions and the higher the transaction fee of the processed transactions, the smaller the value of the first parameter of the miner node.

[0025] Step 102: Based on the probability of each miner node being selected as a record node, a record node is selected from the multiple miner nodes using a consensus algorithm.

[0026] In this embodiment, after obtaining the probability of each miner node being selected as a record-keeping node, a consensus algorithm (such as weighted random polling, verifiable random functions, or random beacon mechanisms) is used to ultimately determine the record-keeping node from all miner nodes in a decentralized, unpredictable, and unmanipulated manner based on the above probabilities. This directly transforms the historical transaction behavior reflected by the first parameter into the actual allocation of record-keeping opportunities, enabling miner nodes with good historical behavior to obtain more record-keeping opportunities, while nodes with poor historical behavior face fewer record-keeping opportunities, thereby incentivizing miner nodes to prioritize urgent transactions.

[0027] Step 103: Process the transactions in the pending transaction pool through the accounting node.

[0028] In this embodiment of the application, the transactions in the pending transaction pool are those submitted by the user. After the user submits the relevant information of the transaction, the user broadcasts the transaction to the entire network. After receiving the transaction, the miner node will verify the transaction. After the verification is successful, the transaction will be added to the pending transaction pool. The relevant information of the transaction can be configured by the user. The relevant information of the transaction includes: digital signature, sender address, receiver address, transaction amount, transaction structure data, transaction validity period, and transaction fee.

[0029] Based on this, in this embodiment of the application, the relevant information of the transaction includes: digital signature, sender address, receiver address, transaction amount, transaction structure data, transaction validity period, and transaction fee.

[0030] In this embodiment, time-sensitive transactions (such as transactions in blockchain-based auction systems and combined transactions) need to be confirmed within a limited time. However, miner nodes cannot quantify the time-sensitive value differences of transactions, resulting in highly time-sensitive transactions not being prioritized, while ordinary transactions are forced into transaction fee competition, causing resource misallocation. Secondly, even if a time-sensitive transaction is delayed, the original transaction fee still needs to be paid when the transaction is processed later, which not only results in the invalidation of the time window but also exacerbates the waste of user resources.

[0031] Therefore, this application proposes that the trend of transaction fees over time conforms to the bimodal curve model. By adopting the bimodal value curve model, the early high-value zone incentivizes miner nodes to process transactions quickly, and the final high-value zone incentivizes miners to complete transaction confirmation within the effective time, thereby reducing the impact of transaction fees on transaction delays.

[0032] The function of the bimodal curve is as follows: ,in, It is the sum of the two peak transaction fees, that is, the maximum transaction fee configured by the user. It is a weighting coefficient that adjusts the transaction fee values ​​for the two peaks. , The slope coefficient is used to adjust the rate at which transaction fees increase with transaction processing delays. t represents the time elapsed since the transaction was generated. This is the first time the transaction fee peaks. This is the second peak time for transaction fees, which is configured by the transaction initiator based on the urgency of the transaction.

[0033] In this embodiment of the application, since some blockchain systems (such as PoW consensus mechanism blockchain systems) generate blocks at random times, the timestamp here can be represented by the block sequence number rather than a specific time. For example, The option is 1, which is the first block after the transaction is generated. Optional , This is the validity period of the transaction. For example, If a transaction is not processed by the 5th block, it is considered an invalid transaction.

[0034] In the embodiments of this application, and The transaction information is not displayed in plain text; for example, a scaling algorithm is used to represent the differences between transactions. and The size relationship is sufficient to prevent miners from waiting maliciously.

[0035] In this embodiment of the application, the effective time limit can also be represented by time, and this embodiment of the application does not limit it in this way.

[0036] In this embodiment, a first transaction fee peak incentivizes miner nodes to process transactions quickly and earn high returns. If a transaction is not processed during the first peak, the transaction fee decreases with latency. If a miner node confirms the transaction during this period, it receives a transaction fee, but less than the fee during the first peak. This setup avoids users bearing both high latency and high transaction fees. Subsequently, transactions enter a second peak. If a transaction is processed during this second peak, a relatively high transaction fee reward is awarded as an emergency processing bonus, preventing transaction invalidation. If a transaction is not effectively processed within its validity period, it expires. This setup effectively prevents transactions from being processed even after their value has been lost, thus avoiding the double loss of transaction invalidation and transaction fee payment for the user.

[0037] Based on this, in this embodiment of the application, the trend of the transaction fee over time conforms to a bimodal curve model; the relevant information of the transaction also includes: the first peak time of the transaction fee and the second peak time of the transaction fee.

[0038] In this embodiment, the process of the ledger node processing transactions in the pending transaction pool is as follows: the ledger node selects the transactions to be processed from the pending transaction pool, generates a block, stores the block on the blockchain, confirms the transactions on it, and the miner node receives the transaction fee. After generating the block, the ledger node counts the invalid transactions in the pending transaction pool and removes them from the pending transaction pool; the invalid transactions are those that have exceeded the transaction validity period; and a penalty is applied to the first parameters of each of the one or more first miner nodes involved in the lifecycle of the invalid transaction.

[0039] In this embodiment of the application, it should be noted that the transaction processing flow in the blockchain is as follows: after the accounting node generates a block, it needs to reselect an accounting node for processing. The one or more first miner nodes involved in the life cycle of an invalid transaction refer to the accounting nodes corresponding to each of the one or more first blocks that the invalid transaction has gone through from generation to invalidation. For example, an invalid transaction has gone through 3 first blocks from generation to invalidation, that is, the validity period of the transaction is three blocks. After going through three first blocks, the transaction has not been processed, so the transaction is invalid, and the first parameter of the three accounting nodes corresponding to these three first blocks needs to be penalized.

[0040] Based on this, in this embodiment of the application, processing transactions in the pending transaction pool through the accounting node includes: Transactions are retrieved from the pending transaction pool through the accounting node, blocks are generated, and the blocks are stored on the blockchain. After generating the block, the method further includes: Expired transactions are removed from the pending transaction pool; the expired transactions are those that have exceeded their validity period. The first parameter of each of the one or more first miner nodes involved in the lifecycle of the failed transaction is penalized.

[0041] In this embodiment, when a transaction exceeds the set validity period, the transaction automatically expires, and the user does not need to pay the original transaction fee. This effectively solves the problem of wasted time window and wasted user resources. Furthermore, the first parameter of each of the one or more first miner nodes involved in the life cycle of the expired transaction is penalized to effectively incentivize the miner nodes and encourage them to handle urgent transactions.

[0042] In this embodiment of the application, for the accounting node k of the Kth block, the set of invalid transactions involved is { Although the failed transaction i only becomes invalid in block K+1, it is broadcast for the first time in block K-3, and therefore still affects node k. (See reference) Figure 2 , Figure 2 This is a schematic diagram of the penalty processing provided in the embodiments of this application, such as... Figure 2 As shown, the factors considered in penalty processing include: the transaction amount of the invalid transaction, the time elapsed since the block was generated (urgency level), and the transaction fee. In addition to the status of invalid transactions, the impact of network status on transaction processing is also considered. That is, if there are too many pending transactions in the network, exceeding the maximum processing capacity of node k, it indicates network congestion, and the penalty for node k can be reduced. Furthermore, the characteristics of the transactions recorded in block K should also be taken into consideration. If the average transaction fee of valid transactions in the block is higher and the average urgency level is lower, it indicates that node k is only concerned with profit and has not prioritized urgent transactions, and the penalty for it should be strengthened.

[0043] Based on this, in this embodiment of the application, the penalty processing of the first parameters of each of the one or more first miner nodes involved in the lifecycle of the failed transaction includes: For any first miner node, based on the transaction information in the first block generated by the first miner node during the lifecycle of the failed transaction, the transaction information of the failed transaction, and preset rules, the first parameter of the first miner node is penalized.

[0044] In this embodiment of the application, the preset rules include one or more of the following rules: The first parameter of the first miner node is penalized based on the transaction fee of the failed transaction at the time the first block was generated; the higher the transaction fee of the failed transaction at the time the first block was generated, the stronger the penalty. The first parameter of the first miner node is penalized based on the transaction amount of the failed transaction; the higher the transaction amount of the failed transaction, the stronger the penalty. The first parameter of the first miner node is penalized based on the time from the failure of the failed transaction when the first block is generated; the shorter the time from the failure of the failed transaction when the first block is generated, the stronger the penalty. A penalty is applied to the first parameter of the first miner node based on the average transaction fee of all transactions in the first block; the higher the average transaction fee of all transactions in the first block, the stronger the penalty; and... The first parameter of the first miner node is penalized based on the average distance failure time of all transactions in the first block; the longer the average distance failure time of all transactions in the first block, the stronger the penalty.

[0045] In this embodiment of the application, the update formula for the first parameter is as follows: ; ; ;in, The first parameter of the penalty for the preceding node k, also known as the reputation factor, The first parameter of node k after the penalty; , , , , , All are regulatory factors, among which , As a multiplier factor, it determines the weight of each influencing factor and can be adjusted according to needs. It is a small coefficient to regulate the maximum impact of transaction fees, while avoiding a denominator of 0.

[0046] Let i be the transaction amount of the invalid transaction. This is the average transaction amount of all recorded transactions in block K. The transaction fee for invalid transaction i at block K. This is the average transaction fee for all recorded transactions in block K. Let i be the time elapsed since transaction i was generated in block K. This represents the average time until a transaction expires, as recorded in block K. This is used to measure whether node K is choosing to process non-urgent transactions for higher returns. This indicates the degree of network congestion, measured by the multiple of the number of pending transactions to the maximum number of transactions that can be processed per block, for example, the number of pending transactions divided by the maximum number of transactions that can be processed in block K. As can be seen from the formula above, the main factors determining whether the reputation coefficient increases or decreases are the degree of network congestion and the effective transaction time.

[0047] Based on this, in this embodiment of the application, the transaction information in the first block includes: the average transaction amount of all transactions, the average transaction fee of all transactions, the average time to expiration of all transactions, the number of pending transactions in the pending transaction pool of the first miner node, and the maximum number of transactions that the first block can process. The transaction information of the invalid transaction includes: the transaction amount, the transaction fee of the invalid transaction when the first block was generated, and the time remaining until the invalid transaction expired when the first block was generated.

[0048] refer to Figure 3 , Figure 3 This is a schematic diagram of the incentive mechanism provided in the embodiments of this application, such as... Figure 3 As shown, after a user submits a transaction, it is divided into two core branches: the "Early Value Zone" and the "Value Reduction Zone." In the Early Value Zone, miner nodes can obtain high-value rewards by processing quickly. If they enter the Value Reduction Zone, delayed processing will trigger a delay penalty, resulting in a decrease in transaction fees. This zone is further subdivided into the Final Value Zone. If a transaction expires, the miner nodes involved in the invalid transaction will be penalized, facing severe penalties such as zero transaction fees and reputational damage. If they can avoid transaction expiration, they can obtain high-value rewards. This embodiment constructs a "reward-penalty" incentive framework to guide miner nodes to process tasks quickly and effectively.

[0049] The transaction processing method provided in this application first allows users to explicitly set a validity period when submitting a transaction, directly linking the transaction fee to the transaction delay time. This mechanism enables miner nodes to understand the urgency of the transaction, and the transaction fee can be dynamically adjusted according to the timeliness of the transaction, rather than remaining fixed. To prevent miner nodes from maliciously delaying due to simple linear changes in transaction fees, this application introduces a bimodal value curve model to dynamically adjust the transaction fee. This model includes two high-value regions: the early high-value region aims to incentivize miner nodes to process transactions quickly to reduce initial delays; as delays increase, transaction fees decrease; the final high-value region aims to incentivize miners to complete transaction confirmation within the valid time, ensuring transaction timeliness. This design strikes a balance between ensuring effective transaction processing and reducing transaction costs; it links the transaction delay rate (transaction failure rate) to the probability of a miner node being selected as a record-keeping node, establishing an effective incentive mechanism. This mechanism prompts miner nodes to reduce the weight of transaction fee influencing factors in processing delayed transactions within the transaction's validity period, thereby improving the overall efficiency of the system. When a transaction exceeds the set validity period, the transaction automatically expires, and the user does not need to pay the original transaction fee. This mechanism effectively solves the problem of wasted time windows caused by transaction delays, while avoiding the double waste of users paying fees for invalid transactions. Based on the above, it improves the overall performance and user experience of the time-sensitive transaction processing system.

[0050] This application also provides a transaction processing apparatus, referencing... Figure 4 , Figure 4 This is a schematic diagram of the structure of a transaction processing apparatus provided in an embodiment of this application. The transaction processing apparatus in this embodiment includes: The processing module is used to determine the probability that each miner node will be selected as an accounting node based on the computing power and a first parameter of each miner node among multiple miner nodes; the first parameter of each miner node is related to the first information of each miner node; the first information includes: the urgency of processed transactions and the transaction fee of processed transactions; the urgency of the transaction is related to the time before the transaction expires; The processing module is used to select an accounting node from the plurality of mining nodes based on the probability that each mining node is selected as an accounting node, using a consensus algorithm. The processing module is used to process transactions in the pending transaction pool through the accounting node.

[0051] In this embodiment of the application, the relevant information of the transaction includes: digital signature, sender address, receiver address, transaction amount, transaction structure data, transaction validity period, and transaction fee.

[0052] In this embodiment of the application, the trend of the transaction fee over time conforms to a bimodal curve model; the relevant information of the transaction also includes: the peak time of the first transaction fee and the peak time of the second transaction fee.

[0053] In this embodiment of the application, the processing module is used to obtain transactions from the pending transaction pool through the accounting node, generate blocks, and store the blocks on the blockchain; the processing module is used to remove invalid transactions from the pending transaction pool; the invalid transaction is a transaction that has exceeded the transaction validity period; and to perform penalty processing on the first parameter of each of the one or more first miner nodes involved in the life cycle of the invalid transaction.

[0054] In this embodiment of the application, the processing module is used to perform penalty processing on the first parameter of any first miner node based on the transaction information in the first block generated by the first miner node during the life cycle of the failed transaction, the transaction information of the failed transaction, and preset rules.

[0055] In this embodiment of the application, the transaction information in the first block includes: the average transaction amount of all transactions, the average transaction fee of all transactions, the average time to expiration of all transactions, the number of pending transactions in the pending transaction pool of the first miner node, and the maximum number of transactions that the first block can process. The transaction information of the invalid transaction includes: the transaction amount, the transaction fee of the invalid transaction when the first block was generated, and the time remaining until the invalid transaction expired when the first block was generated.

[0056] In this embodiment of the application, the preset rules include one or more of the following rules: The first parameter of the first miner node is penalized based on the transaction fee of the failed transaction at the time the first block was generated; the higher the transaction fee of the failed transaction at the time the first block was generated, the stronger the penalty. The first parameter of the first miner node is penalized based on the transaction amount of the failed transaction; the higher the transaction amount of the failed transaction, the stronger the penalty. The first parameter of the first miner node is penalized based on the time from the failure of the failed transaction when the first block is generated; the shorter the time from the failure of the failed transaction when the first block is generated, the stronger the penalty. A penalty is applied to the first parameter of the first miner node based on the average transaction fee of all transactions in the first block; the higher the average transaction fee of all transactions in the first block, the stronger the penalty; and... The first parameter of the first miner node is penalized based on the average distance failure time of all transactions in the first block; the longer the average distance failure time of all transactions in the first block, the stronger the penalty.

[0057] Those skilled in the art should understand that Figure 4 The functions of each module in the transaction processing device shown can be understood by referring to the relevant descriptions of the aforementioned methods. Figure 4 The functions of each module in the transaction processing device shown can be implemented by a program running on the processor or by specific logic circuits.

[0058] Figure 5 This is a schematic structural diagram of an electronic device provided in an embodiment of this application. Figure 5 The electronic device shown includes a first processor 510, which can call and run computer programs from memory to implement the transaction processing method provided in the embodiments of this application.

[0059] Optionally, such as Figure 5 As shown, the electronic device may further include a memory 520. The first processor 510 can retrieve and run computer programs from the memory 520 to implement the transaction processing method provided in this embodiment.

[0060] The memory 520 can be a separate device independent of the first processor 510, or it can be integrated into the first processor 510.

[0061] Optionally, such as Figure 5As shown, the electronic device may also include a transceiver 530, which the first processor 510 can control to communicate with other devices. Specifically, it can send information or data to other devices or receive information or data sent by other devices.

[0062] The transceiver 530 may include a transmitter and a receiver. The transceiver 530 may further include antennas, and the number of antennas may be one or more.

[0063] The electronic device can implement the corresponding processes implemented by the transaction processing device in the various methods of the embodiments of this application, which will not be described in detail here for the sake of brevity.

[0064] For example, embodiments of this application also provide a computer program product, including a computer program that can be executed by a first processor 510 of an electronic device to perform the steps described in any of the foregoing methods.

[0065] Figure 6 This is a schematic structural diagram of the chip according to an embodiment of this application. Figure 6 The chip shown includes a second processor 610, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0066] Optionally, such as Figure 6 As shown, the chip may also include a memory 620. The second processor 610 can retrieve and run computer programs from the memory 620 to implement the methods described in this embodiment.

[0067] The memory 620 can be a separate device independent of the second processor 610, or it can be integrated into the second processor 610.

[0068] Optionally, the chip may also include an input interface 630. The second processor 610 can control the input interface 630 to communicate with other devices or chips; specifically, it can acquire information or data sent by other devices or chips.

[0069] Optionally, the chip may also include an output interface 640. The second processor 610 can control the output interface 640 to communicate with other devices or chips, specifically, to output information or data to other devices or chips.

[0070] This chip can be applied to the electronic devices in the embodiments of this application, and the chip can implement the corresponding processes implemented by the electronic devices in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0071] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0072] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0073] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0074] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0075] This application also provides a storage medium for storing a computer program. This storage medium can be applied to the electronic device in this application embodiment, and the computer program causes the computer to execute the corresponding processes implemented by the electronic device in the various methods of this application embodiment; for brevity, these will not be elaborated further here.

[0076] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0077] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0078] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0079] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0080] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0081] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or electronic device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0082] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A transaction processing method, characterized in that, include: Based on the computing power of each miner node among multiple miner nodes and the first parameter, the probability of each miner node being selected as an accounting node is determined. The first parameter of each miner node is related to the first information of each miner node; The first information includes: the urgency of processed transactions and the transaction fees of processed transactions; the urgency of the transaction is related to the time remaining before the transaction expires; Based on the probability of each miner node being selected as a record node, a consensus algorithm is used to select a record node from the multiple miners. Transactions in the pending transaction pool are processed through the accounting nodes.

2. The method according to claim 1, characterized in that, The relevant information for the transaction includes: digital signature, sender address, receiver address, transaction amount, transaction structure data, transaction validity period, and transaction fee.

3. The method according to claim 2, characterized in that, The trend of the transaction fee over time conforms to a bimodal curve model; the relevant information of the transaction also includes: the peak time of the first transaction fee and the peak time of the second transaction fee.

4. The method according to claim 1, characterized in that, The process of processing transactions in the pending transaction pool through the accounting node includes: Transactions are retrieved from the pending transaction pool through the accounting node, blocks are generated, and the blocks are stored on the blockchain. After generating the block, the method further includes: Expired transactions are removed from the pending transaction pool; the expired transactions are those that have exceeded their validity period. The first parameter of each of the one or more first miner nodes involved in the lifecycle of the failed transaction is penalized.

5. The method according to claim 4, characterized in that, The penalty processing for the first parameters of each of the one or more first miner nodes involved in the lifecycle of the failed transaction includes: For any first miner node, based on the transaction information in the first block generated by the first miner node during the lifecycle of the failed transaction, the transaction information of the failed transaction, and preset rules, the first parameter of the first miner node is penalized.

6. The method according to claim 5, characterized in that, The transaction information in the first block includes: the average transaction amount of all transactions, the average transaction fee of all transactions, the average time to expiration of all transactions, the number of pending transactions in the pending transaction pool of the first miner node, and the maximum number of transactions that the first block can process. The transaction information of the invalid transaction includes: the transaction amount, the transaction fee of the invalid transaction when the first block was generated, and the time remaining until the invalid transaction expired when the first block was generated.

7. The method according to claim 5, characterized in that, The preset rules include one or more of the following rules: The first parameter of the first miner node is penalized based on the transaction fee of the failed transaction at the time the first block was generated; the higher the transaction fee of the failed transaction at the time the first block was generated, the stronger the penalty. The first parameter of the first miner node is penalized based on the transaction amount of the failed transaction. The higher the transaction amount of the invalidated transaction, the stronger the penalty. The first parameter of the first miner node is penalized based on the time from the failure of the failed transaction when the first block is generated; the shorter the time from the failure of the failed transaction when the first block is generated, the stronger the penalty. A penalty is applied to the first parameter of the first miner node based on the average transaction fee of all transactions in the first block; the higher the average transaction fee of all transactions in the first block, the stronger the penalty; and... The first parameter of the first miner node is penalized based on the average distance failure time of all transactions in the first block; the longer the average distance failure time of all transactions in the first block, the stronger the penalty.

8. An electronic device, characterized in that, include: A first processor and a memory for storing a computer program, the first processor for calling and running the computer program stored in the memory to perform the transaction processing method as described in any one of claims 1 to 7.

9. A storage medium, characterized in that, Used to store a computer program that causes a computer to perform the transaction processing method as described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the transaction processing method as described in any one of claims 1 to 7.