WO2019114128A1 - 区块链事务区块处理方法、电子装置及可读存储介质 - Google Patents

区块链事务区块处理方法、电子装置及可读存储介质 Download PDF

Info

Publication number
WO2019114128A1
WO2019114128A1 PCT/CN2018/075880 CN2018075880W WO2019114128A1 WO 2019114128 A1 WO2019114128 A1 WO 2019114128A1 CN 2018075880 W CN2018075880 W CN 2018075880W WO 2019114128 A1 WO2019114128 A1 WO 2019114128A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
blockchain
transactions
data
data node
Prior art date
Application number
PCT/CN2018/075880
Other languages
English (en)
French (fr)
Inventor
陆陈一帆
褚镇飞
冯承勇
张松松
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2019114128A1 publication Critical patent/WO2019114128A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a blockchain transaction block processing method, an electronic device, and a readable storage medium.
  • a blockchain is a distributed database based on transaction blocks. Transactions in traditional databases are typically packaged in a block in a blockchain.
  • the blockchain nodes distributed throughout the blockchain accept the same block through the consensus mechanism, and execute the same transactions in the block in order, thereby achieving consistency of execution results.
  • all transactions are usually collected by the consensus node, multiple transactions are packaged to generate blocks, and blocks are sent to the data nodes, and the data nodes execute the transactions in block by block.
  • the purpose of the present application is to provide a blockchain transaction block processing method, an electronic device, and a readable storage medium, which are intended to reduce system response time and improve execution efficiency of a blockchain transaction block.
  • the present application provides an electronic device including a memory, a processor, and a memory block block processing system operable on the processor, the area being stored
  • the blockchain transaction block processing system is implemented by the processor to implement the following steps:
  • the received local transaction is packaged into one or more transaction blocks, and according to the sorting of the corresponding transaction in the transaction block, the transaction block is selected one by one in the sort order and the selected transaction block is executed.
  • the present application further provides a block chain transaction block processing method, where the block chain transaction block processing method includes:
  • Step 1 The data node of the blockchain initiates a transaction receiving request to the consensus node of the blockchain through a preset request mechanism, and receives the sorted transaction in the consensus node to the data node locally; All the transactions are pre-collected and sorted in the consensus node, and the sorted transactions are cached;
  • Step 2 Each of the data nodes packages the received local transaction into one or more transaction blocks according to a preset rule, and selects the transaction blocks one by one according to the sorting order according to the sorting of the corresponding transactions in the transaction block. Execute the transaction in the selected transaction block.
  • the present application further provides a computer readable storage medium storing a blockchain transaction block processing system, and the blockchain transaction block processing system can be At least one processor is operative to cause the at least one processor to perform the steps of the blockchain transaction block processing method as described above.
  • the blockchain transaction block processing method, system and readable storage medium proposed by the present application collect all transactions and sort by the consensus node of the blockchain, and then the data nodes of the blockchain pass the preset request mechanism to the device.
  • the consensus node initiates a transaction receiving request to receive the sorted transaction locally; each of the data nodes packages the received local transaction to generate one or more transaction blocks, and executes the generated transaction block Transaction.
  • the consensus node is only responsible for collecting the transaction, and sorting the transaction, sending the transaction to the data node according to the request of the data node, and the data node can package the transaction after receiving the transaction.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a blockchain transaction block processing system 10 of the present application;
  • FIG. 2 is a schematic flow chart of an embodiment of a blockchain transaction block processing method according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of the blockchain transaction block processing system 10 of the present application.
  • the blockchain transaction block processing system 10 is installed and operated in the electronic device 1.
  • the electronic device 1 may include, but is not limited to, a memory 11, a processor 12, and a display 13.
  • Figure 1 shows only the electronic device 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 11 is at least one type of readable computer storage medium, which in some embodiments may be an internal storage unit of the electronic device 1, such as a hard disk or memory of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • SMC smart memory card
  • SD Secure Digital
  • flash card etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 is configured to store application software and various types of data installed in the electronic device 1, such as program code of the blockchain transaction block processing system 10.
  • the memory 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 12 in some embodiments, may be a central processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example The block chain transaction block processing system 10 and the like are executed.
  • CPU central processing unit
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example
  • the block chain transaction block processing system 10 and the like are executed.
  • the display 13 in some embodiments may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display 13 is used to display information processed in the electronic device 1 and a user interface for displaying visualization, such as the number of sorted transactions in the consensus node, the transaction block to be executed in the data node, and the like.
  • the components 11-13 of the electronic device 1 communicate with one another via a system bus.
  • the blockchain transaction block processing system 10 includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement various embodiments of the present application.
  • step S1 a transaction receiving request is initiated to the consensus node of the blockchain by using a preset request mechanism, and the sorted transaction in the consensus node is received locally by the data node; wherein all the pre-collected nodes are collected in the consensus node.
  • the transactions are sorted and the sorted transactions are cached.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc., and transactions are packaged into blocks for execution.
  • the blockchain includes a data node and a consensus node.
  • All the transactions to be processed (such as a transaction of a transfer transaction, a payment transaction, etc.) are collected and sorted by the consensus node of the blockchain, such as by execution time, Sort the importance levels, etc., and cache all sorted transactions in the consensus node of the blockchain.
  • the data node of the blockchain initiates a transaction receiving request to the consensus node of the blockchain through a preset request mechanism, so that the sorted transaction in the consensus node is received locally by the data node.
  • the preset request mechanism may be a polling request mechanism, a long polling request mechanism, or a registration transaction pushing mechanism, for example, a data node of the blockchain initiates a polling request or initiates a registration transaction to a consensus node of the blockchain.
  • Push event That is, the data node of the blockchain periodically initiates a transaction receiving request to the consensus node of the blockchain, or the data node of the blockchain initiates a request for receiving a registration transaction to the consensus node of the blockchain to ensure After the consensus node of the blockchain completes the transaction sorting, the data node of the blockchain can obtain the transaction information as soon as possible.
  • Step S2 according to a preset rule, the received local transaction is packaged into one or more transaction blocks, and according to the sorting of the corresponding transactions in the transaction block, the transaction block is selected one by one in the sorting order and the selected transaction block is executed. In the business.
  • each data node of the blockchain requests to obtain the sorted transaction in the consensus node of the blockchain and save it to each data node, and then package the received local transaction according to a preset rule.
  • One or more transaction blocks For example, each of the data nodes may be packaged into one or more transaction blocks according to their own configuration (including hardware and software configurations, such as the number of cores of the CPU, the number of cores of the CPU, and the clock frequency, etc.), and packaged.
  • the transaction block can be generated by periodically packing the transaction block, or by generating a transaction block according to a preset fixed transaction quantity, or by combining the timing package with the fixed transaction quantity package to generate the transaction block. , not limited here.
  • each data node of the blockchain After each data node of the blockchain packages the local transaction into one or more transaction blocks, since all the transactions have been sorted in the consensus node, each data node of the blockchain can The transaction block is selected one by one in the sort order and the transaction in the selected transaction block is executed according to the ordering of the corresponding transactions in the transaction block generated by its local packaging.
  • all the transactions are collected and sorted by the consensus node of the blockchain, and then the data node of the blockchain initiates a transaction receiving request to the consensus node by using a preset request mechanism,
  • the sorted transactions are received locally; each of the data nodes packages the received local transactions to generate one or more transaction blocks and executes the transactions in the generated transaction blocks.
  • the consensus node is only responsible for collecting the transaction, and sorting the transaction, sending the transaction to the data node according to the request of the data node, and the data node can package the transaction after receiving the transaction.
  • Blocks which execute transactions in a transaction block block by block.
  • the data node does not need to wait for the consensus node to perform transaction packaging before acquiring the transaction block, and can acquire the transaction and execute as soon as possible with the lowest possible delay, thereby reducing the response time of the system and improving the blockchain transaction block. Execution efficiency.
  • the method specifically includes:
  • the transactions received locally are grouped according to the sort order of the transactions and the corresponding number of transaction parallel processing thresholds. For example, the local transaction is sorted as "X1, X2, X3, X4, X5, X6, X7". If the number of transaction parallel processing thresholds corresponding to one data node is 3, the data node receives the local transaction. For the three groups, the first group is "X1, X2, X3", the second group is "X4, X5, X6", and the third group is "X7".
  • Each packetized transaction is separately packaged to generate a corresponding transaction block.
  • the transaction block corresponding to the first group of transactions "X1, X2, X3" is Y1
  • the transaction block corresponding to the second group of transactions "X4, X5, X6" is Y2
  • the transaction corresponding to the third group of transactions "X7” The block is Y3.
  • the corresponding transaction block is selected one by one in the sort order and the transaction in the selected transaction block is executed. For example, if the local transaction is sorted as "X1, X2, X3, X4, X5, X6, X7", then the transaction "X1, X2, X3" in the transaction block Y1 is the sorted transaction, then select first.
  • the transaction block Y1 performs transaction execution; the selection order of the transaction blocks Y1, Y2, and Y3 is Y1, Y2, and Y3, and each of the data nodes sequentially executes transactions in the transaction blocks Y1, Y2, and Y3.
  • each data node can control the number of transactions in the transaction block according to its own hardware attribute data, so that the subsequent transaction execution process does not cause the task to be blocked due to the limitation of the hardware attribute of the data node, such as the CPU limitation. Improve response speed.
  • the preset request mechanism is a long polling request mechanism, and an upper limit value of the number of polling acquisition transactions corresponding to each of the data nodes is greater than or equal to a corresponding transaction parallel processing quantity threshold, thereby Give full play to the performance of the data node CPU multicore.
  • the long polling request mechanism in this embodiment can better adapt to the scenario, and the long polling request mechanism can set the upper limit of the number of transactions to be polled, thereby avoiding the excessive number of transactions acquired at one time. And the network is blocked.
  • a data node belongs to multiple blockchains at the same time, analyze the size of the number of transactions of the consensus node cache of each blockchain to which the data node belongs;
  • the upper limit value of the number of transactions for the polling of the data node for the blockchain is decreased by a first preset value, and Lowering, by the data node, the transaction parallel processing quantity threshold for the blockchain by a second preset value, where the first preset value is the same as or different from the second preset value;
  • the upper limit value of the number of transactions obtained by the data node for the polling chain is increased to a third preset value.
  • the preset request mechanism is a long polling request mechanism, that is, each of the data nodes is configured with an upper limit value of a corresponding number of polling acquisition transactions, and a polling acquisition transaction corresponding to each of the data nodes
  • the upper limit of the quantity is greater than or equal to the corresponding transaction parallel processing number threshold.
  • the data node may obtain the number of transactions for the polling of the blockchain.
  • the limit and the number of transaction parallel processing thresholds are increased to increase the processing power of the data node for the blockchain.
  • the data node in this embodiment can appropriately reduce the processing quota of the blockchain with less transactions, appropriately increase the processing quota of the blockchain with more transactions, thereby fully utilizing the multi-core performance of the data node, and improving the transaction of the entire system. Processing capacity.
  • FIG. 2 is a schematic flowchart of a method for processing a blockchain transaction block according to an embodiment of the present invention.
  • the method for processing a blockchain transaction block includes the following steps:
  • Step S10 The data node of the blockchain initiates a transaction receiving request to the consensus node of the blockchain by using a preset request mechanism, and receives the sorted transaction in the consensus node to the data node locally; All transactions are pre-collected and sorted in the consensus node, and the sorted transactions are cached.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc., and transactions are packaged into blocks for execution.
  • the blockchain includes a data node and a consensus node.
  • All the transactions to be processed (such as a transaction of a transfer transaction, a payment transaction, etc.) are collected and sorted by the consensus node of the blockchain, such as by execution time, Sort the importance levels, etc., and cache all sorted transactions in the consensus node of the blockchain.
  • the data node of the blockchain initiates a transaction receiving request to the consensus node of the blockchain through a preset request mechanism, so that the sorted transaction in the consensus node is received locally by the data node.
  • the preset request mechanism may be a polling request mechanism, a long polling request mechanism, or a registration transaction pushing mechanism, for example, a data node of the blockchain initiates a polling request or initiates a registration transaction to a consensus node of the blockchain.
  • Push event That is, the data node of the blockchain periodically initiates a transaction receiving request to the consensus node of the blockchain, or the data node of the blockchain initiates a request for receiving a registration transaction to the consensus node of the blockchain to ensure After the consensus node of the blockchain completes the transaction sorting, the data node of the blockchain can obtain the transaction information as soon as possible.
  • Step S20 Each of the data nodes packages the received local transaction into one or more transaction blocks according to a preset rule, and selects the transaction block one by one according to the sorting order according to the ordering of the corresponding transactions in the transaction block. Execute the transaction in the selected transaction block.
  • each data node of the blockchain requests to obtain the sorted transaction in the consensus node of the blockchain and save it to each data node, and then package the received local transaction according to a preset rule.
  • One or more transaction blocks For example, each of the data nodes may be packaged into one or more transaction blocks according to their own configuration (including hardware and software configurations, such as the number of cores of the CPU, the number of cores of the CPU, and the clock frequency, etc.), and packaged.
  • the transaction block can be generated by periodically packing the transaction block, or by generating a transaction block according to a preset fixed transaction quantity, or by combining the timing package with the fixed transaction quantity package to generate the transaction block. , not limited here.
  • each data node of the blockchain After each data node of the blockchain packages the local transaction into one or more transaction blocks, since all the transactions have been sorted in the consensus node, each data node of the blockchain can The transaction block is selected one by one in the sort order and the transaction in the selected transaction block is executed according to the ordering of the corresponding transactions in the transaction block generated by its local packaging.
  • all the transactions are collected and sorted by the consensus node of the blockchain, and then the data node of the blockchain initiates a transaction receiving request to the consensus node by using a preset request mechanism,
  • the sorted transactions are received locally; each of the data nodes packages the received local transactions to generate one or more transaction blocks and executes the transactions in the generated transaction blocks.
  • the consensus node is only responsible for collecting the transaction, and sorting the transaction, sending the transaction to the data node according to the request of the data node, and the data node can package the transaction after receiving the transaction.
  • Blocks which execute transactions in a transaction block block by block.
  • the data node does not need to wait for the consensus node to perform transaction packaging before acquiring the transaction block, and can acquire the transaction and execute as soon as possible with the lowest possible delay, thereby reducing the response time of the system and improving the blockchain transaction block. Execution efficiency.
  • the step S20 includes:
  • Each of the data nodes groups the received local transactions according to the sort order of the transactions and the corresponding transaction parallel processing number threshold. For example, the local transaction is sorted as "X1, X2, X3, X4, X5, X6, X7". If the number of transaction parallel processing thresholds corresponding to one data node is 3, the data node receives the local transaction. For the three groups, the first group is "X1, X2, X3", the second group is "X4, X5, X6", and the third group is "X7".
  • Each packetized transaction is separately packaged to generate a corresponding transaction block.
  • the transaction block corresponding to the first group of transactions "X1, X2, X3" is Y1
  • the transaction block corresponding to the second group of transactions "X4, X5, X6" is Y2
  • the transaction corresponding to the third group of transactions "X7” The block is Y3.
  • Each of the data nodes selects a corresponding transaction block one by one according to a sorting of transactions corresponding to the transaction block, and executes a transaction in the selected transaction block. For example, if the local transaction is sorted as "X1, X2, X3, X4, X5, X6, X7", then the transaction "X1, X2, X3" in the transaction block Y1 is the sorted transaction, then select first.
  • the transaction block Y1 performs transaction execution; the selection order of the transaction blocks Y1, Y2, and Y3 is Y1, Y2, and Y3, and each of the data nodes sequentially executes transactions in the transaction blocks Y1, Y2, and Y3.
  • each data node can control the number of transactions in the transaction block according to its own hardware attribute data, so that the subsequent transaction execution process does not cause the task to be blocked due to the limitation of the hardware attribute of the data node, such as the CPU limitation. Improve response speed.
  • the preset request mechanism is a long polling request mechanism, and an upper limit value of the number of polling acquisition transactions corresponding to each of the data nodes is greater than or equal to a corresponding transaction parallel processing quantity threshold, thereby Give full play to the performance of the data node CPU multicore.
  • the long polling request mechanism in this embodiment can better adapt to the scenario, and the long polling request mechanism can set the upper limit of the number of transactions to be polled, thereby avoiding the excessive number of transactions acquired at one time. And the network is blocked.
  • the method further includes the following steps:
  • a data node belongs to multiple blockchains at the same time, analyze the size of the number of transactions of the consensus node cache of each blockchain to which the data node belongs;
  • the upper limit value of the number of transactions for the polling of the data node for the blockchain is decreased by a first preset value, and Lowering, by the data node, the transaction parallel processing quantity threshold for the blockchain by a second preset value, where the first preset value is the same as or different from the second preset value;
  • the upper limit value of the number of transactions obtained by the data node for the polling chain is increased to a third preset value.
  • the preset request mechanism is a long polling request mechanism, that is, each of the data nodes is configured with an upper limit value of a corresponding number of polling acquisition transactions, and a polling acquisition transaction corresponding to each of the data nodes
  • the upper limit of the quantity is greater than or equal to the corresponding transaction parallel processing number threshold.
  • the data node may obtain the number of transactions for the polling of the blockchain.
  • the limit and the number of transaction parallel processing thresholds are increased to increase the processing power of the data node for the blockchain.
  • the data node in this embodiment can appropriately reduce the processing quota of the blockchain with less transactions, appropriately increase the processing quota of the blockchain with more transactions, thereby fully utilizing the multi-core performance of the data node, and improving the transaction of the entire system. Processing capacity.
  • the present application also provides a computer readable storage medium storing a blockchain transaction block processing system, the blockchain transaction block processing system being executable by at least one processor,
  • the step of performing the block chain transaction block processing method in the foregoing embodiment, the steps S10, S20, and S30 of the block chain transaction block processing method are as described above. , will not repeat them here.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请涉及一种区块链事务区块处理方法、电子装置及可读存储介质,该方法包括:区块链的数据节点通过预设请求机制向所述区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到所述数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存;每个所述数据节点根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。本申请降低系统的响应时间,提高区块链事务区块的执行效率。

Description

区块链事务区块处理方法、电子装置及可读存储介质
本申请要求于2017年12月13日提交中国专利局、申请号为201711323460.8、发明名称为“区块链事务区块处理方法、电子装置及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种区块链事务区块处理方法、电子装置及可读存储介质。
背景技术
区块链是一个基于事务区块的分布式数据库。传统数据库中的事务在区块链中一般被打包在一个区块中。区块链上分布在各处的区块链节点通过共识机制接受相同的区块,按顺序执行区块中的同样的事务,从而达到执行结果的一致性。在区块链的联盟链场景中,通常由共识节点收集到所有的事务,将多个事务打包生成区块,并发送区块给数据节点,数据节点按顺序逐块执行其中的事务。生成区块的方法有多种,无论哪种方法,都需要由共识节点来生成区块,因此,事务较多时往往共识节点需要阻塞等待一段时间才能进行事务打包操作,从而延长了系统的响应时间,降低了区块链事务区块的执行效率。
发明内容
本申请的目的在于提供一种区块链事务区块处理方法、电子装置及可读存储介质,旨在降低系统响应时间,提高区块链事务区块的执行效率。
为实现上述目的,本申请提供一种电子装置,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的区块链事务区块处理系统,所述区块链事务区块处理系统被所述处理器执行时实现如下步骤:
A、通过预设请求机制向区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存;
B、根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
此外,为实现上述目的,本申请还提供一种区块链事务区块处理方法,所述区块链事务区块处理方法包括:
步骤一、区块链的数据节点通过预设请求机制向所述区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到所述数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存;
步骤二、每个所述数据节点根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
进一步地,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有区块链事务区块处理系统,所述区块链事务区块处理系统可被至少一个处理器执行,以使所述至少一个处理器执行如上述的区块链事务区块处理方法的步骤。
本申请提出的区块链事务区块处理方法、系统及可读存储介质,由区块链的共识节点收集所有的事务并排序,再由该区块链的数据节点通过预设请求机制向所述共识节点发起事务接收请求,以将排序好的事务接收到本地;由每个所述数据节点将接收到本地的事务打包生成一个或多个事务区块,并执行生成的事务区块中的事务。通过将共识节点的生成事务区块功能移交给数据节点,共识节点只负责收集事务,并将事务排序,根据数据节点的请求, 把事务发送给数据节点,数据节点收到事务后可以打包形成事务区块,逐块执行事务区块中的事务。这样,数据节点在获取到事务区块之前不需要等待共识节点进行事务打包,可以尽快获取到事务并执行,从而降低系统的响应时间,提高区块链事务区块的执行效率。
附图说明
图1为本申请区块链事务区块处理系统10较佳实施例的运行环境示意图;
图2为本申请区块链事务区块处理方法一实施例的流程示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
本申请提供一种区块链事务区块处理系统。请参阅图1,是本申请区块链事务区块处理系统10较佳实施例的运行环境示意图。
在本实施例中,所述的区块链事务区块处理系统10安装并运行于电子装置1中。该电子装置1可包括,但不仅限于,存储器11、处理器12及显示器13。图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
所述存储器11为至少一种类型的可读计算机存储介质,所述存储器11在一些实施例中可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘或内存。所述存储器11在另一些实施例中也可以是所述电子装置1的外部存储设备,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括所述电子装置1的内部存储单元也包括外部存储设备。所述存储器11用于存储安装于所述电子装置1的应用软件及各类数据,例如所述区块链事务区块处理系统10的程序代码等。所述存储器11还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器11中存储的程序代码或处理数据,例如执行所述区块链事务区块处理系统10等。
所述显示器13在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器13用于显示在所述电子装置1中处理的信息以及用于显示可视化的用户界面,例如共识节点中排序好的事务数量、数据节点中待执行的事务区块等。所述电子装置1的部件11-13通过系统总线相互通信。
区块链事务区块处理系统10包括至少一个存储在所述存储器11中的计算机可读指令,该至少一个计算机可读指令可被所述处理器12执行,以实现本申请各实施例。
其中,上述区块链事务区块处理系统10被所述处理器12执行时实现如下步骤:
步骤S1,通过预设请求机制向所述区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到所述数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存。
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式,事务被打包成区块来执行。本实施例中,区块链中包括数据节点和共识节点,首先,由区块链的共识节点收集待处理的所有的事务(例如转账交易、支付交易等事务)并排序,如按执行时间、重要程度优先级等排序,并将排序好的所有事务缓存在区块链的共识节点。由该区块链的数据节点通过预设请求机制向该区块链的共识节点发起事务接收请求,以将所述共识节点中排序好的事务接收到所述数据节点本地。所述预设请求机制可以是轮询请求机制、长轮询请求机制或注册事务推送机制,例如,由该区块链的数据节点向该区块链的共识节点发起轮询请求或发起注册事务推送事件。即由该区块链的数据节点定时向该区块链的共识节点发起事务接收请求,或由该区块链的数据节点向该区块链的共识节点发起其注册事务的接收请求,以确保在该区块链的共识节点完成事务排序之后该区块链的数据节点可以尽快获取到事务信息。
步骤S2,根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
本实施例中,区块链的每个数据节点请求获取到该区块链的共识节点中排序好的事务并保存到各数据节点本地后,可根据预设规则将接收到本地的事务打包成一个或多个事务区块。例如,可由每个所述数据节点根据自身配置(包括软硬件配置,例如CPU的核数、CPU的核数和时钟频率等)将接 收到本地的事务打包成一个或多个事务区块,打包生成事务区块的方式还可以是定时打包产生事务区块,或按预设的固定事务数量来打包产生事务区块,或以定时打包与按固定事务数量打包相结合的方式来生成事务区块,在此不做限定。
区块链的每个数据节点将接收到本地的事务打包成一个或多个事务区块后,由于所有的事务已经在共识节点中经过了排序操作,因此,区块链的每个数据节点可根据其本地打包生成的事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
与现有技术相比,本实施例中由区块链的共识节点收集所有的事务并排序,再由该区块链的数据节点通过预设请求机制向所述共识节点发起事务接收请求,以将排序好的事务接收到本地;由每个所述数据节点将接收到本地的事务打包生成一个或多个事务区块,并执行生成的事务区块中的事务。通过将共识节点的生成事务区块功能移交给数据节点,共识节点只负责收集事务,并将事务排序,根据数据节点的请求,把事务发送给数据节点,数据节点收到事务后可以打包形成事务区块,逐块执行事务区块中的事务。这样,数据节点在获取到事务区块之前不需要等待共识节点进行事务打包,可以在尽可能低延迟的情况下尽快获取到事务并执行,从而降低系统的响应时间,提高区块链事务区块的执行效率。
在一可选的实施例中,在上述图1的实施例的基础上,所述区块链事务区块处理系统10被所述处理器12执行实现所述步骤S2时,具体包括:
根据各个所述数据节点的硬件属性数据(例如,CPU的核数,或者,CPU的核数和时钟频率等),确定各个所述数据节点对应的事务并行处理数量阈值;
按照事务的排序顺序及对应的事务并行处理数量阈值,对接收到本地的事务进行分组。例如,接收到本地的事务排序为“X1、X2、X3、X4、X5、X6、X7”,若一个数据节点对应的事务并行处理数量阈值为3,则该数据节点对接收到本地的事务分为三组,第一组是“X1、X2、X3”,第二组是“X4、X5、X6”,第三组是“X7”。
对每个分组的事务分别进行打包生成对应的事务区块。例如,第一组事务“X1、X2、X3”对应的事务区块为Y1,第二组事务“X4、X5、X6”对应的事务区块为Y2,第三组事务“X7”对应的事务区块为Y3。
根据事务区块对应的事务的排序,按排序顺序逐个选择对应的事务区块并执行选择的事务区块中的事务。例如,接收到本地的事务排序为“X1、X2、X3、X4、X5、X6、X7”,则事务区块Y1中的事务“X1、X2、X3”是排序在先的事务,则先选择事务区块Y1进行事务执行;事务区块Y1、Y2及Y3的选择顺序为Y1、Y2、Y3,各个所述数据节点依次执行事务区块Y1、Y2、Y3中的事务。
本实施例中各个数据节点可以根据自身的硬件属性数据自行控制事务区块中的事务个数,使得后续事务执行过程中不会因数据节点自身硬件属性限制如CPU限制导致任务堵塞的情况发生,提高响应速度。
在一可选的实施例中,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值,从而充分发挥出数据节点CPU多核的性能。相比注册事务推送机制,本实施例中长轮询请求机制可以更好的适应该场景,并且长轮询请求机制可以设置轮询获取事务数量的上限值,避免因为一次获取事务数量过多而造成网络阻塞。
在一可选的实施例中,在上述实施例的基础上,所述区块链事务区块处理系统10被所述处理器12执行时,还实现如下步骤:
分析是否有数据节点同时属于多个区块链;
若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同;
若该数据节点所属的一个区块链的共识节点缓存的事务数量大于或者等于第二阈值,则将该数据节点针对该区块链的轮询获取事务数量的上限值提高第三预设值,并将该数据节点针对该区块链的事务并行处理数量阈值提高第四预设值,该第三预设值与该第四预设值相同或者不同,该第二阈值大于或者等于第一阈值。
本实施例中,所述预设请求机制为长轮询请求机制,即各个所述数据节点设置有对应的轮询获取事务数量的上限值,且各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。当有数据节点同时属于多个区块链时,若该数据节点所属的一个区块链中共识节点缓存的事务数量较少,即该区块链中事务处理较空闲,则可以将该数据节点针对该区块链的轮询获取事务数量的上限值以及事务并行处理数量阈值降低,以释放出该数据节点针对该区块链的部分处理能力。若该数据节点所属的一个区块链中共识节点缓存的事务数量较多,即该区块链中事务处理较繁忙,则可以将该数据节点针对该区块链的轮询获取事务数量的上限值以及事务并行处理数量阈值提高,以增加该数据节点针对该区块链的处理能力。这样,本实施例中数据节点可以适当降低事务较少的区块链的处理限额,适 当增大事务较多的区块链的处理限额,从而充分使用数据节点的多核性能,提高整个系统的事务处理能力。
如图2所示,图2为本申请区块链事务区块处理方法一实施例的流程示意图,该区块链事务区块处理方法包括以下步骤:
步骤S10,区块链的数据节点通过预设请求机制向所述区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到所述数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存。
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式,事务被打包成区块来执行。本实施例中,区块链中包括数据节点和共识节点,首先,由区块链的共识节点收集待处理的所有的事务(例如转账交易、支付交易等事务)并排序,如按执行时间、重要程度优先级等排序,并将排序好的所有事务缓存在区块链的共识节点。由该区块链的数据节点通过预设请求机制向该区块链的共识节点发起事务接收请求,以将所述共识节点中排序好的事务接收到所述数据节点本地。所述预设请求机制可以是轮询请求机制、长轮询请求机制或注册事务推送机制,例如,由该区块链的数据节点向该区块链的共识节点发起轮询请求或发起注册事务推送事件。即由该区块链的数据节点定时向该区块链的共识节点发起事务接收请求,或由该区块链的数据节点向该区块链的共识节点发起其注册事务的接收请求,以确保在该区块链的共识节点完成事务排序之后该区块链的数据节点可以尽快获取到事务信息。
步骤S20,每个所述数据节点根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
本实施例中,区块链的每个数据节点请求获取到该区块链的共识节点中排序好的事务并保存到各数据节点本地后,可根据预设规则将接收到本地的事务打包成一个或多个事务区块。例如,可由每个所述数据节点根据自身配置(包括软硬件配置,例如CPU的核数、CPU的核数和时钟频率等)将接收到本地的事务打包成一个或多个事务区块,打包生成事务区块的方式还可以是定时打包产生事务区块,或按预设的固定事务数量来打包产生事务区块,或以定时打包与按固定事务数量打包相结合的方式来生成事务区块,在此不做限定。
区块链的每个数据节点将接收到本地的事务打包成一个或多个事务区块后,由于所有的事务已经在共识节点中经过了排序操作,因此,区块链的每个数据节点可根据其本地打包生成的事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
与现有技术相比,本实施例中由区块链的共识节点收集所有的事务并排序,再由该区块链的数据节点通过预设请求机制向所述共识节点发起事务接收请求,以将排序好的事务接收到本地;由每个所述数据节点将接收到本地的事务打包生成一个或多个事务区块,并执行生成的事务区块中的事务。通过将共识节点的生成事务区块功能移交给数据节点,共识节点只负责收集事务,并将事务排序,根据数据节点的请求,把事务发送给数据节点,数据节点收到事务后可以打包形成事务区块,逐块执行事务区块中的事务。这样,数据节点在获取到事务区块之前不需要等待共识节点进行事务打包,可以在尽可能低延迟的情况下尽快获取到事务并执行,从而降低系统的响应时间,提高区块链事务区块的执行效率。
在一可选的实施例中,在上述实施例的基础上,所述步骤S20包括:
根据各个所述数据节点的硬件属性数据(例如,CPU的核数,或者,CPU的核数和时钟频率等),确定各个所述数据节点对应的事务并行处理数量阈值;
各个所述数据节点按照事务的排序顺序及对应的事务并行处理数量阈值,对接收到本地的事务进行分组。例如,接收到本地的事务排序为“X1、X2、X3、X4、X5、X6、X7”,若一个数据节点对应的事务并行处理数量阈值为3,则该数据节点对接收到本地的事务分为三组,第一组是“X1、X2、X3”,第二组是“X4、X5、X6”,第三组是“X7”。
对每个分组的事务分别进行打包生成对应的事务区块。例如,第一组事务“X1、X2、X3”对应的事务区块为Y1,第二组事务“X4、X5、X6”对应的事务区块为Y2,第三组事务“X7”对应的事务区块为Y3。
各个所述数据节点根据事务区块对应的事务的排序,按排序顺序逐个选择对应的事务区块并执行选择的事务区块中的事务。例如,接收到本地的事务排序为“X1、X2、X3、X4、X5、X6、X7”,则事务区块Y1中的事务“X1、X2、X3”是排序在先的事务,则先选择事务区块Y1进行事务执行;事务区块Y1、Y2及Y3的选择顺序为Y1、Y2、Y3,各个所述数据节点依次执行事务区块Y1、Y2、Y3中的事务。
本实施例中各个数据节点可以根据自身的硬件属性数据自行控制事务区块中的事务个数,使得后续事务执行过程中不会因数据节点自身硬件属性限制如CPU限制导致任务堵塞的情况发生,提高响应速度。
在一可选的实施例中,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值,从而充分发挥出数据节点CPU多核的性能。相比注册事务推送机制,本实施例中长轮询请求机制可以更好的适应该场景,并且长轮询 请求机制可以设置轮询获取事务数量的上限值,避免因为一次获取事务数量过多而造成网络阻塞。
在一可选的实施例中,在上述实施例的基础上,该方法还包括如下步骤:
分析是否有数据节点同时属于多个区块链;
若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同;
若该数据节点所属的一个区块链的共识节点缓存的事务数量大于或者等于第二阈值,则将该数据节点针对该区块链的轮询获取事务数量的上限值提高第三预设值,并将该数据节点针对该区块链的事务并行处理数量阈值提高第四预设值,该第三预设值与该第四预设值相同或者不同,该第二阈值大于或者等于第一阈值。
本实施例中,所述预设请求机制为长轮询请求机制,即各个所述数据节点设置有对应的轮询获取事务数量的上限值,且各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。当有数据节点同时属于多个区块链时,若该数据节点所属的一个区块链中共识节点缓存的事务数量较少,即该区块链中事务处理较空闲,则可以将该数据节点针对该区块链的轮询获取事务数量的上限值以及事务并行处理数量阈值降低,以释放出该数据节点针对该区块链的部分处理能力。若该数据节点所属的一个区块链中共识节点缓存的事务数量较多,即该区块链中事务处理较繁忙,则可以将该数据节点针对该区块链的轮询获取事务数量的上限值以及 事务并行处理数量阈值提高,以增加该数据节点针对该区块链的处理能力。这样,本实施例中数据节点可以适当降低事务较少的区块链的处理限额,适当增大事务较多的区块链的处理限额,从而充分使用数据节点的多核性能,提高整个系统的事务处理能力。
此外,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有区块链事务区块处理系统,所述区块链事务区块处理系统可被至少一个处理器执行,以使所述至少一个处理器执行如上述实施例中的区块链事务区块处理方法的步骤,该区块链事务区块处理方法的步骤S10、S20、S30等具体实施过程如上文所述,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上参照附图说明了本申请的优选实施例,并非因此局限本申请的权利 范围。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本领域技术人员不脱离本申请的范围和实质,可以有多种变型方案实现本申请,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本申请的技术构思之内所作的任何修改、等同替换和改进,均应在本申请的权利范围之内。

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的区块链事务区块处理系统,所述区块链事务区块处理系统被所述处理器执行时实现如下步骤:
    A、通过预设请求机制向区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存;
    B、根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
  2. 如权利要求1所述的电子装置,其特征在于,所述区块链事务区块处理系统被所述处理器执行实现所述步骤B时,具体包括:
    根据各个所述数据节点的硬件属性数据,确定各个所述数据节点对应的事务并行处理数量阈值;
    按照事务的排序顺序及对应的事务并行处理数量阈值,对接收到本地的事务进行分组;
    对每个分组的事务分别进行打包生成对应的事务区块;
    根据事务区块对应的事务的排序,按排序顺序逐个选择对应的事务区块并执行选择的事务区块中的事务。
  3. 如权利要求1所述的电子装置,其特征在于,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。
  4. 如权利要求2所述的电子装置,其特征在于,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或 者等于对应的事务并行处理数量阈值。
  5. 如权利要求3所述的电子装置,其特征在于,在所述步骤A之前,所述处理器还用于执行所述区块链事务区块处理系统,以实现以下步骤:
    分析是否有数据节点同时属于多个区块链;
    若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同。
  6. 如权利要求4所述的电子装置,其特征在于,在所述步骤A之前,所述处理器还用于执行所述区块链事务区块处理系统,以实现以下步骤:
    分析是否有数据节点同时属于多个区块链;
    若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同。
  7. 如权利要求5或6所述的电子装置,其特征在于,还包括:
    若该数据节点所属的一个区块链的共识节点缓存的事务数量大于或者等于第二阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值提高第三预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值提高第四预设值,所述第三预设值与所述第四预设值相同或者不同,所述第二阈值大于或者等于所述第一阈值。
  8. 一种区块链事务区块处理方法,其特征在于,所述区块链事务区块处理方法包括:
    步骤一、区块链的数据节点通过预设请求机制向所述区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到所述数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存;
    步骤二、每个所述数据节点根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
  9. 如权利要求8所述的区块链事务区块处理方法,其特征在于,所述步骤二包括:
    根据各个所述数据节点的硬件属性数据,确定各个所述数据节点对应的事务并行处理数量阈值;
    各个所述数据节点按照事务的排序顺序及对应的事务并行处理数量阈值,对接收到本地的事务进行分组;
    对每个分组的事务分别进行打包生成对应的事务区块;
    各个所述数据节点根据事务区块对应的事务的排序,按排序顺序逐个选择对应的事务区块并执行选择的事务区块中的事务。
  10. 如权利要求8所述的区块链事务区块处理方法,其特征在于,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。
  11. 如权利要求9所述的区块链事务区块处理方法,其特征在于,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。
  12. 如权利要求10所述的区块链事务区块处理方法,其特征在于,所述 预设请求机制为长轮询请求机制,所述步骤一之前,该方法还包括:
    分析是否有数据节点同时属于多个区块链;
    若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同。
  13. 如权利要求11所述的区块链事务区块处理方法,其特征在于,所述预设请求机制为长轮询请求机制,所述步骤一之前,该方法还包括:
    分析是否有数据节点同时属于多个区块链;
    若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同。
  14. 如权利要求12或13所述的区块链事务区块处理方法,其特征在于,该方法还包括:
    若该数据节点所属的一个区块链的共识节点缓存的事务数量大于或者等于第二阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值提高第三预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值提高第四预设值,所述第三预设值与所述第四预设值相同或者不同,所述第二阈值大于或者等于所述第一阈值。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有区块链事务区块处理系统,所述区块链事务区块处理系统被处理器执行时实现如下步骤:
    A、通过预设请求机制向区块链的共识节点发起事务接收请求,将所述共识节点中排序好的事务接收到数据节点本地;其中,所述共识节点中预先收集所有的事务并排序,将排序好的事务缓存;
    B、根据预设规则将接收到本地的事务打包成一个或多个事务区块,并根据事务区块中对应的事务的排序,按排序顺序逐个选择事务区块并执行选择的事务区块中的事务。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述区块链事务区块处理系统被所述处理器执行实现所述步骤B时,具体包括:
    根据各个所述数据节点的硬件属性数据,确定各个所述数据节点对应的事务并行处理数量阈值;
    按照事务的排序顺序及对应的事务并行处理数量阈值,对接收到本地的事务进行分组;
    对每个分组的事务分别进行打包生成对应的事务区块;
    根据事务区块对应的事务的排序,按排序顺序逐个选择对应的事务区块并执行选择的事务区块中的事务。
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述预设请求机制为长轮询请求机制,各个所述数据节点对应的轮询获取事务数量的上限值大于或者等于对应的事务并行处理数量阈值。
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,在所述步 骤A之前,所述处理器还用于执行所述区块链事务区块处理系统,以实现以下步骤:
    分析是否有数据节点同时属于多个区块链;
    若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同;若该数据节点所属的一个区块链的共识节点缓存的事务数量大于或者等于第二阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值提高第三预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值提高第四预设值,所述第三预设值与所述第四预设值相同或者不同,所述第二阈值大于或者等于所述第一阈值。
  20. 如权利要求18所述的计算机可读存储介质,其特征在于,在所述步骤A之前,所述处理器还用于执行所述区块链事务区块处理系统,以实现以下步骤:
    分析是否有数据节点同时属于多个区块链;
    若有数据节点同时属于多个区块链,则分析该数据节点所属的各个区块链的共识节点缓存的事务数量的大小;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量小于第一阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值降低第一预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值降低第二预设值,该第一预设值与该第二预设值相同或者不同;
    若该数据节点所属的一个区块链的共识节点缓存的事务数量大于或者 等于第二阈值,则将该数据节点针对所属的该区块链的轮询获取事务数量的上限值提高第三预设值,并将该数据节点针对所属的该区块链的事务并行处理数量阈值提高第四预设值,所述第三预设值与所述第四预设值相同或者不同,所述第二阈值大于或者等于所述第一阈值。
PCT/CN2018/075880 2017-12-13 2018-02-08 区块链事务区块处理方法、电子装置及可读存储介质 WO2019114128A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711323460.8A CN107992356B (zh) 2017-12-13 2017-12-13 区块链事务区块处理方法、电子装置及可读存储介质
CN201711323460.8 2017-12-13

Publications (1)

Publication Number Publication Date
WO2019114128A1 true WO2019114128A1 (zh) 2019-06-20

Family

ID=62037450

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/075880 WO2019114128A1 (zh) 2017-12-13 2018-02-08 区块链事务区块处理方法、电子装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN107992356B (zh)
WO (1) WO2019114128A1 (zh)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535661A (zh) * 2019-09-03 2019-12-03 中国建设银行股份有限公司 基于区块链的业务处理方法、装置、电子设备和存储介质
CN110555017A (zh) * 2019-07-25 2019-12-10 深圳壹账通智能科技有限公司 区块链数据清理方法、装置、计算机设备和存储介质
CN110598060A (zh) * 2019-09-18 2019-12-20 广东卓启投资有限责任公司 一种区块链快速共识方法、装置、计算机设备和存储介质
CN110619582A (zh) * 2019-09-18 2019-12-27 深圳前海微众银行股份有限公司 区块链交易方法、装置、设备及计算机存储介质
CN111177258A (zh) * 2019-12-13 2020-05-19 浙商银行股份有限公司 一种基于区块链平台的自适应配置交易打包方法
CN111262921A (zh) * 2020-01-13 2020-06-09 北京百度网讯科技有限公司 基于区块链网络的应用请求处理方法、装置、设备和介质
CN111506783A (zh) * 2020-04-08 2020-08-07 百度在线网络技术(北京)有限公司 区块链中事务请求处理方法、装置、设备和介质
CN112491983A (zh) * 2020-11-13 2021-03-12 南方科技大学 基于区块链的智能合约调度方法、装置、设备及存储介质
CN112613861A (zh) * 2020-12-18 2021-04-06 国网浙江省电力有限公司嘉兴供电公司 一种基于联盟链的电力预售交易方法、装置及系统
CN112712371A (zh) * 2020-12-30 2021-04-27 东软集团股份有限公司 联盟链系统及用于联盟链系统的方法
CN113409047A (zh) * 2021-08-18 2021-09-17 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、设备及可读存储介质

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471755A (zh) * 2018-05-09 2019-11-19 厦门本能管家科技有限公司 一种多进程打块方法及系统
CN108776897B (zh) * 2018-06-05 2020-04-21 腾讯科技(深圳)有限公司 数据处理方法、装置、服务器及计算机可读存储介质
CN108898368B (zh) * 2018-06-07 2021-05-14 腾讯科技(深圳)有限公司 资源的转移方法和装置、存储介质、电子装置
CN109165092B (zh) * 2018-07-10 2021-07-20 矩阵元技术(深圳)有限公司 一种基于有效算力贡献的共识方法、装置及系统
CN109086388B (zh) * 2018-07-26 2020-12-29 百度在线网络技术(北京)有限公司 区块链数据存储方法、装置、设备及介质
CN109241181A (zh) 2018-08-08 2019-01-18 北京百度网讯科技有限公司 数据库操作方法和装置
CN109639751B (zh) * 2018-10-16 2021-12-21 平安科技(深圳)有限公司 区块链节点监控方法、装置、系统及计算机存储介质
CN109614206A (zh) * 2018-10-25 2019-04-12 深圳壹账通智能科技有限公司 区块链事务处理的装置、方法及存储介质
CN109684050B (zh) * 2018-12-06 2021-02-19 成都佰纳瑞信息技术有限公司 一种并行化事务执行器的使用方法
CN109710387B (zh) * 2018-12-06 2020-12-15 成都佰纳瑞信息技术有限公司 一种用于区块链事务优先级排序的策略引擎及其使用方法
CN110245006B (zh) * 2019-05-07 2023-05-02 深圳壹账通智能科技有限公司 区块链事务的处理方法、装置、设备及存储介质
CN110266763B (zh) * 2019-05-20 2022-04-12 深圳壹账通智能科技有限公司 跨网段互连的区块链网络实现方法、系统及存储介质
CN110460634B (zh) * 2019-07-02 2020-10-27 特斯联(北京)科技有限公司 边缘计算共识请求管理方法和系统
CN110753028B (zh) * 2019-09-11 2021-06-22 复旦大学 一种控制分布式记账网络资源使用方法
CN111241061B (zh) * 2020-01-09 2023-04-07 平安科技(深圳)有限公司 状态数据库的写入方法、数据处理装置及存储介质
CN112039987B (zh) * 2020-08-28 2022-05-20 平安科技(深圳)有限公司 区块链中区块的处理方法、装置、节点设备及存储介质
CN111984733A (zh) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 基于区块链的数据传输方法、装置及存储介质
CN111988432A (zh) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 区块链交易事务处理方法、装置、电子设备及存储介质
CN111930847B (zh) * 2020-09-16 2021-01-08 深圳壹账通智能科技有限公司 基于区块链的数据处理方法、装置及存储介质
CN112540985B (zh) * 2020-12-07 2023-09-26 江苏赛融科技股份有限公司 基于分布式计算框架的全局排序输出系统及其方法
CN113112359A (zh) * 2021-03-16 2021-07-13 卓尔智联(武汉)研究院有限公司 一种联盟链共识达成方法、装置及存储介质
CN114979148B (zh) * 2022-06-16 2023-07-14 中国联合网络通信集团有限公司 数据传输方法、装置及计算机可读存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040582A (zh) * 2017-02-17 2017-08-11 阿里巴巴集团控股有限公司 一种数据处理方法及装置
CN107395665A (zh) * 2017-05-22 2017-11-24 阿里巴巴集团控股有限公司 一种区块链业务受理及业务共识方法及装置
CN107450979A (zh) * 2017-03-28 2017-12-08 阿里巴巴集团控股有限公司 一种区块链共识方法及装置

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677751B (zh) * 2012-09-06 2016-12-21 阿里巴巴集团控股有限公司 任务并行处理方法和装置
CN102929707B (zh) * 2012-11-06 2015-10-07 无锡江南计算技术研究所 并行任务动态分配方法
CN105808339B (zh) * 2014-12-29 2019-05-17 华为技术有限公司 大数据并行计算方法及装置
US10515409B2 (en) * 2016-03-23 2019-12-24 Domus Tower, Inc. Distributing work load of high-volume per second transactions recorded to append-only ledgers
US10304143B2 (en) * 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
CN105573828B (zh) * 2015-12-17 2019-04-12 布比(北京)网络技术有限公司 一种操作处理方法及装置
CN106656974B (zh) * 2016-10-17 2019-07-16 江苏通付盾科技有限公司 区块链的分组共识方法及系统
CN106874087A (zh) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 一种区块链智能合约定时任务调度方法
CN113282659A (zh) * 2017-03-28 2021-08-20 创新先进技术有限公司 一种基于区块链的数据处理方法及设备
CN107391527B (zh) * 2017-03-28 2020-03-27 创新先进技术有限公司 一种基于区块链的数据处理方法及设备
CN107360206B (zh) * 2017-03-29 2020-03-27 创新先进技术有限公司 一种区块链共识方法、设备及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107040582A (zh) * 2017-02-17 2017-08-11 阿里巴巴集团控股有限公司 一种数据处理方法及装置
CN107450979A (zh) * 2017-03-28 2017-12-08 阿里巴巴集团控股有限公司 一种区块链共识方法及装置
CN107395665A (zh) * 2017-05-22 2017-11-24 阿里巴巴集团控股有限公司 一种区块链业务受理及业务共识方法及装置

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555017A (zh) * 2019-07-25 2019-12-10 深圳壹账通智能科技有限公司 区块链数据清理方法、装置、计算机设备和存储介质
CN110535661B (zh) * 2019-09-03 2022-10-11 中国建设银行股份有限公司 基于区块链的业务处理方法、装置、电子设备和存储介质
CN110535661A (zh) * 2019-09-03 2019-12-03 中国建设银行股份有限公司 基于区块链的业务处理方法、装置、电子设备和存储介质
CN110598060A (zh) * 2019-09-18 2019-12-20 广东卓启投资有限责任公司 一种区块链快速共识方法、装置、计算机设备和存储介质
CN110619582A (zh) * 2019-09-18 2019-12-27 深圳前海微众银行股份有限公司 区块链交易方法、装置、设备及计算机存储介质
CN110619582B (zh) * 2019-09-18 2023-07-14 深圳前海微众银行股份有限公司 区块链交易方法、装置、设备及计算机存储介质
CN111177258A (zh) * 2019-12-13 2020-05-19 浙商银行股份有限公司 一种基于区块链平台的自适应配置交易打包方法
CN111177258B (zh) * 2019-12-13 2021-05-18 浙商银行股份有限公司 一种基于区块链平台的自适应配置交易打包方法
CN111262921A (zh) * 2020-01-13 2020-06-09 北京百度网讯科技有限公司 基于区块链网络的应用请求处理方法、装置、设备和介质
CN111506783A (zh) * 2020-04-08 2020-08-07 百度在线网络技术(北京)有限公司 区块链中事务请求处理方法、装置、设备和介质
CN111506783B (zh) * 2020-04-08 2023-12-22 百度在线网络技术(北京)有限公司 区块链中事务请求处理方法、装置、设备和介质
CN112491983A (zh) * 2020-11-13 2021-03-12 南方科技大学 基于区块链的智能合约调度方法、装置、设备及存储介质
CN112613861A (zh) * 2020-12-18 2021-04-06 国网浙江省电力有限公司嘉兴供电公司 一种基于联盟链的电力预售交易方法、装置及系统
CN112613861B (zh) * 2020-12-18 2024-02-02 国网浙江省电力有限公司嘉兴供电公司 一种基于联盟链的电力预售交易方法、装置及系统
CN112712371A (zh) * 2020-12-30 2021-04-27 东软集团股份有限公司 联盟链系统及用于联盟链系统的方法
CN113409047A (zh) * 2021-08-18 2021-09-17 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN107992356B (zh) 2021-09-14
CN107992356A (zh) 2018-05-04

Similar Documents

Publication Publication Date Title
WO2019114128A1 (zh) 区块链事务区块处理方法、电子装置及可读存储介质
US11580107B2 (en) Bucket data distribution for exporting data to worker nodes
JP5744707B2 (ja) メモリ使用量照会ガバナのためのコンピュータ実装方法、コンピュータ・プログラム、およびシステム(メモリ使用量照会ガバナ)
US20110264704A1 (en) Methods and Systems for Deleting Large Amounts of Data From a Multitenant Database
JP2014123365A (ja) MapReduceフレームワークにおけるデータ処理の最適化のためのデバイスおよび方法
US7860822B1 (en) Distributed aggregation mapping
US11836067B2 (en) Hyper-converged infrastructure (HCI) log system
WO2021114877A1 (zh) 缺失号码检测方法、装置、电子设备及存储介质
WO2022267769A1 (zh) 图数据生成的方法及装置
WO2017157111A1 (zh) 防止内存数据丢失的的方法、装置和系统
CN113360321B (zh) 微服务重试调用方法、装置、电子设备及存储介质
CN109614411B (zh) 数据存储方法、设备和存储介质
CN112256472B (zh) 分布式数据调取方法、装置、电子设备及存储介质
WO2022142008A1 (zh) 数据处理方法、装置、电子设备及存储介质
US11489731B2 (en) Techniques and architectures for efficient allocation of under-utilized resources
CN107391541A (zh) 一种实时数据合并方法和装置
CN114675976B (zh) 基于kubernetes的GPU共享方法、装置、设备及介质
CN113590703B (zh) Es数据导入方法、装置、电子设备及可读存储介质
CN107453950B (zh) 一种信息处理方法及监控系统
CN115269523A (zh) 基于人工智能的文件存储与查询方法及相关设备
WO2022160443A1 (zh) 谱系挖掘方法、装置、电子设备及计算机可读存储介质
CN116304079A (zh) 基于时序的图谱数据管理方法、设备和可读存储介质
WO2023173551A1 (zh) 短地址生成方法、装置、电子设备及计算机可读存储介质
WO2018196459A1 (zh) 一种下载请求处理方法、装置、处理设备及介质
WO2021104100A1 (zh) Cdn中url刷新方法、装置、设备以及cdn节点

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18888770

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 20.10.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18888770

Country of ref document: EP

Kind code of ref document: A1