CN110505065B - A method, device and storage medium for adding trusted timestamp - Google Patents
A method, device and storage medium for adding trusted timestamp Download PDFInfo
- Publication number
- CN110505065B CN110505065B CN201910775729.9A CN201910775729A CN110505065B CN 110505065 B CN110505065 B CN 110505065B CN 201910775729 A CN201910775729 A CN 201910775729A CN 110505065 B CN110505065 B CN 110505065B
- Authority
- CN
- China
- Prior art keywords
- block
- timestamp
- blockchain
- trusted
- transaction
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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/3297—Cryptographic 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 time stamps, e.g. generation of time stamps
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2463/00—Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
- H04L2463/121—Timestamp
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Business, Economics & Management (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Development Economics (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请实施例提供一种可信时间戳添加方法、装置和存储介质,涉及区块链技术领域。其中,方法包括:获取区块链上当前最新区块的区块数据;获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据;根据所述具有可信时间戳的区块数据构建时间戳交易请求;向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。本申请实施例通过异步地为区块链的当前最新区块的区块数据添加可信时间戳,提高了区块链的性能,方便对区块链进行管理。
The embodiments of the present application provide a method, device and storage medium for adding a trusted timestamp, which relate to the technical field of blockchain. Wherein, the method includes: obtaining block data of the current latest block on the blockchain; obtaining a trusted time, and adding a trusted timestamp to the block data according to the trusted time, so as to obtain a trusted timestamp. block data; construct a timestamp transaction request according to the block data with a trusted timestamp; send the timestamp transaction request to a node in the blockchain, so that the node can trade according to the timestamp Request to add the trusted timestamped block data to the blockchain. The embodiment of the present application improves the performance of the blockchain and facilitates the management of the blockchain by asynchronously adding a trusted timestamp to the block data of the current latest block of the blockchain.
Description
技术领域technical field
本申请涉及区块链技术领域,具体涉及一种可信时间戳添加方法、装置和存储介质。The present application relates to the field of blockchain technology, and in particular to a method, device and storage medium for adding trusted timestamps.
背景技术Background technique
区块链是区块以链的方式组合在一起形成的去中心化的数据库。具体地,把一段时间内生成的信息(包括存证数据)打包生成一个区块,为该区块添加可信时间戳,再与上一个区块衔接在一起,如此,首尾相连,形成了区块链。其中,每一个区块的区块头中,除了创世区块外,都包括了上一个区块的哈希值,每一个区块的区块体中包括至少一个交易,交易中包括所生成的信息如包括存证数据等。由于区块链在生成区块时添加了可信时间戳,使得保存在区块链中的信息生成的时间是可信的,如此为区块链赋予可信时间。A blockchain is a decentralized database formed by combining blocks in a chain. Specifically, the information generated within a period of time (including the data on deposit) is packaged to generate a block, a trusted timestamp is added to the block, and then connected with the previous block. In this way, the end-to-end connection forms a block. blockchain. Among them, the block header of each block, except the genesis block, includes the hash value of the previous block, the block body of each block includes at least one transaction, and the transaction includes the generated The information includes, for example, evidence-based data. Since the blockchain adds a trusted timestamp when generating blocks, the time when the information stored in the blockchain is generated is credible, thus giving the blockchain a trusted time.
现有技术中,为区块链添加可信时间戳的方式具体为:区块链网络的共识节点在生成区块时获取可信时间戳。这种添加可信时间戳的方式,需要区块链本身获取可信时间戳,即需要区块链的共识节点在生成区块时去获取可信时间戳,如此,若想为区块链赋予可信时间,对区块链有侵入,需要修改共识节点的代码,使得共识节点支持获取可信时间戳,因此降低了区块链的性能。In the prior art, the method of adding a trusted timestamp to a blockchain is as follows: a consensus node of the blockchain network obtains a trusted timestamp when generating a block. This method of adding trusted timestamps requires the blockchain itself to obtain trusted timestamps, that is, the consensus nodes of the blockchain need to obtain trusted timestamps when generating blocks. Trusted time, which invades the blockchain, needs to modify the code of the consensus node so that the consensus node can support obtaining trusted timestamps, thus reducing the performance of the blockchain.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种可信时间戳添加方法、装置和存储介质,可提高区块链的性能。The embodiments of the present application provide a method, device and storage medium for adding a trusted timestamp, which can improve the performance of the blockchain.
本申请实施例提供了一种可信时间戳添加方法,包括:The embodiment of the present application provides a method for adding a trusted timestamp, including:
获取区块链上当前最新区块的区块数据;Get the block data of the current latest block on the blockchain;
获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据;Obtaining a trusted time, and adding a trusted timestamp to the block data according to the trusted time to obtain block data with a trusted timestamp;
根据所述具有可信时间戳的区块数据构建时间戳交易请求;constructing a timestamp transaction request according to the block data with the trusted timestamp;
向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。The timestamp transaction request is sent to the node in the blockchain, so that the node adds the block data with a trusted timestamp to the blockchain according to the timestamp transaction request.
本申请实施例还提供了一种可信时间戳添加方法,应用于应用于第一节点,所述第一节点为区块链中的任意节点,包括:The embodiment of the present application also provides a method for adding a trusted timestamp, which is applied to a first node, where the first node is any node in the blockchain, including:
接收时间戳交易请求,所述时间戳交易请求携带具有可信时间戳的区块数据;Receive a timestamp transaction request, where the timestamp transaction request carries block data with a trusted timestamp;
当所述第一节点为可生成区块的目标节点时,生成区块,所述区块中包括具有可信时间戳的区块数据;When the first node is a target node that can generate a block, generate a block, and the block includes block data with a trusted timestamp;
向区块链中的第二节点广播所述区块的验证请求,其中,所述第二节点为区块链中除第一节点以外的节点;Broadcast the verification request of the block to a second node in the blockchain, where the second node is a node other than the first node in the blockchain;
接收所述第二节点基于所述验证请求返回的验证结果;receiving a verification result returned by the second node based on the verification request;
基于所述第二节点返回的验证结果,将所述区块加入至所述区块链中。Based on the verification result returned by the second node, the block is added to the blockchain.
本申请实施例还提供了一种可信时间戳添加装置,包括:The embodiment of the present application also provides a trusted timestamp adding device, including:
区块数据获取单元,用于获取区块链上当前最新区块的区块数据;The block data acquisition unit is used to acquire the block data of the current latest block on the blockchain;
时间戳添加单元,用于获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据;a timestamp adding unit, configured to obtain a trusted time, and add a trusted timestamp to the block data according to the trusted time to obtain block data with a trusted timestamp;
请求构建单元,用于根据所述具有可信时间戳的区块数据构建时间戳交易请求;a request construction unit, configured to construct a timestamp transaction request according to the block data with a trusted timestamp;
请求发送单元,用于向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。A request sending unit, configured to send the time stamp transaction request to the node in the blockchain, so that the node adds the block data with a trusted time stamp to all the nodes according to the time stamp transaction request in the blockchain described above.
进一步地,所述请求构建单元,包括:Further, the request building unit includes:
模板获取单元,用于获取预设交易模板,所述预设交易模板中包括交易内容字段;a template obtaining unit, configured to obtain a preset transaction template, where the preset transaction template includes a transaction content field;
填充单元,用于根据所述具有可信时间戳的区块数据对所述交易内容字段进行数据填充;a filling unit, configured to perform data filling on the transaction content field according to the block data with a trusted timestamp;
时间戳交易构建单元,用于根据填充后的预设交易模板构建一笔时间戳交易;The timestamp transaction construction unit is used to construct a timestamp transaction according to the filled preset transaction template;
请求生成单元,用于根据所述时间戳交易生成时间戳交易请求。A request generating unit, configured to generate a timestamp transaction request according to the timestamp transaction.
进一步地,所述可信时间戳添加装置,还包括:Further, the device for adding trusted time stamps further includes:
时间获取单元,用于获取区块链中上一次记录的最新区块的第一生成时间、以及当前最新区块的第二生成时间;a time obtaining unit, used to obtain the first generation time of the latest block recorded last time in the blockchain and the second generation time of the current latest block;
时间记录单元,用于若所述第二生成时间与所述第一生成时间之差达到预设时间间隔,则记录所述第二生成时间,并触发区块数据获取单元,以用于获取区块链上当前最新区块的区块数据。A time recording unit for recording the second generation time if the difference between the second generation time and the first generation time reaches a preset time interval, and triggers the block data acquisition unit for acquiring the area The block data of the current latest block on the blockchain.
进一步地,所述时间戳交易请求包括时间戳交易,所述时间戳交易是根据所述具有可信时间戳的区块数据构建的,所述可信时间戳添加装置,还包括:Further, the time stamp transaction request includes a time stamp transaction, and the time stamp transaction is constructed according to the block data with a trusted time stamp, and the trusted time stamp adding device further includes:
目标区块获取单元,用于获取在预设时间间隔内所生成的区块,作为目标区块;a target block obtaining unit, used for obtaining the blocks generated within the preset time interval as target blocks;
区块检测单元,用于检测所述目标区块中是否包括除所述时间戳交易之外的交易;若所述目标区块中包括除所述时间戳交易之外的交易,则触发区块数据获取单元,以用于获取区块链上当前最新区块的区块数据。A block detection unit, configured to detect whether the target block includes transactions other than the timestamp transaction; if the target block includes transactions other than the timestamp transaction, trigger the block The data acquisition unit is used to acquire the block data of the current latest block on the blockchain.
进一步地,所述可信时间戳添加装置,还包括:Further, the device for adding trusted time stamps further includes:
高度获取单元,用于获取区块链中上一次记录的区块高度、以及当前区块高度;The height obtaining unit is used to obtain the last recorded block height and the current block height in the blockchain;
高度记录单元,用于当所述当前区块高度与所述上一次记录的区块高度之差达到预设高度差,则记录所述当前区块高度,并触发区块数据获取单元,以用于获取区块链上当前最新区块的区块数据。The height recording unit is used to record the current block height when the difference between the current block height and the previously recorded block height reaches a preset height difference, and trigger the block data acquisition unit to use It is used to obtain the block data of the current latest block on the blockchain.
本申请实施例还提供了一种可信时间戳添加装置,应用于第一节点,所述第一节点为区块链中的任意节点,包括:The embodiment of the present application also provides a trusted timestamp adding device, which is applied to a first node, where the first node is any node in the blockchain, including:
请求接收单元,用于接收时间戳交易请求,所述时间戳交易请求携带具有可信时间戳的区块数据;a request receiving unit, configured to receive a timestamp transaction request, where the timestamp transaction request carries block data with a trusted timestamp;
区块生成单元,用于当所述第一节点为可生成区块的目标节点时,生成区块,所述区块中包括具有可信时间戳的区块数据;a block generating unit, configured to generate a block when the first node is a target node that can generate a block, and the block includes block data with a trusted timestamp;
广播单元,用于向区块链中的第二节点广播所述区块的验证请求,其中,所述第二节点为区块链中除第一节点以外的节点;a broadcasting unit, configured to broadcast the verification request of the block to a second node in the blockchain, where the second node is a node other than the first node in the blockchain;
验证结果接收单元,用于接收所述第二节点基于所述验证请求返回的验证结果;a verification result receiving unit, configured to receive the verification result returned by the second node based on the verification request;
区块添加单元,用于基于所述第二节点返回的验证结果,将所述区块添加至所述区块链中。A block adding unit, configured to add the block to the blockchain based on the verification result returned by the second node.
进一步地,所述可信时间戳添加装置,还包括:Further, the device for adding trusted time stamps further includes:
指令生成单元,用于当所述第一节点不为可生成区块的目标节点时,根据所述时间戳交易请求生成发送指令;an instruction generation unit, configured to generate a sending instruction according to the timestamp transaction request when the first node is not a target node that can generate a block;
指令发送单元,用于将所述发送指令发送至目标节点,所述发送指令用于指示:所述目标节点生成区块,并基于共识机制将所述区块添加至所述区块链中。an instruction sending unit, configured to send the sending instruction to a target node, where the sending instruction is used to instruct: the target node to generate a block and add the block to the blockchain based on a consensus mechanism.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,实现上述任一种可信时间戳添加方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the foregoing methods for adding a trusted timestamp is implemented.
本申请实施例通过获取区块链上当前最新区块的区块数据;获取可信时间,并根据可信时间为区块数据添加可信时间戳,得到具有可信时间戳的区块数据,根据具有可信时间戳的区块数据构建时间戳交易请求,并将时间戳交易请求发送至区块链中的节点以使得所述节点根据时间戳交易请求将所述具有可信时间戳的区块数据添加至区块链中。如此,异步地为区块链的当前最新区块添加可信时间戳,并将可信时间戳加入至区块链中,来为区块链赋予可信时间,并不需要区块链本身获取可信时间戳,即本申请中的方案对区块链无侵入,无需对区块链的共识节点进行改造。本申请实施例通过异步地为区块链的当前最新区块添加可信时间戳,提高了区块链的性能,方便对区块链进行管理,无需区块链中的共识节点在生成区块时去获取可信时间戳,提高了区块链的灵活性;另外,本申请实施例中的添加可信时间戳的方案可以为任何一条区块链赋予可信时间,适用性广。The embodiment of the present application obtains the block data of the current latest block on the blockchain; obtains the trusted time, and adds a trusted timestamp to the block data according to the trusted time, so as to obtain block data with a trusted timestamp, Construct a timestamp transaction request according to the block data with a trusted timestamp, and send the timestamp transaction request to a node in the blockchain, so that the node will send the block with a trusted timestamp according to the timestamp transaction request. Block data is added to the blockchain. In this way, a trusted timestamp is asynchronously added to the current latest block of the blockchain, and the trusted timestamp is added to the blockchain to give the blockchain a trusted time, without the need for the blockchain itself to acquire Trusted timestamp, that is, the solution in this application does not intrude on the blockchain, and does not need to modify the consensus node of the blockchain. The embodiment of the present application improves the performance of the blockchain by asynchronously adding a trusted timestamp to the latest block of the blockchain, facilitates the management of the blockchain, and does not require consensus nodes in the blockchain to generate blocks The trusted timestamp is obtained from time to time, which improves the flexibility of the blockchain; in addition, the solution for adding a trusted timestamp in the embodiment of the present application can assign a trusted timestamp to any blockchain, and has wide applicability.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1a是本申请实施例提供的为区块链添加可信时间戳的系统示意图;FIG. 1a is a schematic diagram of a system for adding a trusted timestamp to a blockchain provided by an embodiment of the present application;
图1b是本申请实施例提供的可信时间戳添加方法流程示意图;1b is a schematic flowchart of a method for adding a trusted timestamp provided by an embodiment of the present application;
图1c是本申请实施例提供的区块结构示意图;1c is a schematic diagram of a block structure provided by an embodiment of the present application;
图2a是本申请实施例提供的可信时间戳添加方法流程示意图;2a is a schematic flowchart of a method for adding a trusted timestamp provided by an embodiment of the present application;
图2b是本申请实施例提供的添加可信时间戳的示意图;2b is a schematic diagram of adding a trusted timestamp provided by an embodiment of the present application;
图3是本申请实施例提供的可信时间戳添加方法另一流程示意图;3 is another schematic flowchart of a method for adding a trusted timestamp provided by an embodiment of the present application;
图4是本申请实施例提供的可信时间戳添加装置的示意性框图;4 is a schematic block diagram of an apparatus for adding a trusted timestamp provided by an embodiment of the present application;
图5是本申请实施例提供的可信时间戳添加装置的另一示意性框图;Fig. 5 is another schematic block diagram of a trusted timestamp adding device provided by an embodiment of the present application;
图6是本申请实施例提供的可信时间戳添加装置的另一示意性框图;Fig. 6 is another schematic block diagram of a trusted timestamp adding device provided by an embodiment of the present application;
图7是本申请实施例提供的计算机设备的结构示意图。FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
在对本发明实施例进行详细地解释说明之前,先对本发明实施例涉及到的一些名词进行解释说明。Before explaining the embodiments of the present invention in detail, some terms involved in the embodiments of the present invention are explained first.
区块链:区块链技术脱胎于比特币技术,是比特币的底层技术,其是去中心化的分布式账本数据库。区块链本身是一串使用密码学算法相关联产生的数据块(即区块),每一个数据块中包含了多次区块链网络交易有效确认的信息。正是基于此,所以无法通过篡改区块上的数据来进行作弊,能够确保任何区块上的数据均是公开透明的,确保了数据的安全性。Blockchain: Blockchain technology is born out of Bitcoin technology and is the underlying technology of Bitcoin, which is a decentralized distributed ledger database. The blockchain itself is a series of data blocks (that is, blocks) that are associated with cryptographic algorithms, and each data block contains information for valid confirmation of multiple blockchain network transactions. Based on this, it is impossible to cheat by tampering with the data on the block, and it can ensure that the data on any block is open and transparent, ensuring the security of the data.
区块链可以分为公有链、私有链、联盟链。其中,联盟链则介于公有链和私有链之间,由若干组织一起合作维护一条区块链,该区块链的使用必须是有权限的管理,相关信息会得到保护,典型如金融组织。总结来说,区块链是由节点参与的分布式数据库系统,或者,也可称之为一个基于P2P(点对点)网络的分布式公共账本,由于对区块链加入了可信时间戳,因此,区块链的特点是不可更改、不可伪造。Blockchain can be divided into public chain, private chain, alliance chain. Among them, the alliance chain is between the public chain and the private chain. Several organizations cooperate to maintain a blockchain. The use of the blockchain must be managed with permission, and relevant information will be protected, such as financial organizations. To sum up, the blockchain is a distributed database system participated by nodes, or it can also be called a distributed public ledger based on a P2P (peer-to-peer) network. Since a trusted timestamp is added to the blockchain, so , The characteristics of the blockchain are that it cannot be changed or forged.
区块链的节点:参与构建区块链的设备。一个节点可以是参与构建区块链的单台计算机设备,也可以是计算机设备集群如服务器集群等。该节点存储有相关区块数据,比如,该区块数据可以包括交易等数据。其中,所述节点中包括共识节点,共识节点指的是可以生成区块的节点(具有生成区块的能力)、可以基于共识机制对在一定的时间内发生的事务进行共识的节点,如对新生成的区块进行共识,以达成共识。同时需要说明的是,区块链网络中同一时刻只有一个共识节点可以生成区块。Nodes of the blockchain: The devices that participate in building the blockchain. A node can be a single computer device participating in the construction of the blockchain, or a cluster of computer devices such as a server cluster. The node stores relevant block data, for example, the block data may include data such as transactions. Among them, the nodes include consensus nodes, and consensus nodes refer to nodes that can generate blocks (have the ability to generate blocks), and nodes that can agree on transactions that occur within a certain period of time based on a consensus mechanism, such as Newly generated blocks are subject to consensus to achieve consensus. At the same time, it should be noted that only one consensus node in the blockchain network can generate blocks at the same time.
区块链的多个节点,以及多个节点之间相互连接的关系,构成区块链网络。因此,区块链网络中的节点和区块链的节点意义相同。The multiple nodes of the blockchain and the interconnected relationships between the multiple nodes constitute the blockchain network. Therefore, a node in a blockchain network has the same meaning as a node in the blockchain.
本申请实施例提供一种可信时间戳添加方法、装置、计算机设备和存储介质。Embodiments of the present application provide a method, apparatus, computer device, and storage medium for adding a trusted timestamp.
本申请实施例提供了一种可信时间戳添加系统,包括本申请实施例任一提供的可信时间戳添加装置。该可信时间戳添加装置可以集成在服务器等网络设备中。如该可信时间戳添加系统中包括服务器和区块链网络。其中,服务器和区块链网络之间通过网络连接。网络中包括路由器、网关等网络实体。在每个区块链网络中,包括有区块链的多个节点(也可称为网络节点或者节点设备),每个节点之间对等连接,每个节点中保存有区块链的全量数据。An embodiment of the present application provides a trusted timestamp adding system, including the trusted timestamp adding device provided by any of the embodiments of the present application. The trusted time stamp adding device may be integrated in network equipment such as a server. For example, the trusted timestamp addition system includes a server and a blockchain network. Among them, the server and the blockchain network are connected through a network. The network includes network entities such as routers and gateways. In each blockchain network, there are multiple nodes of the blockchain (also called network nodes or node devices), each node is connected peer-to-peer, and each node stores the full amount of the blockchain data.
在服务器中配置该区块链网络中的某个节点,获取所配置的该节点,服务器通过区块链网络提供的接口与所获取的该节建立连接。如此,以使得服务器与区块链网络建立连接。Configure a node in the blockchain network in the server, obtain the configured node, and the server establishes a connection with the obtained section through the interface provided by the blockchain network. In this way, the server establishes a connection with the blockchain network.
其中,该可信时间戳添加系统的服务器实现:获取区块链上当前最新区块的区块数据;获取可信时间,并根据可信时间为区块数据添加可信时间戳,得到具有可信时间戳的区块数据;根据具有可信时间戳的区块数据构建时间戳交易请求;向区块链中的节点发送时间戳交易请求,以使得节点根据时间戳交易请求将具有可信时间戳的区块数据添加至区块链中。其中,该节点是区块链中的任意一个节点。Among them, the server implementation of the trusted timestamp adding system: obtains the block data of the current latest block on the blockchain; obtains the trusted time, and adds a trusted timestamp to the block data according to the trusted time, and obtains a reliable timestamp. block data with trusted timestamps; construct timestamp transaction requests based on block data with trusted timestamps; send timestamp transaction requests to nodes in the blockchain, so that nodes will have trusted time based on timestamp transaction requests The stamped block data is added to the blockchain. Among them, the node is any node in the blockchain.
该区块链网络中的任意一个节点实现:接收时间戳交易请求,该时间戳交易请求携带具有可信时间戳的区块数据;当该节点为可生成区块的目标节点(目标共识节点)时,生成区块,并基于共识机制将区块添加至区块链中;当该节点不为可生成区块的目标节点时,根据时间戳交易请求生成发送指令;将发送指令发送至目标节点,该发送指令用于指示:所述目标节点生成区块,并基于共识机制将所述区块添加至区块链中。Any node in the blockchain network realizes: receives a timestamp transaction request, and the timestamp transaction request carries block data with a trusted timestamp; when the node is the target node (target consensus node) that can generate blocks When the block is generated, a block is generated and added to the blockchain based on the consensus mechanism; when the node is not the target node that can generate a block, a sending instruction is generated according to the timestamp transaction request; the sending instruction is sent to the target node , the sending instruction is used to instruct: the target node generates a block and adds the block to the blockchain based on a consensus mechanism.
具有可信时间戳的区块数据,可以包括可信时间戳和区块数据,也可以仅包括可信时间戳。Block data with trusted timestamps can include trusted timestamps and block data, or only trusted timestamps.
需要注意的是,该可信时间戳添加系统的服务器可以是一个服务器,也可以是多个服务器,如服务器集群。It should be noted that the server of the trusted timestamp adding system may be one server or multiple servers, such as a server cluster.
例如,参考图1a,可信时间戳添加系统,包括中间服务器、时间戳服务器和区块链网络。即该可信时间戳添加系统中的服务器包括两个:中间服务器和时间戳服务器。中间服务器和时间戳服务器相互连接,如通过接口连接。其中,区块链网络中包括多个共识节点,多个共识节点之间是对等的,比如包括n个共识节点。每个共识节点中保存该区块链的全量数据。在一实施例中,该可信时间戳添加系统还包括国家授时中心。For example, referring to Figure 1a, a trusted time stamping system includes an intermediate server, a time stamping server, and a blockchain network. That is, the servers in the trusted timestamp adding system include two: an intermediate server and a timestamp server. The intermediate server and the timestamp server are connected to each other, eg via an interface. Among them, the blockchain network includes multiple consensus nodes, and the multiple consensus nodes are equal, such as including n consensus nodes. The full data of the blockchain is stored in each consensus node. In one embodiment, the trusted time stamp adding system further includes a national time service center.
在中间服务器中配置该区块链网络中的某个共识节点,获取所配置的该共识节点,中间服务器通过区块链网络提供的接口与所获取的该共识节点建立连接。A certain consensus node in the blockchain network is configured in the intermediate server, the configured consensus node is obtained, and the intermediate server establishes a connection with the obtained consensus node through the interface provided by the blockchain network.
需要注意的是,中间服务器中所配置的该共识节点可以是区块链网络中的任意一个共识节点,也可以是某个指定的共识节点,比如根据预设规则指定的某个共识节点,例如,指定离中间服务器网络距离最近的一个共识节点,在中间服务器中配置该网络距离最近的该共识节点。It should be noted that the consensus node configured in the intermediate server can be any consensus node in the blockchain network, or a specified consensus node, such as a consensus node specified according to preset rules, such as , specify a consensus node that is closest to the network of the intermediate server, and configure the consensus node that is closest to the network in the intermediate server.
中间服务器与区块链网络建立连接后,中间服务器获取区块链的当前最新区块的区块数据;将该区块数据发送至时间戳服务器。时间戳服务器接收到该区块数据后,为该区块数据添加可信时间戳。具体地,时间戳服务器到国家授时中心去获取可信时间,并将所获取的可信时间和区块数据等一起进行签名,以得到具有可信时间戳的区块数据,并将该具有可信时间戳的区块数据返回至中间服务器。中间服务器接收时间戳服务器返回的具有可信时间戳的区块数据,并根据该具有可信时间戳的区块数据构建时间戳交易请求,并将时间戳交易请求发送至区块链网络中的一个共识节点,该共识节点是预先配置的共识节点,该共识节点可以是区块链网络中的任何一个共识节点。After the intermediate server establishes a connection with the blockchain network, the intermediate server obtains the block data of the current latest block of the blockchain, and sends the block data to the timestamp server. After the timestamp server receives the block data, it adds a trusted timestamp to the block data. Specifically, the time stamp server goes to the national time service center to obtain the trusted time, and signs the obtained trusted time and block data together to obtain block data with a trusted time stamp, and signs the obtained trusted time with the block data, etc. The time stamped block data is returned to the intermediate server. The intermediate server receives the block data with a trusted timestamp returned by the timestamp server, constructs a timestamp transaction request based on the block data with a trusted timestamp, and sends the timestamp transaction request to the blockchain network. A consensus node, which is a pre-configured consensus node, which can be any consensus node in the blockchain network.
区块链网络的该共识节点实现的内容与上文中区块链网络中的节点一致,在此不再赘述。The content implemented by the consensus node of the blockchain network is consistent with the nodes in the blockchain network above, and will not be repeated here.
图1b是本申请实施例提供的可信时间戳添加方法流程示意图,该方法应用于服务器中,该可信时间戳添加方法的具体流程可以如下:1b is a schematic flowchart of a method for adding a trusted timestamp provided by an embodiment of the present application. The method is applied to a server. The specific process of the method for adding a trusted timestamp may be as follows:
101,获取区块链上当前最新区块的区块数据。101. Obtain block data of the current latest block on the blockchain.
其中,区块链中的每个区块包括区块头和区块体,如图1c所示。区块体中包括至少一个交易,一般情况下,区块体中包括多个交易,交易中包括有存证数据等。如图1c所述,包括8个交易。区块头中包括上一个区块的哈希值、版本、时间戳(用于保存该区块生成时本地的时间)、难度、随机数、Merkel跟、区块高度等信息。需要说明的是,图1c中也只是例举出了其中一部分信息而已,区块头中还包括有其他的信息,如区块头中还包括交易数量等。需要注意的是,获取区块链上当前最新区块的区块数据,该区块数据可以是当前最新区块的区块头和区块体的数据,也可以是当前最新区块的区块头的数据,还可以是当前最新区块的区块哈希值等,还可以该处例举的数据的其他组合。需要注意的是,当前最新区块的区块数据可以唯一表示一个区块。其中,区块哈希值指的是对区块头中的信息进行哈希运算后所得到的哈希值,该哈希值可唯一表示一个区块。当前最新区块指的是区块链上最近生成的一个区块。一个区块生成后,就可计算出该区块的哈希值。Among them, each block in the blockchain includes a block header and a block body, as shown in Figure 1c. The block body includes at least one transaction. In general, the block body includes multiple transactions, and the transaction includes certificate data and so on. As shown in Figure 1c, 8 transactions are included. The block header includes the hash value, version, timestamp of the previous block (used to save the local time when the block was generated), difficulty, random number, Merkel follow, block height and other information. It should be noted that Figure 1c only exemplifies part of the information, and the block header also includes other information, such as the number of transactions in the block header. It should be noted that to obtain the block data of the latest block on the blockchain, the block data can be the data of the block header and block body of the latest block, or the block header of the latest block. The data can also be the block hash value of the current latest block, etc., or other combinations of the data exemplified here. It should be noted that the block data of the current latest block can uniquely represent a block. The block hash value refers to a hash value obtained by performing a hash operation on the information in the block header, and the hash value can uniquely represent a block. The current latest block refers to the most recently generated block on the blockchain. After a block is generated, the hash value of the block can be calculated.
具体地,例如,服务器向区块链的某个节点发送获取请求,该获取请求用于请求获取区块链当前最新区块的区块数据,如区块哈希值;区块链的该节点接收到获取请求后,将计算出的当前最新区块的区块数据返回给服务器。或者,也可以设置一些条件来触发服务器发送获取请求,比如,设置到达某个时间段后,触发服务器发送获取请求。Specifically, for example, the server sends an acquisition request to a certain node of the blockchain, and the acquisition request is used to request to acquire the block data of the current latest block of the blockchain, such as the block hash value; the node of the blockchain After receiving the acquisition request, the calculated block data of the current latest block is returned to the server. Alternatively, some conditions can also be set to trigger the server to send the acquisition request, for example, after a certain time period is set, the server is triggered to send the acquisition request.
在一实施例中,若服务器包括多个服务器,如中间服务器和时间戳服务器,其中,中间服务器和时间戳服务器通过相互连接。步骤101,包括:从中间服务器获取区块链上当前最新区块的区块数据。可以理解地,中间服务器获取区块链上当前最新区块的区块数据,时间戳服务器从中间服务器获取区块链上当前最新区块的区块数据。In one embodiment, if the server includes a plurality of servers, such as an intermediate server and a timestamp server, wherein the intermediate server and the timestamp server are connected to each other. Step 101 includes: obtaining block data of the latest current block on the blockchain from an intermediate server. Understandably, the intermediate server obtains the block data of the current latest block on the blockchain, and the timestamp server obtains the block data of the current latest block on the blockchain from the intermediate server.
102,获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据。102. Obtain a trusted time, and add a trusted timestamp to the block data according to the trusted time, to obtain block data with a trusted timestamp.
服务器获取当前最新区块的区块数据后,向国家授时中心获取可信时间,服务器接收到国家授时中心返回的可信时间后,根据可信时间为区块数据添加可信时间戳。服务器将所获取的区块数据、可信时间等,用服务器中保存的私钥进行签名,最后得到具有可信时间戳的区块数据。可以理解地,服务器具有时间戳服务器的功能。而时间戳服务器符合“RFC3161标准”,经过公安部、国密局检验检测,安全可靠;时间戳服务器的私钥存在于时间戳服务器密码卡中无法导出,无法被任何人获取;因此时间戳服务器可以提供可信的时间证明。After the server obtains the block data of the current latest block, it obtains the trusted time from the National Time Service Center. After the server receives the trusted time returned by the National Time Service Center, the server adds a trusted time stamp to the block data according to the trusted time. The server signs the acquired block data, trusted time, etc. with the private key stored in the server, and finally obtains block data with a trusted timestamp. Understandably, the server functions as a timestamp server. The time stamp server conforms to the "RFC3161 standard", and has been inspected by the Ministry of Public Security and the State Secret Service, and is safe and reliable; the private key of the time stamp server exists in the time stamp server password card and cannot be exported and cannot be obtained by anyone; therefore, the time stamp server Credible proof of time can be provided.
由于获取的是当前最新区块的区块数据,该区块数据可以唯一的表示当前区块,因此,为该区块数据添加可信时间戳后,即为所获取的区块链的当前最新区块以及所获取的区块链的当前最新区块之前的区块添加可信时间戳,以证明,所获取的区块链中的当前最新区块以及所获取的区块链的当前最新区块之前的区块中的所有交易,在该可信时间戳所对应的可信时间之前已经存在。Since the block data of the current latest block is obtained, the block data can uniquely represent the current block. Therefore, after adding a trusted timestamp to the block data, it is the current latest block chain obtained. Add a trusted timestamp to the block and the block before the current latest block of the acquired blockchain to prove that the current latest block in the acquired blockchain and the current latest block of the acquired blockchain All transactions in blocks prior to the block that existed before the trusted time corresponding to this trusted timestamp.
103,根据所述具有可信时间戳的区块数据构建时间戳交易请求。103. Construct a timestamp transaction request according to the block data with the trusted timestamp.
根据具有可信时间戳的区块数据生成一个时间戳交易请求,该时间戳交易请求中包括具有可信时间戳的区块数据。A timestamp transaction request is generated according to the block data with a trusted timestamp, and the timestamp transaction request includes the block data with a trusted timestamp.
在一实施例中,步骤103,包括:根据所述具有可信时间戳的区块数据构建时间戳交易,根据时间戳交易生成时间戳交易请求。其中,时间戳交易,指的是交易中包括具有可信时间戳的区块数据。本质上,时间戳交易也是一个交易,只是该交易中包括具有可信时间戳的区块数据。In one embodiment, step 103 includes: constructing a timestamp transaction according to the block data with a trusted timestamp, and generating a timestamp transaction request according to the timestamp transaction. Among them, the timestamp transaction refers to that the transaction includes block data with a trusted timestamp. Essentially, a timestamp transaction is also a transaction, except that the transaction includes block data with a trusted timestamp.
具体地,根据所述具有可信时间戳的区块数据构建时间戳交易的步骤,包括:Specifically, the steps of constructing timestamp transactions according to the block data with trusted timestamps include:
(1)获取预设交易模板,该预设交易模板中包括交易内容。(1) Obtain a preset transaction template, where the preset transaction template includes transaction content.
其中,预设交易模板可以是由运维人员预先进行设置的交易模板,也可以是其他设备预先建立之后提供给服务器的交易模板,或者,还可以由服务器自行生成的交易模板,等等。该预设交易模板可以在构建交易时,由服务器临时生成或者临时获取;也可以是预先设置或者预先生成或者预先获取,保存在服务器中,在构建交易时,获取该保存的预设交易模板。The preset transaction template may be a transaction template pre-set by the operation and maintenance personnel, or a transaction template provided to the server after being pre-established by other devices, or a transaction template generated by the server itself, and so on. The preset transaction template may be temporarily generated or acquired by the server when the transaction is constructed; it may also be pre-set or pre-generated or pre-acquired and stored in the server, and the saved preset transaction template is acquired when the transaction is constructed.
预设交易模板也可以理解为预设交易格式或者预设交易的数据结构等,预设交易模板中的字段也可以理解为参数,每个参数包括参数名称、参数类型、参数值等信息。需要提醒的是,预设交易模板中的某些字段还可以包括下一级字段。比如,某些字段在定义数据结构时,就定义为该字段包括多个下一级的字段,下一级字段中还包括有下下一级的字段等。如某些字段以数组的方式存储,数组中的多个数据对应该字段的下一级字段。A preset transaction template can also be understood as a preset transaction format or a preset transaction data structure, etc. The fields in the preset transaction template can also be understood as parameters, and each parameter includes parameter name, parameter type, parameter value and other information. It should be reminded that some fields in the preset transaction template may also include next-level fields. For example, when defining a data structure for some fields, it is defined that the field includes multiple fields of the next level, and the fields of the next level also include fields of the next level. If some fields are stored in an array, multiple data in the array correspond to the next-level fields of the field.
预设交易模板中的字段包括交易版本号、附加数据(类型为json)、输入数组、输出数组、锁定时间(默认值为0)、base58|hex返回格式等字段。其中,比如,base58|hex返回格式字段,类型为string,默认为该base58|hex返回格式字段不填,若不填的情况下,则该base58|hex返回格式字段值=base58,此字段不参与签名。The fields in the preset transaction template include transaction version number, additional data (type is json), input array, output array, lock time (default value is 0), base58|hex return format and other fields. Among them, for example, the base58|hex return format field, the type is string, the default is that the base58|hex return format field is not filled, if not filled, the base58|hex return format field value = base58, this field does not participate sign.
其中,每个交易的输入数组字段中包括一个或者多个输入,比如,对于时间戳交易,输入数组字段中有一个输入。每个输入中包括输入序号、引用来源output信息、解锁脚本等字段。比如,输入序号字段,类型为uint32,值为从0开始的某一个正整数,如0,该输入序号只保证唯一性,无需保证连续性。比如,应用来源output信息字段,类型为json,该应用来源output信息指的是引用交易的信息,即上一个交易的输出信息。该字段中还包括下一级的两个字段:hash和index,其中,hash指的是引用交易的hash值,index指的是引用交易的索引。需要注意的是,时间戳交易因为没有引用交易,所以hash和index为固定值,以作特殊处理;而非时间戳交易,即时间戳交易之外的交易,比如存证交易等需引用实际信息。比如,解锁脚本字段,类型可以为string或者base58,该字段的值为利用base58函数计算后得到的值,如base58(脚本类型+脚本版本+签名)计算后得到的值。Among them, the input array field of each transaction includes one or more inputs, eg, for timestamp transactions, there is an input in the input array field. Each input includes fields such as input serial number, reference source output information, and unlock script. For example, the input sequence number field, the type is uint32, and the value is a positive integer starting from 0, such as 0, the input sequence number only guarantees uniqueness, and does not need to guarantee continuity. For example, the application source output information field, the type is json, the application source output information refers to the information of the reference transaction, that is, the output information of the previous transaction. This field also includes two fields at the next level: hash and index, where hash refers to the hash value of the referenced transaction, and index refers to the index of the referenced transaction. It should be noted that since timestamp transactions do not refer to transactions, hash and index are fixed values for special processing; non-timestamp transactions, that is, transactions other than timestamp transactions, such as deposit transactions, need to refer to actual information . For example, to unlock the script field, the type can be string or base58, and the value of this field is calculated by using the base58 function, such as the value calculated by base58 (script type + script version + signature).
其中,每个交易的输出数组字段中包括一个或者多个输出,比如,对于时间戳交易,输出数组字段中有一个输出。每个输出中包括输出序号、到账地址、资产ID、金额数量、交易内容、锁定脚本等字段。比如,输出序号字段,类型为uint32,值为从0开始的某一个正整数,如0,该输出序号字段只需保证唯一性,无需保证连续性。比如,到账地址字段,类型为string或者base58,值为1KzBWDAcf66fyZ1qGb2r6YZp3CfuRgfdDr。比如,金额数量字段,类型为uint64,值为100。比如,交易内容字段,类型为string或者base58,对于时间戳交易来说,交易内容字段的值为序列化后的具有可信时间戳的区块数据和数据类型等信息。Among them, the output array field of each transaction includes one or more outputs, for example, for timestamp transactions, there is one output in the output array field. Each output includes fields such as output serial number, account address, asset ID, amount, transaction content, and lock script. For example, the output sequence number field is of type uint32, and the value is a positive integer starting from 0, such as 0. The output sequence number field only needs to ensure uniqueness, not continuity. For example, the arrival address field, the type is string or base58, and the value is 1KzBWDAcf66fyZ1qGb2r6YZp3CfuRgfdDr. For example, the amount field, the type is uint64, the value is 100. For example, the transaction content field is of type string or base58. For timestamp transactions, the value of the transaction content field is the serialized block data and data type with a trusted timestamp.
(2)根据具有可信时间戳的区块数据对预设交易模板中的交易内容字段进行数据填充。(2) Filling the transaction content field in the preset transaction template with data according to the block data with a trusted timestamp.
交易内容字段即为输出数组中的一个输出中包括的一个字段信息。在交易内容字段中可以填充任意的数据,其中,填充可以理解为为字段赋值。在时间戳交易中,交易内容字段填充的数据包括:填充数据的类型以及填充数据的具体内容等。比如填充数据的类型为可信时间戳,填充数据的具体内容即为具有可信时间戳的区块数据。将填充数据的类型和填充数据的具体内容进行序列化,以得到序列化的值。如若序列化后的可信时间戳的数据类型的值用5表示,可信时间戳的数据类型的值也可以用其他的数字或者字母或者符号来表示,具有可信时间戳的区块数据的值为djREFASDGJs483K。那么交易内容字段进行数据填充并序列化后,为:5djREFASDGJs483K。需要提醒的是,该处的时间戳的数据类型的值以及具有可信时间戳的区块数据的值并不是真实的值,只是为了进行示例说明而已,并不构成对具有可信时间戳的区块数据的值以及可信时间戳的数据类型的值的限制。The transaction content field is a field information included in an output in the output array. Arbitrary data can be filled in the transaction content field, where filling can be understood as assigning a value to the field. In the timestamp transaction, the data filled in the transaction content field includes: the type of the filled data and the specific content of the filled data. For example, the type of the filling data is a trusted timestamp, and the specific content of the filling data is the block data with a trusted timestamp. Serialize the type of the padding data and the specific content of the padding data to get the serialized value. If the value of the data type of the serialized trusted timestamp is represented by 5, the value of the data type of the trusted timestamp can also be represented by other numbers, letters or symbols. The value is djREFASDGJs483K. Then, after the transaction content field is filled with data and serialized, it is: 5djREFASDGJs483K. It should be reminded that the value of the data type of the timestamp here and the value of the block data with a trusted timestamp are not real values. Restrictions on the value of the block data and the value of the trusted timestamp data type.
(3)根据填充后的预设交易模板构建一笔时间戳交易。(3) Construct a timestamp transaction according to the filled preset transaction template.
填充后的预设交易模板中,已经为交易内容的字段赋值。In the filled preset transaction template, the fields of the transaction content have been assigned values.
需要注意的是,引用源output信息,指的是引用交易的信息,即上一个交易的输出信息。由于时间戳交易不存在上一个交易,即时间戳交易并没有引用上一个交易的输出信息,因此,时间戳交易并没有实际引用源output信息,如此将引用源output信息中的hash和index都设置为固定值。其中,hash="000000000000.....000"(64个零),index="-1"。另外,时间戳交易的输出数组中的到帐地址、金额数量等字段的值也都设置为固定值。It should be noted that the reference source output information refers to the information of the reference transaction, that is, the output information of the previous transaction. Since the timestamp transaction does not have a previous transaction, that is, the timestamp transaction does not refer to the output information of the previous transaction, therefore, the timestamp transaction does not actually refer to the source output information, so the hash and index in the reference source output information are set. is a fixed value. Among them, hash="000000000000.....000" (64 zeros), index="-1". In addition, the values of the arrival address, amount and other fields in the output array of the timestamp transaction are also set to fixed values.
根据填充后的预设交易模板构建一笔交易,包括以下三种情况:Build a transaction based on the filled preset transaction template, including the following three situations:
一,在获取的预设交易模板中,除了交易内容的字段,其他一些字段,比如引用源output信息中的hash和index值、输出数组中的到帐地址、金额数量等字段,都已经进行了设置(即数据填充),比如设置为固定值或者临时计算出的值。可以理解地,在获取的预设交易模板中除了交易内容字段之外,其他的字段已经都有了对应的值。那么再对交易内容进行数据填充后,填充后的预设交易模板中的所有字段都已经有了对应的值,如此,所有字段都进行数据填充后的预设交易模板即构成一笔交易。将构建出的交易,作为时间戳交易。1. In the obtained preset transaction template, in addition to the fields of transaction content, other fields, such as the hash and index values in the reference source output information, the account address in the output array, the amount of money and other fields have been processed. Setting (ie data filling), such as setting to a fixed value or a temporarily calculated value. It is understandable that, in the acquired preset transaction template, except for the transaction content field, other fields already have corresponding values. Then, after the transaction content is filled with data, all fields in the filled preset transaction template already have corresponding values. In this way, the preset transaction template with all fields filled with data constitutes a transaction. The constructed transaction will be used as a timestamp transaction.
二,在获取的预设交易模板中,所有字段都未进行数据填充,可以理解为,所有字段的值都为空。在对交易内容字段进行数据填充后,此时填充后的预设交易模板中只有交易内容字段进行了数据填充。如此,步骤“根据填充后的预设交易模板构建一笔时间戳交易”,还包括:对除了交易内容字段之外的其他字段进行数据填充,将所有字段都进行数据填充后的预设交易模板作为一笔交易。将构建出的交易,作为时间戳交易。Second, in the acquired preset transaction template, all fields are not filled with data, which can be understood as the values of all fields are empty. After the transaction content field is filled with data, only the transaction content field in the filled preset transaction template is filled with data. In this way, the step of "constructing a timestamp transaction according to the filled preset transaction template" also includes: filling other fields except the transaction content field with data, and filling all fields with data in the preset transaction template. as a transaction. The constructed transaction will be used as a timestamp transaction.
三,在获取的预设交易模板中,有一部分字段进行了数据填充,可以理解为,有一部分字段的值为空,有一部分字段的值不为空。在对交易内容字段进行数据填充后,还存在有一部分的字段的值未进行数据填充。则步骤“根据填充后的预设交易模板构建一笔交易”,还包括:对未进行数据填充的字段进行数据填充,将所有字段都进行数据填充后的预设交易模板作为一笔交易。将构建出的交易,作为时间戳交易。Third, in the acquired preset transaction template, some fields are filled with data, which can be understood as the value of some fields is empty, and the value of some fields is not empty. After the transaction content fields are filled with data, there are still some fields whose values are not filled with data. The step of "constructing a transaction according to the pre-filled preset transaction template" further includes: filling the fields without data filling with data, and using the preset transaction template after all fields have been filled with data as a transaction. The constructed transaction will be used as a timestamp transaction.
可以理解地,步骤103,包括:获取预设交易模板,该预设交易模板中包括交易内容;根据具有可信时间戳的区块数据对预设交易模板中的交易内容字段进行数据填充;根据填充后的预设交易模板构建一笔时间戳交易;根据时间戳交易生成时间戳交易请求。Understandably, step 103 includes: acquiring a preset transaction template, where the preset transaction template includes transaction content; filling the transaction content field in the preset transaction template with data according to block data with a trusted timestamp; The filled preset transaction template builds a timestamp transaction; generates a timestamp transaction request according to the timestamp transaction.
如此,时间戳交易请求中包括时间戳交易,该时间戳交易中包括具有可信时间戳的区块数据。In this way, the timestamp transaction request includes a timestamp transaction, and the timestamp transaction includes block data with a trusted timestamp.
该实施例进一步限定了如何根据具有可信时间戳的区块数据构建时间戳交易请求。首先,获取预设交易模板,该预设交易模板中包括一个特殊字段:交易内容字段。该交易内容字段中可以填充任意内容,因此,根据具有可信时间戳的区块数据填充预设交易模板中的交易内容字段。再根据填充了交易内容字段的预设交易模板构建时间戳交易,最后,根据时间戳交易生成时间戳交易请求。由于将具有可信时间戳的区块数据填充到预设交易模板的交易内容字段中,因此,构建的时间戳交易对于区块链的节点来说,并没有特别之处,只当做是一个普通交易,区块链的节点将该时间戳交易当做普通交易进行处理。This embodiment further defines how to construct timestamp transaction requests from block data with trusted timestamps. First, a preset transaction template is obtained, and the preset transaction template includes a special field: the transaction content field. Any content can be filled in the transaction content field. Therefore, the transaction content field in the preset transaction template is filled according to the block data with a trusted timestamp. Then, a timestamp transaction is constructed according to the preset transaction template filled with the transaction content field, and finally, a timestamp transaction request is generated according to the timestamp transaction. Since the block data with trusted timestamp is filled into the transaction content field of the preset transaction template, the constructed timestamp transaction has nothing special to the nodes of the blockchain, and is only regarded as a common transaction, the nodes of the blockchain process the timestamp transaction as a normal transaction.
在一实施例中,若服务器包括多个服务器,如中间服务器和时间戳服务器,步骤103,包括:通过中间服务器根据所述具有可信时间戳的区块数据构建时间戳交易请求。可以理解地,将具有可信时间戳的区块数据发送至中间服务器,以使得中间服务器构建时间戳交易请求。具体地,以上步骤(1)、(2)、(3)以及根据时间戳交易生成时间戳交易请求的步骤是在中间服务器上完成的。In an embodiment, if the server includes multiple servers, such as an intermediate server and a timestamp server, step 103 includes: constructing a timestamp transaction request according to the block data with a trusted timestamp through the intermediate server. Understandably, the block data with a trusted timestamp is sent to the intermediate server, so that the intermediate server constructs the timestamp transaction request. Specifically, the above steps (1), (2), (3) and the step of generating a timestamp transaction request according to the timestamp transaction are completed on the intermediate server.
104,向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。104. Send the timestamp transaction request to the node in the blockchain, so that the node adds the block data with a trusted timestamp to the blockchain according to the timestamp transaction request middle.
服务器可以将时间戳交易请求发送至区块链中的任何一个共识节点,也可以发送到指定的共识节点。其中,需要预先在服务器中配置时间戳交易请求发送的共识节点。其中,区块链中的共识节点接收到时间戳交易请求后,将时间戳交易请求中携带的具有可信时间戳的区块数据添加至区块链中。The server can send timestamp transaction requests to any consensus node in the blockchain, or to a designated consensus node. Among them, the consensus node for sending the timestamp transaction request needs to be configured in the server in advance. Wherein, after receiving the timestamp transaction request, the consensus node in the blockchain adds the block data with a trusted timestamp carried in the timestamp transaction request to the blockchain.
本申请实施例中通过获取区块链上当前最新区块的区块数据;获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据;根据所述具有可信时间戳的区块数据构建时间戳交易请求;向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。如此,通过服务器异步地为区块链当前最新区块的区块数据添加可信时间戳,为区块链赋予可信时间,并不需要区块链本身获取可信时间戳,即本申请实施例中的方案对区块链无侵入,无需对区块链本身进行改造,即可为区块链赋予可信时间。本申请实施例通过异步地为区块链当前最新区块的区块数据添加可信时间戳,提高了区块链的性能,使得区块链本身无需关注可信时间戳的问题,无需区块链中的节点在生成区块时去获取可信时间戳,方便对区块链进行管理,提高了区块链的性能和灵活性。另一方面,将具有可信时间戳的区块数据加入到区块链中后,方便接入到区块链中的节点获取具有可信时间戳的区块数据,方便进行可信时间戳的共享。而且,本申请实施例中的可信时间戳添加的方案可以为任何一条区块链添加可信时间戳,即为任何一条区块链赋予可信时间,适用性广。In the embodiment of the present application, the block data of the current latest block on the blockchain is obtained; the trusted time is obtained, and a trusted timestamp is added to the block data according to the trusted time, so as to obtain a trusted timestamp block data; construct a timestamp transaction request according to the block data with trusted timestamp; send the timestamp transaction request to the node in the blockchain, so that the node can make the timestamp according to the timestamp A transaction request adds the trusted timestamped block data to the blockchain. In this way, the server asynchronously adds a trusted timestamp to the block data of the current latest block of the blockchain, giving the blockchain a trusted time, and does not require the blockchain itself to obtain a trusted timestamp, that is, the implementation of this application. The solution in the example is non-intrusive to the blockchain, and can give the blockchain a credible time without modifying the blockchain itself. The embodiment of the present application improves the performance of the blockchain by asynchronously adding a trusted timestamp to the block data of the latest block of the blockchain, so that the blockchain itself does not need to pay attention to the trusted timestamp, and no block Nodes in the chain obtain trusted timestamps when generating blocks, which facilitates the management of the blockchain and improves the performance and flexibility of the blockchain. On the other hand, after adding block data with trusted timestamps to the blockchain, it is convenient for nodes accessing the blockchain to obtain block data with trusted timestamps, and it is convenient to perform trusted timestamps. shared. Moreover, the solution for adding a trusted timestamp in the embodiment of the present application can add a trusted timestamp to any blockchain, that is, assign a trusted time to any blockchain, and has wide applicability.
图2a是本申请实施例提供的可信时间戳添加方法的另一流程示意图,应用于服务器端,该可信时间戳添加方法的具体流程包括:2a is another schematic flowchart of a method for adding a trusted timestamp provided by an embodiment of the present application, which is applied to a server. The specific process of the method for adding a trusted timestamp includes:
201,获取区块链中上一次记录的最新区块的第一生成时间。201. Obtain the first generation time of the latest block recorded last time in the blockchain.
上一次记录的最新区块的第一生成时间,可以理解为,上一次为区块链添加可信时间戳时所获取的最新区块,该最新区块生成时间。在该最新区块生成时,记录该最新区块的生成时间。获取上一次记录的最新区块的生成时间,作为第一生成时间。The first generation time of the latest block recorded last time can be understood as the latest block obtained when the trusted timestamp was added to the blockchain last time, the generation time of the latest block. When the latest block is generated, the generation time of the latest block is recorded. Obtain the generation time of the latest block recorded last time as the first generation time.
需要注意的是,若第一次为区块链添加可信时间戳,则不存在上一次记录的最新区块的第一生成时间,那么执行步骤202,获取当前最新区块的生成时间,并记录当前最新区块的生成时间,作为第一生成时间,并执行“获取区块链上当前最新区块的区块数据”的步骤,以直接为区块链添加可信时间戳。It should be noted that if a trusted timestamp is added to the blockchain for the first time, there is no first generation time of the latest block recorded last time, then step 202 is executed to obtain the generation time of the current latest block, and Record the generation time of the current latest block as the first generation time, and perform the step of "obtaining the block data of the latest block on the blockchain" to directly add a trusted timestamp to the blockchain.
202,获取当前最新区块的第二生成时间。即获取当前最新区块的生成时间,作为第二生成时间。其中,第一生成时间和第二生成时间都是获取的服务器的时间。202. Obtain the second generation time of the current latest block. That is, the generation time of the current latest block is obtained as the second generation time. Wherein, both the first generation time and the second generation time are obtained from the server.
203,判断所述第二生成时间与所述第一生成时间之差是否达到预设时间间隔。203. Determine whether the difference between the second generation time and the first generation time reaches a preset time interval.
其中,预设时间间隔是预先设定的,比如以秒级为粒度,如5秒等,也可以设置为其他的粒度。判断第二生成时间与第一生成时间之差是否达到预设时间间隔。若达到预设时间间隔,则执行步骤204;若未达到预设时间间隔,执行“获取当前最新区块的第二生成时间”的步骤。The preset time interval is preset, for example, the granularity is in seconds, such as 5 seconds, and can also be set to other granularities. Determine whether the difference between the second generation time and the first generation time reaches a preset time interval. If the preset time interval is reached,
204,记录所述第二生成时间。204. Record the second generation time.
205,获取区块链上最新区块的区块数据。205. Obtain block data of the latest block on the blockchain.
206,获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据。206. Obtain a trusted time, and add a trusted timestamp to the block data according to the trusted time, to obtain block data with a trusted timestamp.
207,根据所述具有可信时间戳的区块数据构建时间戳交易请求。207. Construct a timestamp transaction request according to the block data with the trusted timestamp.
208,向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。208. Send the timestamp transaction request to the node in the blockchain, so that the node adds the block data with a trusted timestamp to the blockchain according to the timestamp transaction request middle.
该实施例中的步骤205-208请参看上述实施例中步骤101-104的描述,在此不再赘述。For steps 205-208 in this embodiment, please refer to the description of steps 101-104 in the above-mentioned embodiment, and details are not repeated here.
该实施例进一步限定了根据预设时间间隔来为区块链当前最新区块的区块数据添加可信时间戳,即每隔预设时间间隔,为区块链当前最新区块的区块数据添加一次可信时间戳,并根据具有可信时间戳的区块数据构建时间戳交易请求,根据该时间戳交易请求将具有可信时间戳的区块数据加入到区块链中。如此,不必实时为区块链当前最新区块的区块数据添加可信时间戳,减少了与服务器的交互,节约添加可信时间戳的成本,同时也减少了存储具有可信时间戳的区块数据的存储开销和存储成本。This embodiment further defines that a trusted timestamp is added to the block data of the current latest block of the blockchain according to a preset time interval, that is, every preset time interval, the block data of the current latest block of the blockchain is added. A trusted timestamp is added once, and a timestamp transaction request is constructed according to the block data with the trusted timestamp, and the block data with the trusted timestamp is added to the blockchain according to the timestamp transaction request. In this way, it is not necessary to add a trusted timestamp to the block data of the current latest block of the blockchain in real time, which reduces the interaction with the server, saves the cost of adding a trusted timestamp, and also reduces the storage area with trusted timestamps. Storage overhead and storage cost of block data.
在一实施例中,若根据所述具有可信时间戳的区块数据构建时间戳交易请求,包括:根据所述具有可信时间戳的区块数据构建时间戳交易,根据所述时间戳交易生成时间戳交易请求,或者也可以理解为,时间戳交易请求中携带时间戳交易,而该时间戳交易是根据所述具有可信时间戳的区块数据构建的,则在记录所述第二生成时间之后,获取区块链上当前最新区块的区块数据之前,所述方法还包括:In one embodiment, if constructing a timestamp transaction request according to the block data with a trusted timestamp, the method includes: constructing a timestamp transaction according to the block data with a trusted timestamp, and constructing a timestamp transaction according to the block data with a trusted timestamp. A timestamp transaction request is generated, or it can also be understood that a timestamp transaction is carried in the timestamp transaction request, and the timestamp transaction is constructed according to the block data with a trusted timestamp. After the generation time, before acquiring the block data of the current latest block on the blockchain, the method further includes:
A,获取在预设时间间隔内所生成的区块,作为目标区块。A. Obtain blocks generated within a preset time interval as target blocks.
在区块链中,若未加入到区块链的交易数量达到预设数量,或者未加入到区块链的交易存在的时间达到预定时间,则会触发生成新区块。因此,在预设时间间隔内,有可能生成了多个区块,也有可能只生成了一个区块。In the blockchain, if the number of transactions that have not been added to the blockchain reaches a preset number, or the transaction that has not been added to the blockchain has existed for a predetermined time, it will trigger the generation of a new block. Therefore, during the preset time interval, it is possible that multiple blocks are generated, or only one block is generated.
区块链中的每个区块生成时,都会在区块头中写入区块生成的时间,如图1c中,区块头中的“时间戳”,保存的即是生成区块时的时间。可以根据生成区块时的时间,来获取区块链在预设时间间隔内所生成的区块,作为目标区块。也可以根据区块的高度来获取区块链在预设时间间隔内所生成的区块,如获取上一次获取时间时区块链的高度,达到预设时间间隔时区块链的高度,以来获取区块链在预设时间间隔内所生成的区块。When each block in the blockchain is generated, the block generation time will be written in the block header. As shown in Figure 1c, the "time stamp" in the block header stores the time when the block was generated. The block generated by the blockchain within a preset time interval can be obtained as the target block according to the time when the block was generated. It is also possible to obtain the blocks generated by the blockchain within a preset time interval according to the height of the block, such as obtaining the height of the blockchain when the last acquisition time was obtained, and the height of the blockchain when the preset time interval was reached. Blocks generated by the blockchain at preset time intervals.
B,检测目标区块中是否包括除时间戳交易之外的交易。B. Check whether the target block includes transactions other than timestamp transactions.
其中,除时间戳交易之外的交易,包括存储有存证数据的交易。存储有存证数据的交易,也可以称为存证交易。如此,可以理解为,本申请实施例中的交易至少包括时间戳交易和存证交易。Among them, transactions other than timestamp transactions include transactions in which evidence data is stored. A transaction that stores data on deposit can also be referred to as a deposit transaction. In this way, it can be understood that the transaction in this embodiment of the present application includes at least a time stamp transaction and a certificate deposit transaction.
检测目标区块的数量,若目标区块有多个,则确定目标区块中包括除时间戳交易之外的交易,即确定目标区块中包括存证交易。可以理解地,在预设时间间隔内只会生成一个时间戳交易,若该时间戳交易存在的时间达到预设时间,而在预设时间间隔内没有生成任何存证交易,在这种情况下,生成的区块中只包括该时间戳交易,不包括存证交易。则在该预设时间间隔内仅生成了一个目标区块,该目标区块中仅包括该时间戳交易。若目标区块有多个,假设其中一个目标区块仅包括时间戳交易,那么其他区块一定包括存证交易,也即目标区块中一定包括除时间戳交易之外的交易。The number of target blocks is detected. If there are multiple target blocks, it is determined that the target block includes transactions other than timestamp transactions, that is, it is determined that the target block includes certificate transactions. Understandably, only one time stamp transaction will be generated within the preset time interval. If the time stamp transaction exists for the preset time, and no deposit transaction is generated within the preset time interval, in this case , only the timestamp transaction is included in the generated block, and the deposit transaction is not included. Then only one target block is generated within the preset time interval, and the target block only includes the timestamp transaction. If there are multiple target blocks, assuming that one of the target blocks only includes timestamp transactions, other blocks must include certificate transactions, that is, the target block must include transactions other than timestamp transactions.
若目标区块有一个,则包括以下两种情况:1、该一个目标区块中包括时间戳交易,也包括存证交易。2、该一个目标区块中仅包括时间戳交易。若目标区块有一个,可获取目标区块的交易数量,通过该交易数量判断该目标区块是否包括除时间戳交易之外的交易。如若一个目标区块仅包括时间戳交易,那么该目标区块的交易数量是固定的,将该固定的交易数量值作为预设数量。获取目标区块的交易数量后,判断该目标区块的交易数量值是否为预设数量,若为预设数量,则确定目标区块中不包括除时间戳交易之外的交易,即确定目标区块中仅包括时间戳交易;若该目标区块的交易数量不为预设数量,则确定目标区块中包括除时间戳交易之外的交易,即目标区块中包括存证交易。需要注意的是,还可以通过其他方式来确定目标区块中是否包括除时间戳交易之外的交易。If there is one target block, it includes the following two situations: 1. The one target block includes timestamp transactions and certificate transactions. 2. Only timestamp transactions are included in the target block. If there is one target block, the number of transactions in the target block can be obtained, and based on the number of transactions, it can be judged whether the target block includes transactions other than timestamp transactions. If a target block only includes timestamp transactions, then the transaction quantity of the target block is fixed, and the fixed transaction quantity value is used as the preset quantity. After obtaining the transaction quantity of the target block, determine whether the transaction quantity value of the target block is the preset quantity. If it is the preset quantity, it is determined that the target block does not include transactions other than timestamp transactions, that is, the target block is determined. Only timestamp transactions are included in the block; if the number of transactions in the target block is not the preset number, it is determined that the target block includes transactions other than timestamp transactions, that is, the target block includes certificate transactions. It should be noted that there are other ways to determine whether transactions other than timestamp transactions are included in the target block.
若目标区块中包括除时间戳交易之外的交易,执行“获取区块链中当前最新区块的区块数据”的步骤。若目标区块中包括除时间戳交易之外的交易,即目标区块中包括存证交易,那么再次为区块链添加可信时间戳,即为目标区块中的存证交易添加可信时间,这是有必要的。若目标区块中不包括除时间戳交易之外的交易,执行“获取区块链中上一次记录的最新区块的第一生成时间”的步骤。If the target block includes transactions other than timestamp transactions, perform the step of "obtaining the block data of the current latest block in the blockchain". If the target block includes transactions other than time stamp transactions, that is, the target block includes certificate transactions, then add a trusted timestamp to the blockchain again, that is, add trusted time stamps to the certificate transactions in the target block. time, it is necessary. If the target block does not include transactions other than timestamp transactions, execute the step of "obtaining the first generation time of the latest block last recorded in the blockchain".
若目标区块中不包括除时间戳交易之外的交易,执行获取区块链中上一次记录的最新区块的第一生成时间的步骤。可以理解地,若目标区块中不包括除时间戳交易之外的交易,则不执行获取区块链上当前最新区块的区块数据步骤,暂停为区块链添加可信时间戳。以避免预设时间间隔内仅生成一个区块,而该区块中仅包括时间戳交易的情况,即避免为仅包括时间戳交易的区块再添加可信时间,或者也可以理解为,避免所生成的连续多个区块仅包括时间戳交易的情况。If the target block does not include transactions other than timestamp transactions, perform the step of obtaining the first generation time of the latest block recorded last time in the blockchain. Understandably, if the target block does not include transactions other than timestamp transactions, the step of obtaining the block data of the current latest block on the blockchain is not performed, and adding trusted timestamps to the blockchain is suspended. To avoid the situation where only one block is generated within a preset time interval, and the block only includes timestamp transactions, that is, to avoid adding trusted time to blocks that only include timestamp transactions, or it can also be understood as avoiding The resulting multiple consecutive blocks only include the case of timestamped transactions.
如图2b所示,为本申请实施例提供的可信时间戳添加的示意图。本申请实施例中,交易包括两种:时间戳交易和存证交易。在图2b中,服务器包括多个:中间服务器和时间戳服务器,中间服务器获取区块链当前最新区块的区块数据,如区块哈希值,中间服务器将所获取的区块数据发送至时间戳服务器,时间戳服务器获取国家授时中心的可信时间,并将区块数据、可信时间一起进行签名,以生成具有可信时间戳的区块数据。中间服务器接收时间戳服务器返回的具有可信时间戳的区块数据,并构建一笔包括该可信时间戳的交易,作为时间戳交易,根据时间戳交易生成时间戳交易请求,将该时间戳交易请求发送至区块链网络中的节点中。区块链网络的节点将时间戳交易请求中包括的时间戳交易加入到区块链中。其中,区块链中第一生成时间和第二生成时间达到预设时间间隔后,接着为区块链的当前最新区块的区块数据添加可信时间戳。在预设时间间隔内,目标区块包括多个,比如图2b中的六个(图2b中的第二个到第七个)。在预设时间间隔内,生成了包括时间戳交易的区块,如背景为白色的区块,在该区块中,除了包括时间戳交易(背景为白色的交易)外,还包括存证交易(背景为深灰色的交易),即在图2b中,时间戳交易和其他存证交易一起生成一个区块,加入到区块链中。需要说明的是,在一些实施例中,时间戳交易可以独立生成一个区块,并加入到区块链中。As shown in FIG. 2b , it is a schematic diagram of adding a trusted timestamp provided by an embodiment of the present application. In the embodiment of the present application, the transaction includes two types: time stamp transaction and certificate deposit transaction. In Figure 2b, the server includes multiple: an intermediate server and a timestamp server. The intermediate server obtains the block data of the current latest block of the blockchain, such as the block hash value, and the intermediate server sends the obtained block data to The timestamp server obtains the trusted time of the National Time Service Center, and signs the block data and the trusted time together to generate block data with a trusted timestamp. The intermediate server receives the block data with a trusted timestamp returned by the timestamp server, and constructs a transaction including the trusted timestamp as a timestamp transaction, generates a timestamp transaction request according to the timestamp transaction, and uses the timestamp Transaction requests are sent to nodes in the blockchain network. Nodes of the blockchain network add timestamp transactions included in timestamp transaction requests to the blockchain. Wherein, after the first generation time and the second generation time in the blockchain reach a preset time interval, a trusted timestamp is then added to the block data of the current latest block of the blockchain. In a preset time interval, the target block includes multiple, such as six in FIG. 2b (the second to seventh in FIG. 2b). Within a preset time interval, a block including timestamp transactions is generated, such as a block with a white background, in this block, in addition to including timestamp transactions (transactions with a white background), it also includes certificate transactions (transactions with a dark gray background), i.e. in Figure 2b, the timestamp transaction and other depository transactions together generate a block, which is added to the blockchain. It should be noted that, in some embodiments, the timestamp transaction can independently generate a block and add it to the blockchain.
该实施例进一步限定了,若在预设时间间隔内所生成的目标区块中,包括除时间戳交易之外的交易,则获取区块链中最新区块的区块数据,为区块链的最新区块添加可信时间戳;若在预设时间间隔内所生成的目标区块中,不包括除时间戳交易之外的交易,则暂停为区块链的最新区块添加可信时间戳。该实施例进一步排除了为仅包括时间戳交易的区块添加可信时间,减少了与服务器的交互,节约添加可信时间戳的成本,同时也减少了存储时间戳交易和具有可信时间戳的区块数据的存储开销和存储成本。This embodiment further defines that if the target blocks generated within the preset time interval include transactions other than timestamp transactions, the block data of the latest block in the blockchain is obtained, which is the blockchain Add a trusted timestamp to the latest block of the blockchain; if the target block generated within the preset time interval does not include transactions other than timestamp transactions, add trusted time to the latest block of the blockchain. stamp. This embodiment further precludes adding trusted time to blocks that only include timestamped transactions, reduces interaction with the server, saves the cost of adding trusted timestamps, and also reduces storing timestamped transactions and transactions with trusted timestamps The storage overhead and storage cost of the block data.
本申请实施例还提供了一种可信时间戳添加方法,应用于服务器端,该实施例与图1b中的实施例的区别在于:在获取区块链上当前最新区块的区块数据之前,增加了步骤:获取计时时间,并检测计时时间是否达到预设时间间隔,若达到预设时间间隔,则执行获取区块链上当前最新区块的区块数据的步骤以及之后的步骤;若未达到预设时间间隔,则继续执行检测计时时间是否达到预设时间间隔的步骤。其中,获取区块链上当前最新区块的区块数据的步骤以及之后的步骤,与图1b中的实施例一致,具体请参看图1b中的实施例对应的描述。The embodiment of the present application also provides a method for adding a trusted timestamp, which is applied to the server side. The difference between this embodiment and the embodiment in FIG. 1b is that: before acquiring the block data of the current latest block on the blockchain , adding a step: obtaining the timing time, and detecting whether the timing time reaches the preset time interval, if the preset time interval reaches the preset time interval, execute the step of obtaining the block data of the current latest block on the blockchain and the following steps; If the preset time interval is not reached, continue to perform the step of detecting whether the timing time reaches the preset time interval. The step of acquiring the block data of the current latest block on the blockchain and the subsequent steps are consistent with the embodiment in FIG. 1b . For details, please refer to the description corresponding to the embodiment in FIG. 1b .
其中,检测计时时间是否达到预设时间间隔,可通过多种方式实现。比如,设置一个计时器,获取计时时间即为获取计时器的时间,该计时器从零开始计时,当达到预设时间间隔时,则确定计时时间达到预设时间间隔,将该计时器重新置为零。比如,获取本机上的第一时间,从第一时间开始计时,若检测到从第一时间开始经过了预设时间间隔,则确定检测到计时时间达到预设时间间隔。可以理解地,若设置预设时间间隔为一分钟,则理解为每隔一分钟执行“获取区块链上当前最新区块的区块数据”的步骤。Among them, detecting whether the timing time reaches the preset time interval can be realized in various ways. For example, setting a timer, obtaining the timing time is the time of obtaining the timer, the timer starts counting from zero, when the preset time interval is reached, it is determined that the timing time reaches the preset time interval, and the timer is reset. zero. For example, the first time on the local machine is obtained, and the timer is started from the first time. If it is detected that the preset time interval has elapsed from the first time, it is determined that the detected time has reached the preset time interval. Understandably, if the preset time interval is set to one minute, it is understood that the step of "obtaining the block data of the current latest block on the blockchain" is executed every one minute.
该实施例中,在获取区块链上当前最新区块的区块数据之前,还可以执行上述描述的A和B步骤。在此不再赘述。In this embodiment, before acquiring the block data of the current latest block on the blockchain, steps A and B described above may also be performed. It is not repeated here.
该实施例根据计时时间来确定是否达到预设时间间隔,若达到预设时间间隔,则执行“获取区块链上当前最新区块的区块数据”的步骤。即该实施例进一步限定了根据计时时间来确定是否达到预设时间间隔,根据预设时间间隔来为区块链当前最新区块的区块数据添加可信时间戳,并根据具有可信时间戳的区块数据构建时间戳交易请求,根据该时间戳交易请求将具有可信时间戳的区块数据加入到区块链中。如此,不必实时为区块链当前最新区块的区块数据添加可信时间戳,减少了与服务器的交互,节约添加可信时间戳的成本,减少了存储具有可信时间戳的区块数据的存储开销和存储成本。In this embodiment, whether the preset time interval is reached is determined according to the timing time, and if the preset time interval is reached, the step of "obtaining the block data of the current latest block on the blockchain" is performed. That is, this embodiment further defines whether to determine whether the preset time interval has been reached according to the timing time, adding a trusted timestamp to the block data of the current latest block of the blockchain according to the preset time interval, and according to the trusted timestamp. The block data constructs a timestamp transaction request, and the block data with a trusted timestamp is added to the blockchain according to the timestamp transaction request. In this way, it is not necessary to add a trusted timestamp to the block data of the latest block of the blockchain in real time, which reduces the interaction with the server, saves the cost of adding a trusted timestamp, and reduces the storage of block data with a trusted timestamp. storage overhead and storage cost.
本申请实施例还提供了一种可信时间戳添加方法,应用于服务器端,该实施例与图1b中的实施例的区别在于:在获取区块链上当前最新区块的区块数据之前,增加了步骤a-d。下面将详细描述该实施例与图1b中的实施例的区别之处。另外,获取区块链上当前最新区块的区块数据的步骤以及之后的步骤,与图1b中的实施例一致,具体请参看图1b中的实施例对应的描述。The embodiment of the present application also provides a method for adding a trusted timestamp, which is applied to the server side. The difference between this embodiment and the embodiment in FIG. 1b is that: before acquiring the block data of the current latest block on the blockchain , adding steps a-d. The differences between this embodiment and the embodiment in FIG. 1b will be described in detail below. In addition, the step of acquiring the block data of the current latest block on the blockchain and the subsequent steps are consistent with the embodiment in FIG. 1b . For details, please refer to the description corresponding to the embodiment in FIG. 1b .
a,获取区块链中上一次记录的区块高度。a, Get the block height last recorded in the blockchain.
可以理解地,在上一次为区块链的最新区块的区块数据添加可信时间戳时,获取区块链的区块高度,并记录下来。Understandably, when a trusted timestamp is added to the block data of the latest block of the blockchain last time, the block height of the blockchain is obtained and recorded.
b,获取当前区块高度。b, Get the current block height.
c,判断当前区块高度与上一次记录的区块高度之差是否达到预设高度差。c. Determine whether the difference between the current block height and the last recorded block height reaches a preset height difference.
其中,预设高度差预先进行设定,预设高度差是大于1的正整数,如预设高度差为2、5等。预设高度差为大于1的正整数,说明在获取区块链的当前区块高度的时间,与获取上一次区块高度时的时间间隔内,已经生成了大于1的区块数量,那么生成的区块中,一定包括除时间戳交易之外的交易。若当前区块高度与上一次区块高度之差达到预设高度差,执行步骤d;若当前区块高度与上一次区块高度之差未达到预设高度差,执行步骤b,以获取当前区块高度。The preset height difference is set in advance, and the preset height difference is a positive integer greater than 1, for example, the preset height difference is 2, 5, and so on. The preset height difference is a positive integer greater than 1, indicating that the number of blocks greater than 1 has been generated between the time when the current block height of the blockchain was obtained and the time when the previous block height was obtained. The block must include transactions other than timestamp transactions. If the difference between the current block height and the previous block height reaches the preset height difference, execute step d; if the difference between the current block height and the last block height does not reach the preset height difference, execute step b to obtain the current block height. block height.
d,记录当前区块高度。并执行获取区块链上当前最新区块的区块数据的步骤以及之后的步骤。d, record the current block height. And perform the steps of obtaining the block data of the current latest block on the blockchain and the following steps.
该实施例进一步限定了根据预设高度差来为区块链的最新区块的区块数据添加可信时间戳,即每隔预设高度差(每隔预设区块数),为区块链的最新区块的区块数据添加一次可信时间戳,以得到具有可信时间戳的区块数据,并构建时间戳交易请求,根据时间戳交易请求将具有可信时间戳的区块数据添加至到区块链中。如此,不必实时为区块链的最新区块的区块数据添加可信时间戳,减少了与服务器的交互,节约添加可信时间戳的成本,同时也减少了存储具有可信时间戳的区块数据的存储开销和存储成本。This embodiment further defines that a trusted timestamp is added to the block data of the latest block of the blockchain according to the preset height difference, that is, every preset height difference (every preset number of blocks) is a block Add a trusted timestamp to the block data of the latest block of the chain to obtain block data with a trusted timestamp, and construct a timestamp transaction request. According to the timestamp transaction request, the block data with a trusted timestamp is added to the blockchain. In this way, it is not necessary to add a trusted timestamp to the block data of the latest block of the blockchain in real time, which reduces the interaction with the server, saves the cost of adding a trusted timestamp, and also reduces the storage area with trusted timestamps. Storage overhead and storage cost of block data.
图3是本申请实施例提供的可信时间戳添加方法的另一流程示意图,该方法应用于第一节点中,该第一节点为区块链中的任意节点。需要注意的是,本申请实施例中的节点指的是共识节点。该方法的具体流程包括:FIG. 3 is another schematic flowchart of a method for adding a trusted timestamp provided by an embodiment of the present application, where the method is applied to a first node, and the first node is any node in the blockchain. It should be noted that the nodes in the embodiments of this application refer to consensus nodes. The specific process of this method includes:
301,接收时间戳交易请求,所述时间戳交易请求携带具有可信时间戳的区块数据。301. Receive a timestamp transaction request, where the timestamp transaction request carries block data with a trusted timestamp.
区块链网络中的第一共识节点接收服务器发送时间戳交易请求,该时间戳交易请求中携带时间戳交易。需要注意的是,该第一共识节点即为服务器中配置的共识节点。The first consensus node in the blockchain network receives a timestamp transaction request sent by the server, and the timestamp transaction request carries the timestamp transaction. It should be noted that the first consensus node is the consensus node configured in the server.
302,检测所述第一节点是否为目标节点。302. Detect whether the first node is a target node.
其中,目标节点指的是目标共识节点,目标共识节点是当前能生成区块的节点。区块链网络中的第一共识节点接收服务器发送的时间戳交易请求后,获取保存在该第一共识节点中的目标共识节点信息,目标共识节点信息包括目标共识节点的IP等信息。获取该第一共识节点的IP;判断该第一共识节点的IP是否与目标共识节点的IP相同;若相同,则确定该第一共识节点为目标共识节点;若不相同,则确定所述第一共识节点不为目标共识节点。Among them, the target node refers to the target consensus node, and the target consensus node is the node that can currently generate blocks. After receiving the timestamp transaction request sent by the server, the first consensus node in the blockchain network obtains the target consensus node information stored in the first consensus node, and the target consensus node information includes the IP and other information of the target consensus node. Obtain the IP of the first consensus node; determine whether the IP of the first consensus node is the same as the IP of the target consensus node; if they are the same, determine that the first consensus node is the target consensus node; if not, determine the first consensus node A consensus node is not the target consensus node.
需要说明的是,本区块链网络中会预先选择出目标共识节点,并将目标共识节点的信息保存在其他的共识节点中。一旦选择出目标共识节点,若检测到该目标共识节点生成的区块未通过本区块链网络中的其他共识节点验证后,需要更换目标共识节点。具体的,根据算法从其他的共识节点中选择出一个共识节点,将该共识节点作为目标共识节点,并将该目标共识节点的信息发送至其他的共识节点,以让其他的共识节点中都保存目标共识节点的信息。It should be noted that the target consensus node will be pre-selected in this blockchain network, and the information of the target consensus node will be stored in other consensus nodes. Once the target consensus node is selected, if it is detected that the block generated by the target consensus node has not been verified by other consensus nodes in the blockchain network, the target consensus node needs to be replaced. Specifically, a consensus node is selected from other consensus nodes according to the algorithm, the consensus node is used as the target consensus node, and the information of the target consensus node is sent to other consensus nodes, so that the other consensus nodes can save it Information of the target consensus node.
若该第一共识节点为目标共识节点,执行步骤303;若该第一共识节点不为目标共识节点,执行步骤307。If the first consensus node is the target consensus node,
303,生成区块,所述区块中包括具有可信时间戳的区块数据。303. Generate a block, where the block includes block data with a trusted timestamp.
若确定该第一共识节点为目标共识节点,若检测到目标共识节点满足生成区块的条件(如是否达到生成区块的时间),生成包括具有可信时间戳的区块数据的区块。If it is determined that the first consensus node is the target consensus node, and if it is detected that the target consensus node satisfies the conditions for generating the block (such as whether the time for generating the block is reached), a block including block data with a trusted timestamp is generated.
304,向区块链中的第二节点广播所述区块的验证请求,其中,所述第二节点为区块链中除第一节点以外的节点。304. Broadcast the verification request of the block to a second node in the blockchain, where the second node is a node other than the first node in the blockchain.
其中,第二节点指的是第二共识节点,向区块链中的第二共识节点广播所述区块的验证请求,如此,第二共识节点都接收到了区块的消息。第二共识节点接收到区块的消息后,对该区块进行验证。The second node refers to the second consensus node, and broadcasts the verification request of the block to the second consensus node in the blockchain, so that the second consensus node has received the block message. After receiving the message of the block, the second consensus node verifies the block.
305,接收所述第二节点基于所述验证请求返回的验证结果。305. Receive a verification result returned by the second node based on the verification request.
第二共识节点把验证结果会进行广播,如此,第二共识节点都会接收到广播的验证结果。其中,验证结果包括验证通过结果和验证未通过结果。The second consensus node will broadcast the verification result, so that the second consensus node will receive the broadcast verification result. Wherein, the verification results include verification pass results and verification failure results.
306,基于所述第二节点返回的验证结果,将所述区块添加至所述区块链中。306. Add the block to the blockchain based on the verification result returned by the second node.
其中,基于所述第二节点返回的验证结果,将所述区块添加至所述区块链中,包括:若第二共识节点返回的验证结果中有达到第一预设数量的验证通过结果,将所述区块添加至所述区块链中。其中,第一预设数量与区块链网络中的总共识节点数相关,(第一预设数量+1)/总共识节点数=预设比值。其中,预设比值为大于1/2的值,比如预设比值=2/3。第一预设数量+1,指的是第一预设数量的第二共识节点和目标共识节点。若接收到达到第一预设数量的第二共识节点发送的验证通过结果,即意味着新生成的该区块完成共识,将该区块加入到区块链中。Wherein, adding the block to the blockchain based on the verification results returned by the second node includes: if there are verification results returned by the second consensus node that reach a first preset number of pass results , adding the block to the blockchain. Wherein, the first preset number is related to the total number of consensus nodes in the blockchain network, (the first preset number+1)/total number of consensus nodes=preset ratio. The preset ratio is a value greater than 1/2, for example, the preset ratio=2/3. The first preset number + 1 refers to the first preset number of second consensus nodes and target consensus nodes. If the verification result sent by the second consensus node reaching the first preset number is received, it means that the newly generated block completes the consensus, and the block is added to the blockchain.
307,根据所述时间戳交易请求生成发送指令。307. Generate a sending instruction according to the timestamp transaction request.
即若第一共识节点不为目标共识节点,根据时间戳交易请求生成发送指令。That is, if the first consensus node is not the target consensus node, a sending instruction is generated according to the timestamp transaction request.
308,将所述发送指令发送至目标节点,所述发送指令用于指示:所述目标节点生成区块,并基于共识机制将所述区块添加至所述区块链中。308. Send the sending instruction to the target node, where the sending instruction is used to instruct the target node to generate a block and add the block to the blockchain based on a consensus mechanism.
目标共识节点接收到发送指令(包括时间戳交易请求)后,检测是否满足生成区块的条件(如是否达到生成区块的时间),若满足生成区块的条件,生成区块,并向区块链中的第一共识节点和第二共识节点广播该区块的验证请求,其中,该处的第二共识节点为区块链中除第一共识节点和目标共识节点以外的节点;第一共识节点基于验证请求会得到一个验证结果,同时接收第二共识节点和目标共识节点基于验证请求返回的验证结果;若检测到达到第二预设数量的验证通过结果,将该区块加入至所述区块链中。其中,第二预设数量与区块链网络中的总共识节点数相关,(第二预设数量)/总共识节点数=预设比值。若检测到达到第二预设数量的验证通过结果,即意味着新生成的该区块完成共识,将新生成的该区块加入到区块链中。After the target consensus node receives the sending instruction (including the timestamp transaction request), it detects whether the conditions for generating blocks are met (such as whether the time for generating blocks is reached). The first consensus node and the second consensus node in the blockchain broadcast the verification request of the block, wherein the second consensus node here is a node other than the first consensus node and the target consensus node in the blockchain; the first consensus node The consensus node will get a verification result based on the verification request, and at the same time receive the verification results returned by the second consensus node and the target consensus node based on the verification request; if the second preset number of verification results are detected, the block will be added to all in the blockchain described above. Wherein, the second preset number is related to the total number of consensus nodes in the blockchain network, (the second preset number)/total number of consensus nodes=preset ratio. If it is detected that the verification result reaches the second preset number, it means that the newly generated block completes the consensus, and the newly generated block is added to the blockchain.
该实施例中预先选择出区块链网络中的目标共识节点,选择出目标共识节点后,该目标共识节点一般不再变动(在该目标共识节点生成的区块未通过验证才会重新再选择目标共识节点)。通过该固定的目标共识节点生成当前区块,而无需让所有共识节点争夺当前生成区块的权利,提高了生成区块的效率,降低了争夺当前生成区块权利的资源消耗。另一方面,接收到服务器发送的时间戳交易请求的第一共识节点,无需将该时间戳交易请求广播发送至其他的共识节点,而只需发送至目标共识节点,由目标共识节点生成区块,降低了带宽,节省了网络资源,以及每个共识节点存储该交易的存储资源。In this embodiment, the target consensus node in the blockchain network is pre-selected, and after the target consensus node is selected, the target consensus node generally does not change (the block generated by the target consensus node will not be re-selected until the verification is passed). target consensus node). The current block is generated through the fixed target consensus node without requiring all consensus nodes to compete for the right to generate the current block, which improves the efficiency of generating blocks and reduces the resource consumption for competing for the right to generate the current block. On the other hand, the first consensus node that receives the timestamp transaction request sent by the server does not need to broadcast the timestamp transaction request to other consensus nodes, but only needs to send it to the target consensus node, and the target consensus node generates a block , which reduces bandwidth, saves network resources, and storage resources for each consensus node to store the transaction.
根据上述实施例所描述的方法,本实施例将从可信时间戳添加装置的角度进一步进行描述,该可信时间戳添加装置具体可以作为独立的实体来实现,也可以集成在服务器中来实现。According to the method described in the above embodiment, this embodiment will be further described from the perspective of a trusted time stamp adding device. The trusted time stamp adding device can be specifically implemented as an independent entity, or can be implemented by being integrated in a server. .
如图4所示,该可信时间戳添加装置包括用于执行上述图1b中的可信时间戳添加方法所对应的单元。该装置可以包括区块数据获取单元401、时间戳添加单元402、请求构建单元403、以及请求发送单元404。As shown in FIG. 4 , the apparatus for adding trusted timestamp includes a unit corresponding to executing the method for adding trusted timestamp in FIG. 1 b. The apparatus may include a block
区块数据获取单元401,用于获取区块链上当前最新区块的区块数据。The block
时间戳添加单元402,用于获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据。The
请求构建单元403,用于根据所述具有可信时间戳的区块数据构建时间戳交易请求。The
请求发送单元404,用于根据所述时间戳交易生成提交指令,并将所述提交指令发送至第二服务器,所述提交指令用于指示所述第二服务器将所述时间戳交易加入所述区块链中。A
在一实施例中,请求构建单元403包括具体包括:交易构建单元、请求生成单元。其中,交易构建单元,用于根据具有可信时间戳的区块数据构建时间戳交易。请求生成单元,用于根据时间戳交易生成时间戳交易请求。其中,交易构建单元,包括:模板获取单元、填充单元、时间戳交易构建单元。其中,模板获取单元,用于获取预设交易模板,所述预设交易模板中包括交易内容字段。填充单元,用于根据所述可信时间戳对所述预设交易模板中的所述交易内容字段进行数据填充。时间戳交易构建单元,用于根据填充后的预设交易模板构建一笔时间戳交易。In an embodiment, the
图5是本申请实施例提供的可信时间戳添加装置的另一示意性框图,该装置包括用于执行上述图2a实施例的可信时间戳添加方法所对应的单元。该装置包括时间获取单元501、时间判断单元502、时间记录单元503、区块数据获取单元504、时间戳添加单元505、请求构建单元506、以及请求发送单元507。该装置实施例与图4所示的装置实施例的区别在于:增加了时间获取单元501、时间判断单元502、时间记录单元503。该实施例中的区块数据获取单元504、时间戳添加单元505、请求构建单元506、以及请求发送单元507与上述实施例中的区块数据获取单元401、时间戳添加单元402、请求构建单元403、以及请求发送单元404一一对应,具体可参看图4实施例中的描述,在此不再赘述。下面将描述将装置实施例与图4所示的装置实施例的区别之处。FIG. 5 is another schematic block diagram of an apparatus for adding a trusted time stamp provided by an embodiment of the present application, where the apparatus includes a unit corresponding to executing the method for adding a trusted time stamp in the embodiment of FIG. 2a. The apparatus includes a
时间获取单元501,用于获取区块链中上一次记录的最新区块的第一生成时间。时间获取单元501,还用于当前最新区块的第二生成时间。The
时间判断单元502,用于第二生成时间与第一生成时间之差是否达到预设时间间隔。The
时间记录单元503,用于若第二生成时间与第一生成时间之差达到预设时间间隔,记录该第二生成时间。接着触发区块数据获取单元504;若第二生成时间与第一生成时间之差未达到预设时间间隔,触发时间获取单元501,以用于获取当前最新区块的第二生成时间。The
在一实施例中,若时间戳交易请求中携带时间戳交易,而该时间戳交易是根据所述具有可信时间戳的区块数据构建的,则所述可信时间戳添加装置还包括目标区块获取单元、区块检测单元。其中,In one embodiment, if a timestamp transaction is carried in the timestamp transaction request, and the timestamp transaction is constructed according to the block data with the trusted timestamp, the trusted timestamp adding device further includes a target. Block acquisition unit, block detection unit. in,
目标区块获取单元,用于获取在预设时间间隔内所生成的区块,作为目标区块。The target block acquiring unit is used for acquiring the blocks generated within the preset time interval as the target blocks.
区块检测单元,用于检测目标区块中是否包括除时间戳交易之外的交易。The block detection unit is used to detect whether transactions other than timestamp transactions are included in the target block.
若目标区块中不包括除时间戳交易之外的交易,触发时间获取单元501,以用于获取区块链中上一次记录的最新区块的第一生成时间;若目标区块中包括除时间戳交易之外的交易,触发区块数据获取单元504。If the target block does not include transactions other than timestamp transactions, the
在一实施例中,还提供了一种可信时间戳添加装置,该装置包括计时检测单元、区块数据获取单元、时间戳添加单元、请求构建单元、以及请求发送单元。其中,该装置实施例与图4所示的装置实施例的区别在于:增加了计时检测单元,其中计时检测单元,用于获取计时时间,并检测计时时间是否达到预设时间间隔。其中,该装置实施例中的区块数据获取单元、时间戳添加单元、请求构建单元、以及请求发送单元与图4所示的装置实施例中的区块数据获取单元401、时间戳添加单元402、请求构建单元403、以及请求发送单元404一一对应,具体可参看图4实施例中的描述,在此不再赘述。In an embodiment, a trusted timestamp adding device is also provided, the device includes a timing detection unit, a block data acquisition unit, a timestamp adding unit, a request constructing unit, and a request sending unit. The difference between this device embodiment and the device embodiment shown in FIG. 4 is that a timing detection unit is added, wherein the timing detection unit is used to acquire the timing time and detect whether the timing time reaches a preset time interval. Among them, the block data acquisition unit, the time stamp adding unit, the request construction unit, and the request sending unit in the device embodiment are the same as the block
本申请的实施例中还提供了一种可信时间戳添加装置,该装置集成在服务器中。该装置包括高度获取单元、高度判断单元、高度记录单元、区块数据获取单元、时间戳添加单元、请求构建单元、以及请求发送单元。该装置实施例与图4所示的装置实施例的区别在于:增加了高度获取单元、高度判断单元、高度记录单元。该实施例中的区块数据获取单元、时间戳添加单元、请求构建单元、以及请求发送单元与上述图4所示实施例中的区块数据获取单元401、时间戳添加单元402、请求构建单元403、以及请求发送单元404一一对应,具体可参看图4实施例中的描述,在此不再赘述。下面将描述将装置实施例与图4所示的装置实施例的区别之处。The embodiment of the present application also provides a trusted timestamp adding device, which is integrated in the server. The device includes a height obtaining unit, a height judging unit, a height recording unit, a block data obtaining unit, a time stamp adding unit, a request constructing unit, and a request sending unit. The difference between this apparatus embodiment and the apparatus embodiment shown in FIG. 4 is that an altitude acquisition unit, an altitude judgment unit, and an altitude recording unit are added. The block data acquisition unit, time stamp addition unit, request construction unit, and request transmission unit in this embodiment are the same as the block
高度获取单元,用于获取区块链中上一次记录的区块高度,以及还用于获取区块链的当前区块高度。The height obtaining unit is used to obtain the last recorded block height in the blockchain, and is also used to obtain the current block height of the blockchain.
高度判断单元,用于判断当前区块高度与上一次记录的区块高度之差是否达到预设高度差。The height judgment unit is used for judging whether the difference between the height of the current block and the height of the block recorded last time reaches a preset height difference.
高度记录单元,用于若当前区块高度与上一次记录的区块高度之差达到预设高度差,记录当前区块高度,并触发区块数据获取单元;若当前区块高度与上一次记录的区块高度之差未达到预设高度差,触发高度获取单元,以用于获取区块链的当前区块高度。The height recording unit is used to record the current block height and trigger the block data acquisition unit if the difference between the current block height and the last recorded block height reaches the preset height difference; The difference between the heights of the blocks does not reach the preset height difference, and the height obtaining unit is triggered to obtain the current block height of the blockchain.
具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现。以上装置和各单元的具体实现过程,以及所达到的有益效果,可以参考前述应用于服务器端的方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。During specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities. For the specific implementation process of the above device and each unit, as well as the beneficial effects achieved, reference may be made to the corresponding description in the foregoing method embodiments applied to the server side.
根据上述实施例所描述的方法,本实施例将从可信时间戳添加装置的角度进一步进行描述,该可信时间戳添加装置具体可以作为独立的实体来实现,也可以集成在区块链网络中的节点中来实现。According to the method described in the above embodiment, this embodiment will be further described from the perspective of a trusted timestamp adding device. The trusted timestamp adding device can be specifically implemented as an independent entity, or can be integrated in a blockchain network. in the node to achieve.
本申请的实施例中也提供了另一可信时间戳添加装置,如图6所示,该装置包括用于执行上述图3实施例的可信时间戳添加方法所对应的单元。该装置包括请求接收单元601、节点检测单元602、区块生成单元603、广播单元604、验证结果接收单元605、区块添加单元606、指令生成单元607、指令发送单元608。其中,The embodiment of the present application also provides another apparatus for adding a trusted timestamp. As shown in FIG. 6 , the apparatus includes a unit corresponding to executing the method for adding a trusted timestamp in the embodiment of FIG. 3 . The device includes a
请求接收单元601,用于接收时间戳交易请求,所述时间戳交易请求携带具有可信时间戳的区块数据;A
节点检测单元602,用于检测所述第一节点是否为目标节点。A
区块生成单元603,用于当所述第一节点为可生成区块的目标节点时,生成区块,所述区块中包括具有可信时间戳的区块数据;A
广播单元604,用于向区块链中的第二节点广播所述区块的验证请求,其中,所述第二节点为区块链中除第一节点以外的节点;A
验证结果接收单元605,用于接收所述第二节点基于所述验证请求返回的验证结果;a verification
区块添加单元606,用于基于所述第二节点返回的验证结果,将所述区块添加至所述区块链中。A
指令生成单元607,用于当所述第一节点不为可生成区块的目标节点时,根据所述时间戳交易请求生成发送指令;An
指令发送单元608,用于将所述发送指令发送至目标节点,所述发送指令用于指示:所述目标节点生成区块,并基于共识机制将所述区块添加至所述区块链中。an
具体实施时,以上各个单元可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现。以上装置和各单元的具体实现过程,以及所达到的有益效果,可以参考前述应用于区块链的节点中的方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。During specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities. For the specific implementation process of the above devices and units, as well as the beneficial effects achieved, reference may be made to the corresponding descriptions in the foregoing method embodiments applied to the nodes of the blockchain.
本申请实施例还提供一种计算机设备,如图7所示,其示出了本申请实施例所涉及的计算机设备的结构示意图,具体来讲:The embodiment of the present application also provides a computer device, as shown in FIG. 7 , which shows a schematic structural diagram of the computer device involved in the embodiment of the present application, specifically:
该计算机设备可以包括一个或者一个以上处理核心的处理器701、一个或一个以上计算机可读存储介质的存储器702、射频(Radio Frequency,RF)电路703、电源704、输入单元705、以及显示单元706等部件。本领域技术人员可以理解,图中示出的计算机设备结构并不构成对计算机设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:The computer device may include a
处理器701是该计算机设备的控制中心,利用各种接口和线路连接整个计算机设备的各个部分,通过运行或执行存储在存储器702内的软件程序和/或模块,以及调用存储在存储器702内的数据,执行计算机设备的各种功能和处理数据,从而对计算机设备进行整体监控。可选的,处理器701可包括一个或多个处理核心;优选的,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。The
存储器702可用于存储软件程序以及模块,处理器701通过运行存储在存储器702的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。The
RF电路703可用于收发信息过程中,信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器701处理;另外,将涉及上行的数据发送给基站。通常,RF电路703包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM)卡、收发信机、耦合器、低噪声放大器(LNA,Low Noise Amplifier)、双工器等。此外,RF电路703还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GSM,Global System of Mobilecommunication)、通用分组无线服务(GPRS,General Packet Radio Service)、码分多址(CDMA,Code Division Multiple Access)、宽带码分多址(WCDMA,Wideband CodeDivision Multiple Access)、长期演进(LTE,Long Term Evolution)、电子邮件、短消息服务(SMS,Short Messaging Service)等。The
计算机设备还包括给各个部件供电的电源704(比如电池),优选的,电源704可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源704还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The computer equipment also includes a power supply 704 (such as a battery) for supplying power to various components. Preferably, the
该计算机设备还可包括输入单元705,该输入单元705可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,在一个具体的实施例中,输入单元705可包括触敏表面以及其他输入设备。触敏表面,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面上或在触敏表面附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器701,并能接收处理器701发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面。除了触敏表面,输入单元705还可以包括其他输入设备。具体地,其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The computer device may also include an
该计算机设备还可包括显示单元706,该显示单元706可用于显示由用户输入的信息或提供给用户的信息以及计算机设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元706可包括显示面板,可选的,可以采用液晶显示器(LCD,Liquid Crystal Display)、有机发光二极管(OLED,Organic Light-Emitting Diode)等形式来配置显示面板。进一步的,触敏表面可覆盖显示面板,当触敏表面检测到在其上或附近的触摸操作后,传送给处理器701以确定触摸事件的类型,随后处理器701根据触摸事件的类型在显示面板上提供相应的视觉输出。虽然在图中,触敏表面与显示面板是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面与显示面板集成而实现输入和输出功能。The computer device may also include a
尽管未示出,计算机设备还可以包括摄像头、蓝牙模块等,在此不再赘述。具体在本实施例中,计算机设备中的处理器701会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器702中,并由处理器701来运行存储在存储器702中的应用程序,从而实现各种功能,如下:Although not shown, the computer device may also include a camera, a Bluetooth module, etc., which will not be described herein again. Specifically, in this embodiment, the
获取区块链上当前最新区块的区块数据;获取可信时间,并根据所述可信时间为所述区块数据添加可信时间戳,得到具有可信时间戳的区块数据;根据所述具有可信时间戳的区块数据构建时间戳交易请求;向所述区块链中的节点发送所述时间戳交易请求,以使得所述节点根据所述时间戳交易请求将所述具有可信时间戳的区块数据添加至所述区块链中。Obtain the block data of the current latest block on the blockchain; obtain the trusted time, and add a trusted timestamp to the block data according to the trusted time to obtain block data with a trusted timestamp; The block data with a trusted timestamp constructs a timestamp transaction request; the timestamp transaction request is sent to a node in the blockchain, so that the node converts the timestamp transaction request according to the timestamp transaction request. Trusted timestamped block data is added to the blockchain.
该计算机设备可以实现本申请实施例所提供的应用于服务器中的可信时间戳添加方法任一实施例中的步骤或者实现本申请实施例中所提供的应用于区块链节点中的可信时间戳添加方法任一实施例中的步骤,因此,可以实现本申请实施例所提供的应用于服务器中的任一可信时间戳添加方法所能实现的有益效果或者实现本申请实施例所提供的应用于区块链节点中的任一可信时间戳添加方法所能实现的有益效果,详见前面的实施例,在此不再赘述。The computer device can implement the steps in any of the embodiments of the method for adding trusted timestamps in a server provided by the embodiments of this application, or implement the trusted timestamps provided in the embodiments of this application and applied in blockchain nodes. The steps in any of the embodiments of the method for adding time stamps can therefore achieve the beneficial effects that can be achieved by any method for adding trusted time stamps provided by the embodiments of the present application and applied to the server or achieve the benefits provided by the embodiments of the present application. The beneficial effects that can be achieved by any method for adding trusted timestamps applied to blockchain nodes can be seen in the previous embodiments, which will not be repeated here.
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。为此,本发明实施例提供一种存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本发明实施例所提供的应用于服务器端的可信时间戳添加方法中任一实施例的步骤或者以执行本申请实施例所提供的的应用于区块链节点的可信时间戳添加方法的步骤。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructions, or by instructions that control relevant hardware, and the instructions can be stored in a computer-readable storage medium, and loaded and executed by the processor. To this end, an embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute any of the methods for adding a trusted timestamp applied to a server provided by the embodiments of the present invention. The steps of an embodiment may be performed to perform the steps of the method for adding a trusted timestamp applied to a blockchain node provided by the embodiments of the present application.
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。Wherein, the storage medium may include: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.
由于该存储介质中所存储的指令,可以执行本发明实施例所提供的任一可信时间戳添加方法实施例中的步骤,因此,可以实现本发明实施例所提供的任一可信时间戳添加方法所能实现的有益效果,详见前面的实施例,在此不再赘述。Since the instructions stored in the storage medium can perform the steps in any of the method embodiments for adding a trusted timestamp provided by the embodiments of the present invention, any trusted timestamp provided by the embodiments of the present invention can be implemented The beneficial effects that can be achieved by the adding method can be found in the previous embodiments, and details are not repeated here.
以上对本申请实施例所提供的一种可信时间戳添加方法、装置、计算机设备以及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A method, device, computer device, and storage medium for adding a trusted timestamp provided by the embodiments of the present application have been described above in detail. The principles and implementations of the present application are described with specific examples in this article. The above embodiments The description is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scope. In summary, the above , the contents of this specification should not be construed as limiting the application.
Claims (10)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910854907.7A CN110601849B (en) | 2019-08-21 | 2019-08-21 | Trusted timestamp adding method and device and storage medium |
| CN201910775729.9A CN110505065B (en) | 2019-08-21 | 2019-08-21 | A method, device and storage medium for adding trusted timestamp |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910775729.9A CN110505065B (en) | 2019-08-21 | 2019-08-21 | A method, device and storage medium for adding trusted timestamp |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910854907.7A Division CN110601849B (en) | 2019-08-21 | 2019-08-21 | Trusted timestamp adding method and device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110505065A CN110505065A (en) | 2019-11-26 |
| CN110505065B true CN110505065B (en) | 2021-07-20 |
Family
ID=68588417
Family Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910775729.9A Active CN110505065B (en) | 2019-08-21 | 2019-08-21 | A method, device and storage medium for adding trusted timestamp |
| CN201910854907.7A Active CN110601849B (en) | 2019-08-21 | 2019-08-21 | Trusted timestamp adding method and device and storage medium |
Family Applications After (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910854907.7A Active CN110601849B (en) | 2019-08-21 | 2019-08-21 | Trusted timestamp adding method and device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (2) | CN110505065B (en) |
Families Citing this family (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111837359B (en) * | 2019-09-02 | 2023-08-04 | 创新先进技术有限公司 | Managing a blockchain-based centralized ledger system |
| CN118195611A (en) | 2019-09-02 | 2024-06-14 | 创新先进技术有限公司 | Managing a blockchain-based centralized ledger system |
| CN111161072A (en) * | 2019-12-30 | 2020-05-15 | 山东爱城市网信息技术有限公司 | Block chain-based random number generation method, equipment and storage medium |
| CN111339187B (en) * | 2020-02-20 | 2023-05-09 | 百度在线网络技术(北京)有限公司 | Data processing method, device, equipment and storage medium based on intelligent contract |
| CN111447068B (en) * | 2020-03-20 | 2024-05-14 | 腾讯科技(深圳)有限公司 | Time service evidence-storing method based on blockchain |
| CN111460474B (en) * | 2020-03-27 | 2023-12-29 | 北京瑞卓喜投科技发展有限公司 | Method, device, memory and computer for implementing decentralization predictor |
| SG11202103074PA (en) | 2020-04-22 | 2021-04-29 | Alipay Hangzhou Inf Tech Co Ltd | Managing transaction requests in ledger systems |
| WO2020143855A2 (en) | 2020-04-22 | 2020-07-16 | Alipay (Hangzhou) Information Technology Co., Ltd. | Managing transaction requests in ledger systems |
| CN111630545B (en) | 2020-04-22 | 2022-05-27 | 支付宝(杭州)信息技术有限公司 | Managing transaction requests in ledger system |
| CN111786952B (en) * | 2020-05-29 | 2023-03-17 | 中国银联股份有限公司 | Consensus method, apparatus, device, and medium for block chain system |
| CN114065206B (en) * | 2020-07-30 | 2025-04-25 | 阿里巴巴集团控股有限公司 | A data evidence storage method, device and storage medium based on blockchain |
| CN112328601A (en) * | 2020-11-16 | 2021-02-05 | 深圳壹账通智能科技有限公司 | Data processing method, device, equipment and storage medium based on block chain |
| CN112788106B (en) * | 2020-12-28 | 2022-12-27 | 深圳前海益链网络科技有限公司 | Block generation control method applied to block chain and related device |
| CN112364384B (en) * | 2021-01-12 | 2021-04-23 | 支付宝(杭州)信息技术有限公司 | Business record time service method based on credible account book database |
| US12160532B2 (en) | 2021-12-06 | 2024-12-03 | Blocky, Inc. | System and method for creating and maintaining immutability, agreement and availability of data |
| CN114880399B (en) * | 2022-04-28 | 2025-08-19 | 蚂蚁区块链科技(上海)有限公司 | Data sharing system based on account database network and account database |
| CN117834069A (en) * | 2022-09-27 | 2024-04-05 | 中兴通讯股份有限公司 | Network timing method, system, electronic device and storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105790954A (en) * | 2016-03-02 | 2016-07-20 | 布比(北京)网络技术有限公司 | Method and system for constructing electronic evidence |
| CN107147501A (en) * | 2017-06-27 | 2017-09-08 | 中国联合网络通信集团有限公司 | Time stamp processing method and device |
| CN108256867A (en) * | 2017-12-01 | 2018-07-06 | 西安电子科技大学 | Offline transaction system and its method based on the transaction block verification of bit coin |
| CN109508984A (en) * | 2018-11-26 | 2019-03-22 | 中国科学院软件研究所 | It is a kind of that card method is deposited based on certainty common recognition and the block chain electronics of trusted timestamp |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180091316A1 (en) * | 2016-09-26 | 2018-03-29 | Shapeshift Ag | System and method of providing a multi-validator oracle |
| CN107317856A (en) * | 2017-06-23 | 2017-11-03 | 李波 | A kind of date storage method and device based on block chain |
| US11363033B2 (en) * | 2017-08-04 | 2022-06-14 | Ho Yun KYUNG | Time-dependent blockchain-based self-verification user authentication method |
| CN109947843B (en) * | 2017-12-01 | 2021-06-01 | 北京欧链科技有限公司 | Method, device and system for determining time in block chain |
| CN109034805B (en) * | 2018-08-09 | 2022-09-02 | 江苏先安科技有限公司 | Timestamp signature verification method suitable for block chain and embedded field |
| CN109726597B (en) * | 2018-12-29 | 2020-12-08 | 杭州趣链科技有限公司 | Blockchain-based trusted timestamp system |
| CN109981673B (en) * | 2019-04-04 | 2021-10-08 | 上海人行道网络信息技术有限公司 | Block chain-based data evidence storage method, device, equipment and storage medium |
-
2019
- 2019-08-21 CN CN201910775729.9A patent/CN110505065B/en active Active
- 2019-08-21 CN CN201910854907.7A patent/CN110601849B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105790954A (en) * | 2016-03-02 | 2016-07-20 | 布比(北京)网络技术有限公司 | Method and system for constructing electronic evidence |
| CN107147501A (en) * | 2017-06-27 | 2017-09-08 | 中国联合网络通信集团有限公司 | Time stamp processing method and device |
| CN108256867A (en) * | 2017-12-01 | 2018-07-06 | 西安电子科技大学 | Offline transaction system and its method based on the transaction block verification of bit coin |
| CN109508984A (en) * | 2018-11-26 | 2019-03-22 | 中国科学院软件研究所 | It is a kind of that card method is deposited based on certainty common recognition and the block chain electronics of trusted timestamp |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110601849B (en) | 2021-05-11 |
| CN110505065A (en) | 2019-11-26 |
| CN110601849A (en) | 2019-12-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110505065B (en) | A method, device and storage medium for adding trusted timestamp | |
| US11469891B2 (en) | Expendable cryptographic key access | |
| US12341872B2 (en) | Hardware security module management | |
| US20190236300A1 (en) | Service processing method and apparatus, data sharing system, and storage medium | |
| US20190082026A1 (en) | Interface invocation method and apparatus for hybrid cloud | |
| KR20220006623A (en) | Blockchain consensus method, device and system | |
| CN106685907B (en) | A kind of generation method and device of session key | |
| CN114092101B (en) | Transaction verification method and device, storage medium and electronic equipment | |
| CN110601858B (en) | Certificate management method and device | |
| CN111460474B (en) | Method, device, memory and computer for implementing decentralization predictor | |
| EP4618474A1 (en) | Cross-blockchain transaction processing method, related device, storage medium and product | |
| CN112766998A (en) | Data processing method and device for business activities | |
| CN111937013B (en) | Electronic device management | |
| CN112181599B (en) | Model training method, device and storage medium | |
| CN111125187B (en) | Data management method and device based on blockchain | |
| CN117216152A (en) | Data processing method, device, equipment, medium and product of block chain network | |
| HK40014522A (en) | Method, apparatus and storage medium for adding trusted time stamp | |
| HK40014522B (en) | Method, apparatus and storage medium for adding trusted time stamp | |
| HK40014940B (en) | Method, apparatus, and storage medium for adding trusted time stamp | |
| HK40014940A (en) | Method, apparatus, and storage medium for adding trusted time stamp | |
| CN115222392A (en) | Blockchain-based business access method, device, medium and electronic device | |
| EP3437289B1 (en) | Untrusted code distribution | |
| CN108881344A (en) | Method for processing business, device, storage equipment and processing server | |
| HK40043916A (en) | Method and device for processing data of business activities | |
| CN116939014A (en) | Decoupling control distribution method, device and equipment for system events and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40014940 Country of ref document: HK |
|
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |