[go: up one dir, main page]

HK1247325B - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
HK1247325B
HK1247325B HK18106598.3A HK18106598A HK1247325B HK 1247325 B HK1247325 B HK 1247325B HK 18106598 A HK18106598 A HK 18106598A HK 1247325 B HK1247325 B HK 1247325B
Authority
HK
Hong Kong
Prior art keywords
consensus
parameters
block
processing
preprocessing block
Prior art date
Application number
HK18106598.3A
Other languages
Chinese (zh)
Other versions
HK1247325A1 (en
Inventor
王士峰
Original Assignee
创新先进技术有限公司
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Priority to HK18106598.3A priority Critical patent/HK1247325B/en
Publication of HK1247325A1 publication Critical patent/HK1247325A1/en
Publication of HK1247325B publication Critical patent/HK1247325B/en

Links

Description

一种数据处理的方法及装置Data processing method and device

技术领域Technical Field

本申请涉及计算机技术领域,尤其涉及一种数据处理的方法及装置。The present application relates to the field of computer technology, and in particular to a method and device for data processing.

背景技术Background Art

随着计算机技术的不断发展,区块链技术的应用范围得到了进一步的拓展,当前,多种业务模式由于区块链技术的引入而变的更加的有效和安全,从而为用户提供了更为有效的业务服务。With the continuous development of computer technology, the application scope of blockchain technology has been further expanded. At present, various business models have become more effective and secure due to the introduction of blockchain technology, thereby providing users with more effective business services.

在实际应用中,涉及区块链技术的业务在业务执行过程中大致可分为三个过程:In actual applications, businesses involving blockchain technology can be roughly divided into three stages during business execution:

一、业务受理阶段。在这一阶段中,区块链节点可接收用户通过终端或客户端发送的待处理的业务数据(也可以称之为交易数据),并在通过对该业务数据的验证后,存储该业务数据。当然,区块链节点在此阶段也可接收由其他区块链节点通过广播的方式发送的待处理的业务数据,按照上述记载的方式,存储该业务数据。1. Business Acceptance Phase. During this phase, blockchain nodes receive pending business data (also known as transaction data) sent by users via terminals or clients, and after verifying the business data, store it. Of course, blockchain nodes can also receive pending business data sent by other blockchain nodes via broadcast during this phase and store it in the same manner as described above.

二、业务共识阶段。在这一阶段中,若该区块链节点作为发起共识的主节点,可从存储的业务数据中捞取一部分业务数据打包成预处理块,并广播给其他区块链节点,以对该预处理块进行共识。共识网络中的其他区块链节点在接收到该预处理块后,可根据已存储的业务数据,对该预处理块中包含的业务数据进行共识验证。当然,若该区块链节点不是主节点,则也可接收主节点广播的预处理块,并通过自身内存中存储的业务请求,对该预处理块中包含的业务请求进行共识验证。Second, the business consensus phase. During this phase, if the blockchain node is the master node initiating consensus, it can extract a portion of the stored business data, package it into a pre-processed block, and broadcast it to other blockchain nodes for consensus on this pre-processed block. After receiving this pre-processed block, other blockchain nodes in the consensus network can perform consensus verification on the business data contained in the pre-processed block based on their stored business data. Of course, if the blockchain node is not the master node, it can also receive the pre-processed block broadcast by the master node and perform consensus verification on the business requests contained in the pre-processed block using the business requests stored in its own memory.

三、业务提交阶段。在这一阶段中,在该区块链节点确定业务共识阶段处理的预处理块通过共识后,可将该预处理块中包含的业务数据存储在区块链中。不仅如此,该区块链节点可将这些业务数据存储在指定的数据库中,并从自身的存储空间中释放该预处理块中所包含的业务数据。3. Business Submission Phase. During this phase, after the blockchain node confirms that the pre-processed block processed during the business consensus phase has passed consensus, it can store the business data contained in the pre-processed block on the blockchain. Furthermore, the blockchain node can store this business data in a designated database and release the business data contained in the pre-processed block from its own storage space.

在现有技术中,对于同一部分的业务数据,区块链节点通常需要在业务共识阶段完成的基础上,才能进入业务提交阶段,而只有在该业务提交阶段完成后,区块链节点才可以对下一次待共识的预处理块进行共识。In the existing technology, for the same part of business data, blockchain nodes usually need to complete the business consensus phase before entering the business submission phase. Only after the business submission phase is completed can the blockchain nodes reach consensus on the next pre-processing block to be agreed upon.

然而,由于现有技术中,对于业务数据处理过程中所经历的业务共识阶段和业务提交阶段是串行执行的,区块链节点只有在完成一次业务数据处理的业务提交阶段后,方能启动下一次业务数据处理的业务共识阶段,这样就势必增加了两次业务数据处理的时间间隔,进而降低了整个系统的业务处理效率。However, in the existing technology, the business consensus stage and the business submission stage experienced in the business data processing process are executed serially. The blockchain node can only start the business consensus stage of the next business data processing after completing the business submission stage of one business data processing. This will inevitably increase the time interval between the two business data processing, thereby reducing the business processing efficiency of the entire system.

发明内容Summary of the Invention

本申请实施例提供一种数据处理的方法,用以解决现有技术的区块链技术中存在的业务处理效率低的问题。The embodiments of the present application provide a data processing method to solve the problem of low business processing efficiency in the blockchain technology of the prior art.

本申请实施例提供了一种数据处理的方法,包括:The present invention provides a method for processing data, including:

区块链节点获取待共识的预处理块,并对所述预处理块进行共识;The blockchain node obtains the pre-processed block to be consensused and reaches consensus on the pre-processed block;

若确定所述预处理块通过共识,则启动对下一次待共识的预处理块进行共识,以及并行对已通过共识的预处理块中包含的业务数据进行数据处理。If it is determined that the pre-processed block has passed the consensus, the consensus process for the next pre-processed block to be reached is initiated, and data processing is performed on the business data contained in the pre-processed block that has passed the consensus in parallel.

本申请实施例提供一种数据处理的装置,用以解决现有技术业务共识效率较低的问题。The embodiment of the present application provides a data processing device to solve the problem of low efficiency of business consensus in the prior art.

本申请实施例提供了一种数据处理的装置,包括:An embodiment of the present application provides a data processing device, including:

获取模块,获取待共识的预处理块,并对所述预处理块进行共识;An acquisition module acquires a pre-processed block to be consensus-based and performs consensus on the pre-processed block;

处理模块,若确定所述预处理块通过共识,则启动对下一次待共识的预处理块进行共识,以及并行对已通过共识的预处理块中包含的业务数据进行数据处理。The processing module starts consensus on the next pre-processing block to be agreed upon if it is determined that the pre-processing block has passed the consensus, and concurrently processes the business data contained in the pre-processing block that has passed the consensus.

本申请实施例提供一种数据处理的装置,用以解决现有技术业务共识效率较低的问题。The embodiment of the present application provides a data processing device to solve the problem of low efficiency of business consensus in the prior art.

本申请实施例提供了一种数据处理的装置,包括:存储器和至少一个处理器,其中:所述存储器存储有程序,并被配置成由所述至少一个处理器执行以下步骤:An embodiment of the present application provides a data processing device, comprising: a memory and at least one processor, wherein: the memory stores a program and is configured such that the at least one processor executes the following steps:

获取待共识的预处理块,并对所述预处理块进行共识;Obtaining a pre-processed block to be consensused, and performing consensus on the pre-processed block;

若确定所述预处理块通过共识,则启动对下一次待共识的预处理块进行共识,以及并行对已通过共识的预处理块中包含的业务数据进行数据处理。If it is determined that the pre-processed block has passed the consensus, the consensus process for the next pre-processed block to be reached is initiated, and data processing is performed on the business data contained in the pre-processed block that has passed the consensus in parallel.

本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

在本申请实施例中,由于区块链节点在确定获取到的预处理块通过共识后,采用并行处理方式,启动对下一次待共识的预处理块进行共识,并且对已通过共识的预处理块中包含的业务数据进行数据处理。换句话说,区块链节点实现了业务数据在业务共识阶段以及业务提交阶段的并行处理,既能够对一部分业务数据执行业务提交阶段的数据处理,同时又可执行另一部分业务数据的业务共识阶段的共识处理,这样能够缩短两次业务共识阶段的共识处理的时间间隔,从而有效提升了系统的业务数据处理效率。In the embodiment of the present application, after the blockchain node determines that the acquired pre-processing block has passed consensus, it uses a parallel processing method to start consensus on the next pre-processing block to be agreed upon, and also processes the business data contained in the pre-processing block that has passed consensus. In other words, the blockchain node implements parallel processing of business data in the business consensus stage and the business submission stage. It can perform data processing in the business submission stage on a portion of business data while performing consensus processing in the business consensus stage on another portion of business data. This can shorten the time interval between the consensus processing in the two business consensus stages, thereby effectively improving the system's business data processing efficiency.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

图1为本申请实施例提供的数据处理过程的示意图;FIG1 is a schematic diagram of a data processing process provided in an embodiment of the present application;

图2为本申请实施例所提供的区块链节点进行数据处理的示意图;FIG2 is a schematic diagram of data processing performed by a blockchain node according to an embodiment of the present application;

图3为本申请实施例提供的一种数据处理的装置示意图。FIG3 is a schematic diagram of a data processing device provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

图1为本申请实施例提供的数据处理过程的示意图,具体包括以下步骤:FIG1 is a schematic diagram of the data processing process provided in an embodiment of the present application, which specifically includes the following steps:

S101:区块链节点获取待共识的预处理块,并对所述预处理块进行共识。S101: The blockchain node obtains a pre-processed block to be consensus-based and reaches consensus on the pre-processed block.

在本申请实施例中,区块链节点在业务共识阶段中,可获取在一次共识所要的预处理块(这里将当前获取的预处理块称之为本次共识所获取的预处理块)。其中,该预处理块可以是由该区块链节点根据自身保存的业务数据而生成的,也可以是从其他区块链节点中获取到的。In the embodiment of the present application, during the business consensus phase, a blockchain node may obtain a pre-processed block required for a consensus (hereinafter referred to as the pre-processed block obtained for this consensus). The pre-processed block may be generated by the blockchain node based on its own stored business data, or may be obtained from other blockchain nodes.

S102:若确定所述预处理块通过共识,则启动对下一次待共识的预处理块进行共识,以及并行对已通过共识的预处理块中包含的业务数据进行数据处理。S102: If it is determined that the pre-processing block has passed the consensus, then starting the consensus process for the next pre-processing block to be reached, and in parallel performing data processing on the business data contained in the pre-processing block that has passed the consensus.

上述区块链节点在确定出本次共识中待共识的预处理块通过共识验证后,可采用并行处理的方式,对已通过共识的预处理块进行业务提交阶段的数据处理,这样,能够有效实现在对下一个预处理块进行业务共识阶段的共识处理时,还可以同步对已通过共识的预处理块进行业务提交阶段的数据处理。After determining that the pre-processing block to be agreed upon in this consensus has passed the consensus verification, the above-mentioned blockchain node can adopt a parallel processing method to perform data processing in the business submission stage on the pre-processing block that has passed the consensus. In this way, it can effectively achieve the consensus processing of the business consensus stage for the next pre-processing block, and can also synchronously perform data processing in the business submission stage on the pre-processing block that has passed the consensus.

由此可见,在本申请实施例中,在业务数据的处理过程中,业务共识节点的业务共识阶段的共识处理与业务提交阶段的数据处理是同步并行处理的。即假设待共识的预处理块为至少两个,那么通过本申请提供的技术方案,能够实现在对已通过共识的预处理块进行业务提交阶段的数据处理时,同步可以并行地对尚未通过共识的预处理块进行业务共识阶段的共识处理。Thus, in the embodiment of the present application, during the processing of business data, the consensus processing in the business consensus phase of the business consensus node and the data processing in the business submission phase are processed synchronously and in parallel. That is, assuming that there are at least two pre-processed blocks to be agreed upon, the technical solution provided by the present application enables the data processing in the business submission phase of the pre-processed blocks that have already passed consensus to be carried out simultaneously and in parallel with the consensus processing in the business consensus phase of the pre-processed blocks that have not yet passed consensus.

需要说明的是,对于本次共识中待共识的预处理块,在确定通过对本次共识中待共识的预处理块的共识处理时,启动对下一次共识的待共识的预处理块的共识处理,同时获取针对本次共识通过的预处理块的处理参数,以便于用于实现业务数据处理过程中业务提交阶段的数据处理的处理器(后续可以称之为预设的处理器)基于这些处理参数对本次共识通过的预处理块进行数据处理。It should be noted that, for the pre-processing blocks to be agreed upon in this consensus, when it is determined that the consensus processing of the pre-processing blocks to be agreed upon in this consensus has passed, the consensus processing of the pre-processing blocks to be agreed upon in the next consensus is started, and at the same time, the processing parameters for the pre-processing blocks passed by this consensus are obtained, so that the processor used to implement data processing in the business submission stage during the business data processing process (hereinafter referred to as the preset processor) performs data processing on the pre-processing blocks passed by this consensus based on these processing parameters.

例如:一种情况:在启动对下一次共识的待共识的预处理块的共识处理时,预设的处理器基于产生的处理参数对本次共识通过的预处理块进行数据处理。这里可以理解为对下一次共识的待共识的预处理块的共识处理与对本次共识通过的预处理块进行数据处理是同时并行处理的,有效缩短了本次共识的待共识的预处理块的共识处理与下一次共识的待共识的预处理块的共识处理之间的时间间隔;For example, in one case, when starting the consensus processing of the pre-processed block to be agreed upon for the next consensus, the preset processor processes the data of the pre-processed block that has passed the current consensus based on the generated processing parameters. This can be understood as the consensus processing of the pre-processed block to be agreed upon for the next consensus and the data processing of the pre-processed block that has passed the current consensus are processed simultaneously and in parallel, effectively shortening the time interval between the consensus processing of the pre-processed block to be agreed upon for the current consensus and the consensus processing of the pre-processed block to be agreed upon for the next consensus.

另一种情况:在启动对下一次共识的待共识的预处理块的共识处理时,预设的处理器在对之前共识通过的预处理块进行数据处理,那么本次共识通过的预处理块将被存储至预设的队列中进行等待,预设的处理器按照某种规则(例如:按照共识完成时间顺序等)依次对该队列中存储的、通过共识的预处理块进行数据处理,这里可以理解为本次共识的待共识的预处理块的共识处理与该预处理块的数据处理是通过异步方式完成的。Another situation: when starting the consensus processing of the pre-processed block to be agreed upon for the next consensus, the preset processor processes the data of the pre-processed block that has passed the previous consensus. Then the pre-processed block that has passed the current consensus will be stored in the preset queue for waiting. The preset processor processes the data of the pre-processed blocks that have passed the consensus stored in the queue in sequence according to a certain rule (for example, according to the order of consensus completion time, etc.). Here it can be understood that the consensus processing of the pre-processed block to be agreed upon for this consensus and the data processing of the pre-processed block are completed asynchronously.

例如,假设有A、B、C三个预处理块,这三个预处理块按照字母的排列顺序依次发送至区块链节点中进行共识。区块链节点确定预处理块A通过共识后,可通过预设的处理器对预处理块A进行数据处理。与此同时,区块链节点可对预处理块B进行共识,而当确定预处理块B通过共识后,发现还未完成对预处理块A的数据处理时,则可将通过共识的预处理块B存储在预设的队列中进行等待,并继续对预处理块C进行共识。当确定完成对预处理块A的数据处理时,则可从预设的队列中提取出预处理块B,继而通过预设的处理器,对预处理块B进行数据处理。For example, suppose there are three preprocessing blocks, A, B, and C. These three preprocessing blocks are sent to the blockchain nodes in alphabetical order for consensus. After the blockchain nodes determine that preprocessing block A has passed consensus, they can process the data on preprocessing block A through a preset processor. At the same time, the blockchain nodes can reach consensus on preprocessing block B. After determining that preprocessing block B has passed consensus, if it is discovered that data processing for preprocessing block A has not yet been completed, the blockchain nodes can store the consensus-passing preprocessing block B in a preset queue for waiting, while continuing to reach consensus on preprocessing block C. When data processing for preprocessing block A is determined to be complete, preprocessing block B can be extracted from the preset queue and then processed by the preset processor.

所以,对于每个预处理块来说,该预处理块的共识处理和数据处理这两个阶段是通过异步的方式完成的。而对于不同的预处理块来说,一个预处理块的共识处理和另一个已通过共识的预处理块的数据处理可以通过同步的方式来进行处理。Therefore, for each pre-processed block, the consensus processing and data processing of the pre-processed block are completed in an asynchronous manner. However, for different pre-processed blocks, the consensus processing of one pre-processed block and the data processing of another pre-processed block that has already passed consensus can be processed in a synchronous manner.

区块链节点在确定出本次共识中待共识的预处理块通过共识验证后,在本申请实施例中包括但不限于执行以下两大类操作:After the blockchain node determines that the pre-processed block to be agreed upon in this consensus has passed the consensus verification, in the embodiment of the present application, it includes but is not limited to performing the following two types of operations:

1、第一类操作:确定与本次共识通过的预处理块对应的处理参数。该处理参数中包含有对所述预处理块中的业务数据进行处理的参数,以便于预设的处理器可以按照该处理参数对所述预处理块进行处理,以完成业务提交阶段的相关操作。1. First type of operation: Determine the processing parameters corresponding to the pre-processing block that has passed this consensus. The processing parameters include parameters for processing the business data in the pre-processing block, so that the preset processor can process the pre-processing block according to the processing parameters to complete the relevant operations in the business submission phase.

下面针对第一类操作进行详细说明。The first type of operations is described in detail below.

这里的处理参数可以包含但不限于:存储参数、释放参数、删除参数、上链参数等,而上述只是简单的举例说明了处理参数中所包含的一些参数,在实际应用中,该处理参数还可包含有其他的参数,而具体包含有哪些参数则可由区块链节点在业务提交阶段所执行的具体操作来决定。The processing parameters here may include but are not limited to: storage parameters, release parameters, deletion parameters, chain parameters, etc. The above is just a simple example of some parameters included in the processing parameters. In actual applications, the processing parameters may also include other parameters, and the specific parameters included may be determined by the specific operations performed by the blockchain node during the business submission stage.

例如,释放参数用于指示对通过共识的预处理块执行将该预处理块从存储空间中进行释放的操作;For example, the release parameter is used to instruct the pre-processed block that has passed the consensus to release the pre-processed block from the storage space;

存储参数用于指示将通过共识的预处理块中包含的业务数据存储至指定位置。针对不同的预处理块确定的存储参数不同。在该存储参数中包含存储位置。The storage parameter indicates that the business data contained in the consensus pre-processing block should be stored in a specified location. The storage parameters are different for different pre-processing blocks. The storage location is included in the storage parameter.

删除参数用于指示将通过共识的预处理块在业务共识阶段产生的消息(如PBFT共识中的预准备消息、准备消息、确认消息)进行删除,以降低存储压力。The delete parameter is used to indicate that the messages generated by the pre-processing block that passes the consensus during the business consensus phase (such as the pre-prepare message, prepare message, and confirmation message in the PBFT consensus) will be deleted to reduce storage pressure.

上链参数用于指示按照预处理块中包含的上一个区块的头Hash,将该预处理块以区块的形式上链至上一个区块所在的区块链中。The on-chain parameter is used to indicate that the pre-processed block should be chained to the blockchain where the previous block is located in the form of a block according to the header hash of the previous block contained in the pre-processed block.

较优地,在本申请实施例中,区块链节点在对相邻下一次待共识的预处理块进行共识的过程中,还可通过预设的处理器实现对通过本次共识的预处理块中包含的业务数据进行处理的并行操作。Preferably, in an embodiment of the present application, while the blockchain node is reaching consensus on the adjacent pre-processing block to be agreed upon next time, it can also implement parallel operations of processing the business data contained in the pre-processing block that has passed the current consensus through a preset processor.

假设现有技术中区块链节点执行一次业务数据处理过程中的业务共识阶段以及业务提交阶段,可以理解成是通过同一线程来完成这两个阶段的。区块链节点需要通过该线程先完成本次业务数据处理过程中的业务共识阶段,而后再利用该线程执行本次业务数据处理过程中的业务提交阶段。显然,现有技术中区块链节点是通过串行的方式来执行一次业务数据处理过程中所涉及的业务共识阶段以及业务提交阶段,因此,增加了相邻两次业务数据处理之间的时间间隔,降低了业务数据处理效率。Assuming that, in the prior art, a blockchain node executes the business consensus and business submission phases of a business data processing process, it can be understood that these two phases are completed through the same thread. The blockchain node must first complete the business consensus phase of the business data processing process through this thread, and then use the same thread to execute the business submission phase of the business data processing process. Obviously, in the prior art, blockchain nodes execute the business consensus and business submission phases involved in a business data processing process in a serial manner, thereby increasing the time interval between two consecutive business data processing operations and reducing business data processing efficiency.

为了有效的解决上述问题,在本申请实施例中,区块链节点中预先设置一个处理器(该处理器可以采用异步处理方式工作,这里不做具体限定),该处理器可用于执行业务提交阶段所涉及的操作。换句话说,在本申请实施例中,区块链节点可以采用两个线程分别实现业务数据处理过程中的业务共识阶段的共识处理和业务提交阶段的数据处理,即由一个线程用于对待共识的预处理块进行共识处理,另一个线程用于对共识通过的预处理块进行数据处理,这样对于同一个预处理块,其共识处理与其数据处理通过异步方式完成。In order to effectively solve the above problems, in an embodiment of the present application, a processor is pre-set in the blockchain node (the processor can work in an asynchronous processing mode, which is not specifically limited here), and the processor can be used to perform operations involved in the business submission phase. In other words, in an embodiment of the present application, the blockchain node can use two threads to respectively implement the consensus processing of the business consensus phase and the data processing of the business submission phase in the business data processing process, that is, one thread is used to perform consensus processing on the pre-processing block to be consensused, and the other thread is used to perform data processing on the pre-processing block that has passed the consensus. In this way, for the same pre-processing block, its consensus processing and its data processing are completed in an asynchronous manner.

这样一来,区块链节点利用该处理器执行业务提交阶段所涉及的操作的过程中,区块链节点可以不受影响的启动相邻下一次待共识的预处理块的共识任务,即开始下一次共识的执行,从而极大的缩短了相邻两次共识之间的时间间隔,进而提高了共识效率。In this way, while the blockchain node uses the processor to execute operations involved in the business submission phase, the blockchain node can start the consensus task of the next adjacent pre-processed block to be agreed upon without being affected, that is, start the execution of the next consensus, thereby greatly shortening the time interval between two adjacent consensuses and improving the consensus efficiency.

在本申请实施例中,本次共识所确定的处理参数均可通过上一次共识所确定的处理参数得出。In the embodiment of the present application, the processing parameters determined by this consensus can be obtained through the processing parameters determined by the previous consensus.

以存储参数为例进行说明。区块链节点在确定本次共识中待共识的预处理块通过共识后,可根据本次共识已通过共识的预处理块的存储参数,确定出相邻下一次共识的预处理块的存储参数,并存储。Taking storage parameters as an example, after a blockchain node determines that the pre-processed block to be agreed upon in the current consensus has passed the consensus, it can determine the storage parameters of the pre-processed block for the next consensus based on the storage parameters of the pre-processed block that has passed the consensus in the current consensus, and store them.

例如,假设通过本次共识的预处理块所对应的存储参数(也可以理解为本次共识所对应的存储参数)中规定了需要将通过本次共识的预处理块中包含的业务数据存储在关系型数据库A中的a表上。则区块链节点可以依照该关系型数据库A中各表的字母顺序,确定出通过相邻下一次共识的预处理块所对应的存储参数为:将通过此次共识(即上面提到的相邻下一次共识)的预处理块中包含的业务数据存储在关系型数据库A的b表中。For example, suppose the storage parameters corresponding to the pre-processed block that passes the current consensus (which can also be understood as the storage parameters corresponding to this consensus) stipulate that the business data contained in the pre-processed block that passes the current consensus needs to be stored in table a of relational database A. Then, the blockchain node can determine the storage parameters corresponding to the pre-processed block that passes the next consensus according to the alphabetical order of the tables in relational database A: the business data contained in the pre-processed block that passes the current consensus (i.e., the next consensus mentioned above) needs to be stored in table b of relational database A.

区块链节点可将确定出的下一次共识的存储参数进行存储,这样使得预设的处理器在确定下一次共识的预处理块通过共识时,可根据得到的存储参数,确定出需要将通过此次通过共识的预处理块中包含的业务数据存储在哪个数据库中的哪个表中。The blockchain node can store the determined storage parameters for the next consensus, so that when the preset processor determines that the pre-processing block of the next consensus has passed the consensus, it can determine which table in which database the business data contained in the pre-processing block that has passed the consensus needs to be stored in based on the obtained storage parameters.

较优地,在本申请实施例中,区块链节点在确定出本次共识中待共识的预处理块通过共识后,也可根据该预处理块以及该预处理块的存储参数,确定出相邻下一次共识的预处理块的存储参数并存储。Preferably, in an embodiment of the present application, after the blockchain node determines that the pre-processed block to be agreed upon in this consensus has passed the consensus, it can also determine and store the storage parameters of the pre-processed block of the next adjacent consensus based on the pre-processed block and the storage parameters of the pre-processed block.

具体地,若存储参数中包含的存储位置是以存储指针形式存在的,即,存储指针所指向的位置即为预处理块中业务数据的存储位置,区块链节点在确定出本次共识中待共识的预处理块通过共识后,可以以当前存储指针所在位置为起点,按照本次共识的预处理块的大小,移动存储指针的位置,并将移动后的存储指针的位置确定为下一次共识所对应的存储参数,也即相邻下一次待共识的预处理块的存储参数。Specifically, if the storage location included in the storage parameter exists in the form of a storage pointer, that is, the location pointed to by the storage pointer is the storage location of the business data in the preprocessing block. After the blockchain node determines that the preprocessing block to be agreed upon in this consensus has passed the consensus, it can use the current location of the storage pointer as the starting point, and move the location of the storage pointer according to the size of the preprocessing block of this consensus. The location of the moved storage pointer is determined as the storage parameter corresponding to the next consensus, that is, the storage parameter of the next adjacent preprocessing block to be agreed upon.

例如,假设每次共识的处理参数中包含有一个以存储指针basepointer的形式而出现的存储参数,该存储指针(即存储参数)指向业务数据的具体存储位置。该存储指针basepointer的初始值可以设为0,每经过一次共识后,区块链节点可根据经过本次共识的预处理块的大小以及本次共识所对应的处理参数中包含的存储指针,确定出相邻下一次共识所对应的处理参数中,存储指针的具体值。在第一次共识中,区块链节点确定出通过此次共识的预处理块的大小为1024字节,则区块链节点可根据确定出的预处理块的大小,以及存储指针basepointer的初始值0,确定出第二次共识所对应的处理参数中包含的存储指针basepointer为1024,并存储。相应的,在第二次共识中,区块链节点可通过处理器,将通过第二次共识的预处理块中包含的业务数据存储在存储指针basepo inter=1024所对应的存储位置中。For example, suppose that each consensus processing parameter includes a storage parameter in the form of a storage pointer, basepointer. This storage pointer (i.e., storage parameter) points to the specific storage location of the business data. The initial value of this storage pointer, basepointer, can be set to 0. After each consensus, the blockchain node can determine the specific value of the storage pointer in the processing parameters corresponding to the next consensus based on the size of the preprocessed block that passed the consensus and the storage pointer included in the processing parameters corresponding to the current consensus. In the first consensus, the blockchain node determines that the size of the preprocessed block that passed the consensus is 1024 bytes. Based on the determined preprocessed block size and the initial value of 0 of the storage pointer, the blockchain node can determine that the storage pointer included in the processing parameters corresponding to the second consensus is 1024 and store it. Accordingly, in the second consensus, the blockchain node can use the processor to store the business data contained in the preprocessed block that passed the second consensus in the storage location corresponding to the storage pointer, basepointer = 1024.

在第二次共识中,区块链节点确定出通过此次共识的预处理块的大小为10字节,则区块链节点可根据确定出的通过此次共识的预处理块的大小,以及上一次共识(即第一次共识)对应的处理参数中所包含的存储指针basepointer=1024,确定出第三次共识对应的处理参数中包含的存储指针basepointer为1034并存储。相应的,在第三次共识中,区块链节点可通过处理器,将通过第三次共识的预处理块中包含的业务数据存储在存储指针basepointer=1034所对应的存储位置中,后续的共识则可以此类推。In the second consensus, the blockchain node determines that the size of the pre-processed block that passed this consensus is 10 bytes. Based on the determined size of the pre-processed block that passed this consensus and the storage pointer basepointer = 1024 contained in the processing parameters corresponding to the previous consensus (i.e., the first consensus), the blockchain node can determine and store the storage pointer basepointer contained in the processing parameters corresponding to the third consensus as 1034. Accordingly, in the third consensus, the blockchain node can use the processor to store the business data contained in the pre-processed block that passed the third consensus in the storage location corresponding to the storage pointer basepointer = 1034. The subsequent consensus can be deduced in the same way.

需要说明的是,在本申请实施例中,除了可以通过本次共识的预处理块的大小,确定下一次共识对应的处理参数中包含的存储参数外,还可通过预处理块的其他信息来进行确定,具体采用哪种信息来进行确定则可由区块链节点的运维人员来决定,在此就不一一举例说明了。It should be noted that in the embodiment of the present application, in addition to determining the storage parameters included in the processing parameters corresponding to the next consensus through the size of the preprocessing block of this consensus, it can also be determined through other information of the preprocessing block. The specific information to be used for determination can be decided by the operation and maintenance personnel of the blockchain node, and examples will not be given one by one here.

需要说明的是,对于处理参数中所包含的不同参数来说,区块链节点在业务提交阶段所执行的操作,决定了这些参数是否每经过一次共识就需要发生相应的变更。如,对于上述提到的存储参数来说,由于每次共识所涉及的预处理块中包含的业务数据不可能存储在相同的存储位置中,所以,每经过一次共识后,存储参数则需要发生相应的变更。而对于上述提到的上链参数来说,无论是哪次共识所涉及的预处理块,预处理块一旦通过了共识网络的共识,则均需要将预处理块以区块的形式存储在区块链中。换句话说,无论是哪个预处理块,该预处理块一旦通过共识,则处理器均需要对该预处理块执行上链操作。所以,每经过一次共识后,该上链参数则不需要发生相应的变更,即,对于每次共识来说,上链参数可以是一致的。It's important to note that for the various parameters included in the processing parameters, the operations performed by blockchain nodes during the business submission phase determine whether these parameters require changes after each consensus. For example, regarding the storage parameters mentioned above, since the business data contained in the preprocessing blocks involved in each consensus cannot be stored in the same storage location, the storage parameters must be changed after each consensus. Regarding the on-chain parameters mentioned above, regardless of which preprocessing block is involved in the consensus, once the preprocessing block passes the consensus network, it must be stored as a block on the blockchain. In other words, regardless of which preprocessing block passes consensus, the processor must perform on-chain operations on that preprocessing block. Therefore, the on-chain parameters do not need to be changed after each consensus, meaning that the on-chain parameters can remain consistent for each consensus.

较优地,在本申请实施例中,区块链节点可将得到的下一次共识的处理参数存储在一个预设的队列中。例如,将相邻下一次业务共识的预处理块的存储参数存储在该预设的队列中。Preferably, in an embodiment of the present application, the blockchain node may store the obtained processing parameters for the next consensus in a preset queue. For example, the storage parameters of the pre-processing block of the next business consensus are stored in the preset queue.

这样一来,处理器可从该预设的队列中获取到处理参数(即获取到已通过共识的预处理块的处理参数),进而根据该处理参数所包含的存储参数,将与该存储参数对应的通过共识的预处理块中包含的业务数据进行存储。In this way, the processor can obtain the processing parameters from the preset queue (that is, obtain the processing parameters of the pre-processing block that has passed the consensus), and then store the business data contained in the pre-processing block that has passed the consensus corresponding to the storage parameters according to the storage parameters contained in the processing parameters.

其中,这里提到的预设的队列可以是先进先出队列(First Input First Output,FIFO),也可以是其他类型的队列,这里不做具体限定。处理器可获取到存储在该FIFO队列中的处理参数,并根据该处理参数中所包含的存储参数,从存储的已通过共识的预处理块中确定出与该存储参数对应的预处理块,进而根据该存储参数,将该预处理块中包含的业务数据进行存储。The preset queue mentioned here can be a first-in-first-out queue (FIFO) or other types of queues, which are not specifically limited here. The processor can obtain the processing parameters stored in the FIFO queue, and based on the storage parameters contained in the processing parameters, determine the preprocessing block corresponding to the storage parameters from the stored preprocessing blocks that have passed consensus, and then store the business data contained in the preprocessing block based on the storage parameters.

具体的,处理器可从上述FIFO队列中获取到存储参数,而后,处理器可进一步的从确定出与该存储参数对应的待处理的预处理块。例如:区块链节点在对本次共识的待共识的预处理块的共识通过时,产生该预处理块的存储参数,并确定该预处理块与该存储参数之间的对应关系,那么处理器即可根据该对应关系,确定出与该存储参数对应的待处理的预处理块。再例如:区块链节点在对本次共识的待共识的预处理块的共识通过时,产生该预处理块的存储参数,确定产生该存储参数的第一时间,并确定本次共识的待共识的预处理块的共识通过的第二时间,建立第一时间和第二时间之间的对应关系,那么处理器可以根据存储参数的产生时间,查找与该产生时间之间满足设定条件的共识处理结束时间对应的预处理块,查找出的预处理块可以确定为与该存储参数对应的待处理的预处理块。再例如:处理器从FIFO队列中获取位于队列出口最前端的存储参数,那么处理器从区块链节点的存储空间中查找存储位置排在最靠前的已通过共识的预处理块,将该预处理块确定为与该存储参数对应的预处理块。Specifically, the processor can obtain the storage parameters from the above-mentioned FIFO queue, and then the processor can further determine the pre-processing block to be processed corresponding to the storage parameters. For example: when the blockchain node passes the consensus on the pre-processing block to be agreed upon for this consensus, it generates the storage parameters of the pre-processing block and determines the corresponding relationship between the pre-processing block and the storage parameters. Then, the processor can determine the pre-processing block to be processed corresponding to the storage parameters based on the corresponding relationship. For another example: when the blockchain node passes the consensus on the pre-processing block to be agreed upon for this consensus, it generates the storage parameters of the pre-processing block, determines the first time when the storage parameters are generated, and determines the second time when the consensus on the pre-processing block to be agreed upon for this consensus is passed, and establishes a corresponding relationship between the first time and the second time. Then, the processor can search for the pre-processing block corresponding to the consensus processing end time that meets the set conditions between the generation time of the storage parameters and the generation time. The found pre-processing block can be determined as the pre-processing block to be processed corresponding to the storage parameters. For another example: the processor obtains the storage parameter at the front end of the queue exit from the FIFO queue, then the processor searches the storage space of the blockchain node for the pre-processing block that has passed consensus and has the frontmost storage location, and determines the pre-processing block as the pre-processing block corresponding to the storage parameter.

处理器在确定出与该存储参数对应的待处理的预处理块后,可根据该存储参数,将该待处理的预处理块中包含的业务数据存储在该存储参数所规定的存储位置中。After determining the pre-processing block to be processed corresponding to the storage parameter, the processor may store the service data included in the pre-processing block to be processed in a storage location specified by the storage parameter according to the storage parameter.

需要说明的是,在本申请实施例中,区块链节点除了可采用上述说明的FIFO队列来存储各处理参数外,还可通过其他的队列来进行存储,如双端队列等,在此就不一一举例说明了。It should be noted that in the embodiment of the present application, in addition to using the FIFO queue described above to store various processing parameters, the blockchain node can also use other queues for storage, such as double-ended queues, etc., which will not be explained one by one here.

处理器除了可根据获取的处理参数中包含的存储参数,对该存储参数对应的待处理的预处理块中包含的业务数据进行存储外,还可根据该处理参数中包含的其他参数,对该待处理的预处理块执行其他操作。In addition to storing the business data contained in the pre-processing block to be processed corresponding to the storage parameter contained in the acquired processing parameter, the processor can also perform other operations on the pre-processing block to be processed according to other parameters contained in the processing parameter.

例如,处理器可以根据该处理参数中的释放参数,将该待处理的预处理块中包含的业务数据从存储空间中释放。再例如,处理器可根据获取到的处理参数中包含的删除参数,将本次共识中业务共识阶段所产生的诸如预准备消息、准备消息、确认消息等进行删除,以节省区块链节点的存储空间。当然,处理器还可根据该处理参数中的其他参数来执行其他的操作,在此就不一一举例说明了。For example, the processor can release the business data contained in the pending pre-processing block from the storage space based on the release parameter in the processing parameters. For another example, the processor can delete messages such as pre-prepare messages, prepare messages, and confirmation messages generated during the business consensus phase of the current consensus based on the delete parameter in the acquired processing parameters to save storage space on the blockchain node. Of course, the processor can also perform other operations based on other parameters in the processing parameters, which will not be fully illustrated here.

2、第二类操作:根据本次共识所对应的共识参数,更新下一次共识所对应的共识参数。换句话说,区块链节点可确定出已通过本次共识的预处理块所对应的共识参数,并根据确定出的该共识参数,得到相邻下一次待共识的预处理块对应的共识参数。2. The second type of operation: Based on the consensus parameters corresponding to the current consensus, the consensus parameters corresponding to the next consensus are updated. In other words, the blockchain node can determine the consensus parameters corresponding to the pre-processed block that has passed the current consensus, and based on the determined consensus parameters, obtain the consensus parameters corresponding to the next pre-processed block to be agreed upon.

需要说明的是,在本申请实施例中,区块链节点在确定本次共识需要进行共识的预处理块通过共识验证后,除了需要根据本次共识所对应的处理参数,来得到下一次共识所对应的处理参数并存储外,还可根据本次共识所对应的共识参数,更新下一次共识所对应的共识参数。换句话说,区块链节点可确定出已通过本次共识的预处理块所对应的共识参数,并根据确定出的该共识参数,得到相邻下一次待共识的预处理块对应的共识参数。It should be noted that in the embodiments of the present application, after the blockchain node determines that the pre-processed block required for the current consensus has passed consensus verification, in addition to obtaining and storing the processing parameters corresponding to the next consensus based on the processing parameters corresponding to the current consensus, the blockchain node can also update the consensus parameters corresponding to the next consensus based on the consensus parameters corresponding to the current consensus. In other words, the blockchain node can determine the consensus parameters corresponding to the pre-processed block that has passed the current consensus, and based on the determined consensus parameters, obtain the consensus parameters corresponding to the next adjacent pre-processed block to be agreed upon.

其中,这里提到的共识参数可以理解为一次共识所对应的属性信息。例如,以PBFT共识举例说明,在PBFT共识过程中,一次共识通常对应有一个视图编号v,该视图编号v用于唯一标识这一次共识。在一次共识中,无论共识网络中的哪个区块链节点作为主节点,其生成的预处理块中所包含的上一个区块的头Hash通常都是当前位于区块链上最后一个区块的头Hash。对于这里提到的视图编号v以及上一个区块的头Hash,则可以称之为本次共识所对应的共识参数。The consensus parameters mentioned here can be understood as the attribute information corresponding to a consensus. For example, in the PBFT consensus process, each consensus is typically associated with a view number v, which uniquely identifies this consensus. During a consensus, regardless of which blockchain node in the consensus network serves as the master node, the header hash of the previous block included in the preprocessed block it generates is typically the header hash of the last block currently on the blockchain. The view number v and the header hash of the previous block mentioned here can be referred to as the consensus parameters corresponding to this consensus.

当然,共识参数除了可包含有上述说明的视图编号v以及上一个区块的头Hash外,还可包含有其他的信息,而对于不同共识方式来说,共识参数中所包含的内容也存在一定的差异,具体就不进行详细说明了。Of course, in addition to the view number v and the header Hash of the previous block described above, the consensus parameters can also contain other information. For different consensus methods, the content contained in the consensus parameters also varies to a certain extent, so I will not explain them in detail.

区块链节点在确定本次共识的预处理块通过共识验证后,可进一步的确定出本次共识所对应的共识参数,进而通过更新该共识参数的方式,得到下一次共识所对应的共识参数,也即,得到相邻下一次待共识的预处理块对应的共识参数。After determining that the pre-processing block of this consensus has passed the consensus verification, the blockchain node can further determine the consensus parameters corresponding to this consensus, and then obtain the consensus parameters corresponding to the next consensus by updating the consensus parameters, that is, obtain the consensus parameters corresponding to the next adjacent pre-processing block to be agreed upon.

还以PBFT共识方式为例,假设在本次共识所对应的共识参数中包含有视图编号v以及上一个区块的头Hash,其中,视图编号v为16、上一个区块的头Hash为0929d9sldom23oix239xed。区块链节点在确定出本次共识所涉及的预处理块通过共识验证后,可将视图编号16更新为17,并根据预处理块中包含的该预处理块的头Hash:679xx9a9a8dfa23389xx34,将下一次共识所基于的区块的头Hash更新为679xx9a9a8dfa23389xx34。这样一来,下一次共识所对应的共识参数应为:视图编号v:17、上一个区块的头Hash:679xx9a9a8dfa23389xx34。Taking PBFT consensus as an example, assume that the consensus parameters for the current consensus include the view number v and the previous block's header hash. For example, view number v is 16, and the previous block's header hash is 0929d9sldom23oix239xed. After the blockchain node determines that the preprocessed block involved in the current consensus has passed consensus verification, it can update view number 16 to 17 and, based on the preprocessed block's header hash: 679xx9a9a8dfa23389xx34, update the header hash of the block used for the next consensus to 679xx9a9a8dfa23389xx34. Therefore, the consensus parameters for the next consensus should be: view number v: 17, previous block's header hash: 679xx9a9a8dfa23389xx34.

由于区块链节点能够根据本次共识所对应的共识参数,得到下一次共识所对应的共识参数,这样一来,该区块链节点可以根据得到的下一次共识所对应的共识参数,启动对相邻下一次待共识的预处理块进行共识。其中,这里提到的共识参数可以存储在内存中,也可以存储在区块链节点所对应的数据库中,当然还可以全局变量的方式存在。Since blockchain nodes can obtain the consensus parameters for the next consensus based on the consensus parameters corresponding to the current consensus, the blockchain node can then initiate consensus on the adjacent pre-processed blocks to be agreed upon based on the consensus parameters corresponding to the next consensus. The consensus parameters mentioned here can be stored in memory, in the database corresponding to the blockchain node, or in the form of global variables.

需要说明的是,在本申请实施例中,该共识参数也可以与处理参数对应存储在上述预设的队列中。这样一来,用于共识处理的处理器可以从该预设的队列中获取到共识参数,并根据共识参数,启动一次新的共识处理;用于数据处理的处理器从该预设的队列中获取到处理参数,进而根据获取到的处理参数,启动对该处理参数对应的预处理块中包含的业务数据进行数据处理。It should be noted that, in the embodiment of the present application, the consensus parameters may also be stored in the above-mentioned preset queue in correspondence with the processing parameters. In this way, the processor for consensus processing can obtain the consensus parameters from the preset queue and start a new consensus process based on the consensus parameters; the processor for data processing can obtain the processing parameters from the preset queue and, based on the obtained processing parameters, start data processing of the business data contained in the pre-processing block corresponding to the processing parameters.

例如,假设处理器从FIFO队列中获取到一个处理参数以及与之对应的共识参数,该共识参数中包含有视图编号v,这样一来,该处理器可以从区块链节点自身的存储空间中,确定出与该视图编号v相对应的待处理的预处理块,进而根据获取到处理参数,对该待处理的预处理块进行处理。For example, suppose the processor obtains a processing parameter and a corresponding consensus parameter from the FIFO queue, and the consensus parameter includes a view number v. In this way, the processor can determine the pre-processing block to be processed corresponding to the view number v from the storage space of the blockchain node itself, and then process the pre-processing block to be processed according to the obtained processing parameter.

当然,在本申请实施例中,处理参数也可不存在上述提到的预设的队列中,如,可将处理参数存储在区块链节点的自身内存中,也可将该处理参数存储在区块链节点所对应的数据库中,抑或是存储在区块链节点的其他位置中,在此就不一一举例说明了。Of course, in the embodiment of the present application, the processing parameters may not exist in the preset queue mentioned above. For example, the processing parameters may be stored in the blockchain node's own memory, or in a database corresponding to the blockchain node, or in other locations of the blockchain node. Examples are not given here one by one.

从上述方法中可以看出,由于区块链节点在确定获取到的预处理块通过共识后,采用并行处理方式,启动对相邻下一次待共识的预处理块进行共识,并且对已通过共识的预处理块中包含的业务数据进行处理。换句话说,区块链节点实现了业务数据在业务共识阶段以及业务提交阶段的并行处理,既能够对一部分业务数据执行业务提交阶段的数据处理,同时又可执行另一部分业务数据的业务共识阶段的共识处理,这样能够缩短相邻两次业务共识阶段的共识处理的时间间隔,从而有效提升了系统的业务数据处理效率。As can be seen from the above method, after the blockchain node determines that the acquired pre-processing block has passed consensus, it uses parallel processing to initiate consensus on the next adjacent pre-processing block to be reached, and then processes the business data contained in the pre-processing block that has passed consensus. In other words, the blockchain node implements parallel processing of business data in the business consensus stage and the business submission stage. It can simultaneously perform data processing in the business submission stage on a portion of business data while simultaneously performing consensus processing in the business consensus stage on another portion of business data. This shortens the time interval between consensus processing in two adjacent business consensus stages, thereby effectively improving the system's business data processing efficiency.

为了进一步的说明本申请所提到的数据处理方法,下面将详细简明的说明该数据处理方法所涉及的各过程,如图2所示。In order to further illustrate the data processing method mentioned in this application, the various processes involved in the data processing method will be briefly described in detail below, as shown in Figure 2.

图2为本申请实施例所提供的区块链节点进行数据处理的示意图。FIG2 is a schematic diagram of data processing performed by a blockchain node provided in an embodiment of the present application.

在业务受理阶段中,用户可通过终端中安装的客户端向区块链节点发送业务数据,而区块链节点可将接收到业务数据进行验证,并将验证通过的业务数据存储在自身对应的存储空间中进行保存。During the business acceptance stage, users can send business data to the blockchain node through the client installed in the terminal, and the blockchain node can verify the received business data and store the verified business data in its own corresponding storage space for storage.

在业务共识阶段中,区块链节点可获取到在本次共识中待共识的预处理块,其中,若该区块链节点作为发起此次共识的主节点时,可从自身的存储空间中捞取一部分业务数据,并将这部分业务数据打包成预处理块,此时该区块链节点将获取到需要在本次共识中进行共识的预处理块。与此同时,该区块链节点需要将该预处理块通过广播的方式发送至共识网络中的其他区块链节点中,以使其他的区块链节点对该预处理块进行共识验证。During the business consensus phase, blockchain nodes can obtain pre-processed blocks to be agreed upon in this consensus. If the blockchain node is the master node initiating this consensus, it can retrieve a portion of business data from its own storage space and package this data into pre-processed blocks. At this time, the blockchain node will obtain the pre-processed blocks that need to be agreed upon in this consensus. At the same time, the blockchain node needs to broadcast this pre-processed block to other blockchain nodes in the consensus network so that other blockchain nodes can verify the consensus of the pre-processed block.

若该区块链节点并非发起此次共识的主节点,则可从发起此次共识的主节点获取到需要在本次业务共识中进行共识的预处理块,继而对该预处理块进行共识验证。If the blockchain node is not the master node that initiated this consensus, it can obtain the pre-processed block that needs to be agreed upon in this business consensus from the master node that initiated this consensus, and then perform consensus verification on the pre-processed block.

区块链节点在确定该预处理块通过共识验证后,可根据本次共识所对应的共识参数(也即该预处理块所对应的共识参数),更新得到下一次共识所对应的共识参数(也即相邻下一次待共识的预处理块对应的共识参数),以备下一次共识所使用。不仅如此,区块链节点还可根据该预处理块以及本次共识所对应的处理参数(即该已通过本次共识的预处理块对应的处理参数),得到下一次共识所对应的处理参数(即相邻下一次待共识的预处理块所对应的处理参数),并将得到的下一次共识所对应的处理参数存储在FIFO队列中。After determining that the pre-processed block has passed consensus verification, the blockchain node can update the consensus parameters corresponding to the next consensus (i.e., the consensus parameters corresponding to the next pre-processed block to be reached) based on the consensus parameters corresponding to the current consensus (i.e., the consensus parameters corresponding to the pre-processed block), in preparation for the next consensus. Furthermore, the blockchain node can also obtain the processing parameters corresponding to the next consensus (i.e., the processing parameters corresponding to the next pre-processed block to be reached) based on the pre-processed block and the processing parameters corresponding to the current consensus (i.e., the processing parameters corresponding to the pre-processed block that has passed the current consensus), and store the obtained processing parameters corresponding to the next consensus in the FIFO queue.

区块链节点在得到相邻下一次共识对应的共识参数以及处理参数的过程中,可启动执行相邻下一次共识的业务共识阶段,即,启动对相邻下一次待共识的预处理块进行共识。而区块链节点在启动执行相邻下一次共识的业务共识阶段中,可以通过处理器,实现对本次共识中的业务提交阶段执行并行操作。When a blockchain node obtains the consensus parameters and processing parameters for the next consensus, it can initiate the business consensus phase of the next consensus. This means it can initiate consensus on the pre-processed blocks for the next consensus. During this phase, the blockchain node can use its processor to execute operations in parallel with the business submission phase of the current consensus.

换句话说,区块链节点将业务提交阶段所涉及的操作交给了处理器来完成,而自身则可进行相邻的下一次共识,从而实现了一次共识中,业务共识阶段和业务提交阶段的并行处理,缩短了两次相邻共识之间的时间间隔,进而提高了共识效率。In other words, the blockchain node hands over the operations involved in the business submission phase to the processor to complete, while it can itself perform the next adjacent consensus, thereby achieving parallel processing of the business consensus phase and the business submission phase in one consensus, shortening the time interval between two adjacent consensuses, and thus improving consensus efficiency.

处理器可从FIFO队列中获取到本次共识所对应的处理参数,进而根据该处理参数中包含的上链参数,将通过本次共识的预处理块以区块的形式存储在区块链中;处理器可根据该处理参数中包含的是否参数以及存储参数,将该预处理块中包含的业务数据从区块链节点自身的存储空间中进行释放,并将释放出的业务数据按照该存储参数中的规定,存储在相应的存储位置中;处理器可根据该处理属性中包含的删除参数,将业务共识阶段所产生的诸如PBFT共识的预准备消息、准备消息、确认消息等进行删除,以节省区块链节点的存储空间。The processor can obtain the processing parameters corresponding to this consensus from the FIFO queue, and then store the pre-processed block that passes this consensus in the form of a block in the blockchain according to the on-chain parameters contained in the processing parameters; the processor can release the business data contained in the pre-processed block from the storage space of the blockchain node itself according to the whether parameter and storage parameter contained in the processing parameters, and store the released business data in the corresponding storage location according to the provisions of the storage parameters; the processor can delete the pre-prepare messages, prepare messages, confirmation messages, etc. generated in the business consensus stage, such as PBFT consensus, according to the deletion parameters contained in the processing attributes, to save the storage space of the blockchain node.

以上为本申请实施例提供的数据处理方法,基于同样的思路,本申请实施例还提供数据处理的装置,如图3所示。The above is the data processing method provided in the embodiment of the present application. Based on the same idea, the embodiment of the present application also provides a data processing device, as shown in Figure 3.

图3为本申请实施例提供的一种数据处理的装置示意图,具体包括:FIG3 is a schematic diagram of a data processing device provided in an embodiment of the present application, specifically comprising:

获取模块301,获取待共识的预处理块,并对所述预处理块进行共识;An acquisition module 301 acquires a pre-processed block to be consensus-based and performs consensus on the pre-processed block;

处理模块302,若确定所述预处理块通过共识,则启动对下一次待共识的预处理块进行共识,以及并行对已通过共识的预处理块中包含的业务数据进行数据处理。Processing module 302, if it is determined that the pre-processing block has passed the consensus, starts consensus on the next pre-processing block to be agreed upon, and concurrently processes the business data contained in the pre-processing block that has passed the consensus.

所述处理模块302,通过预设的处理器并行对所述已通过共识的预处理块中包含的业务数据进行数据处理。The processing module 302 processes the business data contained in the pre-processing block that has passed the consensus in parallel through a preset processor.

所述处理模块302,针对所述已通过共识的预处理块,执行以下操作:调用处理器获取存储参数,所述存储参数中包含存储位置;根据所述存储参数,确定与所述存储参数对应的待处理的预处理块,并将确定的所述待处理的预处理块中包含的业务数据存储在所述存储位置中。The processing module 302 performs the following operations for the pre-processing block that has passed consensus: calling a processor to obtain storage parameters, where the storage parameters include a storage location; determining a pre-processing block to be processed corresponding to the storage parameters based on the storage parameters, and storing the business data included in the determined pre-processing block to be processed in the storage location.

所述获取模块301,在确定所述预处理块通过共识后,根据所述预处理块以及所述预处理块的存储参数,确定相邻下一次共识的预处理块的存储参数,并存储。After determining that the pre-processed block has passed the consensus, the acquisition module 301 determines the storage parameters of the next consensus pre-processed block based on the pre-processed block and the storage parameters of the pre-processed block, and stores them.

所述获取模块301,将相邻下一次共识的预处理块的存储参数存储在先进先出FIFO队列中。The acquisition module 301 stores the storage parameters of the pre-processing block adjacent to the next consensus in a first-in-first-out (FIFO) queue.

所述处理模块302,调用所述处理器从所述FIFO队列中获取存储参数。The processing module 302 calls the processor to obtain storage parameters from the FIFO queue.

所述获取模块301,若确定所述预处理块通过共识,则确定所述预处理块对应的共识参数,并根据确定的所述预处理块对应的共识参数,得到相邻下一次待共识的预处理块对应的共识参数,所述共识参数用于指示所述区块链节点对待共识的预处理块进行共识。The acquisition module 301 determines the consensus parameters corresponding to the pre-processing block if it is determined that the pre-processing block has passed the consensus, and obtains the consensus parameters corresponding to the next adjacent pre-processing block to be agreed upon based on the determined consensus parameters corresponding to the pre-processing block. The consensus parameters are used to instruct the blockchain nodes to reach a consensus on the pre-processing block to be agreed upon.

所述处理模块302,在得到相邻下一次待共识的预处理块对应的共识参数时,基于得到的所述共识参数,启动对相邻下一次待共识的预处理块进行共识。The processing module 302, when obtaining the consensus parameters corresponding to the adjacent pre-processed block to be agreed upon next time, starts consensus on the adjacent pre-processed block to be agreed upon next time based on the obtained consensus parameters.

基于同样的思路,本申请实施例还提供另一种数据处理的装置,具体包括:Based on the same idea, the embodiment of the present application also provides another data processing device, specifically including:

存储器和至少一个处理器,其中:所述存储器存储有程序,并被配置成由所述至少一个处理器执行以下步骤:A memory and at least one processor, wherein the memory stores a program and is configured to cause the at least one processor to execute the following steps:

获取待共识的预处理块,并对所述预处理块进行共识;Obtaining a pre-processed block to be consensused, and performing consensus on the pre-processed block;

若确定所述预处理块通过共识,则启动对下一次待共识的预处理块进行共识,以及并行对已通过共识的预处理块中包含的业务数据进行数据处理。If it is determined that the pre-processed block has passed the consensus, the consensus process for the next pre-processed block to be reached is initiated, and data processing is performed on the business data contained in the pre-processed block that has passed the consensus in parallel.

其中,处理器通过存储器存储的程序所执行的具体操作可以参照上述实施例中所记载的内容,在此则不再赘述。The specific operations performed by the processor through the program stored in the memory can refer to the contents recorded in the above embodiments, which will not be repeated here.

在本申请实施例中,区块链节点在确定获取到的预处理块通过共识后,可启动对下一次待共识的预处理块进行共识,以通过并行的方式对已通过共识的预处理块中包含的业务数据进行数据处理。由于区块链节点在确定获取到的预处理块通过共识后,采用并行处理方式,启动对下一次待共识的预处理块进行共识,并且对已通过共识的预处理块中包含的业务数据进行处理。换句话说,区块链节点实现了业务数据在业务共识阶段以及业务提交阶段的并行处理,既能够对一部分业务数据执行业务提交阶段的数据处理,同时又可执行另一部分业务数据的业务共识阶段的共识处理,这样能够缩短两次业务共识阶段的共识处理的时间间隔,从而有效提升了系统的业务数据处理效率。In an embodiment of the present application, after determining that the acquired pre-processing block has passed the consensus, the blockchain node can start the consensus on the next pre-processing block to be agreed upon, so as to perform data processing on the business data contained in the pre-processing block that has passed the consensus in a parallel manner. Because the blockchain node adopts a parallel processing method after determining that the acquired pre-processing block has passed the consensus, it starts the consensus on the next pre-processing block to be agreed upon, and processes the business data contained in the pre-processing block that has passed the consensus. In other words, the blockchain node realizes the parallel processing of business data in the business consensus stage and the business submission stage, and can perform data processing in the business submission stage on a part of the business data, and at the same time perform consensus processing in the business consensus stage on another part of the business data. This can shorten the time interval between the consensus processing in the two business consensus stages, thereby effectively improving the business data processing efficiency of the system.

在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware DescriptionLanguage)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(RubyHardware Description Language)等,目前最普遍使用的是VHDL(Very-High-SpeedIntegrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and/or hardware.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims (13)

1.一种数据处理的方法,包括:1. A data processing method, comprising: 区块链节点获取待共识的预处理块,并对所述预处理块进行共识;Blockchain nodes obtain preprocessed blocks to be reached in consensus and reach a consensus on the preprocessed blocks; 若确定所述预处理块通过共识,则确定所述预处理块对应的共识参数,并根据所述预处理块对应的共识参数,得到相邻下一次待共识的预处理块对应的共识参数,根据所述待共识的预处理块对应的共识参数启动对下一次待共识的预处理块进行共识,同时获取针对通过共识的预处理块的处理参数,通过预设的处理器基于所述处理参数并行对已通过共识的预处理块中包含的业务数据进行数据处理。If the preprocessing block is determined to have passed consensus, then the consensus parameters corresponding to the preprocessing block are determined, and the consensus parameters corresponding to the next preprocessing block to be reached are obtained based on the consensus parameters corresponding to the preprocessing block. Consensus is initiated for the next preprocessing block to be reached based on the consensus parameters corresponding to the preprocessing block to be reached. At the same time, the processing parameters for the preprocessing blocks that have passed consensus are obtained, and the business data contained in the preprocessing blocks that have passed consensus are processed in parallel by a preset processor based on the processing parameters. 2.如权利要求1所述的方法,通过预设的处理器并行对所述已通过共识的预处理块中包含的业务数据进行数据处理,具体包括:2. The method as described in claim 1, wherein the business data contained in the preprocessing block that has passed consensus is processed in parallel by a preset processor, specifically including: 针对所述已通过共识的预处理块,执行以下操作:For the preprocessing block that has passed consensus, perform the following operations: 调用处理器获取存储参数,所述存储参数中包含存储位置;The processor is invoked to obtain storage parameters, which include the storage location. 根据所述存储参数,确定与所述存储参数对应的待处理的预处理块,并将确定的所述待处理的预处理块中包含的业务数据存储在所述存储位置中。Based on the storage parameters, a preprocessing block to be processed corresponding to the storage parameters is determined, and the business data contained in the determined preprocessing block to be processed is stored in the storage location. 3.如权利要求1至2任一项所述的方法,所述方法还包括:3. The method according to any one of claims 1 to 2, further comprising: 在确定所述预处理块通过共识后,根据所述预处理块以及所述预处理块的存储参数,确定相邻下一次共识的预处理块的存储参数,并存储。After the preprocessing block passes consensus, the storage parameters of the next adjacent preprocessing block for consensus are determined and stored based on the preprocessing block and its storage parameters. 4.如权利要求3所述的方法,存储相邻下一次共识的预处理块的存储参数,具体包括:4. The method as described in claim 3, wherein storing the storage parameters of the preprocessing block for the next consensus iteration specifically includes: 将相邻下一次共识的预处理块的存储参数存储在先进先出FIFO队列中。The storage parameters of the preprocessed blocks for the next consensus are stored in a first-in-first-out (FIFO) queue. 5.如权利要求4所述的方法,调用处理器获取存储参数,具体包括:5. The method as described in claim 4, wherein calling the processor to obtain storage parameters specifically includes: 调用所述处理器从所述FIFO队列中获取存储参数。The processor is invoked to retrieve storage parameters from the FIFO queue. 6.如权利要求1所述的方法,启动对下一次待共识的预处理块进行共识,包括:6. The method as described in claim 1, initiating consensus on the next preprocessing block to be reached, comprising: 在得到相邻下一次待共识的预处理块对应的共识参数时,基于得到的所述共识参数,启动对相邻下一次待共识的预处理块进行共识。Upon obtaining the consensus parameters corresponding to the next adjacent preprocessing block to be reached, consensus is initiated for the next adjacent preprocessing block to be reached based on the obtained consensus parameters. 7.一种数据处理的装置,包括:7. A data processing apparatus, comprising: 获取模块,获取待共识的预处理块,并对所述预处理块进行共识;The acquisition module acquires the preprocessed block to be consensus-reached and performs consensus-reaching on the preprocessed block; 处理模块,若确定所述预处理块通过共识,则确定所述预处理块对应的共识参数,并根据所述预处理块对应的共识参数,得到相邻下一次待共识的预处理块对应的共识参数,根据所述待共识的预处理块对应的共识参数启动对下一次待共识的预处理块进行共识,同时获取针对通过共识的预处理块的处理参数,通过预设的处理器基于所述处理参数并行对已通过共识的预处理块中包含的业务数据进行数据处理。The processing module determines the consensus parameters corresponding to the preprocessing block if it is determined that the preprocessing block has passed consensus. Based on the consensus parameters corresponding to the preprocessing block, it obtains the consensus parameters corresponding to the next preprocessing block to be reached for consensus. Based on the consensus parameters corresponding to the preprocessing block to be reached for consensus, it initiates consensus on the next preprocessing block to be reached for consensus. At the same time, it obtains the processing parameters for the preprocessing blocks that have passed consensus. Based on the processing parameters, the preset processor performs parallel data processing on the business data contained in the preprocessing blocks that have passed consensus. 8.如权利要求7所述的装置,所述处理模块,针对所述已通过共识的预处理块,执行以下操作:调用处理器获取存储参数,所述存储参数中包含存储位置;根据所述存储参数,确定与所述存储参数对应的待处理的预处理块,并将确定的所述待处理的预处理块中包含的业务数据存储在所述存储位置中。8. The apparatus of claim 7, wherein the processing module performs the following operations on the preprocessing block that has passed consensus: calling the processor to obtain storage parameters, the storage parameters including a storage location; determining the preprocessing block to be processed corresponding to the storage parameters according to the storage parameters, and storing the business data contained in the determined preprocessing block to be processed in the storage location. 9.如权利要求7至8任一项所述的装置,所述获取模块,在确定所述预处理块通过共识后,根据所述预处理块以及所述预处理块的存储参数,确定相邻下一次共识的预处理块的存储参数,并存储。9. The apparatus according to any one of claims 7 to 8, wherein the acquisition module, after determining that the preprocessing block has passed consensus, determines the storage parameters of the next adjacent preprocessing block for consensus based on the preprocessing block and the storage parameters of the preprocessing block, and stores them. 10.如权利要求9所述的装置,所述获取模块,将相邻下一次共识的预处理块的存储参数存储在先进先出队列FIFO队列中。10. The apparatus of claim 9, wherein the acquisition module stores the storage parameters of the preprocessing block of the next consensus in a first-in-first-out (FIFO) queue. 11.如权利要求10所述的装置,所述处理模块,调用所述处理器从所述FIFO队列中获取存储参数。11. The apparatus of claim 10, wherein the processing module calls the processor to obtain storage parameters from the FIFO queue. 12.如权利要求7所述的装置,所述处理模块,在得到相邻下一次待共识的预处理块对应的共识参数时,基于得到的所述共识参数,启动对相邻下一次待共识的预处理块进行共识。12. The apparatus of claim 7, wherein the processing module, upon obtaining the consensus parameters corresponding to the next adjacent preprocessing block to be reached for consensus, initiates consensus processing for the next adjacent preprocessing block to be reached for consensus based on the obtained consensus parameters. 13.一种数据处理的装置,包括:存储器和至少一个处理器,其中:所述存储器存储有程序,并被配置成由所述至少一个处理器执行以下步骤:13. A data processing apparatus, comprising: a memory and at least one processor, wherein: the memory stores a program and is configured to be executed by the at least one processor of the following steps: 获取待共识的预处理块,并对所述预处理块进行共识;Obtain the preprocessed block to be consensused, and reach a consensus on the preprocessed block; 若确定所述预处理块通过共识,则确定所述预处理块对应的共识参数,并根据所述预处理块对应的共识参数,得到相邻下一次待共识的预处理块对应的共识参数,根据所述待共识的预处理块对应的共识参数启动对下一次待共识的预处理块进行共识,同时获取针对通过共识的预处理块的处理参数,通过预设的处理器基于所述处理参数并行对已通过共识的预处理块中包含的业务数据进行数据处理。If the preprocessing block is determined to have passed consensus, then the consensus parameters corresponding to the preprocessing block are determined, and the consensus parameters corresponding to the next preprocessing block to be reached are obtained based on the consensus parameters corresponding to the preprocessing block. Consensus is initiated for the next preprocessing block to be reached based on the consensus parameters corresponding to the preprocessing block to be reached. At the same time, the processing parameters for the preprocessing blocks that have passed consensus are obtained, and the business data contained in the preprocessing blocks that have passed consensus are processed in parallel by a preset processor based on the processing parameters.
HK18106598.3A 2018-05-21 Data processing method and device HK1247325B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
HK18106598.3A HK1247325B (en) 2018-05-21 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
HK18106598.3A HK1247325B (en) 2018-05-21 Data processing method and device

Publications (2)

Publication Number Publication Date
HK1247325A1 HK1247325A1 (en) 2018-09-21
HK1247325B true HK1247325B (en) 2021-03-26

Family

ID=

Similar Documents

Publication Publication Date Title
TWI697227B (en) Data processing method and device
TWI679547B (en) Block chain business acceptance and business consensus method and device
KR102208186B1 (en) Blockchain consensus method and device
WO2018177250A1 (en) Block chain based data processing method and device
TW201935343A (en) File processing method, device, and equipment
US20200143361A1 (en) Virtual card opening method and system, payment system, and card issuing system
CN107391527A (en) A kind of data processing method and equipment based on block chain
TWI679581B (en) Method and device for task execution
TW201944314A (en) Payment process configuration and execution method, apparatus and device
WO2021143397A1 (en) Resource reuse method, apparatus and device based on gpu virtualization
WO2024250650A1 (en) Heterogeneous chip task scheduling method and apparatus based on sequence generation
WO2025044317A1 (en) Method and apparatus for accelerating model training, storage medium, and electronic device
CN116166614A (en) Log archiving method and device, storage medium and electronic equipment
CN115408468A (en) Data synchronization method and device, readable storage medium and electronic equipment
HK1247325B (en) Data processing method and device
CN111967767A (en) Business risk identification method, device, equipment and medium
CN109614388B (en) A budget deduction method and device
CN114443180A (en) Service processing method and device
HK1247325A1 (en) Data processing method and device
HK1247457B (en) Block chain service acceptance and consensus methods and devices
HK1247301B (en) Data processing method and equipment based on blockchain
HK1247300B (en) Data processing method and equipment based on blockchain
HK40039065B (en) Blockchain consensus method and device
HK1247357B (en) Block chain consensus method and device
HK1248349B (en) Data processing method and equipment based on blockchain