WO2021073240A1 - 一种块链式账本中的数据存储方法、装置及设备 - Google Patents

一种块链式账本中的数据存储方法、装置及设备 Download PDF

Info

Publication number
WO2021073240A1
WO2021073240A1 PCT/CN2020/109256 CN2020109256W WO2021073240A1 WO 2021073240 A1 WO2021073240 A1 WO 2021073240A1 CN 2020109256 W CN2020109256 W CN 2020109256W WO 2021073240 A1 WO2021073240 A1 WO 2021073240A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
block
data block
data record
written
Prior art date
Application number
PCT/CN2020/109256
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 蚂蚁区块链科技(上海)有限公司
Publication of WO2021073240A1 publication Critical patent/WO2021073240A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • the embodiments of this specification relate to the field of information technology, and in particular to a data storage method, device, and equipment in a block chain ledger.
  • a data block in the ledger usually needs to store multiple data records. During this process, service interruption may occur, which will result in data loss and affect customer experience.
  • the purpose of the embodiments of the present application is to provide a data storage solution that is not affected by interruption in a block chain ledger.
  • a data storage method in a block chain ledger is applied to a database server that stores data records in a block chain ledger.
  • the method includes: receiving data records to be stored and determining the hash value of each data record, wherein , The data record contains business attributes; determine each data record to be written in the data block, and the location information of each data record in the data block, where the location information includes the block height of the data block where the data record is located, and , The offset in the data block in which it is located; write the data record and the location information to the database log and store it persistently; when the preset block condition is reached, a hash containing the data block is generated The Nth data block of the value and data record.
  • the embodiment of this specification also provides a data storage device in a block chain ledger, which is applied to a database server that stores data records in a block chain ledger.
  • the device includes: a receiving module that receives data to be stored Record, determine the hash value of each data record, where the data record contains the business attribute; the determining module, determine each data record to be written in the data block, and the location information of each data record in the data block, where the The location information includes the block height of the data block where the data record is located, and the offset in the data block where the data record is located; the storage module writes the data record and the location information into the database log and stores it persistently ; Blocking module, when the preset blocking condition is reached, it generates the Nth data block containing the hash value of the data block and the data record.
  • the data record that has been confirmed to be written into the data block and its location information are written into the database log in advance, so that the database can be interrupted in blocks Then, the location information of the data record is re-acquired, and the block is re-formed according to the location information, avoiding data loss that may be caused by data interruption, and improving user experience.
  • any one of the embodiments of the present specification does not need to achieve all the above-mentioned effects.
  • Figure 1 is a schematic diagram of the system architecture involved in an embodiment of the specification
  • FIG. 2 is a schematic flowchart of a data storage method in a block chain ledger provided by an embodiment of this specification
  • FIG. 3 is a schematic diagram of a block header of a data block provided by an embodiment of this specification.
  • FIG. 4 is a schematic structural diagram of a data storage device in a block chain ledger provided by an embodiment of this specification
  • Fig. 5 is a schematic structural diagram of a device for configuring the method of the embodiment of this specification.
  • FIG. 1 is a schematic diagram of a system architecture involved in an embodiment of the specification.
  • an enterprise organization can face multiple users, and each user can query the database service provider through its corresponding enterprise organization.
  • the organization connected to the database server is a financial product company, and the data records can be individual users’ financial management records in the financial product company; or, the connected organization can be a government department, where the data records are what the government department has for the department. Expense details of the managed public project; or, the database server is connected to a hospital, and the data record is the patient’s medical record; or the database server is connected to a third-party payment agency, and the data record can be an individual user Payment records through the agency, and so on.
  • the block-forming process of the block chain ledger in order to improve the speed of reading and writing, usually user data is written in the memory or cache of the server. For example, if the block-forming condition is that 100 data records produce one block, the database server has already 80 data records sent by the user are received, the 80 data will be written into the memory or cache first, and the remaining 20 data records will be waited for. This may cause block interruption (such as server downtime, Power failure, etc.), so that data loss may occur.
  • the data server needs to wait for the block to be generated before giving the user feedback. In this process, the user needs to wait all the time, and the user experience is not good.
  • the embodiment of the present specification provides a data storage solution that is not affected by interruption in a blockchain ledger.
  • FIG. 2 is a schematic flowchart of a method for storing data in a block-chain ledger provided by an embodiment of this specification, and the process specifically includes steps S201 to S207.
  • S201 Receive a data record to be stored, and determine a hash value of each data record, where the data record contains business attributes.
  • the data records to be stored here 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.
  • the business attribute is generally unique in the interface organization.
  • the business attributes are based on different business scenarios and can include user names, user ID numbers, and driver’s licenses. Number, mobile phone number, project unique number, type of data record (such as financial package number), etc.
  • the data record is the user's consumption record
  • the business attribute at this time is the user ID (including mobile phone number, ID number, user name, etc.), or the user ID is hashed
  • the hash value obtained by the algorithm; or, for government agencies, the data record is the overhead flow of multiple public projects, then the business attribute at this time can be a unique number for each project.
  • Business attributes can be stored in a specified location in the data record, such as the head or tail of the data record.
  • S203 Determine each data record to be written in the data block and location information of each data record in the data block.
  • Each data record to be written in the data block is the data record received by the user during the block period determined based on the block condition.
  • the preset blocking 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 distance
  • the time interval of 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.
  • Each time a data record is received during the block formation period it can be regarded as a data record to be written into the data block.
  • a ledger In a blockchain ledger, a ledger is composed of multiple data blocks, and at the same time, a data block usually contains multiple data records. Therefore, in the embodiment of this specification, the location information specifically refers to which data block in the ledger is located when a data record is saved, and where it is in the data block.
  • the hash value of the data block is a hash value obtained by hash calculation based on the previous block's hash value and its own data record, which can be used to uniquely and unambiguously identify a data block.
  • the block height of the first data block is 0, and the block height is increased by 1 for each additional data block; or, the block time of the data block can be converted into a large monotonic increase Integer data (usually 12 to 15 bits) sequence, as the block height of the data block. Therefore, a data block usually has a clear block height.
  • the order of the data records has also been fixed, so the serial number of a data record in the data block is also clear.
  • the sequence number can also be used to clarify the location information of the data record in the data block in which it is located. That is, the sequence number can also be used to indicate the offset of the data recorded in the data block.
  • the address offset of each data record in the data block can also be used to identify the data records in the data block respectively.
  • the address offset of each data record is not the same.
  • the specific format of the data block can be customized (for example, the metadata information and remark information contained in the block header of the data block, and the block height of the data block is adopted Format, etc.), in different formats, the content of the location information will also be different, which does not constitute a limitation to this solution.
  • the offset sequence number of a data record to be written in a data block in the data block can be determined in sequence according to the time when the data record is received by the database server.
  • the database log sequentially records the data records and location information contained in a ledger.
  • the content of a record can be in the form of "data record + block height + offset”.
  • the database log can also be written according to the block height, that is, the write is sequentially performed according to the block height, so that the data records of the same block height will be written together.
  • the block height can also be identified in the database log: block has been formed or not.
  • the records corresponding to the block heights that have been blocked can be cleared appropriately (for example, clearing the records that have been blocked and have exceeded 24 hours in the log) to reduce the space occupied by the database log.
  • the persistent storage is to store the database log in the callable database space or disk file.
  • the preset blocking 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.
  • N 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 strong timing characteristics.
  • 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.
  • the block height of the Nth data block is N; the block height can also be generated in other ways, for example, the block time symmetric encryption is converted into large integer data (for example, 12-bit or 15-bit Integer) as the block height.
  • 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 order in the block.
  • 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.
  • the data block generated in the above manner may include two parts: a block header and a block body.
  • the block body can be used to store the plaintext of the spliced data, or the hash value of the spliced data, etc.;
  • the block header can be used to store metadata about the data block, for example, the version number of the ledger, the hash of the previous data block Value, the root hash value of the Merkel tree composed of the spliced data in the own data block, the hash value of the own data block, the state array used to record the operated state of the spliced data, and so on.
  • FIG. 3 is a schematic diagram of a block header of a data block provided by an embodiment of this specification.
  • the hash value of the corresponding data record and the hash value of the data block can be obtained and saved, and integrity verification can be initiated based on the hash value.
  • the specific verification method is to recalculate the hash value of the data record itself and the hash value of the data block in the database, and compare with the locally stored hash value.
  • each data block is determined by a hash value
  • the hash value of the data block is determined by the content and order 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 content of the data block (including the modification of the data record content or sequence in the data block) will result in the hash value of the data block calculated during verification.
  • 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.
  • a segment of data block is designated for continuous integrity verification, or continuous integrity verification is performed from the initial data block.
  • the verification method is to obtain the hash value of the previous data block, and use the same algorithm as when generating the hash value of the data block, and recalculate its own data according to its own data record and the hash value of the previous data block.
  • the hash value of the block for verification is to obtain the hash value of the previous data block, and use the same algorithm as when generating the hash value of the data block, and recalculate its own data according to its own data record and the hash value of the previous data block.
  • the block is interrupted during the block forming period, and the data in the memory is lost, at this time, after the database service is restarted, the data record of the data block to be written and its corresponding location information can be obtained from the database log; The data record is written into the Nth data block according to the location information.
  • the data block has not been formally formed, the content contained in it has actually been partially determined.
  • the location information of a data record is "block height 100+offset 10"
  • the 10th record of the data needs to be written into the data recording.
  • the data record that has been confirmed to be written into the data block and its location information are written into the database log in advance, so that the database can be interrupted in blocks Then, the location information of the data record is re-acquired, and the block is re-formed according to the location information, avoiding data loss that may be caused by data interruption, and improving user experience.
  • an inverted index can also be created in advance.
  • the primary key is the business attribute contained in the data record
  • the value is the data record corresponding to the business attribute.
  • Location information The specific creation method is, for any determined data record to be written into the data block, obtain the business attribute contained in the data record; establish the corresponding relationship between the business attribute and location information, and write it into the memory; After the Nth data block is generated, the corresponding relationship is read from the memory, and the index with the business attribute field as the main key is written.
  • Table 1 is an exemplary index table provided in the embodiment of this specification.
  • the Key is the specific value of the business attribute, and each array in the Value part is a piece of position information.
  • the first part of each array is the block height, and the latter part is the serial number of the data recorded in the data block, passing the block height and serial number That is, a data record can be uniquely determined. It is easy to understand that in the index table, a key can correspond to multiple location information.
  • the business attributes of the data records and the storage location in the ledger are determined, the corresponding relationship between the two is established, and the business attribute is created as the main key. Sort index, without knowing the user's business details, from the index, you can perform corresponding statistics on data records based on business attributes, as well as subsequent query and verification.
  • the creation of the index can only be performed after the ledger has been generated, otherwise there will be a data error that the location information provided in the index does not exist in the block chain ledger.
  • the corresponding relationship built in the same memory will also be lost. Therefore, if the block is interrupted, the data record and its location information can also be obtained from the database log after the database service is restarted. , And re-establish the corresponding relationship between the business attribute and the location information, and the corresponding relationship can still be written in the memory; after the Nth data block is generated, an index with the business attribute as the primary key is written.
  • confirmation information can be sent to the sender of the data record, and the confirmation information is used to indicate that the data record has been written into the block chain ledger.
  • the confirmation information may include the hash value of the data record, location information, and the digital signature of the database server, etc. In this way, the waiting time of the user is avoided, and the user experience is improved.
  • the embodiment of this specification also provides a data storage device in a block chain ledger, which is applied to a database server that stores data records in a block chain ledger, as shown in FIG. 4, which is an embodiment of this specification.
  • a structural schematic diagram of a data storage device in a block chain ledger is provided, and the device includes the following modules.
  • the receiving module 401 receives the data records to be stored, and determines the hash value of each data record, where the data record contains business attributes.
  • the determining module 403 determines each data record to be written in the data block and the location information of each data record in the data block, where the location information includes the block height of the data block where the data record is located, and the location The offset in the data block.
  • the storage module 405 writes the data record and the location information into the database log, and stores it persistently.
  • the blocking module 407 when the preset blocking condition is reached, generates the Nth data block including the hash value of the data block and the data record.
  • the device further includes an index creation module 409, for any determined data record to be written in the data block, obtain the business attribute contained in the data record; establish the corresponding relationship between the business attribute and the location information, And write it into the memory; after the Nth data block is generated, read the corresponding relationship from the memory, and write the index with the business attribute field as the primary key.
  • an index creation module 409 for any determined data record to be written in the data block, obtain the business attribute contained in the data record; establish the corresponding relationship between the business attribute and the location information, And write it into the memory; after the Nth data block is generated, read the corresponding relationship from the memory, and write the index with the business attribute field as the primary key.
  • the block forming module 407 obtains the data to be written in the data block from the database log Record and its corresponding location information; write the data record into the Nth data block according to the location information.
  • the index creation module 409 obtains the business attribute of the data record to be written into the data block in the database log and its corresponding location information; establishes the corresponding relationship between the business attribute and the location information; After the Nth data block, an index with the business attribute as the primary key is written.
  • the data block The block height increases monotonically based on the sequence of the block time.
  • the preset blocking condition includes: the number of data records to be stored reaches the number threshold; or, the time interval from the last blocking time reaches the time threshold.
  • the device also includes a return module 411 for returning confirmation information to the sender of the data record for the data record that has been written in the database log, the confirmation information is used to indicate that the data record has been written into the blockchain ledger .
  • the embodiments of this specification also provide a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the data shown in FIG. 2 when the program is executed. Storage method.
  • FIG. 5 shows a more specific hardware structure diagram of a computing device provided by an embodiment of this specification.
  • 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 by a general CPU (Central Processing Unit, central processing unit), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for execution related Program to realize the technical solutions provided in the embodiments of this specification.
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • the memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (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 this specification are implemented by 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 it 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.
  • 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 above device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include the equipment necessary for normal operation. Other components.
  • the above-mentioned device may also include only the components necessary to implement the solutions of the embodiments of the present specification, and not necessarily include 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 data storage method shown in FIG. 2 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)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种块链式账本中的数据存储方法、装置及设备。通过所提供的方案,在块链式账本中生成数据块时,预先将已经确认要写入数据块的数据记录以及其位置信息写入数据库日志,从而可以在数据库成块被中断后重新获取数据记录的位置信息,并且根据位置信息重新成块。

Description

一种块链式账本中的数据存储方法、装置及设备 技术领域
本说明书实施例涉及信息技术领域,尤其涉及一种块链式账本中的数据存储方法、装置及设备。
背景技术
在数据库服务端以块链式的账本对外提供中心化的服务时,账本中的一个数据块通常需要存储多条数据记录。在这个过程中,有可能发生服务被中断的情形,将会导致数据丢失,影响客户体验。
基于此,需要一种在块链式账本中不受中断影响的数据存储方案。
发明内容
本申请实施例的目的是提供一种在块链式账本中不受中断影响的数据存储方案。
为解决上述技术问题,本申请实施例是通过以下实现的。
一种块链式账本中的数据存储方法,应用于以块链式账本存储数据记录的数据库服务端中,所述方法包括:接收待存储的数据记录,确定各数据记录的哈希值,其中,数据记录中包含业务属性;确定待写入数据块中的各数据记录,以及各数据记录在数据块的位置信息,其中,所述位置信息包括数据记录所处的数据块的块高,以及,在所处的数据块中的偏移量;将所述数据记录以及所述位置信息写入数据库日志,并持久化存储;当达到预设的成块条件时,生成包含数据块的哈希值和数据记录的第N个数据块。
对应的,本说明书实施例还提供一种块链式账本中的数据存储装置,应用于以块链式账本存储数据记录的数据库服务端中,所述装置包括:接收模块,接收待存储的数据记录,确定各数据记录的哈希值,其中,数据记录中包含业务属性;确定模块,确定待写入数据块中的各数据记录,以及各数据记录在数据块的位置信息,其中,所述位置信息包括数据记录所处的数据块的块高,以及,在所处的数据块中的偏移量;存储模块,将所述数据记录以及所述位置信息写入数据库日志,并持久化存储;成块模块,当达到预设的成块条件时,生成包含数据块的哈希值和数据记录的第N个数据块。
通过本说明书实施例所提供的方案,在块链式账本中生成数据块时,预先将已经确 认要写入数据块的数据记录以及其位置信息写入数据库日志,从而可以在数据库成块被中断后重新获取数据记录的位置信息,并且根据位置信息重新成块,避免了数据中断有可能导致的数据丢失,提高了用户体验。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。
此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。
附图说明
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。
图1为本说明书实施例所涉及的系统架构示意图;
图2是本说明书实施例提供的一种块链式账本中的数据存储方法的流程示意图;
图3为本说明书实施例所提供的一种数据块的块头的示意图;
图4是本说明书实施例提供的一种块链式账本中的数据存储装置的结构示意图;
图5是用于配置本说明书实施例方法的一种设备的结构示意图。
具体实施方式
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。
首先对本说明书实施例中所涉及的块链式账本进行说明。数据库服务端面向的常常为各种机构,各机构则可以将它们与第三方用户(包括其它机构或者个人)之间所产生的数据记录在数据库服务方进行存储。如图1所示,图1为本说明书实施例所涉及的系统架构示意图。在该示意图中,一个企业机构可以面向多名用户,而每个用户均可以通过其对应的企业机构向数据库服务提供方进行查询。
例如,数据库服务端对接的机构是某金融产品公司,数据记录可以是个人用户在该金融产品公司的理财记录;或者,对接的机构可以是政府部门,其中的数据记录是政府部门对于该部门所管理的公共项目的开销明细;或者,数据库服务方对接的机构是某个医院,其中的数据记录是病人的病历;或者,数据库服务方对接的机构是第三方支付机构,数据记录可以是个人用户通过该机构的支付记录,等等。
在块链式账本的成块过程中,为了提高读写速度,通常用户数据都是写在服务器的内存或者缓存中,例如,假设成块条件是100条数据记录出一个块,数据库服务端已经接收到了用户所发来的80条数据记录,那么这80条数据就会先写入内存或者缓存,并等待剩余的20条数据记录,这样就有可能发生成块被中断(例如服务器宕机,断电等等),从而有可能发生数据丢失。同时在另一方面,用户发来的数据记录以后,数据服务端需要等待出块以后才能给与用户反馈,在这个过程中,用户需要一直等待,用户体验不佳。
基于此,本说明书实施例提供一种在块链式账本中不受中断影响的数据存储方案。
以下结合附图,详细说明本说明书各实施例提供的技术方案。如图2所示,图2是本说明书实施例提供的一种块链式账本中的数据存储方法的流程示意图,该流程具体包括步骤S201至S207。
S201,接收待存储的数据记录,确定各数据记录的哈希值,其中,数据记录中包含业务属性。
此处的待存储的数据记录,可以是客户端个人用户的各种消费记录,也可以是应用服务器基于用户的指令,在执行业务逻辑时产生的业务结果、中间状态以及操作记录等等。具体的业务场景可以包括消费记录、审计日志、供应链条、政府监管记录、医疗记录等等。
在每个与数据库服务方对接的机构中,所述业务属性在所述对接机构中,一般而言是唯一存在的,业务属性基于不同的业务场景,可以包括用户名、用户身份证号、驾照编号、手机号、项目唯一编号、数据记录的类型(例如金融包编号)等等。
例如,对于第三方支付机构而言,数据记录是用户的消费记录,此时的业务属性即为用户标识(包括手机号、身份证号、用户名等等),或者对该用户标识进行哈希算法所得到的哈希值;或者,对于政府机构而言,数据记录为多个公共项目的开销流水,则此时的业务属性可以为每个项目的唯一编号。
业务属性可以存储在数据记录中的指定位置,例如数据记录的头部或者尾部。
S203,确定待写入数据块中的各数据记录,以及各数据记录在数据块的位置信息。
待写入数据块中的各数据记录即为在基于成块条件所确定的成块期间所接受到的用户发送的数据记录。预设的成块条件包括:待存储的数据记录数量达到数量阈值,例如,每接收到一千条数据记录时,生成一个新数据块,将一千条数据记录写入块中;或者,距离上一次成块时刻的时间间隔达到时间阈值,例如,每隔5分钟,生成一个新数据块,将在这5分钟内接收到的数据记录写入块中。在成块期间每接收到到一条数据记录,均可以将其视为待写入数据块的数据记录。
在块链式账本中,一个账本由多个数据块组成,同时,一个数据块中通常包含多个数据记录。因此,在本说明书实施例中,所述的位置信息具体指的是一条数据记录被保存时,处于账本中的哪个数据块上,以及,在该数据块中的什么位置。
在本说明书实施例所提供的数据块中,可以有多种方式用来标识不同的数据块,包括数据块的哈希值或者块高。
数据块的哈希值为根据前一区块哈希值和自身数据记录进行哈希计算而得到的哈希值,可以用于唯一、明确地标识一个数据块。在块链式的账本中,通常第一个数据块其块高为0,以后每增加一个数据块,块高加1;或者,还可以将数据块的成块时间转换为一个大的单调递增整型数据(一般为12至15位)序列,作为数据块的块高。因此,一个数据块通常有一个明确的块高。
又例如,在一个已经确定的要写入数据库的数据块,其中数据记录的排序也已经固定,因此一个数据记录在该数据块中的序号也是明确的,在数据记录的长度为固定单位时,序号同样可以用于明确该数据记录在其所处的数据块中的位置信息。即,序号同样也可以用于指示数据记录在数据块中的偏移量。
同时,在一个数据块中,由于通常包含了多个数据记录,因此,还可以用各数据记录在该数据块中的地址偏移量来分别标识数据块中的数据记录。显而易见,在同一个数据块中,各数据记录的地址偏移量并不相同。
当然,由于在本说明书实施例所提供的方式中,数据块的具体格式是可以自定义的(例如,数据块的块头中所包含的元数据信息和备注信息,数据块的块高所采取的形式等等),在不同的格式下,位置信息的内容也会有所不同,这并不构成对本方案的限定。
一条待写入数据块的数据记录在数据块中的偏移序号可以根据数据库服务端接收到 数据记录的时间依序确定。
S205,将所述数据记录以及所述位置信息写入数据库日志,并持久化存储。
具体而言,数据库日志中依序记载了一个账本中所包含的数据记录和位置信息。在数据库日志中,一条记录的内容可以是如“数据记录+块高+偏移量”的形式。
为了便于查询,数据库日志中还可以根据块高进行写入,即,根据块高依序进行写入,从而同一块高的数据记录将会被集中写入在一起。
同时数据库日志中还可以对块高进行标识:已成块或者未成块。对于已成块的块高所对应的记录,可以适当的进行清除(例如,对于日志中已成块且已超过24小时的记录进行清除),以降低数据库日志的占用空间。
所处的持久化存储即将数据库日志存储在可调用的数据库空间或者磁盘文件中。
S207,当达到预设的成块条件时,生成包含数据块的哈希值和数据记录的第N个数据块。
所述预设的成块条件包括:待存储的数据记录数量达到数量阈值,例如,每接收到一千条数据记录时,生成一个新数据块,将一千条数据记录写入块中;或者,距离上一次成块时刻的时间间隔达到时间阈值,例如,每隔5分钟,生成一个新数据块,将在这5分钟内接收到的数据记录写入块中。
此处的N指的是数据块的序号,换言之,在本说明书实施例中,数据块是以块链的形式,基于成块时间的顺序先后排列,具有很强的时序特征。其中,数据块的块高基于成块时间的先后顺序单调递增。块高可以是序号,此时第N个数据块的块高即为N;块高也可以其它方式生成,例如,将成块时间对称加密转换为大整型数据(例如,12位或者15位的整数)作为块高。
当N=1时,即此时的数据块为为初始数据块。初始数据块的哈希值和块高基于预设方式给定。例如,初始数据块中不包含数据记录,哈希值则为任一给定的哈希值,块高blknum=0;又例如,初始数据块的生成触发条件与其它数据块的触发条件一致,但是初始数据块的哈希值由对初始数据块中的所有内容取哈希确定。
当N>1时,由于前一数据块的内容和哈希值已经确定,则此时,可以基于前一数据块(即第N-1个数据块)的哈希值生成当前数据块(第N个数据块)的哈希值,例如,一种可行的方式为,确定每一条将要写入第N个块中的数据记录的哈希值,按照在块中 的排列顺序,生成一个默克尔树,将默克尔树的根哈希值和前一数据块的哈希值拼接在一起,再次采用哈希算法,生成当前块的哈希值。又例如,还可以按照块中数据记录的顺序进行拼接并取哈希得到整体数据记录的哈希值,拼接前一数据块的哈希值和整体数据记录的哈希值,并对拼接得到的字串进行哈希运算,生成数据块的哈希值。
上述方式生成的数据块,可以包括块头和块体两个部分。块体中可以用于存储拼接数据的明文,或者拼接数据的哈希值等等;块头中可以用于存储有关本数据块的元数据,例如,账本的版本号,前一数据块的哈希值,自身数据块中的拼接数据所组成的默克尔树的根哈希值,自身数据块的哈希值,用于记录拼接数据的被操作状态的状态数组等等。如图3所示,图3为本说明书实施例所提供的一种数据块的块头的示意图。
用户在上传数据成功后,即可以得到对应的数据记录的哈希值以及所处的数据块的哈希值,并保存,并且可以基于该哈希值发起完整性验证。具体的验证方式即为在数据库中重新计算数据记录自身的哈希值以及所处的数据块的哈希值,与本地所保存的进行对比。
通过前述的数据块的生成方式,每一个数据块通过哈希值确定,数据块的哈希值由数据块中的数据记录的内容、顺序以及前一数据块的哈希值决定。用户可以随时基于数据块的哈希值发起验证,对于数据块中任何内容(包括对于数据块中数据记录内容或者顺序的修改)的修改都会造成在验证时计算得到的数据块的哈希值和数据块生成时的哈希值不一致,而导致验证失败,从而实现了中心化下的不可篡改。
在对于块链式的账本进行验证时,一般而言,即指定一段数据块进行连续的完整性验证,或者从初始数据块开始进行连续的完整性验证。验证的方式即为获取前一数据块的哈希值,并采用与生成数据块的哈希值时的同样算法,根据自身的数据记录和前一数据块的哈希值,重新计算一遍自身数据块的哈希值,以进行验证。
进一步地,如果在成块期间,成块被中断,内存中的数据丢失,此时在数据库服务重启之后,可以从所述数据库日志获取待写入数据块的数据记录和其对应的位置信息;根据所述位置信息将所述数据记录写入第N个数据块。
换言之,在这种情形下,数据块虽然还未正式形成,但是实际上其内部所包含的内容已经部分确定。假设在数据库日志中,一条数据记录的位置信息为“块高100+偏移10”,那么在重启之后,在第100个数据块成块时,其中的第10条记录就需要写入该数据记录。
通过本说明书实施例所提供的方案,在块链式账本中生成数据块时,预先将已经确认要写入数据块的数据记录以及其位置信息写入数据库日志,从而可以在数据库成块被中断后重新获取数据记录的位置信息,并且根据位置信息重新成块,避免了数据中断有可能导致的数据丢失,提高了用户体验。
在本说明书的一种实施例中,为了提高查询效率,还可以预先创建一种倒排索引,在该索引中,主键是数据记录中所包含的业务属性,值为业务属性所对应的数据记录的位置信息。具体的创建方式即为,对于任一已经确定的待写入数据块的数据记录,获取该数据记录所包含的业务属性;建立所述业务属性和位置信息的对应关系,并写入内存;在生成所述第N个数据块之后,从内存中读取所述对应关系,写入以所述业务属性字段为主键的索引。
如表1所示,表1为本说明书实施例所提供的一种示例性索引表。其中Key即为业务属性的具体值,Value部分的每个数组即为一条位置信息,每个数组中的前部分块高,后部分为数据记录在该数据块中的序号,通过块高和序号即可以唯一的确定一条数据记录。容易理解,在索引表中,一个key可以对应于多个位置信息。
表1
Key Value
0X123456 (2,08),(2,10),(300,89),(300,999)
344X0001 (5,01),(8,22)
…… ……
通过本说明书实施例所提供的方案,对于写入账本的数据记录,确定出数据记录的业务属性,以及在账本中的存储位置,建立起二者的对应关系,创建以业务属性为主键的倒排索引,不必了解用户的业务详情,从索引中即可以基于业务属性对于数据记录进行相应统计,以及后续的查询和验证。
容易理解,在这种实施方式下,索引的创建需要等待账本出块之后才可以进行,否则将会发生索引中所提供的位置信息在块链式账本中并不存在的数据错误。
因此,如果成块服务被中断,那么同样内存中所构建的对应关系同样会丢失,因此如果成块被中断,此时在数据库服务重启之后,也可以从数据库日志中获取数据记录及其位置信息,并且重新建立所述业务属性和位置信息的对应关系,该对应关系依然可以 写在内存中;在生成所述第N个数据块之后,写入以所述业务属性为主键的索引。
在本说明书的一种实施例中,对于接受到的数据记录,如果确定其内容和位置信息已经写入了数据库日志,那么就表明该数据记录在账本中的位置已经确定,并且能够保证即使服务中断该数据记录也一定会被写入账本中,因此,此时可以发送确认信息至数据记录的发送方,所述确认信息用于表征数据记录已经被写入块链式账本中。确认信息中可以包含有该数据记录的哈希值、位置信息,以及数据库服务端的数字签名等等。通过这种方式,避免了用户的等待时间,提高了用户体验。
对应的,本说明书实施例还提供一种块链式账本中的数据存储装置,应用于以块链式账本存储数据记录的数据库服务端中,如图4所示,图4是本说明书实施例提供的一种块链式账本中的数据存储装置的结构示意图,所述装置包括如下模块。
接收模块401,接收待存储的数据记录,确定各数据记录的哈希值,其中,数据记录中包含业务属性。
确定模块403,确定待写入数据块中的各数据记录,以及各数据记录在数据块的位置信息,其中,所述位置信息包括数据记录所处的数据块的块高,以及,在所处的数据块中的偏移量。
存储模块405,将所述数据记录以及所述位置信息写入数据库日志,并持久化存储。
成块模块407,当达到预设的成块条件时,生成包含数据块的哈希值和数据记录的第N个数据块。
进一步地,所述装置还包括索引创建模块409,针对任一已经确定的待写入数据块的数据记录,获取该数据记录所包含的业务属性;建立所述业务属性和位置信息的对应关系,并写入内存;在生成所述第N个数据块之后,从内存中读取所述对应关系,写入以所述业务属性字段为主键的索引。
进一步地,在所述装置中,若生成包含数据块的哈希值和数据记录的第N个数据块被中断,所述成块模块407,从所述数据库日志获取待写入数据块的数据记录和其对应的位置信息;根据所述位置信息将所述数据记录写入第N个数据块。
进一步地,所述索引创建模块409,从所述数据库日志中待写入数据块的数据记录的业务属性,以及其对应的位置信息;建立所述业务属性和位置信息的对应关系;在生成所述第N个数据块之后,写入以所述业务属性为主键的索引。
进一步地,所述成块模块407,当N=1时,初始数据块的哈希值和块高基于预设方式给定;当N>1时,根据待写入数据块中的各数据记录和第N-1个数据块的哈希值确定第N个数据块的哈希值,生成包含第N个数据块的哈希值和各数据记录的第N个数据块,其中,数据块的块高基于成块时间的先后顺序单调递增。
进一步地,在所述装置中,所述预设的成块条件包括:待存储的数据记录数量达到数量阈值;或者,距离上一次成块时刻的时间间隔达到时间阈值。
进一步地,所述装置还包括返回模块411,针对已经写入数据库日志的数据记录,返回确认信息至数据记录的发送方,所述确认信息用于表征数据记录已经被写入块链式账本中。
本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图2所示的数据存储方法。
图5示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器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,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图2所示的数据存储方法。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。
上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于方法实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的方法实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。

Claims (15)

  1. 一种块链式账本中的数据存储方法,应用于以块链式账本存储数据记录的数据库服务端中,所述方法包括:
    接收待存储的数据记录,确定各数据记录的哈希值,其中,数据记录中包含业务属性;
    确定待写入数据块中的各数据记录,以及各数据记录在数据块的位置信息,其中,所述位置信息包括数据记录所处的数据块的块高,以及,在所处的数据块中的偏移量;
    将所述数据记录以及所述位置信息写入数据库日志,并持久化存储;
    当达到预设的成块条件时,生成包含数据块的哈希值和数据记录的第N个数据块。
  2. 如权利要求1所述的方法,所述方法还包括:
    针对任一已经确定的待写入数据块的数据记录,获取该数据记录所包含的业务属性;
    建立所述业务属性和位置信息的对应关系,并写入内存;
    在生成所述第N个数据块之后,从内存中读取所述对应关系,写入以所述业务属性字段为主键的索引。
  3. 如权利要求1所述的方法,若生成包含数据块的哈希值和数据记录的第N个数据块被中断,所述方法还包括:
    从所述数据库日志获取待写入数据块的数据记录和其对应的位置信息;
    根据所述位置信息将所述数据记录写入第N个数据块。
  4. 如权利要求2所述的方法,还包括:
    从所述数据库日志中待写入数据块的数据记录的业务属性,以及其对应的位置信息;
    建立所述业务属性和位置信息的对应关系;
    在生成所述第N个数据块之后,写入以所述业务属性为主键的索引。
  5. 如权利要求1所述的方法,生成包含数据块的哈希值和数据记录的第N个数据块,具体包括:
    当N=1时,初始数据块的哈希值和块高基于预设方式给定;
    当N>1时,根据待写入数据块中的各数据记录和第N-1个数据块的哈希值确定第N个数据块的哈希值,生成包含第N个数据块的哈希值和各数据记录的第N个数据块,其中,数据块的块高基于成块时间的先后顺序单调递增。
  6. 如权利要求5所述的方法,所述预设的成块条件包括:
    待存储的数据记录数量达到数量阈值;或者,距离上一次成块时刻的时间间隔达到时间阈值。
  7. 如权利要求1所述的方法,所述方法还包括:
    针对已经写入数据库日志的数据记录,返回确认信息至数据记录的发送方,所述确认信息用于表征数据记录已经被写入块链式账本中。
  8. 一种块链式账本中的数据存储装置,应用于以块链式账本存储数据记录的数据库服务端中,所述装置包括:
    接收模块,接收待存储的数据记录,确定各数据记录的哈希值,其中,数据记录中包含业务属性;
    确定模块,确定待写入数据块中的各数据记录,以及各数据记录在数据块的位置信息,其中,所述位置信息包括数据记录所处的数据块的块高,以及,在所处的数据块中的偏移量;
    存储模块,将所述数据记录以及所述位置信息写入数据库日志,并持久化存储;
    成块模块,当达到预设的成块条件时,生成包含数据块的哈希值和数据记录的第N个数据块。
  9. 如权利要求8所述的装置,还包括索引创建模块,针对任一已经确定的待写入数据块的数据记录,获取该数据记录所包含的业务属性;建立所述业务属性和位置信息的对应关系,并写入内存;在生成所述第N个数据块之后,从内存中读取所述对应关系,写入以所述业务属性字段为主键的索引。
  10. 如权利要求8所述的装置,若生成包含数据块的哈希值和数据记录的第N个数据块被中断,所述成块模块,从所述数据库日志获取待写入数据块的数据记录和其对应的位置信息;根据所述位置信息将所述数据记录写入第N个数据块。
  11. 如权利要求9所述的装置,所述索引创建模块,从所述数据库日志中待写入数据块的数据记录的业务属性,以及其对应的位置信息;建立所述业务属性和位置信息的对应关系;在生成所述第N个数据块之后,写入以所述业务属性为主键的索引。
  12. 如权利要求8所述的装置,所述成块模块,当N=1时,初始数据块的哈希值和块高基于预设方式给定;当N>1时,根据待写入数据块中的各数据记录和第N-1个数据块的哈希值确定第N个数据块的哈希值,生成包含第N个数据块的哈希值和各数据记录的第N个数据块,其中,数据块的块高基于成块时间的先后顺序单调递增。
  13. 如权利要求12所述的装置,所述预设的成块条件包括:待存储的数据记录数量达到数量阈值;或者,距离上一次成块时刻的时间间隔达到时间阈值。
  14. 如权利要求8所述的装置,还包括返回模块,针对已经写入数据库日志的数据记录,返回确认信息至数据记录的发送方,所述确认信息用于表征数据记录已经被写入 块链式账本中。
  15. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1至7任一项所述的方法。
PCT/CN2020/109256 2019-10-18 2020-08-14 一种块链式账本中的数据存储方法、装置及设备 WO2021073240A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910992806.6 2019-10-18
CN201910992806.6A CN110837502B (zh) 2019-10-18 2019-10-18 一种块链式账本中的数据存储方法、装置及设备

Publications (1)

Publication Number Publication Date
WO2021073240A1 true WO2021073240A1 (zh) 2021-04-22

Family

ID=69575416

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/109256 WO2021073240A1 (zh) 2019-10-18 2020-08-14 一种块链式账本中的数据存储方法、装置及设备

Country Status (2)

Country Link
CN (1) CN110837502B (zh)
WO (1) WO2021073240A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837502B (zh) * 2019-10-18 2021-03-12 蚂蚁区块链科技(上海)有限公司 一种块链式账本中的数据存储方法、装置及设备
CN111444216A (zh) * 2020-06-15 2020-07-24 支付宝(杭州)信息技术有限公司 一种基于中心化块链式账本的数据块删除方法
CN112507014B (zh) * 2021-02-07 2021-06-04 支付宝(杭州)信息技术有限公司 一种基于可信账本数据库的数据存储方法、装置及系统
CN113190176B (zh) * 2021-05-11 2023-01-10 上海华东汽车信息技术有限公司 一种数据存储方法、装置、电子设备及存储介质
CN116304390B (zh) * 2023-04-13 2024-02-13 北京基调网络股份有限公司 时序数据处理方法、装置、存储介质及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012793A (zh) * 2010-11-12 2011-04-13 浪潮(北京)电子信息产业有限公司 镜像实现方法和装置
CN109960601A (zh) * 2017-12-26 2019-07-02 航天信息股份有限公司 一种业务数据的恢复方法、装置和电子设备
CN110008743A (zh) * 2019-03-26 2019-07-12 阿里巴巴集团控股有限公司 一种块链式账本中的数据属性标识方法、装置及设备
CN110837502A (zh) * 2019-10-18 2020-02-25 支付宝(杭州)信息技术有限公司 一种块链式账本中的数据存储方法、装置及设备

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10129238B2 (en) * 2016-02-10 2018-11-13 Bank Of America Corporation System for control of secure access and communication with different process data networks with separate security features
CN107122682B (zh) * 2017-04-20 2019-02-05 杭州铜板街互联网金融信息服务有限公司 基于区块链存储的数据处理方法及系统
US10320574B2 (en) * 2017-05-05 2019-06-11 International Business Machines Corporation Blockchain for open scientific research
US11281644B2 (en) * 2017-07-28 2022-03-22 Hitachi, Ltd. Blockchain logging of data from multiple systems
CN109614806A (zh) * 2018-12-03 2019-04-12 北京工业大学 基于区块链的日志管理系统
CN109636390A (zh) * 2018-12-19 2019-04-16 谭宜勇 一种基于区块链智能合约的sto实施方法及系统
CN110059084B (zh) * 2019-01-31 2023-08-01 创新先进技术有限公司 一种数据存储方法、装置及设备
CN109902071B (zh) * 2019-01-31 2020-06-30 阿里巴巴集团控股有限公司 业务日志存储方法、系统、装置及设备
CN110188096B (zh) * 2019-04-18 2021-08-17 创新先进技术有限公司 一种数据记录的索引创建方法、装置及设备
CN110162526B (zh) * 2019-04-18 2023-02-24 创新先进技术有限公司 一种块链式账本中数据记录的查询方法、装置及设备
CN110162662B (zh) * 2019-04-18 2023-02-28 创新先进技术有限公司 一种块链式账本中数据记录的验证方法、装置及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012793A (zh) * 2010-11-12 2011-04-13 浪潮(北京)电子信息产业有限公司 镜像实现方法和装置
CN109960601A (zh) * 2017-12-26 2019-07-02 航天信息股份有限公司 一种业务数据的恢复方法、装置和电子设备
CN110008743A (zh) * 2019-03-26 2019-07-12 阿里巴巴集团控股有限公司 一种块链式账本中的数据属性标识方法、装置及设备
CN110837502A (zh) * 2019-10-18 2020-02-25 支付宝(杭州)信息技术有限公司 一种块链式账本中的数据存储方法、装置及设备

Also Published As

Publication number Publication date
CN110837502A (zh) 2020-02-25
CN110837502B (zh) 2021-03-12

Similar Documents

Publication Publication Date Title
WO2021073240A1 (zh) 一种块链式账本中的数据存储方法、装置及设备
WO2021073242A1 (zh) 索引创建和数据查询方法、装置及设备
CN110188096B (zh) 一种数据记录的索引创建方法、装置及设备
WO2020211569A1 (zh) 一种数据记录的索引创建方法
CN110162662B (zh) 一种块链式账本中数据记录的验证方法、装置及设备
CN110162526B (zh) 一种块链式账本中数据记录的查询方法、装置及设备
WO2021017422A1 (zh) 一种块链式账本中的索引创建方法、装置及设备
WO2020244237A1 (zh) 一种块链式账本中的验证方法、装置及设备
WO2020244239A1 (zh) 一种基于业务标识的索引创建方法、装置及设备
WO2021093461A1 (zh) 一种块链式账本中的聚合计算方法、装置及设备
WO2020253231A1 (zh) 一种基于收据的数据存储方法、装置及设备
WO2020244238A1 (zh) 多层块链式账本的数据存储方法、装置及设备
WO2021057164A1 (zh) 一种块链式账本中的查询方法、装置及设备
US10999062B2 (en) Blockchain-type data storage
WO2021000578A1 (zh) 一种块链式账本中的用户创建方法、装置及设备
WO2021073241A1 (zh) 一种基于磁盘存储的数据读取方法、装置及设备
US11126751B2 (en) Index creation for data records
WO2021057127A1 (zh) 一种基于多条业务属性的数据存储方法、装置及设备
WO2021093462A1 (zh) 一种数据库中的操作记录存储方法、装置及设备
CN110362570B (zh) 一种数据存储方法、装置及设备
CN110636042B (zh) 一种服务端已验证块高的更新方法、装置及设备
WO2021057220A1 (zh) 一种块链式账本中的权限管理方法、装置及设备
US11115189B2 (en) Verifying a blockchain-type ledger
WO2021057183A1 (zh) 一种块链式账本中的权限移交方法、装置及设备
CN111444194B (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: 20876364

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: 20876364

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20876364

Country of ref document: EP

Kind code of ref document: A1