Block data processing method and device, equipment, storage medium and program product
By separating block construction and proposal, and utilizing intermediate nodes and auction matching mechanisms, the performance cost of block proposal objects in the blockchain network is reduced, block data processing is automated and intelligent, the degree of network decentralization is improved, and the interests of block proposal objects are ensured.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-12-18
- Publication Date
- 2026-06-19
AI Technical Summary
In the process of blockchain transaction processing, the performance cost of computer nodes is relatively high, especially when processing large amounts of block data. Existing technologies are unable to effectively reduce performance requirements and barriers.
By separating block building and proposal, the computationally intensive block building task is separated from the block proposal. Intermediate nodes are introduced to perform data interaction and verification. After the block building object builds a block, the intermediate node sends it to the block proposal object for on-chain processing. An auction matching mechanism is used to ensure that the block proposal object obtains electronic resources.
It reduces the performance requirements of block proposal objects, automates and intelligentizes block data processing, improves the decentralization of the network, and ensures that block proposal objects can still obtain benefits without building blocks.
Smart Images

Figure CN122240291A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a block data processing method, apparatus and device, storage medium and computer program product. Background Technology
[0002] A blockchain is a data structure composed of several blocks of data linked together by hash values. Each block consists of transactions generated within a certain period, packaged by computer nodes in the blockchain network that have the right to record transactions, and uploaded to the blockchain based on a consensus mechanism. The blockchain consensus mechanism is an agreement among computer nodes in the blockchain network to reach consensus on the transactions and states within the block data, preventing malicious acts such as transaction tampering, double-spending, and Byzantine attacks, thus ensuring the security and reliability of the blockchain.
[0003] As the number of transactions processed by the blockchain increases and the types of transactions become more diverse, the amount of data that needs to be processed during the process of putting block data on the chain is large. This places high demands on the processing performance of computer nodes that obtain the right to record transactions or the qualification to propose blocks, and to some extent increases the performance cost of putting blocks on the chain for computer nodes. Summary of the Invention
[0004] This application provides a block data processing method, apparatus and device, storage medium and computer program product, which can reduce the performance cost of computer nodes that obtain the right to record transactions or the qualification to propose blocks.
[0005] On one hand, embodiments of this application provide a block data processing method applied to a block processing network, the block processing network including block proposal objects, intermediate nodes, and block building objects, the method including:
[0006] Retrieve block data generated by the block building object and inspect the transaction data included in the retrieved block data;
[0007] The target block data is determined based on the detection results. The target block data includes target transaction data, which refers to transaction data that indicates the transfer of electronic resources from the block building object that constructs the target block data to the block proposal object, and the amount of transferred electronic resources meets the transaction conditions.
[0008] Receive block extraction requests from block proposal objects;
[0009] Respond to the block extraction request to obtain the target block data, and send the block to be added to the chain based on the target block data to the block proposal object to trigger the block proposal object to process the target block to be added to the chain.
[0010] On the other hand, embodiments of this application provide another block data processing method applied to a block processing network, which includes block proposal objects, intermediate nodes, and block building objects. The method includes:
[0011] Retrieve transaction data submitted by at least one transaction object;
[0012] Based on the identified block proposal object, generate transaction data to indicate the transfer of electronic resources from the block building object to the block proposal object;
[0013] Block data is generated based on transaction data submitted by at least one transaction object and transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object;
[0014] Send the block data to the intermediate node.
[0015] Furthermore, embodiments of this application provide a block data processing method applied to a block processing network, which includes block proposal objects, intermediate nodes, and block building objects. The method includes:
[0016] Send a block retrieval request to the intermediate node;
[0017] Receive block header data returned by intermediate nodes, and perform signature processing on the received block header data to obtain block header signature data. The block header data includes: the block header data of the target block data obtained by the intermediate nodes.
[0018] The block header signature data is sent to the intermediate node. The block header signature data is used to trigger the intermediate node to process the target block data according to the block header signature data to obtain the block data to be added to the chain.
[0019] Accordingly, embodiments of this application also provide a block data processing apparatus, which includes one or more units for performing the aforementioned method.
[0020] Accordingly, this application also provides a computer device, which includes a storage device and a processor; the storage device stores a computer program; the processor runs the computer program in the storage device to implement the steps of the aforementioned method.
[0021] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned method.
[0022] Accordingly, embodiments of this application also provide a computer program product, including a computer program / instruction, which, when processed and executed, implements the steps of the aforementioned related methods.
[0023] By implementing the embodiments of this application, a block building object used for block construction can be associated with a block proposal object that is qualified to propose blocks. On the one hand, the block building object can be used to construct the blocks required for this round of on-chaining and provide them to the block proposal object. This allows the block proposal object to not have to perform block construction tasks, but only to store the constructed blocks at the corresponding height position of the blockchain. This can separate block proposal and block construction, reducing the performance requirements and threshold for computer nodes qualified to propose blocks. On the other hand, the requirement that the existence of block data indicates the transfer of electronic resources from the block building object that constructs the target block data to the block proposal object, and that the amount of transferred electronic resources meets the transaction conditions, also ensures that even if the block proposal object does not construct blocks, it can still obtain the electronic resources allocated by the block building object that meet the conditions, thus protecting the interests of the block proposal object. This not only automates and intelligently processes the entire process from block packaging to final on-chaining, but also automates and intelligently processes the allocation of electronic resources. Attached Figure Description
[0024] 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, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1a This is a schematic diagram of the structure of a data sharing system provided in an embodiment of this application;
[0026] Figure 1b This is a schematic diagram of a blockchain data structure provided in an embodiment of this application;
[0027] Figure 1c This is a schematic diagram illustrating the input information processing procedure in a blockchain, provided in an embodiment of this application.
[0028] Figure 2 This is a flowchart illustrating a block data processing method provided in an embodiment of this application;
[0029] Figure 3 This is a flowchart illustrating another block data processing method provided in an embodiment of this application;
[0030] Figure 4 This is a flowchart illustrating another block data processing method provided in an embodiment of this application;
[0031] Figure 5This is a flowchart illustrating another block data processing method provided in an embodiment of this application;
[0032] Figure 6 This is a schematic diagram of the structure of a block data processing device provided in an embodiment of this application;
[0033] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0035] This application proposes a scheme that separates block construction and proposal, separating the computationally intensive and highly specialized task of block construction from block proposal. The constructed block processing network includes block proposal objects, intermediate nodes, and block construction objects. Block proposal objects are computer nodes that have obtained the right to record transactions or the qualification to propose blocks. Block construction objects are computer nodes capable of acquiring transaction data to complete block construction for the block proposal objects. Intermediate nodes act as data interaction bridges between the block proposal objects and the block construction objects, performing verification and other processing on the blocks constructed by the block construction objects, and ultimately sending the blocks to the block proposal objects for on-chain processing. In this way, the computer nodes that have obtained the right to record transactions or the qualification to propose blocks are only responsible for on-chain processing of block data, while the block construction process can be performed by other computer nodes with better processing performance or those willing to perform block construction. This lowers the performance threshold for block proposal objects and reduces the performance cost for computer nodes that have obtained the right to record transactions or the qualification to propose blocks. Furthermore, intermediate nodes can also determine the resources that the block data generated by multiple block building objects can provide to the block proposal object as needed, and provide the block data that is most beneficial to the block proposal object for on-chain in an auction manner, which also protects the rights and interests of the block proposal object to a certain extent.
[0036] For blockchain, it can be maintained by a data-sharing system, see [link / reference] Figure 1aThe data sharing system shown, data sharing system 100, refers to a system for data sharing between nodes. This data sharing system may include multiple nodes 101, which can refer to various clients within the data sharing system. Each node 101, during normal operation, can receive input information and maintain shared data within the data sharing system based on the received input information. To ensure information interoperability within the data sharing system, information connections can exist between each node, allowing information transmission between nodes. For example, when any node in the data sharing system receives input information, other nodes in the system obtain this input information according to a consensus algorithm and store it as data in the shared data, ensuring consistency of data stored on all nodes in the data sharing system.
[0037] Each node in the data sharing system has a corresponding node identifier, and each node can also store the node identifiers of other nodes in the data sharing system. This allows for the subsequent broadcasting of generated blocks to other nodes in the data sharing system based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. Table 1 only uses IP addresses as an example.
[0038] Table 1
[0039] Node Name Node identifier Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0040] Each node in the data-sharing system stores the same blockchain. A blockchain consists of multiple blocks; see [link to blockchain documentation]. Figure 1b A blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values of the current block, the block header feature values of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks.
[0041] When generating the individual blocks in the blockchain, see Figure 1cWhen a node in the blockchain receives input information, it verifies the input information. After verification, it stores the input information in a memory pool and updates its hash tree used to record the input information. Then, it updates the timestamp to the time the input information was received and tries different random numbers multiple times to calculate the feature value, ensuring that the calculated feature value satisfies the following formula:
[0042] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET
[0043] Wherein, SHA256 is the feature value algorithm used to calculate the feature value; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the current block; merkle_root is the feature value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value for a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the feature value threshold, which can be determined based on nbits.
[0044] Thus, when a random number satisfying the above formula is calculated, the information can be stored accordingly, generating a block header and a block body to obtain the current block. Subsequently, the node where the blockchain resides sends the newly generated block to other nodes in its data sharing system based on the node identifiers of other nodes in the data sharing system. The other nodes then verify the newly generated block and add it to their stored blockchain after verification.
[0045] for Figure 1aIn this application embodiment, the block proposal object and block building object mentioned can be nodes within the data sharing system. The node that obtains the right to record transactions or the qualification to propose blocks within the data sharing system is determined as the block proposal object. The block proposal object can determine whether to complete the block building and on-chain processing itself or to delegate the block building task to one or more other nodes in the data sharing system based on its own status. In one embodiment, the block proposal object can determine whether to notify other nodes in the data sharing system to execute the block building task based on the performance parameters of the block proposal object configured by the user or detected. The performance parameters can refer to the amount of hardware and software resources of the block proposal object, such as processor utilization, unused physical memory, etc. The block building object refers to one or more computer nodes in the data sharing system that have not obtained the right to record transactions or the qualification to propose blocks. In the data sharing system, these computer nodes can determine whether to respond to the block building task notification initiated by the block proposal object and execute the block building task based on user-configured or detected performance parameters. These performance parameters can refer to the processor utilization, unused physical memory, etc., of the nodes that have not obtained the right to record transactions or the qualification to propose blocks. The intermediate node involved in this application embodiment can be a node within the data sharing system or a computer node set up outside the data sharing system that can communicate with the block proposal object and the block building object. The intermediate node can be considered a trusted third-party node that provides services to the block proposal object and the block building object.
[0046] As the number and types of transactions processed by blockchains increase, block construction has become a computationally intensive task. Therefore, in data-sharing systems or blockchain networks, the barrier to entry for nodes increases, network centralization strengthens, and ordinary nodes struggle to construct blocks that maximize their profits. This application proposes a block construction and proposal separation technology, separating the computationally intensive and highly specialized block construction task from the block proposal process. Furthermore, this application introduces an auction matching system, enabling consensus nodes to maximize their block rewards. Simultaneously, it ensures fairness for both parties in the matching process and protects against malicious behavior.
[0047] Please see Figure 2This is a flowchart illustrating a block data processing method according to this application. The method is applied to a block processing network and is implemented through data interaction between block proposal objects, intermediate nodes, and block building objects within the network. The block proposal objects, intermediate nodes, and block building objects are all computer nodes. The block processing network can be all or part of the aforementioned data sharing system, or the block proposal objects and block building objects can be computer nodes within the aforementioned data sharing system, while the intermediate node is a computer node outside of a data sharing system. In one possible implementation, the intermediate node is an off-chain relay.
[0048] S201: The block building object sorts the transaction data in the transaction set according to the service resource quantity of each transaction data in the transaction set; the transaction set includes transaction data submitted by at least one transaction object. In a data sharing system, block proposal objects can be determined from the computer nodes in the system according to the proposal selection rules. For example, a simple proposal selection rule is random selection. The block proposal objects in the system are determined by random selection and broadcast. After each block building object knows the block proposal objects in the system, it can start to execute steps such as S201.
[0049] The transaction set stores transaction data submitted by various transaction objects. This transaction data can be, for example, transaction data based on transfer transactions or transaction data generated based on multimedia data that needs to be uploaded to the blockchain. To incentivize block-building objects to package transaction data and upload it to the blockchain more promptly, transaction objects can set service resource fees for their transaction data. These service fees are transferred to the computer nodes that package the transaction data and upload it to the blockchain. The amount of service resources also determines whether the block-building object extracts the corresponding transaction data to package into a block. The block-building object can sort multiple transaction data in the transaction set based on its own service resource sorting algorithm to select the multiple transaction data that maximize benefits to package into block data. In one embodiment, the sorting can be simply based on the service resource amount from largest to smallest.
[0050] In one possible implementation, after acquiring block proposal eligibility at a certain blockchain height, a block proposal target can choose to either construct and submit a block itself or notify other computer nodes to construct blocks. This choice can be determined through settings or by receiving selection actions via an interactive interface. For example, when a node acquires block proposal eligibility, an interactive interface is displayed. This interface includes a prompt area with multimedia information indicating that block proposal eligibility has been acquired, and a selection area with controls for prompting the node to construct a block itself and for prompting the node to construct a block through other nodes. When the node selects the control for prompting the node to construct a block itself, it packages transaction data to generate block data and completes consensus and on-chain storage processing. However, when the node selects the control for prompting the node to construct a block through other nodes, a notification message is broadcast in the data sharing system. This notification message notifies computer nodes in the system to construct and submit a block at a target height, which is the blockchain height corresponding to the block proposal eligibility acquired by the block proposal target.
[0051] S202: The block building object retrieves N transaction data from the transaction set according to the sorting result. S201 and S202 are the processes by which the block building object retrieves transaction data submitted by at least one transaction object. The block building object selects N transaction data based on the principle of maximizing its own benefits, where N is a positive integer. In one embodiment, the block building object can select the top N transaction data with the largest service resource volume for packaging and processing according to the sorting result.
[0052] S203: The block building object sets itself as the receiving address, that is, it sets itself as the receiving object for the service resources corresponding to N transaction data. This is so that after the block data built by the block building object is successfully uploaded to the blockchain as the target block data, it can receive the service resources generated by the execution of the N transaction data. The block building object can set itself as the receiving address for the block service resources corresponding to the block data it packages. In other words, the block building object sets the receiving account for the service resources generated by the N transaction data as the account corresponding to the block building object. This is so that after the block data built by this block building object is used as the target block data and is finally uploaded to the blockchain, the transaction object corresponding to the N transaction data packaged in the target block data will pay the service resources to the block service resource receiving address set for the target block data, that is, pay the account corresponding to the block building object that built the target block data.
[0053] S204: Based on the service resource volume of N transaction data, the block building object determines the amount of electronic resources to be transferred from the block building object to the determined block proposal object. A total service resource amount, fee, can be calculated based on the service resource volume generated by the N transaction data. Then, the amount of electronic resources that can be transferred to the block proposal object is determined through calculation. The block building object can consider factors such as its potential block packaging costs, while also trying to ensure that the transferred resource amount meets transaction conditions (e.g., is greater than the transferred resource volume that other block building objects can provide) to facilitate adoption and on-chain inclusion by the block proposal object. The amount of electronic resources transferred to the determined block proposal object can be denoted as bid.
[0054] S205: The block building object generates transaction data to instruct the transfer of electronic resources from the block building object to the block proposal object, based on the determined amount of resources to be transferred. S204 and S205 describe the process by which the block building object generates transaction data to instruct the transfer of electronic resources from the block building object to the block proposal object, based on the determined block proposal object. For the transaction data instructing the transfer of electronic resources from the block building object to the block proposal object, the block building object must weigh: a) winning the bid, i.e., the amount of resources to be transferred (or the bid price) must be higher than other block building objects; b) maximizing its own profit (profit = fee – bid); c) in a fully competitive scenario, the block proposal object can capture the vast majority of the block value.
[0055] S206: The block building object generates block data based on transaction data submitted by at least one transaction object and transaction data indicating the transfer of electronic resources from the block building object to the block proposal object. The block data is generated by packaging N transaction data and its own generated transaction data of a specified type according to the protocol. In one embodiment, the transaction data indicating the transfer of electronic resources from the block building object to the block proposal object can be placed at the end of the block data, which facilitates subsequent intermediate nodes to quickly determine whether the specified type of transaction data exists. If the block built by the block building object is adopted and eventually added to the blockchain, the block proposal object can receive the bid price for the transfer payment from the block building object through the transaction data indicating the transfer of electronic resources from the block building object to the block proposal object (which can be simply referred to as a transfer transaction).
[0056] S207: The block building object sends block data to the intermediate nodes. The block building object can send the constructed block data to the intermediate nodes according to the configured network address of the intermediate nodes.
[0057] S208: The intermediate node acquires the block data generated by the block building object and checks the transaction data included in the acquired block data. The detection of transaction data includes legality detection, such as checking whether the protocol format of the transaction data is correct, whether there are conflicting transactions, etc. In one embodiment, S208 may specifically include: determining whether the currently acquired block data includes transfer transaction data, which refers to transfer transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object; if transfer transaction data is included, then determining whether the amount of electronic resources indicated to be transferred from the block building object to the block proposal object is greater than a resource threshold; if it is greater than the resource threshold, then the transfer transaction data is determined as target transaction data, and the currently acquired block data is determined as target block data. For intermediate nodes, it will check whether each block includes transaction data of a specified type, namely transfer transaction data. If transfer transaction data exists, and it is determined that the amount of electronic resources transferred from the block building object to the block proposal object indicated in the transfer transaction data is greater than the resource threshold, the transfer transaction data can be identified as target transaction data, and the corresponding block data is target block data.
[0058] The resource threshold can be a set value, such as a threshold set by the block proposal object. The first transfer transaction data that reaches this resource threshold becomes the target transaction data, and the corresponding block data is adopted by the block proposal object and ultimately added to the blockchain. The resource threshold can also be a dynamic value, based on the maximum amount of electronic resources indicated in the currently acquired block data, representing the amount of electronic resources transferred from the block building object to the block proposal object. In other words, once a transfer transaction data in a block is identified as the target transaction data, the amount of electronic resources indicated by that target transaction data, representing the amount transferred from the block building object to the block proposal object, is updated to the resource threshold, thereby continuously acquiring the maximum amount of resources that can be provided to the block proposer.
[0059] If an intermediate node receives malicious block data constructed by a block builder during the process of obtaining blocks, such as invalid block data or the block proposal object not being able to receive bids, the intermediate node will reject and accept subsequent blocks constructed by the corresponding block builder object.
[0060] S209: The intermediate node determines the target block data based on the detection results. The target block data includes target transaction data, which refers to transaction data indicating the transfer of electronic resources from the block construction object that constructs the target block data to the block proposal object, and the amount of transferred electronic resources meets the transaction conditions. Meeting the transaction conditions means that the amount of transferred electronic resources is greater than the resource threshold. If the detection results do not show any transfer transaction data, the target block data is directly deleted. In S208 and S209, it is essential to ensure that the block data contains transfer transaction data, and the block proposal object can receive the bid price from the block construction object; otherwise, the corresponding block data is meaningless and is directly deleted.
[0061] S210: The intermediate node updates the resource threshold to the amount of electronic resources to be transferred as indicated by the target transaction data; wherein, the amount of electronic resources to be transferred satisfies the transaction conditions if the amount of electronic resources to be transferred is greater than the resource threshold. If the bid price of a certain block building object is higher than the bid prices of other existing block building objects, then the highest bid price is updated, and the block data is recorded as the target block data. Other block data can be processed according to rules, such as directly deleting other block data that are not the target block data, without consuming the intermediate node's storage resources.
[0062] S211: The intermediate node receives the block retrieval request from the block proposal object; the block proposal object sends the block retrieval request to the intermediate node at an appropriate time. Before the expiration of the validity period for block proposal eligibility, the block proposal object can initiate a block retrieval request to the intermediate node to request the packaged block data, and then complete the on-chain process after consensus and other processing.
[0063] S212: The intermediate node responds to the block retrieval request by sending the block header data of the obtained target block data to the block proposal object, triggering the block proposal object to sign the block header data. The intermediate node sends the block header data to the block proposal object, which only needs to sign the block header data. The intermediate node does not expose the complete block data to the block proposal object to prevent the block proposal object from directly using the target block data to modify and generate a copied block data to complete the on-chain process, thus bypassing the block building object and causing losses to the block building object.
[0064] S213: The block proposal object receives the block header data returned by the intermediate node and performs signature processing on the received block header data to obtain the block header signature data. The block header data refers to the block header data of the target block data obtained by the intermediate node.
[0065] S214: The block proposal object sends the block header signature data to the intermediate node. The block header signature data is used to trigger the intermediate node to process the target block data according to the block header signature data to obtain the block data to be added to the chain.
[0066] S215: The intermediate node receives the block header signature data provided by the block proposal object and verifies the block header signature data. This verification process mainly includes checking whether the signature of the block proposal object is valid. If the verification passes, S216 can be executed below. If the verification fails, the block header data of the target block data is resent to the block proposal object along with an error notification message. The error notification message is used to notify the block proposal object to sign the block header data and to indicate that if the signed block header data is not returned or the signature fails again, the block upload will fail.
[0067] S216: The intermediate node processes the target block data based on the verified block header signature data to generate the block data to be added to the chain; it updates and combines the signed block header data with the target block data to complete the filling of the block header signature data, resulting in a valid block data to be added to the chain. If the verification of the block header data fails, S214-S216 can be re-executed to obtain verified block header signature data. If verified block header signature data is still not obtained after a certain number of re-executions or a certain cumulative time, a block failure notification message can be sent to the block proposal object. The block proposal object can be penalized based on a penalty mechanism, such as deducting proposal points. In this way, when the proposal points of the block proposal object are lower than the point threshold, it will no longer be eligible to propose blocks for a preset time. At the same time, a notification message is sent to the block building object of the target block data to inform it of the reason for the failure of this block proposal.
[0068] S217: The intermediate node sends the data of the block to be added to the blockchain to the block proposal object, triggering the block proposal object to process the target block for on-chain processing. The intermediate node can either reach consensus on the data to be added to the blockchain and send it to the block proposal object after consensus is reached, or it can directly send the data to the block proposal object, which will then process the consensus and complete the on-chain process. Specifically, S217 includes: processing the data of the block to be added to the blockchain network for consensus; generating a record notification message including the data of the block to be added to the blockchain after consensus is reached, and sending the record notification message to the block proposal object. The record notification message is used to notify the block proposal object to record the consensus-reached data of the block to be added to the blockchain; or, generating a consensus notification message including the data of the block to be added to the blockchain and sending the generated consensus notification message to the block proposal object. The consensus notification message is used to instruct the block proposal object to process the data of the block to be added to the blockchain included in the consensus notification message and record the consensus-reached data of the block to be added to the blockchain.
[0069] For a block proposal object, before obtaining the target block data from the block builder object, it can only sign the block header data. Once the intermediate nodes obtain the block header data signed by the block proposal object, they can assemble a valid block to be added to the blockchain and broadcast it. The broadcast block data will be recognized by the consensus mechanism. At this point, the block to be added to the blockchain after consensus is reached can be sent to the block proposal object, which only needs to store it at the corresponding height of the blockchain. For a block proposal object, if it proposes to build its own block, it will be penalized by the consensus mechanism for proposing two different blocks (the block to be added to the blockchain built by the block builder object and signed by the block proposal object, and the self-built block). Of course, the block proposal object can also detect the status of block data to be added to the blockchain broadcast in the system. If it fails to detect the block data to be added to the blockchain signed by the block proposal object and broadcast by the intermediate node in the system, it can broadcast the block data to be added to the blockchain extracted from the intermediate node on its own, and store the block to be added to the blockchain after consensus is achieved after the broadcast.
[0070] During the consensus process, corresponding transaction data is also executed. This includes not only the transaction data submitted by each transaction object in the target block data corresponding to the block to be added to the chain, but also the target transaction data used to instruct the block builder to transfer electronic resources from the block builder to the block proposer. In this way, the block builder receives the transaction fees generated from executing the transaction data submitted by each transaction object, i.e., the total service resources (fee), and also transfers a resource amount (bid) to the block proposer. For the block builder, the actual resources it receives upon completing the block builder are fee - bid; for the block proposer, it receives the transferred resource amount (bid).
[0071] Through the embodiments of this application, on the one hand, block construction and block proposal can be separated, so that the computationally intensive block construction work is separated from the block proposal, which lowers the threshold for computer nodes, reduces the performance cost of computer nodes, and improves the decentralization of the network. On the other hand, through the data processing logic configured by the block construction object, intermediate nodes, and block proposal object, as well as the consensus and on-chain processing logic, professional block builders can construct blocks that maximize benefits. At the same time, through bidding, block proposers can also obtain certain benefits without performing block construction, thus meeting the automation and intelligence needs of all parties.
[0072] Please see Figure 3 This is a flowchart illustrating another block data processing method according to an embodiment of this application. The method is applied to a block processing network, which includes a block proposal object, intermediate nodes, and block building objects. Each of these elements is a computer node, and the method in this embodiment is executed by an intermediate node. The method includes the following steps.
[0073] S301: Obtain block data generated by block building objects and inspect the transaction data included in the obtained block data. The obtained block data is generated by at least one block building object. Each block building object packages transaction data submitted by at least one transaction object and transaction data used to instruct the transfer of electronic resources from the block building object to the block proposal object. As described above, the block building object can be any computer node in the data sharing system or blockchain network. There can be multiple block building objects performing block building. Each block building object can obtain transaction data from the transaction pool and package it into block data according to its own packaging rules. The packaged block data is submitted to an intermediate node in the data sharing system or blockchain network. This intermediate node is a designated special computer node. Of course, this intermediate node can also be a computer node outside the data sharing system or blockchain network. Each block building object and subsequent block proposal objects can find and communicate with the intermediate node according to the configuration.
[0074] Intermediate nodes simultaneously or sequentially acquire block data generated by various block building objects and perform checks on the acquired block data. In this embodiment, the checks performed by intermediate nodes on the block data may include legality checks, such as verifying the signature of transaction data to determine whether it is a legitimate user signature, checking for contradictory transactions in the packaged transaction data (e.g., the amounts of transaction expenditures and revenues do not match), and verifying whether the packaged format is correct. Furthermore, in this embodiment, checking the transaction data included in the acquired block data also includes checking whether a specified type of transaction data exists in all transaction data packaged into the block data. If the specified type of transaction data is included, then S302 is executed, wherein if any block data includes transaction data indicating the transfer of electronic resources from the block building object that constructs that block data to the block proposal object, then that block data can be considered to contain the specified type of transaction data. If a block does not contain transaction data of a specified type, the block can be discarded and no further processing can be performed; or, based on a penalty mechanism, a point can be deducted from the block building object that initiated the block data that does not contain transaction data of the specified type. When the point value of the block building object after deduction is less than the score threshold, the construction of the block building object with the point value less than the score threshold is suspended and a new block data is submitted.
[0075] S302: Based on the detection results, the target block data is determined. The target block data includes transaction data containing target transaction data. Target transaction data refers to transaction data that indicates the transfer of electronic resources from the block construction object that constructs the target block data to the block proposal object, and the amount of transferred electronic resources meets the transaction conditions. In S301, the detection can delete block data without transaction data of the specified type, leaving only block data with transaction data of the specified type. For block data containing transaction data of the specified type, S302 further filters are needed based on the amount of electronic resources to be transferred recorded in the specified type of transaction data to determine the final target transaction data, and thus determine the target block data.
[0076] In one possible implementation of this application, in step S302, the amount of electronic resources indicated by transaction data of a specified type in each block of data can be determined. The transaction data of the specified type with the largest resource amount is designated as the target transaction data, and the block of data containing the target transaction data is designated as the target block data. Alternatively, the amount of electronic resources indicated by transaction data of a specified type in all acquired block data can be compared at once to determine the transaction data with the largest resource amount as the target transaction data, and the block of data containing the target transaction data is designated as the target block data. Alternatively, the comparison can be performed according to the order of block data reception time. First, among the transaction data of the specified type in the currently received block data, the transaction data of the specified type with the maximum value of the indicated electronic resource transfer amount is determined as the target transaction data, and the currently determined target transaction data and the target block data in which the target transaction data is located are recorded. When a new block data containing transaction data of the specified type is received, it is only necessary to compare the transaction data of the specified type in the new block data with the resource amount of the indicated electronic resource transfer amount of each of the recorded target transaction data. If the resource amount of the indicated electronic resource transfer amount of the specified type transaction data in the new block data is greater than the resource amount of the indicated electronic resource transfer amount of the currently recorded target transaction data, then the new block data is updated as the target block data, and the original target block data is directly deleted.
[0077] In another possible implementation of this application, in S302, the block proposal object can set a resource value as a threshold. Among the block data with transaction data of a specified type that are received successively, when the resource amount of the electronic resources transferred by the first transaction data of the specified type reaches the threshold set by the block proposal object, that is, the transaction data of the specified type that reaches the set threshold is determined as the target transaction data, and the block data in which the target transaction data is located is determined as the target block data.
[0078] S303: Receive block extraction request from block proposal object. Within its eligible timeframe, a block proposal object can send a block extraction request to the intermediate node at a suitable time, as configured. This request is used to request the target block data determined by the intermediate node. For example, the block proposal object can initiate a block extraction request at a certain point before the end of its eligible timeframe (only reserving time for block consensus and on-chain processing), allowing the intermediate node to obtain more block data built by block building objects, thus maximizing the amount of transferred electronic resources. Alternatively, the intermediate node can dynamically determine whether to notify the block proposal object to send a block extraction request based on the determined target block data. For example, the intermediate node can notify the block proposal object to initiate a block proposal request if the target block data has not been updated within a preset timeframe, or it can notify the block proposal object to initiate a block proposal request at a point when the estimated timeframe for the block proposal object's eligible timeframe has elapsed.
[0079] S304: Respond to the block retrieval request to obtain the target block data, and send the block to be added to the chain based on the target block data to the block proposal object to trigger the block proposal object to perform the on-chain processing of the target block. When a block retrieval request is received from the block proposal object, the block proposal object can be interacted with to complete the on-chain operation of the block to be added to the chain corresponding to the target block data.
[0080] In S304, intermediate nodes can interact with the block proposal object to obtain the block proposal object's signature on the target block data, thus obtaining a complete block ready for blockchain upload. After consensus is reached, the block is sent to the block proposal object, which only needs to complete the upload process. Alternatively, after receiving the block, intermediate nodes can directly send it to the block proposal object, which then completes the consensus before recording it in the blockchain.
[0081] Through the embodiments of this application, by analyzing and processing the block data provided by the block building object through intermediate nodes, and interacting with the block proposal object, the proposal and construction of blocks can be separated, so that the proposal and construction of blocks are implemented in different computer nodes. In this way, in the data sharing system, the block building object can share the block building task of the block proposal object that is qualified to propose blocks, without requiring the block proposal object to have good computing performance for building blocks, thus reducing the performance cost requirements of the block proposal object. At the same time, it can also ensure that the block proposal object can still better obtain the benefits of some blocks on the chain even without performing block construction, thus meeting the needs of block building users and block proposal users for automation and intelligence in on-chain processing and resource allocation.
[0082] Please see again Figure 4 This is a flowchart illustrating another block data processing method according to this application. The method is applied to a block processing network, which includes a block proposal object, intermediate nodes, and a block building object. Each of these elements is a computer node. In this embodiment, the method is executed by the block building object. The method includes the following steps.
[0083] S401: Obtain transaction data submitted by at least one transaction object. Computer nodes in the data sharing system or blockchain network can submit transaction data as transaction objects. Other computer nodes outside the data sharing system or blockchain network can also submit transaction data to the data sharing system or blockchain network as needed. This transaction data can be, for example, data generated by payment transfer transactions, or multimedia data that needs to be uploaded to the blockchain. Transaction data submitted by various transaction objects can be stored in a transaction pool for the corresponding computer nodes in the blockchain network to access.
[0084] S402: Based on the identified block proposal object, generate transaction data to instruct the transfer of electronic resources from the block building object to the block proposal object. The block building object begins executing S401 after knowing the block building objects currently qualified to propose, and in S402, determines the amount of electronic resources that can be transferred to the block proposal object by calculating the amount of service resources that each transaction data can generate.
[0085] In this embodiment, the transaction object submitting transaction data will configure an appropriate amount of service resources for the transaction data. For example, it will configure an appropriate transaction fee for transaction data corresponding to payment transfer transactions and an appropriate on-chain service fee for transaction data such as multimedia data. This is to incentivize block building objects and block proposal objects to actively package transactions and complete on-chain processing. The block building object can determine the amount of electronic resources that can be transferred to the block proposal object based on the service resource amount of each transaction data and the amount of resources it needs to consume when packaging a block. This allows it to generate transaction data of a specified type, i.e., transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object. For the block building object, when generating the specified type of transaction data, it must consider both maximizing its own resource acquisition and ensuring that the amount of transfer resources allocated to the block proposal object is reasonable and easily accepted by the block proposal object, thus generating the specified type of transaction data under these two constraints. Of course, it is understandable that the block building object can give priority to allocating the transfer resources to the block proposal object, because the block building object will only obtain the corresponding service resources after the final packaged block data is adopted by the block proposal object.
[0086] S403: Block data will be generated based on transaction data submitted by at least one transaction object and transaction data used to instruct the transfer of electronic resources from the block building object to the block proposal object. The block building object packages the transaction data submitted by the transaction object and the specified type of transaction data according to the packaging rules to generate a block data. It can be understood that this block data is an initial data and still needs to be processed by subsequent intermediate nodes. After undergoing corresponding processing such as consensus and verification, it is completed on the chain by the block proposal object with specific block proposal qualifications.
[0087] S404: Send the block data to the intermediate node. The intermediate node can perform the above-mentioned steps to determine the target block data so that it can perform on-chain processing.
[0088] Through the embodiments of this application, block builders can utilize their computing resources to share the block building tasks of block proposal objects. This not only allows for better completion of block data construction but also eliminates the need for block proposal objects to consume block building resources during the block uploading process, reducing the computing resource requirements of block proposal objects. Furthermore, it can automatically allocate resources to block proposal objects that do not need to perform block building while protecting the interests of block builders. The entire process is automatically completed by computer nodes and intermediate nodes in the data sharing system, meeting the automation and intelligence requirements for block building, uploading, and resource allocation.
[0089] Please see again Figure 5 This is another flowchart illustrating a block data processing method according to this application. The method is applied to a block processing network, which includes a block proposal object, intermediate nodes, and a block building object. Each of these elements is a computer node. In this embodiment, the method is executed by the block proposal object. The method includes the following steps.
[0090] S501: Send a block retrieval request to the intermediate node. A block proposal object can send a block retrieval request to the intermediate node before the block proposal eligibility expires, in order to obtain the target block data determined by the intermediate node.
[0091] S502: Receive the block header data returned by the intermediate node and sign the received block header data to obtain block header signature data. The block header data includes the block header data of the target block data obtained by the intermediate node. For block extraction requests sent by the block proposal object, the intermediate node can initially only return the block header data of the target block data. The block proposal object only needs to sign and return the block header data. The intermediate node combines the signed block header data with the target block data to form a block to be added to the blockchain. Not returning complete block data to the block proposal object prevents the block proposal object from generating block data based on the packaged target block data and adding it to the blockchain independently, bypassing the block construction object that consumes computational resources to build the target block data, thus avoiding potential losses to the block construction object.
[0092] S503: The block header signature data is sent to the intermediate nodes. This signature data triggers the intermediate nodes to process the target block data to obtain the block data to be added to the blockchain. After obtaining the signed block header signature data, the intermediate nodes combine it with the target block data to generate the block to be added to the blockchain. After consensus is reached, the block to be added to the blockchain is sent to the block proposal object, which only needs to complete the on-chain processing. Alternatively, after receiving the block to be added to the blockchain, the intermediate nodes can directly send it to the block proposal object, which will then complete the consensus before recording it in the blockchain.
[0093] After the intermediate node completes the operations described in the aforementioned embodiments, it can generate a block to be added to the blockchain and send it back to the block proposal object. The block proposal object can then directly process the block to be added to the blockchain. If the intermediate node returns the block to be added after achieving consensus by broadcasting the block to be added, the block proposal object can simply add the block to the corresponding height of the blockchain. If the intermediate node has not achieved consensus, the block proposal object can achieve consensus on the block to be added fed back by the intermediate node, and after the consensus is passed, add the block to the corresponding height of the blockchain.
[0094] During the consensus process of the block to be uploaded to the blockchain, all transaction data included in the target block data, including the aforementioned transaction data used to instruct the transfer of electronic resources from the block building object to the block proposal object, will be executed. In this way, not only can the block building object obtain the transaction fee for the corresponding transaction data, but the block building object will also transfer a corresponding amount of electronic resources to the block proposal object according to the amount of electronic resources transferred from the block building object to the block proposal object.
[0095] Through the embodiments of this application, block proposers who are qualified to propose blocks can complete the construction of blocks through other nodes, and then complete the block proposal for this round based on the constructed blocks. For block proposers, there is no need to consume resources to complete the block construction, which reduces the computational performance requirements of the block proposal object and lowers the computational threshold of the block proposal object. At the same time, they can also obtain some of the resource benefits generated by the transaction fees generated by the block on the chain without having to construct blocks, thus meeting the needs for automation and intelligence in block construction, on-chain, and resource allocation.
[0096] The block data processing device, computer equipment, etc. involved in this application will be described below.
[0097] In a first embodiment of the block data processing apparatus, the apparatus may be housed in a computer device corresponding to the aforementioned intermediate node. The block data processing apparatus includes one or more units for executing the methods described in the foregoing embodiments. See the embodiments in this application for details. Figure 6 This is a schematic diagram of the structure of a block data processing device provided in an embodiment of this application. The device may specifically include a communication unit 601 and a processing unit 602.
[0098] Communication unit 601 is used to communicate with other units and devices;
[0099] Processing unit 602 is configured to acquire block data generated by a block building object and detect the transaction data included in the acquired block data; determine target block data based on the detection results, wherein the target block data includes target transaction data, which refers to transaction data indicating the transfer of electronic resources from the block building object that constructs the target block data to the block proposal object, and the amount of transferred electronic resources meets the transaction conditions; receive a block extraction request from the block proposal object; respond to the block extraction request to acquire the target block data, and send the block to be added to the chain obtained based on the target block data to the block proposal object to trigger the block proposal object to perform on-chain processing of the target block.
[0100] In one possible implementation, when processing unit 602 detects transaction data included in the acquired block data, it determines whether the currently acquired block data includes transfer transaction data, which refers to transaction data used to instruct the transfer of electronic resources from a block building object to a block proposal object; if transfer transaction data is included, it determines whether the amount of electronic resources instructing the transfer from the block building object to the block proposal object is greater than a resource threshold; if it is greater than the resource threshold, the transfer transaction data is determined as target transaction data, and the currently acquired block data is determined as target block data.
[0101] In one possible implementation, the processing unit 602 is further configured to update the resource threshold to the amount of electronic resources transferred as indicated by the target transaction data; wherein, the amount of electronic resources transferred satisfies the transaction conditions if the amount of electronic resources transferred is greater than the resource threshold.
[0102] In one possible implementation, the processing unit 602, when responding to a block extraction request to obtain target block data and sending the block to be added to the blockchain based on the target block data to the block proposal object, is configured to respond to the block extraction request, send the block header data of the obtained target block data to the block proposal object to trigger the block proposal object to sign the block header data; receive the block header signature data provided by the block proposal object and verify the block header signature data; process the target block data based on the verified block header signature data to obtain the block to be added to the blockchain; and send the block to be added to the blockchain to the block proposal object to trigger the block proposal object to add the target block to the blockchain.
[0103] In one possible implementation, the processing unit 602, when sending the block data to be added to the blockchain to the block proposal object to trigger the block proposal object to perform on-chain processing of the target block, is used to perform consensus processing on the block data to be added to the blockchain network. After consensus is passed, a record notification message including the block data to be added to the blockchain is generated and sent to the block proposal object. The record notification message is used to notify the block proposal object to record the block data to be added to the blockchain after consensus is passed. Alternatively, a consensus notification message including the block data to be added to the blockchain is generated and sent to the block proposal object. The consensus notification message is used to instruct the block proposal object to perform consensus processing on the block data to be added to the blockchain included in the consensus notification message and to record the block data to be added to the blockchain after consensus is passed.
[0104] In one possible implementation, the acquired block data is generated by at least one block building object, which packages transaction data submitted by at least one transaction object and transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object.
[0105] In a second embodiment of the block data processing apparatus, the block data processing apparatus can be housed in a computer device, which corresponds to the block construction object mentioned above. This block data processing apparatus includes one or more units for executing the relevant methods in the foregoing embodiments. Specific schematic diagrams of this block data processing apparatus can also be found in the embodiments of this application. Figure 6 As shown, it includes a communication unit 601 and a processing unit 602.
[0106] Communication unit 601 is used to communicate with other units and devices;
[0107] Processing unit 602 is configured to: acquire transaction data submitted by at least one transaction object; generate transaction data for instructing the transfer of electronic resources from the block building object to the block proposal object based on the determined block proposal object; generate block data based on the transaction data submitted by at least one transaction object and the transaction data for instructing the transfer of electronic resources from the block building object to the block proposal object; and send the block data to the intermediate node.
[0108] In one possible implementation, the processing unit 602, when acquiring transaction data submitted by at least one transaction object, sorts the transaction data in the transaction set according to the service resource quantity of each transaction data in the transaction set; the transaction set includes transaction data submitted by at least one transaction object; and acquires N transaction data from the transaction set according to the sorting result, where N is a positive integer.
[0109] In one possible implementation, the processing unit 602 is further configured to set the block building object as the service resource receiving object corresponding to N transaction data, so that after the block data built by the block building object is successfully uploaded to the chain as the target block data, it can receive the service resources generated by executing the N transaction data.
[0110] In one possible implementation, the processing unit 602, when generating transaction data to indicate the transfer of electronic resources from the block building object to the block proposal object based on the determined block proposal object, is used to determine the transfer resource amount of the electronic resources from the block building object to the determined block proposal object based on the service resource amount of N transaction data; and generate transaction data to indicate the transfer of electronic resources from the block building object to the block proposal object based on the determined transfer resource amount.
[0111] In a third embodiment of the block data processing apparatus, the block data processing apparatus may be housed in a computer device corresponding to the aforementioned block proposal object. This block data processing apparatus includes one or more units for executing the relevant methods in the preceding embodiments. Specific schematic diagrams of this block data processing apparatus can also be found in the embodiments of this application. Figure 6 As shown, it includes a communication unit 601 and a processing unit 602.
[0112] Communication unit 601 is used to communicate with other units and devices;
[0113] Processing unit 602 is used to send a block extraction request to the intermediate node; receive the block header data returned by the intermediate node, and perform signature processing on the received block header data to obtain block header signature data, wherein the block header data includes: the block header data of the target block data obtained by the intermediate node; and send the block header signature data to the intermediate node, which is used to trigger the intermediate node to process the target block data according to the block header signature data to obtain the block data to be added to the chain.
[0114] Corresponding to the first, second, and third embodiments of the block data processing device described above, they can be installed on different computer devices to respectively implement the relevant steps and functions of the aforementioned block building object, intermediate node, and block proposal object. Alternatively, they can be implemented simultaneously on a single computer device; that is, a block data processing device, including a communication unit 601 and a processing unit 602, can be installed on a computer device within the data sharing system. This device can implement all the functions mentioned in the first, second, and third embodiments, and can simultaneously implement the steps and functions corresponding to the block building object, intermediate node, and block proposal object mentioned in the aforementioned method embodiments. Of course, the first, second, and third embodiments of the block data processing device can also be located on two separate computer devices. For example, the block data processing devices mentioned in the second and third embodiments can be installed on a single computer device, that is, on a computer node within the data sharing system, thereby implementing the steps and functions corresponding to the block building object and block proposal object. The block data processing device in the first embodiment can be installed on an intermediate node or an off-chain relay. Of course, the block data processing devices involved in the first, second and third embodiments can be combined in any two pairs to simultaneously implement the steps and functions of any two different combinations of block building objects, block proposal objects and intermediate nodes.
[0115] Based on the same inventive concept, the message processing device provided in the embodiments of this application solves the problem in a principle and with beneficial effects similar to the solution principle and with beneficial effects of the method embodiments of this application. For the sake of brevity, the principle and with beneficial effects of the method embodiments can be referred to. They will not be repeated here.
[0116] Please see again Figure 7This is a schematic diagram of the structure of a computer device according to an embodiment of this application. The computer device includes a storage device 701 and a processor 702. The storage device 701 may include volatile memory, such as random-access memory (RAM); the storage device 701 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; the storage device may also include a combination of the above types of memory.
[0117] Processor 702 may be a central processing unit (CPU). Processor 702 may further include hardware chips. The aforementioned hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), etc. The aforementioned PLDs may be field-programmable gate arrays (FPGAs), generic array logic (GALs), etc.
[0118] In one embodiment, storage device 701 is further used to store a computer program. Processor 702 can invoke the computer program to implement the block data processing methods mentioned in the foregoing embodiments.
[0119] The computer device of this application can implement the corresponding functions and steps of any one, any two, or any three of the aforementioned block building objects, intermediate nodes, and block proposal objects. That is, in the embodiments of this application, the computer device can act alone as a block building object, implementing only the functions and steps corresponding to the aforementioned block building objects; it can also act alone as a block proposal object, implementing only the functions and steps corresponding to the aforementioned block proposal objects; and it can also act alone as an intermediate node, implementing only the functions and steps corresponding to the aforementioned intermediate nodes. Of course, combinations are also possible. For example, the computer device can simultaneously implement the functions and steps corresponding to both the block building objects and the block proposal objects mentioned in the foregoing embodiments. In this way, when acting as a block building object, it can implement the relevant functions and steps of the block building objects mentioned in the foregoing embodiments; and when acting as a block proposal object, it can implement the relevant functions and steps of the block proposal objects mentioned in the foregoing embodiments. Similarly, the computer device can also implement functional combinations of block building objects and intermediate nodes, functional combinations of block proposal objects and intermediate nodes, and functional combinations of block building objects, block proposal objects, and intermediate nodes.
[0120] In one embodiment, when the computer device is capable of functioning as an intermediate node, the processor 702 executes a computer program stored in a storage device to acquire block data generated by a block building object and to detect the transaction data included in the acquired block data; determines target block data based on the detection results, wherein the target block data includes target transaction data, which refers to transaction data indicating the transfer of electronic resources from the block building object that constructs the target block data to the block proposal object, and the amount of transferred electronic resources meets the transaction conditions; receives a block extraction request from the block proposal object; responds to the block extraction request to acquire the target block data, and sends the block to be added to the chain obtained based on the target block data to the block proposal object to trigger the block proposal object to perform on-chain processing of the target block.
[0121] In one possible implementation, when the processor 702 detects the transaction data included in the acquired block data, it determines whether the currently acquired block data includes transfer transaction data, which refers to transaction data used to instruct the transfer of electronic resources from a block building object to a block proposal object; if the transfer transaction data is included, it determines whether the amount of electronic resources instructing the transfer from the block building object to the block proposal object is greater than a resource threshold; if it is greater than the resource threshold, the transfer transaction data is determined as target transaction data, and the currently acquired block data is determined as target block data.
[0122] In one possible implementation, the processor 702 is further configured to update the resource threshold to the amount of electronic resources transferred as indicated by the target transaction data; wherein the amount of electronic resources transferred satisfies the transaction conditions if the amount of electronic resources transferred is greater than the resource threshold.
[0123] In one possible implementation, the processor 702, when responding to a block extraction request to obtain target block data and sending the block to be added to the blockchain based on the target block data to the block proposal object, is configured to: respond to the block extraction request, send the block header data of the obtained target block data to the block proposal object to trigger the block proposal object to sign the block header data; receive the block header signature data provided by the block proposal object and verify the block header signature data; process the target block data based on the verified block header signature data to obtain the block to be added to the blockchain; and send the block to be added to the blockchain to the block proposal object to trigger the block proposal object to add the target block to the blockchain.
[0124] In one possible implementation, the processor 702, when sending the block data to be added to the blockchain to the block proposal object to trigger the block proposal object to process the target block for on-chain processing, is used to perform consensus processing on the block data to be added to the blockchain network. After consensus is passed, a record notification message including the block data to be added to the blockchain is generated and sent to the block proposal object. The record notification message is used to notify the block proposal object to record the block data to be added to the blockchain after consensus is passed. Alternatively, a consensus notification message including the block data to be added to the blockchain is generated and sent to the block proposal object. The consensus notification message is used to instruct the block proposal object to perform consensus processing on the block data to be added to the blockchain included in the consensus notification message and to record the block data to be added to the blockchain after consensus is passed.
[0125] In one possible implementation, the acquired block data is generated by at least one block building object, which packages transaction data submitted by at least one transaction object and transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object.
[0126] In another embodiment, when the computer device is capable of implementing the function of a block building object, the processor calls a computer program stored in a storage device to obtain transaction data submitted by at least one transaction object; generates transaction data indicating the transfer of electronic resources from the block building object to the block proposal object based on the determined block proposal object; generates block data based on the transaction data submitted by at least one transaction object and the transaction data indicating the transfer of electronic resources from the block building object to the block proposal object; and sends the block data to an intermediate node.
[0127] In one possible implementation, the processor 702, when acquiring transaction data submitted by at least one transaction object, sorts the transaction data in the transaction set according to the service resource amount of each transaction data in the transaction set; the transaction set includes transaction data submitted by at least one transaction object; and acquires N transaction data from the transaction set according to the sorting result, where N is a positive integer.
[0128] In one possible implementation, the processor 702 is further configured to set the block building object as the service resource receiving object corresponding to N transaction data, so that after the block data built by the block building object is successfully uploaded to the chain as the target block data, it can receive the service resources generated by executing the N transaction data.
[0129] In one possible implementation, the processor 702, when generating transaction data to indicate the transfer of electronic resources from the block building object to the block proposal object based on the determined block proposal object, is configured to determine the transfer resource amount of the electronic resources from the block building object to the determined block proposal object based on the service resource amount of N transaction data; and generate transaction data to indicate the transfer of electronic resources from the block building object to the block proposal object based on the determined transfer resource amount.
[0130] In another embodiment, when the computer device is capable of implementing the function of a block proposal object, the processor 702 calls a computer program stored in the storage device to send a block extraction request to the intermediate node; receives block header data returned by the intermediate node, and performs signature processing on the received block header data to obtain block header signature data, wherein the block header data includes: block header data of the target block data obtained by the intermediate node; and sends the block header signature data to the intermediate node, the block header signature data being used to trigger the intermediate node to process the target block data according to the block header signature data to obtain the block data to be added to the chain.
[0131] Based on the same inventive concept, the principle and beneficial effects of the computer device provided in the embodiments of this application in solving the problem are similar to the principle and beneficial effects of the method embodiments of this application in solving the problem. Please refer to the principle and beneficial effects of the method embodiments. For the sake of brevity, they will not be repeated here.
[0132] This application also provides a computer program product comprising a computer program / instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instructions from the computer-readable storage medium, causing the computer device to execute the method provided in the foregoing embodiments.
[0133] The steps in the methods mentioned in the embodiments of this application can be adjusted, combined, or deleted according to actual needs. The units in the apparatus mentioned in the embodiments of this application can be combined, divided, or deleted according to actual needs.
[0134] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0135] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of this application still fall within the scope of the invention.
Claims
1. A method for processing block data, characterized in that, Applied to a block processing network, the block processing network including block proposal objects, intermediate nodes, and block building objects, the method includes: Retrieve block data generated by the block building object and inspect the transaction data included in the retrieved block data; The target block data is determined based on the detection results. The target block data includes target transaction data among the transaction data. The target transaction data refers to transaction data that indicates the transfer of electronic resources from the block building object that constructs the target block data to the block proposal object, and the amount of transferred electronic resources meets the transaction conditions. Receive block extraction requests from block proposal objects; In response to the block extraction request, the target block data is obtained, and the block to be added to the chain based on the target block data is sent to the block proposal object to trigger the block proposal object to perform on-chain processing of the target block.
2. The method as described in claim 1, characterized in that, The detection of transaction data included in the acquired block data includes: Determine whether the currently acquired block data includes transfer transaction data, which refers to transaction data used to instruct the transfer of electronic resources from the block building object to the block proposal object; If transfer transaction data is included, determine whether the amount of electronic resources transferred from the block building object to the block proposal object is greater than the resource threshold. If the value exceeds the resource threshold, the transfer transaction data is identified as the target transaction data, and the currently acquired block data is identified as the target block data.
3. The method as described in claim 2, characterized in that, Also includes: The resource threshold is updated to the amount of electronic resources transferred as indicated by the target transaction data; wherein, the amount of electronic resources transferred satisfies the transaction conditions if the amount of electronic resources transferred is greater than the resource threshold.
4. The method according to any one of claims 1-3, characterized in that, The step of responding to the block extraction request to obtain target block data and sending the block to be added to the chain based on the target block data to the block proposal object includes: In response to the block extraction request, the block header data of the obtained target block data is sent to the block proposal object to trigger the block proposal object to sign the block header data; Receive the block header signature data provided by the block proposal object, and verify the block header signature data; The target block data is processed based on the verified block header signature data to obtain the block data to be uploaded to the blockchain; The data of the block to be added to the chain is sent to the block proposal object to trigger the block proposal object to add the target block to the chain.
5. The method as described in claim 4, characterized in that, The step of sending the block data to be added to the blockchain to the block proposal object, thereby triggering the block proposal object to perform on-chain processing of the target block, includes: Consensus processing is performed on the block data to be added to the blockchain network. After consensus is reached, a record notification message including the block data to be added to the blockchain is generated and sent to the block proposal object. The record notification message is used to notify the block proposal object to record the block data to be added to the blockchain after consensus is reached. Alternatively, a consensus notification message including the block data to be added to the blockchain can be generated and sent to the block proposal object. The consensus notification message is used to instruct the block proposal object to perform consensus processing on the block data to be added to the blockchain included in the consensus notification message, and to record the block data to be added to the blockchain that has passed the consensus.
6. The method as described in claim 1, characterized in that, The acquired block data is generated by at least one block building object, which packages transaction data submitted by at least one transaction object and transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object.
7. A method for processing block data, characterized in that, Applied to a block processing network, the block processing network including block proposal objects, intermediate nodes, and block building objects, the method includes: Retrieve transaction data submitted by at least one transaction object; Based on the identified block proposal object, generate transaction data to indicate the transfer of electronic resources from the block building object to the block proposal object; Block data is generated based on transaction data submitted by at least one transaction object and transaction data used to indicate the transfer of electronic resources from the block building object to the block proposal object; The block data is sent to the intermediate node.
8. The method as described in claim 7, characterized in that, The acquisition of transaction data submitted by at least one transaction object includes: The transaction data in the transaction set is sorted by resource based on the service resource volume of each transaction data in the transaction set; the transaction set includes transaction data submitted by at least one transaction object; Based on the sorting results, retrieve N transaction data from the transaction set, where N is a positive integer.
9. The method as described in claim 8, characterized in that, Also includes: The block building object is set as the service resource receiving object corresponding to N transaction data, so that after the block data built by the block building object is successfully uploaded to the chain as the target block data, the service resources generated by the execution of the N transaction data can be received.
10. The method as described in claim 8 or 9, characterized in that, The step of generating transaction data, based on the determined block proposal object, to indicate the transfer of electronic resources from the block building object to the block proposal object, includes: Based on the service resource volume of N transaction data, determine the transfer resource volume of electronic resources from the block construction object to the determined block proposal object; Based on the determined amount of resources to be transferred, transaction data is generated to indicate the transfer of electronic resources from the block building object to the block proposal object.
11. A method for processing block data, characterized in that, Applied to a block processing network, the block processing network including block proposal objects, intermediate nodes, and block building objects, the method includes: Send a block retrieval request to the intermediate node; Receive block header data returned by intermediate nodes, and perform signature processing on the received block header data to obtain block header signature data, wherein the block header data includes: the block header data of the target block data obtained by the intermediate nodes; The block header signature data is sent to the intermediate node, and the block header signature data is used to trigger the intermediate node to process the target block data according to the block header signature data to obtain the block data to be added to the chain.
12. A block data processing device, characterized in that, The apparatus includes one or more units for performing the method as described in any one of claims 1-6, or the apparatus includes one or more units for performing the method as described in any one of claims 7-10, or the apparatus includes one or more units for performing the method as described in claim 11.
13. A computer device, characterized in that, The computer device includes a storage device and a processor; The storage device stores a computer program; the processor runs the computer program in the storage device to implement the steps of the method as described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1-11.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is processed and executed, it implements the steps of the method as described in any one of claims 1-11.