HK1241594B - Service check method and device - Google Patents
Service check method and device Download PDFInfo
- Publication number
- HK1241594B HK1241594B HK18100888.5A HK18100888A HK1241594B HK 1241594 B HK1241594 B HK 1241594B HK 18100888 A HK18100888 A HK 18100888A HK 1241594 B HK1241594 B HK 1241594B
- Authority
- HK
- Hong Kong
- Prior art keywords
- business
- service
- request
- blockchain node
- blockchain
- Prior art date
Links
Description
技术领域Technical Field
本申请涉及计算机技术领域,尤其涉及一种业务校验的方法及装置。The present application relates to the field of computer technology, and in particular to a method and device for service verification.
背景技术Background Art
区块链技术又称之为分布式账本技术,存储在区块链中的数据具备不可篡改、去中心化等特点,所以,区块链技术为人们提供愈加安全的数据存储环境,并为人们的数据存储提供更多便利。Blockchain technology is also known as distributed ledger technology. The data stored in the blockchain has the characteristics of being tamper-proof and decentralized. Therefore, blockchain technology provides people with a more secure data storage environment and provides more convenience for people's data storage.
当前,区块链节点接收到终端向其发送的业务请求时,会将该业务请求存储在自身的业务存储器中,与此同时,区块链节点还会将该业务请求广播给整个共识网络的其他区块链节点,以使其他区块链节点在接收到该业务请求后,将该业务请求存储在自身对应的业务存储器中。Currently, when a blockchain node receives a business request sent by a terminal, it will store the business request in its own business memory. At the same time, the blockchain node will also broadcast the business request to other blockchain nodes in the entire consensus network, so that other blockchain nodes will store the business request in their corresponding business memory after receiving the business request.
而后,区块链节点将从自身的业务存储器中捞取设定数量的业务请求,并将这些业务请求打包成预处理块广播给整个共识网络中的其他区块链节点进行共识,以确定是否需要将这些业务请求以区块的形式存储在区块链中。Then, the blockchain node will retrieve a set number of business requests from its own business storage, package these business requests into pre-processed blocks and broadcast them to other blockchain nodes in the entire consensus network for consensus to determine whether these business requests need to be stored in the blockchain in the form of blocks.
在实际应用中,联盟链中的区块链节点将接收到业务请求广播给其他区块链节点的过程中,由于网络故障等因素的影响,整个共识网络中的一些其他区块链节点可能并没有接收到该区块链节点广播的该业务请求,换句话说,相对于一个区块链节点自身对应的业务存储器中存储的各业务请求来说,其他区块链节点对应的业务存储器中可能会缺失一部分业务请求。而缺少部分业务请求的区块链节点在一定程度上会对整个共识网络的共识校验结果产生较大的影响。In actual applications, when a blockchain node in a consortium chain broadcasts a received service request to other blockchain nodes, due to factors such as network failures, some other blockchain nodes in the entire consensus network may not receive the service request broadcast by the blockchain node. In other words, compared to the service requests stored in the service memory of a blockchain node itself, the service memory of other blockchain nodes may be missing some service requests. Blockchain nodes that are missing some service requests will, to a certain extent, have a significant impact on the consensus verification results of the entire consensus network.
例如,假设整个共识网络中有3个区块链节点A、B、C,其中,区块链节点A存储有#1、#2、#3、#4、#5这5个业务请求,区块链节点B存储有#1、#2、#3、#4这4个业务请求,而区块链节点C存储有#1、#2、#3这3个业务请求,其中,各业务请求均存储在各区块链节点对应的业务存储器中。区块链节点A将#1、#2、#3、#4、#5这5个业务请求打包成预处理块广播给其他的两个区块链节点以对这5个业务请求进行共识校验时,由于区块链节点B和C均缺失有这5个业务请求的部分业务请求,所以,区块链节点B和C会对包含有这5个业务请求的预处理块直接认定为共识校验不通过,这样一来,由于整个共识网络中超过半数的区块链节点认定该预处理块共识校验不通过,则导致该预处理块中包含的这5个业务请求将无法通过整个共识网络的共识校验,继而这5个业务请求也将无法记录在整个共识网络中的区块链中。For example, suppose there are three blockchain nodes A, B, and C in the entire consensus network, among which blockchain node A stores five business requests #1, #2, #3, #4, and #5, blockchain node B stores four business requests #1, #2, #3, and #4, and blockchain node C stores three business requests #1, #2, and #3. Among them, each business request is stored in the business storage corresponding to each blockchain node. When blockchain node A packages the five business requests #1, #2, #3, #4, and #5 into a pre-processing block and broadcasts it to the other two blockchain nodes for consensus verification of these five business requests, since blockchain nodes B and C are both missing some of the business requests that contain these five business requests, blockchain nodes B and C will directly determine that the pre-processing block containing these five business requests has failed the consensus verification. In this way, since more than half of the blockchain nodes in the entire consensus network determine that the consensus verification of the pre-processing block has failed, the five business requests contained in the pre-processing block will not be able to pass the consensus verification of the entire consensus network, and then these five business requests will not be able to be recorded in the blockchain in the entire consensus network.
由于上述其他区块链节点认定该预处理块不通过共识校验的原因并不是因为该预处理块中有部分业务请求存在非法篡改的情况,而仅是因为该预处理块中有部分业务请求并未存储在其他区块链节点自身所对应的业务存储器中,继而使得该预处理块无法通过整个共识网络共识校验的几率将大大增加,而实际上,该预处理块中包含的各业务请求可能本身并不存在任何问题,这就使正常的业务请求在现有技术中将有很大的几率无法通过各区块链节点的共识校验,从而影响了整个区块链业务的业务处理准确性。Since the reason why the other blockchain nodes determine that the pre-processing block fails the consensus verification is not because some business requests in the pre-processing block are illegally tampered with, but simply because some business requests in the pre-processing block are not stored in the business storage corresponding to the other blockchain nodes themselves, the probability that the pre-processing block will fail to pass the consensus verification of the entire consensus network will be greatly increased. In fact, the business requests contained in the pre-processing block may not have any problems themselves. This makes it very likely that normal business requests will fail to pass the consensus verification of each blockchain node in the existing technology, thereby affecting the business processing accuracy of the entire blockchain business.
发明内容Summary of the Invention
本申请实施例提供一种业务校验的方法,用以解决现有技术中区块链业务的业务处理准确性较低的问题。The embodiments of the present application provide a method for business verification to solve the problem of low business processing accuracy of blockchain business in the prior art.
本申请实施例提供了一种业务校验的方法,包括:This embodiment of the present application provides a service verification method, including:
第一区块链节点接收终端发送的业务请求;The first blockchain node receives a service request sent by the terminal;
将所述业务请求存储在所述第一区块链节点对应的业务存储器中,并将所述业务请求广播给各第二区块链节点,以使所述各第二区块链节点将所述业务请求分别存储在各自对应的业务存储器中;Storing the service request in a service memory corresponding to the first blockchain node, and broadcasting the service request to each second blockchain node, so that each second blockchain node stores the service request in its corresponding service memory;
从所述业务存储器中捞取至少一个业务请求,并将捞取的所述至少一个业务请求打包成预处理块广播给各第二区块链节点,以使所述各第二区块链节点在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求,并通过所述部分业务请求以及自身业务存储器中存储的业务请求对所述预处理块进行共识校验。At least one business request is retrieved from the business memory, and the retrieved at least one business request is packaged into a pre-processing block and broadcast to each second blockchain node, so that when each second blockchain node determines that its corresponding business memory does not contain some business requests in the pre-processing block, it obtains the part of the business requests from other blockchain nodes, and performs consensus verification on the pre-processing block through the part of the business requests and the business requests stored in its own business memory.
本申请实施例提供一种业务校验的装置,用以解决现有技术中区块链业务的业务处理准确性较低的问题。The embodiments of the present application provide a business verification device to solve the problem of low business processing accuracy of blockchain business in the prior art.
本申请实施例提供了一种业务校验的装置,包括:The present invention provides a device for verifying a service, including:
接收模块,接收终端发送的业务请求;Receiving module, receiving service requests sent by the terminal;
存储模块,将所述业务请求存储在所述装置对应的业务存储器中,并将所述业务请求广播给各第二区块链节点,以使所述各第二区块链节点将所述业务请求分别存储在各自对应的业务存储器中;a storage module, storing the service request in a service memory corresponding to the device, and broadcasting the service request to each second blockchain node, so that each second blockchain node stores the service request in its corresponding service memory;
请求捞取模块,从所述业务存储器中捞取至少一个业务请求,并将捞取的所述至少一个业务请求打包成预处理块广播给各第二区块链节点,以使所述各第二区块链节点在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求,并通过所述部分业务请求以及自身业务存储器中存储的业务请求对所述预处理块进行共识校验。The request retrieval module retrieves at least one business request from the business memory, and packages the retrieved at least one business request into a pre-processing block and broadcasts it to each second blockchain node, so that when each second blockchain node determines that its corresponding business memory does not contain some business requests in the pre-processing block, it obtains the part of the business requests from other blockchain nodes, and performs consensus verification on the pre-processing block through the part of the business requests and the business requests stored in its own business memory.
本申请实施例提供一种业务校验的方法,用以解决现有技术中区块链业务的业务处理准确性较低的问题。The embodiments of the present application provide a method for business verification to solve the problem of low business processing accuracy of blockchain business in the prior art.
本申请实施例提供了一种业务校验的方法,包括:This embodiment of the present application provides a service verification method, including:
第二区块链节点接收第一区块链节点广播的业务请求;The second blockchain node receives the service request broadcast by the first blockchain node;
将所述业务请求存储在所述第二区块链节点对应的业务存储器中;Storing the service request in a service memory corresponding to the second blockchain node;
接收所述第一区块链节点广播的包含有至少一个业务请求的预处理块,并在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求;receiving a pre-processing block containing at least one service request broadcasted by the first blockchain node, and obtaining the part of the service request from other blockchain nodes when determining that the service memory corresponding to the first blockchain node does not contain part of the service request in the pre-processing block;
通过所述部分业务请求以及自身对应的业务存储器中存储的业务请求,对所述预处理块进行共识校验。The pre-processing block is subjected to consensus verification through the partial business requests and the business requests stored in the corresponding business memory.
本申请实施例提供一种业务校验的装置,用以解决现有技术中区块链业务的业务处理准确性较低的问题。The embodiments of the present application provide a business verification device to solve the problem of low business processing accuracy of blockchain business in the prior art.
本申请实施例提供了一种业务校验的装置,包括:The present invention provides a device for verifying a service, including:
接收请求模块,接收第一区块链节点广播的业务请求;A request receiving module receives a service request broadcasted by the first blockchain node;
请求存储模块,将所述业务请求存储在所述装置对应的业务存储器中;a request storage module, storing the service request in a service memory corresponding to the device;
接收模块,接收所述第一区块链节点广播的包含有至少一个业务请求的预处理块,并在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求;a receiving module configured to receive a pre-processing block including at least one service request broadcast by the first blockchain node, and obtain the service request from other blockchain nodes when determining that the service memory corresponding to the receiving module does not include some service requests in the pre-processing block;
校验模块,通过所述部分业务请求以及自身对应的业务存储器中存储的业务请求,对所述预处理块进行共识校验。The verification module performs consensus verification on the pre-processing block through the partial business requests and the business requests stored in its own corresponding business memory.
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
在本申请实施例中,第二区块链节点在接收到第一区块链节点广播的包含有各业务请求的预处理块后发现,自身对应的业务存储器中未包含有该预处理块中的部分业务请求时,并不是直接认定该预处理块在该第二区块链节点上共识校验不通过,而是可从整个共识网络中的其他区块链节点获取这部分缺失的业务请求,并通过获取的这部分业务请求以及自身业务存储器中存储的业务请求对该预处理块中包含的业务请求进行共识校验,这样一来就大大降低了因网络故障而对各业务请求的共识校验产生不利影响的情况发生,从而提高了整个区块链业务的业务处理准确性。In an embodiment of the present application, after receiving the pre-processing block containing various business requests broadcast by the first blockchain node, when the second blockchain node finds that its corresponding business memory does not contain some of the business requests in the pre-processing block, it does not directly determine that the pre-processing block fails the consensus verification on the second blockchain node. Instead, it can obtain this part of the missing business requests from other blockchain nodes in the entire consensus network, and perform consensus verification on the business requests contained in the pre-processing block through the obtained part of the business requests and the business requests stored in its own business memory. In this way, the occurrence of adverse effects on the consensus verification of various business requests due to network failures is greatly reduced, thereby improving the business processing accuracy of the entire blockchain business.
附图说明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 service efficiency process provided by an embodiment of the present application;
图2为本申请实施例提供的各区块链节点通过预设的分布式中间件将接收的业务请求分别存储在自身对应的业务存储器中的示意图;FIG2 is a schematic diagram of each blockchain node storing received service requests in its corresponding service memory through a preset distributed middleware according to an embodiment of the present application;
图3为本申请实施例提供的确定待校验总特征值的示意图;FIG3 is a schematic diagram of determining a total eigenvalue to be verified according to an embodiment of the present application;
图4为本申请实施例提供的共识网络针对第一区块链节点发送的预处理块进行共识的示意图;FIG4 is a schematic diagram of a consensus network according to an embodiment of the present application performing consensus on a pre-processed block sent by a first blockchain node;
图5为本申请实施例提供的一种业务校验的装置示意图;FIG5 is a schematic diagram of a service verification device provided in an embodiment of the present application;
图6为本申请实施例提供的另一种业务校验的装置示意图。FIG6 is a schematic diagram of another service verification device provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
当前,区块链节点进行业务处理的过程大致如下:终端向区块链节点发送业务请求后,区块链节点会将接收到的业务请求以广播的形式发送至其他区块链节点中,其他区块链节点会将接收到的该业务请求存储在自身对应的业务存储器中,当然,向其他区块链节点发送该业务请求的区块链节点也会将该业务请求存储在自身的业务存储器中。Currently, the process of business processing by blockchain nodes is roughly as follows: after the terminal sends a business request to the blockchain node, the blockchain node will send the received business request to other blockchain nodes in the form of a broadcast. Other blockchain nodes will store the received business request in their corresponding business storage. Of course, the blockchain node that sends the business request to other blockchain nodes will also store the business request in its own business storage.
在由各区块链节点组成的共识网络中,各区块链节点均有向其他区块链节点发起共识请求的权利,区块链节点可将自身业务存储器中存储的设定数量的业务请求按照一定顺序进行排列,得到一个业务请求队列,并生成针对该业务请求队列的一个哈希(Hash)值,而后,区块链节点可将该业务请求队列以及该Hash打包成一个预处理块,并将该预处理块以广播的形式的发送至其他的区块链节点,以进行共识校验。In a consensus network composed of blockchain nodes, each blockchain node has the right to initiate consensus requests to other blockchain nodes. The blockchain node can arrange a set number of business requests stored in its own business memory in a certain order to obtain a business request queue and generate a hash value for the business request queue. Then, the blockchain node can package the business request queue and the hash into a pre-processing block and send the pre-processing block to other blockchain nodes in the form of broadcast for consensus verification.
在共识校验的过程中,当其他区块链节点接收到该预处理块后,将对该预处理块中的包含的各业务请求进行非对称签名合法验证,即,区块链节点可根据自身所持有的公钥(或私钥,公钥还是私钥取决于各业务请求在加密时所使用的是私钥还是公钥),将该预处理块中包含的各业务请求进行解析,以验证各业务请求是否为合法的各业务请求。During the consensus verification process, when other blockchain nodes receive the pre-processing block, they will perform asymmetric signature legal verification on each business request contained in the pre-processing block. That is, the blockchain node can parse each business request contained in the pre-processing block based on the public key (or private key, whether the public key or private key depends on whether the private key or public key is used when encrypting each business request) it holds to verify whether each business request is a legal business request.
除此之外,由于区块链节点每当接收终端发送的业务请求时,就会将该业务请求广播给其他的区块链节点,因此,通常情况下,各区块链节点自身对应的业务存储器中均应存储有整个共识网络接收的各业务请求。基于此,其他区块链节点接收到该预处理块后,将对该预处理块中的各业务请求进行哈希完整性验证,即,区块链节点可从自身的业务存储器中查找到该预处理块中包含的各业务请求,并将查找到的各业务请求按照各业务请求在该预处理块中的排列顺序进行排列,得到一个业务请求队列,而后,区块链节点可生成针对该业务请求队列的一个Hash值,进而将得到的Hash值与该预处理块中包含的Hash值进行比对,以确认该预处理块中的各业务请求在内容上是否发生过非法篡改。In addition, since each time a blockchain node receives a service request from a terminal, it broadcasts the service request to other blockchain nodes. Therefore, under normal circumstances, each blockchain node's corresponding service memory should store all service requests received by the entire consensus network. Based on this, after receiving the pre-processing block, other blockchain nodes will perform hash integrity verification on each service request in the pre-processing block. That is, the blockchain node can find each service request contained in the pre-processing block from its own service memory, and arrange the found service requests in the order in which they are arranged in the pre-processing block to obtain a service request queue. The blockchain node can then generate a hash value for the service request queue, and then compare the obtained hash value with the hash value contained in the pre-processing block to confirm whether the content of each service request in the pre-processing block has been illegally tampered with.
各区块链节点将根据对该预处理块进行的非对称签名合法验证以及哈希完整性验证,得到自身针对该预处理块整体是否合法的校验结果,并将自身得到的校验结果以广播的形式广播给其他的区块链节点。Each blockchain node will obtain its own verification result on whether the pre-processed block is legal as a whole based on the asymmetric signature legality verification and hash integrity verification of the pre-processed block, and broadcast its own verification result to other blockchain nodes in the form of broadcast.
各区块链节点将根据其他区块链节点针对该预处理块所发送的校验结果以及自身得到的校验结果,得到整个共识网络中各区块链节点针对该预处理块是否通过的综合校验结果,并将得到的综合校验结果再次以广播的形式广播给其他的区块链节点。Each blockchain node will obtain a comprehensive verification result of whether the pre-processed block has passed by each blockchain node in the entire consensus network based on the verification results sent by other blockchain nodes for the pre-processed block and its own verification results, and broadcast the obtained comprehensive verification result to other blockchain nodes again in the form of broadcast.
共识网络中的各区块链节点接收到相互广播的综合校验结果后,将进一步判断共识网络中各区块链节点得出各综合校验结果大部分是否均为校验通过,若是,则将该预处理块中的各业务请求以区块的形式存储在自身的区块链中,若否,则拒绝该预处理块中的各业务请求。After receiving the mutually broadcasted comprehensive verification results, each blockchain node in the consensus network will further determine whether most of the comprehensive verification results obtained by each blockchain node in the consensus network have passed the verification. If so, each business request in the pre-processing block will be stored in its own blockchain in the form of a block. If not, each business request in the pre-processing block will be rejected.
各区块链节点将预处理块中的各业务请求以区块的形式存储在自身的区块链中后,可将该预处理块中包含的各业务请求从自身的业务存储器中释放,以使得到释放的业务存储器能够继续存储区块链节点接收的各业务请求。After each blockchain node stores each business request in the preprocessing block in its own blockchain in the form of a block, it can release each business request contained in the preprocessing block from its own business memory so that the released business memory can continue to store each business request received by the blockchain node.
然而,在现有技术中,区块链节点将接收到业务请求广播给其他区块链节点的过程中,由于受网络故障等因素的影响,一些其他区块链节点可能并没有接收到该区块链节点广播的该业务请求,这就使得后续区块链节点将包含有设定数量业务请求的预处理块广播给各区块链节点进行共识校验时,一部分区块链节点由于在自身对应的业务存储器中缺失预处理块中的部分业务请求,而导致会直接认定该预处理块在区块链节点本地的共识校验不通过,从而大大增加该预处理块无法通过整个共识网络共识校验的几率,从而影响了整个区块链业务的业务处理准确性。However, in the prior art, when a blockchain node broadcasts a received business request to other blockchain nodes, due to factors such as network failure, some other blockchain nodes may not receive the business request broadcast by the blockchain node. This causes the subsequent blockchain node to broadcast a pre-processing block containing a set number of business requests to each blockchain node for consensus verification. As a result, some blockchain nodes will directly determine that the pre-processing block has failed the consensus verification in the local blockchain node due to the lack of some business requests in the pre-processing block in their corresponding business memory, thereby greatly increasing the probability that the pre-processing block will fail the consensus verification of the entire consensus network, thereby affecting the business processing accuracy of the entire blockchain business.
不仅如此,在实际应用中,若业务请求未通过整个共识网络的共识校验,则区块链节点将会向用户终端返回该业务请求处理失败的消息,所以,上述情况的发生,还会给用户本身带来极大的不便。Not only that, in actual applications, if the business request fails to pass the consensus verification of the entire consensus network, the blockchain node will return a message to the user terminal indicating that the business request processing failed. Therefore, the occurrence of the above situation will also bring great inconvenience to the user itself.
为了有效解决上述问题,在本申请中,第二区块链节点在接收到第一区块链节点广播的包含有各业务请求的预处理块后发现自身对应的业务存储器中未包含有该预处理块中的部分业务请求时,可从整个共识网络中的其他区块链节点获取这部分缺失的业务请求,并通过获取的这部分业务请求以及自身业务存储器中存储的业务请求对该预处理块中包含的各业务请求进行共识校验,这样一来就大大降低了因网络故障而对各业务请求的共识校验产生不利影响的情况发生,从而提高了整个区块链业务的业务处理准确性。In order to effectively solve the above problems, in the present application, after receiving the pre-processing block containing various business requests broadcast by the first blockchain node, the second blockchain node finds that its corresponding business memory does not contain some of the business requests in the pre-processing block. In this way, the second blockchain node can obtain these missing business requests from other blockchain nodes in the entire consensus network, and perform consensus verification on each business request contained in the pre-processing block through the obtained business requests and the business requests stored in its own business memory. This greatly reduces the occurrence of adverse effects on the consensus verification of each business request due to network failure, thereby improving the business processing accuracy of the entire blockchain business.
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。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 a service efficiency process provided by an embodiment of the present application, which specifically includes the following steps:
S101:第一区块链节点接收终端发送的业务请求。S101: The first blockchain node receives a service request sent by a terminal.
在本申请实施例中,用户在业务处理的过程中,可在用户所持有的用户终端填写相应的业务处理内容,而终端将根据用户填写的业务处理内容,生成相应的业务请求,并将业务请求发送至整个共识网络中的第一区块链节点中。其中,这里提到的终端可以是诸如电脑、智能手机等设备。当然,用户也可通过终端中安装的客户端向第一区块链节点发送的业务请求,即,用户在客户端中终端上所展示的界面中填写相应的业务处理内容,客户端根据用户在该界面中填写的业务处理内容,生成相应的业务请求,进而通过终端将该业务请求发送至第一区块链节点中。In an embodiment of the present application, during the business processing process, the user can fill in the corresponding business processing content on the user terminal held by the user, and the terminal will generate a corresponding business request based on the business processing content filled in by the user, and send the business request to the first blockchain node in the entire consensus network. Among them, the terminal mentioned here can be a device such as a computer, a smart phone, etc. Of course, the user can also send a business request to the first blockchain node through the client installed in the terminal, that is, the user fills in the corresponding business processing content in the interface displayed on the terminal in the client, and the client generates a corresponding business request based on the business processing content filled in by the user in the interface, and then sends the business request to the first blockchain node through the terminal.
需要说明的是,在实际应用中,整个共识网络中包含有多个区块链节点,而本申请实施例所提到的第一区块链节点指的是接收终端业务请求的区块链节点,而除第一区块链节点之外其他区块链节点,在本申请实施例中可以称之为第二区块链节点,第一区块链节点和第二区块链节点是一个相对概念,即,从终端接收业务请求的区块链节点为第一区块链节点,而接收由第一区块链节点通过广播的方式所发送的该业务请求的区块链节点则称之为第二区块链节点。由于共识网络中的各区块链节点均可接收终端发送的业务请求,因此,各区块链节点实质上均可以是第一区块链节点,也可以是第二区块链节点,而第一区块链节点和第二区块链节点的划分取决于业务请求是从何处接收的。It should be noted that, in actual applications, the entire consensus network includes multiple blockchain nodes, and the first blockchain node mentioned in the embodiment of the present application refers to the blockchain node that receives the terminal service request, and the other blockchain nodes other than the first blockchain node can be referred to as the second blockchain node in the embodiment of the present application. The first blockchain node and the second blockchain node are relative concepts, that is, the blockchain node that receives the service request from the terminal is the first blockchain node, and the blockchain node that receives the service request sent by the first blockchain node via broadcast is called the second blockchain node. Since each blockchain node in the consensus network can receive the service request sent by the terminal, each blockchain node can actually be the first blockchain node or the second blockchain node, and the division of the first blockchain node and the second blockchain node depends on where the service request is received.
当然,在共识校验过程中,第一区块链节点和第二区块链节点的划分也可以通过哪一节点发起共识校验来区分,即,将包含有至少一个业务请求的预处理块广播给整个共识网络的共识校验发起者可以是第一区块链节点,而接收该预处理块的区块链节点则可以称之为第二区块链节点。Of course, during the consensus verification process, the division of the first blockchain node and the second blockchain node can also be distinguished by which node initiates the consensus verification, that is, the consensus verification initiator that broadcasts the pre-processed block containing at least one business request to the entire consensus network can be the first blockchain node, and the blockchain node that receives the pre-processed block can be called the second blockchain node.
S102:将所述业务请求存储在所述第一区块链节点对应的业务存储器中,并将所述业务请求广播给各第二区块链节点,以使所述各第二区块链节点将所述业务请求分别存储在各自对应的业务存储器中。S102: Storing the business request in a business memory corresponding to the first blockchain node, and broadcasting the business request to each second blockchain node, so that each second blockchain node stores the business request in its corresponding business memory.
由于在共识校验过程中,第一区块链节点需要从自身对应的业务存储器中捞取一部分业务请求,并将这部分业务请求打包成预处理块广播给整个共识网络中的各第二区块链节点,而各第二区块链节点接收到包含有这部分业务请求的预处理块后,需要根据自身对应的业务存储器中所包含的与这部分业务请求相匹配的各业务请求共识校验预处理块中的这部分业务请求,而第二区块链节点自身对应的业务存储器中所包含的与这部分业务请求相匹配的各业务请求则需要通过第一区块链节点来获取。During the consensus verification process, the first blockchain node needs to retrieve a portion of business requests from its corresponding business memory, and package these portion of business requests into a pre-processing block and broadcast it to each second blockchain node in the entire consensus network. After each second blockchain node receives the pre-processing block containing this portion of business requests, it needs to verify this portion of business requests in the pre-processing block based on the consensus of each business request matching this portion of business requests contained in its corresponding business memory, and each business request matching this portion of business requests contained in the business memory corresponding to the second blockchain node itself needs to be obtained through the first blockchain node.
基于此,在本申请实施例中,第一区块链节点在接收到终端发送的业务请求后,可将该业务请求存储在自身对应的业务存储器中,与此同时,第一区块链节点可将该业务请求以广播的形式发送给整个共识网络中的各第二区块链节点,以使各第二区块链节点将该业务请求分别存储在自身对应的业务存储器中。Based on this, in an embodiment of the present application, after receiving the business request sent by the terminal, the first blockchain node can store the business request in its own corresponding business memory. At the same time, the first blockchain node can send the business request to each second blockchain node in the entire consensus network in the form of a broadcast, so that each second blockchain node will store the business request in its own corresponding business memory respectively.
在现有技术中,第一区块链节点通常是将接收到的业务请求存储在自身的缓存中,即,现有技术中,上述业务存储器即为区块链节点的缓存,而由于缓存的存储空间有限,致使当该缓存的存储空间占满时,该第一区块链节点无法继续接收终端发送的业务请求,只能等到该缓存中的部分业务请求通过整个共识网络所有区块链节点的共识校验后,才能利用这部分业务请求所占有的存储空间,继续存储终端发送的业务请求。因此,在现有技术中,缓存存储空间极大的限制了区块链业务的业务处理效率。In the prior art, a first blockchain node typically stores received service requests in its own cache. Specifically, the service memory in the prior art is the blockchain node's cache. However, due to the limited storage space of the cache, when the cache is full, the first blockchain node cannot continue to receive service requests from the terminal. The node can only use the storage space occupied by the service requests in the cache to continue storing service requests from the terminal after the service requests pass the consensus verification of all blockchain nodes in the consensus network. Therefore, in the prior art, the cache storage space significantly limits the efficiency of blockchain service processing.
为了有效解决现有技术中出现的问题,在本申请实施例中,区块链节点的运维人员可针对每个区块链节点,分别设置各数据库形式的各业务存储器,即,每个区块链节点均可对应有一个数据库形式的业务存储器,换句话说,本申请实施例所提到的业务存储器是一个用于存储各业务请求的数据库。这样,当第一区块链节点接收到终端发送的业务请求后,可将该业务请求存储在该第一区块链节点所对应的业务存储器中,并待后续过程中,对业务存储器中存储的业务请求进行共识校验。To effectively address the issues arising from the prior art, in an embodiment of the present application, blockchain node operators can set up separate business memories in the form of databases for each blockchain node. That is, each blockchain node can correspond to a business memory in the form of a database. In other words, the business memory mentioned in the embodiment of the present application is a database for storing business requests. In this way, when a first blockchain node receives a business request sent by a terminal, it can store the business request in the business memory corresponding to the first blockchain node, and in the subsequent process, perform a consensus check on the business request stored in the business memory.
由于数据库形式的业务存储器的存储空间相比于缓存的存储空间来说要大得多,所以,第一区块链节点通过整个共识网络对该业务存储器中的部分业务请求进行共识校验时,该第一区块链节点依然可以继续接收终端发送的业务请求,即,无需再利用通过共识校验的部分业务请求所占有的存储空间来接收终端发送的业务请求,相比于现有技术而言,第一区块链节点极大的满足了区块链业务的业务量不断提升的需求,并提高了区块链业务的业务处理效率。Since the storage space of the business memory in the form of a database is much larger than the storage space of the cache, when the first blockchain node performs consensus verification on some business requests in the business memory through the entire consensus network, the first blockchain node can still continue to receive business requests sent by the terminal, that is, there is no need to use the storage space occupied by some business requests that have passed the consensus verification to receive business requests sent by the terminal. Compared with the existing technology, the first blockchain node greatly meets the demand for the continuous increase in business volume of the blockchain business and improves the business processing efficiency of the blockchain business.
不仅如此,在现有技术中,由于整个共识网络中各区块链节点都是通过自身的缓存(即现有技术中的业务存储器即为缓存)存储各业务请求的,当区块链节点出现宕机等故障时,其自身缓存中存储的各业务请求也将消失。而在本申请实施例中,各业务请求均是存储在区块链节点对应的数据库形式的业务存储器中,所以,即使区块链节点出现宕机等故障,存储在数据库形式的业务存储器中的各业务请求也不会消失,从而进一步保证了各业务请求的安全性。Furthermore, in the prior art, since each blockchain node in the entire consensus network stores each service request in its own cache (i.e., the service memory in the prior art is the cache), when a blockchain node experiences a failure such as downtime, the service requests stored in its own cache will also disappear. In the embodiments of the present application, each service request is stored in the service memory in the form of a database corresponding to the blockchain node. Therefore, even if a blockchain node experiences a failure such as downtime, the service requests stored in the service memory in the form of a database will not disappear, thereby further ensuring the security of each service request.
在本申请实施例中,整个共识网络中的各区块链节点和各业务存储器中可通过一个预设的分布式中间件实现数据传输,即,第一区块链节点接收到终端发送的业务请求后,可将该业务请求发送至分布式中间件中,该分布式中间件可根据该第一区块链节点的节点标识,将该业务请求发送至该第一区块链节点所对应的业务存储器中进行存储,同理,第二区块链节点接收到第一区块链节点广播的业务请求后,可将该业务请求发送至该分布式中间件中,该分布式中间件同样可根据该第二区块链节点的节点标识,将该业务请求发送至该第二区块链节点所对应的业务存储器中进行存储,如图2所示。In an embodiment of the present application, data transmission can be achieved between each blockchain node and each business memory in the entire consensus network through a preset distributed middleware. That is, after the first blockchain node receives the business request sent by the terminal, it can send the business request to the distributed middleware. The distributed middleware can send the business request to the business memory corresponding to the first blockchain node for storage based on the node identifier of the first blockchain node. Similarly, after the second blockchain node receives the business request broadcast by the first blockchain node, it can send the business request to the distributed middleware. The distributed middleware can also send the business request to the business memory corresponding to the second blockchain node for storage based on the node identifier of the second blockchain node, as shown in Figure 2.
图2为本申请实施例提供的各区块链节点通过预设的分布式中间件将接收的业务请求分别存储在自身对应的业务存储器中的示意图。Figure 2 is a schematic diagram of each blockchain node provided by an embodiment of the present application storing received business requests in its own corresponding business memory through a preset distributed middleware.
以交易业务为例,当用户需要进行转账业务时,可在自己所持有的终端中选择转账对象并输入转账金额,终端将根据用户输入的内容,生成相应的交易请求,并将这笔交易请求发送至第一区块链节点中。Taking transaction business as an example, when a user needs to transfer money, he can select the transfer object and enter the transfer amount in the terminal he holds. The terminal will generate a corresponding transaction request based on the user's input and send this transaction request to the first blockchain node.
第一区块链节点接收到终端发送的交易请求(即业务请求)后,可将这笔交易请求发送至预设的分布式中间件中,以是该预设的分布式中间件可以根据该第一区块链节点的节点标识,将该交易请求存储在第一区块链节点所对应的业务存储器中。After the first blockchain node receives the transaction request (i.e., business request) sent by the terminal, it can send the transaction request to the preset distributed middleware, so that the preset distributed middleware can store the transaction request in the business memory corresponding to the first blockchain node according to the node identifier of the first blockchain node.
而后,第一区块链节点在接收到这笔交易请求时,可将这笔交易请求以广播的形式发送给整个共识网络中的其他区块链节点,即各第二区块链节点,各第二区块链节点在接收到这笔交易请求后,可同样将该交易请求发送至预设的分布式中间件中,以使该预设的分布式中间件根据各第二区块链节点的节点标识,将该交易请求分别存储在各第二区块链节点各自所对应的业务存储器中。Then, when the first blockchain node receives the transaction request, it can send the transaction request in the form of a broadcast to other blockchain nodes in the entire consensus network, that is, each second blockchain node. After receiving the transaction request, each second blockchain node can also send the transaction request to the preset distributed middleware, so that the preset distributed middleware can store the transaction request in the business storage corresponding to each second blockchain node according to the node identifier of each second blockchain node.
需要说明的是,第二区块链节点接收到第一区块链节点发送的该业务请求时,同样可通过广播的方式,将该业务请求发送至整个共识网络中的其他区块链节点。此举的目的在于,对于一笔正常合法的业务请求来说,整个共识网络实质上是希望该业务请求求能够通过各区块链节点的共识校验,所以,整个共识网络其实希望该业务请求在共识校验之前,均能存在于各区块链节点所对应的业务存储器中。It should be noted that when the second blockchain node receives the service request sent by the first blockchain node, it can also broadcast the service request to other blockchain nodes in the entire consensus network. The purpose of this is that for a normal and legitimate service request, the entire consensus network actually hopes that the service request can pass the consensus verification of each blockchain node. Therefore, the entire consensus network actually hopes that the service request can exist in the service storage corresponding to each blockchain node before the consensus verification.
然而,在实际应用中,各区块链节点之间的网络通信通常会出现诸如断网、网络抖动等情况发生,若该业务请求只由第一区块链节点进行广播,而其他区块链节点(即各第二区块链节点)不对该业务请求进行再次广播,则当第一区块链节点与某一个或某一些第二区块链节点之前的网络通信出现故障时,则这部分第二区块链节点将无法接收到该业务请求,从而在后续过程中对该业务请求的共识校验造成影响。However, in actual applications, network communications between blockchain nodes often experience problems such as network disconnection and network jitter. If the service request is only broadcast by the first blockchain node, and other blockchain nodes (i.e., the second blockchain nodes) do not broadcast the service request again, then when the network communication between the first blockchain node and one or some second blockchain nodes fails, these second blockchain nodes will not be able to receive the service request, thereby affecting the consensus verification of the service request in the subsequent process.
为了尽可能降低这种情况的发生,在本申请实施例中,第二区块链节点接收到第一区块链节点发送的该业务请求后,可将通过广播的方式将该业务请求再次广播给整个共识网络的其他区块链节点。其他区块链节点在接收到该业务请求时,可先判断此前是否已经接收过该业务请求,若是,则忽略该业务请求,若否,则可通过预设的分布式中间件,该业务请求存储在自身对应的业务存储器中。To minimize the occurrence of this situation, in an embodiment of the present application, after receiving the service request sent by the first blockchain node, the second blockchain node can broadcast the service request to other blockchain nodes in the entire consensus network. When other blockchain nodes receive the service request, they can first determine whether they have received the service request before. If so, they will ignore the service request. If not, they can store the service request in their corresponding service memory through the preset distributed middleware.
例如在图2中,当第一区块链节点与第二区块链节点3之间出现网络通信故障时,第二区块链节点3依然可以通过第二区块链节点2以及第二区块链节点4接收到这笔交易请求,这就保证了当这笔交易请求是一笔正常合法的交易请求时,这笔交易请求将尽可能的存储在整个共识网络中各区块链节点的各业务存储器中。For example, in Figure 2, when a network communication failure occurs between the first blockchain node and the second blockchain node 3, the second blockchain node 3 can still receive the transaction request through the second blockchain node 2 and the second blockchain node 4. This ensures that when the transaction request is a normal and legal transaction request, the transaction request will be stored in the business storage of each blockchain node in the entire consensus network as much as possible.
在本申请实施例中,第一区块链节点在存储该业务请求的过程中,可先确定出该业务请求所对应的业务类型,并根据预设的各业务类型的优先级顺序,将该业务请求与先前接收到的各业务请求进行排序。In an embodiment of the present application, when storing the business request, the first blockchain node may first determine the business type corresponding to the business request, and sort the business request with the previously received business requests according to the preset priority order of each business type.
此举的目的在于,在实际应用中,不同的业务,所要求的业务处理的延迟性也各不相同,例如,对于交易业务来说,这类业务通常对业务处理的延迟性要求较高,即,希望整个共识网络能够快速完成该业务的处理工作,而对于公益类的业务来说,这类业务对业务处理的延迟性要求则相对较低,即,即使整个共识网络经过较长的时间后才对该业务进行处理,也不会对该业务造成较大的影响。The purpose of this is that in actual applications, different businesses require different processing delays. For example, for transaction businesses, such businesses usually have higher requirements for business processing delays, that is, they hope that the entire consensus network can quickly complete the processing of the business. For public welfare businesses, such businesses have relatively low requirements for business processing delays, that is, even if the entire consensus network processes the business after a long time, it will not have a major impact on the business.
基于此,在本申请实施例中,第一区块链节点将该业务请求存储在第一区块链节点所对应的业务存储器时,可按照各业务的优先级顺序,将该业务请求在业务存储器中进行排序,从而得到包含有该业务请求的一个业务队列。在该业务队列中,延迟性要求较高的业务请求则相对靠前,而延迟性要求较低的业务请求则相对靠后,具体的排序方式则是通过运维人员预设的各业务类型的优先级顺序来决定的。Based on this, in an embodiment of the present application, when the first blockchain node stores the service request in the service memory corresponding to the first blockchain node, the service request may be sorted in the service memory according to the priority order of each service, thereby generating a service queue containing the service request. In this service queue, service requests with higher latency requirements are placed relatively early, while service requests with lower latency requirements are placed relatively late. The specific sorting method is determined by the priority order of each service type preset by the operation and maintenance personnel.
需要说明的是,在本申请实施例中,除了通过各业务类型的优先级顺序来决定业务队列中各业务请求的排列顺序外,第一区块链节点也可根据业务请求在业务存储器中的存储时间来综合决定各业务请求在业务存储器中的排列顺序。即,当业务存储器中的某一业务请求在该业务存储器中的存储时间过长时,则即使该业务请求的延迟性要求较低,也可将该业务请求提升至整个业务队列的前端。It should be noted that in this embodiment of the present application, in addition to determining the order of service requests in the service queue based on the priority of each service type, the first blockchain node may also comprehensively determine the order of service requests in the service memory based on the storage time of the service requests in the service memory. In other words, if a service request in the service memory has been stored in the service memory for an excessively long time, even if the latency requirement for the service request is relatively low, the service request may be promoted to the front of the entire service queue.
S103:从所述业务存储器中捞取至少一个业务请求,并将捞取的所述至少一个业务请求打包成预处理块广播给各第二区块链节点,以使所述各第二区块链节点在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求,并通过所述部分业务请求以及自身业务存储器中存储的业务请求对所述预处理块进行共识校验。S103: Retrieve at least one business request from the business memory, and package the at least one business request into a pre-processing block and broadcast it to each second blockchain node, so that when each second blockchain node determines that its corresponding business memory does not contain some business requests in the pre-processing block, it obtains the part of the business requests from other blockchain nodes, and performs consensus verification on the pre-processing block through the part of the business requests and the business requests stored in its own business memory.
在本申请实施例中,第一区块链节点需要将自身对应的业务存储器中存储的业务请求通过整个共识网络进行共识,以完成该业务请求的处理工作。为此,第一区块链节点可从自身对应的业务存储器中捞取至少一个业务请求,并在后续过程中,通过整个共识网络对这些业务请求进行共识。In this embodiment of the present application, the first blockchain node needs to reach consensus on the service request stored in its corresponding service memory through the entire consensus network to complete the processing of the service request. To this end, the first blockchain node can retrieve at least one service request from its corresponding service memory and, in the subsequent process, reach consensus on these service requests through the entire consensus network.
其中,第一区块链节点可将所述业务存储器中业务类型高于设定优先级的各业务请求进行捞取,例如,第一区块链节点可以某一业务类型为界限,将业务类型优先级位于该业务类型之上的各业务请求从该业务存储器中捞取出来。Among them, the first blockchain node can retrieve each business request in the business memory whose business type is higher than the set priority. For example, the first blockchain node can use a certain business type as a boundary and retrieve each business request whose business type priority is above the business type from the business memory.
当然,第一区块链节点也可以从该业务存储器中捞取设定数量的业务请求,如,当各业务请求在业务存储器中的存储形式是以上述业务队列的形式存储时,第一区块链节点可从该业务队列中捞取设定数量的业务请求,进一步的,若设定数量用N表示,则第一区块链节点可从该业务队列中捞取前N个业务请求。Of course, the first blockchain node can also retrieve a set number of business requests from the business memory. For example, when the storage form of each business request in the business memory is stored in the form of the above-mentioned business queue, the first blockchain node can retrieve a set number of business requests from the business queue. Furthermore, if the set number is represented by N, the first blockchain node can retrieve the first N business requests from the business queue.
除了以设定数量为标准来捞取业务请求外,第一区块链节点也可通过其他的标准来捞取业务请求,例如,第一区块链节点可将在业务存储器中存储时间超过设定时长的业务请求进行捞取;或是,第一区块链节点通过整个共识网络对业务请求进行共识时,可选定一个业务,并将这个业务所对应的各业务请求从业务存储器中捞取出来,其中,第一区块链节点选定业务时,可随机选取,也可按照一定顺序进行选取。当然,第一区块链节点还可通过其他标准来捞取业务请求,在此就不进行详细赘述了。In addition to retrieving business requests based on a set number of requests, the first blockchain node may also retrieve business requests based on other criteria. For example, the first blockchain node may retrieve business requests that have been stored in the business memory for longer than a set period of time. Alternatively, when the first blockchain node reaches consensus on the business requests through the entire consensus network, it may select a business and retrieve the business requests corresponding to that business from the business memory. The first blockchain node may select the business randomly or in a certain order. Of course, the first blockchain node may also retrieve business requests based on other criteria, which will not be discussed in detail here.
第一区块链节点捞取设定数量的业务请求后,可通过预设的特征值确定规则,分别确定出各业务请求所对应的各子特征值,如,当预设的特征值确定规则为Hash算法时,第一区块链节点可分别确定出各业务请求所对应的各子Ha sh值,而当预设的特征值确定规则为消息摘要算法第五版(Message Digest A lgorithm,MD5)时,第一区块链节点可分别确定出各业务请求所对应的子M D5值。After the first blockchain node retrieves a set number of business requests, it can determine the sub-feature values corresponding to each business request through a preset feature value determination rule. For example, when the preset feature value determination rule is a Hash algorithm, the first blockchain node can determine the sub-Hash values corresponding to each business request. When the preset feature value determination rule is the Message Digest Algorithm (MD5), the first blockchain node can determine the sub-MD5 values corresponding to each business request.
第一区块链节点确定出各业务请求对应的各子特征值后,可根据确定出的各特征值以及各业务请求在所述业务存储器中的排列顺序,确定出各业务请求唯一对应的待验证特征值。After the first blockchain node determines the sub-feature values corresponding to each business request, it can determine the unique feature value to be verified corresponding to each business request based on the determined feature values and the arrangement order of each business request in the business memory.
其中,该待验证特征值与各业务请求整体上唯一对应,即,当各业务请求中的某一业务请求在内容上发生变化时,则该待验证特征值也将发生变化。第一区块链节点确定待验证特征值的方式如图3所示。The feature value to be verified uniquely corresponds to each service request as a whole. That is, when the content of a service request in each service request changes, the feature value to be verified will also change. The method for the first blockchain node to determine the feature value to be verified is shown in Figure 3.
图3为本申请实施例提供的确定待验证特征值的示意图。FIG3 is a schematic diagram of determining a characteristic value to be verified provided in an embodiment of the present application.
在图3中,第一区块链节点所采用的特征值确定规则为Hash算法,假设,第一区块链节点从其自身对应的业务存储器中捞取设定数量为4的四个业务请求,这四个业务请求在业务队列中的排序如图3所示。第一区块链节点分别确定出这四个业务请求对应的四个Hash值后,可将这四个Hash值,按照这四个业务请求在业务队列中的排序,从左到右依次置于Merkle树的四个叶子节点上,并以此确定出Merkle树的非叶子节点以及根节点,而后,第一区块链节点可将该Merkle树的根节点Hash7确定为这四个业务请求唯一对应的待验证特征值。In Figure 3, the first blockchain node uses a hash algorithm to determine the characteristic value. Assume that the first blockchain node retrieves a set number of four business requests from its corresponding business memory. The order of these four business requests in the business queue is shown in Figure 3. After the first blockchain node determines the four hash values corresponding to these four business requests, it can place these four hash values on the four leaf nodes of the Merkle tree from left to right according to the order of these four business requests in the business queue. This is used to determine the non-leaf nodes and the root node of the Merkle tree. The first blockchain node can then determine the root node Hash7 of the Merkle tree as the unique characteristic value to be verified corresponding to these four business requests.
需要说明的是,上述说明的确定待验证特征值的方法并不唯一,第一区块链节点也可采用其他的方式进行,只需保证各业务请求在一定顺序下,该待验证特征值与各业务请求唯一对应即可。It should be noted that the method for determining the characteristic value to be verified described above is not unique. The first blockchain node may also adopt other methods. It only needs to ensure that the characteristic value to be verified uniquely corresponds to each business request in a certain order.
第一区块链节点在确定出各业务请求(即从业务存储器中捞取的至少一个业务请求)唯一对应的待验证特征值后,可将该待验证特征值以及各业务请求打包成一个预处理块,其中在该预处理块中包含有各业务请求以及该待验证特征值,与此同时,各业务请求在该预处理块中是按照各业务请求在业务存储器中的排列顺序进行排列的。After determining the unique characteristic value to be verified corresponding to each business request (i.e., at least one business request retrieved from the business memory), the first blockchain node can package the characteristic value to be verified and each business request into a preprocessing block, wherein the preprocessing block includes each business request and the characteristic value to be verified. At the same time, the business requests are arranged in the preprocessing block according to the arrangement order of the business requests in the business memory.
第一区块链节点可将确定出的预处理块以广播的形式发送给整个共识网络中的其他区块链节点(即各第二区块链节点),进而通过整个共识网络对该预处理块中包含的这些业务请求进行共识,如图4所示。The first blockchain node can send the determined pre-processing block to other blockchain nodes (i.e., each second blockchain node) in the entire consensus network in the form of a broadcast, and then reach a consensus on the business requests contained in the pre-processing block through the entire consensus network, as shown in Figure 4.
图4为本申请实施例提供的共识网络针对第一区块链节点发送的预处理块进行共识的示意图。Figure 4 is a schematic diagram of the consensus network provided in an embodiment of the present application performing consensus on the pre-processed block sent by the first blockchain node.
在图4中,第一区块链节点可将该预处理块广播给整个共识网络中的各第二区块链节点,而对于每个第二区块链节点来说,当接收到第一区块链节点发送的预处理块时,第二区块链节点可对该预处理块进行解析,以确定出该预处理块中所包含的各业务请求以及上述待验证特征值。In Figure 4, the first blockchain node can broadcast the pre-processing block to each second blockchain node in the entire consensus network. For each second blockchain node, when receiving the pre-processing block sent by the first blockchain node, the second blockchain node can parse the pre-processing block to determine the business requests contained in the pre-processing block and the above-mentioned feature values to be verified.
而后,针对每个第二区块链节点来说,第二区块链节点在从该预处理块中解析出各业务请求后,需要对解析出的各业务请求进行非对称签名合法验证,以验证这些业务请求是否均为合法的业务请求。Then, for each second blockchain node, after parsing each business request from the preprocessing block, the second blockchain node needs to perform asymmetric signature legal verification on each parsed business request to verify whether these business requests are all legal business requests.
具体的,由于终端向区块链节点发送业务请求时,通常会使用自己所持有的私钥(当然也可以是公钥)对该业务请求进行加密(或签名),所以,第二区块链节点对上述预处理块中包含的各业务请求进行非对称签名合法验证时,需要通过公钥(或当终端用公钥加密时,第二区块链节点通过自己所持有的私钥对该业务请求进行解密)对该业务请求进行解析,并对解析出的内容进行验证。Specifically, since when a terminal sends a service request to a blockchain node, it usually uses its own private key (of course, it can also be a public key) to encrypt (or sign) the service request, when the second blockchain node performs asymmetric signature legal verification on each service request contained in the above-mentioned preprocessing block, it needs to use the public key (or when the terminal encrypts with the public key, the second blockchain node decrypts the service request with its own private key) to parse the service request and verify the parsed content.
例如,第二区块链节点对上述预处理块中的某一笔交易请求(即业务请求)进行非对称签名合法验证时,可通过自身所持有的公钥对这笔交易请求进行解密,以得到这笔交易请求中所涉及的交易双方的账户地址,进而验证交易双方的账户地址是否合法。当确定出这笔交易请求所涉及的交易双方的账户地址均为合法账户,且交易发起方的账户中所存有的金额数大于等于这笔交易请求中所涉及的转账金额数时,则确定这笔交易请求通过非对称签名合法验证,反之,则确定这笔交易请求未通过非对称签名合法验证。For example, when the second blockchain node performs asymmetric signature verification on a transaction request (i.e., a business request) in the pre-processing block, it can decrypt the transaction request using its own public key to obtain the account addresses of the two parties involved in the transaction request, thereby verifying whether the account addresses of the two parties are legitimate. If it is determined that the account addresses of the two parties involved in the transaction request are both legitimate accounts, and the amount in the account of the transaction initiator is greater than or equal to the transfer amount involved in the transaction request, then the transaction request is determined to have passed the asymmetric signature verification. Otherwise, the transaction request is determined to have failed the asymmetric signature verification.
当第二区块链节点确定出上述预处理块中包含的各业务请求均通过非对称签名合法验证后,可进一步通过预设的特征值确定规则,分别确定出这些业务请求所对应的各子特征值,其中,第二区块链节点所采用的特征值确定规定与第一区块链节点的相同。When the second blockchain node determines that all business requests contained in the above-mentioned preprocessing block have passed the legal verification of the asymmetric signature, it can further determine the sub-feature values corresponding to these business requests through the preset feature value determination rules, wherein the feature value determination regulations adopted by the second blockchain node are the same as those of the first blockchain node.
第二区块链节点确定出各业务请求对应的各子特征值后,可根据各业务请求在该预处理块中的排列顺序以及各子特征值,确定出各业务请求在整体上唯一对应的一个特征值,继而将该特征值与预处理块中的待验证特征值进行对比,当这两个特征值相同时,则可确定出第一区块链节点所要共识的这些业务请求在内容上没有发生过变动,即,确定这些业务请求通过哈希完整性验证。After the second blockchain node determines the sub-feature values corresponding to each business request, it can determine a unique feature value corresponding to each business request as a whole based on the arrangement order of each business request in the preprocessing block and the sub-feature values, and then compare the feature value with the feature value to be verified in the preprocessing block. When these two feature values are the same, it can be determined that the content of these business requests that the first blockchain node wants to reach consensus on has not changed, that is, it is determined that these business requests have passed the hash integrity verification.
各第二区块链节点可按照上述方法对该预处理块进行非对称签名合法验证以及哈希完整性验证后,可分别得到各自针对该预处理块在本地的校验结果(其中,只有在该预处理块中的各业务请求均通过非对称签名合法验证以及哈希完整性验证时,该预处理块在本地的校验结果才会是通过,否则只要有一个验证不通过,该预处理块在本地的校验结果均为不通过),随后,各第二区块链节点可将各自得到的校验结果以广播的形式发送给整个共识网络中的其他区块链节点,以进入整个共识网络的共识校验过程,而整个共识网络中的各区块链节点接收到相互广播的各校验结果后,可通过接收到的各校验结果以及自身得到的校验结果,得到整个共识网络中各区块链节点针对该预处理块中包含的各业务请求是否通过校验的综合校验结果,并将得到的综合校验结果再次广播给整个共识网络中的其他区块链节点。After each second blockchain node performs asymmetric signature legal verification and hash integrity verification on the pre-processing block according to the above method, it can obtain its own local verification results for the pre-processing block (wherein, only when each business request in the pre-processing block passes the asymmetric signature legal verification and hash integrity verification, the local verification result of the pre-processing block will be passed, otherwise as long as one verification fails, the local verification result of the pre-processing block will be failed). Subsequently, each second blockchain node can send its own verification results in the form of broadcast to other blockchain nodes in the entire consensus network to enter the consensus verification process of the entire consensus network. After each blockchain node in the entire consensus network receives the mutually broadcasted verification results, it can obtain the comprehensive verification result of whether each blockchain node in the entire consensus network has passed the verification for each business request contained in the pre-processing block through the received verification results and its own verification results, and broadcast the obtained comprehensive verification result to other blockchain nodes in the entire consensus network again.
整个共识网络中的各区块链节点接收到相互广播的综合校验结果后,可进一步判断整个共识网络中,各区块链节点得出的各综合校验结果大部分是否均为校验通过,若是,则将该预处理块包含的各业务请求写入到一个区块中进行存储,并进一步将该区块按照时序写入到自身保存的区块链中;若否,则拒绝所述各业务请求。After receiving the mutually broadcasted comprehensive verification results, each blockchain node in the entire consensus network can further determine whether most of the comprehensive verification results obtained by each blockchain node in the entire consensus network have passed the verification. If so, the business requests contained in the pre-processing block are written into a block for storage, and the block is further written into the blockchain saved by itself in time sequence; if not, the business requests are rejected.
上述说明的整个共识网络的共识校验过程只是一个大致的共识校验过程,在本申请实施例中,整个共识网络对设定数量的业务请求进行共识校验的过程还会涉及到较为复杂的共识算法,如,拜占庭容错算法(Practical Byzantine Fault Tolerance,PBFT)、一致性算法(Raft)、Paxos算法等,而本申请实施例中涉及共识算法的过程与现有技术相同,在此就不进行详细赘述了。The consensus verification process of the entire consensus network described above is only a rough consensus verification process. In the embodiment of the present application, the process of consensus verification of a set number of business requests by the entire consensus network will also involve more complex consensus algorithms, such as Practical Byzantine Fault Tolerance (PBFT), Raft, Paxos, etc. The process involving the consensus algorithm in the embodiment of the present application is the same as that in the prior art, and will not be described in detail here.
当区块链节点(这里提到的区块链节点即可以是第一区块链节点,也可以是第二区块链节点)将所述各业务请求以区块的形式存储在区块链中后,可将这些业务请求在各自业务存储器中所占用的存储空间进行释放,并将这些业务请求转移至用于保存历史业务请求的数据库中。After the blockchain node (the blockchain node mentioned here can be either the first blockchain node or the second blockchain node) stores the business requests in the form of blocks in the blockchain, the storage space occupied by these business requests in their respective business memories can be released, and these business requests can be transferred to a database for storing historical business requests.
需要说明的是,虽然各第二区块链节点会将第一区块链节点广播的业务请求进行再次广播,但是,受网络状况的影响,整个共识网络中的一些区块链节点依然可能无法有效的接收到该业务请求,所以,在共识阶段过程中,当某一第二区块链节点并没有从自身对应的业务存储器中查找到上述预处理块中的部分业务请求时,则该第二区块链节点可通过预设的分布式中间件,向其他区块链节点发送获取这部分业务请求的询问消息,而其他区块链节点在接收到该询问消息后,可确定自身对应的业务存储器中是否包含有这部分业务请求,若是,则向该第二区块链节点返回应答消息,若否,则不向该第二区块链节点返回该应答消息。It should be noted that although each second blockchain node will rebroadcast the business request broadcast by the first blockchain node, due to the influence of network conditions, some blockchain nodes in the entire consensus network may still not be able to effectively receive the business request. Therefore, during the consensus stage, when a second blockchain node does not find some of the business requests in the above-mentioned pre-processing block from its corresponding business storage, the second blockchain node can send an inquiry message to other blockchain nodes through the preset distributed middleware to obtain this part of the business request. After receiving the inquiry message, the other blockchain nodes can determine whether their corresponding business storage contains this part of the business request. If so, a response message is returned to the second blockchain node. If not, the response message is not returned to the second blockchain node.
该第二区块链节点接收到该应答消息后,可通过预设的分布式中间件从发送该应答消息的区块链节点所对应的业务存储器中获取这部分业务请求,而后,第二区块链节点可对这部分业务请求进行非对称签名合法验证,并当确定出这部分业务请求通过非对称签名合法验证时,将这部分业务请求存储在自身对应的业务存储器中,其中,第二区块链节点可按照预处理块中各业务请求的排列顺序,将这部分业务请求存储在自身对应的业务存储器中。而当该第二区块链节点确定这部分业务请求未通过非对称签名合法验证时,则不对这部分业务请求进行存储,并确定第一区块链节点发送的预处理块未通过本地(即该第二区块链节点)的共识校验。After receiving the response message, the second blockchain node can obtain this part of the business request from the business memory corresponding to the blockchain node that sent the response message through the preset distributed middleware. Then, the second blockchain node can perform asymmetric signature legal verification on this part of the business request, and when it is determined that this part of the business request has passed the asymmetric signature legal verification, it will store this part of the business request in its own corresponding business memory. Among them, the second blockchain node can store this part of the business request in its own corresponding business memory according to the order of arrangement of each business request in the pre-processing block. If the second blockchain node determines that this part of the business request has not passed the asymmetric signature legal verification, it will not store this part of the business request, and will determine that the pre-processing block sent by the first blockchain node has not passed the local (i.e., the second blockchain node) consensus verification.
若第二区块链节点从其他区块链节点接收到这部分业务请求后,依然从其他的区块链节点接收到这部分业务请求,则该第二区块链节点可将后续接收到的这部分业务请求忽略即可,无需再对后续接收到的这部分业务请求进行非对称签名合法验证及存储。If the second blockchain node receives this part of the business request from other blockchain nodes and still receives this part of the business request from other blockchain nodes, the second blockchain node can ignore this part of the business request received subsequently, and there is no need to perform asymmetric signature legal verification and storage on this part of the business request received subsequently.
在本申请实施例中,整个共识网络可以是联盟链的共识网络,而各区块链节点则可以是联盟链中的各区块链节点,其中,本申请实施例中,第一区块链节点可以是联盟链共识算法中的leader节点,而第二区块链节点可以是联盟链共识算法中的非leader节点。In an embodiment of the present application, the entire consensus network can be a consensus network of a consortium chain, and each blockchain node can be each blockchain node in the consortium chain. In this embodiment of the present application, the first blockchain node can be a leader node in the consortium chain consensus algorithm, and the second blockchain node can be a non-leader node in the consortium chain consensus algorithm.
从上述方法可以看出,第二区块链节点在接收到第一区块链节点广播的各业务请求后发现自身对应的业务存储器中未包含有各业务请求中的部分业务请求时,并不是直接认定这些业务请求在该第二区块链节点上共识校验不通过,而是可从整个共识网络中的其他区块链节点获取这部分缺失的业务请求,并通过获取的这部分业务请求以及自身业务存储器中存储的业务请求对从第一区块链节点接收到的各业务请求进行共识校验,这样一来就大大降低了因网络故障而对各业务请求的共识校验产生不利影响的情况发生,从而提高了整个区块链业务的业务处理准确性。It can be seen from the above method that after receiving the business requests broadcast by the first blockchain node, when the second blockchain node finds that its corresponding business memory does not contain some of the business requests, it does not directly determine that these business requests fail the consensus verification on the second blockchain node. Instead, it can obtain these missing business requests from other blockchain nodes in the entire consensus network, and perform consensus verification on each business request received from the first blockchain node through the obtained business requests and the business requests stored in its own business memory. This greatly reduces the occurrence of adverse effects on the consensus verification of each business request due to network failure, thereby improving the business processing accuracy of the entire blockchain business.
不仅如此,由于本申请实施例中,各区块链节点用于存储业务请求的业务存储器是以数据库形式存在的,相对于现有技术中各区块链节点通过各自的缓存存储各业务请求的方式来说,本申请实施例中所提供的数据库形式的业务存储器极大的提高了业务请求的存储能力,并且,区块链节点通过整个共识网络对该业务存储器中的部分业务请求进行共识校验时,该区块链节点依然可以继续接收终端发送的业务请求,即,无需再利用通过共识校验的部分业务请求所占有的存储空间来接收终端发送的业务请求,从而进一步提高了区块链业务的业务处理效率。Moreover, since, in the embodiment of the present application, the business memory used by each blockchain node to store business requests exists in the form of a database, compared to the prior art method in which each blockchain node stores each business request through its own cache, the business memory in the form of a database provided in the embodiment of the present application greatly improves the storage capacity of business requests. Moreover, when the blockchain node performs consensus verification on some business requests in the business memory through the entire consensus network, the blockchain node can still continue to receive business requests sent by the terminal, that is, there is no need to use the storage space occupied by some business requests that have passed the consensus verification to receive business requests sent by the terminal, thereby further improving the business processing efficiency of the blockchain business.
以上为本申请实施例提供的业务校验方法,基于同样的思路,本申请实施例还提供两种业务校验的装置,如图5、6所示。The above is the service verification method provided in the embodiment of the present application. Based on the same idea, the embodiment of the present application also provides two service verification devices, as shown in Figures 5 and 6.
图5为本申请实施例提供的一种业务校验的装置示意图,具体包括:FIG5 is a schematic diagram of a service verification device provided in an embodiment of the present application, specifically comprising:
接收模块501,接收终端发送的业务请求;Receiving module 501, receiving a service request sent by a terminal;
存储模块502,将所述业务请求存储在所述装置对应的业务存储器中,并将所述业务请求广播给各第二区块链节点,以使所述各第二区块链节点将所述业务请求分别存储在各自对应的业务存储器中;The storage module 502 stores the service request in a service memory corresponding to the device, and broadcasts the service request to each second blockchain node, so that each second blockchain node stores the service request in its corresponding service memory;
请求捞取模块503,从所述业务存储器中捞取至少一个业务请求,并将捞取的所述至少一个业务请求打包成预处理块广播给各第二区块链节点,以使所述各第二区块链节点在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求,并通过所述部分业务请求以及自身业务存储器中存储的业务请求对所述预处理块进行共识校验。The request retrieval module 503 retrieves at least one business request from the business memory, and packages the retrieved at least one business request into a pre-processing block and broadcasts it to each second blockchain node, so that when each second blockchain node determines that its corresponding business memory does not contain some business requests in the pre-processing block, it obtains the part of the business requests from other blockchain nodes and performs consensus verification on the pre-processing block through the part of the business requests and the business requests stored in its own business memory.
所述业务存储器为存储业务请求的数据库。The service memory is a database for storing service requests.
所述存储模块502,将所述业务请求通过预设的分布式中间件存储在所述业务存储器中。The storage module 502 stores the service request in the service memory through a preset distributed middleware.
所述请求捞取模块503,从所述业务存储器中捞取业务类型高于设定优先级的设定数量的各业务请求。The request retrieval module 503 retrieves a set number of service requests whose service types are higher than a set priority from the service memory.
所述存储模块502,根据所述业务请求的业务类型以及预设的各业务类型的优先级顺序,将所述业务请求在所述业务存储器中进行存储。The storage module 502 stores the service request in the service memory according to the service type of the service request and the preset priority order of each service type.
所述装置为联盟链共识算法中的leader节点,所述第二区块链节点为联盟链共识算法中的非leader节点。The device is a leader node in the alliance chain consensus algorithm, and the second blockchain node is a non-leader node in the alliance chain consensus algorithm.
图6为本申请实施例提供的另一种业务校验的装置示意图,具体包括:FIG6 is a schematic diagram of another service verification device provided in an embodiment of the present application, specifically comprising:
接收请求模块601,接收第一区块链节点广播的业务请求;A request receiving module 601 receives a service request broadcast by a first blockchain node;
请求存储模块602,将所述业务请求存储在所述装置对应的业务存储器中;A request storage module 602 stores the service request in a service memory corresponding to the device;
接收模块603,接收到所述第一区块链节点广播的包含有至少一个业务请求的预处理块,并在确定出自身对应的业务存储器中未包含有所述预处理块中的部分业务请求时,从其他区块链节点中获取所述部分业务请求;The receiving module 603 receives a pre-processing block containing at least one service request broadcast by the first blockchain node, and when determining that a service memory corresponding to the receiving module 603 does not contain some service requests in the pre-processing block, obtains the some service requests from other blockchain nodes;
校验模块604,通过所述部分业务请求以及自身对应的业务存储器中存储的业务请求,对所述预处理块进行共识校验。The verification module 604 performs consensus verification on the pre-processing block through the partial business requests and the business requests stored in its own corresponding business memory.
所述接收模块603,在确定所述业务存储器中未包含有所述预处理块中的部分业务请求时,则向其他第二区块链节点或所述第一区块链节点发送获取所述部分业务请求的询问消息;接收所述其他第二区块链节点或所述第一区块链节点返回的应答消息,所述应答消息表示发送所述应答消息的其他第二区块链节点或第一区块链节点所对应的业务存储器中存储有所述部分业务请求;从发送所述应答消息的第二区块链节点或所述第一区块链节点对应的业务存储器中获取所述部分业务请求。The receiving module 603, when determining that the business memory does not contain some business requests in the preprocessing block, sends an inquiry message to the other second blockchain node or the first blockchain node to obtain the said part of the business request; receives a response message returned by the other second blockchain node or the first blockchain node, wherein the response message indicates that the said part of the business request is stored in the business memory corresponding to the other second blockchain node or the first blockchain node that sent the response message; and obtains the said part of the business request from the business memory corresponding to the second blockchain node that sent the response message or the first blockchain node.
在本申请实施例中,第一区块链节点将从自身业务存储器中捞取的至少一个业务请求打包成预处理块广播给各第二区块链节点后,若第二区块链节点发现自身对应的业务存储器中未包含有所述预处理块中的部分业务请求,则可从其他区块链节点中获取所述部分业务请求,并通过所述部分业务请求以及自身业务存储器中存储的业务请求对所述预处理块中包含的业务请求进行共识校验。由于第二区块链节点在接收到第一区块链节点广播的预处理块后发现自身对应的业务存储器中未包含有该预处理块中的部分业务请求时,并不是直接认定该预处理块在该第二区块链节点上共识校验不通过,而是可从整个共识网络中的其他区块链节点获取这部分缺失的业务请求,并通过获取的这部分业务请求以及自身业务存储器中存储的业务请求对该预处理块进行共识校验,这样一来就大大降低了因网络故障而对各业务请求的共识校验产生不利影响的情况发生,从而提高了整个区块链业务的业务处理准确性。In an embodiment of the present application, after a first blockchain node packages at least one business request retrieved from its own business memory into a pre-processing block and broadcasts it to each second blockchain node, if the second blockchain node finds that its corresponding business memory does not contain some of the business requests in the pre-processing block, it can obtain the said part of the business requests from other blockchain nodes and perform consensus verification on the business requests contained in the pre-processing block using the said part of the business requests and the business requests stored in its own business memory. Since the second blockchain node does not directly determine that the pre-processing block has failed the consensus verification on the second blockchain node when it receives the pre-processing block broadcast by the first blockchain node and finds that its corresponding business memory does not contain some of the business requests in the pre-processing block, it can obtain the missing business requests from other blockchain nodes in the entire consensus network and perform consensus verification on the pre-processing block using the obtained part of the business requests and the business requests stored in its own business memory. This greatly reduces the possibility that the consensus verification of each business request will be adversely affected by network failures, thereby improving the accuracy of business processing of the entire blockchain business.
在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 (16)
Publications (3)
| Publication Number | Publication Date |
|---|---|
| HK1241594A1 HK1241594A1 (en) | 2018-06-08 |
| HK1241594A HK1241594A (en) | 2018-06-08 |
| HK1241594B true HK1241594B (en) | 2021-03-05 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI691853B (en) | Service verification method and device | |
| TWI685764B (en) | Consensus verification method and device | |
| TWI686709B (en) | Method and device for business acceptance and consensus | |
| EP3531668B1 (en) | Method and device for processing service request | |
| EP3565219B1 (en) | Service execution method and device | |
| US11436604B2 (en) | Method, apparatus and storage medium for processing ethereum-based falsified transaction | |
| WO2025039447A1 (en) | Electronic voting method and apparatus, and storage medium and electronic device | |
| CN111245897A (en) | Data processing method, device, system, storage medium and processor | |
| HK1241594B (en) | Service check method and device | |
| HK40040423B (en) | Service verification method and device | |
| HK40040423A (en) | Service verification method and device | |
| HK1241594A1 (en) | Service check method and device | |
| HK1241594A (en) | Service check method and device | |
| HK1244599B (en) | Consensus checking method and checking device | |
| HK1247454B (en) | Business acceptance and common method and device | |
| CN115470211A (en) | Method, device, system, and equipment for requesting and sending scoring data of source party | |
| HK1247457B (en) | Block chain service acceptance and consensus methods and devices | |
| HK1244600B (en) | Method and device for processing service request | |
| HK1244599A1 (en) | Consensus checking method and checking device |