WO2020199710A1 - 一种账本的验证方法、装置及设备 - Google Patents

一种账本的验证方法、装置及设备 Download PDF

Info

Publication number
WO2020199710A1
WO2020199710A1 PCT/CN2020/071183 CN2020071183W WO2020199710A1 WO 2020199710 A1 WO2020199710 A1 WO 2020199710A1 CN 2020071183 W CN2020071183 W CN 2020071183W WO 2020199710 A1 WO2020199710 A1 WO 2020199710A1
Authority
WO
WIPO (PCT)
Prior art keywords
data block
ledger
block
height
data
Prior art date
Application number
PCT/CN2020/071183
Other languages
English (en)
French (fr)
Inventor
杨新颖
Original Assignee
创新先进技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Priority to US16/815,882 priority Critical patent/US10790968B2/en
Publication of WO2020199710A1 publication Critical patent/WO2020199710A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • G06F16/152File search processing using file content signatures, e.g. hash values
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/12Accounting

Definitions

  • the embodiments of this specification relate to the field of information technology, and in particular to a method, device and equipment for verifying an account.
  • the purpose of the embodiments of the present application is to provide a method for flexible verification in a block chain ledger.
  • a verification method for a blockchain ledger, applied to a centralized database service provider that stores data through multiple data blocks, includes:
  • Timing certificate corresponds to a continuous partial ledger
  • the timing certificate includes the starting point data block height, the end point data block height, the trusted timestamp, and the partial ledger information of the partial ledger.
  • Root hash used to clarify the generation time of the part of the ledger;
  • each data block contains at least one data record
  • each data block contains the hash value of the previous data block and the data record contained in itself Determine the hash value of the own data block
  • the block height of the data block increases monotonically based on the sequence of the block time.
  • the embodiment of this specification also provides a verification device for a blockchain ledger, which is applied to a centralized database service provider that stores data through multiple data blocks, and the device includes:
  • the determining module determines at least one time service certificate, wherein any time service certificate corresponds to a continuous partial account book, and the time service certificate includes the starting point data block height, the end point data block height, and the trusted timestamp of the partial account book.
  • the root hash of part of the ledger used to clarify the generation time of the part of the ledger;
  • the obtaining module obtains the hash value of the data block from the height of the starting point data block to the height of the end data block, constructs the Merkel tree corresponding to the partial ledger, and determines the root of the Merkel tree Hash
  • the verification module verifies the consistency of the root hash of the partial ledger and the root hash of the Merkel tree
  • each data block contains at least one data record
  • each data block contains the hash value of the previous data block and the data record contained in itself Determine the hash value of the own data block
  • the block height of the data block increases monotonically based on the sequence of the block time.
  • the timing certificate as the anchor to verify the part of the ledger corresponding to the anchor. Since the time stamp of this part of the account book is based on the time service certificate as a credible proof, verification based on the time service certificate can guarantee the time validity and correctness of this part of the account book.
  • Figure 1 is a schematic diagram of the system architecture involved in the current technology
  • FIG. 2 is a schematic diagram of a pseudo chain provided by an embodiment of this specification
  • FIG. 3 is a schematic diagram of a process for generating a time service certificate provided by an embodiment of the specification
  • FIG. 4 is a schematic flowchart of a method for verifying an account provided by an embodiment of the specification
  • FIG. 5 is a schematic structural diagram of an account book verification device provided by an embodiment of this specification.
  • Fig. 6 is a schematic structural diagram of a device for configuring the method of the embodiment of this specification.
  • the database server can be directly connected to individual client users, or it can be connected to individual client users by some application servers, and the database server is connected to the application server.
  • Figure 1 is a schematic diagram of the involved system architecture.
  • data blocks are pre-generated in the following ways:
  • the data records to be stored can be various consumption records of individual users of the client, or can be business results, intermediate states, and operation records generated when the application server executes business logic based on user instructions.
  • Specific business scenarios can include consumption records, audit logs, supply chains, government supervision records, medical records, and so on.
  • each data record to be written in the data block is determined, and the Nth data block including the hash value of the data block and the data record is generated.
  • the preset block conditions include: the number of data records to be stored reaches the number threshold, for example, every time one thousand data records are received, a new data block is generated and one thousand data records are written into the block; or , The time interval from the last block formation time reaches the time threshold, for example, every 5 minutes, a new data block is generated, and the data records received within these 5 minutes are written into the block.
  • the N here refers to the serial number of the data block.
  • the data block is in the form of a block chain, which is arranged sequentially based on the order of the block time, and has a strong timing characteristic.
  • the block height of the data block increases monotonically based on the sequence of the block time.
  • the block height can be a sequence number, at this time the block height of the Nth data block is N; the block height can also be generated in other ways.
  • the data block at this time is the initial data block.
  • the current data block (the first data block) can be generated based on the hash value of the previous data block (that is, the N-1th data block). For example, a feasible way is to determine the hash value of each data record to be written in the Nth block, and generate a Merck according to the sequence in the block. In the Er tree, the root hash value of the Merkel tree and the hash value of the previous data block are spliced together, and the hash algorithm is used again to generate the hash value of the current block.
  • each data block is determined by a hash value, and the hash value of the data block is determined by the content and sequence of the data records in the data block and the hash value of the previous data block.
  • the user can initiate verification based on the hash value of the data block at any time. Any modification of the data block (including the modification of the data record content or sequence in the data block) will cause the hash value of the data block calculated during verification and The hash value of the data block is inconsistent when it is generated, which causes the verification to fail, thus realizing the immutability under centralization.
  • the block time is generally given by the database server.
  • FIG. 2 is a schematic diagram of a pseudo chain provided by an embodiment of this specification.
  • the blocking method of the data block is the same as the aforementioned blocking method.
  • the embodiments of this specification provide a verification method for account books based on time service certificates to ensure the validity and correctness of the account books.
  • FIG. 3 is a schematic diagram of a process for generating a time service certificate provided by an embodiment of this specification, including the following steps:
  • S301 Determine a target ledger that needs time service authentication, where the target ledger contains at least one data block or multiple data blocks with high continuous blocks.
  • each data block contains at least one data record, and each data block contains the hash value of the previous data block and its own
  • the data record determines the hash value of its own data block, and the block height of the data block increases monotonically based on the sequence of the block time.
  • the server first determines from the data blocks that have been generated and stored, a section of the ledger that needs time service authentication, which should contain at least one data block, or multiple blocks of highly continuous data.
  • the manner of determination can be specified based on user operations. For example, the user initiates a timing instruction, which contains the starting block height and the number of blocks required for timing authentication; the partial ledger is used as the target ledger.
  • the target account does not need to be specified by the user, and the service party automatically performs it based on preset business logic. For example, from the finest granularity, each data block can be applied for timing. In this way, the root hash of the Merkel tree of part of the ledger is the block hash value of the data block. This way can protect the authenticity of the ledger (that is, each data block) to the greatest extent. Due to the high frequency of data block generation, this method will have a relatively large cost for both the time service center and the server.
  • An optional method is to set a certain preset time service condition, and initiate a time service request when the certain preset time service condition is met.
  • the preset time-serving condition may be: the number of data blocks to be time-served and authenticated reaches the threshold, or the time interval since the last time-service authentication has reached the time Threshold.
  • S303 Generate a Merkel tree corresponding to the target ledger according to the block height order of the data blocks in the target ledger, and determine the root hash of the Merkel tree based on the block hash of each data block.
  • the time fairness agency can be, for example, the national time service center, or a corresponding time service agency authorized by the national time service center.
  • the time justice agency receives the above information, it gives a trusted timestamp, and performs digital signature authentication on the trusted timestamp, and generates a time service certificate containing the trusted timestamp and digital signature.
  • the time service certificate may also contain the above
  • the method of digital signature is conventional private key encryption and public key decryption.
  • Timing certificate corresponding to the target ledger returned by a time justice agency, where the timing certificate includes the starting point data block height, the end point data block height, the trusted timestamp, and the target ledger.
  • the root hash of the ledger is the root hash of the ledger.
  • the database server can receive a series of trusted timing certificates containing the signature of the time fair agency, and each timing certificate contains a trusted timestamp and corresponds to a section of the ledger.
  • a timing certificate can prove that the corresponding part of the ledger was generated before the trusted timestamp. You can clearly know which part of the account book is through the relevant information in the time service certificate.
  • the database server can manage and verify a series of timing certificates accordingly.
  • the database server can sequentially number each time service certificate.
  • the database or index contains a correspondence table of the starting data block height, the ending data block height, the root hash value of the partial account book corresponding to the timing certificate and the timing certificate number.
  • FIG. 4 is a schematic flowchart of a method for verifying an account provided by an embodiment of this specification, including the following steps:
  • S401 Determine at least one timing certificate.
  • any timing certificate corresponds to a continuous partial ledger, and the timing certificate includes the starting data block height, the end data block height, the trusted timestamp, and the root hash of the partial ledger. , Used to clarify the generation time of the part of the ledger;
  • full verification can be performed, or spot check verification can be performed.
  • spot-check verification mode one or several timing certificates can be selected at random, and then part of the ledger corresponding to each timing certificate is verified.
  • full verification mode all time service certificates need to be obtained, and all verifications are performed in the order of the time service certificates.
  • the corresponding time service certificate may also be determined based on the time specified by the user. For example, based on actual needs, it is determined that the ledger generated within a certain period of time [a, b] has problems and needs to be audited. Then, the time service certificate whose credible timestamp included falls within the above range can be obtained as the object to be verified. Or, for a specified time point, a time service certificate whose interval between the trusted timestamp and the specified time point is less than a preset value can be obtained as the object to be verified.
  • a time service certificate can uniquely determine the part of the account book corresponding to the time service certificate, and the starting data block height and the end data block height of the part of the account book have been included in the time service certificate.
  • the time service certificate also contains a trusted time stamp, if it is found that the time stamp in the data record contained in part of the ledger is after the trusted time stamp, or the trusted time stamp in the time service certificate and the adjacent time service If the difference between the certificate intervals is too large, it can be directly determined that there is a problem with this part of the ledger.
  • the credible timestamp contained in the time service certificate 2 is June 1, 20xx 0:00:00, assuming that for the ledger, an average time service certificate will be applied for about 10 minutes.
  • the trusted timestamp of the previous time service certificate 1 of time service certificate 2 is 0:00:00 on March 1, 20xx. It can be known that the generation time of the part of the ledger corresponding to time service certificate 2 is longer than that of the previous part of the ledger. If the generation interval is too long, it may be a false chain.
  • the trusted timestamp of the time service certificate can be used to clarify the generation time of the part of the account book, and then used to verify the time consistency of the part of the account book corresponding to the time service certificate.
  • each data block can calculate the hash value of its own data block, if there is no problem with the time consistency of this part of the ledger, you can further construct the default corresponding to this part of the ledger.
  • Merkle Tree in the Merkle tree, each leaf node is the block hash of a data block, so that the root hash of the Merkle tree can be obtained.
  • the root hash of part of the ledger in the timing certificate is calculated in the same way as the root hash of the Merkel tree, the root hash of part of the ledger is not modified when the data records in this part of the ledger are not modified.
  • the root hash of Xi and the Merkel tree are consistent. Any modification of part of the ledger will obviously lead to inconsistencies between the two. Therefore, the correctness of the part of the account book corresponding to the time service certificate can be verified by the above method.
  • the timing certificate as the anchor to verify the part of the ledger corresponding to the anchor. Since the time stamp of this part of the account book is based on the time service certificate as a credible proof, verification based on the time service certificate can guarantee the time validity and correctness of this part of the account book.
  • the user when determining the time service certificate, can also input the specified block height, and then query from the data block high school corresponding to the time service certificate, and know which time service certificate the block height falls into. , And query part of the account book corresponding to the time service certificate.
  • the timing certificate when determining the timing certificate, may also be directly obtained from the pre-established timing certificate index.
  • the database service provider can pre-establish a related database or index on the timing certificate.
  • the timing certificate index contains the corresponding relationship between the data block height, the hash value of the data block and the timing certificate, which can be based on the input Block height, directly obtain the corresponding timing certificate.
  • the verification refers to the steps performed in S403 to S405.
  • the time service certificate is generated corresponding to the full account book, that is, the last data block in the partial account book corresponding to the previous time service certificate is the last data block in the partial account book corresponding to the next time service certificate
  • the parent data block of the first data block for example, when each new data block has a corresponding time service certificate
  • the embodiment of this specification also provides a verification device for a ledger, as shown in FIG. 5, which is a schematic structural diagram of a verification device for a ledger provided by the embodiment of this specification, which is applied to store data through multiple data blocks
  • the device includes:
  • the determining module 501 determines at least one time service certificate, wherein any time service certificate corresponds to a continuous partial account book, and the time service certificate includes the starting point data block height, the end point data block height, the trusted timestamp, and all the parts of the account book.
  • the root hash of the part of the ledger is used to clarify the generation time of the part of the ledger;
  • the obtaining module 503 obtains the hash value of the data block from the height of the starting point data block to the height of the end data block, constructs the Merkel tree corresponding to the partial ledger, and determines the value of the Merkel tree Root hash
  • the verification module 505 verifies the consistency of the root hash of the partial ledger and the root hash of the Merkel tree;
  • each data block contains at least one data record
  • each data block contains the hash value of the previous data block and the data record contained in itself Determine the hash value of the own data block
  • the block height of the data block increases monotonically based on the sequence of the block time.
  • the verification module 505 determines the part of the ledger corresponding to each time service certificate, and the trusted timestamp contained in each time service certificate; according to the order of the trusted timestamps , To verify multiple partial ledgers in sequence.
  • the determining module 501 receives the block height of the input data, and obtains the timing certificate from the pre-established timing certificate index according to the block height; wherein, the timing certificate index includes the data block block height and the data block height. Correspondence between hash value and timing certificate.
  • a data block generation module 507 which receives the data records to be stored, and determines the hash value of each data record; when the preset blocking condition is reached, determines each data record to be written in the data block, and generates
  • the Nth data block of the block time of the block wherein the block height of the data block monotonically increases based on the sequence of the block time.
  • the target ledger contains at least one data block or a plurality of highly continuous data blocks; according to the number of data blocks in the target ledger In order of block height, a Merkel tree corresponding to the target ledger is generated, and the root hash of the Merkel tree is determined based on the block hash of each data block; the root hash of the Merkel tree is taken as The root hash of the target ledger sends the relevant information about the root hash and the data block to the time justice agency, where the relevant information about the data block includes the starting point data block height and the end point data block height; the receiving time justice agency The returned timing certificate corresponding to the target ledger, wherein the timing certificate includes the starting point data block height, the end point data block height, the trusted timestamp and the root hash of the target ledger of the target ledger.
  • the timing certificate generation module 509 determines each new data block as the target ledger; or, based on the starting point data block height and the end point data block height determined by the user's instruction, the starting point A segment of a continuous partial ledger whose data block is as high as the end point data block is taken as the target ledger.
  • the embodiment of this specification also provides a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the program shown in FIG. 4 when the program is executed.
  • a verification method for the ledger is also provided.
  • the device may include a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050.
  • the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040 realize the communication connection between each other in the device through the bus 1050.
  • the processor 1010 may be implemented in a general-purpose CPU (Central Processing Unit, central processing unit), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits for execution related Program to implement the technical solutions provided in the embodiments of this specification.
  • a general-purpose CPU Central Processing Unit, central processing unit
  • microprocessor microprocessor
  • application specific integrated circuit Application Specific Integrated Circuit, ASIC
  • ASIC Application Specific Integrated Circuit
  • the memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory, random access memory), static storage device, dynamic storage device, etc.
  • the memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of the present specification are implemented through software or firmware, related program codes are stored in the memory 1020 and called and executed by the processor 1010.
  • the input/output interface 1030 is used to connect an input/output module to realize information input and output.
  • the input/output/module can be configured in the device as a component (not shown in the figure), or can be connected to the device to provide corresponding functions.
  • the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and an output device may include a display, a speaker, a vibrator, an indicator light, and the like.
  • the communication interface 1040 is used to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices.
  • the communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
  • the bus 1050 includes a path to transmit information between various components of the device (for example, the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040).
  • the device may also include the necessary equipment for normal operation.
  • the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of the present specification, rather than all the components shown in the figures.
  • the embodiment of this specification also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method for verifying an account book shown in FIG. 4 is implemented.
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Computer Security & Cryptography (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Technology Law (AREA)
  • Software Systems (AREA)
  • Development Economics (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种账本的验证方法、装置及设备。在所述方法中,任一用户需要对块链式的账本进行审计或者验证时,可以通过以授时证书作为锚点,对锚点所对应的部分账本进行验证。由于该部分账本的时间戳是以授时证书作为可信证明的,基于授时证书的验证可以保障该部分账本的时间有效性和正确性。

Description

一种账本的验证方法、装置及设备 技术领域
本说明书实施例涉及信息技术领域,尤其涉及一种账本的验证方法、装置及设备。
背景技术
在块链式的账本中,数据难以被篡改。由于存储的经常是多方共同参与的所产生的数据,经常需要对于账本进行全量或者部分的验证。进行验证时,通常需要从创世块开始至目标数据块进行验证。但是在中心化的场景下,为躲避审计,存在业务方和数据库服务提供方联合做假账的可能。
基于此,需要一种有效的实现对于中心化场景下的块链式账本进行验证的方法。
发明内容
本申请实施例的目的是提供一种块链式账本中实现灵活验证的方法。
为解决上述技术问题,本申请实施例是这样实现的:
一种块链式账本的验证方法,应用于通过多个数据块存储数据的中心化的数据库服务提供方中,包括:
确定至少一个授时证书,其中,任一授时证书对应一段连续的部分账本,所述授时证书中包括所述部分账本的起点数据块高、终点数据块高、可信时间戳和所述部分账本的根哈希,用于明确所述部分账本的生成时间;
获取从所述起点数据块高至所述终点数据块高之间的数据块的哈希值,构建所述部分账本所对应的默克尔树,确定所述默克尔树的根哈希;
验证所述部分账本的根哈希和所述默克尔树的根哈希的一致性;
其中,在所述块链式账本中,除初始数据块以外,每一数据块中包含至少一条数据记录,每一数据块中包含由前一数据块的哈希值和自身所包含的数据记录确定的自身数据块的哈希值,数据块的块高基于成块时间的先后顺序单调递增。
对应的,本说明书实施例还提供一种块链式账本的验证装置,应用于通过多个数据块存储数据的中心化的数据库服务提供方中,所述装置包括:
确定模块,确定至少一个授时证书,其中,任一授时证书对应一段连续的部分账本,所述授时证书中包括所述部分账本的起点数据块高、终点数据块高、可信时间戳和所述部分账本的根哈希,用于明确所述部分账本的生成时间;
获取模块,获取从所述起点数据块高至所述终点数据块高之间的数据块的哈希值,构建所述部分账本所对应的默克尔树,确定所述默克尔树的根哈希;
验证模块,验证所述部分账本的根哈希和所述默克尔树的根哈希的一致性;
其中,在所述块链式账本中,除初始数据块以外,每一数据块中包含至少一条数据记录,每一数据块中包含由前一数据块的哈希值和自身所包含的数据记录确定的自身数据块的哈希值,数据块的块高基于成块时间的先后顺序单调递增。
在本申请实施例所提供的方案中,任一用户需要对块链式的账本进行审计或者验证时,可以通过以授时证书作为锚点,对锚点所对应的部分账本进行验证。由于该部分账本的时间戳是以授时证书作为可信证明的,基于授时证书的验证可以保障该部分账本的时间有效性和正确性。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。
此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。
附图说明
为了更清楚地说明本说明书实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。
图1当前技术中所涉及的系统架构的示意图;
图2为本说明书实施例所提供的一种伪链的示意图;
图3为本说明书实施例所提供的生成授时证书的一种流程示意图;
图4为本说明书实施例所提供的一种账本的验证方式的流程示意图;
图5是本说明书实施例所提供的一种账本的验证装置的结构示意图;
图6是用于配置本说明书实施例方法的一种设备的结构示意图。
具体实施方式
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。
以下结合附图,详细说明本说明书各实施例提供的技术方案。首先需要说明的是,本说明书中的数据库服务提供方是以中心化的形式提供数据服务。
在当前的服务器架构中,数据库服务器可以是直接对接的客户端个人用户,也可以是由一些应用服务器对接客户端个人用户,而数据库服务器则对接所述应用服务器。如图1所示,图1为所涉及的系统架构的示意图。
在本说明书实施例所涉及中心化的数据库服务提供方中,数据块通过如下方式预先生成:
接收待存储的数据记录,确定各数据记录的哈希值。此处的待存储的数据记录,可以是客户端个人用户的各种消费记录,也可以是应用服务器基于用户的指令,在执行业务逻辑时产生的业务结果、中间状态以及操作记录等等。具体的业务场景可以包括消费记录、审计日志、供应链条、政府监管记录、医疗记录等等。
当达到预设的成块条件时,确定待写入数据块中的各数据记录,生成包含数据块的哈希值和数据记录的第N个数据块。
所述预设的成块条件包括:待存储的数据记录数量达到数量阈值,例如,每接收到一千条数据记录时,生成一个新数据块,将一千条数据记录写入块中;或者,距离上一次成块时刻的时间间隔达到时间阈值,例如,每隔5分钟,生成一个新数据块,将在这5分钟内接收到的数据记录写入块中。
此处的N指的是数据块的序号,换言之,在本说明书实施例中,数据块是以块链的形式,基于成块时间的顺序先后排列,具有很强的时序特征。其中,数据块的块高基于成块时间的先后顺序单调递增。块高可以是序号,此时第N个数据块的块高即为N;块高也可以其它方式生成。
当N=1时,即此时的数据块为为初始数据块。初始数据块的哈希值和块高基于预设方式给定。例如,初始数据块中不包含数据记录,哈希值则为任一给定的哈希值,块 高blknum=0;又例如,初始数据块的生成触发条件与其它数据块的触发条件一致,但是初始数据块的哈希值由对初始数据块中的所有内容取哈希确定。
当N>1时,由于前一数据块的内容和哈希值已经确定,则此时,可以基于前一数据块(即第N-1个数据块)的哈希值生成当前数据块(第N个数据块)的哈希值,例如,一种可行的方式为,确定每一条将要写入第N个块中的数据记录的哈希值,按照在块中的排列顺序,生成一个默克尔树,将默克尔树的根哈希值和前一数据块的哈希值拼接在一起,再次采用哈希算法,生成当前块的哈希值。又例如,还可以按照块中数据记录的顺序进行拼接并取哈希得到整体数据记录的哈希值,拼接前一数据块的哈希值和整体数据记录的哈希值,并对拼接得到的字串进行哈希运算,生成数据块的哈希值。
通过前述的数据块的生成方式,每一个数据块通过哈希值确定,数据块的哈希值由数据块中的数据记录的内容、顺序以及前一数据块的哈希值决定。用户可以随时基于数据块的哈希值发起验证,对于数据块中任何内容(包括对于数据块中数据记录内容或者顺序的修改)的修改都会造成在验证时计算得到的数据块的哈希值和数据块生成时的哈希值不一致,而导致验证失败,从而实现了中心化下的不可篡改。
需要说明的是,在前述生成数据块时,成块时间一般是由数据库服务方给出的。
在上述方式中,虽然数据块中的数据已经不可篡改,但是如果第三方需要对该账本进行审计时,仍然存在如下可能性:数据库服务方和业务方联合起来从某个数据块开始,根据上述的生成方式,重新生成一条相关的伪链,从而形成一个与原账本部分相同的新的账本,躲避相关的审计和验证。如图2所示,图2为本说明书实施例所提供的一种伪链的示意图。生成伪链的过程中,数据块的成块方式和前述的成块方式相同。
在该示意图中,在账本已经记录了很多数据块之后,业务方认为第1000个数据块中的数据记录有问题,因此,为了不暴露该问题,其和数据库服务方联合起来,从第1000个数据块开始对数据块进行了替换,重新生成一个新的第1000个数据块,接在第999个数据块之后,形成一条与原账本部分相同的伪链,以躲避验证和审计,而在外部第三方而言并不能识别出伪链和真链。
基于此,本说明书实施例提供一种基于授时证书的对账本的验证方法,保证账本的有效性和正确性。
为便于理解,首先对授时证书的生成方式和包含内容进行说明。如图3所示,图3为本说明书实施例所提供的生成授时证书的一种流程示意图,包括如下步骤:
S301,确定需要进行授时认证的目标账本,所述目标账本中至少包含一个数据块,或者多个块高连续的数据块。
如前所述,在所述链式账本中,除初始数据块以外,每一数据块中包含至少一条数据记录,每一数据块中包含由前一数据块的哈希值和自身所包含的数据记录确定的自身数据块的哈希值,数据块的块高基于成块时间的先后顺序单调递增。
具体而言,服务方首先从已经生成并存储的数据块中确定出需要进行授时认证的一段账本,其中至少应该包含一个数据块,或者多个块高连续的数据块。确定的方式可以基于用户操作进行指定,例如,用户发起授时指令,指令中包含需要进行授时认证的起始块高和块数量;将所述部分账本作为目标账本。
目标账户也可以是无需用户指定,服务方基于预设的业务逻辑自动进行。例如,从最细粒度上,可以每一个数据块都去申请授时。在这种方式下,部分账本的默克尔树的根哈希即为该数据块的块哈希值,该方式可以最大程度的对账本(即各数据块)进行真实性的保护。由于数据块的出块频率较高,这种方式无论对于授时中心,还是对于服务方而言,成本开销都会比较大。
一种可选的方式为,设置一定的授时预设条件,当满足一定的授时预设条件时,发起授时请求。在新生成的数据块都认为是待授时认证的数据块时,所述的授时预设条件可以是:待授时认证的数据块达到数量阈值,或者,距离上一次授时认证的时间间隔已经到达时间阈值。
S303,按照所述目标账本中数据块的块高的顺序,生成对应于所述目标账本的默克尔树,基于各数据块的块哈希确定所述默克尔树的根哈希。
由于链式账本的前后依存性,此处生成的默克尔树只需按照各数据块的顺序进行生成即可。具体的根哈希的计算方式即为常规的计算方式,此处不再赘述。
S305,将所述默克尔树的根哈希作为目标账本的根哈希,将所述根哈希和数据块的相关信息发送至时间公正机构,其中,所述数据块的相关信息包括起点数据块高和终点数据块高;
时间公正机构可以是诸如国家授时中心,或者国家授时中心所授权的相应授时机构。时间公正机构接收到上述信息,即给出一个可信时间戳,并且对可信时间戳进行数字签名认证,生成一个包含可信时间戳和数字签名的授时证书,其中授时证书中还可以包含上述数据块的相关信息,数字签名的方式为常规的私钥加密、公钥解密即可。
S307,接收时间公正机构所返回的对应于所述目标账本的授时证书,其中,所述授时证书中包括所述目标账本的起点数据块高、终点数据块高、可信时间戳和所述目标账本的根哈希。
从而,数据库服务方可以接收到一连串的包含时间公正机构签名的可信授时证书,每一个授时证书中包含一个可信时间戳,且对应于一段账本。一个授时证书可以证明其对应的部分账本是在该可信时间戳之前生成的。通过授时证书中的相关信息可以明确的知道是哪部分账本。数据库服务方可以对一系列的授时证书进行相应的管理,以及验证。
例如,数据库服务方可以对每个授时证书进行顺序编号。建立一个关于授时证书的数据库或者索引。在数据库或者索引中包含有起始数据块高、结束数据块高、授时证书对应的部分账本的根哈希值和授时证书编号的对应关系表。
在获取了授时证书之后,即可以根据授时证书对账本进行验证。如图4所示,图4为本说明书实施例所提供的一种账本的验证方式的流程示意图,包括如下步骤:
S401,确定至少一个授时证书。
如前所述,任一授时证书对应一段连续的部分账本,所述授时证书中包括所述部分账本的起点数据块高、终点数据块高、可信时间戳和所述部分账本的根哈希,用于明确所述部分账本的生成时间;
在验证过程中,可以进行全量的验证,也可以进行抽查式的验证。在抽查式的验证方式下,可以随机的选取一个或者若干个授时证书,然后对每个授时证书所对应的部分账本进行验证。在全量的验证方式下,则需要获取全部的授时证书,按照授时证书的顺序进行全部的验证。
在一种实施方式中,还可以基于用户指定的时间确定对应的授时证书。例如,基于实际需要,确定在某一段时间[a,b]内产生的账本是存在问题的,需要审计。则可以获取所包含的可信时间戳落入上述区间的授时证书,作为待验证的对象。或者,对于一个指定的时间点,可以获取可信时间戳与指定的时间点的间隔小于预设值的授时证书,作为待验证的对象。
一个授时证书可唯一的确定该授时证书所对应的部分账本,该部分账本的起点数据块高和终点数据块高已经被包含在授时证书中。并且,由于授时证书中还包含了可信时间戳,如果发现部分账本中所包含的数据记录中的时间戳在可信时间戳之后,或者,授时证书中的可信时间戳与相邻的授时证书的间隔差异过大,则可以直接认定该部分账 本是存在问题的。
例如,授时证书2中所包含的可信时间戳为20xx年6月1日0点0分0秒,假设对于该账本而言,平均约10分钟就会申请得到一个授时证书。
现发现,授时证书2的前一个授时证书1的可信时间戳是20xx年3月1日0点0分0秒,则可以知道授时证书2所对应的部分账本的生成时间距离前部分账本的生成时间间隔太久,有可能是一条伪链。
或者,发现授时证书2中的某些数据块中包含的数据记录的时间戳在20xx年7月1日0点0分0秒,则说明授时证书所明确的时间反而出现在业务数据的时间之前,这也是有问题的。总之,授时证书的可信时间戳可以用于明确所述部分账本的生成时间,进而用于验证该授时证书所对应的部分账本的时间一致性。
S403,获取从所述起点数据块高至所述终点数据块高之间的数据块的哈希值,构建所述部分账本所对应的默克尔树,确定所述默克尔树的根哈希。
对于一个授时证书所对应的部分账本,由于每个数据块是可以计算得到自身数据块的哈希值,如果该部分账本的时间一致性没有问题,则可以进一步的构建该部分账本所对应的默克尔树(Merkle Tree),在默克尔树中,每个叶子节点即为一个数据块的块哈希,从而可以得到该默克尔树的根哈希。
S405,验证所述部分账本的根哈希和所述默克尔树的根哈希的一致性。
由于授时证书中的部分账本的根哈希的计算方式和默克尔树的根哈希的计算方式相同,因此,在该部分账本中的数据记录没有被修改的情形下,部分账本的根哈希和所述默克尔树的根哈希是一致的。对于部分账本的任意修改,显然都会导致二者的不一致。因此,通过上述方式可以验证授时证书所对应的部分账本的正确性。
在本申请实施例所提供的方案中,任一用户需要对块链式的账本进行审计或者验证时,可以通过以授时证书作为锚点,对锚点所对应的部分账本进行验证。由于该部分账本的时间戳是以授时证书作为可信证明的,基于授时证书的验证可以保障该部分账本的时间有效性和正确性。
在一种实施例中,确定授时证书时,还可以由用户输入指定的块高,进而从授时证书所对应的数据块高中进行查询,可得知该块高落入了哪一个授时证书的范围,并对该授时证书所对应的部分账本查询。
在一种实施例中,确定授时证书时,还可以直接从预先建立的授时证书索引中获取授时证书。如前所述,数据库服务提供方可以预先建立相关的一个关于授时证书的数据库或者索引,授时证书索引中包含数据块块高、数据块哈希值和授时证书的对应关系,从而可以基于输入的块高,直接获取对应的授时证书。
在一种实施例中,如果需要对多个授时证书分别对应的部分账本进行验证,还可以首先确定每个授时证书所包含的可信时间戳;根据所述可信时间戳的顺序,依次对多个部分账本依序进行验证。从而,如果排序在前的某个授时证书所对应的部分账本出现了验证错误,则可以直接不再验证后续的部分账本。此处的验证即指的是前述S403至S405所执行的步骤。
在一种实施例中,如果在生成授时证书时是对应于全量账本的,即前一授时证书所对应的部分账本中的最后一个数据块,是后一授时证书中所对应的部分账本中的最前的一个数据块的父数据块时(例如,每一个新出的数据块都有一个对应的授时证书时),还可以基于全部的授时证书的顺序,以授时证书为锚点将全量账本分割为多个部分账本,依序对多个部分账本进行验证。此处的验证即指的是前述S403至S405所执行的步骤。
对应的,本说明书实施例还提供一种账本的验证装置,如图5所示,图5是本说明书实施例提供的一种账本的验证装置的结构示意图,应用于通过多个数据块存储数据的中心化的数据库服务提供方中,所述装置包括:
确定模块501,确定至少一个授时证书,其中,任一授时证书对应一段连续的部分账本,所述授时证书中包括所述部分账本的起点数据块高、终点数据块高、可信时间戳和所述部分账本的根哈希,用于明确所述部分账本的生成时间;
获取模块503,获取从所述起点数据块高至所述终点数据块高之间的数据块的哈希值,构建所述部分账本所对应的默克尔树,确定所述默克尔树的根哈希;
验证模块505,验证所述部分账本的根哈希和所述默克尔树的根哈希的一致性;
其中,在所述块链式账本中,除初始数据块以外,每一数据块中包含至少一条数据记录,每一数据块中包含由前一数据块的哈希值和自身所包含的数据记录确定的自身数据块的哈希值,数据块的块高基于成块时间的先后顺序单调递增。
进一步地,当存在多个授时证书时,所述验证模块505,确定每个授时证书分别对应的部分账本,以及每个授时证书所包含的可信时间戳;根据所述可信时间戳的顺序,对多个部分账本依序进行验证。
进一步地,所述确定模块501,接收输入数据块块高,根据所述块高从预先建立的授时证书索引中获取授时证书;其中,在所述授时证书索引中包含数据块块高、数据块哈希值和授时证书的对应关系。
进一步地,还包括数据块生成模块507,接收待存储的数据记录,确定各数据记录的哈希值;当达到预设的成块条件时,确定待写入数据块中的各数据记录,生成包含数据块的哈希值和数据记录的第N个数据块,具体包括:当N=1时,初始数据块的哈希值和块高基于预设方式给定;当N>1时,根据待写入数据块中的各数据记录和第N-1个数据块的哈希值确定第N个数据块的哈希值,生成包含第N个数据块的哈希值、各数据记录和数据块的成块时间的第N个数据块,其中,数据块的块高基于成块时间的先后顺序单调递增。
进一步地,还包括授时证书生成模块509,确定需要进行授时认证的目标账本,所述目标账本中至少包含一个数据块,或者多个块高连续的数据块;按照所述目标账本中数据块的块高的顺序,生成对应于所述目标账本的默克尔树,基于各数据块的块哈希确定所述默克尔树的根哈希;将所述默克尔树的根哈希作为目标账本的根哈希,将所述根哈希和数据块的相关信息发送至时间公正机构,其中,所述数据块的相关信息包括起点数据块高和终点数据块高;接收时间公正机构所返回的对应于所述目标账本的授时证书,其中,所述授时证书中包括所述目标账本的起点数据块高、终点数据块高、可信时间戳和所述目标账本的根哈希。
进一步地,所述授时证书生成模块509,将每一个新出的数据块确定为目标账本;或者,基于用户的指令所确定的起点数据块高和所述终点数据块高,确定从所述起点数据块高至所述终点数据块高的一段连续的部分账本,将所述部分账本作为目标账本。
本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图4所示的一种账本的验证方法。
图6示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。
处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处 理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。
存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。
输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。
通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。
总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。
需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图4所示的一种账本的验证方法。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存 储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。
上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于方法实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的方法实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。

Claims (13)

  1. 一种账本的验证方法,应用于通过多个数据块存储数据的中心化的数据库服务提供方中,包括:
    确定至少一个授时证书,其中,任一授时证书对应一段连续的部分账本,所述授时证书中包括所述部分账本的起点数据块高、终点数据块高、可信时间戳和所述部分账本的根哈希,用于明确所述部分账本的生成时间;
    获取从所述起点数据块高至所述终点数据块高之间的数据块的哈希值,构建所述部分账本所对应的默克尔树,确定所述默克尔树的根哈希;
    验证所述部分账本的根哈希和所述默克尔树的根哈希的一致性;
    其中,在所述块链式账本中,除初始数据块以外,每一数据块中包含至少一条数据记录,每一数据块中包含由前一数据块的哈希值和自身所包含的数据记录确定的自身数据块的哈希值,数据块的块高基于成块时间的先后顺序单调递增。
  2. 如权利要求1所述的方法,当存在多个授时证书时,所述方法还包括:
    确定每个授时证书分别对应的部分账本,以及每个授时证书所包含的可信时间戳;
    根据所述可信时间戳的顺序,对多个部分账本依序进行验证。
  3. 如权利要求1所述的方法,确定至少一个授时证书,包括:
    接收输入的数据块块高,根据所述块高从预先建立的授时证书索引中获取授时证书;
    其中,在所述授时证书索引中包含数据块块高、数据块哈希值和授时证书的对应关系。
  4. 如权利要求1所述的方法,所述在中心化的数据库服务提供方,数据块通过如下方式预先生成:
    接收待存储的数据记录,确定各数据记录的哈希值;
    当达到预设的成块条件时,确定待写入数据块中的各数据记录,生成包含数据块的哈希值和数据记录的第N个数据块,具体包括:
    当N=1时,初始数据块的哈希值和块高基于预设方式给定;
    当N>1时,根据待写入数据块中的各数据记录和第N-1个数据块的哈希值确定第N个数据块的哈希值,生成包含第N个数据块的哈希值、各数据记录和数据块的成块时间的第N个数据块,其中,数据块的块高基于成块时间的先后顺序单调递增。
  5. 如权利要求1所述的方法,所述授时证书通过如下方式预先生成:
    确定需要进行授时认证的目标账本,所述目标账本中至少包含一个数据块,或者多个块高连续的数据块;
    按照所述目标账本中数据块的块高的顺序,生成对应于所述目标账本的默克尔树,基于各数据块的块哈希确定所述默克尔树的根哈希;
    将所述默克尔树的根哈希作为目标账本的根哈希,将所述根哈希和数据块的相关信息发送至时间公正机构,其中,所述数据块的相关信息包括起点数据块高和终点数据块高;
    接收时间公正机构所返回的对应于所述目标账本的授时证书,其中,所述授时证书中包括所述目标账本的起点数据块高、终点数据块高、可信时间戳和所述目标账本的根哈希。
  6. 如权利要求5所述的方法,确定需要进行授时认证的目标账本,包括:
    将每一个新出的数据块确定为目标账本;或者,
    基于用户的指令所确定的起点数据块高和所述终点数据块高,确定从所述起点数据块高至所述终点数据块高的一段连续的部分账本,将所述部分账本作为目标账本。
  7. 一种账本的验证装置,应用于通过多个数据块存储数据的中心化的数据库服务提供方中,所述装置包括:
    确定模块,确定至少一个授时证书,其中,任一授时证书对应一段连续的部分账本,所述授时证书中包括所述部分账本的起点数据块高、终点数据块高、可信时间戳和所述部分账本的根哈希,用于明确所述部分账本的生成时间;
    获取模块,获取从所述起点数据块高至所述终点数据块高之间的数据块的哈希值,构建所述部分账本所对应的默克尔树,确定所述默克尔树的根哈希;
    验证模块,验证所述部分账本的根哈希和所述默克尔树的根哈希的一致性;
    其中,在所述块链式账本中,除初始数据块以外,每一数据块中包含至少一条数据记录,每一数据块中包含由前一数据块的哈希值和自身所包含的数据记录确定的自身数据块的哈希值,数据块的块高基于成块时间的先后顺序单调递增。
  8. 如权利要求7所述的装置,当存在多个授时证书时,所述验证模块,确定每个授时证书分别对应的部分账本,以及每个授时证书所包含的可信时间戳;根据所述可信时间戳的顺序,对多个部分账本依序进行验证。
  9. 如权利要求7所述的装置,所述确定模块,接收输入数据块块高,根据所述块高从预先建立的授时证书索引中获取授时证书;其中,在所述授时证书索引中包含数据块块高、数据块哈希值和授时证书的对应关系。
  10. 如权利要求7所述的装置,还包括数据块生成模块,接收待存储的数据记录,确定各数据记录的哈希值;当达到预设的成块条件时,确定待写入数据块中的各数据记 录,生成包含数据块的哈希值和数据记录的第N个数据块,具体包括:当N=1时,初始数据块的哈希值和块高基于预设方式给定;当N>1时,根据待写入数据块中的各数据记录和第N-1个数据块的哈希值确定第N个数据块的哈希值,生成包含第N个数据块的哈希值、各数据记录和数据块的成块时间的第N个数据块,其中,数据块的块高基于成块时间的先后顺序单调递增。
  11. 如权利要求7所述的装置,还包括授时证书生成模块,确定需要进行授时认证的目标账本,所述目标账本中至少包含一个数据块,或者多个块高连续的数据块;按照所述目标账本中数据块的块高的顺序,生成对应于所述目标账本的默克尔树,基于各数据块的块哈希确定所述默克尔树的根哈希;将所述默克尔树的根哈希作为目标账本的根哈希,将所述根哈希和数据块的相关信息发送至时间公正机构,其中,所述数据块的相关信息包括起点数据块高和终点数据块高;接收时间公正机构所返回的对应于所述目标账本的授时证书,其中,所述授时证书中包括所述目标账本的起点数据块高、终点数据块高、可信时间戳和所述目标账本的根哈希。
  12. 如权利要求11所述的装置,所述授时证书生成模块,将每一个新出的数据块确定为目标账本;或者,基于用户的指令所确定的起点数据块高和所述终点数据块高,确定从所述起点数据块高至所述终点数据块高的一段连续的部分账本,将所述部分账本作为目标账本。
  13. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1至6任一项所述的方法。
PCT/CN2020/071183 2019-04-04 2020-01-09 一种账本的验证方法、装置及设备 WO2020199710A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/815,882 US10790968B2 (en) 2019-04-04 2020-03-11 Ledger verification method and apparatus, and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910272426.5A CN110163602A (zh) 2019-04-04 2019-04-04 一种账本的验证方法、装置及设备
CN201910272426.5 2019-04-04

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/815,882 Continuation US10790968B2 (en) 2019-04-04 2020-03-11 Ledger verification method and apparatus, and device

Publications (1)

Publication Number Publication Date
WO2020199710A1 true WO2020199710A1 (zh) 2020-10-08

Family

ID=67638996

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/071183 WO2020199710A1 (zh) 2019-04-04 2020-01-09 一种账本的验证方法、装置及设备

Country Status (2)

Country Link
CN (1) CN110163602A (zh)
WO (1) WO2020199710A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10917231B2 (en) 2019-04-04 2021-02-09 Advanced New Technologies Co., Ltd. Data storage method, apparatus, system and device
CN110163602A (zh) * 2019-04-04 2019-08-23 阿里巴巴集团控股有限公司 一种账本的验证方法、装置及设备
CN112364383B (zh) * 2021-01-12 2021-04-27 支付宝(杭州)信息技术有限公司 一种业务记录真实性验证方法
CN112364384B (zh) * 2021-01-12 2021-04-23 支付宝(杭州)信息技术有限公司 一种基于可信账本数据库的业务记录授时方法
CN113590890B (zh) * 2021-08-04 2024-03-26 拉卡拉支付股份有限公司 信息存储方法、装置、电子设备、存储介质及程序产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110276490A1 (en) * 2010-05-07 2011-11-10 Microsoft Corporation Security service level agreements with publicly verifiable proofs of compliance
CN106548091A (zh) * 2016-10-14 2017-03-29 北京爱接力科技发展有限公司 一种数据存证、验证的方法及装置
CN107729383A (zh) * 2017-09-18 2018-02-23 联动优势科技有限公司 一种索引库生成方法、数据验证方法、装置及平台
CN109101572A (zh) * 2018-07-17 2018-12-28 何晓行 基于区块链的存证方法、装置及服务器、存储介质
CN109493043A (zh) * 2018-10-30 2019-03-19 广州品唯软件有限公司 交易记录区块化方法、装置、电子设备及存储介质
CN110163602A (zh) * 2019-04-04 2019-08-23 阿里巴巴集团控股有限公司 一种账本的验证方法、装置及设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790954B (zh) * 2016-03-02 2019-04-09 布比(北京)网络技术有限公司 一种构建电子证据的方法和系统
US10097344B2 (en) * 2016-07-15 2018-10-09 Mastercard International Incorporated Method and system for partitioned blockchains and enhanced privacy for permissioned blockchains
CN106357701B (zh) * 2016-11-25 2019-03-26 西安电子科技大学 云存储中数据的完整性验证方法
CN108540291B (zh) * 2018-03-23 2020-08-04 西安电子科技大学 基于身份的云存储中数据完整性验证方法
CN109308211B (zh) * 2018-09-11 2021-04-23 上海点融信息科技有限责任公司 用于在区块链中处理事务数据的方法、装置及存储介质
CN109508984B (zh) * 2018-11-26 2021-09-07 中国科学院软件研究所 一种基于确定性共识与可信时间戳的区块链电子存证方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110276490A1 (en) * 2010-05-07 2011-11-10 Microsoft Corporation Security service level agreements with publicly verifiable proofs of compliance
CN106548091A (zh) * 2016-10-14 2017-03-29 北京爱接力科技发展有限公司 一种数据存证、验证的方法及装置
CN107729383A (zh) * 2017-09-18 2018-02-23 联动优势科技有限公司 一种索引库生成方法、数据验证方法、装置及平台
CN109101572A (zh) * 2018-07-17 2018-12-28 何晓行 基于区块链的存证方法、装置及服务器、存储介质
CN109493043A (zh) * 2018-10-30 2019-03-19 广州品唯软件有限公司 交易记录区块化方法、装置、电子设备及存储介质
CN110163602A (zh) * 2019-04-04 2019-08-23 阿里巴巴集团控股有限公司 一种账本的验证方法、装置及设备

Also Published As

Publication number Publication date
CN110163602A (zh) 2019-08-23

Similar Documents

Publication Publication Date Title
WO2020199710A1 (zh) 一种账本的验证方法、装置及设备
WO2020211496A1 (zh) 一种块链式账本中的签名验证方法、系统、装置及设备
US11057220B2 (en) Signature verification for a blockchain ledger
CN110457898B (zh) 基于可信执行环境的操作记录存储方法、装置及设备
WO2020199708A1 (zh) 一种针对授时证书生成请求的监控方法、装置及设备
WO2020233149A1 (zh) 一种块链式账本中的授时认证方法、装置及设备
CN113726751B (zh) 一种块链式账本中的权重管理方法、装置及设备
WO2020258858A1 (zh) 块链式账本中的授权方法、系统、装置及设备
WO2020199713A1 (zh) 数据验证方法、系统、装置及设备
WO2020199711A1 (zh) 数据存储方法、系统、装置及设备
US10790968B2 (en) Ledger verification method and apparatus, and device
WO2020244236A1 (zh) 一种块链式账本的授时认证方法、装置及设备
US11108573B2 (en) Blockchain ledger authentication
WO2020211493A1 (zh) 一种块链式账本中的数据验证方法、系统、装置及设备
WO2021000578A1 (zh) 一种块链式账本中的用户创建方法、装置及设备
CN114039733B (zh) 一种针对联盟链的存证业务转移方法、装置及设备
US10979233B2 (en) Monitoring time certificate generation requests
US10771241B2 (en) Time authentication method, apparatus and device in blockchain-type ledger
CN111292082B (zh) 一种块链式账本中的公钥管理方法、装置及设备
CN112380573B (zh) 一种块链式账本中的数字签名方法、装置及设备

Legal Events

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

Ref document number: 20784164

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20784164

Country of ref document: EP

Kind code of ref document: A1