WO2021052098A1 - Blockchain transaction method, apparatus and device, and computer readable storage medium - Google Patents

Blockchain transaction method, apparatus and device, and computer readable storage medium Download PDF

Info

Publication number
WO2021052098A1
WO2021052098A1 PCT/CN2020/110266 CN2020110266W WO2021052098A1 WO 2021052098 A1 WO2021052098 A1 WO 2021052098A1 CN 2020110266 W CN2020110266 W CN 2020110266W WO 2021052098 A1 WO2021052098 A1 WO 2021052098A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
block
transaction volume
volume
packaging
Prior art date
Application number
PCT/CN2020/110266
Other languages
French (fr)
Chinese (zh)
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 WO2021052098A1 publication Critical patent/WO2021052098A1/en

Links

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the technical field of financial technology (Fintech), in particular to blockchain transaction methods, devices, equipment, and computer-readable storage media.
  • the operating environment of the blockchain is not stable, and it is possible It will cause the configuration parameters to be configured through the configuration method to be too large or too small, thereby affecting the overall transaction effect. Therefore, how to improve the efficiency of block transactions without affecting the normal transactions of block nodes in the block chain has become a technical problem that needs to be solved urgently.
  • the main purpose of this application is to propose a blockchain transaction method, device, equipment and computer-readable storage medium, aiming to improve the usability of task execution.
  • this application provides a blockchain transaction method, which includes the following steps:
  • the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and whether the current block packaging transaction volume is detected Equal to the maximum transaction volume of the block;
  • block chain transactions are performed based on the current block packaging transaction volume.
  • the step of increasing the block packaging transaction volume to obtain the current block packaging transaction volume includes:
  • the step of obtaining the current block packaging transaction volume based on the incremental block packaging transaction volume includes:
  • the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume.
  • the step of increasing the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain the current block packaging transaction volume includes:
  • the step of sequentially performing timeout detection on the packaged transaction volume of each of the sub-blocks includes:
  • the step of obtaining the current block packaging transaction volume based on the maximum untimed transaction volume includes:
  • the transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
  • the step of detecting whether the current block packaging transaction volume is greater than the block maximum transaction packaging volume includes:
  • this application also provides a block chain transaction device, the block chain transaction device includes:
  • the obtaining module is configured to perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
  • the detection module is configured to, if the block packaging transaction volume is less than the preset quick start threshold, increment the block packaging transaction volume to obtain the current block packaging transaction volume, and detect the current block Whether the packaged transaction volume is equal to the maximum transaction packaged volume of the block;
  • the transaction module is configured to perform a blockchain transaction based on the current block packaging transaction volume if the current block packaging transaction volume is equal to the block maximum transaction packaging volume.
  • the present application also provides a blockchain transaction device, the blockchain transaction device comprising: a memory, a processor, and an area stored on the memory and capable of running on the processor.
  • a block chain transaction program when the block chain transaction program is executed by the processor, the steps of the block chain transaction method as described above are realized.
  • the present application also provides a computer-readable storage medium with a blockchain transaction program stored on the computer-readable storage medium.
  • the blockchain transaction program is executed by a processor to achieve the above The steps of the blockchain transaction method described.
  • the transaction information submitted by the client is packaged by consensus to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than the preset quick start threshold; if the block packaged transaction volume is less than the pre-determined Set the quick start threshold, the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and it is detected whether the current block packaging transaction volume is equal to the block maximum transaction packaging volume; The current block packaging transaction volume is equal to the block maximum transaction packaging volume, and then blockchain transactions are performed based on the current block packaging transaction volume.
  • the block packaged transaction volume By obtaining the block packaged transaction volume corresponding to the transaction information, and when the block packaged transaction volume is less than the quick start threshold, the block packaged transaction volume is incremented to obtain the current block packaged transaction volume and package it in the current block
  • the transaction volume is equal to the maximum transaction packaging volume of the block
  • blockchain transactions are performed according to the current block packaging transaction volume, thereby ensuring that the block transaction efficiency is improved without affecting the normal transactions of the block nodes in the blockchain. This avoids the phenomenon that the existing technology uses configuration methods to perform block transactions to limit the block transaction volume.
  • FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application
  • Figure 2 is a schematic flowchart of the first embodiment of the blockchain transaction method of the application
  • Figure 3 is a schematic diagram of the device modules of the blockchain transaction device of the application.
  • Figure 4 is a schematic diagram of the blockchain transaction process in the application for the blockchain transaction method
  • Fig. 5 is a schematic diagram of the increasing trend of block packaged transaction volume in the blockchain transaction method of the application.
  • FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
  • the blockchain transaction device in the embodiment of the present application may be a PC or a server device.
  • the blockchain transaction device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is configured to implement connection and communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a magnetic disk memory.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a blockchain transaction program.
  • the network interface 1004 is mainly configured to connect to the back-end server and communicate with the back-end server;
  • the user interface 1003 is mainly configured to connect to the client (user side) and communicate with the client;
  • the processor 1001 can be configured to call a blockchain transaction program stored in the memory 1005, and perform operations in the following blockchain transaction method.
  • Fig. 2 is a schematic flowchart of a first embodiment of a blockchain transaction method according to this application. The method includes:
  • Step S10 Perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
  • Consensus packaging can be transaction packaging through a consensus algorithm in the blockchain.
  • Blockchain is a distributed storage system that is maintained and trusted by multiple nodes.
  • the bottom layer of the blockchain is a chain composed of a series of blocks.
  • each block also records the hash value of the previous block. In this way, a chained data structure is formed.
  • Each node in the blockchain peer-to-peer network confirms a batch of transactions through an algorithm and ensures that all nodes have a consistent confirmation result for this batch of data.
  • This algorithm is the consensus algorithm of the blockchain.
  • Block packaging is in the blockchain, and any operation (deploy contract, call contract interface, etc.) is carried out by sending transactions. The transaction is initiated by the user and sent to the blockchain node through the client.
  • Consensus nodes are nodes that can participate in consensus block generation.
  • the main functions include: packaging transactions in the transaction pool; executing transactions; running consensus algorithms and writing consensus blocks into the ledger.
  • the block packaging transaction volume can be the transaction volume that can be packaged by the block.
  • the initial value can be configured by yourself. Generally, the default value is 100.
  • the algorithm dynamically adjusts it later.
  • the consensus algorithm uses this value to determine the current block package transaction volume.
  • the fast-start threshold can be the threshold of the fast-start phase.
  • the default value is generally half of the maximum transaction volume of the block. It will be dynamically adjusted according to the block execution in the follow-up. When the current block package transaction number is less than this value, the algorithm works at In the quick start phase, when it is greater than or equal to, it works in the overtime avoidance phase.
  • the transaction packaging process needs to obtain the maximum transaction volume that can be packaged in the block from the dynamic adjustment module, and then load the transaction from the transaction pool.
  • the execution time, time consumption, and transaction volume of the block need to be changed.
  • Information such as normal block execution or block execution timeout is called back to the dynamic adjustment module, and the dynamic adjustment module adjusts the transaction volume that the block can pack in the next round of consensus based on the callback information. Therefore, after obtaining the block packaging transaction volume, it is necessary to determine whether the block packaging transaction volume is less than the preset quick start threshold, and perform different operations according to the determination result.
  • Step S20 If it is determined that the block packaging transaction volume is less than the preset quick start threshold, the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and the current block packaging transaction volume is detected Whether the transaction volume is greater than the maximum transaction package volume of the block;
  • the block package transaction volume When it is judged that the block package transaction volume is less than the preset quick start threshold, it enters the quick start phase, which is the initial working phase of the dynamic adjustment algorithm.
  • the dynamic adjustment module does not have enough information to predict the transaction processing of the blockchain Therefore, the transaction processing capacity of the blockchain can be determined by adjusting the block packaging transaction volume, and since the initial value of the block packaging transaction volume is very small, the block packaging transaction volume can be increased in an exponential manner. Increment processing, and when the block package transaction volume after increment processing is greater than or equal to the quick start threshold, exit the quick start phase and enter the timeout avoidance phase.
  • the transaction volume of the block package exceeds the rapidly increasing threshold, and the possibility of block execution timeout occurring is relatively fast in the start phase.
  • the possibility of block execution timeout has greatly increased, so the growth rate needs to be reduced.
  • the size of the block packaging transaction volume is increased according to the configured rate (such as the transaction volume increase rate), and may also time out after the timeout avoidance phase increases to a certain extent, that is, when a timeout phenomenon is found, the priority is given to the processing of the timeout (ie Timeout processing stage), after adjusting the parameters, continue to the next timeout avoidance stage.
  • the consensus module block transaction timeout occurs, indicating that the transaction volume has increased too much, which has exceeded the transaction processing load capacity of the current blockchain.
  • the block package transaction volume and the quick start threshold are set to the maximum Timeout transaction volume, and the quick start threshold is not greater than the minimum timeout transaction volume, and then enter the timeout avoidance phase again.
  • the current block packaged transaction volume is obtained, and check whether the current block packaged transaction volume is equal to the block maximum transaction package volume. Perform different operations based on different detection results.
  • the transaction volume increase rate can be the rate at which the packaged transaction volume increases during the timeout avoidance phase.
  • the initial value is configurable, and the default value is 0.1.
  • the maximum untimed transaction volume may be the maximum transaction volume value of the block package that has been executed currently without a timeout.
  • the minimum timeout transaction volume can be the minimum transaction volume value of the block that has been executed that has timed out.
  • the maximum transaction volume of a block is the maximum transaction volume that can be packaged in a block, and the dynamic adjustment algorithm adjusts the limit value of the block package transaction volume.
  • step S30 if it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume, block chain transactions are performed based on the current block packaging transaction volume.
  • the current block packaging transaction volume When it is judged that the current block packaging transaction volume is equal to the block's maximum transaction packaging volume, it can be considered that the current block packaging transaction volume has reached the maximum value that the block can execute transactions. At this point, you can directly perform blockchain transactions according to the current block packaging transaction volume.
  • the current block packaging transaction volume When the current block packaging transaction volume is found to be less than the block maximum transaction packaging volume after judgment, the current block packaging transaction volume will continue to be increased until the current block packaging transaction volume is equal to the block maximum transaction packaging volume. However, when the current block packaged transaction volume is greater than the block's maximum transaction package volume, the current block node may be faulty.
  • the transaction pool when the client submits a transaction to the transaction pool of the blockchain node, the transaction pool will load the transaction into the consensus module and execute the block through the block executor, that is, through the consensus module Consensus packaging, after reaching a consensus, the block will be chained, that is, the transaction information will be transferred to the block chain. And after uploading the transaction information to the blockchain, the block's execution time, time-consuming, transaction volume and other information will be called back to the dynamic adjustment module through the network module, so that the dynamic adjustment module can adjust the next block according to the block execution feedback information.
  • Round consensus block package transaction volume that is, the dynamic adjustment module needs to obtain the next round of block package transaction volume.
  • consensus packaging transaction when the consensus packaging transaction is carried out, consensus message interaction will be carried out through the network module to ensure that the transaction information can be successfully uploaded to the blockchain.
  • the transaction information submitted by the client is packaged by consensus to obtain the block package transaction volume, and it is determined whether the block package transaction volume is less than the preset quick start threshold;
  • the block packaged transaction volume is incremented to obtain the current block packaged transaction volume, and check whether the current block packaged transaction volume is equal to the block maximum transaction packaged volume; if it is equal to, the packaged transaction volume is based on the current block The amount of blockchain transactions.
  • the block packaged transaction volume By obtaining the block packaged transaction volume corresponding to the transaction information, and when the block packaged transaction volume is less than the quick start threshold, the block packaged transaction volume is incremented to obtain the current block packaged transaction volume and package it in the current block
  • the transaction volume is equal to the maximum transaction packaging volume of the block
  • blockchain transactions are performed according to the current block packaging transaction volume, thereby ensuring that the block transaction efficiency is improved without affecting the normal transactions of the block nodes in the blockchain. This avoids the phenomenon that the existing technology uses configuration methods to perform block transactions to limit the block transaction volume.
  • step S20 of the first embodiment of the present application The step of increasing the block packaging transaction volume to obtain the current block packaging transaction volume is refined, including:
  • Step a Obtain a preset processing method, and perform incremental processing on the block packaging transaction volume according to the preset processing method to obtain an incremental block packaging transaction volume;
  • the preset processing method may be a method for increasing the block packaging transaction volume stored in advance by the user, for example, increasing according to a certain ratio. Therefore, in this embodiment, when the block packaging transaction volume needs to be adjusted, the block packaging transaction volume can be increased through a preset processing method (such as exponential increase) to obtain the incremental block packaging transaction volume.
  • the incremental block packaging transaction volume may be the current block packaging transaction volume after the increase is performed using a preset processing method.
  • Step b Obtain the current block packaging transaction volume based on the incremental block packaging transaction volume.
  • the incremental block packaging transaction volume When the incremental block packaging transaction volume is obtained, the incremental block packaging transaction volume can be compared with the quick start threshold, and the current block packaging transaction can be determined according to the comparison result.
  • the block packaging transaction volume is incrementally processed according to a preset processing method, and the current block packaging transaction volume is obtained according to the incremental block packaging transaction volume after the incremental processing, thereby ensuring the current obtained The accuracy of the block package transaction volume.
  • the step of obtaining the current block packaging transaction volume based on the incremental block packaging transaction volume includes:
  • Step b1 judging whether the incremental block packaging transaction volume is greater than or equal to the quick start threshold
  • the incremental block packaging transaction volume When the incremental block packaging transaction volume is obtained, it is also necessary to determine whether the incremental block packaging transaction volume is greater than or equal to the fast start threshold; if it is greater than or equal to, the fast start phase of the block packaging transaction volume can be considered to be completed and it is necessary to enter The timeout avoidance phase is to avoid incrementing the block package transaction volume to exceed the processing load capacity of the blockchain. However, if the incremental block packaging transaction volume is less than the quick start threshold, you can continue to increase the incremental block packaging transaction volume according to the preset processing method until the new incremental block packaging transaction volume is greater than or equal to the quick start Threshold.
  • Step b2 If it is determined that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume .
  • the preset transaction volume increase rate needs to be obtained, and the incremental block packaging transaction volume is increased according to the transaction volume increase rate until the obtained
  • the incremental block packaging transaction volume is equal to the maximum transaction packaging volume of the block, and the incremental block packaging transaction volume is increased according to the preset transaction volume increase rate, and the incremental block packaging that has been increased at the current moment is obtained
  • the transaction volume can be used as the current block package transaction volume. It should be noted that, in order to avoid the occurrence of ultrasonic phenomenon when the block packaging transaction volume is used for transactions, the increase rate of the block packaging transaction volume in the fast start phase is greater than that in the timeout avoiding phase, and the incremental block is packaged according to the transaction volume increase rate.
  • the rate at which the transaction volume increases processing is much greater than the rate at which the incremental block packaged transaction volume is increased according to the preset transaction volume increase rate.
  • the growth rate of the block packaged transaction volume during the fast start phase is significantly less than that of the block packaged transaction volume greater than or equal to the fast start threshold during the timeout avoidance phase. .
  • the increase processing is performed according to the preset transaction volume increase rate to obtain the current block packaging transaction volume, thereby ensuring the obtained The accuracy of the current block package transaction volume.
  • the step of processing the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain the current block packaging transaction volume includes:
  • Step f Performing an increase process on the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain multiple sub-block packaging transaction volumes, and performing timeout detection on each sub-block packaging transaction volume in turn;
  • the sub-block package transaction volume is the package transaction volume of the incremental block through the transaction volume increase rate After the increase processing, the block package transaction volume at a certain moment), and after obtaining the package transaction volume of each sub-block, it is necessary to perform timeout detection on each sub-block package transaction volume in turn to determine whether there is a timeout phenomenon. , And perform different operations based on the results of each timeout detection.
  • Step g if it is determined that there is a sub-block packaged transaction volume that fails overtime detection in each sub-block packaged transaction volume, then determine the maximum untimed transaction volume in each of the sub-block packaged transaction volume, and based on The maximum untimed transaction volume obtains the current block packaging transaction volume.
  • the maximum untimed transaction volume may be the maximum transaction volume value of the block package that has been executed currently without a timeout.
  • the minimum timeout transaction volume can be the minimum transaction volume value of the block that has been executed that has timed out.
  • the packaged transaction volume of each sub-block generated after the increase process is tested for timeout, and when it is determined that the timeout detection fails, the maximum untimed transaction volume is obtained, and the maximum untimed transaction volume is obtained according to the maximum untimed transaction volume.
  • the current block packaging transaction volume ensures the accuracy of the obtained current block packaging transaction volume.
  • the step of sequentially performing timeout detection on the packaged transaction volume of each of the sub-blocks includes:
  • Step h Obtain the time period between the sending time of each sub-block packaged transaction volume from the block node to the blockchain and the feedback time of receiving the feedback information of the blockchain, and Determine whether there is a target time period that does not match the preset time period in the time period;
  • the timeout detection of the packaged transaction volume of each sub-block is performed in turn. Since the packaged transaction volume of the sub-block is uploaded to the blockchain, a feedback message will be returned to the node of the block where the packaged transaction volume of the sub-block is located, so each sub-area can be obtained in turn.
  • the time period between the time when the block package transaction volume is sent from the block node to the blockchain and the feedback time when the feedback information of the blockchain is received, and the existence and preset time period can be determined in each time period (user The set block chain normal transaction upload block chain time) does not match the target time period, and then perform different operations based on the determination result.
  • step k if it is determined that there is a target time period that does not match the preset time period, it is determined that the overtime detection of the sub-block packaging transaction volume corresponding to the target time period is unqualified.
  • this time period can be used as the target time period, and then the sub-block package transaction volume corresponding to the target time period can be determined. It is determined that the timeout detection of the sub-block packaged transaction volume corresponding to the target time period is unqualified, and the timeout processing stage needs to be entered. However, if there is no target time period that does not match the preset time period in each time period, the increase processing can be continued.
  • the step of obtaining the current block packaging transaction volume based on the maximum untimed transaction volume includes:
  • Step x Adjust the transaction volume increase rate, and increase the maximum untimed transaction volume based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
  • the transaction volume increase rate needs to be adjusted, and the maximum untimed transaction volume is increased according to the adjusted transaction increase rate to obtain the increased transaction The current block package transaction volume.
  • the transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased according to the adjusted transaction volume increase rate to obtain the current block packaged transaction volume, thereby ensuring the current obtained The accuracy of the block package transaction volume.
  • the method includes:
  • Step y if it is determined that the current block packaged transaction volume is less than the block maximum transaction package volume, continue to increase the current block packaged transaction volume according to the adjusted transaction increase rate until the current block The block packaging transaction volume is greater than or equal to the block maximum transaction packaging volume.
  • the current block packaging transaction volume can be increased according to the adjusted transaction increase rate until the current block packaging transaction volume is greater than or equal to the area Only when the maximum transaction volume of the block is reached, the increase processing operation is stopped.
  • the current block packaged transaction volume is increased according to the adjusted transaction increase rate, thereby increasing the block transaction volume effectiveness.
  • the block chain transaction device includes:
  • the obtaining module is configured to perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
  • the detection module is configured to, if it is determined that the block packaging transaction volume is less than the preset quick start threshold, increment the block packaging transaction volume to obtain the current block packaging transaction volume, and detect the current area Whether the block packaging transaction volume is equal to the maximum transaction packaging volume of the block;
  • the transaction module is configured to perform a blockchain transaction based on the current block packaging transaction volume if it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume.
  • the detection module is further configured to:
  • the detection module is further configured to:
  • the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume.
  • the detection module is further configured to:
  • the maximum untimed transaction volume is determined in each sub-block packaged transaction volume, and the maximum transaction volume Untimed transaction volume gets the current block packaged transaction volume.
  • the detection module is further configured to:
  • the detection module is further configured to:
  • the transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
  • the detection module is further configured to:
  • the application also provides a computer-readable storage medium.
  • the computer-readable storage medium of the present application stores a blockchain transaction program, and when the blockchain transaction program is executed by a processor, the steps of the blockchain transaction method as described above are realized.
  • the method implemented when the blockchain transaction program running on the processor is executed can refer to the various embodiments of the blockchain transaction method of this application, which will not be repeated here.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disks, optical disks), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
  • a terminal device which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A blockchain transaction method in the field of Fintech. The method comprises: performing consensus packaging on transaction information submitted by a client to acquire a packaged block transaction amount, and determining whether the packaged block transaction amount is less than a preset quick start threshold; if it is determined that the packaged block transaction amount is less than the preset quick start threshold, performing incremental processing on the packaged block transaction amount so as to acquire the current packaged block transaction amount, and detecting whether the current packaged block transaction amount is equal to the maximum packaged block transaction amount; and if it is determined that the current packaged block transaction amount is equal to the maximum packaged block transaction amount, performing a blockchain transaction on the basis of the current packaged block transaction amount. Further disclosed are a blockchain transaction apparatus and device, and a computer readable storage medium.

Description

区块链交易方法、装置、设备及计算机可读存储介质Block chain transaction method, device, equipment and computer readable storage medium
本申请要求于2019年9月18日申请的、申请号为201910885625.3、名称为“区块链交易方法、装置、设备及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on September 18, 2019, with the application number 201910885625.3, and the name "blockchain transaction methods, devices, equipment, and computer storage media", the entire contents of which are incorporated by reference In this application.
技术领域Technical field
本申请涉及金融科技(Fintech)技术领域,尤其涉及区块链交易方法、装置、设备及计算机可读存储介质。This application relates to the technical field of financial technology (Fintech), in particular to blockchain transaction methods, devices, equipment, and computer-readable storage media.
背景技术Background technique
随着计算机技术的发展,越来越多的技术(大数据、分布式、区块链Blockchain、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,但由于金融行业的安全性、实时性要求,也对技术提出了更高的要求。例如,目前在区块链中,基本上都是通过配置方式为限制区块大小或者区块交易量,使用时通过提起预估的方式给出一个比较合理的初始值,来达到提高区块链交易的效率,但是在实际中单个区块在共识周期内能够执行的交易数量受多个因素的影响,如机器配置,网络因素,节点负载等,因此区块链运行的环境并非稳定,有可能会导致通过配置方式进行配置的配置参数过大或者过小,从而影响到整体交易的效果。因此,如何在不影响区块链中区块节点正常交易的情况下,提高区块交易效率成为目前亟待解决的技术问题。With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field. The traditional financial industry is gradually transforming to Fintech. However, due to financial The industry's security and real-time requirements also place higher requirements on technology. For example, in the current blockchain, basically the configuration method is to limit the block size or the block transaction volume, and a relatively reasonable initial value is given by the estimation method to achieve the improvement of the blockchain. The efficiency of transactions, but in reality, the number of transactions that a single block can execute in the consensus cycle is affected by multiple factors, such as machine configuration, network factors, node load, etc. Therefore, the operating environment of the blockchain is not stable, and it is possible It will cause the configuration parameters to be configured through the configuration method to be too large or too small, thereby affecting the overall transaction effect. Therefore, how to improve the efficiency of block transactions without affecting the normal transactions of block nodes in the block chain has become a technical problem that needs to be solved urgently.
技术解决方案Technical solutions
本申请的主要目的在于提出一种区块链交易方法、装置、设备及计算机可读存储介质,旨在提高任务作业执行的可用性。The main purpose of this application is to propose a blockchain transaction method, device, equipment and computer-readable storage medium, aiming to improve the usability of task execution.
为实现上述目的,本申请提供一种区块链交易方法,所述区块链交易方法包括如下步骤:In order to achieve the above objective, this application provides a blockchain transaction method, which includes the following steps:
对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;Perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
若确定所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;If it is determined that the block packaging transaction volume is less than the preset quick start threshold, the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and whether the current block packaging transaction volume is detected Equal to the maximum transaction volume of the block;
若确定所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。If it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume, block chain transactions are performed based on the current block packaging transaction volume.
在一实施方式中,所述对所述区块打包交易量进行递增处理,以获取当前区块打包交易量的步骤,包括:In one embodiment, the step of increasing the block packaging transaction volume to obtain the current block packaging transaction volume includes:
获取预设的处理方式,并按照所述预设的处理方式对所述区块打包交易量进行递增处理,以获取递增区块打包交易量;Acquiring a preset processing method, and performing incremental processing on the block packaging transaction volume according to the preset processing method to obtain an incremental block packaging transaction volume;
基于所述递增区块打包交易量获取当前区块打包交易量。Obtain the current block packaging transaction volume based on the incremental block packaging transaction volume.
在一实施方式中,所述基于所述递增区块打包交易量获取当前区块打包交易量的步骤,包括:In one embodiment, the step of obtaining the current block packaging transaction volume based on the incremental block packaging transaction volume includes:
判断所述递增区块打包交易量是否大于或等于快速启动阈值;Judging whether the incremental block packaging transaction volume is greater than or equal to the quick start threshold;
若确定所述递增区块打包交易量大于或等于快速启动阈值,则基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量。If it is determined that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume.
在一实施方式中,所述基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量的步骤,包括:In one embodiment, the step of increasing the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain the current block packaging transaction volume includes:
基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取多个子区块打包交易量,并依次对各所述子区块打包交易量进行超时检测;Performing an increase process on the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain multiple sub-block packaging transaction volumes, and performing timeout detection on each sub-block packaging transaction volume in turn;
若确定在各所述子区块打包交易量中存在超时检测不合格的子区块打包交易量,则在各所述子区块打包交易量中确定最大未超时交易量,并基于所述最大未超时交易量获取当前区块打包交易量。If it is determined that there is a sub-block packaged transaction volume that fails overtime detection in each sub-block packaged transaction volume, determine the maximum untimed transaction volume in each of the sub-block packaged transaction volume, and based on the maximum Untimed transaction volume gets the current block packaged transaction volume.
在一实施方式中,所述依次对各所述子区块打包交易量进行超时检测的步骤,包括:In one embodiment, the step of sequentially performing timeout detection on the packaged transaction volume of each of the sub-blocks includes:
依次获取各所述子区块打包交易量从区块节点发送到区块链的发送时间与接收到所述区块链反馈信息的反馈时间之间的时间段,并在各所述时间段中确定是否存在和预设时间段不匹配的目标时间段;Obtain in turn the time period between the sending time of each sub-block packaged transaction volume from the block node to the blockchain and the feedback time of receiving the feedback information of the blockchain, and in each of the time periods Determine whether there is a target time period that does not match the preset time period;
若确定存在和预设时间段不匹配的目标时间段,则确定所述目标时间段对应的子区块打包交易量的超时检测不合格。If it is determined that there is a target time period that does not match the preset time period, it is determined that the overtime detection of the sub-block packaged transaction volume corresponding to the target time period is unqualified.
在一实施方式中,所述基于所述最大未超时交易量获取当前区块打包交易量的步骤,包括:In one embodiment, the step of obtaining the current block packaging transaction volume based on the maximum untimed transaction volume includes:
对所述交易量增加速率进行调整,并基于调整后的所述交易增加速率对所述最大未超时交易量进行增加处理,以获取当前区块打包交易量。The transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
在一实施方式中,所述检测所述当前区块打包交易量是否大于区块最大交易打包量的步骤之后,包括:In an embodiment, after the step of detecting whether the current block packaging transaction volume is greater than the block maximum transaction packaging volume, the step includes:
若确定所述当前区块打包交易量小于区块最大交易打包量,则根据调整后的所述交易增加速率继续对所述当前区块打包交易量进行增加处理,直至所述当前区块打包交易量大于或等于区块最大交易打包量。If it is determined that the current block packaging transaction volume is less than the block maximum transaction packaging volume, continue to increase the current block packaging transaction volume according to the adjusted transaction increase rate until the current block packaging transaction volume The amount is greater than or equal to the maximum transaction volume of the block.
此外,为实现上述目的,本申请还提供一种区块链交易装置,所述区块链交易装置包括:In addition, in order to achieve the above objective, this application also provides a block chain transaction device, the block chain transaction device includes:
获取模块,配置为对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;The obtaining module is configured to perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
检测模块,配置为若所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;The detection module is configured to, if the block packaging transaction volume is less than the preset quick start threshold, increment the block packaging transaction volume to obtain the current block packaging transaction volume, and detect the current block Whether the packaged transaction volume is equal to the maximum transaction packaged volume of the block;
交易模块,配置为若所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。The transaction module is configured to perform a blockchain transaction based on the current block packaging transaction volume if the current block packaging transaction volume is equal to the block maximum transaction packaging volume.
此外,为实现上述目的,本申请还提供一种区块链交易设备,所述区块链交易设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的区块链交易程序,所述区块链交易程序被所述处理器执行时实现如上所述的区块链交易方法的步骤。In addition, in order to achieve the above objective, the present application also provides a blockchain transaction device, the blockchain transaction device comprising: a memory, a processor, and an area stored on the memory and capable of running on the processor. A block chain transaction program, when the block chain transaction program is executed by the processor, the steps of the block chain transaction method as described above are realized.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有区块链交易程序,所述区块链交易程序被处理器执行时实现如上所述的区块链交易方法的步骤。In addition, in order to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium with a blockchain transaction program stored on the computer-readable storage medium. The blockchain transaction program is executed by a processor to achieve the above The steps of the blockchain transaction method described.
本申请通过对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;若所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;若所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。通过获取交易信息对应的区块打包交易量,并在区块打包交易量小于快速启动阈值时,对区块打包交易量进行递增处理,以获当前区块打包交易量,并在当前区块打包交易量等于区块最大交易打包量时,按照当前区块打包交易量进行区块链交易,从而保障了在不影响区块链中区块节点正常交易的情况下,提高了区块交易效率,避免了现有技术采用配置方式进行区块交易限制区块交易量的现象发生。In this application, the transaction information submitted by the client is packaged by consensus to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than the preset quick start threshold; if the block packaged transaction volume is less than the pre-determined Set the quick start threshold, the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and it is detected whether the current block packaging transaction volume is equal to the block maximum transaction packaging volume; The current block packaging transaction volume is equal to the block maximum transaction packaging volume, and then blockchain transactions are performed based on the current block packaging transaction volume. By obtaining the block packaged transaction volume corresponding to the transaction information, and when the block packaged transaction volume is less than the quick start threshold, the block packaged transaction volume is incremented to obtain the current block packaged transaction volume and package it in the current block When the transaction volume is equal to the maximum transaction packaging volume of the block, blockchain transactions are performed according to the current block packaging transaction volume, thereby ensuring that the block transaction efficiency is improved without affecting the normal transactions of the block nodes in the blockchain. This avoids the phenomenon that the existing technology uses configuration methods to perform block transactions to limit the block transaction volume.
附图说明Description of the drawings
图1是本申请实施例方案涉及的硬件运行环境的设备结构示意图;FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application;
图2为本申请区块链交易方法第一实施例的流程示意图;Figure 2 is a schematic flowchart of the first embodiment of the blockchain transaction method of the application;
图3为本申请区块链交易装置的装置模块示意图;Figure 3 is a schematic diagram of the device modules of the blockchain transaction device of the application;
图4为本申请区块链交易方法中区块链交易的流程示意图;Figure 4 is a schematic diagram of the blockchain transaction process in the application for the blockchain transaction method;
图5为本申请区块链交易方法中对区块打包交易量进行增加的趋势示意图。Fig. 5 is a schematic diagram of the increasing trend of block packaged transaction volume in the blockchain transaction method of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
本发明的实施方式Embodiments of the present invention
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the application, and not used to limit the application.
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的设备结构示意图。As shown in FIG. 1, FIG. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
本申请实施例区块链交易设备可以是PC机或服务器设备。The blockchain transaction device in the embodiment of the present application may be a PC or a server device.
如图1所示,该区块链交易设备可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002配置为实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1, the blockchain transaction device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is configured to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a magnetic disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
本领域技术人员可以理解,图1中示出的设备结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the device shown in FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than those shown in the figure, or a combination of certain components, or different component arrangements.
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及区块链交易程序。As shown in FIG. 1, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a blockchain transaction program.
在图1所示的设备中,网络接口1004主要配置为连接后台服务器,与后台服务器进行数据通信;用户接口1003主要配置为连接客户端(用户端),与客户端进行数据通信;而处理器1001可以配置为调用存储器1005中存储的区块链交易程序,并执行下述区块链交易方法中的操作。In the device shown in Figure 1, the network interface 1004 is mainly configured to connect to the back-end server and communicate with the back-end server; the user interface 1003 is mainly configured to connect to the client (user side) and communicate with the client; and the processor 1001 can be configured to call a blockchain transaction program stored in the memory 1005, and perform operations in the following blockchain transaction method.
基于上述硬件结构,提出本申请区块链交易方法实施例。Based on the above hardware structure, an embodiment of the blockchain transaction method of this application is proposed.
参照图2,图2为本申请区块链交易方法第一实施例的流程示意图,所述方法包括:Referring to Fig. 2, Fig. 2 is a schematic flowchart of a first embodiment of a blockchain transaction method according to this application. The method includes:
步骤S10,对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;Step S10: Perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
共识打包可以是在区块链中通过共识算法进行交易打包。区块链是一种由多个节点共同维护的及信任的分布式存储系统。区块链底层是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的哈希值,通过这种方式组成链式的数据结构。而区块链对等网络中的各个节点通过一种算法对一批交易进行确认,并确保所有节点对这批数据具有一致的确认结果,这种算法就是区块链的共识算法。区块打包则是在区块链中,任何操作(部署合约、调用合约接口等)都是通过发送交易的方式进行。交易由用户发起,并通过客户端发送至区块链节点。区块链节点在收到交易后,会将交易打包为区块并执行。共识节点是可参与共识出块的节点,主要功能包括:将交易池内的交易打包;执行交易;运行共识算法,并将达成共识的区块写入账本。区块打包交易量可以是区块能够打包的交易量,初始值可以自行配置,一般默认为100,后续由算法动态调整,共识算法使用该值确定当前区块打包的交易量大小。快速启动阈值可以是快速启动阶段的阈值,默认值一般为区块最大交易打包量的一半,在后续中会根据区块执行情况动态调整,当前区块打包交易数小于该值时,算法工作在快速启动阶段,大于等于时工作在超时避免阶段。Consensus packaging can be transaction packaging through a consensus algorithm in the blockchain. Blockchain is a distributed storage system that is maintained and trusted by multiple nodes. The bottom layer of the blockchain is a chain composed of a series of blocks. In addition to recording the data of this block, each block also records the hash value of the previous block. In this way, a chained data structure is formed. Each node in the blockchain peer-to-peer network confirms a batch of transactions through an algorithm and ensures that all nodes have a consistent confirmation result for this batch of data. This algorithm is the consensus algorithm of the blockchain. Block packaging is in the blockchain, and any operation (deploy contract, call contract interface, etc.) is carried out by sending transactions. The transaction is initiated by the user and sent to the blockchain node through the client. After receiving the transaction, the blockchain node will package the transaction into a block and execute it. Consensus nodes are nodes that can participate in consensus block generation. The main functions include: packaging transactions in the transaction pool; executing transactions; running consensus algorithms and writing consensus blocks into the ledger. The block packaging transaction volume can be the transaction volume that can be packaged by the block. The initial value can be configured by yourself. Generally, the default value is 100. The algorithm dynamically adjusts it later. The consensus algorithm uses this value to determine the current block package transaction volume. The fast-start threshold can be the threshold of the fast-start phase. The default value is generally half of the maximum transaction volume of the block. It will be dynamically adjusted according to the block execution in the follow-up. When the current block package transaction number is less than this value, the algorithm works at In the quick start phase, when it is greater than or equal to, it works in the overtime avoidance phase.
在区块链节点中接收到客户端发送的提交交易,并在共识模块区块执行交易正常时,会回调正常执行的回调接口,动态调整模块根据当前的状态进行动态调整。也就是在共识过程中交易打包流程需要从动态调整模块获取区块能够打包的最大交易量,然后从交易池加载交易,在区块执行完毕后需要将区块的执行时间、耗时、交易量、区块正常执行或者区块执行超时等信息回调给动态调整模块,而动态调整模块会根据回调信息调整下一轮共识时区块能够打包的交易量。因此在获取到区块打包交易量后,需要先确定区块打包交易量是否小于预设的快速启动阈值,并根据确定结果执行不同的操作。When the submitted transaction sent by the client is received in the blockchain node, and the consensus module block executes the transaction normally, it will call back the normally executed callback interface, and the dynamic adjustment module will dynamically adjust according to the current state. That is, in the consensus process, the transaction packaging process needs to obtain the maximum transaction volume that can be packaged in the block from the dynamic adjustment module, and then load the transaction from the transaction pool. After the block is executed, the execution time, time consumption, and transaction volume of the block need to be changed. Information such as normal block execution or block execution timeout is called back to the dynamic adjustment module, and the dynamic adjustment module adjusts the transaction volume that the block can pack in the next round of consensus based on the callback information. Therefore, after obtaining the block packaging transaction volume, it is necessary to determine whether the block packaging transaction volume is less than the preset quick start threshold, and perform different operations according to the determination result.
步骤S20,若确定所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否大于区块最大交易打包量;Step S20: If it is determined that the block packaging transaction volume is less than the preset quick start threshold, the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and the current block packaging transaction volume is detected Whether the transaction volume is greater than the maximum transaction package volume of the block;
当经过判断发现区块打包交易量小于预设的快速启动阈值,则进入快速启动阶段,也就是动态调整算法的初始工作阶段,在此阶段动态调整模块没有足够的信息预测区块链的交易处理能力,因此可以通过调整区块打包交易量来确定区块链的交易处理能力,并且由于区块打包交易量的初始值很小,因此可以采取如指数级递增的方式对区块打包交易量进行递增处理,并在递增处理后的区块打包交易量大于或等于快速启动阈值时,退出快速启动阶段,进入超时避免阶段。When it is judged that the block package transaction volume is less than the preset quick start threshold, it enters the quick start phase, which is the initial working phase of the dynamic adjustment algorithm. At this stage, the dynamic adjustment module does not have enough information to predict the transaction processing of the blockchain Therefore, the transaction processing capacity of the blockchain can be determined by adjusting the block packaging transaction volume, and since the initial value of the block packaging transaction volume is very small, the block packaging transaction volume can be increased in an exponential manner. Increment processing, and when the block package transaction volume after increment processing is greater than or equal to the quick start threshold, exit the quick start phase and enter the timeout avoidance phase.
而在超时避免阶段,区块打包的交易量超过快速增加的阈值,区块执行超时发生可能性相对快速启动阶段,发生区块执行超时的可能性已经大大增加,因此需要降低增长的速率,区块打包交易量的大小按照配置速率(如交易量增加速率)的方式进行增加,并在超时避免阶段增加到一定程度后也可能超时,也就是当发现超时现象时,优先进行超时的处理(即超时处理阶段),调整参数后继续进入下一个超时避免阶段。In the timeout avoidance phase, the transaction volume of the block package exceeds the rapidly increasing threshold, and the possibility of block execution timeout occurring is relatively fast in the start phase. The possibility of block execution timeout has greatly increased, so the growth rate needs to be reduced. The size of the block packaging transaction volume is increased according to the configured rate (such as the transaction volume increase rate), and may also time out after the timeout avoidance phase increases to a certain extent, that is, when a timeout phenomenon is found, the priority is given to the processing of the timeout (ie Timeout processing stage), after adjusting the parameters, continue to the next timeout avoidance stage.
而在超时处理阶段,共识模块区块进行交易发生超时,说明交易量增加过多,已经超过当前区块链的交易处理负载能力,此时将区块打包交易量与快速启动阈值设置为最大未超时交易量,并且快速启动阈值不大于最小超时交易量,然后再次进入超时避免阶段。直至获取到当前区块打包交易量,并检测当前区块打包交易量是否等于区块最大交易打包量。基于不同的检测结果执行不同的操作。In the timeout processing stage, the consensus module block transaction timeout occurs, indicating that the transaction volume has increased too much, which has exceeded the transaction processing load capacity of the current blockchain. At this time, the block package transaction volume and the quick start threshold are set to the maximum Timeout transaction volume, and the quick start threshold is not greater than the minimum timeout transaction volume, and then enter the timeout avoidance phase again. Until the current block packaged transaction volume is obtained, and check whether the current block packaged transaction volume is equal to the block maximum transaction package volume. Perform different operations based on different detection results.
其中,交易量增加速率可以是超时避免阶段打包交易量增加的速率,初始值可配置,默认值为0.1。最大未超时交易量可以是当前已经执行未发生超时的区块打包的最大交易量值。最小超时交易量可以是当前已经执行发生超时的区块打包的最小交易量值。区块最大交易打包量是区块能够打包的最大交易量,动态调整算法调整区块打包交易量的极限值。Among them, the transaction volume increase rate can be the rate at which the packaged transaction volume increases during the timeout avoidance phase. The initial value is configurable, and the default value is 0.1. The maximum untimed transaction volume may be the maximum transaction volume value of the block package that has been executed currently without a timeout. The minimum timeout transaction volume can be the minimum transaction volume value of the block that has been executed that has timed out. The maximum transaction volume of a block is the maximum transaction volume that can be packaged in a block, and the dynamic adjustment algorithm adjusts the limit value of the block package transaction volume.
步骤S30,若确定所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。In step S30, if it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume, block chain transactions are performed based on the current block packaging transaction volume.
当经过判断发现当前区块打包交易量等于区块最大交易打包量,则可以认为当前区块打包交易量已达到该区块能够执行交易的最大值。此时就可以直接按照当前区块打包交易量进行区块链交易了。当经过判断发现当前区块打包交易量小于区块最大交易打包量时,则继续对当前区块打包交易量进行增加处理,直至当前区块打包交易量等于区块最大交易打包量。但是在当前区块打包交易量大于区块最大交易打包量时,则可以当前区块节点存在故障。When it is judged that the current block packaging transaction volume is equal to the block's maximum transaction packaging volume, it can be considered that the current block packaging transaction volume has reached the maximum value that the block can execute transactions. At this point, you can directly perform blockchain transactions according to the current block packaging transaction volume. When the current block packaging transaction volume is found to be less than the block maximum transaction packaging volume after judgment, the current block packaging transaction volume will continue to be increased until the current block packaging transaction volume is equal to the block maximum transaction packaging volume. However, when the current block packaged transaction volume is greater than the block's maximum transaction package volume, the current block node may be faulty.
另外为辅助理解本实施例中的区块链交易方法,下面进行举例说明。In addition, in order to assist in understanding the blockchain transaction method in this embodiment, an example is given below.
例如,如图4所示,在客户端提交交易到区块链节点的交易池时,交易池会加载交易到共识模块中,并通过区块执行器来进行区块执行,即通过共识模块进行共识打包,在达成共识后区块上链,即将交易信息传递至区块链。并且在将交易信息上传至区块链后,会通过网络模块将区块的执行时间、耗时、交易量等信息回调给到动态调整模块,以便动态调整模块根据区块执行反馈信息调整下一轮共识区块打包交易量,也就是动态调整模块需要获取下一轮的区块打包交易量。其中在进行共识打包交易时,会通过网络模块进行共识消息交互,以保障交易信息能成功上传至区块链。For example, as shown in Figure 4, when the client submits a transaction to the transaction pool of the blockchain node, the transaction pool will load the transaction into the consensus module and execute the block through the block executor, that is, through the consensus module Consensus packaging, after reaching a consensus, the block will be chained, that is, the transaction information will be transferred to the block chain. And after uploading the transaction information to the blockchain, the block's execution time, time-consuming, transaction volume and other information will be called back to the dynamic adjustment module through the network module, so that the dynamic adjustment module can adjust the next block according to the block execution feedback information. Round consensus block package transaction volume, that is, the dynamic adjustment module needs to obtain the next round of block package transaction volume. Among them, when the consensus packaging transaction is carried out, consensus message interaction will be carried out through the network module to ensure that the transaction information can be successfully uploaded to the blockchain.
在本实施例中,通过对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;若小于,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;若等于,则基于所述当前区块打包交易量进行区块链交易。通过获取交易信息对应的区块打包交易量,并在区块打包交易量小于快速启动阈值时,对区块打包交易量进行递增处理,以获当前区块打包交易量,并在当前区块打包交易量等于区块最大交易打包量时,按照当前区块打包交易量进行区块链交易,从而保障了在不影响区块链中区块节点正常交易的情况下,提高了区块交易效率,避免了现有技术采用配置方式进行区块交易限制区块交易量的现象发生。In this embodiment, the transaction information submitted by the client is packaged by consensus to obtain the block package transaction volume, and it is determined whether the block package transaction volume is less than the preset quick start threshold; The block packaged transaction volume is incremented to obtain the current block packaged transaction volume, and check whether the current block packaged transaction volume is equal to the block maximum transaction packaged volume; if it is equal to, the packaged transaction volume is based on the current block The amount of blockchain transactions. By obtaining the block packaged transaction volume corresponding to the transaction information, and when the block packaged transaction volume is less than the quick start threshold, the block packaged transaction volume is incremented to obtain the current block packaged transaction volume and package it in the current block When the transaction volume is equal to the maximum transaction packaging volume of the block, blockchain transactions are performed according to the current block packaging transaction volume, thereby ensuring that the block transaction efficiency is improved without affecting the normal transactions of the block nodes in the blockchain. This avoids the phenomenon that the existing technology uses configuration methods to perform block transactions to limit the block transaction volume.
进一步地,基于本申请区块链交易方法第一实施例,提出本申请区块链交易方法第二实施例。本实施例是本申请第一实施例的步骤S20,对所述区块打包交易量进行递增处理,以获取当前区块打包交易量的步骤的细化,包括:Further, based on the first embodiment of the blockchain transaction method of the present application, a second embodiment of the blockchain transaction method of the present application is proposed. This embodiment is step S20 of the first embodiment of the present application. The step of increasing the block packaging transaction volume to obtain the current block packaging transaction volume is refined, including:
步骤a,获取预设的处理方式,并按照所述预设的处理方式对所述区块打包交易量进行递增处理,以获取递增区块打包交易量;Step a: Obtain a preset processing method, and perform incremental processing on the block packaging transaction volume according to the preset processing method to obtain an incremental block packaging transaction volume;
预设的处理方式可以是用户提前存储的用于增加区块打包交易量的方法,例如按照一定的比例进行递增。因此,在本实施例中,需要对区块打包交易量进行调整时,可以通过预设的处理方式(如指数级递增)增加区块打包交易量,以获取递增区块打包交易量。递增区块打包交易量可以是采用预设的处理方式进行增加后的当前的区块打包交易量。The preset processing method may be a method for increasing the block packaging transaction volume stored in advance by the user, for example, increasing according to a certain ratio. Therefore, in this embodiment, when the block packaging transaction volume needs to be adjusted, the block packaging transaction volume can be increased through a preset processing method (such as exponential increase) to obtain the incremental block packaging transaction volume. The incremental block packaging transaction volume may be the current block packaging transaction volume after the increase is performed using a preset processing method.
步骤b,基于所述递增区块打包交易量获取当前区块打包交易量。Step b: Obtain the current block packaging transaction volume based on the incremental block packaging transaction volume.
当获取到递增区块打包交易量后,可以将递增区块打包交易量和快速启动阈值进行比较,并根据比较结果来确定当前区块打包交易。When the incremental block packaging transaction volume is obtained, the incremental block packaging transaction volume can be compared with the quick start threshold, and the current block packaging transaction can be determined according to the comparison result.
在本实施例中,通过按照预设的处理方式对区块打包交易量件递增处理,并根据递增处理后的递增区块打包交易量获取当前区块打包交易量,从而保障了获取到的当前区块打包交易量的准确性。In this embodiment, the block packaging transaction volume is incrementally processed according to a preset processing method, and the current block packaging transaction volume is obtained according to the incremental block packaging transaction volume after the incremental processing, thereby ensuring the current obtained The accuracy of the block package transaction volume.
具体地,基于所述递增区块打包交易量获取当前区块打包交易量的步骤,包括:Specifically, the step of obtaining the current block packaging transaction volume based on the incremental block packaging transaction volume includes:
步骤b1,判断所述递增区块打包交易量是否大于或等于快速启动阈值;Step b1, judging whether the incremental block packaging transaction volume is greater than or equal to the quick start threshold;
当获取到递增区块打包交易量后,还需要确定递增区块打包交易量是否大于或等于快速启动阈值;若大于或等于,则可以认为区块打包交易量的快速启动阶段已完成,需要进入超时避免阶段,也就是避免递增区块打包交易量超过区块链的处理负载能力。但是若递增区块打包交易量小于快速启动阈值,则可以继续按照预设的处理方式的对递增区块打包交易量进行递增处理,直至获取到新的递增区块打包交易量大于或等于快速启动阈值。When the incremental block packaging transaction volume is obtained, it is also necessary to determine whether the incremental block packaging transaction volume is greater than or equal to the fast start threshold; if it is greater than or equal to, the fast start phase of the block packaging transaction volume can be considered to be completed and it is necessary to enter The timeout avoidance phase is to avoid incrementing the block package transaction volume to exceed the processing load capacity of the blockchain. However, if the incremental block packaging transaction volume is less than the quick start threshold, you can continue to increase the incremental block packaging transaction volume according to the preset processing method until the new incremental block packaging transaction volume is greater than or equal to the quick start Threshold.
步骤b2,若确定所述递增区块打包交易量大于或等于快速启动阈值,则基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量。Step b2: If it is determined that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume .
若经过判断发现递增区块打包交易量大于或等于快速启动阈值,则需要获取预设的交易量增加速率,并按照此交易量增加速率对递增区块打包交易量进行增加处理,直至获取到的递增区块打包交易量等于区块最大交易打包量,并且按照预设的交易量增加速率对递增区块打包交易量进行增加处理后,在当前时刻获取到的已进行增加处理的递增区块打包交易量可以作为当前区块打包交易量。需要说明的是,为了避免区块打包交易量进行交易时的超声现象发生,将快速启动阶段对区块打包交易量进行增长的速率要大于超时避免阶段中按照交易量增加速率对递增区块打包交易量进行增加处理的速率,也就是通过预设的处理方式对区块打包交易量进行递增的速率要远远大于按照预设的交易量增加速率对递增区块打包交易量进行增加的速率。例如,如图5所示,在区块打包交易量在快速启动阶段增长的速率明显要小于在快速启动阶段,其区块打包交易量大于或等于快速启动阈值后进行的超时避免阶段的增长速率。If it is found after judgment that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the preset transaction volume increase rate needs to be obtained, and the incremental block packaging transaction volume is increased according to the transaction volume increase rate until the obtained The incremental block packaging transaction volume is equal to the maximum transaction packaging volume of the block, and the incremental block packaging transaction volume is increased according to the preset transaction volume increase rate, and the incremental block packaging that has been increased at the current moment is obtained The transaction volume can be used as the current block package transaction volume. It should be noted that, in order to avoid the occurrence of ultrasonic phenomenon when the block packaging transaction volume is used for transactions, the increase rate of the block packaging transaction volume in the fast start phase is greater than that in the timeout avoiding phase, and the incremental block is packaged according to the transaction volume increase rate. The rate at which the transaction volume increases processing, that is, the rate at which the block packaged transaction volume is increased through a preset processing method is much greater than the rate at which the incremental block packaged transaction volume is increased according to the preset transaction volume increase rate. For example, as shown in Figure 5, the growth rate of the block packaged transaction volume during the fast start phase is significantly less than that of the block packaged transaction volume greater than or equal to the fast start threshold during the timeout avoidance phase. .
在本实施例中,通过在确定递增区块打包交易量大于或等于快速启动阈值时,根据预设的交易量增加速率进行增加处理,以获取当前区块打包交易量,从而保障了获取到的当前区块打包交易量的准确性。In this embodiment, when it is determined that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the increase processing is performed according to the preset transaction volume increase rate to obtain the current block packaging transaction volume, thereby ensuring the obtained The accuracy of the current block package transaction volume.
具体地,基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量的步骤,包括:Specifically, the step of processing the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain the current block packaging transaction volume includes:
步骤f,基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取多个子区块打包交易量,并依次对各所述子区块打包交易量进行超时检测;Step f: Performing an increase process on the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain multiple sub-block packaging transaction volumes, and performing timeout detection on each sub-block packaging transaction volume in turn;
当通过交易量增加速率对递增区块打包交易量进行增加处理后,需要获取不同时刻的各个子区块打包交易量(子区块打包交易量为通过交易量增加速率对递增区块打包交易量进行增加处理后的某一时刻的区块打包交易量),并在获取到各个子区块打包交易量后,需要依次对各个子区块打包交易量进行超时检测,以确定是否存在超时现象发生,并根据各个超时检测结果执行不同的操作。After increasing the transaction volume of the incremental block package by the transaction volume increase rate, it is necessary to obtain the package transaction volume of each sub-block at different times (the sub-block package transaction volume is the package transaction volume of the incremental block through the transaction volume increase rate After the increase processing, the block package transaction volume at a certain moment), and after obtaining the package transaction volume of each sub-block, it is necessary to perform timeout detection on each sub-block package transaction volume in turn to determine whether there is a timeout phenomenon. , And perform different operations based on the results of each timeout detection.
步骤g,若确定在各所述子区块打包交易量中存在超时检测不合格的子区块打包交易量,则在各所述子区块打包交易量中确定最大未超时交易量,并基于所述最大未超时交易量获取当前区块打包交易量。Step g, if it is determined that there is a sub-block packaged transaction volume that fails overtime detection in each sub-block packaged transaction volume, then determine the maximum untimed transaction volume in each of the sub-block packaged transaction volume, and based on The maximum untimed transaction volume obtains the current block packaging transaction volume.
当经过超时检测发现存在有子区块打包交易量的超时检测不合格,也就可以认为共识模块区块执行交易发生超时,交易量增加过多,已经超过当前区块链的交易处理负载能力,此时就需要在各个子区块打包交易量中确定最大未超时交易量,并可以将快速启动阈值和超时检测不合格的子区块打包交易量均设置为最大未超时交易量,并且快速启动阈值不能大于最小超时交易量,并在设置完成后,再次进行超时避免阶段,即采用新的增加速率对已设置为最大未超时交易量的子区块打包交易量进行增加处理,并获取当前区块打包交易量。其中,最大未超时交易量可以是当前已经执行未发生超时的区块打包的最大交易量值。最小超时交易量可以是当前已经执行发生超时的区块打包的最小交易量值。When it is found that there is a sub-block packaged transaction volume after the timeout detection is unqualified, it can be considered that the consensus module block execution transaction has timed out, and the transaction volume has increased too much, which has exceeded the transaction processing load capacity of the current blockchain. At this time, you need to determine the maximum untimed transaction volume in each sub-block packaged transaction volume, and you can set the quick start threshold and the sub-block packaged transaction volume that failed overtime detection to the maximum untimed transaction volume, and start quickly The threshold cannot be greater than the minimum timeout transaction volume, and after the setting is completed, the timeout avoidance phase is performed again, that is, the new increase rate is used to increase the sub-block package transaction volume that has been set to the maximum untimed transaction volume, and the current area is obtained Block package transaction volume. Among them, the maximum untimed transaction volume may be the maximum transaction volume value of the block package that has been executed currently without a timeout. The minimum timeout transaction volume can be the minimum transaction volume value of the block that has been executed that has timed out.
在本实施例中,通过对经过增加处理后产生的各个子区块打包交易量进行超时检测,并在确定有超时检测不合格时,获取最大未超时交易量,并根据最大未超时交易量获取当前区块打包交易量,从而保障了获取到的当前区块打包交易量的准确性。In this embodiment, the packaged transaction volume of each sub-block generated after the increase process is tested for timeout, and when it is determined that the timeout detection fails, the maximum untimed transaction volume is obtained, and the maximum untimed transaction volume is obtained according to the maximum untimed transaction volume. The current block packaging transaction volume ensures the accuracy of the obtained current block packaging transaction volume.
具体地,依次对各所述子区块打包交易量进行超时检测的步骤,包括:Specifically, the step of sequentially performing timeout detection on the packaged transaction volume of each of the sub-blocks includes:
步骤h,依次获取各所述子区块打包交易量从区块节点发送到区块链的发送时间与接收到所述区块链反馈信息的反馈时间之间的时间段,并在各所述时间段中确定是否存在和预设时间段不匹配的目标时间段;Step h: Obtain the time period between the sending time of each sub-block packaged transaction volume from the block node to the blockchain and the feedback time of receiving the feedback information of the blockchain, and Determine whether there is a target time period that does not match the preset time period in the time period;
依次对各个子区块打包交易量进行超时检测,由于子区块打包交易量上传区块链后,会回复一个反馈信息到子区块打包交易量所在区块节点,因此可以依次获取各个子区块打包交易量从区块节点发送到区块链的发送时间与接收到区块链反馈信息的反馈时间之间的时间段,并且可以在各个时间段中确定是否存在和预设时间段(用户设置的区块链正常交易上传区块链所用的时间)不匹配的目标时间段,再基于确定结果执行不同的操作。The timeout detection of the packaged transaction volume of each sub-block is performed in turn. Since the packaged transaction volume of the sub-block is uploaded to the blockchain, a feedback message will be returned to the node of the block where the packaged transaction volume of the sub-block is located, so each sub-area can be obtained in turn The time period between the time when the block package transaction volume is sent from the block node to the blockchain and the feedback time when the feedback information of the blockchain is received, and the existence and preset time period can be determined in each time period (user The set block chain normal transaction upload block chain time) does not match the target time period, and then perform different operations based on the determination result.
步骤k,若确定存在和预设时间段不匹配的目标时间段,则确定所述目标时间段对应的子区块打包交易量的超时检测不合格。In step k, if it is determined that there is a target time period that does not match the preset time period, it is determined that the overtime detection of the sub-block packaging transaction volume corresponding to the target time period is unqualified.
当经过判断发现在各个时间段中存在和预设时间段不匹配的时间段,则可以将此时间段作为目标时间段,再确定该目标时间段对应的子区块打包交易量,此时可以确定该目标时间段对应的子区块打包交易量的超时检测不合格,需要进入超时处理阶段。但是,若在各个时间段中不存在和预设时间段不匹配的目标时间段,则可以继续进行增加处理。When it is judged that there is a time period that does not match the preset time period in each time period, this time period can be used as the target time period, and then the sub-block package transaction volume corresponding to the target time period can be determined. It is determined that the timeout detection of the sub-block packaged transaction volume corresponding to the target time period is unqualified, and the timeout processing stage needs to be entered. However, if there is no target time period that does not match the preset time period in each time period, the increase processing can be continued.
在本实施例中,通过依次检测各个子区块打包交易量对应的时间段是否和预设时间段不匹配,并在确定目标时间段和预设时间段不匹配时,确定目标时间段对应的子区块打包交易量的超时检测不合格,从而保障了超时检测的有效性。In this embodiment, by sequentially detecting whether the time period corresponding to the packaged transaction volume of each sub-block does not match the preset time period, and when it is determined that the target time period does not match the preset time period, it is determined that the time period corresponding to the target time period The timeout detection of sub-block packaged transaction volume is unqualified, thus ensuring the effectiveness of the timeout detection.
具体地,基于所述最大未超时交易量获取当前区块打包交易量的步骤,包括:Specifically, the step of obtaining the current block packaging transaction volume based on the maximum untimed transaction volume includes:
步骤x,对所述交易量增加速率进行调整,并基于调整后的所述交易增加速率对所述最大未超时交易量进行增加处理,以获取当前区块打包交易量。Step x: Adjust the transaction volume increase rate, and increase the maximum untimed transaction volume based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
当在超时处理阶段已处理完成,并再次进入超时避免阶段时,需要对交易量增加速率进行调整,并根据调整后的交易增加速率对最大未超时交易量进行增加处理,以获取增加处理后的当前区块打包交易量。When the processing is completed in the timeout processing phase and the timeout avoidance phase is entered again, the transaction volume increase rate needs to be adjusted, and the maximum untimed transaction volume is increased according to the adjusted transaction increase rate to obtain the increased transaction The current block package transaction volume.
在本实施例中,通过对交易量增加速率进行调整,并根据调整后的交易量增加速率对最大未超时交易量进行增加处理,以获取当前区块打包交易量,从而保障了获取到的当前区块打包交易量的准确性。In this embodiment, the transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased according to the adjusted transaction volume increase rate to obtain the current block packaged transaction volume, thereby ensuring the current obtained The accuracy of the block package transaction volume.
进一步地,检测所述当前区块打包交易量是否大于区块最大交易打包量的步骤之后,包括:Further, after the step of detecting whether the current block packaging transaction volume is greater than the block maximum transaction packaging volume, the method includes:
步骤y,若确定所述当前区块打包交易量小于区块最大交易打包量,则根据调整后的所述交易增加速率继续对所述当前区块打包交易量进行增加处理,直至所述当前区块打包交易量大于或等于区块最大交易打包量。Step y, if it is determined that the current block packaged transaction volume is less than the block maximum transaction package volume, continue to increase the current block packaged transaction volume according to the adjusted transaction increase rate until the current block The block packaging transaction volume is greater than or equal to the block maximum transaction packaging volume.
当经过判断发现当前区块打包交易量小于区块最大交易打包量,则可以根据调整后的交易增加速率继续对当前区块打包交易量进行增加处理,直至当前区块打包交易量大于或等于区块最大交易打包量,才停止增加处理的操作。When it is judged that the current block packaging transaction volume is less than the block maximum transaction packaging volume, the current block packaging transaction volume can be increased according to the adjusted transaction increase rate until the current block packaging transaction volume is greater than or equal to the area Only when the maximum transaction volume of the block is reached, the increase processing operation is stopped.
在本实施例中,通过在确定当前区块打包交易量小于区块最大交易打包量时,根据调整后的交易增加速率继续对当前区块打包交易量进行增加处理,从而提高了区块交易的效率。In this embodiment, when it is determined that the current block packaged transaction volume is less than the block maximum transaction package volume, the current block packaged transaction volume is increased according to the adjusted transaction increase rate, thereby increasing the block transaction volume effectiveness.
本申请还提供一种区块链交易装置,参照图3,所述区块链交易装置包括:This application also provides a block chain transaction device. Referring to FIG. 3, the block chain transaction device includes:
获取模块,配置为对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;The obtaining module is configured to perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
检测模块,配置为若确定所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;The detection module is configured to, if it is determined that the block packaging transaction volume is less than the preset quick start threshold, increment the block packaging transaction volume to obtain the current block packaging transaction volume, and detect the current area Whether the block packaging transaction volume is equal to the maximum transaction packaging volume of the block;
交易模块,配置为若确定所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。The transaction module is configured to perform a blockchain transaction based on the current block packaging transaction volume if it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume.
进一步地,所述检测模块,还配置为:Further, the detection module is further configured to:
获取预设的处理方式,并按照所述预设的处理方式对所述区块打包交易量进行递增处理,以获取递增区块打包交易量;Acquiring a preset processing method, and performing incremental processing on the block packaging transaction volume according to the preset processing method to obtain an incremental block packaging transaction volume;
基于所述递增区块打包交易量获取当前区块打包交易量。Obtain the current block packaging transaction volume based on the incremental block packaging transaction volume.
进一步地,所述检测模块,还配置为:Further, the detection module is further configured to:
判断所述递增区块打包交易量是否大于或等于快速启动阈值;Judging whether the incremental block packaging transaction volume is greater than or equal to the quick start threshold;
若确定所述递增区块打包交易量大于或等于快速启动阈值,则基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量。If it is determined that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume.
进一步地,所述检测模块,还配置为:Further, the detection module is further configured to:
基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取多个子区块打包交易量,并依次对各所述子区块打包交易量进行超时检测;Performing an increase process on the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain multiple sub-block packaging transaction volumes, and performing timeout detection on each sub-block packaging transaction volume in turn;
若确定在各所述子区块打包交易量中存在超时检测不合格的子区块打包交易量,则在各所述子区块打包交易量中确定最大未超时交易量,并基于所述最大未超时交易量获取当前区块打包交易量。If it is determined that there is a sub-block packaged transaction volume that fails overtime detection in each sub-block packaged transaction volume, the maximum untimed transaction volume is determined in each sub-block packaged transaction volume, and the maximum transaction volume Untimed transaction volume gets the current block packaged transaction volume.
进一步地,所述检测模块,还配置为:Further, the detection module is further configured to:
依次获取各所述子区块打包交易量从区块节点发送到区块链的发送时间与接收到所述区块链反馈信息的反馈时间之间的时间段,并在各所述时间段中确定是否存在和预设时间段不匹配的目标时间段;Obtain in turn the time period between the sending time of each sub-block packaged transaction volume from the block node to the blockchain and the feedback time of receiving the feedback information of the blockchain, and in each of the time periods Determine whether there is a target time period that does not match the preset time period;
若确定存在和预设时间段不匹配的目标时间段,则确定所述目标时间段对应的子区块打包交易量的超时检测不合格。If it is determined that there is a target time period that does not match the preset time period, it is determined that the overtime detection of the sub-block packaged transaction volume corresponding to the target time period is unqualified.
进一步地,所述检测模块,还配置为:Further, the detection module is further configured to:
对所述交易量增加速率进行调整,并基于调整后的所述交易增加速率对所述最大未超时交易量进行增加处理,以获取当前区块打包交易量。The transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
进一步地,所述检测模块,还配置为:Further, the detection module is further configured to:
若确定所述当前区块打包交易量小于区块最大交易打包量,则根据调整后的所述交易增加速率继续对所述当前区块打包交易量进行增加处理,直至所述当前区块打包交易量大于或等于区块最大交易打包量。If it is determined that the current block packaging transaction volume is less than the block maximum transaction packaging volume, continue to increase the current block packaging transaction volume according to the adjusted transaction increase rate until the current block packaging transaction volume The amount is greater than or equal to the maximum transaction volume of the block.
上述各程序模块所执行的方法可参照本申请区块链交易方法各个实施例,此处不再赘述。For the method executed by the above-mentioned program modules, please refer to the various embodiments of the blockchain transaction method of this application, which will not be repeated here.
本申请还提供一种计算机可读存储介质。The application also provides a computer-readable storage medium.
本申请计算机可读存储介质上存储有区块链交易程序,所述区块链交易程序被处理器执行时实现如上所述的区块链交易方法的步骤。The computer-readable storage medium of the present application stores a blockchain transaction program, and when the blockchain transaction program is executed by a processor, the steps of the blockchain transaction method as described above are realized.
其中,在所述处理器上运行的区块链交易程序被执行时所实现的方法可参照本申请区块链交易方法各个实施例,此处不再赘述。Among them, the method implemented when the blockchain transaction program running on the processor is executed can refer to the various embodiments of the blockchain transaction method of this application, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. Without more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation manners, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disks, optical disks), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the application, and do not limit the scope of the patent for this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of the application, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (10)

  1. 一种区块链交易方法,所述区块链交易方法包括如下步骤:A block chain transaction method, the block chain transaction method includes the following steps:
    对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;Perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
    若确定所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;If it is determined that the block packaging transaction volume is less than the preset quick start threshold, the block packaging transaction volume is incremented to obtain the current block packaging transaction volume, and whether the current block packaging transaction volume is detected Equal to the maximum transaction volume of the block;
    若确定所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。If it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume, block chain transactions are performed based on the current block packaging transaction volume.
  2. 如权利要求1所述的区块链交易方法,其中,所述对所述区块打包交易量进行递增处理,以获取当前区块打包交易量的步骤,包括:The block chain transaction method according to claim 1, wherein the step of increasing the block packaging transaction volume to obtain the current block packaging transaction volume comprises:
    获取预设的处理方式,并按照所述预设的处理方式对所述区块打包交易量进行递增处理,以获取递增区块打包交易量;Acquiring a preset processing method, and performing incremental processing on the block packaging transaction volume according to the preset processing method to obtain an incremental block packaging transaction volume;
    基于所述递增区块打包交易量获取当前区块打包交易量。Obtain the current block packaging transaction volume based on the incremental block packaging transaction volume.
  3. 如权利要求2所述的区块链交易方法,其中,所述基于所述递增区块打包交易量获取当前区块打包交易量的步骤,包括:3. The blockchain transaction method of claim 2, wherein the step of obtaining the current block package transaction volume based on the incremental block package transaction volume comprises:
    判断所述递增区块打包交易量是否大于或等于快速启动阈值;Judging whether the incremental block packaging transaction volume is greater than or equal to the quick start threshold;
    若确定所述递增区块打包交易量大于或等于快速启动阈值,则基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量。If it is determined that the incremental block packaging transaction volume is greater than or equal to the quick start threshold, the incremental block packaging transaction volume is increased based on a preset transaction volume increase rate to obtain the current block packaging transaction volume.
  4. 如权利要求3所述的区块链交易方法,其中,所述基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取当前区块打包交易量的步骤,包括:The block chain transaction method of claim 3, wherein the step of increasing the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain the current block packaging transaction volume comprises :
    基于预设的交易量增加速率对所述递增区块打包交易量进行增加处理,以获取多个子区块打包交易量,并依次对各所述子区块打包交易量进行超时检测;Performing an increase process on the incremental block packaging transaction volume based on a preset transaction volume increase rate to obtain multiple sub-block packaging transaction volumes, and performing timeout detection on each sub-block packaging transaction volume in turn;
    若确定在各所述子区块打包交易量中存在超时检测不合格的子区块打包交易量,则在各所述子区块打包交易量中确定最大未超时交易量,并基于所述最大未超时交易量获取当前区块打包交易量。If it is determined that there is a sub-block packaged transaction volume that fails overtime detection in each sub-block packaged transaction volume, the maximum untimed transaction volume is determined in each sub-block packaged transaction volume, and the maximum transaction volume Untimed transaction volume gets the current block packaged transaction volume.
  5. 如权利要求4所述的区块链交易方法,其中,所述依次对各所述子区块打包交易量进行超时检测的步骤,包括:5. The blockchain transaction method according to claim 4, wherein the step of sequentially performing timeout detection on the packaged transaction volume of each of the sub-blocks comprises:
    依次获取各所述子区块打包交易量从区块节点发送到区块链的发送时间与接收到所述区块链反馈信息的反馈时间之间的时间段,并在各所述时间段中确定是否存在和预设时间段不匹配的目标时间段;Obtain in turn the time period between the sending time of each sub-block packaged transaction volume from the block node to the blockchain and the feedback time of receiving the feedback information of the blockchain, and in each of the time periods Determine whether there is a target time period that does not match the preset time period;
    若确定存在和预设时间段不匹配的目标时间段,则确定所述目标时间段对应的子区块打包交易量的超时检测不合格。If it is determined that there is a target time period that does not match the preset time period, it is determined that the overtime detection of the sub-block packaged transaction volume corresponding to the target time period is unqualified.
  6. 如权利要求4所述的区块链交易方法,其中,所述基于所述最大未超时交易量获取当前区块打包交易量的步骤,包括:The block chain transaction method according to claim 4, wherein the step of obtaining the current block packaging transaction volume based on the maximum untimed transaction volume comprises:
    对所述交易量增加速率进行调整,并基于调整后的所述交易增加速率对所述最大未超时交易量进行增加处理,以获取当前区块打包交易量。The transaction volume increase rate is adjusted, and the maximum untimed transaction volume is increased based on the adjusted transaction increase rate to obtain the current block packaged transaction volume.
  7. 如权利要求6所述的区块链交易方法,其中,所述检测所述当前区块打包交易量是否大于区块最大交易打包量的步骤之后,包括:7. The blockchain transaction method of claim 6, wherein after the step of detecting whether the current block packaging transaction volume is greater than the block maximum transaction packaging volume, the step comprises:
    若确定所述当前区块打包交易量小于区块最大交易打包量,则根据调整后的所述交易增加速率继续对所述当前区块打包交易量进行增加处理,直至所述当前区块打包交易量大于或等于区块最大交易打包量。If it is determined that the current block packaging transaction volume is less than the block maximum transaction packaging volume, continue to increase the current block packaging transaction volume according to the adjusted transaction increase rate until the current block packaging transaction volume The amount is greater than or equal to the maximum transaction volume of the block.
  8. 一种区块链交易装置,所述区块链交易装置包括:A block chain transaction device, the block chain transaction device includes:
    获取模块,配置为对客户端提交的交易信息进行共识打包,以获取区块打包交易量,并确定所述区块打包交易量是否小于预设的快速启动阈值;The obtaining module is configured to perform consensus packaging on the transaction information submitted by the client to obtain the block packaged transaction volume, and determine whether the block packaged transaction volume is less than a preset quick start threshold;
    检测模块,配置为若确定所述区块打包交易量小于预设的快速启动阈值,则对所述区块打包交易量进行递增处理,以获取当前区块打包交易量,并检测所述当前区块打包交易量是否等于区块最大交易打包量;The detection module is configured to, if it is determined that the block packaging transaction volume is less than the preset quick start threshold, increment the block packaging transaction volume to obtain the current block packaging transaction volume, and detect the current area Whether the block packaging transaction volume is equal to the maximum transaction packaging volume of the block;
    交易模块,配置为若确定所述当前区块打包交易量等于区块最大交易打包量,则基于所述当前区块打包交易量进行区块链交易。The transaction module is configured to perform a blockchain transaction based on the current block packaging transaction volume if it is determined that the current block packaging transaction volume is equal to the block maximum transaction packaging volume.
  9. 一种区块链交易设备,所述区块链交易设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的区块链交易程序,所述区块链交易程序被所述处理器执行时实现如权利要求1至7中任一项所述的区块链交易方法的步骤。A block chain transaction device, the block chain transaction device comprising: a memory, a processor, and a block chain transaction program stored on the memory and capable of running on the processor, the block chain transaction When the program is executed by the processor, the steps of the blockchain transaction method according to any one of claims 1 to 7 are realized.
  10. 一种计算机可读存储介质,所述计算机可读存储介质上存储有区块链交易程序,所述区块链交易程序被处理器执行时实现如权利要求1至7中任一项所述的区块链交易方法的步骤。A computer-readable storage medium having a blockchain transaction program stored on the computer-readable storage medium, and when the blockchain transaction program is executed by a processor, the method described in any one of claims 1 to 7 The steps of the blockchain transaction method.
PCT/CN2020/110266 2019-09-18 2020-08-20 Blockchain transaction method, apparatus and device, and computer readable storage medium WO2021052098A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910885625.3A CN110619582B (en) 2019-09-18 2019-09-18 Block chain transaction method, device, equipment and computer storage medium
CN201910885625.3 2019-09-18

Publications (1)

Publication Number Publication Date
WO2021052098A1 true WO2021052098A1 (en) 2021-03-25

Family

ID=68923544

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/110266 WO2021052098A1 (en) 2019-09-18 2020-08-20 Blockchain transaction method, apparatus and device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN110619582B (en)
WO (1) WO2021052098A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110619582B (en) * 2019-09-18 2023-07-14 深圳前海微众银行股份有限公司 Block chain transaction method, device, equipment and computer storage medium
CN111190754B (en) * 2019-12-30 2023-08-11 联动优势科技有限公司 Block chain event notification method and block chain system
CN111640020B (en) 2020-05-22 2023-09-19 百度在线网络技术(北京)有限公司 Transaction request processing method, device, equipment and medium in blockchain
CN111638963A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Transaction pool dynamic control method, device and storage medium
CN111541789A (en) 2020-07-08 2020-08-14 支付宝(杭州)信息技术有限公司 Data synchronization method and device based on block chain all-in-one machine
CN112598522A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Control method and device of service system and electronic equipment
CN112804233B (en) * 2021-01-15 2023-05-02 欧冶云商股份有限公司 Block packing method, device and storage medium for block chain multi-channel
CN112804351B (en) * 2021-03-05 2022-12-23 中国工商银行股份有限公司 Flow control method, device, node, medium and product of block chain system
CN113393061B (en) * 2021-08-17 2021-11-09 腾讯科技(深圳)有限公司 Transaction packing method based on block chain and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411774A (en) * 2016-09-06 2017-02-15 联动优势科技有限公司 Method and device for controlling transaction data volume
CN107767264A (en) * 2017-10-27 2018-03-06 中国银行股份有限公司 Online transaction system focus account trading flow pressure real-time monitoring method and device
CN109165324A (en) * 2018-08-20 2019-01-08 深圳市元征科技股份有限公司 A kind of transaction data packaging method and relevant apparatus
CN110619582A (en) * 2019-09-18 2019-12-27 深圳前海微众银行股份有限公司 Block chain transaction method, device, equipment and computer storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992356B (en) * 2017-12-13 2021-09-14 深圳壹账通智能科技有限公司 Block chain transaction block processing method, electronic device and readable storage medium
CN108399572A (en) * 2018-03-22 2018-08-14 深圳市网心科技有限公司 block chain transaction processing method, device and storage medium
CN108876616A (en) * 2018-06-13 2018-11-23 众安信息技术服务有限公司 Exchange information processing method, device and assets based on block chain register settlement system
CN109255057B (en) * 2018-09-18 2021-05-07 百度在线网络技术(北京)有限公司 Block generation method, device, equipment and storage medium
CN109670800A (en) * 2018-11-15 2019-04-23 亦非云互联网技术(上海)有限公司 Transaction processing method and system, storage medium and terminal based on ether mill

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411774A (en) * 2016-09-06 2017-02-15 联动优势科技有限公司 Method and device for controlling transaction data volume
CN107767264A (en) * 2017-10-27 2018-03-06 中国银行股份有限公司 Online transaction system focus account trading flow pressure real-time monitoring method and device
CN109165324A (en) * 2018-08-20 2019-01-08 深圳市元征科技股份有限公司 A kind of transaction data packaging method and relevant apparatus
CN110619582A (en) * 2019-09-18 2019-12-27 深圳前海微众银行股份有限公司 Block chain transaction method, device, equipment and computer storage medium

Also Published As

Publication number Publication date
CN110619582B (en) 2023-07-14
CN110619582A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
WO2021052098A1 (en) Blockchain transaction method, apparatus and device, and computer readable storage medium
US10789085B2 (en) Selectively providing virtual machine through actual measurement of efficiency of power usage
JP6818014B2 (en) Operation retry method and equipment for jobs
CN107832100B (en) APK plug-in loading method and terminal thereof
CN111818159B (en) Management method, device, equipment and storage medium of data processing node
CN108089814B (en) Data storage method and device
WO2021036810A1 (en) Evidence verification method, system, apparatus and device, and readable storage medium
CN110362402B (en) Load balancing method, device, equipment and readable storage medium
JP6560265B2 (en) Method and apparatus for controlling network payments
US9483493B2 (en) Method and system for accessing a distributed file system
WO2021121407A1 (en) Capacity changing method and apparatus for virtual machine
WO2022151783A1 (en) Processor parameter adjustment method, apparatus, electronic device, and storage medium
CN107181636B (en) Health check method and device in load balancing system
KR20200048440A (en) System for providing retrieval service based on blockchain and method of the same
JP7037066B2 (en) Evaluation device, evaluation method and evaluation program
WO2023087679A1 (en) Routing method and apparatus based on micro-service, and device and storage medium
WO2021012506A1 (en) Method and apparatus for realizing load balancing in speech recognition system, and computer device
CN112199175A (en) Task queue generating method, device and equipment
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
WO2022088809A1 (en) Method and system for determining interval time for testing servers, and device and medium
TW201627873A (en) Method and Apparatus of Processing Retransmission Request in Distributed Computing
WO2015058594A1 (en) Process loading method, device and system
US20160187231A1 (en) Performance testing method, performance testing apparatus performing the same and storage medium storing the same
CN115454576A (en) Virtual machine process management method and system and electronic equipment
US10735245B2 (en) Information processing apparatus and information processing method

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: 20865992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20865992

Country of ref document: EP

Kind code of ref document: A1