WO2020224239A1 - Block chain implementation method,device, system and storage medium - Google Patents

Block chain implementation method,device, system and storage medium Download PDF

Info

Publication number
WO2020224239A1
WO2020224239A1 PCT/CN2019/120679 CN2019120679W WO2020224239A1 WO 2020224239 A1 WO2020224239 A1 WO 2020224239A1 CN 2019120679 W CN2019120679 W CN 2019120679W WO 2020224239 A1 WO2020224239 A1 WO 2020224239A1
Authority
WO
WIPO (PCT)
Prior art keywords
contract
smart contract
data node
consensus
request
Prior art date
Application number
PCT/CN2019/120679
Other languages
French (fr)
Chinese (zh)
Inventor
褚镇飞
张玉坚
李文强
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020224239A1 publication Critical patent/WO2020224239A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0869Network architectures or network communication protocols for network security for authentication of entities for achieving mutual authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1458Denial of Service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/166Implementing security features at a particular protocol layer at the transport layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1048Departure or maintenance mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Definitions

  • This application relates to the field of blockchain technology, in particular to blockchain implementation methods, devices, systems and storage media.
  • Blockchain was originally a special distributed accounting technology designed for Bitcoin (a digital currency) by a person whose name is Satoshi Nakamoto. Bitcoin and the blockchain technology derived from it have introduced signature systems, consensus mechanisms, time stamps and other technologies. The mutual cooperation between the modules perfectly solves the security risks caused by decentralization. Therefore, the blockchain is not a new Internet technology, but a clever integration of a number of existing technologies, such as asymmetric key signatures, consensus mechanisms, time stamps, hash algorithms, and P2P communications. Generally, blockchain can be understood as a distributed ledger, or as a distributed computing and storage system.
  • the blockchain client usually requests an endorsement from the data node and calls the smart contract, receives and verifies the contract execution result returned by the data node, and then submits the verified contract execution result to the consensus node.
  • TPS Transaction Per Second
  • the first aspect of this application provides a blockchain implementation method, which is applied to a blockchain system.
  • the method includes: a receiving step: a data node receives a request sent by an application to execute a corresponding smart contract. Including execution parameters; endorsement and execution steps: the data node endorses the smart contract, after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and compares the contract execution result and the corresponding
  • the request is sent to the consensus node group;
  • the consensus step: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form a block, and send the formed block to the Data node; and returning step: the data node returns the contract execution result to the application side.
  • the second aspect of the application provides a block chain implementation device, including: a receiving module for performing the receiving step: the data node receives the request sent by the application to execute the corresponding smart contract, the request includes execution parameters; endorsement and execution Module for receiving endorsement and execution steps: the data node endorses the smart contract, after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and compares the contract execution result and the corresponding
  • the request is sent to the consensus node group;
  • the consensus module is used to execute the consensus steps: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form a block, and the The block is sent to the data node; and a return module for performing a return step: the data node returns the contract execution result to the application side.
  • the third aspect of the present application provides a blockchain implementation system.
  • the system includes a memory and a processor.
  • the memory stores computer-readable instructions, and the computer-readable instructions are executed by one or more of the processors. When executed, one or more of the processors are caused to execute the steps of the aforementioned concurrent processing method.
  • the fourth aspect of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions run on a computer, the computer executes the method described in the first aspect above .
  • the receiving step the data node receives a request sent by the application to execute the corresponding smart contract, the request includes execution parameters; endorsement and execution steps: the data node endorses the smart contract, and After the smart contract is endorsed, the smart contract is executed according to the execution parameters, and the contract execution result and the corresponding request are sent to the consensus node group; consensus step: the consensus node group adopts a predetermined consensus algorithm to receive The received contract execution results and corresponding requests are sorted by consensus to form a block, and the formed block is sent to the data node; and the step of returning: the data node returns the contract execution result to the application terminal .
  • the consensus node group sorts the contract execution results and requests by consensus, and sends the formed block to the data node.
  • the data node returns the contract execution result to the application terminal and Broadcast the block to all other data nodes so that each data node maintains the same blockchain.
  • Figure 1 is a schematic diagram of an embodiment of a blockchain system in an embodiment of the application
  • FIG. 2 is a schematic diagram of an embodiment of any data node in FIG. 1;
  • FIG. 3 is a schematic flowchart of a first embodiment of a blockchain implementation method in an embodiment of the application
  • Fig. 4 is a schematic flowchart of a second embodiment of a blockchain implementation method in an embodiment of the application.
  • the embodiments of the present application provide a blockchain implementation method, device, system, and storage medium, which are used to reduce network interaction, reduce system delay, and improve the overall performance of the blockchain system.
  • the blockchain system 1 includes a consensus node group 2 and multiple data nodes (only two data nodes, data node 3 and data node 4 are shown in the figure), and each data node is connected to each other and is connected to the The consensus node group 2 is connected.
  • the consensus node group 2 includes a plurality of consensus nodes, and each consensus node is connected to each other. Any one of the multiple data nodes can establish a connection with an application terminal (not shown in the figure), and can also endorse the smart contract according to the endorsement strategy, and execute the smart contract through the endorsement.
  • the consensus node group 2 can perform consensus sorting on the received data to form a block, and send the formed block to the data node.
  • the data nodes and consensus nodes may be terminal devices with storage and computing functions such as servers, smart phones, tablet computers, portable computers, desktop computers and the like.
  • the server when the data node or the consensus node is a server, the server may be one or more of a rack server, a blade server, a tower server, or a cabinet server.
  • FIG. 2 is a schematic diagram of an embodiment of any data node in FIG. 1.
  • the data node includes a memory 31, a processor 32, and a network interface 33.
  • the memory 31 includes at least one type of readable storage medium.
  • the at least one type of readable storage medium may be a non-volatile storage medium such as flash memory, hard disk, multimedia card, card-type memory, and the like.
  • the readable storage medium may be an internal storage unit of the data node, such as a hard disk of the data node.
  • the readable storage medium may also be an external memory of the data node, for example, a plug-in hard disk equipped on the data node, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital). Digital, SD) card, flash card (Flash Card), etc.
  • the readable storage medium of the memory 31 is used to store the blockchain data node implementation program 30, the data stored in the blockchain, and the data node to communicate with the application end, other data nodes, and the consensus node group. Data generated in the process of information interaction, such as contract execution results and requests sent by the application to execute the corresponding smart contract.
  • the memory 31 can also be used to temporarily store data that has been output or will be output.
  • the processor 32 may be a central processing unit (CPU), microprocessor or other data processing chip, used to run the program code or processing data stored in the memory 31, such as executing the blockchain data node implementation Procedure 30.
  • CPU central processing unit
  • microprocessor or other data processing chip, used to run the program code or processing data stored in the memory 31, such as executing the blockchain data node implementation Procedure 30.
  • the network interface 33 may include a standard wired interface and a wireless interface (such as a WI-FI interface). It is usually used to establish a communication connection between the data node and other electronic devices, such as establishing a communication connection with the application end, other data nodes, and consensus node groups.
  • a wireless interface such as a WI-FI interface
  • Fig. 2 only shows data nodes with components 31-33 and a data node implementation program 30, but it should be understood that it is not required to implement all the illustrated components, and more or fewer components may be implemented instead.
  • a microservice call interface to the data node, including but not limited to Restful, grpc, thrift, ICE, SOAP, etc., so that the data node and the application end, other data nodes, and consensus node groups can be established
  • the communication connection especially improves the universality of the data node to the application side.
  • the data node may also include an input unit such as a keyboard (Keyboard), a voice input device such as a microphone (Microphone), a radio frequency (RF) circuit, a display, a sensor, an audio circuit, a wired interface and a wireless interface, etc. No longer.
  • an input unit such as a keyboard (Keyboard)
  • a voice input device such as a microphone (Microphone), a radio frequency (RF) circuit
  • a display such as a keyboard (Keyboard), a microphone (Microphone), a radio frequency (RF) circuit, a display, a sensor, an audio circuit, a wired interface and a wireless interface, etc. No longer.
  • RF radio frequency
  • the data node integrates part of the functions of the original blockchain client node, and the processor 32 implements the following steps when executing the data node implementation program 30 stored in the memory 31:
  • Request receiving step receiving a request from the application to execute the corresponding smart contract, the request including execution parameters;
  • Endorsement and execution steps endorse the smart contract, execute the smart contract according to the execution parameters after the smart contract is endorsed, and send the contract execution result and the corresponding request to the consensus node group;
  • Block receiving step receiving the block formed by the consensus node group according to the contract execution result and the corresponding request.
  • Result returning step returning the contract execution result to the application terminal.
  • FIG. 3 it is a schematic flowchart of the first embodiment of the blockchain implementation method of this application.
  • the method includes the following steps:
  • the data node receives the request for executing the corresponding smart contract sent by the application.
  • the data node may be any data node that establishes a connection with the application end, such as the data node 3.
  • the application end can be any electronic device with data transceiving function.
  • the user can send a request to execute the corresponding smart contract on the application end to the blockchain system.
  • the application end can select the nearest data node Make a connection and send a request.
  • the smart contract is also called a "programmable contract", which is a collection of a piece of code and data, that is, a contract is defined by program coding, and execution conditions are preset, and the preset behavior is executed when the execution conditions are triggered.
  • the "intelligence” is execution intelligence, that is, when a certain preset condition (for example, through endorsement) is reached, the contract is automatically executed.
  • the essence of a smart contract is a collection of some execution tasks. When the preset conditions in the contract are met, the predefined execution tasks are executed.
  • execution tasks can include operations and transactions, and execution requests for operations and transactions can be initiated by users.
  • the content corresponding to the request may be " ⁇ "contract”: “ClearBank”, “param”: ⁇ "args”: ["100”] ⁇ ", where "ClearBank” represents a smart contract
  • the name of "100” means the execution parameter.
  • the request may also include user identity information, smart contract number, smart contract calling address, etc., which will not be repeated here.
  • the smart contract can be a preset smart contract, or a determined smart contract generated according to the request.
  • the smart contract can be written, compiled, and published, and can be broadcast in the blockchain system 1. , Can be stored on each node in the blockchain system 1.
  • the endorsement strategy is determined, that is, the nodes that need to endorse the smart contract and the endorsement rules are determined.
  • the application side usually chooses to establish a connection with the data node that needs to endorse the smart contract. Specifically, the application end may establish a connection with the data node through a Transport Layer Security (TLS). In order to ensure communication security, the data node and the application end may pass multiple handshake (Handshake) through TLS mutual authentication to establish a connection.
  • TLS Transport Layer Security
  • the application side sends a request to execute the corresponding smart contract to the data node through the established connection, and the data node receives the request to execute the corresponding smart contract sent by the application side.
  • step S310 the data node endorses the smart contract. After the smart contract passes the endorsement, the smart contract is executed according to the execution parameters in the request, and the contract execution result and the corresponding request are sent to the consensus node group.
  • the data node can endorse the smart contract by way of digital signature. If the smart contract is endorsed, Then the data node will execute the smart contract according to the execution parameters, and then send the contract execution result and the corresponding request to the consensus node group;
  • the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form a block, and send the formed block to the data node.
  • the consensus algorithm may be a Proof of Work (PoW) algorithm, a Proof of Stake (PoS) algorithm, a Practical Byzantine Fault Tolerance (PBFT) algorithm, a commission Any of the Delegated Proof of Stake (DPoS) algorithm, Raft algorithm, or Ripple algorithm.
  • the consensus node group After the consensus node group receives the contract execution result sent by the data node and the corresponding request, it can execute the smart contract according to the request, verify the validity of the contract execution result, and verify as The effective contract execution result and the corresponding request plus the serial number.
  • the serial number reaches the preset serial number threshold or the preset time threshold, the contract execution result and the corresponding request are packaged to form a block, and the formed area The block is sent to the data node.
  • Step S330 the data node broadcasts the block to all other data nodes, and returns the contract execution result to the application side.
  • the block can be broadcast to all other data nodes, and each data node stores the block in the local blockchain In, to achieve data synchronization.
  • the data node may also return the contract execution result to the application terminal, and then disconnect the application terminal.
  • a second embodiment of the blockchain implementation method is proposed based on the above embodiment.
  • FIG. 4 it is a schematic flowchart of the second embodiment of the blockchain implementation method of this application.
  • the data node is only one of the endorsing nodes specified by the endorsement policy determined by the smart contract, and the data node needs to forward the request to other endorsing nodes specified by the endorsement policy, that is Other data nodes that need to endorse the smart contract, so step S310 will be replaced by steps S311-S313.
  • Step S311 the data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract. Specifically, each data node holds a set of key pairs, the public key in the key pair is known by all data nodes in the blockchain system and the consensus node group, and the private key in the key pair is only Each data node itself holds.
  • the data node forwards the request to other data nodes it first uses a predetermined hash function (such as SHA-256 or MD5) to hash the request, generates a first request digest, and uses its own private The key encrypts the first request digest, and the encrypted first request digest will be sent to other data nodes together with the request as the digital signature of the request.
  • a predetermined hash function such as SHA-256 or MD5
  • other data nodes After receiving the request, other data nodes first use the predetermined hash function to calculate the second request digest from the received request, and then use the public key of the digital node to decrypt the digital signature attached to the request If the decrypted request digest is the same as the second request digest, the data node that receives the request confirms that the digital signature belongs to the data node, and the received request comes from the data node and has not been tampered with.
  • Data transmission within the blockchain system can usually use similar data signature technology to ensure data security, including data transmission between data nodes and consensus node groups. For the convenience of narrative and highlight the key points, this application does not emphasize this. Part.
  • each consensus node in the consensus node group can also hold a key pair, and the data transmission between the consensus node group and the data node and the data transmission between the consensus nodes within the consensus node group can be adopted Data signature technology guarantees data security, so I won’t repeat it here.
  • Step S312 The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters.
  • the endorsement strategy determined by the smart contract when the smart contract collects endorsements from a preset number of data nodes among the multiple data nodes specified by the endorsement strategy, the smart contract is deemed to be endorsed.
  • the data nodes that endorse the smart contract can simulate the execution of the smart contract according to the execution parameters, and each data node will get a contract execution result.
  • Step S313 verifying whether the contract execution results obtained by each data node executing the smart contract are consistent, if the contract execution results are consistent, then the contract execution results and the corresponding request are sent to the consensus node group, if the If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application. It is understandable that for the same request, if the contract execution result obtained by each data node is consistent, the execution result and the corresponding request will be sent to the consensus node group. If the contract execution result obtained by each data node is inconsistent, then The error message is sent to the application end, and the application end can resend the request or give up executing the corresponding smart contract according to the received error information.
  • the data node that receives the application request can determine whether the contract execution result is consistent, and the data node sends the execution result and corresponding request to the consensus node group or The application side returns an error message.
  • the blockchain implementation method proposed in the above embodiment integrates part of the functions of the original blockchain client node by the data node, such as verifying whether the execution results of the contract for the same request are consistent, and the user does not need to install the blockchain client on the application side Software, and establishing a connection with relevant data nodes through TLS and completing information transmission not only meets the security requirements, but also reduces the cost of preventing illegal users and the risk of being attacked by Distributed Denial of Service (SSoS). And it helps to reduce network interaction, reduce system latency, and improve the overall performance of the blockchain system.
  • SoS Distributed Denial of Service
  • the block chain implementation method in the embodiment of the application is described above, and the block chain implementation device in the embodiment of the application is described below.
  • the block chain implementation device in the embodiment of the application includes:
  • the receiving module is used to perform the receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, and the request includes execution parameters;
  • the endorsement and execution module is used to perform the steps of receiving endorsement and execution: the data node endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and executes the contract The result and the corresponding request are sent to the consensus node group;
  • the consensus module is used to perform the consensus steps: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests, form blocks, and send the formed blocks to the data Node; and
  • the return module is used to perform the return step: the data node returns the contract execution result to the application side.
  • block chain implementation device further includes:
  • the data node establishes a connection with the application terminal through a secure transport layer protocol and completes information transmission;
  • connection is disconnected after the returning step.
  • endorsement and execution modules are specifically used for:
  • the data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract;
  • the data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters;
  • the data node that receives the application request will return error information to the application.
  • the consensus module is specifically used to:
  • the consensus algorithm is PoW algorithm, PoS algorithm, PBFT algorithm, Raft algorithm, DPoS algorithm or Ripple algorithm.
  • block chain implementation device further includes:
  • the data node broadcasts the block to all other data nodes
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium.
  • the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on the computer, the computer executes the following steps:
  • Request receiving step receiving a request from the application to execute the corresponding smart contract, the request including execution parameters;
  • Endorsement and execution steps endorse the smart contract, execute the smart contract according to the execution parameters after the smart contract is endorsed, and send the contract execution result and the corresponding request to the consensus node group;
  • Block receiving step receiving the block formed by the consensus node group according to the contract execution result and the corresponding request.
  • Result returning step returning the contract execution result to the application terminal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application relates to the field of block chain, and provides a block chain implementation method, device, a system, and a computer-readable storage medium. The method comprises: a data node receives a request sent by an application side for executing a corresponding smart contract; the data node endorses the smart contract according to the endorsement strategy in the smart contract, executes the smart contracts after the smart contract passes the endorsement, and sends a contract execution result and the corresponding request to a consensus node group; the consensus node group performs consensus sorting on the received contract execution result and the corresponding request, forms a block, and sends the formed block to the data node; and the data node returns the contract execution result to the application side. According to the present application, network interaction can be reduced and the overall performance of the block chain system can be improved.

Description

区块链实现方法、装置、***及存储介质Block chain realization method, device, system and storage medium
本申请要求于2019年5月6日提交中国专利局、申请号为201910371484.3、发明名称为“区块链实现方法、***及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 6, 2019, the application number is 201910371484.3, and the invention title is "Blockchain implementation method, system and storage medium", the entire content of which is incorporated by reference Applying.
技术领域Technical field
本申请涉及区块链技术领域,尤其涉及区块链实现方法、装置、***及存储介质。This application relates to the field of blockchain technology, in particular to blockchain implementation methods, devices, systems and storage media.
背景技术Background technique
区块链最初是由一位化名为中本聪的人为比特币(一种数字货币)而设计出的一种特殊的分布式记账技术。比特币以及由其衍生出来的区块链技术都引入了签名***、共识机制、时间戳等技术,各模块之间的相互协作完美地解决了去中心化带来的安全隐患。因此,区块链并不是一项全新的互联网技术,而是多项已有技术,如非对称密钥签名、共识机制、时间戳、哈希算法、P2P通信等的巧妙整合。通常,区块链可以被理解为一个分布式的账本,或被看作是一个分布式计算和存储***。Blockchain was originally a special distributed accounting technology designed for Bitcoin (a digital currency) by a person whose name is Satoshi Nakamoto. Bitcoin and the blockchain technology derived from it have introduced signature systems, consensus mechanisms, time stamps and other technologies. The mutual cooperation between the modules perfectly solves the security risks caused by decentralization. Therefore, the blockchain is not a new Internet technology, but a clever integration of a number of existing technologies, such as asymmetric key signatures, consensus mechanisms, time stamps, hash algorithms, and P2P communications. Generally, blockchain can be understood as a distributed ledger, or as a distributed computing and storage system.
现有的区块链***,通常是由区块链客户端向数据节点请求背书和调用智能合约,接收并验证数据节点返回的合约执行结果,然后将通过验证的合约执行结果提交给共识节点。在此过程中,远程网络调用次数过多,影响了区块链***整体处理延时以及每秒事务处理量(Transaction Per Second,TPS)的进一步优化。因此,发明人意识到,区块链客户端的存在增加了网络交互和***延迟,现有的区块链实现方法存在改善空间。In the existing blockchain system, the blockchain client usually requests an endorsement from the data node and calls the smart contract, receives and verifies the contract execution result returned by the data node, and then submits the verified contract execution result to the consensus node. In this process, there are too many remote network calls, which affects the overall processing delay of the blockchain system and the further optimization of Transaction Per Second (TPS). Therefore, the inventor realized that the existence of the blockchain client increases network interaction and system delay, and there is room for improvement in the existing blockchain implementation methods.
发明内容Summary of the invention
鉴于以上原因,有必要提供一种区块链实现方法、装置、***及计算机可读存储介质,可以减少网络交互,降低***延迟,提升区块链***的整体性能。In view of the above reasons, it is necessary to provide a blockchain implementation method, device, system and computer-readable storage medium, which can reduce network interaction, reduce system delay, and improve the overall performance of the blockchain system.
为实现上述目的,本申请第一方面提供了一种区块链实现方法,应用于区块链***,该方法包括:接收步骤:数据节点接收应用端发送的执行对应智能 合约的请求,该请求中包括执行参数;背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。In order to achieve the above objective, the first aspect of this application provides a blockchain implementation method, which is applied to a blockchain system. The method includes: a receiving step: a data node receives a request sent by an application to execute a corresponding smart contract. Including execution parameters; endorsement and execution steps: the data node endorses the smart contract, after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and compares the contract execution result and the corresponding The request is sent to the consensus node group; the consensus step: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form a block, and send the formed block to the Data node; and returning step: the data node returns the contract execution result to the application side.
本申请第二方面提供了一种区块链实现装置,包括:接收模块,用于执行接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;背书和执行模块,用于接收背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;共识模块,用于执行共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及返回模块,用于执行返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。The second aspect of the application provides a block chain implementation device, including: a receiving module for performing the receiving step: the data node receives the request sent by the application to execute the corresponding smart contract, the request includes execution parameters; endorsement and execution Module for receiving endorsement and execution steps: the data node endorses the smart contract, after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and compares the contract execution result and the corresponding The request is sent to the consensus node group; the consensus module is used to execute the consensus steps: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form a block, and the The block is sent to the data node; and a return module for performing a return step: the data node returns the contract execution result to the application side.
本申请第三方面提供了一种区块链实现***,所述***包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被一个或多个所述处理器执行时,使得一个或多个所述处理器执行上述所述并发处理方法的步骤。The third aspect of the present application provides a blockchain implementation system. The system includes a memory and a processor. The memory stores computer-readable instructions, and the computer-readable instructions are executed by one or more of the processors. When executed, one or more of the processors are caused to execute the steps of the aforementioned concurrent processing method.
本申请第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行上述第一方面所述的方法。The fourth aspect of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions run on a computer, the computer executes the method described in the first aspect above .
本申请提供的技术方案中,接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。通过数据 节点与应用端建立连接,接收应用端发送的执行对应智能合约的请求,并对所述智能合约进行背书,然后执行通过背书的智能合约,将合约执行结果和所述请求发送至共识节点群,由共识节点群对所述合约执行结果和请求进行共识排序,并将形成的区块发送给所述数据节点,最后由所述数据节点将所述合约执行结果返回给所述应用端并将所述区块广播至所有其他数据节点,使各数据节点维护一条相同的区块链。利用本申请,将原本区块链客户端的功能交由应用端和数据节点来实现,减少了网络交互,尤其是远程调用,降低了***延迟,提高了区块链***的整体性能。In the technical solution provided in this application, the receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, the request includes execution parameters; endorsement and execution steps: the data node endorses the smart contract, and After the smart contract is endorsed, the smart contract is executed according to the execution parameters, and the contract execution result and the corresponding request are sent to the consensus node group; consensus step: the consensus node group adopts a predetermined consensus algorithm to receive The received contract execution results and corresponding requests are sorted by consensus to form a block, and the formed block is sent to the data node; and the step of returning: the data node returns the contract execution result to the application terminal . Establish a connection with the application through the data node, receive the request to execute the corresponding smart contract sent by the application, and endorse the smart contract, then execute the endorsed smart contract, and send the contract execution result and the request to the consensus node Group, the consensus node group sorts the contract execution results and requests by consensus, and sends the formed block to the data node. Finally, the data node returns the contract execution result to the application terminal and Broadcast the block to all other data nodes so that each data node maintains the same blockchain. With this application, the functions of the original blockchain client are handed over to the application side and data nodes to achieve, reducing network interactions, especially remote calls, reducing system latency, and improving the overall performance of the blockchain system.
附图说明Description of the drawings
图1为本申请实施例中区块链***一实施例的示意图;Figure 1 is a schematic diagram of an embodiment of a blockchain system in an embodiment of the application;
图2为图1中任一数据节点的实施例的示意图;FIG. 2 is a schematic diagram of an embodiment of any data node in FIG. 1;
图3为本申请实施例中区块链实现方法第一实施例的流程示意图;FIG. 3 is a schematic flowchart of a first embodiment of a blockchain implementation method in an embodiment of the application;
图4为本申请实施例中区块链实现方法第二实施例的流程示意图。Fig. 4 is a schematic flowchart of a second embodiment of a blockchain implementation method in an embodiment of the application.
具体实施方式Detailed ways
本申请实施例提供了一种区块链实现方法、装置、***及存储介质,用于减少网络交互,降低***延迟,提升区块链***的整体性能。The embodiments of the present application provide a blockchain implementation method, device, system, and storage medium, which are used to reduce network interaction, reduce system delay, and improve the overall performance of the blockchain system.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例进行描述。In order to enable those skilled in the art to better understand the solutions of the present application, the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”或“具有”及其任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, without having to use To describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than the content illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device including a series of steps or units is not necessarily limited to those clearly listed Steps or units, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
本申请提供一种区块链***。参照图1所示,为本申请区块链***1一实 施例的示意图。在该实施例中,区块链***1包括共识节点群2和多个数据节点(图中仅标示数据节点3和数据节点4两个数据节点),各个数据节点间相互连接,并与所述共识节点群2相连接,所述共识节点群2包括多个共识节点,各个共识节点间相互连接。所述多个数据节点中的任一数据节点可以与应用端(图中未示出)建立连接,还可以根据背书策略对智能合约进行背书,并执行通过背书的智能合约。所述共识节点群2可以对接收的数据进行共识排序,形成区块,并将形成的区块发送给数据节点。所述数据节点和共识节点可以是服务器、智能手机、平板电脑、便携计算机、桌上型计算机等具有存储和运算功能的终端设备。在一个实施例中,当所述数据节点或共识节点为服务器时,该服务器可以是机架式服务器、刀片式服务器、塔式服务器或机柜式服务器等的一种或几种。This application provides a blockchain system. Refer to Figure 1 for a schematic diagram of an embodiment of the blockchain system 1 of this application. In this embodiment, the blockchain system 1 includes a consensus node group 2 and multiple data nodes (only two data nodes, data node 3 and data node 4 are shown in the figure), and each data node is connected to each other and is connected to the The consensus node group 2 is connected. The consensus node group 2 includes a plurality of consensus nodes, and each consensus node is connected to each other. Any one of the multiple data nodes can establish a connection with an application terminal (not shown in the figure), and can also endorse the smart contract according to the endorsement strategy, and execute the smart contract through the endorsement. The consensus node group 2 can perform consensus sorting on the received data to form a block, and send the formed block to the data node. The data nodes and consensus nodes may be terminal devices with storage and computing functions such as servers, smart phones, tablet computers, portable computers, desktop computers and the like. In an embodiment, when the data node or the consensus node is a server, the server may be one or more of a rack server, a blade server, a tower server, or a cabinet server.
参照图2所示,为图1中任一数据节点的实施例的示意图。所述数据节点包括存储器31、处理器32以及网络接口33。Refer to FIG. 2, which is a schematic diagram of an embodiment of any data node in FIG. 1. The data node includes a memory 31, a processor 32, and a network interface 33.
其中,存储器31包括至少一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述可读存储介质可以是所述数据节点的内部存储单元,例如该数据节点的硬盘。在另一些实施例中,所述可读存储介质也可以是该数据节点的外部存储器,例如该数据节点上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The memory 31 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as flash memory, hard disk, multimedia card, card-type memory, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the data node, such as a hard disk of the data node. In other embodiments, the readable storage medium may also be an external memory of the data node, for example, a plug-in hard disk equipped on the data node, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital). Digital, SD) card, flash card (Flash Card), etc.
在本实施例中,所述存储器31的可读存储介质用于存储区块链数据节点实现程序30、区块链中存储的数据以及该数据节点与应用端、其他数据节点以及共识节点群进行信息交互过程中产生的数据,例如合约执行结果以及应用端发送的执行对应智能合约的请求等。所述存储器31还可以用于暂时地存储已经输出或者将要输出的数据。In this embodiment, the readable storage medium of the memory 31 is used to store the blockchain data node implementation program 30, the data stored in the blockchain, and the data node to communicate with the application end, other data nodes, and the consensus node group. Data generated in the process of information interaction, such as contract execution results and requests sent by the application to execute the corresponding smart contract. The memory 31 can also be used to temporarily store data that has been output or will be output.
处理器32可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行存储器31中存储的程序代码或处理数据,例如执行所述区块链数据节点实现程序30。The processor 32 may be a central processing unit (CPU), microprocessor or other data processing chip, used to run the program code or processing data stored in the memory 31, such as executing the blockchain data node implementation Procedure 30.
网络接口33可以包括标准的有线接口、无线接口(如WI-FI接口)。通常用于在该数据节点与其他电子设备之间建立通信连接,例如与应用端、其他数据节点以及共识节点群等建立通信连接。The network interface 33 may include a standard wired interface and a wireless interface (such as a WI-FI interface). It is usually used to establish a communication connection between the data node and other electronic devices, such as establishing a communication connection with the application end, other data nodes, and consensus node groups.
图2仅示出了具有组件31-33以及数据节点实现程序30的数据节点,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Fig. 2 only shows data nodes with components 31-33 and a data node implementation program 30, but it should be understood that it is not required to implement all the illustrated components, and more or fewer components may be implemented instead.
可选地,在所述数据节点增加微服务化的调用接口,包括但不限于Restful、grpc、thrift、ICE、SOAP等,以便所述数据节点与应用端、其他数据节点以及共识节点群等建立通信连接,尤其是提高了所述数据节点对应用端的普适性。Optionally, add a microservice call interface to the data node, including but not limited to Restful, grpc, thrift, ICE, SOAP, etc., so that the data node and the application end, other data nodes, and consensus node groups can be established The communication connection especially improves the universality of the data node to the application side.
所述数据节点还可以包括输入单元比如键盘(Keyboard),语音输入装置比如麦克风(Microphone),射频(Radio Frequency,RF)电路、显示器、传感器、音频电路、有线接口和无线接口等等,在此不再赘述。The data node may also include an input unit such as a keyboard (Keyboard), a voice input device such as a microphone (Microphone), a radio frequency (RF) circuit, a display, a sensor, an audio circuit, a wired interface and a wireless interface, etc. No longer.
在上述实施例中,所述数据节点整合了原有区块链客户端节点的部分功能,处理器32执行存储器31中存储的数据节点实现程序30时实现如下步骤:In the foregoing embodiment, the data node integrates part of the functions of the original blockchain client node, and the processor 32 implements the following steps when executing the data node implementation program 30 stored in the memory 31:
请求接收步骤:接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;Request receiving step: receiving a request from the application to execute the corresponding smart contract, the request including execution parameters;
背书和执行步骤:对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;Endorsement and execution steps: endorse the smart contract, execute the smart contract according to the execution parameters after the smart contract is endorsed, and send the contract execution result and the corresponding request to the consensus node group;
区块接收步骤:接收共识节点群根据所述合约执行结果以及对应的请求形成的区块;及Block receiving step: receiving the block formed by the consensus node group according to the contract execution result and the corresponding request; and
结果返回步骤:将所述合约执行结果返回给所述应用端。Result returning step: returning the contract execution result to the application terminal.
关于上述步骤的详细介绍,请参照下述图3、图4关于区块链实现方法实施例的流程示意图的相关说明。For a detailed description of the above steps, please refer to the following descriptions of the flowcharts of the embodiments of the blockchain implementation method in FIG. 3 and FIG. 4.
参照图3所示,为本申请区块链实现方法第一实施例的流程示意图。该方法包括如下步骤:Referring to FIG. 3, it is a schematic flowchart of the first embodiment of the blockchain implementation method of this application. The method includes the following steps:
步骤S300,数据节点接收应用端发送的执行对应智能合约的请求。所述数据节点可以是与应用端建立连接的任一数据节点,例如所述数据节点3。所述应用端可以为任意具有数据收发功能的电子设备,用户可以在所述应用端向区块链***发送执行对应智能合约的请求,为了降低***延迟,所述应用端可以选择最近的数据节点进行连接和发送请求。所述智能合约也叫“可编程合约”,它是一段代码和数据的集合,即通过程序编码定义合约,预设执行条件,当触发执行条件时执行预设行为。其中的“智能”是执行上的智能,也就是说,当达到某个预设条件(例如通过背书)时,合约自动执行。智能合约的本质是一些执行任务的集合,当满足合约中的预设条件时,执行预先定义好的执行任务。通常,执行任务可包括操作和交易,操作和交易的执行请求可由用户发起。在本实施例中,所述请求对应的内容可以为“{"contract":"ClearBank","param":{"args":[“100”]}}”,其中,“ClearBank”表示智能合约的名称,“100”表示执行参数。在其他实施例中,所述请求还可以包括用户身份信息、智能合约编号、智能合约调用地址等,在此不再赘述。In step S300, the data node receives the request for executing the corresponding smart contract sent by the application. The data node may be any data node that establishes a connection with the application end, such as the data node 3. The application end can be any electronic device with data transceiving function. The user can send a request to execute the corresponding smart contract on the application end to the blockchain system. In order to reduce the system delay, the application end can select the nearest data node Make a connection and send a request. The smart contract is also called a "programmable contract", which is a collection of a piece of code and data, that is, a contract is defined by program coding, and execution conditions are preset, and the preset behavior is executed when the execution conditions are triggered. The "intelligence" is execution intelligence, that is, when a certain preset condition (for example, through endorsement) is reached, the contract is automatically executed. The essence of a smart contract is a collection of some execution tasks. When the preset conditions in the contract are met, the predefined execution tasks are executed. Generally, execution tasks can include operations and transactions, and execution requests for operations and transactions can be initiated by users. In this embodiment, the content corresponding to the request may be "{"contract": "ClearBank", "param": {"args": ["100"]}}", where "ClearBank" represents a smart contract The name of "100" means the execution parameter. In other embodiments, the request may also include user identity information, smart contract number, smart contract calling address, etc., which will not be repeated here.
在本实施例中,所述智能合约可以是预先设置的智能合约,也可以是根据所述请求生成的确定的智能合约,智能合约通过编写、编译和发布,可以在区块链***1中广播,可被存储在该区块链***1中的各个节点上。对于确定的智能合约,背书策略是确定的,即需要对该智能合约进行背书的节点和背书的规则是确定的。应用端通常会选择与需要对该智能合约进行背书的数据节点建立连接。具体地,所述应用端可以通过安全传输层协议(Transport Layer Security,TLS)与数据节点建立连接,为了保障通信安全,所述数据节点和所述应用端可以通过多次握手(Handshake),通过TLS双向认证,从而建立连接。数据节点和应用端建立连接后,所述应用端通过建立的连接将执行对应智能合约的请求发送给所述数据节点,所述数据节点接收所述应用端发送的执行对应智能合约的请求。In this embodiment, the smart contract can be a preset smart contract, or a determined smart contract generated according to the request. The smart contract can be written, compiled, and published, and can be broadcast in the blockchain system 1. , Can be stored on each node in the blockchain system 1. For a certain smart contract, the endorsement strategy is determined, that is, the nodes that need to endorse the smart contract and the endorsement rules are determined. The application side usually chooses to establish a connection with the data node that needs to endorse the smart contract. Specifically, the application end may establish a connection with the data node through a Transport Layer Security (TLS). In order to ensure communication security, the data node and the application end may pass multiple handshake (Handshake) through TLS mutual authentication to establish a connection. After the data node and the application side establish a connection, the application side sends a request to execute the corresponding smart contract to the data node through the established connection, and the data node receives the request to execute the corresponding smart contract sent by the application side.
步骤S310,所述数据节点对智能合约进行背书,在所述智能合约通过背书后,根据所述请求中的执行参数执行该智能合约,并将合约执行结果以及对应的请求发送至共识节点群。In step S310, the data node endorses the smart contract. After the smart contract passes the endorsement, the smart contract is executed according to the execution parameters in the request, and the contract execution result and the corresponding request are sent to the consensus node group.
在本实施例中,假设所述智能合约的背书策略指定的背书节点为所述数据 节点,则所述数据节点可以通过数字签名的方式对所述智能合约进行背书,如果该智能合约通过背书,则所述数据节点将根据所述执行参数执行该智能合约,然后将合约执行结果以及对应的请求发送至所述共识节点群;。In this embodiment, assuming that the endorsing node specified by the endorsement policy of the smart contract is the data node, the data node can endorse the smart contract by way of digital signature. If the smart contract is endorsed, Then the data node will execute the smart contract according to the execution parameters, and then send the contract execution result and the corresponding request to the consensus node group;
步骤S320,所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点。在本实施例中,所述共识算法可以是工作量证明(Proof of Work,PoW)算法、股权证明(Proof of Stake,PoS)算法、实用拜占庭容错算法(Practical Byzantine Fault Tolerance,PBFT)算法、委托权益(Delegated Proof of Stake,DPoS)算法、Raft算法或Ripple算法中的任意一种。In step S320, the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form a block, and send the formed block to the data node. In this embodiment, the consensus algorithm may be a Proof of Work (PoW) algorithm, a Proof of Stake (PoS) algorithm, a Practical Byzantine Fault Tolerance (PBFT) algorithm, a commission Any of the Delegated Proof of Stake (DPoS) algorithm, Raft algorithm, or Ripple algorithm.
具体地,所述共识节点群在接收到所述数据节点发送的合约执行结果以及对应的请求后,可以根据所述请求执行所述智能合约,验证所述合约执行结果的有效性,给验证为有效的合约执行结果以及对应的请求加上序号,当所述序号达到预设序号阈值或经过预设时间阈值后,将所述合约执行结果和对应的请求打包形成区块,并将形成的区块发送给所述数据节点。Specifically, after the consensus node group receives the contract execution result sent by the data node and the corresponding request, it can execute the smart contract according to the request, verify the validity of the contract execution result, and verify as The effective contract execution result and the corresponding request plus the serial number. When the serial number reaches the preset serial number threshold or the preset time threshold, the contract execution result and the corresponding request are packaged to form a block, and the formed area The block is sent to the data node.
步骤S330,所述数据节点将所述区块广播至所有其他数据节点,并将所述合约执行结果返回给所述应用端。在本实施例中,所述数据节点在接收到所述共识节点群发送的区块后,可以将该区块广播至所有其他数据节点,各个数据节点将该区块存储至本地的区块链中,实现数据同步。所述数据节点还可以将所述合约执行结果返回给所述应用端,随后断开与该应用端的连接。Step S330, the data node broadcasts the block to all other data nodes, and returns the contract execution result to the application side. In this embodiment, after the data node receives the block sent by the consensus node group, the block can be broadcast to all other data nodes, and each data node stores the block in the local blockchain In, to achieve data synchronization. The data node may also return the contract execution result to the application terminal, and then disconnect the application terminal.
基于上述实施例提出区块链实现方法的第二实施例。参照图4所示,为本申请区块链实现方法第二实施例的流程示意图。在该实施例中,所述数据节点仅为所述智能合约确定的背书策略所指定的背书节点之一,所述数据节点需要将所述请求转发给所述背书策略指定的其他背书节点,即需要对该智能合约进行背书的其他数据节点,因此步骤S310将被步骤S311-S313替换。A second embodiment of the blockchain implementation method is proposed based on the above embodiment. Referring to FIG. 4, it is a schematic flowchart of the second embodiment of the blockchain implementation method of this application. In this embodiment, the data node is only one of the endorsing nodes specified by the endorsement policy determined by the smart contract, and the data node needs to forward the request to other endorsing nodes specified by the endorsement policy, that is Other data nodes that need to endorse the smart contract, so step S310 will be replaced by steps S311-S313.
步骤S311,所述数据节点将所述请求转发给所述智能合约确定的背书策略指定的其他数据节点。具体地,每个数据节点持有一组密钥对,该密钥对中的公钥被区块链***中的所有数据节点以及共识节点群所知,该密钥对中的私钥只由各数据节点本身持有。所述数据节点在向其他数据节点转发所述请求 时,先采用预先确定的哈希函数(例如SHA-256或MD5)对所述请求进行哈希计算,生成第一请求摘要,并用自己的私钥对该第一请求摘要进行加密,加密后的第一请求摘要将作为请求的数字签名和请求一起发送给其他数据节点。其他数据节点在接收到该请求后,先利用所述预先确定的哈希函数从接收的请求中计算出第二请求摘要,然后再用所述数字节点的公钥对请求附加的数字签名进行解密,如果解密得到的请求摘要与该第二请求摘要相同,那么接收到所述请求的数据节点就确认该数字签名是所述数据节点的,接收到的请求来自所述数据节点,未被篡改。数据在区块链***内部的传递通常可以采用类似的数据签名技术保障数据安全,包括数据节点与共识节点群之间的数据传递,为了叙述的方便和重点的突出,本申请并未着重强调这部分内容。可以理解的是,所述共识节点群中的各个共识节点也可以持有密钥对,所述共识节点群与数据节点间的数据传递以及共识节点群内部各共识节点间的数据传递都可以采用数据签名技术保障数据安全,在此不再赘述。Step S311, the data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract. Specifically, each data node holds a set of key pairs, the public key in the key pair is known by all data nodes in the blockchain system and the consensus node group, and the private key in the key pair is only Each data node itself holds. When the data node forwards the request to other data nodes, it first uses a predetermined hash function (such as SHA-256 or MD5) to hash the request, generates a first request digest, and uses its own private The key encrypts the first request digest, and the encrypted first request digest will be sent to other data nodes together with the request as the digital signature of the request. After receiving the request, other data nodes first use the predetermined hash function to calculate the second request digest from the received request, and then use the public key of the digital node to decrypt the digital signature attached to the request If the decrypted request digest is the same as the second request digest, the data node that receives the request confirms that the digital signature belongs to the data node, and the received request comes from the data node and has not been tampered with. Data transmission within the blockchain system can usually use similar data signature technology to ensure data security, including data transmission between data nodes and consensus node groups. For the convenience of narrative and highlight the key points, this application does not emphasize this. Part. It is understandable that each consensus node in the consensus node group can also hold a key pair, and the data transmission between the consensus node group and the data node and the data transmission between the consensus nodes within the consensus node group can be adopted Data signature technology guarantees data security, so I won’t repeat it here.
步骤S312,接收到所述请求的数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约。按照所述智能合约确定的背书策略,当该智能合约收集到所述背书策略指定的多个数据节点中预设数量数据节点的背书时,即认为该智能合约通过背书。在该智能合约通过背书后,对该智能合约进行背书的数据节点可以根据所述执行参数各自模拟执行该智能合约,每个数据节点将得到一个合约执行结果。Step S312: The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters. According to the endorsement strategy determined by the smart contract, when the smart contract collects endorsements from a preset number of data nodes among the multiple data nodes specified by the endorsement strategy, the smart contract is deemed to be endorsed. After the smart contract is endorsed, the data nodes that endorse the smart contract can simulate the execution of the smart contract according to the execution parameters, and each data node will get a contract execution result.
步骤S313,验证执行所述智能合约的各个数据节点得到的合约执行结果是否一致,若所述合约执行结果一致,则将该合约执行结果以及对应的请求发送至所述共识节点群,若所述合约执行结果不一致,则由接收所述应用端请求的数据节点将错误信息返回给所述应用端。可以理解的是,针对同一请求,如果各个数据节点得到的合约执行结果一致,则该执行结果和对应的请求将被发送至所述共识节点群,如果各个数据节点得到的合约执行结果不一致,则将发送错误信息给所述应用端,所述应用端可以根据接收到的错误信息重新发送请求或者放弃执行对应的智能合约。在本实施例中,可以由接收所述应用端请求的数据节点判断所述合约执行结果是否一致,并由该数据节点向所述共识节点群发送所述执行结果及对应的请求或向所述应用端返回错误信息。Step S313, verifying whether the contract execution results obtained by each data node executing the smart contract are consistent, if the contract execution results are consistent, then the contract execution results and the corresponding request are sent to the consensus node group, if the If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application. It is understandable that for the same request, if the contract execution result obtained by each data node is consistent, the execution result and the corresponding request will be sent to the consensus node group. If the contract execution result obtained by each data node is inconsistent, then The error message is sent to the application end, and the application end can resend the request or give up executing the corresponding smart contract according to the received error information. In this embodiment, the data node that receives the application request can determine whether the contract execution result is consistent, and the data node sends the execution result and corresponding request to the consensus node group or The application side returns an error message.
上述实施例提出的区块链实现方法,由数据节点整合了原本区块链客户端节点的部分功能,例如验证针对同一请求的合约执行结果是否一致,用户在应用端无需安装区块链客户端软件,而通过TLS与相关数据节点建立连接并完成信息传输,不但满足了安全性的要求,还降低了防止非法用户的成本以及受分布式拒绝服务(Distributed Denial of Service,SSoS)攻击的风险,并且有助于减少网络交互,降低***延迟,提高区块链***的整体性能。The blockchain implementation method proposed in the above embodiment integrates part of the functions of the original blockchain client node by the data node, such as verifying whether the execution results of the contract for the same request are consistent, and the user does not need to install the blockchain client on the application side Software, and establishing a connection with relevant data nodes through TLS and completing information transmission not only meets the security requirements, but also reduces the cost of preventing illegal users and the risk of being attacked by Distributed Denial of Service (SSoS). And it helps to reduce network interaction, reduce system latency, and improve the overall performance of the blockchain system.
上面对本申请实施例中区块链实现方法进行了描述,下面对本申请实施例中区块链实现装置进行描述,本申请实施例中区块链实现装置包括:The block chain implementation method in the embodiment of the application is described above, and the block chain implementation device in the embodiment of the application is described below. The block chain implementation device in the embodiment of the application includes:
接收模块,用于执行接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;The receiving module is used to perform the receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, and the request includes execution parameters;
背书和执行模块,用于执行接收背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;The endorsement and execution module is used to perform the steps of receiving endorsement and execution: the data node endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and executes the contract The result and the corresponding request are sent to the consensus node group;
共识模块,用于执行共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及The consensus module is used to perform the consensus steps: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests, form blocks, and send the formed blocks to the data Node; and
返回模块,用于执行返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。The return module is used to perform the return step: the data node returns the contract execution result to the application side.
可选的,所述区块链实现装置还包括:Optionally, the block chain implementation device further includes:
所述数据节点通过安全传输层协议与所述应用端建立连接并完成信息传输;The data node establishes a connection with the application terminal through a secure transport layer protocol and completes information transmission;
在所述返回步骤后断开该连接。The connection is disconnected after the returning step.
可选的,背书和执行模块具体用于:Optionally, the endorsement and execution modules are specifically used for:
所述数据节点将所述请求转发给所述智能合约确定的背书策略指定的其他数据节点;The data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract;
接收到所述请求的数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约;The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters;
验证执行所述智能合约的各个数据节点得到的合约执行结果是否一致;Verify whether the contract execution results obtained by each data node executing the smart contract are consistent;
若所述合约执行结果一致,则将该合约执行结果以及对应的请求发送至所述共识节点群;If the contract execution result is consistent, then the contract execution result and the corresponding request are sent to the consensus node group;
若所述合约执行结果不一致,则由接收所述应用端请求的数据节点将错误信息返回给所述应用端。If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application.
可选的,共识模块具体用于:Optionally, the consensus module is specifically used to:
所述共识算法为PoW算法、PoS算法、PBFT算法、Raft算法、DPoS算法或Ripple算法。The consensus algorithm is PoW algorithm, PoS algorithm, PBFT algorithm, Raft algorithm, DPoS algorithm or Ripple algorithm.
可选的,所述区块链实现装置还包括:Optionally, the block chain implementation device further includes:
所述数据节点将所述区块广播至所有其他数据节点;The data node broadcasts the block to all other data nodes;
所有数据节点将所述区块加入到本地区块链中。All data nodes add the block to the local blockchain.
利用本申请,将原本区块链客户端的功能交由应用端和数据节点来实现,减少了网络交互,尤其是远程调用,降低了***延迟,提高了区块链***的整体性能。With this application, the functions of the original blockchain client are handed over to the application side and data nodes to achieve, reducing network interactions, especially remote calls, reducing system latency, and improving the overall performance of the blockchain system.
本申请还提供一种计算机可读存储介质,该计算机可读存储介质可以为非易失性计算机可读存储介质,也可以为易失性计算机可读存储介质。计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:The present application also provides a computer-readable storage medium. The computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on the computer, the computer executes the following steps:
请求接收步骤:接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;Request receiving step: receiving a request from the application to execute the corresponding smart contract, the request including execution parameters;
背书和执行步骤:对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;Endorsement and execution steps: endorse the smart contract, execute the smart contract according to the execution parameters after the smart contract is endorsed, and send the contract execution result and the corresponding request to the consensus node group;
区块接收步骤:接收共识节点群根据所述合约执行结果以及对应的请求形成的区块;及Block receiving step: receiving the block formed by the consensus node group according to the contract execution result and the corresponding request; and
结果返回步骤:将所述合约执行结果返回给所述应用端。Result returning step: returning the contract execution result to the application terminal.
其具体实施方式与上述数据节点的具体实施方式大致相同,可参照上述图2关于数据节点实施例的示意图以及图3、图4关于区块链实现方法实施例的流程示意图的相关介绍,在此不再赘述。The specific implementation is roughly the same as the specific implementation of the above-mentioned data node. You can refer to the above-mentioned schematic diagram of the embodiment of the data node in FIG. 2 and the relevant introduction of the schematic flowchart of the embodiment of the blockchain implementation method in FIGS. 3 and 4, here No longer.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that in this article, the terms "including", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, device, article, or method. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on what can be achieved by a person of ordinary skill in the art. When the combination of technical solutions is contradictory or cannot be achieved, it should be considered that such a combination of technical solutions does not exist. , Not within the scope of protection required by this application.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质中,包括若干指令用以使得电子设备执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of the present application essentially or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium as described above and includes several instructions. It is used to make the electronic device execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (20)

  1. 一种区块链实现方法,所述区块链实现方法包括:A block chain realization method, the block chain realization method includes:
    接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;Receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, and the request includes execution parameters;
    背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;Endorsement and execution steps: the data node endorses the smart contract, after the smart contract is endorsed, executes the smart contract according to the execution parameters, and sends the contract execution result and the corresponding request to the consensus node group;
    共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及Consensus step: The consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form blocks, and send the formed blocks to the data nodes; and
    返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。Return step: The data node returns the contract execution result to the application side.
  2. 如权利要求1所述的区块链实现方法,所述区块链实现方法还包括:The block chain realization method according to claim 1, the block chain realization method further comprises:
    所述数据节点通过安全传输层协议与所述应用端建立连接并完成信息传输;The data node establishes a connection with the application terminal through a secure transport layer protocol and completes information transmission;
    在所述返回步骤后断开该连接。The connection is disconnected after the returning step.
  3. 如权利要求1或2所述的区块链实现方法,所述背书和执行步骤被替换为:According to the block chain implementation method of claim 1 or 2, the endorsement and execution steps are replaced with:
    所述数据节点将所述请求转发给所述智能合约确定的背书策略指定的其他数据节点;The data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract;
    接收到所述请求的数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约;The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters;
    验证执行所述智能合约的各个数据节点得到的合约执行结果是否一致;Verify whether the contract execution results obtained by each data node executing the smart contract are consistent;
    若所述合约执行结果一致,则将该合约执行结果以及对应的请求发送至所述共识节点群;If the contract execution result is consistent, then the contract execution result and the corresponding request are sent to the consensus node group;
    若所述合约执行结果不一致,则由接收所述应用端请求的数据节点将错误信息返回给所述应用端。If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application.
  4. 如权利要求1所述的区块链实现方法,所述区块链实现方法还包括:The block chain realization method according to claim 1, the block chain realization method further comprises:
    所述共识算法为PoW算法、PoS算法、PBFT算法、Raft算法、DPoS算法或Ripple算法。The consensus algorithm is PoW algorithm, PoS algorithm, PBFT algorithm, Raft algorithm, DPoS algorithm or Ripple algorithm.
  5. 如权利要求1所述的区块链实现方法,所述区块链实现方法还包括:The block chain realization method according to claim 1, the block chain realization method further comprises:
    所述数据节点将所述区块广播至所有其他数据节点;The data node broadcasts the block to all other data nodes;
    所有数据节点将所述区块加入到本地区块链中。All data nodes add the block to the local blockchain.
  6. 一种区块链实现装置,所述区块链实现装置包括:A block chain realization device, the block chain realization device includes:
    接收模块,用于执行接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;The receiving module is used to perform the receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, and the request includes execution parameters;
    背书和执行模块,用于执行接收背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;The endorsement and execution module is used to perform the steps of receiving endorsement and execution: the data node endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters, and executes the contract The result and the corresponding request are sent to the consensus node group;
    共识模块,用于执行共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及The consensus module is used to perform the consensus steps: the consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests, form blocks, and send the formed blocks to the data Node; and
    返回模块,用于执行返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。The return module is used to perform the return step: the data node returns the contract execution result to the application side.
  7. 如权利要求6所述的区块链实现装置,所述区块链实现装置还包括:The block chain realization device according to claim 6, the block chain realization device further comprising:
    所述数据节点通过安全传输层协议与所述应用端建立连接并完成信息传输;The data node establishes a connection with the application terminal through a secure transport layer protocol and completes information transmission;
    在所述返回步骤后断开该连接。The connection is disconnected after the returning step.
  8. 如权利要求6或7所述的区块链实现装置,所述背书和执行模块具体用于:According to the block chain implementation device of claim 6 or 7, the endorsement and execution module is specifically used for:
    所述数据节点将所述请求转发给所述智能合约确定的背书策略指定的其他数据节点;The data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract;
    接收到所述请求的数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约;The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters;
    验证执行所述智能合约的各个数据节点得到的合约执行结果是否一致;Verify whether the contract execution results obtained by each data node executing the smart contract are consistent;
    若所述合约执行结果一致,则将该合约执行结果以及对应的请求发送至所述共识节点群;If the contract execution result is consistent, then the contract execution result and the corresponding request are sent to the consensus node group;
    若所述合约执行结果不一致,则由接收所述应用端请求的数据节点将错误信息返回给所述应用端。If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application.
  9. 如权利要求6所述的区块链实现装置,所述共识模块具体用于:According to the block chain implementation device of claim 6, the consensus module is specifically used for:
    所述共识算法为PoW算法、PoS算法、PBFT算法、Raft算法、DPoS算法或Ripple算法。The consensus algorithm is PoW algorithm, PoS algorithm, PBFT algorithm, Raft algorithm, DPoS algorithm or Ripple algorithm.
  10. 如权利要求6所述的区块链实现装置,所述区块链实现装置还包括:The block chain realization device according to claim 6, the block chain realization device further comprising:
    所述数据节点将所述区块广播至所有其他数据节点;The data node broadcasts the block to all other data nodes;
    所有数据节点将所述区块加入到本地区块链中。All data nodes add the block to the local blockchain.
  11. 一种区块链实现***,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如下步骤:A blockchain implementation system includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer program:
    接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;Receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, and the request includes execution parameters;
    背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;Endorsement and execution steps: the data node endorses the smart contract, after the smart contract is endorsed, executes the smart contract according to the execution parameters, and sends the contract execution result and the corresponding request to the consensus node group;
    共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及Consensus step: The consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form blocks, and send the formed blocks to the data nodes; and
    返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。Return step: The data node returns the contract execution result to the application side.
  12. 如权利要求11所述的区块链实现***,所述处理器执行所述计算机程序实现所述区块链实现方法时,还包括如下步骤:The blockchain implementation system according to claim 11, when the processor executes the computer program to implement the blockchain implementation method, it further comprises the following steps:
    所述数据节点通过安全传输层协议与所述应用端建立连接并完成信息传输;The data node establishes a connection with the application terminal through a secure transport layer protocol and completes information transmission;
    在所述返回步骤后断开该连接。The connection is disconnected after the returning step.
  13. 如权利要求11或12所述的区块链实现***,所述处理器执行所述计算机程序实现所述背书和执行步骤时,包括以下步骤:According to the blockchain implementation system of claim 11 or 12, when the processor executes the computer program to implement the endorsement and execution steps, it includes the following steps:
    所述数据节点将所述请求转发给所述智能合约确定的背书策略指定的其他数据节点;The data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract;
    接收到所述请求的数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约;The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters;
    验证执行所述智能合约的各个数据节点得到的合约执行结果是否一致;Verify whether the contract execution results obtained by each data node executing the smart contract are consistent;
    若所述合约执行结果一致,则将该合约执行结果以及对应的请求发送至所述共识节点群;If the contract execution result is consistent, then the contract execution result and the corresponding request are sent to the consensus node group;
    若所述合约执行结果不一致,则由接收所述应用端请求的数据节点将错误信息返回给所述应用端。If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application.
  14. 如权利要求11所述的区块链实现***,所述处理器执行所述计算机程序实现所述区块链实现方法时,还包括如下步骤:The blockchain implementation system according to claim 11, when the processor executes the computer program to implement the blockchain implementation method, it further comprises the following steps:
    所述共识算法为PoW算法、PoS算法、PBFT算法、Raft算法、DPoS算法或Ripple算法。The consensus algorithm is PoW algorithm, PoS algorithm, PBFT algorithm, Raft algorithm, DPoS algorithm or Ripple algorithm.
  15. 如权利要求11所述的区块链实现***,所述处理器执行所述计算机程序实现所述区块链实现方法时,还包括如下步骤:The blockchain implementation system according to claim 11, when the processor executes the computer program to implement the blockchain implementation method, it further comprises the following steps:
    所述数据节点将所述区块广播至所有其他数据节点;The data node broadcasts the block to all other data nodes;
    所有数据节点将所述区块加入到本地区块链中。All data nodes add the block to the local blockchain.
  16. 一种计算机可读存储介质,所述计算机可读存储介质中存储计算机指 令,当所述计算机指令在计算机上运行时,使得计算机执行如下步骤:A computer-readable storage medium in which computer instructions are stored, and when the computer instructions are run on a computer, the computer is caused to perform the following steps:
    接收步骤:数据节点接收应用端发送的执行对应智能合约的请求,该请求中包括执行参数;Receiving step: the data node receives a request sent by the application to execute the corresponding smart contract, and the request includes execution parameters;
    背书和执行步骤:所述数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约,并将合约执行结果以及对应的请求发送至共识节点群;Endorsement and execution steps: the data node endorses the smart contract, after the smart contract is endorsed, executes the smart contract according to the execution parameters, and sends the contract execution result and the corresponding request to the consensus node group;
    共识步骤:所述共识节点群采用预先确定的共识算法对接收到的合约执行结果以及对应的请求进行共识排序,形成区块,并将形成的区块发送给所述数据节点;及Consensus step: The consensus node group uses a predetermined consensus algorithm to perform consensus sorting on the received contract execution results and corresponding requests to form blocks, and send the formed blocks to the data nodes; and
    返回步骤:所述数据节点将所述合约执行结果返回给所述应用端。Return step: The data node returns the contract execution result to the application side.
  17. 如权利要求16所述的计算机可读存储介质,当所述计算机指令在计算机上运行区块链实现方法的步骤时,使得计算机执行如下步骤:The computer-readable storage medium according to claim 16, when the computer instructions run the steps of the blockchain implementation method on the computer, the computer is caused to perform the following steps:
    所述数据节点通过安全传输层协议与所述应用端建立连接并完成信息传输;The data node establishes a connection with the application terminal through a secure transport layer protocol and completes information transmission;
    在所述返回步骤后断开该连接。The connection is disconnected after the returning step.
  18. 如权利要求16或17所述的计算机可读存储介质,当多数计算机指令在计算机上运行区块链实现方法的步骤时,使得计算机执行如下步骤:According to the computer-readable storage medium of claim 16 or 17, when most computer instructions run the steps of the blockchain implementation method on the computer, the computer is caused to perform the following steps:
    所述数据节点将所述请求转发给所述智能合约确定的背书策略指定的其他数据节点;The data node forwards the request to other data nodes specified by the endorsement policy determined by the smart contract;
    接收到所述请求的数据节点对所述智能合约进行背书,在所述智能合约通过背书后,根据所述执行参数执行所述智能合约;The data node that receives the request endorses the smart contract, and after the smart contract passes the endorsement, executes the smart contract according to the execution parameters;
    验证执行所述智能合约的各个数据节点得到的合约执行结果是否一致;Verify whether the contract execution results obtained by each data node executing the smart contract are consistent;
    若所述合约执行结果一致,则将该合约执行结果以及对应的请求发送至所述共识节点群;If the contract execution result is consistent, then the contract execution result and the corresponding request are sent to the consensus node group;
    若所述合约执行结果不一致,则由接收所述应用端请求的数据节点将错误信息返回给所述应用端。If the contract execution results are inconsistent, the data node that receives the application request will return error information to the application.
  19. 如权利要求16所述的计算机可读存储介质,当所述计算机指令在计算机上运行区块链实现方法的步骤时,使得计算机执行如下步骤:The computer-readable storage medium according to claim 16, when the computer instructions run the steps of the blockchain implementation method on the computer, the computer is caused to perform the following steps:
    所述共识算法为PoW算法、PoS算法、PBFT算法、Raft算法、DPoS算法或Ripple算法。The consensus algorithm is PoW algorithm, PoS algorithm, PBFT algorithm, Raft algorithm, DPoS algorithm or Ripple algorithm.
  20. 如权利要求16所述的计算机可读存储介质,当所述计算机指令在计算机上运行区块链实现方法的步骤时,使得计算机执行如下步骤:The computer-readable storage medium according to claim 16, when the computer instructions run the steps of the blockchain implementation method on the computer, the computer is caused to perform the following steps:
    所述数据节点将所述区块广播至所有其他数据节点;The data node broadcasts the block to all other data nodes;
    所有数据节点将所述区块加入到本地区块链中。All data nodes add the block to the local blockchain.
PCT/CN2019/120679 2019-05-06 2019-11-25 Block chain implementation method,device, system and storage medium WO2020224239A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910371484.3A CN110233823A (en) 2019-05-06 2019-05-06 Block chain implementation method, system and storage medium
CN201910371484.3 2019-05-06

Publications (1)

Publication Number Publication Date
WO2020224239A1 true WO2020224239A1 (en) 2020-11-12

Family

ID=67861076

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/120679 WO2020224239A1 (en) 2019-05-06 2019-11-25 Block chain implementation method,device, system and storage medium

Country Status (2)

Country Link
CN (1) CN110233823A (en)
WO (1) WO2020224239A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110233823A (en) * 2019-05-06 2019-09-13 深圳壹账通智能科技有限公司 Block chain implementation method, system and storage medium
CN111224782B (en) * 2019-11-22 2021-06-25 腾讯科技(深圳)有限公司 Data verification method based on digital signature, intelligent device and storage medium
CN110995825B (en) * 2019-11-29 2022-08-26 腾讯科技(深圳)有限公司 Intelligent contract issuing method, intelligent node equipment and storage medium
CN111240732B (en) * 2020-01-17 2021-05-14 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for distributing distributed microservice
CN111478804B (en) * 2020-03-31 2023-04-07 上海墨珩网络科技有限公司 Decentralized flow control method and system based on dynamic block chain
CN111461722A (en) * 2020-04-17 2020-07-28 支付宝(杭州)信息技术有限公司 Intelligent contract deployment method, device and equipment
CN111914299B (en) * 2020-08-20 2021-11-02 深圳市腾盟技术有限公司 Method, device and equipment for optimizing predictive machine interface and storage medium
CN113592645B (en) * 2021-07-02 2023-11-14 中国人民银行数字货币研究所 Data verification method and device
CN113542405B (en) * 2021-07-14 2023-10-17 广东卓启云链科技有限公司 Block chain-based network communication system, method, equipment and storage medium
CN114225381B (en) * 2022-01-07 2022-07-19 广州炫动信息科技有限公司 Battle data processing method and system based on block chain distributed consensus algorithm
CN117478302B (en) * 2023-12-28 2024-03-01 湖南天河国云科技有限公司 Block chain-based privacy node identity verification method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
US20180299852A1 (en) * 2015-10-13 2018-10-18 LO3 Energy Inc. Use of blockchain based distributed consensus control
CN108805561A (en) * 2017-04-27 2018-11-13 中思博安科技(北京)有限公司 It may have access to the execution method and system of the intelligent contract of multiple block chains
CN110233823A (en) * 2019-05-06 2019-09-13 深圳壹账通智能科技有限公司 Block chain implementation method, system and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109118214B (en) * 2017-06-26 2020-11-17 华为技术有限公司 Method and device for operating intelligent contract
CN108595126B (en) * 2018-04-27 2022-09-02 腾讯科技(深圳)有限公司 Data storage system, query method, query device, server, and storage medium
CN108648056A (en) * 2018-05-10 2018-10-12 中链科技有限公司 A kind of house lease contract processing method and system based on block chain
CN108769173B (en) * 2018-05-21 2021-11-09 阿里体育有限公司 Block chain implementation method and equipment for running intelligent contracts
CN108965468B (en) * 2018-08-16 2021-04-30 北京京东尚科信息技术有限公司 Block chain network service platform, chain code installation method thereof and storage medium
CN109347941A (en) * 2018-10-10 2019-02-15 南京简诺特智能科技有限公司 A kind of data sharing platform and its implementation based on block chain
CN109146490B (en) * 2018-10-11 2023-04-07 北京京东尚科信息技术有限公司 Block generation method, device and system
CN109600366A (en) * 2018-12-06 2019-04-09 中链科技有限公司 The method and device of protection user data privacy based on block chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180299852A1 (en) * 2015-10-13 2018-10-18 LO3 Energy Inc. Use of blockchain based distributed consensus control
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
CN108805561A (en) * 2017-04-27 2018-11-13 中思博安科技(北京)有限公司 It may have access to the execution method and system of the intelligent contract of multiple block chains
CN110233823A (en) * 2019-05-06 2019-09-13 深圳壹账通智能科技有限公司 Block chain implementation method, system and storage medium

Also Published As

Publication number Publication date
CN110233823A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
WO2020224239A1 (en) Block chain implementation method,device, system and storage medium
WO2020168937A1 (en) Block chain multi-party witness method, apparatus and device, and computer-readable storage medium
Niruntasukrat et al. Authorization mechanism for MQTT-based Internet of Things
CN106101258B (en) Interface calling method, device and system of hybrid cloud
TWI587672B (en) Login authentication method, client, server and system
US20220239496A1 (en) Blockchain consensus method, device and system
US9363241B2 (en) Cryptographic enforcement based on mutual attestation for cloud services
US8850185B1 (en) Post attack man-in-the-middle detection
CN109347835A (en) Information transferring method, client, server and computer readable storage medium
WO2019084578A1 (en) Trusted remote proving method, apparatus and system
CN103037312A (en) Message push method and message push device
CN109446788B (en) Identity authentication method and device of equipment and computer storage medium
WO2013156531A1 (en) Secure password-based authentication for cloud computing services
CN109981576B (en) Key migration method and device
WO2022183998A1 (en) Data processing method and apparatus, device, and storage medium
EP3598333B1 (en) Electronic device update management
CN102752269A (en) Cloud computing-based method and system for identity authentication and cloud server
Ashik et al. Designing a fog-cloud architecture using blockchain and analyzing security improvements
CN113239375A (en) Block chain-based privacy factor data sharing system, method, computer device, and medium
CN111461720A (en) Identity verification method and device based on block chain, storage medium and electronic equipment
CN111901116B (en) Identity authentication method and system based on EAP-MD5 improved protocol
Hussien et al. Public auditing for secure data storage in cloud through a third party auditor using modern ciphertext
CN111769949A (en) Management/execution method/system, medium, management/agent terminal for mutual authentication
CN112242979A (en) IP address prefix authentication method and equipment based on block chain system
CN113225348B (en) Request anti-replay verification method and device

Legal Events

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

Ref document number: 19928237

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19928237

Country of ref document: EP

Kind code of ref document: A1

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 19928237

Country of ref document: EP

Kind code of ref document: A1