A transaction data processing method and device

By configuring contract priority and transaction processing speed limit information for smart contracts, we optimize the transaction data processing process in the blockchain system, solve the problem of low efficiency in processing important business transaction data, and achieve efficient use of resources and reduction of operation and maintenance costs. .

CN110838065BActive Publication Date: 2024-08-27TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911019591.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-24
Publication Date
2024-08-27
Estimated Expiration
2040-08-10

AI Technical Summary

Technical Problem

In the existing blockchain system, the transaction data processing efficiency of important businesses is low, resulting in a waste of resources and an increase in operation and maintenance costs.

Method used

By configuring the contract priority for the smart contract, and setting the transaction processing speed limit information according to the contract priority, the transaction data is stored in the processing queue of the target contract priority, and the transaction data is processed according to the speed limit information, thereby optimizing the transaction data processing process.

Benefits of technology

Without adding server nodes, the processing efficiency of important business transaction data is improved, resource waste and operation and maintenance cost increases are avoided, and the flexibility of the blockchain system is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110838065B
    Figure CN110838065B
Patent Text Reader

Abstract

The present application discloses a transaction data processing method and device, which are applied to the field of Internet technology to solve the problem of low processing efficiency of transaction data of important businesses in the prior art. Specifically, the contract priority of the smart contract corresponding to the transaction data is determined as the target contract priority, and the transaction data is stored in the transaction data processing queue corresponding to the target contract priority, and the transaction data in the transaction data processing queue is processed according to the transaction processing speed limit information corresponding to the target contract priority. In this way, by configuring contract priorities for different smart contracts, the processing of transaction data of businesses of different priorities can be achieved, thereby solving the problem of low processing efficiency of transaction data of important businesses that exists when processing transaction data in chronological order without adding new server nodes, and avoiding the waste of resources, increased operation and maintenance costs and difficulty caused by the addition of new server nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a transaction data processing method and device. Background Art

[0002] Blockchain technology has been widely used in industries such as industrial manufacturing, transportation, finance and insurance, and retail due to its characteristics of decentralization, information immutability, and openness. In the blockchain system, the transaction data of all transactions involved in various businesses are processed by the server-side nodes running on the server side.

[0003] At present, server nodes usually process transaction data in chronological order. In actual applications, different types of businesses have different levels of importance. For more important businesses, the current transaction data processing method may affect the processing efficiency of transaction data for such businesses. How to improve the processing efficiency of transaction data for important businesses is an issue that needs to be considered at present. Summary of the invention

[0004] The embodiments of the present application provide a transaction data processing method and device to solve the problem that the transaction data processing method in the prior art has low processing efficiency for transaction data of important businesses.

[0005] The technical solutions provided by the embodiments of this application are as follows:

[0006] On the one hand, an embodiment of the present application provides a transaction data processing method, which is applied to a server node in a blockchain system. The transaction data processing method includes:

[0007] Obtain the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data;

[0008] According to the contract identifier of the smart contract, the contract priority of the smart contract is determined as the target contract priority;

[0009] Store the transaction data into the transaction data processing queue corresponding to the target contract priority;

[0010] Obtain the transaction processing speed limit information corresponding to the target contract priority, where the transaction processing speed limit information includes the upper limit of the transaction processing volume within the speed limit period;

[0011] According to the transaction processing speed limit information, the transaction data in the transaction data processing queue is processed.

[0012] In a possible implementation, obtaining the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data includes:

[0013] If the server node is an endorsement node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction endorsement request;

[0014] If the server node is a sorting node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction sorting request.

[0015] In a possible implementation, before obtaining the transaction processing speed limit information corresponding to the target contract priority, the method further includes:

[0016] Make sure the target contract priority is not lower than the priority threshold.

[0017] In a possible implementation, the transaction data processing method provided in the embodiment of the present application further includes:

[0018] If it is determined that the target contract priority is lower than the priority threshold, then when it is determined that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are empty, the transaction data in the transaction data processing queues corresponding to the target contract priority are processed.

[0019] In a possible implementation manner, when processing the transaction data in the transaction data processing queue corresponding to the target contract priority, it also includes:

[0020] When it is determined that the transaction data processing queue corresponding to any contract priority not lower than the priority threshold is not empty, the processing of transaction data in the transaction data processing queue corresponding to the target contract priority is suspended, and the transaction data in the transaction data processing queue corresponding to any contract priority is processed according to the transaction processing speed limit information corresponding to any contract priority.

[0021] In a possible implementation, processing transaction data in a transaction data processing queue according to transaction processing speed limit information includes:

[0022] According to the transaction processing speed limit information, determine the upper limit of the transaction processing volume corresponding to the target contract priority;

[0023] When it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period does not exceed the transaction processing volume upper limit, the transaction data is obtained from the transaction data processing queue for processing.

[0024] In a possible implementation, the transaction data processing method provided in the embodiment of the present application further includes:

[0025] If it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period exceeds the transaction processing volume upper limit, then when the next speed limit period arrives, the transaction data is obtained from the transaction data processing queue for processing.

[0026] On the other hand, an embodiment of the present application provides a transaction data processing device, which is applied to a server node in a blockchain system. The transaction data processing device provided by the embodiment of the present application includes:

[0027] An acquisition module, used to acquire the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data;

[0028] A determination module, used to determine the contract priority of the smart contract as the target contract priority according to the contract identifier of the smart contract;

[0029] A storage module, used to store transaction data in a transaction data processing queue corresponding to the target contract priority;

[0030] The speed limit module is used to obtain the transaction processing speed limit information corresponding to the target contract priority, and process the transaction data in the transaction data processing queue according to the transaction processing speed limit information, wherein the transaction processing speed limit information includes the upper limit of the transaction processing volume within the speed limit period.

[0031] In a possible implementation, when acquiring the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data, the acquisition module is specifically used to:

[0032] If the server node is an endorsement node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction endorsement request;

[0033] If the server node is a sorting node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction sorting request.

[0034] In a possible implementation manner, the transaction data processing device provided in the embodiment of the present application further includes:

[0035] The checking module is used to perform a threshold detection on the target contract priority before the speed limit module obtains the transaction processing speed limit information corresponding to the target contract priority, and to determine that the target contract priority is not lower than the priority threshold.

[0036] In a possible implementation manner, the speed limiting module is further configured to:

[0037] If the inspection module determines that the target contract priority is lower than the priority threshold, then when it is determined that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are empty, the transaction data in the transaction data processing queues corresponding to the target contract priority are processed.

[0038] In a possible implementation, when processing transaction data in the transaction data processing queue corresponding to the target contract priority, the rate limiting module is further used to:

[0039] When it is determined that the transaction data processing queue corresponding to any contract priority not lower than the priority threshold is not empty, the processing of transaction data in the transaction data processing queue corresponding to the target contract priority is suspended, and the transaction data in the transaction data processing queue corresponding to any contract priority is processed according to the transaction processing speed limit information corresponding to any contract priority.

[0040] In a possible implementation, when processing transaction data in a transaction data processing queue according to transaction processing rate limit information, the rate limit module is specifically configured to:

[0041] According to the transaction processing speed limit information, determine the upper limit of the transaction processing volume corresponding to the target contract priority;

[0042] When it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period does not exceed the transaction processing volume upper limit, the transaction data is obtained from the transaction data processing queue for processing.

[0043] In a possible implementation manner, the speed limiting module is further configured to:

[0044] If it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period exceeds the transaction processing volume upper limit, then when the next speed limit period arrives, the transaction data is obtained from the transaction data processing queue for processing.

[0045] On the other hand, an embodiment of the present application provides a smart contract processing device in a blockchain system, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the transaction data processing method provided in the embodiment of the present application is implemented.

[0046] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the transaction data processing method provided in the embodiment of the present application is implemented.

[0047] The beneficial effects of the embodiments of the present application are as follows:

[0048] In the embodiment of the present application, by configuring contract priorities for different smart contracts, it is possible to process transaction data of businesses of different priorities, thereby solving the problem of low efficiency in processing transaction data of important businesses in the method of processing transaction data in chronological order without adding new server nodes, and avoiding the waste of resources, increased operation and maintenance costs and difficulty caused by adding new server nodes. Moreover, by configuring corresponding transaction processing speed limit information for different contract priorities, it is possible to process transaction data of businesses of different priorities using different processing speeds, thereby ensuring the processing efficiency of transaction data of important businesses while improving the flexibility of transaction data processing in the blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is a schematic diagram of the block structure of the blockchain in the embodiment of the present application;

[0050] Figure 2A This is a schematic diagram of the system architecture of the blockchain system in the embodiment of this application;

[0051] Figure 2B This is a schematic diagram of communication interaction between various types of server nodes in an embodiment of the present application;

[0052] Figure 3 This is a schematic diagram of the correspondence between the contract priority, the transaction data processing queue, and the transaction processing speed limit information in the embodiment of the present application;

[0053] Figure 4 This is a flow chart of a transaction data processing method in an embodiment of the present application;

[0054] Figure 5A This is a schematic diagram of an overview of transaction data processing by an endorsement node and an ordering node in an embodiment of the present application;

[0055] Figure 5B This is a schematic diagram of a specific process of the transaction data processing method in an embodiment of the present application;

[0056] Figure 6 This is a functional structure diagram of a transaction data processing device in an embodiment of the present application;

[0057] Figure 7 Schematic diagram of the hardware structure of the transaction data processing device in the embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and beneficial effects of this application clearer, the technical solution in the embodiment of this application will be clearly and completely described below in conjunction with the drawings in the embodiment of this application. Obviously, the described embodiment is only a part of the embodiment of this application, not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0059] In order to facilitate those skilled in the art to better understand the present application, the technical terms involved in the present application are briefly introduced below.

[0060] 1. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of blocks generated by cryptographic methods. Each block records the transaction data of a batch of network transactions, which is used to verify the validity of its transaction data (anti-counterfeiting) and generate the next block. Figure 1 As shown, it is an optional schematic diagram of the block structure (BlockStructure) in this application. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated.

[0061] In actual applications, blockchain can include the blockchain underlying platform, platform product service layer and application service layer. Among them:

[0062] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Specifically, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network monitoring, node equipment health monitoring, etc.

[0063] The platform product service layer provides the basic capabilities and implementation framework for typical applications. Developers can build on these basic capabilities and overlay business features to complete the blockchain implementation of business logic.

[0064] The application service layer provides application services based on blockchain solutions for business participants to use.

[0065] In actual applications, according to the different access rights and management rights, blockchain can be divided into three categories: public chain, private chain and alliance chain. Among them:

[0066] A public chain is a blockchain that is readable by everyone, anyone can initiate transactions and transactions can be effectively confirmed, and anyone can participate in the accounting and consensus process;

[0067] Private chain is a blockchain that uses blockchain technology as the underlying accounting technology, with accounting nodes being private individuals or private institutions and not open to the public.

[0068] A consortium chain is a blockchain that is used by a specific group and a limited number of third parties. It specifies multiple pre-selected nodes as accounting nodes. The generation of each block is jointly decided by all pre-selected nodes. Usually, the consortium chain has certain requirements for the configuration and network environment of consensus or verification nodes.

[0069] 2. The blockchain system is a distributed system formed by connecting client nodes and multiple server nodes through network communication. Figure 2A As shown in the figure, in the blockchain system, the server nodes form a peer-to-peer (P2P) network, and the P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP). Among them:

[0070] A client node is an application (Application, App) or software development kit (Software Development Kit, SDK) that can support users to register for blockchain services and initiate service requests to the blockchain network based on user operations.

[0071] A server node is a computing device that runs on the server side and can provide blockchain services to client nodes. It can be, but is not limited to, a server, a user terminal, etc. In actual applications, any computing device such as a server, a user terminal, etc. can join the blockchain network and become a server node.

[0072] See also Figure 2B As shown, the blockchain system may include server nodes with different functions, such as endorsement nodes, sorting nodes, and accounting nodes, among which the endorsement nodes are mainly responsible for checking and endorsing transaction data such as transaction proposals sent by client nodes, and returning the endorsement results and endorsement signatures to the client nodes; the sorting nodes are mainly responsible for globally sorting and packaging blocks of transaction data such as transaction results with endorsement results and endorsement signatures sent by client nodes, and broadcasting the generated blocks to the endorsement nodes and accounting nodes; the accounting nodes are mainly responsible for verifying the blocks broadcast by the sorting nodes (including but not limited to endorsement policy verification, read-write set verification, etc.), and submitting the verified blocks to the blockchain, as well as updating the database, maintaining state data, and copies of the ledger.

[0073] 3. Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying codes on a shared ledger that are executed when certain conditions are met. The codes are used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.

[0074] 4. Contract priority. In this application, the priority of the smart contract corresponding to the business is configured according to the importance of the business. It can be determined through negotiation among the users in the blockchain system. In addition, the contract priority of the smart contract can be configured and associated with storage when the user uploads, installs, and instantiates the smart contract.

[0075] In the present application, different contract priorities may correspond to different transaction data processing queues and transaction processing speed limit information, wherein the transaction data processing queue is used to store the transaction data of each business under the corresponding contract priority; the transaction processing speed limit information is configured for the corresponding contract priority according to the maximum load capacity of the server node, and is used to limit the processing speed of transaction data of each business under the contract priority, which may include but is not limited to: the upper limit of the transaction processing volume within the speed limit period. In actual applications, the sum of the upper limits of the transaction processing volume corresponding to each contract priority within the speed limit period shall not exceed the maximum load capacity of the server node.

[0076] For example: See Figure 3 As shown, when a user uploads, installs, or instantiates a smart contract, the contract priority of the smart contract can be configured. The contract priority can include, but is not limited to, high priority, normal priority, and low priority. In actual applications, high priority, normal priority, and low priority can correspond to a transaction data processing queue, respectively, which can be a high priority processing queue, a normal priority processing queue, and a low priority processing queue, respectively. In addition, high priority, normal priority, and low priority correspond to a transaction processing speed limit information, respectively. Assuming that the maximum load capacity of each server node is the same, the transaction processing speed limit information corresponding to the high priority, normal priority, and low priority can be, respectively, a maximum of 600 transaction data, a maximum of 300 transaction data, and a maximum of 100 transaction data within a speed limit period of 1 second. In this way, the server node can process the transaction data in the transaction data processing queue corresponding to the corresponding contract priority according to the transaction processing speed limit information corresponding to each contract priority.

[0077] 5. Transaction data. In this application, the content of transaction data varies according to the functions of the server node. Specifically, if the server node is an endorsement node, the transaction data may include but is not limited to: transaction proposals in the transaction endorsement request sent by the client; if the server node is a sorting node, the transaction data may include but is not limited to: transaction results, endorsement results and endorsement signatures in the transaction sorting request sent by the client.

[0078] After introducing the technical terms involved in this application, the application scenarios and design concepts of the embodiments of this application are briefly introduced.

[0079] At present, in the blockchain system, the process of uploading transaction data to the chain is usually completed by calling smart contracts. The smart contracts of all businesses are equal. For the public chain, if you want the transaction data of important businesses to be quickly uploaded to the chain, you can increase the transaction fee to speed up the possibility of quickly uploading the transaction data of important businesses. However, for the alliance chain, increasing the transaction fee cannot effectively solve the problem of quickly uploading the transaction data of important businesses. For this reason, a transaction data processing method is proposed in the prior art, that is, adding a server node in the blockchain system, and using the newly added server node to process the transaction data of important businesses. For the entire blockchain system, the improvement effect of the processing efficiency of the transaction data of important businesses is limited. Moreover, with the increase in the number of newly added server nodes, the difficulty and cost of operation and maintenance of the blockchain system also increase accordingly.

[0080] Therefore, in response to the above problems, a method for processing transaction data is proposed in the embodiment of the present application. Specifically, according to the importance of the business, the contract priority is configured for the corresponding smart contract, and the corresponding transaction processing speed limit information is configured for different contract priorities. When the server node processes the transaction data, it can determine the contract priority of the smart contract as the target contract priority according to the contract identifier of the smart contract corresponding to the transaction data, and store the transaction data in the transaction data processing queue corresponding to the target contract priority, and obtain the transaction processing speed limit information corresponding to the target contract priority, and process the transaction data in the transaction data processing queue according to the transaction processing speed limit information. In this way, by configuring contract priorities for different smart contracts, it is possible to process transaction data of businesses of different priorities, thereby solving the problem of low processing efficiency of transaction data of important businesses in the method of processing transaction data in chronological order without adding new server nodes, and avoiding the waste of resources, increased operation and maintenance costs and difficulty caused by the addition of new server nodes. Moreover, by configuring corresponding transaction processing speed limit information for different contract priorities, it is possible to use different processing speeds to process transaction data of different priority businesses, thereby ensuring the processing efficiency of transaction data of important businesses while improving the flexibility of transaction data processing in the blockchain system.

[0081] The following is a detailed description of the transaction data processing method for a server node in a blockchain system provided in an embodiment of the present application. Figure 4 As shown, the process of the transaction data processing method provided in the embodiment of the present application is as follows:

[0082] Step 401: Obtain the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data.

[0083] In actual applications, if the server node is an endorsement node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data can be obtained from the received transaction endorsement request; if the server node is a sorting node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data can be obtained from the received transaction sorting request.

[0084] Step 402: According to the contract identifier of the smart contract, determine the contract priority of the smart contract as the target contract priority.

[0085] In actual applications, when users upload, install, and instantiate smart contracts, after configuring the contract priority of the smart contract based on the priority results negotiated by each user in the blockchain system based on the importance of the business, the contract identifier and contract priority of the smart contract can be associated and stored. In this way, after the server node obtains the contract identifier of the smart contract corresponding to the transaction data, it can obtain the contract priority of the smart contract based on the association between the contract identifier and the contract priority and determine it as the target contract priority.

[0086] Step 403: Store the transaction data into the transaction data processing queue corresponding to the target contract priority.

[0087] In actual applications, in order to quickly process the transaction data of various businesses corresponding to different priorities and improve the processing efficiency of transaction data, the server node obtains the transaction data to be processed and determines the contract priority of the smart contract corresponding to the transaction data as the target contract priority. Then, the transaction data can be stored in the transaction data processing queue corresponding to the target contract priority.

[0088] Step 404: Obtain transaction processing speed limit information corresponding to the target contract priority, wherein the transaction processing speed limit information includes an upper limit of transaction processing volume within a speed limit period.

[0089] In order to improve resource utilization, in an embodiment of the present application, transaction data for businesses with lower contract priorities can be processed during idle time. Specifically, before obtaining the transaction processing speed limit information corresponding to the target contract priority, the server node can also check whether the target contract priority is not lower than the priority threshold. If it is determined that the target contract priority is not lower than the priority threshold, the transaction processing speed limit information corresponding to the target contract priority can be directly obtained, and according to the transaction processing speed limit information, the transaction data in the transaction data processing queue corresponding to the target contract priority is processed, thereby ensuring real-time processing of transaction data for high-priority businesses and improving the processing efficiency of transaction data for high-priority businesses.

[0090] It is worth mentioning that if the server node determines that the target contract priority is lower than the priority threshold, it can further detect whether the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are all empty. If so, the transaction data in the transaction data processing queue corresponding to the target contract priority can be directly processed. If not, the transaction data in the transaction data processing queue corresponding to the target contract priority can be not processed, and the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold can be monitored in real time. When it is monitored that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are all empty, the transaction data in the transaction data processing queue corresponding to the target contract priority is processed, thereby realizing the function of processing the transaction data of low-priority businesses during idle time and saving the processing resources of the server node.

[0091] Furthermore, when the server node processes the transaction data in the transaction data processing queue of low contract priority during idle time, if it monitors that the transaction data processing queue corresponding to any contract priority not lower than the priority threshold is not empty, the processing of the transaction data in the transaction data processing queue of low contract priority can be suspended, and the transaction data in the transaction data processing queue corresponding to any contract priority can be processed according to the transaction processing speed limit information corresponding to any contract priority, thereby further ensuring the real-time processing of transaction data of high-priority businesses and improving the processing efficiency of transaction data of high-priority businesses.

[0092] Step 405: Process the transaction data in the transaction data processing queue according to the transaction processing speed limit information.

[0093] In an embodiment of the present application, when executing step 405, the server node may adopt but is not limited to the following methods: based on the transaction processing speed limit information, determine the upper limit of the transaction processing volume of the target contract priority within the speed limit period, and based on the upper limit of the transaction processing volume of the target contract priority within the speed limit period, periodically obtain transaction data from the transaction data processing queue corresponding to the target contract priority for processing, and, in each speed limit period, if it is determined that the current transaction processing volume corresponding to the target contract priority in the current speed limit period does not exceed the upper limit of the transaction processing volume, directly obtain the transaction data from the transaction data processing queue for processing; if it is determined that the current transaction processing volume corresponding to the target contract priority in the current speed limit period exceeds the upper limit of the transaction processing volume, then when the next speed limit period arrives, obtain the transaction data from the transaction data processing queue for processing.

[0094] It is worth mentioning that, depending on actual needs and application scenarios, in the blockchain system, all types of server nodes may use the transaction data processing method provided in the embodiment of the present application to process transaction data, or some types of server nodes may use the transaction data processing method provided in the embodiment of the present application to process transaction data. Figure 5A As shown, for a transaction endorsement request sent by a user through a client node to a sorting node, the endorsement node can use the transaction data processing method provided in an embodiment of the present application to check and endorse the transaction data in the transaction endorsement request. For a transaction sorting request sent by a user through a client node to a sorting node, the sorting node can also use the transaction data processing method provided in an embodiment of the present application to sort the transaction data in the transaction sorting request and package the blocks.

[0095] The following uses "the endorsement nodes and sorting nodes in the blockchain system use the transaction data processing method provided in the embodiment of the present application to process transaction data" as a specific application scenario to further explain the transaction data processing method provided in the embodiment of the present application. Figure 5B As shown, the specific process of the transaction data processing method provided in the embodiment of the present application is as follows:

[0096] Step 501: The client node sends a transaction endorsement request to the endorsement node for the transaction initiated by the user, wherein the transaction endorsement request carries at least transaction data such as the transaction proposal, the contract identifier of the smart contract, and the user signature.

[0097] Step 502: The endorsement node obtains transaction data such as the transaction proposal, the contract identifier of the smart contract, and the user signature from the transaction endorsement request.

[0098] Step 503: The endorsement node verifies the user's signature. After confirming that the verification is successful, the endorsement node determines the contract priority of the smart contract as the target contract priority based on the contract identifier of the smart contract.

[0099] Step 504: The endorsing node stores the transaction data such as the transaction proposal into the transaction data processing queue corresponding to the priority of the target contract.

[0100] Step 505: The endorsement node checks whether the target contract priority is not lower than the priority threshold. If so, execute step 507; if not, execute step 506.

[0101] Step 506: When the endorsement node determines that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are all empty, it processes the transaction data in the transaction data processing queue corresponding to the target contract priority.

[0102] Step 507: The endorsement node obtains the transaction processing speed limit information corresponding to the target contract priority, and determines the upper limit of the transaction processing volume of the target contract priority within the speed limit period based on the transaction processing speed limit information.

[0103] Step 508: The endorsement node periodically obtains transaction data such as transaction proposals from the transaction data processing queue corresponding to the target contract priority according to the upper limit of the transaction processing volume of the target contract priority within the speed limit period, checks and endorses the obtained transaction data such as transaction proposals, obtains the endorsement result and signs it.

[0104] Step 509: The endorsing node returns the endorsement result and signature information to the client node in the transaction endorsement response.

[0105] Step 510: The client node checks the endorsement result and signature information in the transaction endorsement response returned by each endorsing node.

[0106] Step 511: When the client node determines that the number of valid endorsement results and signatures reaches the set number, it sends a transaction sorting request to the sorting node, wherein the transaction sorting request carries at least transaction data such as transaction results, the contract identifier of the smart contract, endorsement results and signatures, etc.

[0107] Step 512: The sorting node obtains transaction data such as transaction results, contract identifier of the smart contract, endorsement results and signatures, etc. from the transaction sorting request.

[0108] Step 513: The sorting node determines the contract priority of the smart contract as the target contract priority according to the contract identifier of the smart contract.

[0109] Step 514: The sorting node stores transaction data such as transaction results, endorsement results, and signatures in the transaction data processing queue corresponding to the target contract priority.

[0110] Step 515: The sorting node checks whether the target contract priority is not lower than the priority threshold. If so, execute step 517; if not, execute step 516.

[0111] Step 516: When the sorting node determines that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are all empty, it processes the transaction data in the transaction data processing queue corresponding to the target contract priority.

[0112] Step 517: The sorting node obtains the transaction processing speed limit information corresponding to the target contract priority, and determines the upper limit of the transaction processing volume of the target contract priority within the speed limit period based on the transaction processing speed limit information.

[0113] Step 518: The sorting node periodically obtains transaction data from the transaction data processing queue corresponding to the target contract priority according to the upper limit of the transaction processing volume of the target contract priority within the speed limit period, and globally sorts and packages the obtained transaction data into blocks.

[0114] Step 519: The sorting node broadcasts the generated block to the accounting node and the endorsing node.

[0115] Step 520: The accounting node performs various verifications such as endorsement policy verification and read-write set verification on the blocks broadcast by the sorting node, and submits the verified blocks to the blockchain.

[0116] Based on the above embodiments, the present application embodiment provides a transaction data processing device for a server node in a blockchain system, see Figure 6 As shown, the transaction data processing 600 provided in the embodiment of the present application at least includes:

[0117] An acquisition module 601 is used to acquire the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data;

[0118] A determination module 602, configured to determine the contract priority of the smart contract as the target contract priority according to the contract identifier of the smart contract;

[0119] Storage module 603, used to store transaction data into a transaction data processing queue corresponding to the target contract priority;

[0120] The speed limit module 604 is used to obtain the transaction processing speed limit information corresponding to the target contract priority, and process the transaction data in the transaction data processing queue according to the transaction processing speed limit information, wherein the transaction processing speed limit information includes the upper limit of the transaction processing volume within the speed limit period.

[0121] In a possible implementation, when acquiring the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data, the acquisition module 601 is specifically used to:

[0122] If the server node is an endorsement node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction endorsement request;

[0123] If the server node is a sorting node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction sorting request.

[0124] In a possible implementation manner, the transaction data processing device provided in the embodiment of the present application further includes:

[0125] The checking module 605 is used to perform a threshold detection on the target contract priority before the speed limit module 604 obtains the transaction processing speed limit information corresponding to the target contract priority, and determine that the target contract priority is not lower than the priority threshold.

[0126] In a possible implementation, the speed limiting module 604 is further configured to:

[0127] If the checking module 605 determines that the target contract priority is lower than the priority threshold, then when it is determined that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are empty, the transaction data in the transaction data processing queues corresponding to the target contract priority are processed.

[0128] In a possible implementation, when processing the transaction data in the transaction data processing queue corresponding to the target contract priority, the rate limiting module 604 is further configured to:

[0129] When it is determined that the transaction data processing queue corresponding to any contract priority not lower than the priority threshold is not empty, the processing of transaction data in the transaction data processing queue corresponding to the target contract priority is suspended, and the transaction data in the transaction data processing queue corresponding to any contract priority is processed according to the transaction processing speed limit information corresponding to any contract priority.

[0130] In a possible implementation, when processing the transaction data in the transaction data processing queue according to the transaction processing speed limit information, the speed limit module 604 is specifically used to:

[0131] According to the transaction processing speed limit information, determine the upper limit of the transaction processing volume corresponding to the target contract priority;

[0132] When it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period does not exceed the transaction processing volume upper limit, the transaction data is obtained from the transaction data processing queue for processing.

[0133] In a possible implementation, the speed limiting module 604 is further configured to:

[0134] If it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period exceeds the transaction processing volume upper limit, then when the next speed limit period arrives, the transaction data is obtained from the transaction data processing queue for processing.

[0135] It should be noted that the principle of solving the technical problem by the transaction data processing device 600 provided in the embodiment of the present application is similar to the transaction data processing method provided in the embodiment of the present application. Therefore, the implementation of the transaction data processing device 600 provided in the embodiment of the present application can refer to the implementation of the transaction data processing method provided in the embodiment of the present application, and the repeated parts will not be repeated.

[0136] After introducing the transaction data processing method and apparatus provided in the embodiments of the present application, the transaction data processing device provided in the embodiments of the present application is briefly introduced next.

[0137] The transaction data processing device 700 provided in the embodiment of the present application may be, but is not limited to, a computing device such as a server or a user terminal. Figure 7 As shown, the transaction data processing device 700 provided in the embodiment of the present application includes at least: a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. When the processor 701 executes the computer program, the transaction data processing method provided in the embodiment of the present application is implemented.

[0138] It should be noted that if Figure 7 The transaction data processing device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0139] The transaction data processing device 700 provided in the embodiment of the present application may also include a bus 703 connecting different components (including the processor 701 and the memory 702). The bus 703 represents one or more of several types of bus structures, including a memory bus, a peripheral bus, a local bus, and the like.

[0140] The memory 702 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 7021 and / or a cache memory 7022 , and may further include a read-only memory (ROM) 7023 .

[0141] The memory 702 may also include a program tool 7025 having a set (at least one) of program modules 7024, wherein the program modules 7024 include but are not limited to: an operating subsystem, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment.

[0142] The transaction data processing device 700 may also communicate with one or more external devices 704 (e.g., keyboards, remote controls, etc.), and may also communicate with one or more devices that enable a user to interact with the transaction data processing device 700 (e.g., mobile phones, computers, etc.), and / or communicate with any device that enables the transaction data processing device 700 to communicate with one or more other transaction data processing devices 700 (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 705. Furthermore, the transaction data processing device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 706. Figure 7 As shown, the network adapter 706 communicates with other modules of the transaction data processing device 700 via the bus 703. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with the transaction data processing device 700, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) subsystems, tape drives, and data backup storage subsystems.

[0143] The computer-readable storage medium provided in the embodiment of the present application is introduced below. The embodiment of the present application provides a computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by the processor, the transaction data processing method provided in the embodiment of the present application is implemented. Specifically, the executable program can be built-in or installed in the transaction data processing device 700, so that the transaction data processing device 700 can implement the transaction data processing method provided in the embodiment of the present application by executing the built-in or installed executable program.

[0144] In addition, the transaction data processing method provided in the embodiment of the present application can also be implemented as a program product, which includes a program code. When the program product can be run on the transaction data processing device 700, the program code is used to enable the transaction data processing device 700 to execute the transaction data processing method provided in the embodiment of the present application.

[0145] The program product provided in the embodiments of the present application may adopt any combination of one or more readable media, wherein the readable medium may be a readable signal medium or a readable storage medium, and the readable storage medium may be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination of the above. Specifically, more specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, RAM, ROM, Erasable Programmable Read Only Memory (EPROM), optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0146] The program product provided in the embodiment of the present application may adopt a CD-ROM and include program code, and may also be run on a computing device. However, the program product provided in the embodiment of the present application is not limited thereto. In the embodiment of the present application, the readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.

[0147] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0148] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0149] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0150] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A transaction data processing method, characterized in that: Applied to a server node in a blockchain system, the transaction data processing method includes: Obtaining the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data; According to the contract identifier of the smart contract, determine the contract priority of the smart contract as the target contract priority; The transaction data is stored in a transaction data processing queue corresponding to the target contract priority; Obtaining transaction processing speed limit information corresponding to the target contract priority, wherein the transaction processing speed limit information includes an upper limit of transaction processing volume within a speed limit period; The transaction data in the transaction data processing queue is processed according to the transaction processing speed limit information.

2. The transaction data processing method according to claim 1, characterized in that: Obtaining the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data, including: If the server node is an endorsement node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction endorsement request; If the server node is a sorting node, the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data are obtained from the received transaction sorting request.

3. The transaction data processing method according to claim 1 or 2, characterized in that: Before obtaining the transaction processing speed limit information corresponding to the target contract priority, it also includes: Determine that the target contract priority is not less than a priority threshold.

4. The transaction data processing method according to claim 3, characterized in that: Also includes: If it is determined that the target contract priority is lower than the priority threshold, then when it is determined that the transaction data processing queues corresponding to the contract priorities not lower than the priority threshold are empty, the transaction data in the transaction data processing queues corresponding to the target contract priority are processed.

5. The transaction data processing method according to claim 4, characterized in that: When processing the transaction data in the transaction data processing queue corresponding to the target contract priority, it also includes: When it is determined that the transaction data processing queue corresponding to any contract priority not lower than the priority threshold is not empty, the processing of the transaction data in the transaction data processing queue corresponding to the target contract priority is suspended, and according to the transaction processing speed limit information corresponding to any contract priority, the transaction data in the transaction data processing queue corresponding to any contract priority is processed.

6. The transaction data processing method according to claim 1 or 2, characterized in that: Processing the transaction data in the transaction data processing queue according to the transaction processing speed limit information includes: Determine the upper limit of the transaction processing volume corresponding to the priority of the target contract according to the transaction processing speed limit information; When it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period does not exceed the transaction processing volume upper limit, the transaction data is obtained from the transaction data processing queue for processing.

7. The transaction data processing method according to claim 6, characterized in that: Also includes: If it is determined that the current transaction processing volume corresponding to the target contract priority within the current speed limit period exceeds the transaction processing volume upper limit, then when the next speed limit period arrives, the transaction data is obtained from the transaction data processing queue for processing.

8. A transaction data processing device, characterized in that: Applied to a server node in a blockchain system, the transaction data processing device comprises: An acquisition module, used to acquire the transaction data to be processed and the contract identifier of the smart contract corresponding to the transaction data; A determination module, configured to determine the contract priority of the smart contract as the target contract priority according to the contract identifier of the smart contract; A storage module, used for storing the transaction data in a transaction data processing queue corresponding to the target contract priority; A speed limit module is used to obtain the transaction processing speed limit information corresponding to the target contract priority, and process the transaction data in the transaction data processing queue according to the transaction processing speed limit information, wherein the transaction processing speed limit information includes the upper limit of the transaction processing volume within the speed limit period.

9. A transaction data processing device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the transaction data processing method in the blockchain system as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the transaction data processing method according to any one of claims 1 to 7 is implemented.