[go: up one dir, main page]

CN111444216A - Data block deleting method based on centralized block chain type account book - Google Patents

Data block deleting method based on centralized block chain type account book Download PDF

Info

Publication number
CN111444216A
CN111444216A CN202010544110.XA CN202010544110A CN111444216A CN 111444216 A CN111444216 A CN 111444216A CN 202010544110 A CN202010544110 A CN 202010544110A CN 111444216 A CN111444216 A CN 111444216A
Authority
CN
China
Prior art keywords
block
deleted
data
user account
centralized
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010544110.XA
Other languages
Chinese (zh)
Inventor
杨新颖
汪晟
张渊
李飞飞
高群
俞本权
李亿泽
闫文远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010544110.XA priority Critical patent/CN111444216A/en
Publication of CN111444216A publication Critical patent/CN111444216A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0633Managing shopping lists, e.g. compiling or processing purchase lists
    • G06Q30/0635Managing shopping lists, e.g. compiling or processing purchase lists replenishment orders; recurring orders
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/12Hotels or restaurants

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Primary Health Care (AREA)
  • Human Resources & Organizations (AREA)
  • Technology Law (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data block deleting method based on a centralized block chain type account book is disclosed. When any user wants to delete historical data which is submitted to the centralized block chain type account book before the user, a block deletion request can be sent to the database server side, and the database server side is requested to delete the database containing the historical data specified by the user from the centralized block chain type account book. Because there is coupling between the data blocks adjacent to each other in the ledger, the data blocks are usually deleted from the created data block in sequence, and after deletion, the created data block needs to be regenerated to keep the block hash of the ledger configuration information and the last deleted data block. In addition, considering that the data block includes not only the history data submitted by the user, but also the history data submitted by other users, the deletion operation can be performed after the signature confirmation of each user involved in the data block to be deleted is collected.

Description

一种基于中心化块链式账本的数据块删除方法A data block deletion method based on a centralized blockchain ledger

技术领域technical field

本说明书实施例涉及信息技术领域,尤其涉及一种基于中心化块链式账本的数据块删除方法。The embodiments of this specification relate to the field of information technology, and in particular, to a method for deleting data blocks based on a centralized blockchain ledger.

背景技术Background technique

中心化块链式账本,区别于去中心化的块链式账本(如区块链网络中各节点分布式维护的区块链),是指中心化的数据库服务端维护的本地数据库。有时,也将中心化块链式账本称为Ledger Data Base(Ledger DB)。The centralized blockchain ledger, which is different from the decentralized blockchain ledger (such as the blockchain that is distributed and maintained by each node in the blockchain network), refers to the local database maintained by the centralized database server. Sometimes, the centralized blockchain ledger is also referred to as the Ledger Data Base (Ledger DB).

中心化块链式账本是在区块链存储方案的基础上进行改进得到的新型存储方案,其能够克服了区块链存储存在的吞吐量低、响应时间长等问题。中心化块链式账本的服务对象通常是企业级用户,用户一般在数据库服务端注册账户,并通过账户将自身业务产生的业务数据封装成业务交易,将业务交易提交给数据库服务端,数据库服务端基于一定的成块策略,将若干业务交易打包成数据块写入中心化块链式账本进行存储。The centralized blockchain ledger is a new storage solution improved on the basis of the blockchain storage solution, which can overcome the problems of low throughput and long response time of blockchain storage. The service object of the centralized blockchain ledger is usually enterprise-level users. Users generally register an account on the database server, and encapsulate the business data generated by their own business into business transactions through the account, and submit the business transaction to the database server. The database service Based on a certain block-forming strategy, the terminal packages several business transactions into data blocks and writes them to the centralized block chain ledger for storage.

中心化块链式账本中,类似于传统的区块链,数据块间按照成块时间先后顺序依次链接,每个数据块中携带有本数据块中各业务交易构成的梅克尔树的根哈希值,此外,后一个数据块的块头中携带有前一个数据块的块哈希(即对块头进行哈希计算得到的哈希值),如此确保中心化块链式账本中的业务交易无法被轻易篡改。还需要说明的是,中心化块链式账本中序号为1的数据块(即第一个数据库)为创世数据块,其中一般会携带中心化块链式账本的配置信息(如账本创建时间,账本维护方信息、账本有效期等)。In the centralized block chain ledger, similar to the traditional block chain, the data blocks are linked in sequence according to the block time sequence, and each data block carries the root of the Merkle tree composed of the business transactions in the data block. Hash value, in addition, the block header of the next data block carries the block hash of the previous data block (that is, the hash value obtained by hashing the block header), thus ensuring business transactions in the centralized block chain ledger cannot be easily tampered with. It should also be noted that the data block with serial number 1 (ie the first database) in the centralized blockchain ledger is the creation data block, which generally carries the configuration information of the centralized blockchain ledger (such as the creation time of the ledger). , account book maintainer information, account book validity period, etc.).

在实际应用中,有时用户想要将其拥有的产生时间过于久远的业务数据从中心化块链式账本中删除,从而节约需要支付给数据库服务端的存储费用。为此,需要一种基于中心化块链式账本的数据块删除方法。In practical applications, sometimes users want to delete their business data that has been generated for too long from the centralized blockchain ledger, thereby saving the storage fee that needs to be paid to the database server. To this end, a data block deletion method based on a centralized blockchain ledger is required.

发明内容SUMMARY OF THE INVENTION

本申请实施例是为了解决现有的中心化块链式账本不支持删除数据库的技术问题而提出的。The embodiments of the present application are proposed to solve the technical problem that the existing centralized blockchain ledger does not support deleting the database.

为解决上述技术问题,本申请实施例是这样实现的:In order to solve the above-mentioned technical problems, the embodiments of the present application are implemented as follows:

根据本说明书实施例的第1方面,提供一种基于中心化块链式账本的数据块删除方法,应用于数据库服务端,所述数据库服务端维护有中心化块链式账本,所述方法包括:According to the first aspect of the embodiments of this specification, a method for deleting data blocks based on a centralized block chain ledger is provided, which is applied to a database server, where the database server maintains a centralized block chain ledger, and the method includes: :

接收任一用户账户发送的块删除请求;Receive block delete requests sent by any user account;

确定所述块删除请求指定的待删除数据块集合;所述待删除数据块集合包括序号为1至序号为N的N个待删除数据块,N>1;Determine the set of data blocks to be deleted specified by the block deletion request; the set of data blocks to be deleted includes N data blocks to be deleted with sequence numbers from 1 to N, and N>1;

根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户;According to each transaction corresponding to the set of data blocks to be deleted, determine the relevant at least one other user account;

获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名;Obtain the signature generated by the user account for the block deletion request; and obtain the signature generated by each other user account for the block deletion request;

在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,重新生成创世数据块;其中,重新生成的创世数据块中包含原创世数据块携带的账本配置信息与第N个待删除数据块对应的块哈希。After it is determined that all signatures are obtained, the set of data blocks to be deleted is deleted from the centralized blockchain ledger, and the creation data block is regenerated; wherein, the regenerated creation data block contains the original creation data block carrying The ledger configuration information of , and the block hash corresponding to the Nth data block to be deleted.

根据本说明书实施例的第2方面,提供一种基于中心化块链式账本的数据块删除装置,应用于数据库服务端,所述数据库服务端维护有中心化块链式账本,所述装置包括:According to a second aspect of the embodiments of this specification, a data block deletion device based on a centralized blockchain ledger is provided, which is applied to a database server, where the database server maintains a centralized blockchain ledger, and the device includes :

接收模块,接收任一用户账户发送的块删除请求;The receiving module receives the block deletion request sent by any user account;

第一确定模块,确定所述块删除请求指定的待删除数据块集合;所述待删除数据块集合包括序号为1至序号为N的N个待删除数据块,N>1;a first determining module, which determines a set of data blocks to be deleted specified by the block deletion request; the set of data blocks to be deleted includes N data blocks to be deleted with sequence numbers from 1 to N, and N>1;

第二确定模块,根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户;The second determination module, according to each transaction corresponding to the set of data blocks to be deleted, determines the relevant at least one other user account;

获取模块,获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名;acquiring module, acquiring the signature generated by the user account for the block deletion request; and acquiring the signature generated by each other user account for the block deletion request;

删除模块,在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,重新生成创世数据块;其中,重新生成的创世数据块中包含原创世数据块携带的账本配置信息与第N个待删除数据块对应的块哈希。The deletion module, after confirming that all signatures are obtained, deletes the set of data blocks to be deleted from the centralized block chain ledger, and regenerates the creation data block; wherein, the regenerated creation data block contains the original creation data block. The ledger configuration information carried by the data block and the block hash corresponding to the Nth data block to be deleted.

通过本说明书实施例中所提供的方案,任一用户想要删除自己之前提交给中心化块链式账本历史数据时,可以向数据库服务端发送块删除请求,请求数据库服务端从中心化块链式账本中删除包含该用户指定的历史数据的数据库。由于账本中前后相邻的数据块之间存在耦合性,因此,通常需要从创世数据块开始依次向后删除,删除之后,还需要重新生成创世数据块以便保留账本配置信息与最后一个被删除数据块的块哈希。此外,考虑到数据块中不仅包括该用户提交的历史数据,也可能包括其他用户提交的历史数据,因此,需要搜集待删除的数据块所涉及的每个用户的签名确认之后,才能进行删除操作。Through the solution provided in the embodiments of this specification, when any user wants to delete the historical data submitted to the centralized blockchain ledger, he can send a block deletion request to the database server, requesting the database server to delete the data from the centralized blockchain The database containing the historical data specified by the user is deleted from the ledger. Due to the coupling between the adjacent data blocks in the ledger, it is usually necessary to delete the genesis data block in sequence and backwards. Remove the block hash of the data block. In addition, considering that the data block includes not only the historical data submitted by the user, but also the historical data submitted by other users, the deletion operation can only be performed after the signature confirmation of each user involved in the data block to be deleted needs to be collected. .

通过本说明书实施例,可以在从中心化块链式账本中删除历史数据块的情况下,依然不破坏中心化块链式账本的可用性。Through the embodiments of this specification, it is possible to delete historical data blocks from the centralized blockchain ledger without destroying the availability of the centralized blockchain ledger.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the embodiments of the present specification.

此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。In addition, any one of the embodiments of the present specification does not need to achieve all the above effects.

附图说明Description of drawings

为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the following briefly introduces the accompanying drawings required in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some of the embodiments described in the embodiments of the present specification. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings.

图1是本说明书提供的一种基于中心化块链式账本的数据存储系统示意图;Figure 1 is a schematic diagram of a data storage system based on a centralized block chain ledger provided in this specification;

图2是本说明书实施例提供的一种基于中心化块链式账本的数据块删除方法的流程示意图;2 is a schematic flowchart of a method for deleting data blocks based on a centralized block chain ledger provided by an embodiment of this specification;

图3是本说明书提供的另一种基于中心化块链式账本的数据块删除方法的流程示意图;3 is a schematic flowchart of another method for deleting data blocks based on a centralized block chain ledger provided in this specification;

图4是本说明书实施例提供的一种基于中心化块链式账本的数据块删除装置的结构示意图;4 is a schematic structural diagram of a data block deletion device based on a centralized block chain ledger provided by an embodiment of this specification;

图5是用于配置本说明书实施例方法的一种设备的结构示意图。FIG. 5 is a schematic structural diagram of a device for configuring a method according to an embodiment of the present specification.

具体实施方式Detailed ways

图1是本说明书提供的一种基于中心化块链式账本的数据存储系统示意图。如图1所示,数据存储系统包括中心化的数据库服务端与多个客户端。其中,数据库服务端负责维护中心化块链式账本,每个客户端对应于一个企业级用户(机构),每个企业级用户自身又进一步对接一个或多个个人用户。Figure 1 is a schematic diagram of a data storage system based on a centralized block chain ledger provided in this specification. As shown in Figure 1, the data storage system includes a centralized database server and multiple clients. Among them, the database server is responsible for maintaining the centralized blockchain ledger, each client corresponds to an enterprise-level user (organization), and each enterprise-level user is further connected to one or more individual users.

例如,外卖平台与电商平台分别作为用户在数据库服务端上进行注册,获得用户账户,并且,分别在自己的设备上安装数据库服务端提供的客户端,在客户端中登录用户账户,从而具有与数据库服务端进行数据交互的能力。For example, the takeaway platform and the e-commerce platform respectively register on the database server as users to obtain user accounts, and install the client provided by the database server on their own devices respectively, and log in to the user account in the client, thereby having The ability to interact with the database server.

而外卖平台与电商品台又分别对接各自的大量个人用户。某个个人用户使用自己的手机上安装的外卖客户端购买一份外卖食品后,外卖平台的设备会生成一外卖订单记录(即外卖平台基于业务产生的业务数据),外卖平台会通过自己在数据库服务端注册的用户账户将订单记录封装成交易(类似于区块链,本文所述的交易是适用于中心化块链式账本存储的专用数据结构),将交易提交给数据库服务端,以便数据库服务端将交易封装进数据库写入中心化块链式账本进行存储。类似地,电商平台也会将基于电商业务产生的每个电商订单封装成交易提交给数据库服务端。The takeaway platform and the e-commerce platform are connected to their respective large numbers of individual users. After an individual user purchases a take-out food using the take-out client installed on his mobile phone, the device of the take-out platform will generate a take-out order record (that is, the business data generated by the take-out platform based on the business). The user account registered on the server encapsulates the order record into a transaction (similar to the blockchain, the transaction described in this article is a special data structure suitable for centralized blockchain ledger storage), and submits the transaction to the database server so that the database can The server encapsulates the transaction into the database and writes it to the centralized blockchain ledger for storage. Similarly, the e-commerce platform will encapsulate each e-commerce order generated based on the e-commerce business into a transaction and submit it to the database server.

为了描述的方便,后文所述的用户是指数据库服务端所服务的企业级用户,后文所述的用户账户,是指企业级用户在数据库服务端注册的账户。For the convenience of description, the user mentioned later refers to the enterprise-level user served by the database server, and the user account mentioned later refers to the account registered by the enterprise-level user on the database server.

通常,一个用户向数据库服务端提交的交易的先后顺序体现了交易所封装的业务数据产生的先后顺序,而数据库服务端可以根据同一用户提交的交易的先后顺序,优先将在先收到的交易进行数据块封装,如此,在中心化块链式账本中,对于同一用户提交的若干交易而言,封装于靠前数据块中的交易的产生时间往往早于封装于靠后数据库中的交易的产生时间。Usually, the order of transactions submitted by a user to the database server reflects the order in which the business data encapsulated by the exchange is generated, and the database server can prioritize the transactions received earlier according to the order of transactions submitted by the same user. Data block encapsulation is performed, so that in the centralized blockchain ledger, for several transactions submitted by the same user, the transaction encapsulated in the front data block is often generated earlier than the transaction encapsulated in the later database. generation time.

因此,某个用户如果出于节省存储费用的考虑,想要将产生时间过于久远的交易(这些历史交易封装的业务数据往往已不具有使用价值)从中心化块链式账本中删除,则相当于请求数据库服务端将封装有这些历史交易的每个数据块进行删除。Therefore, if a user wants to delete transactions that have been generated for too long (the business data encapsulated by these historical transactions is often of no use value) from the centralized blockchain ledger for the sake of saving storage costs, it is quite At the requesting database server, each data block encapsulated with these historical transactions will be deleted.

需要说明的是,一方面,对于中心化块链式账本中的每个数据块,该数据块的块头中通常包含块体中所有交易构成的梅克尔树的根哈希(用于确保本数据块内所有交易不可篡改),一旦数据块中的任一交易被删除,则该数据块也就失去了存证的意义,另一方面,由于数据块服务端不仅仅是为一个用户服务,每个数据块中包含的交易也不仅仅来自于同一个用户,因此,即便某个用户只是请求删除自己提交的历史交易,数据块服务端在操作层面,也只能选择将凡是涉及这些历史交易的数据块删除。It should be noted that, on the one hand, for each data block in the centralized blockchain ledger, the block header of the data block usually contains the root hash of the Merkle tree composed of all transactions in the block (used to ensure this All transactions in the data block cannot be tampered with), once any transaction in the data block is deleted, the data block will lose its significance. The transactions contained in each data block are not only from the same user. Therefore, even if a user only requests to delete the historical transactions submitted by himself, the data block server can only choose to delete all historical transactions involving these historical transactions at the operational level. The data block is deleted.

还需要说明的是,中心化块链式账本中先后相邻的数据块之间具有耦合性,后一个数据块的块头中携带有前一个数据块的块头对应的哈希值,因此,即便某个用户请求删除的多个历史交易仅涉及个别不连续的数据块,数据库服务端从操作层面,也只能选择从创世数据块开始连续向后删除数据块,直至实现将该用户请求删除的所有历史交易都删除的效果为止。It should also be noted that there is coupling between successively adjacent data blocks in the centralized blockchain ledger, and the block header of the next data block carries the hash value corresponding to the block header of the previous data block. The multiple historical transactions requested to be deleted by each user only involve individual discontinuous data blocks. From the operational level, the database server can only choose to continuously delete data blocks from the genesis data block until the deletion requested by the user is realized. All historical transactions are deleted until the effect is reached.

此外,考虑到中心化块链式账本中的第1个数据块(创世数据块)往往需要携带中心化块链式账本的账本配置信息,因此,如果从中心化块链式账本从创世数据块开始删除一串数据块(包括删除原创世数据块),则需要重新生成创世数据块。In addition, considering that the first data block (genesis data block) in the centralized blockchain ledger often needs to carry the ledger configuration information of the centralized blockchain ledger, if the When the data block starts to delete a series of data blocks (including the deletion of the original data block), the creation data block needs to be regenerated.

重新生成的创世数据块可以包含原创世数据块携带的账本配置信息,以及包含删除的最后序位(第N个)的数据块对应的块哈希(以便与保留的第N+1个数据块携带的第N个数据块的块哈希匹配,从而保留第N+1个数据块与被删除的数据块之间的耦合性)。The regenerated genesis data block can contain the ledger configuration information carried by the original genesis data block, as well as the block hash corresponding to the data block containing the deleted last sequence bit (Nth) (so as to be consistent with the retained N+1th data). The block hash of the Nth data block carried by the block is matched, thereby preserving the coupling between the N+1th data block and the deleted data block).

为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。In order for those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the accompanying drawings in the embodiments of the present specification. Obviously, the described implementation Examples are only some of the embodiments of the present specification, but not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification should fall within the scope of protection.

以下结合附图,详细说明本说明书各实施例提供的技术方案。The technical solutions provided by the embodiments of the present specification will be described in detail below with reference to the accompanying drawings.

图2是本说明书实施例提供的一种基于中心化块链式账本的数据块删除方法的流程示意图,包括如下步骤:2 is a schematic flowchart of a method for deleting data blocks based on a centralized block chain ledger provided by an embodiment of this specification, including the following steps:

S200:接收任一用户账户发送的块删除请求。S200: Receive a block deletion request sent by any user account.

图2所示方法流程的执行主体是中心化的数据库服务端。The execution subject of the method process shown in FIG. 2 is the centralized database server.

在本说明书实施例中,块删除请求可以不是交易这一数据结构,而是基于传统的客户端/服务端架构下,客户端向服务端发送的请求报文。数据块服务端对块删除请求进行处理。In the embodiment of this specification, the block deletion request may not be a data structure of a transaction, but a request message sent by a client to a server based on a traditional client/server architecture. The data block server processes the block deletion request.

S202:确定所述块删除请求指定的待删除数据块集合。S202: Determine a set of data blocks to be deleted specified by the block deletion request.

可以有多种方式确定块删除请求指定的待删除数据块集合。需要强调的是,在图2所示的方法实施例中,不论采用何种方式确定待删除数据块集合,待删除数据块集合需要满足:包括序号为1至序号为N的N个待删除数据块,N>1。The set of data blocks to be deleted specified by the block delete request can be determined in various ways. It should be emphasized that, in the method embodiment shown in FIG. 2 , no matter what method is used to determine the set of data blocks to be deleted, the set of data blocks to be deleted needs to meet the following requirements: including N pieces of data to be deleted with serial numbers from 1 to N. block, N>1.

例如,用户账户可以在块删除请求中携带待删除交易标识集合,用于指定用户账户请求删除哪些历史交易。数据块服务端可以根据所述块删除请求中携带的待删除交易标识集合,将凡是封装有待删除交易标识集合中任一交易标识对应的交易的数据块加入到待删除数据块集合。For example, the user account may carry the set of transaction identifiers to be deleted in the block deletion request, which is used to specify which historical transactions the user account requests to delete. The data block server may, according to the set of transaction identifiers to be deleted carried in the block deletion request, add all data blocks that encapsulate a transaction corresponding to any transaction identifier in the set of transaction identifiers to be deleted to the set of data blocks to be deleted.

又如,用户账户可以在块删除请求中携带待删除数据块的序号范围[1,N],以便数据库服务端将第1个数据块至第N个数据块确定为待删除数据块。For another example, the user account may carry the sequence number range [1, N] of the data block to be deleted in the block deletion request, so that the database server can determine the first data block to the Nth data block as the data block to be deleted.

S204:根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户。S204: Determine at least one other related user account according to each transaction corresponding to the set of data blocks to be deleted.

所谓相关的至少一个其他用户账户,是指:针对待删除数据块集合对应的每个交易,该交易所封装的数据的所有方用户(即之前提交该交易给数据库服务端的用户)的账户,就属于相关的用户账户;而除了发送块删除请求的用户账户以外的相关的用户账户,就被称为相关的其他用户账户。The so-called related at least one other user account refers to: for each transaction corresponding to the set of data blocks to be deleted, the account of the owner of the data encapsulated by the exchange (that is, the user who submitted the transaction to the database server before), is It belongs to the relevant user account; and the relevant user account other than the user account that sends the block delete request is called the relevant other user account.

S206:获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名。S206: Acquire a signature generated by the user account for the block deletion request; and acquire a signature generated by each other user account for the block deletion request.

一般而言,所述用户账户在向数据库服务端发送块删除请求时,也会一并将针对块删除请求产生的签名发送给数据库服务端。数据库服务端可以对所述用户账户提供的签名进行校验,校验通过后,才能确定获取到所述用户账户针对所述块删除请求产生的签名。Generally speaking, when the user account sends a block deletion request to the database server, it also sends the signature generated for the block deletion request to the database server. The database server can verify the signature provided by the user account, and after the verification is passed, it can be determined that the signature generated by the user account for the block deletion request is obtained.

进一步地,数据库服务端可以在确定获取到所述用户账户针对所述块删除请求产生的签名之后,才确定所述块删除请求指定的待删除数据块集合。Further, the database server may determine the set of data blocks to be deleted specified by the block deletion request after determining to obtain the signature generated by the user account for the block deletion request.

在本说明书实施例中,数据库服务端可以针对确定的每个其他用户账户,向该其他用户账户发送问询消息,用于问询该其他用户账户是否许可所述块删除请求,如果该其他用户账户同意删除这些待删除数据块,则可以向数据库服务端返回针对块删除请求的签名。当然,数据库服务端需要对接收到的每个签名进行校验并通过后,才能确定获取到了每个其他用户账户的签名。In the embodiment of this specification, the database server may, for each other user account determined, send a query message to the other user account, to inquire whether the other user account allows the block deletion request, if the other user account If the account agrees to delete these data blocks to be deleted, the signature for the block deletion request can be returned to the database server. Of course, the database server needs to verify and pass each signature received before it can determine that the signature of each other user account has been obtained.

此外,在本说明书实施例中,数据库服务端也可以配置M个管理方账户,M大于0。对中心化块链式账本进行删除操作可以同样需要取得一定数量的管理方账户的许可。因此,在确定获取到全部签名之前,可以获取中心化块链式账本对应的至少一个管理方账户针对所块删除请求所产生的签名。In addition, in the embodiment of this specification, the database server may also be configured with M accounts of the administrator, where M is greater than 0. Deleting a centralized blockchain ledger may also require permission from a certain number of administrator accounts. Therefore, before it is determined that all the signatures are obtained, the signature generated by at least one manager account corresponding to the centralized blockchain ledger for the block deletion request can be obtained.

其中,需要获取的管理方账户签名的数量可以等于M,也可以小于M,根据实际需要设定。The number of signatures of the manager account to be acquired may be equal to M or less than M, and may be set according to actual needs.

S208:在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,重新生成创世数据块。S208: After it is determined that all signatures are obtained, delete the set of data blocks to be deleted from the centralized block chain ledger, and regenerate the genesis data block.

在本说明书实施例中,获取到全部签名,是指不仅获取到所述用户账户的签名,还获取到每个其他用户账户的签名。In the embodiment of this specification, acquiring all the signatures means not only acquiring the signatures of the user account, but also acquiring the signatures of each other user account.

数据块服务端在删除数据块之前,可以先对待删除的1-N数据块进行完整性验证(即通过复盘交易的方式,将第1-第N个数据块重新推演一次,确保数据块内部各交易的耦合性以及数据块之间耦合性),确认无误后,再进行删除。Before deleting the data block, the data block server can first perform integrity verification on the 1-N data blocks to be deleted (that is, through the method of re-examination transaction, the 1-Nth data block is deduced again to ensure that the internal The coupling of each transaction and the coupling between data blocks), and then delete it after confirming that it is correct.

重新生成的创世数据块中包含原创世数据块携带的账本配置信息与第N个待删除数据块对应的块哈希。原创世数据块是指被删除的序号为1的数据块。The regenerated genesis data block contains the ledger configuration information carried by the original genesis data block and the block hash corresponding to the Nth data block to be deleted. The original data block refers to the deleted data block with sequence number 1.

此处需要说明的是,账本配置信息可以是指与账本配置有关的任何信息。例如创建账本的账本创建交易,其中包含账本创建时间、账本创建方标识等信息。数据块对应的块哈希,一般是指对数据块的块头进行哈希计算得到的哈希值。It should be noted here that the ledger configuration information may refer to any information related to the ledger configuration. For example, a ledger creation transaction for creating a ledger contains information such as the ledger creation time and the ledger creator ID. The block hash corresponding to the data block generally refers to the hash value obtained by hashing the block header of the data block.

在本说明书实施例中,可以将重新生成的创世数据块存储至删除的第N个数据块原本所在的存储位置(即拼接到第N+1个数据块之前)。In this embodiment of the present specification, the regenerated genesis data block may be stored to the storage location where the deleted Nth data block is originally located (ie, before being spliced to the N+1th data block).

通过本说明书实施例中所提供的方案,任一用户想要删除自己之前提交给中心化块链式账本历史数据时,可以向数据库服务端发送块删除请求,请求数据库服务端从中心化块链式账本中删除包含该用户指定的历史数据的数据库。由于账本中前后相邻的数据块之间存在耦合性,因此,通常需要从创世数据块开始依次向后删除,删除之后,还需要重新生成创世数据块以便保留账本配置信息与最后一个被删除数据块的块哈希。此外,考虑到数据块中不仅包括该用户提交的历史数据,也可能包括其他用户提交的历史数据,因此,需要搜集待删除的数据块所涉及的每个用户的签名确认之后,才能进行删除操作。Through the solution provided in the embodiments of this specification, when any user wants to delete the historical data submitted to the centralized blockchain ledger, he can send a block deletion request to the database server, requesting the database server to delete the data from the centralized blockchain The database containing the historical data specified by the user is deleted from the ledger. Due to the coupling between the adjacent data blocks in the ledger, it is usually necessary to delete the genesis data block in sequence and backwards. Remove the block hash of the data block. In addition, considering that the data block includes not only the historical data submitted by the user, but also the historical data submitted by other users, the deletion operation can only be performed after the signature confirmation of each user involved in the data block to be deleted needs to be collected. .

通过本说明书实施例,可以在从中心化块链式账本中删除历史数据块的情况下,依然不破坏中心化块链式账本的可用性。Through the embodiments of this specification, it is possible to delete historical data blocks from the centralized blockchain ledger without destroying the availability of the centralized blockchain ledger.

此外,在本说明书实施例中,块删除请求具体还可以是块删除交易这一数据结构。如此,数据库服务端还需要将所述块删除交易写入中心化块链式账本。进一步地,还可以将所述块删除交易在中心化块链式账本中的存储位置信息也写入重新生成的创世数据块(具体是写入块头),以便根据重新生成的创世数据块可以定位到相应的块删除交易进行查阅。In addition, in the embodiment of this specification, the block deletion request may specifically be a data structure of a block deletion transaction. In this way, the database server also needs to write the block deletion transaction into the centralized blockchain ledger. Further, the storage location information of the block deletion transaction in the centralized blockchain ledger can also be written into the regenerated genesis data block (specifically, the block header is written), so that according to the regenerated genesis data block You can locate the corresponding block deletion transaction for review.

块删除交易中可以携带如下信息:请求删除数据块的用户账户的标识、请求时间、请求删除的数据块范围等。The block deletion transaction can carry the following information: the identity of the user account requesting to delete the data block, the request time, the range of the data block requested to be deleted, etc.

交易在中心化块链式账本中的存储位置,具体可以是指交易所在的数据块的序号(或称块高)以及交易在数据块中的具体位置(即偏移量offset)。The storage location of the transaction in the centralized blockchain ledger can specifically refer to the serial number (or block height) of the data block where the transaction is located and the specific location of the transaction in the data block (that is, the offset offset).

此外,在本说明书实施例中,可以将所述块删除交易与获取到的全部签名以关联形式写入中心化块链式账本,如此,相当于对各方的授权记录也进行了存证。In addition, in the embodiment of this specification, the block deletion transaction and all the obtained signatures can be written into the centralized block chain ledger in an associated form, so that the authorization records of all parties are also stored as evidence.

另外,在本说明书实施例中,可以将重新生成的创世数据块对应的块哈希写入块删除交易对应的交易日志,并且将块删除交易与相应的交易日志一并写入中心化块链式账本。这种情况下,可以不需要将重新生成的创世数据块拼接到第N+1个数据块之前,而是另行存储,根据所述交易日志可以查询到重新生成的创世数据块。In addition, in the embodiment of this specification, the block hash corresponding to the regenerated genesis data block can be written into the transaction log corresponding to the block deletion transaction, and the block deletion transaction and the corresponding transaction log can be written into the centralized block together Chained ledger. In this case, the regenerated genesis data block does not need to be spliced before the N+1th data block, but is stored separately, and the regenerated genesis data block can be queried according to the transaction log.

另外,在中心化块链式账本场景下,每个用户账户可以有相应的状态,例如,每个用户账户的权限可能会频繁变动,每次变动都意味着用户账户对应的状态发生改变。又如,每个用户账户可以有资金余额,用户账户发起交易需要消耗余额,如此,用户账户对应的资金余额状态也会发生变化。In addition, in the centralized blockchain ledger scenario, each user account can have a corresponding state. For example, the permissions of each user account may change frequently, and each change means that the state corresponding to the user account changes. For another example, each user account may have a fund balance, and the user account needs to consume the balance to initiate a transaction. In this way, the state of the fund balance corresponding to the user account will also change.

所有用户账户对应的状态信息的集合被称为世界状态。账本中的每个数据库都对应于一个世界状态。The set of state information corresponding to all user accounts is called the world state. Each database in the ledger corresponds to a world state.

在中心化块链式账本场景下,通常并不会专门记录每个用户账户对应的状态信息,在中心化块链式账本完整的情况下,可以通过账本溯源的方式,从第一个数据块复盘交易,推导出每个数据块对应的世界状态。In the centralized blockchain ledger scenario, the status information corresponding to each user account is usually not specifically recorded. When the centralized blockchain ledger is complete, the first data block can be traced through the ledger. Review the transaction and deduce the world state corresponding to each data block.

而在图2所示的方法流程中,如果删除了第1-第N的数据块,则意味着无法通过复盘交易的方式来推导出第1-第N个数据块分别对应的世界状态。为此,可以将第1-第N个数据块分别对应的世界状态信息写入重新生成的创世数据块,从而实现了对世界状态信息的保留。或者,可以仅将第N个数据块对应的世界状态信息写入重新生成的创世数据块,从而可以证明被删除的前N个数据块的世界状态与第N+1个数据块的世界状态耦合,未被篡改。In the method flow shown in Figure 2, if the 1st-Nth data blocks are deleted, it means that the world states corresponding to the 1st-Nth data blocks cannot be deduced by means of re-examination transactions. To this end, the world state information corresponding to the 1st to the Nth data blocks can be written into the regenerated genesis data block, thereby realizing the retention of the world state information. Alternatively, only the world state information corresponding to the Nth data block can be written into the regenerated genesis data block, so as to prove the world state of the first N data blocks deleted and the world state of the N+1th data block Coupling, not tampered with.

图3是本说明书提供的另一种基于中心化块链式账本的数据块删除方法的流程示意图,包括如下步骤:Figure 3 is a schematic flowchart of another method for deleting data blocks based on a centralized block chain ledger provided in this specification, including the following steps:

S300:接收任一用户账户发送的块删除请求。S300: Receive a block deletion request sent by any user account.

S302:确定所述块删除请求指定的待删除数据块集合。S302: Determine the set of data blocks to be deleted specified by the block deletion request.

所述待删除数据块集合包括序号为2至序号为N的N个待删除数据块,N≥2;The to-be-deleted data block set includes N to-be-deleted data blocks with sequence numbers from 2 to N, where N≥2;

S304:根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户。S304: Determine at least one other related user account according to each transaction corresponding to the set of data blocks to be deleted.

S306:获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名。S306: Acquire a signature generated by the user account for the block deletion request; and acquire a signature generated by each other user account for the block deletion request.

S308:在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,生成标志数据块。S308: After it is determined that all signatures are obtained, delete the set of data blocks to be deleted from the centralized block chain ledger, and generate a flag data block.

所述标志数据块中可以包含第N个待删除数据块对应的块哈希与用于指向创世数据块的指针对象。此外,标志数据块还可以包含块删除交易在中心化块链式账本中的存储位置信息和/或删除的第N个数据块对应的世界状态信息(或第1-N个数据块分别对应的世界状态)。The marked data block may include a block hash corresponding to the Nth data block to be deleted and a pointer object for pointing to the creation data block. In addition, the flag data block may also contain the storage location information of the block deletion transaction in the centralized block chain ledger and/or the world state information corresponding to the deleted Nth data block (or the corresponding data blocks 1-N respectively). state of the world).

显然,图3所示的方法流程与图2所示方法流程的主要区别在于,不会删除创世数据块,如此,也就不需要重新生成创世数据块,但是,需要另行生成标识数据块,其需要关联创世数据块,以便可以关联创世数据块中的账本配置信息。Obviously, the main difference between the method flow shown in Figure 3 and the method flow shown in Figure 2 is that the genesis data block will not be deleted, so the genesis data block does not need to be regenerated, but the identification data block needs to be generated separately , which needs to be associated with the genesis data block so that the ledger configuration information in the genesis data block can be associated.

图4是本说明书实施例提供的一种基于中心化块链式账本的数据块删除装置的结构示意图,应用于数据库服务端,所述数据库服务端维护有中心化块链式账本,所述装置包括:4 is a schematic structural diagram of a data block deletion device based on a centralized block chain ledger provided by an embodiment of this specification, applied to a database server, the database server maintains a centralized block chain ledger, and the device include:

接收模块401,接收任一用户账户发送的块删除请求;Receiving module 401, receiving a block deletion request sent by any user account;

第一确定模块402,确定所述块删除请求指定的待删除数据块集合;所述待删除数据块集合包括序号为1至序号为N的N个待删除数据块,N>1;The first determination module 402 determines the set of data blocks to be deleted specified by the block deletion request; the set of data blocks to be deleted includes N data blocks to be deleted with sequence numbers from 1 to N, where N>1;

第二确定模块403,根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户;The second determination module 403, according to each transaction corresponding to the set of data blocks to be deleted, determines at least one other related user account;

获取模块404,获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名;Obtaining module 404, obtains the signature generated by the user account for the block deletion request; and obtains the signature generated by each other user account for the block deletion request;

删除模块405,在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,重新生成创世数据块;其中,重新生成的创世数据块中包含原创世数据块携带的账本配置信息与第N个待删除数据块对应的块哈希。The deletion module 405, after determining that all signatures have been obtained, deletes the set of data blocks to be deleted from the centralized block chain ledger, and regenerates the creation data block; wherein, the regenerated creation data block contains original The ledger configuration information carried by the world data block and the block hash corresponding to the Nth data block to be deleted.

所述第一确定模块402,根据所述块删除请求中携带的待删除交易标识集合,确定待删除数据块集合;或者根据所述块删除请求中携带的待删除数据块的序号范围[1,N],N>1,确定待删除数据块集合。The first determining module 402 determines the set of data blocks to be deleted according to the set of transaction identifiers to be deleted carried in the block deletion request; or according to the range of sequence numbers of the data blocks to be deleted carried in the block deletion request [1, N], N>1, determine the set of data blocks to be deleted.

所述第一确定模块402,在获取到所述用户账户针对所述块删除请求产生的签名之后,确定所述块删除请求指定的待删除数据块集合。The first determining module 402, after acquiring the signature generated by the user account for the block deletion request, determines the set of data blocks to be deleted specified by the block deletion request.

所述获取模块404,针对确定的每个其他用户账户,向该其他用户账户发送问询消息,用于问询该其他用户账户是否许可所述块删除请求;接收该其他用户账户返回的签名。The obtaining module 404, for each other user account determined, sends an inquiry message to the other user account for inquiring whether the other user account allows the block deletion request; and receives the signature returned by the other user account.

所述块删除请求,包括:所述用户账户构建的块删除交易;The block deletion request includes: a block deletion transaction constructed by the user account;

所述装置还包括:写入模块406,将所述块删除交易写入中心化块链式账本;以及,将所述块删除交易在中心化块链式账本中的存储位置信息写入重新生成的创世数据块。The device further includes: a writing module 406, which writes the block deletion transaction into the centralized block chain ledger; and writes the storage location information of the block deletion transaction in the centralized block chain ledger to regenerate genesis data block.

所述写入模块406,将所述块删除交易与获取到的全部签名以关联形式写入中心化块链式账本。The writing module 406 writes the block deletion transaction and all the obtained signatures into the centralized block chain ledger in an associated form.

所述获取模块404,在确定获取到全部签名之前,获取中心化块链式账本对应的至少一个管理方账户针对所块删除请求所产生的签名。The obtaining module 404 obtains the signature generated by at least one manager account corresponding to the centralized block chain ledger for the block deletion request before determining that all the signatures have been obtained.

本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图2或3所示方法。Embodiments of the present specification further provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the program shown in FIG. 2 or 3 when executing the program. method.

图5示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。FIG. 5 shows a schematic diagram of a more specific hardware structure 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 among each other within the device through the bus 1050 .

处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute related program to implement the technical solutions provided by the embodiments of this specification.

存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random AccessMemory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。The memory 1020 may be implemented in the form of a ROM (Read Only Memory, read only memory), a RAM (Random Access Memory, random access memory), a static storage device, a dynamic storage device, and the like. The memory 1020 may store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and invoked by the processor 1010 for execution.

输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 1030 is used to connect the 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 externally 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 the output device may include a display, a speaker, a vibrator, an indicator light, and the like.

通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 1040 is used to connect a communication module (not shown in the figure), so as to realize the communication interaction between the device and other devices. The communication module can implement communication through wired means (such as USB, network cable, etc.), or can implement communication through wireless means (such as mobile network, WIFI, Bluetooth, etc.).

总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。The bus 1050 includes a path to transfer information between the various components of the device (eg, the processor 1010, the memory 1020, the input/output interface 1030, and the communication interface 1040).

需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above-mentioned 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 necessary components for normal operation. other components. In addition, those skilled in the art can understand that, the above-mentioned device may only include components necessary to implement the solutions of the embodiments of the present specification, rather than all the components shown in the figures.

本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图2或图3所示方法。Embodiments of the present specification further provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the method shown in FIG. 2 or FIG. 3 .

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the embodiments of the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of this specification or the parts that make contributions to the prior art may be embodied in the form of software products, and the computer software products may be stored in storage media, such as ROM/RAM, A magnetic disk, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments in this specification.

上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, methods, modules or units described in the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementing device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, email sending and receiving device, game control desktop, tablet, wearable device, or a combination of any of these devices.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于方法实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的方法实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment. The method embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated. When implementing the solutions of the embodiments of this specification, the functions of each module may be integrated into the same module. or multiple software and/or hardware implementations. Some or all of the modules may also be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.

以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。The above are only specific implementations of the embodiments of the present specification. It should be pointed out that for those skilled in the art, without departing from the principles of the embodiments of the present specification, several improvements and modifications can be made. These Improvements and modifications should also be regarded as the protection scope of the embodiments of the present specification.

Claims (15)

1.一种基于中心化块链式账本的数据块删除方法,应用于数据库服务端,所述数据库服务端维护有中心化块链式账本,所述方法包括:1. A method for deleting data blocks based on a centralized block-chain ledger, applied to a database server that maintains a centralized block-chain ledger, the method comprising: 接收任一用户账户发送的块删除请求;Receive block delete requests sent by any user account; 确定所述块删除请求指定的待删除数据块集合;所述待删除数据块集合包括序号为1至序号为N的N个待删除数据块,N>1;Determine the set of data blocks to be deleted specified by the block deletion request; the set of data blocks to be deleted includes N data blocks to be deleted with sequence numbers from 1 to N, and N>1; 根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户;According to each transaction corresponding to the set of data blocks to be deleted, determine the relevant at least one other user account; 获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名;Obtain the signature generated by the user account for the block deletion request; and obtain the signature generated by each other user account for the block deletion request; 在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,重新生成创世数据块;其中,重新生成的创世数据块中包含原创世数据块携带的账本配置信息与第N个待删除数据块对应的块哈希。After it is determined that all signatures are obtained, the set of data blocks to be deleted is deleted from the centralized blockchain ledger, and the creation data block is regenerated; wherein, the regenerated creation data block contains the original creation data block carrying The ledger configuration information of , and the block hash corresponding to the Nth data block to be deleted. 2.如权利要求1所述的方法,根据所述块删除请求指定的待删除数据块的序号范围,包括:2. The method according to claim 1, the sequence number range of the data block to be deleted specified according to the block deletion request, comprising: 根据所述块删除请求中携带的待删除交易标识集合,确定待删除数据块集合;或者Determine the set of data blocks to be deleted according to the set of transaction identifiers to be deleted carried in the block deletion request; or 根据所述块删除请求中携带的待删除数据块的序号范围[1,N],确定待删除数据块集合。The set of data blocks to be deleted is determined according to the sequence number range [1, N] of the data blocks to be deleted carried in the block deletion request. 3.如权利要求1所述的方法,确定所述块删除请求指定的待删除数据块集合,包括:3. The method of claim 1, determining the set of data blocks to be deleted specified by the block deletion request, comprising: 在获取到所述用户账户针对所述块删除请求产生的签名之后,确定所述块删除请求指定的待删除数据块集合。After obtaining the signature generated by the user account for the block deletion request, determine the set of data blocks to be deleted specified by the block deletion request. 4.如权利要求1所述的方法,获取每个其他用户账户针对所块删除请求产生的签名,包括:4. The method of claim 1, obtaining the signature that each other user account generates for the block deletion request, comprising: 针对确定的每个其他用户账户,向该其他用户账户发送问询消息,用于问询该其他用户账户是否许可所述块删除请求;For each other user account determined, send an inquiry message to the other user account for inquiring whether the other user account permits the block deletion request; 接收该其他用户账户返回的签名。Receive the signature returned by this other user account. 5.如权利要求1所述的方法,所述块删除请求,包括:所述用户账户构建的块删除交易;5. The method of claim 1, wherein the block deletion request comprises: a block deletion transaction constructed by the user account; 所述方法还包括:The method also includes: 将所述块删除交易写入中心化块链式账本;以及,将所述块删除交易在中心化块链式账本中的存储位置信息写入重新生成的创世数据块。Writing the block deletion transaction into the centralized block chain ledger; and writing the storage location information of the block deletion transaction in the centralized block chain ledger into the regenerated genesis data block. 6.如权利要求5所述的方法,将所述块删除交易写入中心化块链式账本,包括:6. The method of claim 5, writing the block deletion transaction to a centralized blockchain ledger, comprising: 将所述块删除交易与获取到的全部签名以关联形式写入中心化块链式账本。The block deletion transaction and all the obtained signatures are written into the centralized block chain ledger in an associated form. 7.如权利要求1所述的方法,在确定获取到全部签名之前,所述方法还包括:7. The method of claim 1, before determining that all signatures are obtained, the method further comprises: 获取中心化块链式账本对应的至少一个管理方账户针对所块删除请求所产生的签名。Obtain the signature generated by at least one manager account corresponding to the centralized blockchain ledger for the block deletion request. 8.一种基于中心化块链式账本的数据块删除装置,应用于数据库服务端,所述数据库服务端维护有中心化块链式账本,所述装置包括:8. A data block deletion device based on a centralized block chain ledger, applied to a database server that maintains a centralized block chain ledger, the device comprising: 接收模块,接收任一用户账户发送的块删除请求;The receiving module receives the block deletion request sent by any user account; 第一确定模块,确定所述块删除请求指定的待删除数据块集合;所述待删除数据块集合包括序号为1至序号为N的N个待删除数据块,N>1;a first determining module, which determines a set of data blocks to be deleted specified by the block deletion request; the set of data blocks to be deleted includes N data blocks to be deleted with sequence numbers from 1 to N, and N>1; 第二确定模块,根据所述待删除数据块集合对应的每个交易,确定相关的至少一个其他用户账户;The second determination module, according to each transaction corresponding to the set of data blocks to be deleted, determines the relevant at least one other user account; 获取模块,获取所述用户账户针对所述块删除请求产生的签名;以及获取每个其他用户账户针对所块删除请求产生的签名;acquiring module, acquiring the signature generated by the user account for the block deletion request; and acquiring the signature generated by each other user account for the block deletion request; 删除模块,在确定获取到全部签名之后,从中心化块链式账本中删除所述待删除数据块集合,并且,重新生成创世数据块;其中,重新生成的创世数据块中包含原创世数据块携带的账本配置信息与第N个待删除数据块对应的块哈希。The deletion module, after confirming that all signatures are obtained, deletes the set of data blocks to be deleted from the centralized block chain ledger, and regenerates the creation data block; wherein, the regenerated creation data block contains the original creation data block. The ledger configuration information carried by the data block and the block hash corresponding to the Nth data block to be deleted. 9.如权利要求8所述的装置,所述第一确定模块,根据所述块删除请求中携带的待删除交易标识集合,确定待删除数据块集合;或者根据所述块删除请求中携带的待删除数据块的序号范围[1,N],N>1,确定待删除数据块集合。9. The apparatus according to claim 8, wherein the first determination module determines the set of data blocks to be deleted according to the set of transaction identifiers to be deleted carried in the block deletion request; or according to the set of data blocks to be deleted carried in the block deletion request The range of the sequence numbers of the data blocks to be deleted is [1, N], where N>1, which determines the set of data blocks to be deleted. 10.如权利要求8所述的装置,所述第一确定模块,在获取到所述用户账户针对所述块删除请求产生的签名之后,确定所述块删除请求指定的待删除数据块集合。10 . The apparatus according to claim 8 , wherein the first determining module determines a set of data blocks to be deleted specified by the block deletion request after acquiring the signature generated by the user account for the block deletion request. 11 . 11.如权利要求8所述的装置,所述获取模块,针对确定的每个其他用户账户,向该其他用户账户发送问询消息,用于问询该其他用户账户是否许可所述块删除请求;接收该其他用户账户返回的签名。11. The apparatus of claim 8, wherein the acquisition module, for each other user account determined, sends an inquiry message to the other user account for inquiring whether the other user account allows the block deletion request ; Receive the signature returned by this other user account. 12.如权利要求8所述的装置,所述块删除请求,包括:所述用户账户构建的块删除交易;12. The apparatus of claim 8, the block deletion request comprising: a block deletion transaction constructed by the user account; 所述装置还包括:写入模块,将所述块删除交易写入中心化块链式账本;以及,将所述块删除交易在中心化块链式账本中的存储位置信息写入重新生成的创世数据块。The device further includes: a writing module, which writes the block deletion transaction into the centralized block chain ledger; and writes the storage location information of the block deletion transaction in the centralized block chain ledger into a regenerated one. Genesis data block. 13.如权利要求12所述的装置,所述写入模块,将所述块删除交易与获取到的全部签名以关联形式写入中心化块链式账本。13. The apparatus according to claim 12, wherein the writing module writes the block deletion transaction and all the obtained signatures into the centralized block chain ledger in an associated form. 14.如权利要求8所述的装置,所述获取模块,在确定获取到全部签名之前,获取中心化块链式账本对应的至少一个管理方账户针对所块删除请求所产生的签名。14. The apparatus according to claim 8, wherein the acquisition module, before determining that all the signatures are acquired, acquires the signature generated by at least one manager account corresponding to the centralized block chain ledger for the block deletion request. 15.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1至7任一项所述的方法。15. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the program as claimed in any one of claims 1 to 7 when the processor executes the program. method described.
CN202010544110.XA 2020-06-15 2020-06-15 Data block deleting method based on centralized block chain type account book Pending CN111444216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010544110.XA CN111444216A (en) 2020-06-15 2020-06-15 Data block deleting method based on centralized block chain type account book

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010544110.XA CN111444216A (en) 2020-06-15 2020-06-15 Data block deleting method based on centralized block chain type account book

Publications (1)

Publication Number Publication Date
CN111444216A true CN111444216A (en) 2020-07-24

Family

ID=71655375

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010544110.XA Pending CN111444216A (en) 2020-06-15 2020-06-15 Data block deleting method based on centralized block chain type account book

Country Status (1)

Country Link
CN (1) CN111444216A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364010A (en) * 2021-01-12 2021-02-12 支付宝(杭州)信息技术有限公司 Business record deleting method based on credible account book database
CN112364383A (en) * 2021-01-12 2021-02-12 支付宝(杭州)信息技术有限公司 Business record time service method based on credible account book database
CN112948355A (en) * 2021-03-05 2021-06-11 湖北央中巨石信息技术有限公司 Method, system, device and medium for destroying distributed network data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493044A (en) * 2018-11-08 2019-03-19 深圳壹账通智能科技有限公司 Block chain block delet method, device and terminal device
CN110008203A (en) * 2019-01-31 2019-07-12 阿里巴巴集团控股有限公司 A kind of data clearing method, device and equipment
CN110730204A (en) * 2019-09-05 2020-01-24 阿里巴巴集团控股有限公司 Method and blockchain system for deleting nodes in blockchain network
CN110837502A (en) * 2019-10-18 2020-02-25 支付宝(杭州)信息技术有限公司 A data storage method, device and equipment in a blockchain ledger

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493044A (en) * 2018-11-08 2019-03-19 深圳壹账通智能科技有限公司 Block chain block delet method, device and terminal device
CN110008203A (en) * 2019-01-31 2019-07-12 阿里巴巴集团控股有限公司 A kind of data clearing method, device and equipment
CN110730204A (en) * 2019-09-05 2020-01-24 阿里巴巴集团控股有限公司 Method and blockchain system for deleting nodes in blockchain network
CN110837502A (en) * 2019-10-18 2020-02-25 支付宝(杭州)信息技术有限公司 A data storage method, device and equipment in a blockchain ledger

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364010A (en) * 2021-01-12 2021-02-12 支付宝(杭州)信息技术有限公司 Business record deleting method based on credible account book database
CN112364383A (en) * 2021-01-12 2021-02-12 支付宝(杭州)信息技术有限公司 Business record time service method based on credible account book database
CN112364383B (en) * 2021-01-12 2021-04-27 支付宝(杭州)信息技术有限公司 Method for verifying authenticity of business record
CN112948355A (en) * 2021-03-05 2021-06-11 湖北央中巨石信息技术有限公司 Method, system, device and medium for destroying distributed network data
CN112948355B (en) * 2021-03-05 2022-07-12 湖北央中巨石信息技术有限公司 Method, system, device and medium for destroying distributed network data

Similar Documents

Publication Publication Date Title
TWI743458B (en) Method, device and system for parallel execution of blockchain transactions
CN110020854B (en) Data evidence storage method and system based on multiple block chain networks
CN111898139B (en) Data reading and writing method and device, and electronic equipment
CN110020945B (en) A data reading method and system based on multiple blockchain networks
TW202025057A (en) Field updating method and device and electronic equipment
CN110060153B (en) Data evidence storage method and system based on multiple block chain networks
CN111506580B (en) A transaction storage method based on a centralized blockchain ledger
CN111444216A (en) Data block deleting method based on centralized block chain type account book
CN111464319B (en) A transaction storage and signature verification method based on a centralized blockchain ledger
CN111459948B (en) A transaction integrity verification method based on a centralized blockchain ledger
US11223692B2 (en) Service execution methods and apparatuses
CN112035156A (en) E-commerce platform docking device, method, equipment and medium
CN110060152B (en) Data reading method and system based on multiple block chain networks
CN110717196A (en) Method, device and equipment for storing securities trading data
CN112364010B (en) Method and device for verifying existence of important business record
HK40034105A (en) A transaction integrity verification method based on centralized block chain type account book
HK40034105B (en) A transaction integrity verification method based on centralized block chain type account book
CN112632055A (en) Business record deleting method based on credible account book database
HK40045953B (en) Method and device for verifying existence of important business records
HK40045953A (en) Method and device for verifying existence of important business records
CN117951135A (en) Data processing method, device, computer equipment and storage medium
CN115328947A (en) Data request method and related equipment
CN115311087A (en) Blockchain-based transaction processing method and device, processor and electronic device
HK40034566B (en) Transaction storage and signature verification method based on centralized block chain type account book
HK40034566A (en) Transaction storage and signature verification method based on centralized block chain type account book

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200724