HK1246533B - Blockchain consensus method, device and system - Google Patents
Blockchain consensus method, device and system Download PDFInfo
- Publication number
- HK1246533B HK1246533B HK18105853.5A HK18105853A HK1246533B HK 1246533 B HK1246533 B HK 1246533B HK 18105853 A HK18105853 A HK 18105853A HK 1246533 B HK1246533 B HK 1246533B
- Authority
- HK
- Hong Kong
- Prior art keywords
- consensus
- unit
- business data
- reached
- units
- Prior art date
Links
Description
技术领域Technical Field
本申请涉及计算机软件技术领域,尤其涉及一种区块链共识方法、设备及系统。The present application relates to the field of computer software technology, and in particular to a blockchain consensus method, device, and system.
背景技术Background Art
区块链最初是为比特币而设计出的一种分布式数据库技术,这种数据结构尤其适合存储有先后顺序且能在系统内进行验证的数据形式,并且这种数据结构利用共识算法保证数据的不可篡改和不可伪造。而共识算法是需要区块链中的节点参加的,通过多个节点共同计算,达成共识的算法。举例来说,某个记账节点在接收到业务数据时,将该业务数据广播给其他参与节点,其他参与节点对其是否有该记账节点拥有该业务数据的记账权进行共识,若其他参与节点的共识结果是该记账节点拥有该业务数据的记账权,那么该记账节点将该业务数据存储在该记账节点对应的区块链中。由此可见,在区块链技术中,共识算法是区块链中程序或者节点的宪法,保证当任何状况出现的时候,各个节点之间能够协作一致。Blockchain, a distributed database technology originally designed for Bitcoin, is particularly well-suited for storing sequentially verifiable data within the system. It also utilizes consensus algorithms to ensure that data cannot be tampered with or forged. Consensus algorithms require the participation of nodes within a blockchain, reaching consensus through a collaborative computation. For example, upon receiving business data, a ledger node broadcasts it to other participating nodes, who then reach consensus on whether it holds the right to record the data. If the consensus is that the node holds the right to record the data, it stores the data in its corresponding blockchain. Therefore, in blockchain technology, the consensus algorithm serves as the constitution of the blockchain's programs or nodes, ensuring that all nodes can collaborate and agree upon any situation.
实用拜占庭容错算法(Practical Byzantine Fault Tolerance,缩写为PBFT)是区块链中一种常用的共识算法。PBFT算法在保证活性和安全性的前提下能够提供一定的容错性,因此得到广泛使用。在PBFT算法中,一个节点是主节点,其余的节点为备份节点。主节点负责将接收到的业务请求进行排序,然后按照排序结果将业务请求广播备份节点。通常在PBFT算法中包含三个阶段:pre-prepare,prepare,commit。pre-prepare阶段和prepare阶段就是用来为业务请求确定排列顺序的。Practical Byzantine Fault Tolerance (PBFT) is a commonly used consensus algorithm in blockchains. PBFT offers a certain degree of fault tolerance while ensuring liveness and security, leading to its widespread use. In PBFT, one node is the master node, and the remaining nodes are backup nodes. The master node is responsible for sorting received service requests and then broadcasting them to the backup nodes based on the sorting results. The PBFT algorithm typically consists of three phases: pre-prepare, prepare, and commit. The pre-prepare and prepare phases are used to determine the order of service requests.
但是主节点在对业务请求进行排序时可能会出错,例如:给不同的业务请求编上相同的序号,或者给有些业务请求不分配序号,或者让相邻的业务请求的序号不连续等等。那么备份节点在接收到有序的业务请求时需要对业务请求的顺序进行验证。However, the master node may make mistakes when sorting service requests. For example, it may assign the same sequence number to different service requests, or not assign sequence numbers to some service requests, or assign discontinuous sequence numbers to adjacent service requests, etc. Therefore, the backup node needs to verify the order of service requests when receiving ordered service requests.
由此可以看出,PBFT算法在保障顺序方面做了大量的设计和计算。经研究发现,目前使用的很多共识算法(例如:工作量证明机制、权益证明机制等共识机制)在进行共识时都需要在顺序方面做大量的设计和计算,消耗较多的系统资源。This shows that the PBFT algorithm has done a lot of design and calculation to ensure order. Research has found that many consensus algorithms currently in use (such as proof-of-work and proof-of-stake) require extensive design and calculation for order during consensus, consuming a large amount of system resources.
然而在实际应用中存在大量无序要求的业务请求。所谓无序要求的业务请求是指服务器在接收到的业务请求时,无需按照受理时间的先后顺序对接收到的业务请求进行处理。例如:慈善捐款交易业务、无上限额度的众筹交易业务等,以慈善捐款交易业务为例,谁在先捐款谁在后捐款对业务处理是没有影响的,因此将这类业务请求可以称之为没有顺序要求的业务请求(简称为无序要求的业务请求)。在区块链中对这类业务请求进行处理时,利用目前的共识算法将导致这类业务处理的效率比较低,同时也影响区块链共识的吞吐量。However, in real-world applications, a large number of business requests require no order. These are business requests that the server does not necessarily process in the order in which they were received. For example, charitable donation transactions and crowdfunding transactions with unlimited amounts have no impact on the processing of the transaction. Therefore, these business requests are referred to as business requests with no order requirements (abbreviated as "business requests with no order requirements"). When processing these business requests in a blockchain, using current consensus algorithms results in relatively low efficiency, which also affects the throughput of blockchain consensus.
发明内容Summary of the Invention
有鉴于此,本申请实施例提供了一种区块链共识方法、设备及系统,用于解决现有技术中存在利用共识算法对无序要求的业务请求进行处理存在处理效率低的问题。In view of this, the embodiments of the present application provide a blockchain consensus method, device and system for solving the problem of low processing efficiency in the prior art of using consensus algorithms to process business requests with disordered requirements.
第一方面,在本申请实施例中提出了一种区块链共识方法,包括:In the first aspect, a blockchain consensus method is proposed in the embodiments of the present application, including:
获取待共识的业务数据;Obtain business data to be agreed upon;
按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。According to a preset allocation rule, the business data to be agreed upon is allocated to at least one consensus unit in the consensus unit set, and the consensus unit is used to perform consensus processing on the allocated business data to be agreed upon.
在本申请实施例中还提出了一种区块链共识方法,包括:In the embodiment of the present application, a blockchain consensus method is also proposed, including:
获取至少一个待共识的业务数据;Obtain at least one piece of business data to be agreed upon;
按照预设的分配规则,并行地将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。According to a preset allocation rule, the business data to be agreed upon is allocated in parallel to at least one consensus unit in the consensus unit set, and the consensus unit is used to perform consensus processing on the allocated business data to be agreed upon.
在本申请实施例中还提出了一种基于区块链的数据存储方法,包括:In the embodiment of the present application, a data storage method based on blockchain is also proposed, including:
接收不同的共识单元发送的共识结果;Receive consensus results sent by different consensus units;
根据所述共识结果的时间戳,将所述共识结果存储至所述区块链中的区块中。According to the timestamp of the consensus result, the consensus result is stored in a block in the blockchain.
第二方面,在本申请实施例中还提出了一种区块链共识系统,所述共识系统包括:分配单元和包含共识单元的共识单元集合,其中:In a second aspect, a blockchain consensus system is also proposed in an embodiment of the present application. The consensus system includes: an allocation unit and a consensus unit set including a consensus unit, wherein:
所述分配单元,获取待共识的业务数据,并按照预设的分配规则,将所述待共识的业务数据分配给所述共识单元集合中的至少一个共识单元;The allocation unit obtains the business data to be agreed upon, and allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule;
所述共识集合中包含的共识单元,对分配到的所述待共识的业务数据进行共识处理。The consensus units included in the consensus set perform consensus processing on the allocated business data to be agreed upon.
第三方面,本申请实施例还提供了一种区块链共识设备,包括:In a third aspect, the present application also provides a blockchain consensus device, including:
获取单元,获取待共识的业务数据;Acquisition unit, obtains the business data to be agreed upon;
处理单元,按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。The processing unit allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, and the consensus unit is used to perform consensus processing on the allocated business data to be agreed upon.
本申请实施例还提供了一种区块链共识设备,包括:The present application also provides a blockchain consensus device, including:
获取单元,获取至少一个待共识的业务数据;An acquisition unit, which acquires at least one piece of business data to be agreed upon;
处理单元,按照预设的分配规则,并行地将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。The processing unit distributes the business data to be agreed upon to at least one consensus unit in the consensus unit set in parallel according to a preset distribution rule, and the consensus unit is used to perform consensus processing on the distributed business data to be agreed upon.
本申请实施例还提供了一种基于区块链的数据存储设备,包括:The present application also provides a blockchain-based data storage device, including:
接收单元,接收不同的共识单元发送的共识结果;Receiving unit, receiving consensus results sent by different consensus units;
存储单元,根据所述共识结果的时间戳,将所述共识结果存储至所述区块链中的区块中。A storage unit stores the consensus result in a block in the blockchain according to a timestamp of the consensus result.
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
本申请将共识算法设计为独立的共识单元,这种共识单元不同于传统的区块链共识,由这些共识单元形成共识单元集合,当获取到待共识的业务数据时,能够根据设定的分配规则,将业务数据分配给共识单元集合中的共识单元,实现共识单元对业务数据的共识处理,这样对于无序要求的业务请求,能够通过多个共识单元并行进行共识处理,简化现有共识算法在顺序方面的处理,提升对无序的业务请求的处理效率以及处理吞吐量,提高区块链网络的运行性能。This application designs the consensus algorithm as an independent consensus unit. This consensus unit is different from the traditional blockchain consensus. These consensus units form a consensus unit set. When the business data to be agreed upon is obtained, the business data can be allocated to the consensus units in the consensus unit set according to the set allocation rules, so that the consensus units can process the business data in consensus in parallel. In this way, for business requests with disordered requirements, consensus processing can be performed in parallel through multiple consensus units, simplifying the order processing of the existing consensus algorithm, improving the processing efficiency and processing throughput of disordered business requests, and improving the operating performance of the blockchain network.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
图1为本申请实施例提供的一种区块链共识方法的流程示意图;FIG1 is a flow chart of a blockchain consensus method provided in an embodiment of the present application;
图2为本申请实施例提供的一种区块链共识方法的流程示意图;FIG2 is a flow chart of a blockchain consensus method provided in an embodiment of the present application;
图3为本申请实施例提供的一种区块链共识方法的流程示意图;FIG3 is a flow chart of a blockchain consensus method provided in an embodiment of the present application;
图4为本申请实施例提供的一种基于区块链的数据存储方法的流程示意图;FIG4 is a flow chart of a data storage method based on blockchain provided in an embodiment of the present application;
图5为本申请实施例提供的一种区块链共识系统的结构示意图;FIG5 is a schematic diagram of the structure of a blockchain consensus system provided by an embodiment of the present application;
图6为本申请实施例提供的一种区块链共识设备的示意图;FIG6 is a schematic diagram of a blockchain consensus device provided in an embodiment of the present application;
图7为本申请实施例提供的一种区块链共识设备的示意图;FIG7 is a schematic diagram of a blockchain consensus device provided in an embodiment of the present application;
图8为本申请实施例提供的一种基于区块链的数据存储设备的结构示意图。FIG8 is a schematic structural diagram of a blockchain-based data storage 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.
以下实施例对本申请所记载的方案进行详细描述。The following examples describe the schemes described in this application in detail.
图1为本申请实施例提供的一种区块链共识方法的流程示意图。从程序角度而言,该流程的执行主体可以是应用(APP)或个人计算机(PC)端程序等。从设备角度而言,该流程的执行主体可以包括但不限于以下设备:个人计算机、大中型计算机、计算机集群、手机、平板电脑、智能可穿戴设备、车机等。Figure 1 is a flowchart of a blockchain consensus method provided by an embodiment of the present application. From a program perspective, the execution entity of this process can be an application (APP) or a personal computer (PC) program. From a device perspective, the execution entity of this process can include, but is not limited to, the following devices: personal computers, large and medium-sized computers, computer clusters, mobile phones, tablet computers, smart wearable devices, and vehicle computers.
图1中的流程可以包括以下步骤:The process in Figure 1 may include the following steps:
S101:获取待共识的业务数据。S101: Obtain business data to be agreed upon.
在本申请的实施例中,若本申请实施例的执行主体为区块链网络中的区块链节点(以下简称节点),那么该节点可以接收待处理的业务请求,并从该业务请求中获取业务数据,存储该业务数据。而本步骤S101中所记载的待共识的业务数据可以是存储的业务数据。这里的业务请求可以是客户端发送的业务请求,例如记账请求,或者请求执行其他某个状态机操作;也可以是其他设备发送的业务请求,这里不做具体限定。In an embodiment of the present application, if the execution subject of the embodiment of the present application is a blockchain node in a blockchain network (hereinafter referred to as a node), then the node can receive a business request to be processed, obtain business data from the business request, and store the business data. The business data to be agreed upon recorded in step S101 can be stored business data. The business request here can be a business request sent by a client, such as an accounting request, or a request to execute another state machine operation; it can also be a business request sent by other devices, which is not specifically limited here.
需要说明的是,本申请实施例中记载的待共识的业务数据可以是指一个业务数据,即在获取到一个业务数据时,触发执行后续操作;也可以是获取到多个待共识的业务数据,即在获取到多个业务数据时,触发执行后续操作;还可以是获取设定时间周期内产生的业务数据,即获取设定时间周期内产生的业务数据,在设定时间周期到达时,触发执行后续操作,这里对于获取到业务数据的个数不做限定。It should be noted that the business data to be agreed upon recorded in the embodiments of the present application may refer to one business data, that is, when one business data is obtained, subsequent operations are triggered; it may also refer to the acquisition of multiple business data to be agreed upon, that is, when multiple business data are obtained, subsequent operations are triggered; it may also refer to the acquisition of business data generated within a set time period, that is, the acquisition of business data generated within a set time period, and when the set time period arrives, subsequent operations are triggered. There is no limit on the number of business data obtained here.
这里“业务数据”包含无序要求的业务数据,即在对获取到的业务数据进行处理时,不考虑业务数据的时间因素。例如:接收到的业务请求是捐款请求,那么获取到的待共识的业务数据就是待共识的业务数据,那么对于与捐款有关的业务数据,先处理哪个业务数据,后处理哪个业务数据,对于发送者来说没有关系,即忽略发送者发送捐款请求的时间因素,所以这种业务请求又被称之为无序要求的业务请求。Here, "business data" includes unordered business data, meaning that the time factor of the business data is not considered when processing the received business data. For example, if the received business request is a donation request, then the business data to be agreed upon is the business data to be agreed upon. Therefore, for the business data related to donations, it does not matter to the sender which business data is processed first or later. In other words, the time factor of the sender sending the donation request is ignored. Therefore, this type of business request is also called an unordered business request.
S102:按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元。S102: Allocate the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule.
其中,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。The consensus unit is used to perform consensus processing on the allocated business data to be agreed upon.
在区块链技术中,对获取到的业务数据进行处理需要使用到共识算法。而共识算法是由参与共识的各个投票节点参与完成,即由各个投票节点共同计算最后达成共识结果的算法。In blockchain technology, consensus algorithms are required to process acquired business data. Consensus algorithms are implemented by the various voting nodes involved in the consensus process, i.e., they jointly calculate the algorithm that ultimately reaches a consensus.
在本申请实施例中记载的共识单元集合中包含共识单元,每一个共识单元都可以提供独立的共识服务。也就是说,不同共识单元所采用的共识算法可以相同,也可以不同。The consensus unit set described in the embodiments of this application includes consensus units, each of which can provide independent consensus services. In other words, the consensus algorithms used by different consensus units can be the same or different.
需要说明的是,共识单元集合中包含的共识单元的个数在本申请实施例中不做限定。不同共识单元中包含的投票节点的个数可以相同也可以不同。例如:如果共识算法为PBFT算法,那么共识单元中的投票节点包含一个主节点和四个辅节点;如果共识算法为工作量证明机制,那么共识单元中至少包含一个投票节点。因此,在本申请实施例中不限定共识单元中投票节点的个数,可以根据共识算法的实际要求确定。It should be noted that the number of consensus units included in the consensus unit set is not limited in the embodiments of the present application. The number of voting nodes included in different consensus units can be the same or different. For example: if the consensus algorithm is the PBFT algorithm, then the voting nodes in the consensus unit include one master node and four slave nodes; if the consensus algorithm is the proof-of-work mechanism, then the consensus unit includes at least one voting node. Therefore, the number of voting nodes in the consensus unit is not limited in the embodiments of the present application and can be determined according to the actual requirements of the consensus algorithm.
这样,对于待共识的业务数据,使用本申请实施例提供的方案,可以对不同的业务数据采用并发处理的方式进行共识处理,即将不同的业务数据并发分配给不同的共识单元,由共识单元独立地对接收到业务数据进行共识处理。In this way, for the business data to be agreed upon, the solution provided in the embodiment of the present application can be used to perform consensus processing on different business data in a concurrent processing manner, that is, different business data are concurrently assigned to different consensus units, and the consensus units independently perform consensus processing on the received business data.
下面详细说明如何按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元。The following describes in detail how to allocate the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule.
第一种方式:First way:
根据接收到所述待共识的业务数据的个数,以随机的方式从共识单元集合中确定与所述个数相匹配的共识单元;According to the number of the received business data to be agreed upon, a consensus unit matching the number is determined from the consensus unit set in a random manner;
并发地将所述待共识的业务数据分别分配给确定的所述共识单元。Concurrently assigning the business data to be agreed upon to the determined consensus units respectively.
具体地,当待共识的业务数据的个数为1个时,从共识单元集合中随机确定一个共识单元,并将待共识的业务数据分配给确定的该共识单元,由该共识单元对该待共识的业务数据进行共识处理。Specifically, when the number of business data to be agreed upon is 1, a consensus unit is randomly determined from the consensus unit set, and the business data to be agreed upon is assigned to the determined consensus unit, and the consensus unit performs consensus processing on the business data to be agreed upon.
当待共识的业务数据的个数大于1时,可以根据待共识的业务数据的个数,从共识单元集合中随机确定所述个数的共识单元,并分别将待共识的业务数据依次分配给确定的不同的共识单元。When the number of business data to be agreed upon is greater than 1, the number of consensus units can be randomly determined from the consensus unit set according to the number of business data to be agreed upon, and the business data to be agreed upon can be assigned to the determined different consensus units in turn.
例如:获取到的待共识的业务数据包含待共识的业务数据1、待共识的业务数据2和待共识的业务数据3,假设共识单元集合中包含共识单元1、共识单元2、共识单元3、共识单元4和共识单元5,那么此时需要从共识单元集合中随机确定出3个共识单元,假设随机确定出的共识单元为共识单元2、共识单元4和共识单元5,此时,按照随机分配的方式将待共识的业务数据1、待共识的业务数据2和待共识的业务数据3依次分配给确定的不同的共识单元,例如:将待共识的业务数据1分配给共识单元5;将待共识的业务数据2分配给共识单元4;将待共识的业务数据3分配给共识单元2。For example: the acquired business data to be agreed upon includes business data 1 to be agreed upon, business data 2 to be agreed upon, and business data 3 to be agreed upon. Assuming that the consensus unit set includes consensus unit 1, consensus unit 2, consensus unit 3, consensus unit 4, and consensus unit 5, then it is necessary to randomly determine 3 consensus units from the consensus unit set. Assuming that the randomly determined consensus units are consensus unit 2, consensus unit 4, and consensus unit 5, at this time, business data 1 to be agreed upon, business data 2 to be agreed upon, and business data 3 to be agreed upon are assigned to different determined consensus units in turn in a random manner. For example: business data 1 to be agreed upon is assigned to consensus unit 5; business data 2 to be agreed upon is assigned to consensus unit 4; and business data 3 to be agreed upon is assigned to consensus unit 2.
本申请实施方式的共识分配是没有顺序要求,因此能够采用随机的方式进行分配。进一步地“按照随机分配的方式将待共识的业务数据1、待共识的业务数据2和待共识的业务数据3依次分配给确定的不同的共识单元”可以采用并行分发的方式实现。采用随机的方式分配。即,获取到某个待共识的业务数据后,任何一个共识单元都有可能成为处理该待共识的业务数据的共识服务的共识单元。这种随机的分配方式能够降低系统在分配时使用的资源。Consensus allocation in the embodiments of this application has no order requirements, so it can be allocated randomly. Furthermore, "randomly allocating business data 1 to be agreed upon, business data 2 to be agreed upon, and business data 3 to be agreed upon to different consensus units" can be implemented using a parallel distribution method. A random allocation method is used. That is, after obtaining a piece of business data to be agreed upon, any consensus unit may become the consensus unit for the consensus service that processes the business data to be agreed upon. This random allocation method can reduce the resources used by the system during allocation.
这里所记载的“随机方式”可以通过随机算法实现,也可以通过其他方式实现,这里不做具体限定。The "random method" described here can be implemented through a random algorithm or other methods, and is not specifically limited here.
第二种方式:Second way:
以轮询的方式,从共识单元集合中确定需要共识服务的共识单元;将所述待共识的业务数据分配给确定的所述共识单元。In a polling manner, a consensus unit requiring consensus service is determined from the consensus unit set; and the business data to be agreed upon is allocated to the determined consensus unit.
具体地,在获取到待共识的业务数据时,采用轮询的方式,向共识单元集合中的各共识单元发送查询消息,以确定共识单元是否需要共识服务对象(即业务请求),在确定共识单元需要共识服务对象时,将待共识的业务数据发送给该共识单元。Specifically, when the business data to be agreed upon is obtained, a polling method is adopted to send a query message to each consensus unit in the consensus unit set to determine whether the consensus unit needs a consensus service object (i.e., a business request). When it is determined that the consensus unit needs a consensus service object, the business data to be agreed upon is sent to the consensus unit.
当待共识的业务数据的个数为1个时,依次向共识单元集合中的各共识单元发送查询消息,当接收到的响应消息中表明需要共识服务对象时,将待共识的业务数据发送给返回该响应消息的共识单元。When the number of business data to be agreed upon is 1, a query message is sent to each consensus unit in the consensus unit set in turn. When the received response message indicates that a consensus service object is required, the business data to be agreed upon is sent to the consensus unit that returns the response message.
当待共识的业务数据的个数大于1时,可以并发向共识单元集合中的各共识单元发送查询消息,在接收到响应消息时,确定接收到的响应消息中表明需要共识服务对象的共识单元的个数,若共识单元的个数大于业务请求的个数时,可以按照第一种方式,从接收到的响应消息中表明需要共识服务对象的共识单元中随机选择共识单元,并发地将待共识的业务数据分别发送给随机选择的共识单元;若共识单元的个数不大于业务请求的个数时,随机地将待共识的业务数据分配给接收到的响应消息中表明需要共识服务对象的共识单元,尚未分配的待共识的业务数据则继续等待。When the number of business data to be agreed upon is greater than 1, query messages can be sent concurrently to each consensus unit in the consensus unit set. When a response message is received, the number of consensus units indicating that a consensus service object is needed in the received response message is determined. If the number of consensus units is greater than the number of business requests, a consensus unit can be randomly selected from the consensus units indicating that a consensus service object is needed in the received response message in the first way, and the business data to be agreed upon can be sent concurrently to the randomly selected consensus units respectively; if the number of consensus units is not greater than the number of business requests, the business data to be agreed upon can be randomly assigned to the consensus units indicating that a consensus service object is needed in the received response message, and the business data to be agreed upon that has not yet been assigned will continue to wait.
例如:通过轮询的方式确定需要共识服务对象的共识单元有3个,假设获取到的待共识的业务数据个数为4个,那么从获取到的4个待共识的业务数据中随机选择3个,将随机选择的3个待共识的业务数据分别发送给需要共识服务对象的共识单元,尚未分配的1个待共识的业务数据则处于等待分配状态;For example, if three consensus units are determined to need consensus service objects through polling, and the number of business data to be agreed upon is four, then three are randomly selected from the four acquired business data to be agreed upon, and the three randomly selected business data to be agreed upon are sent to the consensus units that need consensus service objects respectively. The one business data to be agreed upon that has not yet been assigned is in a waiting state.
假设获取到的待共识的业务数据个数为2个,那么从确定需要共识服务对象的共识单元随机选择2个,将获取到的2个待共识的业务数据并行发送给随机选择的共识单元,使得共识单元对接收到的待共识的业务数据进行共识处理。Assuming that the number of business data to be agreed upon is 2, then 2 are randomly selected from the consensus units that determine the consensus service objects, and the 2 business data to be agreed upon are sent in parallel to the randomly selected consensus units, so that the consensus units perform consensus processing on the received business data to be agreed upon.
第三种方式:The third way:
确定共识单元集合中各共识单元的负载能力;Determine the load capacity of each consensus unit in the consensus unit set;
按照负载均衡的规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元。According to the load balancing rule, the business data to be agreed upon is distributed to at least one consensus unit in the consensus unit set.
具体地,在获取到待共识的业务数据时,为了保证整个共识单元集合中各共识单元的负载均衡,可以确定共识单元集合中各共识单元的负载能力(这里的负载能力可以是指当前共识单元的负载情况,与共识单元的总负载能力不同)。进而可以根据各共识单元的负载能力,确定各共识单元当前空闲资源的多少。在本申请实施例中,可以将待共识的业务数据分配给共识单元集合中负载能力小于设定条件的共识单元。即将待共识的业务数据分配给共识单元集合中空闲资源量大于设定阈值的共识单元。Specifically, when the business data to be agreed upon is obtained, in order to ensure the load balance of each consensus unit in the entire consensus unit set, the load capacity of each consensus unit in the consensus unit set can be determined (the load capacity here can refer to the load situation of the current consensus unit, which is different from the total load capacity of the consensus unit). Then, according to the load capacity of each consensus unit, the amount of current idle resources of each consensus unit can be determined. In an embodiment of the present application, the business data to be agreed upon can be allocated to the consensus unit in the consensus unit set whose load capacity is less than the set condition. That is, the business data to be agreed upon is allocated to the consensus unit in the consensus unit set whose idle resources are greater than the set threshold.
需要说明的是,在上述记载的第二种方式中,对于需要共识服务对象的共识单元的个数大于业务请求的个数的情况,除了使用随机方式确定共识单元之外,还可以采用第三种方式中记载的负载均衡的方式确定共识单元,这里不再详细描述。It should be noted that in the second method recorded above, when the number of consensus units requiring consensus service objects is greater than the number of business requests, in addition to using a random method to determine the consensus unit, the load balancing method recorded in the third method can also be used to determine the consensus unit, which will not be described in detail here.
较优地,在本申请实施例中,在获取到的待共识的业务数据无法一次全部分配给共识单元时,需要一部分业务请求处于等待分配状态,那么处于等待分配状态的业务请求依然可以采用上述记载的三种方式确定共识单元。Preferably, in an embodiment of the present application, when the acquired business data to be agreed upon cannot be allocated to the consensus unit all at once, some business requests need to be in a waiting state for allocation. Then, the business requests in the waiting state for allocation can still determine the consensus unit using the three methods recorded above.
例如:共识单元集合中包含三个共识单元,那么共识单元集合能够并发处理同一时间点获取到的3个待共识的业务数据,若获取到4个待共识的业务数据(即大于3):待共识的业务数据1、待共识的业务数据2、待共识的业务数据3和待共识的业务数据4,那么假设将待共识的业务数据1、待共识的业务数据2和待共识的业务数据3并行分配给共识单元集合中的三个共识单元,那么待共识的业务数据4将处于等待分配状态。一旦监测到共识单元集合中的哪一个共识单元处于空闲,便可以将待共识的业务数据4分配给该共识单元。For example, if the consensus unit set contains three consensus units, then the consensus unit set can concurrently process three business data to be agreed upon that are obtained at the same time point. If four business data to be agreed upon are obtained (i.e., greater than 3): business data to be agreed upon 1, business data to be agreed upon 2, business data to be agreed upon 3, and business data to be agreed upon 4, then assuming that business data to be agreed upon 1, business data to be agreed upon 2, and business data to be agreed upon 3 are allocated to the three consensus units in the consensus unit set in parallel, then business data to be agreed upon 4 will be in a waiting state. Once it is detected that a consensus unit in the consensus unit set is idle, business data to be agreed upon 4 can be allocated to that consensus unit.
优选地,在本申请实施例中,从共识单元集合中确定共识单元,包括:Preferably, in an embodiment of the present application, determining a consensus unit from a consensus unit set includes:
确定共识单元集合中各共识单元的工作状态,所述工作状态包含正常状态、异常状态中的至少一种;Determine a working state of each consensus unit in the consensus unit set, where the working state includes at least one of a normal state and an abnormal state;
从工作状态为正常状态的共识单元中确定共识单元。A consensus unit is determined from consensus units whose working status is a normal state.
为了保证确定的共识单元能够成功地对接获取到的待共识的业务数据进行共识处理,还可以为共识单元集合中的共识单元的工作状态进行监控,这样在选择共识单元时,可以避免选择出工作状态异常的共识单元,有效提升业务请求的处理效率。In order to ensure that the determined consensus unit can successfully connect to the obtained business data to be agreed upon for consensus processing, the working status of the consensus units in the consensus unit set can also be monitored. In this way, when selecting a consensus unit, it is possible to avoid selecting a consensus unit with an abnormal working status, thereby effectively improving the processing efficiency of business requests.
此外,还可以为共识单元集合中的共识单元配置开关控件,这样,在区块链网络中业务请求的处理量较小时,关闭共识单元集合中的部分共识单元,起到节省系统资源的作用,以提升系统资源的利用率。较优地,通过控制各个共识单元的开关状态,使得本申请实施方式的区块链在面对宕机、网络掉线等问题上时能够提高系统的可用性。例如,当某个共识单元出现节点宕机或者网络掉线的现象时,可以通过将该共识单元关闭的方式避免现有方式中系统可用性低的缺陷。In addition, it is also possible to configure switch controls for the consensus units in the consensus unit set. In this way, when the processing volume of business requests in the blockchain network is small, some of the consensus units in the consensus unit set can be turned off, which saves system resources and improves the utilization rate of system resources. Preferably, by controlling the switch status of each consensus unit, the blockchain of the embodiment of the present application can improve the availability of the system when facing problems such as downtime and network disconnection. For example, when a consensus unit experiences a node downtime or network disconnection, the low system availability defect of the existing method can be avoided by turning off the consensus unit.
S103:所述共识单元对分配到的所述待共识的业务数据进行共识处理。S103: The consensus unit performs consensus processing on the allocated business data to be agreed upon.
在本申请实施例中,共识单元所采用的共识算法不做具体限定,可以采用任何共识算法,包括主流的PBFT算法。In the embodiment of the present application, the consensus algorithm adopted by the consensus unit is not specifically limited, and any consensus algorithm can be adopted, including the mainstream PBFT algorithm.
本领域技术人员应当理解的是,本申请的实施方式中分配所述待共识的业务数据是没有顺序要求的。通过本申请实施方式中将共识算法设计为独立的共识单元,这种共识单元不同于传统的区块链共识,由这些共识单元形成共识单元集合,当获取到待共识的业务数据时,能够根据设定的分配规则,将业务数据分配给共识单元集合中的共识单元,实现共识单元对业务数据的共识处理,这样对于无序要求的业务请求,能够通过多个共识单元并行进行共识处理,简化现有共识算法在顺序方面的处理,提升对无序的业务请求的处理效率以及处理吞吐量,提高区块链网络的运行性能。It should be understood by those skilled in the art that there is no order requirement for allocating the business data to be agreed upon in the embodiments of the present application. By designing the consensus algorithm as an independent consensus unit in the embodiments of the present application, this consensus unit is different from the traditional blockchain consensus. These consensus units form a consensus unit set. When the business data to be agreed upon is obtained, the business data can be allocated to the consensus units in the consensus unit set according to the set allocation rules, so that the consensus unit can process the business data in consensus. In this way, for business requests with disordered requirements, consensus processing can be performed in parallel by multiple consensus units, simplifying the order processing of the existing consensus algorithm, improving the processing efficiency and processing throughput of disordered business requests, and improving the operating performance of the blockchain network.
优选地,本申请实施方式所提及的业务请求包括无序要求的业务请求。所谓的无序要求的业务请求包括但不限于慈善捐款交易业务、无上限额度的众筹交易业务,对于慈善捐款交易业务而言,从精确到毫秒级别来看,谁在先捐款谁在后捐款对业务是没有影响的,无上限额度的众筹交易业务也是具有同样的性质,因此我们将这类业务请求作为没有顺序要求的请求。在本申请实施例中,对于这种无序要求的业务请求可以采用并发的共识方式提高共识处理的运行效率,由于采用了采用了这种并发的共识方式,使得整个区块链系统的吞吐量得到极大地提升,尤其是使得共识算法模块不再是整个区块链系统的瓶颈。Preferably, the business requests mentioned in the implementation method of the present application include business requests with no order requirements. The so-called business requests with no order requirements include, but are not limited to, charitable donation transaction business and crowdfunding transaction business with no upper limit. For charitable donation transaction business, from the perspective of millisecond accuracy, who donates first and who donates later has no effect on the business. The crowdfunding transaction business with no upper limit also has the same nature, so we regard this type of business request as a request without order requirements. In the embodiment of the present application, for such business requests with no order requirements, a concurrent consensus method can be used to improve the operating efficiency of the consensus processing. Due to the use of this concurrent consensus method, the throughput of the entire blockchain system is greatly improved, especially the consensus algorithm module is no longer the bottleneck of the entire blockchain system.
基于同一个发明构思,图2为本申请实施例提供的一种基于区块链共识方法的流程示意图。所述方法可以如下所示。Based on the same inventive concept, FIG2 is a flow chart of a blockchain consensus method provided in an embodiment of the present application. The method can be as follows.
S201:获取待共识的业务数据。S201: Obtain business data to be agreed upon.
这里与实施例1中所记载的步骤S101的方式相同或类似,这里不再一一描述。The method here is the same or similar to step S101 described in Example 1, and will not be described here one by one.
S202:确定处理所述待共识的业务数据所需要的资源量,以及共识单元集合中各共识单元的空闲资源量。S202: Determine the amount of resources required to process the business data to be agreed upon, and the amount of idle resources of each consensus unit in the consensus unit set.
在本申请实施例中,在获取到待共识的业务数据时,可以确定处理待共识的业务数据所需要的资源。In an embodiment of the present application, when business data to be agreed upon is obtained, resources required to process the business data to be agreed upon may be determined.
此外,可以通过查询的方式确定共识单元集合中各共识单元当前的空闲资源量。In addition, the current amount of free resources of each consensus unit in the consensus unit set can be determined by query.
S203:分别比较各共识单元的空闲资源量与处理所述待共识的业务数据所需要的资源,并确定空闲资源量大于处理所述待共识的业务数据所需要的资源量的共识单元的个数。S203: Compare the idle resource amount of each consensus unit with the resources required for processing the business data to be agreed upon, and determine the number of consensus units whose idle resource amount is greater than the resource amount required for processing the business data to be agreed upon.
S204:判断所述个数是否大于设定数值,若大于,则执行S205;否则,执行S206。S204: Determine whether the number is greater than a set value. If so, execute S205; otherwise, execute S206.
需要说明的是,本申请实施例中所记载的设定数值可以根据需要确定,也可以根据是实验数据确定,这里不做具体限定。It should be noted that the set values recorded in the embodiments of the present application can be determined according to needs or based on experimental data, and are not specifically limited here.
S205:按照轮询的方式,从空闲资源大于处理所述待共识的业务数据所需要的资源的共识单元中确定需要共识服务的共识单元,并将所述待共识的业务数据分配给确定的所述共识单元。S205: In a round-robin manner, a consensus unit requiring consensus service is determined from consensus units whose idle resources are greater than the resources required for processing the business data to be agreed upon, and the business data to be agreed upon is allocated to the determined consensus unit.
这里采用轮询方式确定需要共识服务的共识单元的方式可以参照实施例1中步骤S102中的第二种方式,这里不再一一说明。The method of determining the consensus unit that needs the consensus service by polling here can refer to the second method in step S102 in Example 1, and will not be described here one by one.
在本申请实施例中采用轮询分发各个待共识的业务数据的机制。所谓轮询分发的机制是负责分发的适配器或者分发单元定时发出询问,依序询问每一个共识单元是否需要共识服务对象,有即给予服务,即分配待共识的业务数据,服务结束后再询问下一个共识单元,接着不断周而复始。In the embodiments of the present application, a polling mechanism is used to distribute the business data to be agreed upon. The so-called polling distribution mechanism is that the adapter or distribution unit responsible for distribution periodically issues inquiries, sequentially asking each consensus unit whether it needs a consensus service object. If it does, it will provide the service, that is, allocate the business data to be agreed upon. After the service is completed, it will ask the next consensus unit again, and then repeat the cycle.
S206:按照负载均衡的规则,从空闲资源大于处理所述待共识的业务数据所需要的资源的共识单元中确定负载能力小于设定条件的共识单元,并将所述待共识的业务数据分配给确定的所述共识单元。S206: According to the load balancing rule, a consensus unit having a load capacity less than a set condition is determined from the consensus units having idle resources greater than the resources required for processing the business data to be agreed upon, and the business data to be agreed upon is allocated to the determined consensus unit.
这里采用负载均衡的规则确定共识单元的方式可以参照实施例1中步骤S102中的第三种方式,这里不再一一说明。The method of determining the consensus unit using the load balancing rule here can refer to the third method in step S102 in Example 1, and will not be explained here one by one.
例如在某个时间点上等待处理的待共识的业务数据有5个,而当前能够参与共识服务的共识单元数量为3个,那么所述业务请求的负载是超过所述独立共识单元的处理能力的。之所以比较所述待共识的业务数据的负载和所述独立共识单元的处理能力,是为下一步的共识分配提供参考,以使得最大化地利用各个独立共识单元,提高单位时间内的共识处理数量,即吞吐量。For example, if at a certain point in time there are five business data items awaiting consensus, and the number of consensus units currently capable of participating in the consensus service is three, then the load of the business requests exceeds the processing capacity of the independent consensus units. The reason for comparing the load of the business data awaiting consensus and the processing capacity of the independent consensus units is to provide a reference for the next step of consensus allocation, so as to maximize the utilization of each independent consensus unit and improve the number of consensus processes per unit time, that is, the throughput.
优选地,本申请实施例所采用负载均衡的分配方式包括但不限于软件或者硬件的均衡方式,例如可以通过DNS负载均衡、网关负载均衡或者负载均衡器等,在此不做赘述。采用负载均衡的方式进行分配,可以避免大量业务请求集中在个别共识单元,而其他个别共识单元出现闲置的情况。Preferably, the load balancing distribution method adopted in the embodiments of the present application includes but is not limited to software or hardware balancing methods, such as DNS load balancing, gateway load balancing or load balancer, etc., which will not be described in detail here. Using load balancing for distribution can avoid a large number of business requests being concentrated in a single consensus unit while other individual consensus units are idle.
与负载均衡的分配方式相比,轮询分配方式相对更容易操作,但是在效率方面,负载均衡的分配方式相对于更高。Compared with the load balancing distribution method, the polling distribution method is relatively easier to operate, but in terms of efficiency, the load balancing distribution method is relatively higher.
基于同一个发明构思,图3为本申请实施例提供的一种区块链共识方法的流程示意图。所述方法还可以如下所示。Based on the same inventive concept, FIG3 is a flow chart of a blockchain consensus method provided by an embodiment of the present application. The method can also be as follows.
S301:获取至少一个待共识的业务数据。S301: Obtain at least one piece of business data to be agreed upon.
S302:将所述至少一个待共识的业务数据进行分组,得到至少一个业务数据组。S302: Group the at least one business data to be agreed upon to obtain at least one business data group.
在本申请实施例中,由于待共识的业务数据为无序要求的业务数据,那么可以对获取到的待共识的业务数据进行分组,这样能够加快业务数据的处理效率。In the embodiment of the present application, since the business data to be agreed upon is business data with disordered requirements, the acquired business data to be agreed upon can be grouped, which can speed up the processing efficiency of the business data.
S303:按照预设的分配规则,并行地将所述业务数据组分配给共识单元集合中的不同的共识单元。S303: Allocate the business data group to different consensus units in the consensus unit set in parallel according to a preset allocation rule.
其中,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。The consensus unit is used to perform consensus processing on the allocated business data to be agreed upon.
基于同一个发明构思,图4为本申请实施例提供的一种基于区块链的数据存储方法的流程示意图。所述方法可以如下所示。Based on the same inventive concept, FIG4 is a flow chart of a blockchain-based data storage method provided in an embodiment of the present application. The method can be as follows.
S401:接收不同的共识单元发送的共识结果。S401: Receive consensus results sent by different consensus units.
在本申请实施例中,共识单元可以具备数据存储能力,那么在得到共识结果时,存储该共识结果即可;也可以不具备数据存储能力,那么不同共识单元可以将得到的共识结果发送给公共节点,由该公共节点完成存储。In an embodiment of the present application, the consensus unit may have data storage capabilities, so when a consensus result is obtained, the consensus result can be stored; or it may not have data storage capabilities, so different consensus units can send the obtained consensus results to a public node, and the public node will complete the storage.
S402:根据所述共识结果的时间戳,将所述共识结果存储至所述区块链中的区块中。S402: According to the timestamp of the consensus result, the consensus result is stored in a block in the blockchain.
具体地,按照所述共识结果的生成时间,依次将不同的所述共识结果存储至所述区块链中的区块中;Specifically, according to the generation time of the consensus result, different consensus results are stored in blocks in the blockchain in sequence;
或者,按照接收到共识结果的时间,依次将不同的所述共识结果存储至所述区块链中的区块中。Alternatively, different consensus results are stored in blocks in the blockchain in sequence according to the time when the consensus results are received.
在本申请实施例中,在将所述共识结果存储至所述区块链中的区块中时,可以按照随机方式选择存储节点,也可以根据共识单元与存储节点之间的对应关系,将所述共识结果存储至产生该共识结果的共识单元对应的节点的区块中。在本申请实施例不做具体限定,即共识单元可以存储本共识单元产生的共识结果,也可以存储其他共识单元产生的共识结果,还可以不存储共识结果,由独立的存储节点存储共识结果。In an embodiment of the present application, when storing the consensus result in a block in the blockchain, a storage node may be selected randomly, or the consensus result may be stored in a block of a node corresponding to the consensus unit that generated the consensus result based on the correspondence between the consensus unit and the storage node. This is not specifically limited in the embodiment of the present application, i.e., a consensus unit may store the consensus result generated by the consensus unit itself, the consensus result generated by other consensus units, or not store the consensus result, with an independent storage node storing the consensus result.
较优地,在设置对于各个共识单元的开关控制之外,还可以在设置对于存储节点的开关控制,这种开关控制在面对存储节点宕机,网络掉线,以及新节点加入和老节点推出等问题上,极大的提高整个区块链系统的可用性。Preferably, in addition to setting on/off control for each consensus unit, on/off control can also be set for storage nodes. This on/off control greatly improves the availability of the entire blockchain system in the face of problems such as storage node failure, network disconnection, and the addition of new nodes and the removal of old nodes.
基于同一个发明构思,图5为本申请实施例提供的一种区块链共识系统的结构示意图。所述共识系统包括:分配单元501、包含共识单元5021的共识单元集合502,其中:Based on the same inventive concept, FIG5 is a schematic diagram of the structure of a blockchain consensus system provided by an embodiment of the present application. The consensus system includes: an allocation unit 501, a consensus unit set 502 including a consensus unit 5021, wherein:
所述分配单元501,获取待共识的业务数据,并按照预设的分配规则,将所述待共识的业务数据分配给所述共识单元集合502中的至少一个共识单元5021;The allocation unit 501 obtains the business data to be agreed upon, and allocates the business data to be agreed upon to at least one consensus unit 5021 in the consensus unit set 502 according to a preset allocation rule;
所述共识集合502中包含的共识单元5021,对分配到的所述待共识的业务数据进行共识处理。The consensus unit 5021 included in the consensus set 502 performs consensus processing on the allocated business data to be agreed upon.
在本申请的另一个实施例中,所述共识系统还包括:存储节点503,其中:In another embodiment of the present application, the consensus system further includes: a storage node 503, wherein:
所述存储节点503,接收不同的所述共识单元发送的共识结果,并按照所述共识结果的时间戳,依次存储所述共识结果。The storage node 503 receives the consensus results sent by different consensus units and stores the consensus results in sequence according to the timestamps of the consensus results.
在本申请的另一个实施例中,所述分配单元501按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the allocating unit 501 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
根据接收到所述待共识的业务数据的个数,以随机的方式从共识单元集合中确定与所述个数相匹配的共识单元;According to the number of the received business data to be agreed upon, a consensus unit matching the number is determined from the consensus unit set in a random manner;
并发地将所述待共识的业务数据分别分配给确定的所述共识单元。Concurrently assigning the business data to be agreed upon to the determined consensus units respectively.
在本申请的另一个实施例中,所述分配单元501按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the allocating unit 501 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
以轮询的方式,从共识单元集合中确定需要共识服务的共识单元;Determine the consensus unit that needs consensus service from the consensus unit set in a polling manner;
将所述待共识的业务数据分配给确定的所述共识单元。Allocate the business data to be agreed upon to the determined consensus unit.
在本申请的另一个实施例中,所述分配单元501按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the allocating unit 501 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
确定共识单元集合中各共识单元的负载能力;Determine the load capacity of each consensus unit in the consensus unit set;
按照负载均衡的规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元。According to the load balancing rule, the business data to be agreed upon is distributed to at least one consensus unit in the consensus unit set.
在本申请的另一个实施例中,所述分配单元501按照负载均衡的规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the distribution unit 501 distributes the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a load balancing rule, including:
将所述待共识的业务数据分配给共识单元集合中负载能力小于设定条件的共识单元。The business data to be agreed upon is allocated to the consensus unit in the consensus unit set whose load capacity is less than the set condition.
在本申请的另一个实施例中,所述分配单元501按照预设的分配规则,将所述待共识的业务数据给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the allocation unit 501 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
确定处理所述待共识的业务数据所需要的资源量,以及共识单元集合中各共识单元的空闲资源量;Determine the amount of resources required to process the business data to be agreed upon, and the amount of idle resources of each consensus unit in the consensus unit set;
当空闲资源量大于处理所述待共识的业务数据所需要的资源量的共识单元的个数大于设定数值时,按照轮询的方式,从空闲资源大于处理所述待共识的业务数据所需要的资源的共识单元中确定需要共识服务的共识单元,并将所述待共识的业务数据分配给确定的所述共识单元;When the number of consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon is greater than a set value, the consensus units that need consensus services are determined from the consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon in a round-robin manner, and the business data to be agreed upon is allocated to the determined consensus units;
当空闲资源量大于处理所述待共识的业务数据所需要的资源量的共识单元的个数小于设定数值时,按照负载均衡的规则,从空闲资源大于处理所述待共识的业务数据所需要的资源的共识单元中确定负载能力小于设定条件的共识单元,并将所述待共识的业务数据分配给确定的所述共识单元。When the number of consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon is less than a set value, according to the load balancing rules, the consensus units whose load capacity is less than the set condition are determined from the consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon, and the business data to be agreed upon is allocated to the determined consensus units.
在本申请的另一个实施例中,所述分配单元501从共识单元集合中确定共识单元,包括:In another embodiment of the present application, the allocating unit 501 determines the consensus unit from the consensus unit set, including:
确定共识单元集合中各共识单元的工作状态,所述工作状态包含正常状态、异常状态中的至少一种;Determine a working state of each consensus unit in the consensus unit set, where the working state includes at least one of a normal state and an abnormal state;
从工作状态为正常状态的共识单元中确定共识单元。A consensus unit is determined from consensus units whose working status is a normal state.
在本申请的另一个实施例中,所述待共识的业务数据中包含无序要求的业务数据。In another embodiment of the present application, the business data to be agreed upon includes business data with no order requirements.
在本申请的另一个实施例中,所述存储节点503接收不同的共识单元发送的共识结果;根据所述共识结果的时间戳,将所述共识结果存储至所述区块链中的区块中。In another embodiment of the present application, the storage node 503 receives consensus results sent by different consensus units; and stores the consensus results in blocks in the blockchain according to the timestamp of the consensus results.
在本申请的另一个实施例中,所述存储节点503将所述共识结果存储至所述区块链中的区块中,包括:In another embodiment of the present application, the storage node 503 stores the consensus result in a block in the blockchain, including:
将所述共识结果存储至产生该共识结果的共识单元对应的节点的区块中。The consensus result is stored in the block of the node corresponding to the consensus unit that generated the consensus result.
基于同一个发明构思,图6为本申请实施例提供的一种区块链共识设备的结构示意图。所述共识设备包括:获取单元601和处理单元602,其中:Based on the same inventive concept, FIG6 is a schematic diagram of the structure of a blockchain consensus device provided by an embodiment of the present application. The consensus device includes: an acquisition unit 601 and a processing unit 602, wherein:
获取单元601,获取待共识的业务数据;Acquisition unit 601, acquires the business data to be agreed upon;
处理单元602,按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。The processing unit 602 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, and the consensus unit is used to perform consensus processing on the allocated business data to be agreed upon.
在本申请的另一个实施例中,所述处理单元602按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the processing unit 602 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
根据接收到所述待共识的业务数据的个数,以随机的方式从共识单元集合中确定与所述个数相匹配的共识单元;According to the number of the received business data to be agreed upon, a consensus unit matching the number is determined from the consensus unit set in a random manner;
并发地将所述待共识的业务数据分别分配给确定的所述共识单元。Concurrently assigning the business data to be agreed upon to the determined consensus units respectively.
在本申请的另一个实施例中,所述处理单元602按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the processing unit 602 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
以轮询的方式,从共识单元集合中确定需要共识服务的共识单元;Determine the consensus unit that needs consensus service from the consensus unit set in a polling manner;
将所述待共识的业务数据分配给确定的所述共识单元。Allocate the business data to be agreed upon to the determined consensus unit.
在本申请的另一个实施例中,所述处理单元602按照预设的分配规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the processing unit 602 allocates the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
确定共识单元集合中各共识单元的负载能力;Determine the load capacity of each consensus unit in the consensus unit set;
按照负载均衡的规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元。According to the load balancing rule, the business data to be agreed upon is distributed to at least one consensus unit in the consensus unit set.
在本申请的另一个实施例中,所述处理单元602按照负载均衡的规则,将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the processing unit 602 distributes the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a load balancing rule, including:
将所述待共识的业务数据分配给共识单元集合中负载能力小于设定条件的共识单元。The business data to be agreed upon is allocated to the consensus unit in the consensus unit set whose load capacity is less than the set condition.
在本申请的另一个实施例中,所述处理单元602按照预设的分配规则,将所述待共识的业务数据给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the processing unit 602 distributes the business data to be agreed upon to at least one consensus unit in the consensus unit set according to a preset allocation rule, including:
确定处理所述待共识的业务数据所需要的资源量,以及共识单元集合中各共识单元的空闲资源量;Determine the amount of resources required to process the business data to be agreed upon, and the amount of idle resources of each consensus unit in the consensus unit set;
当空闲资源量大于处理所述待共识的业务数据所需要的资源量的共识单元的个数大于设定数值时,按照轮询的方式,从空闲资源大于处理所述待共识的业务数据所需要的资源的共识单元中确定需要共识服务的共识单元,并将所述待共识的业务数据分配给确定的所述共识单元;When the number of consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon is greater than a set value, the consensus units that need consensus services are determined from the consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon in a round-robin manner, and the business data to be agreed upon is allocated to the determined consensus units;
当空闲资源量大于处理所述待共识的业务数据所需要的资源量的共识单元的个数小于设定数值时,按照负载均衡的规则,从空闲资源大于处理所述待共识的业务数据所需要的资源的共识单元中确定负载能力小于设定条件的共识单元,并将所述待共识的业务数据分配给确定的所述共识单元。When the number of consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon is less than a set value, according to the load balancing rules, the consensus units whose load capacity is less than the set condition are determined from the consensus units whose idle resources are greater than the resources required to process the business data to be agreed upon, and the business data to be agreed upon is allocated to the determined consensus units.
在本申请的另一个实施例中,所述处理单元602从共识单元集合中确定共识单元,包括:In another embodiment of the present application, the processing unit 602 determines the consensus unit from the consensus unit set, including:
确定共识单元集合中各共识单元的工作状态,所述工作状态包含正常状态、异常状态中的至少一种;Determine a working state of each consensus unit in the consensus unit set, where the working state includes at least one of a normal state and an abnormal state;
从工作状态为正常状态的共识单元中确定共识单元。A consensus unit is determined from consensus units whose working status is a normal state.
在本申请的另一个实施例中,所述待共识的业务数据中包含无序要求的业务数据。In another embodiment of the present application, the business data to be agreed upon includes business data with no order requirements.
需要说明的是,本申请实施例提供的共识设备可以通过软件方式实现,可以通过硬件方式实现,这里不做具体限定。It should be noted that the consensus device provided in the embodiment of the present application can be implemented by software or hardware, and no specific limitation is made here.
基于同一个发明构思,图7为本申请实施例提供的一种区块链共识设备的结构示意图。所述共识设备包括:获取单元701和处理单元702,其中:Based on the same inventive concept, FIG7 is a schematic diagram of the structure of a blockchain consensus device provided by an embodiment of the present application. The consensus device includes: an acquisition unit 701 and a processing unit 702, wherein:
获取单元,获取至少一个待共识的业务数据;An acquisition unit, which acquires at least one piece of business data to be agreed upon;
处理单元,按照预设的分配规则,并行地将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,所述共识单元用于对分配到的所述待共识的业务数据进行共识处理。The processing unit distributes the business data to be agreed upon to at least one consensus unit in the consensus unit set in parallel according to a preset distribution rule, and the consensus unit is used to perform consensus processing on the distributed business data to be agreed upon.
在本申请的另一个实施例中,所述处理单元702按照预设的分配规则,并行地将所述待共识的业务数据分配给共识单元集合中的至少一个共识单元,包括:In another embodiment of the present application, the processing unit 702 distributes the business data to be agreed upon to at least one consensus unit in the consensus unit set in parallel according to a preset distribution rule, including:
将所述至少一个待共识的业务数据进行分组,得到至少一个业务数据组;Grouping the at least one business data to be agreed upon to obtain at least one business data group;
按照预设的分配规则,并行地将所述业务数据组分配给共识单元集合中的不同的共识单元。According to a preset allocation rule, the business data group is allocated to different consensus units in the consensus unit set in parallel.
基于同一个发明构思,图8为本申请实施例提供的一种基于区块链的数据存储设备的结构示意图。所述存储设备包括:接收单元801和存储单元802,其中:Based on the same inventive concept, FIG8 is a schematic diagram of the structure of a blockchain-based data storage device provided in an embodiment of the present application. The storage device includes: a receiving unit 801 and a storage unit 802, wherein:
接收单元801,接收不同的共识单元发送的共识结果;Receiving unit 801, receiving consensus results sent by different consensus units;
存储单元802,根据所述共识结果的时间戳,将所述共识结果存储至所述区块链中的区块中。The storage unit 802 stores the consensus result in a block in the blockchain according to the timestamp of the consensus result.
在申请的另一个实施例中,所述存储单元802将所述共识结果存储至所述区块链中的区块中,包括:In another embodiment of the application, the storage unit 802 stores the consensus result in a block in the blockchain, including:
将所述共识结果存储至产生该共识结果的共识单元对应的节点的区块中。The consensus result is stored in the block of the node corresponding to the consensus unit that generated the consensus result.
需要说明的是,本申请实施例提供的共识设备可以通过软件方式实现,可以通过硬件方式实现,这里不做具体限定。共识设备将共识算法设计为独立的共识单元,这种共识单元不同于传统的区块链共识,由这些共识单元形成共识单元集合,当获取到待共识的业务数据时,能够根据设定的分配规则,将业务数据分配给共识单元集合中的共识单元,实现共识单元对业务数据的共识处理,这样对于无序要求的业务请求,能够通过多个共识单元并行进行共识处理,简化现有共识算法在顺序方面的处理,提升对无序的业务请求的处理效率以及处理吞吐量,提高区块链网络的运行性能。It should be noted that the consensus device provided in the embodiment of the present application can be implemented by software or hardware, which is not specifically limited here. The consensus device designs the consensus algorithm as an independent consensus unit. This consensus unit is different from the traditional blockchain consensus. These consensus units form a consensus unit set. When the business data to be agreed upon is obtained, the business data can be allocated to the consensus units in the consensus unit set according to the set allocation rules, so that the consensus unit can process the business data in consensus. In this way, for business requests with disordered requirements, consensus processing can be performed in parallel by multiple consensus units, simplifying the order processing of the existing consensus algorithm, improving the processing efficiency and processing throughput of disordered business requests, and improving the operating performance of the blockchain network.
本申请实施例提供的设备与方法是一一对应的,因此,设备也具有与其对应的方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述对应设备的有益技术效果。The devices and methods provided in the embodiments of the present application correspond one to one, and therefore, the devices also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding devices will not be repeated here.
在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 pure computer-readable program code, 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 implementing 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 the 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 manufactured 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.
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。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 (26)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| HK18105853.5A HK1246533B (en) | 2018-05-07 | Blockchain consensus method, device and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| HK18105853.5A HK1246533B (en) | 2018-05-07 | Blockchain consensus method, device and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| HK1246533A1 HK1246533A1 (en) | 2018-09-07 |
| HK1246533B true HK1246533B (en) | 2021-03-05 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI694339B (en) | Blockchain consensus method, equipment and system | |
| AU2019101567A4 (en) | Method and apparatus for consensus verification | |
| CN107391320B (en) | A consensus method and device | |
| CN111756550B (en) | A blockchain consensus method and device | |
| US11102284B2 (en) | Service processing methods and systems based on a consortium blockchain network | |
| CN110008018A (en) | Batch task processing method, device and equipment | |
| CN111831408A (en) | Asynchronous task processing method, device, electronic device and medium | |
| TW201727517A (en) | Method and device for data storage and business processing | |
| CN111401752A (en) | Flywheel energy storage frequency modulation sharing processing method, device and system and electronic equipment | |
| HK1246533B (en) | Blockchain consensus method, device and system | |
| CN116501474A (en) | A processing system, method and device for batch homogenous tasks | |
| CN114936116A (en) | Block chain service management method and block chain node | |
| CN121210084A (en) | A system load balancing processing method, apparatus and related equipment | |
| CN115729701A (en) | Virtual network element resource scheduling method and device | |
| CN115514819A (en) | A service scheduling method, device and equipment | |
| HK1247454B (en) | Business acceptance and common method and device | |
| HK1247357B (en) | Block chain consensus method and device | |
| HK1238774B (en) | Data storage and service processing method and device |