Data cutting method, computer device and storage medium

By generating rollbcak-n.wal files in the blockchain and performing key-value pair deduplication, combined with binary search technology, the problem of time-consuming cutting of blockchain data is solved, and more efficient data processing and storage optimization is achieved.

CN114036137BActive Publication Date: 2024-11-01GUIZHOU XISHAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111289587.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2024-11-01
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

The prior art takes a long time to crop data in blockchain, mainly due to the need to traverse all keys to delete historical state data, resulting in inefficiency.

Method used

When the reparation result of block height and block security depth is 0, a rollbcak-n.wal file is generated, the key value is read and deduplicated, and the data between specific block heights is positioned and deleted by binary search, reducing the data between the height of a specific block, Data storage and query time.

Benefits of technology

This method significantly reduces the time-consuming data cropping, improves data processing efficiency, and saves disk space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114036137B_ABST
    Figure CN114036137B_ABST
Patent Text Reader

Abstract

The present invention provides a data clipping method, a computer device and a storage medium, the method comprising: generating a rollbackcak-n.wal file; starting an independent process to read all keys in the rollback-{n-2}.wal file, deduplicating and saving; receiving a clipping instruction; dividing the second block height by the block safety depth to obtain a second value, and multiplying the second value by the block safety depth to obtain a third block height; reading each of the six keys corresponding to .mvcc.m.versionkl:{second value} from a database, and performing the following operations on each of the read six keys: splicing the sixth key and the third block height to obtain the seventh key; splicing the sixth key and the initial block height to obtain the eighth key; locating the seventh key and the eighth key by binary search, and deleting the seventh key, the eighth key and the data between the eighth key and the seventh key. The present application makes data clipping less time-consuming.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a data clipping method, a computer device, and a storage medium. Background Art

[0002] The applicant has applied for several patent applications for applying KVMVCC technology to blockchain. KVMVCC was proposed to separate data reading and writing to improve concurrency performance. However, since the historical status data will not be deleted when the new status data is written, the status data will continue to expand. The blockchain mainly relies on the latest status data and not the historical status data, so the historical status data can be deleted regularly.

[0003] The existing solution is to traverse all the keys in the state database in reverse order. If a key has multiple versions, only the latest version is retained and all old versions of the key are deleted. The above mechanism needs to read all the keys in the state database, so it takes a long time. Summary of the invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a data clipping method, a computer device and a storage medium that takes less time.

[0005] In a first aspect, the present invention provides a data clipping method applicable to a blockchain node, the method comprising:

[0006] When the remainder of the current block height and the block safety depth is 0, a rollbcak-n.wal file is generated; wherein n is the quotient of the current block height and the block safety depth, and rollbcak-n.wal is used to store a list of keys generated by each first block height in the third block height interval, and the list of keys generated by the first block height is stored in the form of: first block height: keys generated by executing all transactions of the first block of the first block height, the third starting height of the third block height interval is the current block height, and the third ending height of the third block height interval is the third starting height plus the block safety depth minus one;

[0007] When n-2 is not less than 0, start an independent process to read all the keys in the rollback-{n-2}.wal file and remove duplicates;

[0008] The keys after deduplication are stored in the database in the form of a fifth key-value pair; wherein the fifth key of the fifth key-value pair is .mvcc.m.versionkl:{n-2}, and the fifth value of the fifth key-value pair is the keys after deduplication;

[0009] Receiving a first cropping instruction sent by a user; wherein the first cropping instruction includes a second block height;

[0010] Divide the second block height by the block security depth to obtain a second value, and multiply the second value by the block security depth to obtain a third block height;

[0011] Read the six keys corresponding to .mvcc.m.versionkl:{second value} from the database;

[0012] Perform the following operations on each of the six keys read:

[0013] Connect the sixth key and the third block height to obtain the seventh key;

[0014] Join the sixth key and the initial block height to obtain the eighth key;

[0015] The seventh key and the eighth key are located through binary search, and the data of the seventh key, the eighth key and the data between the eighth key and the seventh key are deleted.

[0016] In a second aspect, the present invention further provides a device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors so that the one or more processors execute the data clipping method provided according to various embodiments of the present invention.

[0017] In a third aspect, the present invention further provides a storage medium storing a computer program, wherein the computer program enables a computer to execute the data clipping method provided according to each embodiment of the present invention.

[0018] The data clipping method, computer device and storage medium provided by many embodiments of the present invention generate a rollbackcak-n.wal file when the modulo result of the current block height and the block safety depth is 0; start an independent process to read all the keys in the rollback-{n-2}.wal file and remove duplicates; save the keys after duplication in the database in the form of a fifth key-value pair; receive a first clipping instruction sent by a user; divide the second block height and the block safety depth by an integer to obtain a second value, and multiply the second value by the block safety depth to obtain a third block height; read the six keys corresponding to .mvcc.m.versionkl:{second value} from the database, and perform the following operations on the six keys read: splice the sixth key and the third block height to obtain the seventh key; splice the sixth key and the initial block height to obtain the eighth key; locate the seventh key and the eighth key through binary search, and delete the seventh key, the eighth key and the data between the eighth key and the seventh key, so that data clipping takes less time. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0020] Figure 1 The present invention provides a flowchart of a data clipping method according to an embodiment of the present invention.

[0021] Figure 2 A schematic diagram of the structure of a device provided in one embodiment of the present invention. DETAILED DESCRIPTION

[0022] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] The applicant has applied for several patent applications for applying KVMVCC technology to blockchain (for details, please refer to the applicant's patent texts 2018108842951, 2018108840354, etc.). In the above patent applications, each node of the blockchain network stores the Merkle tree of each block and the global index table corresponding to the Merkle tree of each block, and the global index table uses the block height as the version number.

[0025] Figure 1 A flow chart of a data clipping method provided by an embodiment of the present invention. Figure 1 As shown, in this embodiment, the present invention provides a data clipping method applicable to a blockchain node, and the method includes:

[0026] S11: When the remainder of the current block height and the block safety depth is 0, generate a rollbcak-n.wal file; wherein n is the quotient of the current block height and the block safety depth, and rollbcak-n.wal is used to store a list of keys generated by each first block height in the third block height interval, and the list of keys generated by the first block height is stored in the form of: first block height: keys generated by executing all transactions of the first block of the first block height, the third starting height of the third block height interval is the current block height, and the third ending height of the third block height interval is the third starting height plus the block safety depth minus one;

[0027] S12: When n-2 is not less than 0, start an independent process to read all the keys in the rollback-{n-2}.wal file and remove duplicates;

[0028] S13: Save the keys after deduplication in the database in the form of a fifth key-value pair; wherein the fifth key of the fifth key-value pair is .mvcc.m.versionkl:{n-2}, and the fifth value of the fifth key-value pair is the keys after deduplication;

[0029] S14: receiving a first cropping instruction sent by a user; wherein the first cropping instruction includes a second block height;

[0030] S15: Divide the second block height by the block security depth to obtain a second value, and multiply the second value by the block security depth to obtain a third block height;

[0031] S16: Read the six keys corresponding to .mvcc.m.versionkl:{second value} from the database;

[0032] Perform the following operations on each of the six keys read:

[0033] S171: Highly splice the sixth key and the third block to obtain the seventh key;

[0034] S172: Connect the sixth key and the initial block height to obtain an eighth key;

[0035] S173: Locate the seventh key and the eighth key through binary search, and delete the seventh key, the eighth key, and the data between the eighth key and the seventh key.

[0036] Specifically, assuming that the block security depth is 10000 and the current block height is 0; those skilled in the art should understand that the block security depth can be configured according to actual needs to achieve the same technical effect;

[0037] The blockchain node executes step S12. Since the modulo of 0 and 10000 is 0, the rollbcak-0.wal file is generated.

[0038] The rollbcak-0.wal file is used to store the list of keys generated by each block in [0,9999];

[0039] rollbcak-0.wal is stored as follows: 0

[0041] .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv,

[0042] .mvcc.d.mavl-coins-bty-16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp,

[0043] .mvcc.d.mavl-coins-bty-19QPCDcrPPPnYDAKeMPCaBFnra5vdjcUoR,

[0044] .mvcc.d.mavl-coins-bty-121qqR7Kb7CcwuHfx9GYkSZhx6L6w8GmzH 1

[0046] .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv,

[0047] .mvcc.d.mavl-coins-bty-16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp,

[0048] .mvcc.d.mavl-coins-bty-19QPCDcrPPPnYDAKeMPCaBFnra5vdjcUoR,

[0049] .mvcc.d.mavl-coins-bty-121qqR7Kb7CcwuHfx9GYkSZhx6L6w8GmzH

[0050] ......

[0051] ...... 9999

[0053] .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv,

[0054] .mvcc.d.mavl-coins-bty-16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp,

[0055] .mvcc.d.mavl-coins-bty-19QPCDcrPPPnYDAKeMPCaBFnra5vdjcUoR,

[0056] .mvcc.d.mavl-coins-bty-121qqR7Kb7CcwuHfx9GYkSZhx6L6w8GmzH

[0057] If you have 10000 shares of your rollback-1.wal, you can rollback your rollback-1.

[0058] Assume that the blockchain node generates the rollbcak-2.wal file at this time;

[0059] The blockchain node executes step S12, starts an independent process to read all the keys in the rollbcak-0.wal file, and performs a deduplication operation on the read keys;

[0060] The blockchain node executes step S13 to save the deduplicated keys in the database in the form of key-value pairs; the key of the key-value pair is .mvcc.m.versionkl:{0}, and the value of the key-value pair is the deduplicated keys;

[0061] The blockchain node executes step S14 to receive the cropping instruction sent by the user, where the cropping instruction includes the block height, which is assumed to be 15000;

[0062] The blockchain node executes step S15, divides 15000 by 10000 to equal 1, and then multiplies by 10000 to obtain a block height of 10000;

[0063] The blockchain node executes step S16, and reads the keys corresponding to .mvcc.m.versionkl:{1} from the database, assuming they are k1 to k10;

[0064] Perform the following operations on each key read, taking k1 as an example:

[0065] The blockchain node executes step S171, concatenating k1 and 10000 to obtain k1`;

[0066] The blockchain node executes step S172, concatenating k1 and 0 to obtain k1``;

[0067] The blockchain node executes step S173: locates k1` and k1`` through binary search and deletes the data between k1` and k1``.

[0068] The above embodiment can specify a height (the specified height can only be an integer multiple of 10,000, and when it is not a multiple of 10,000, an approximate value is taken according to step S15) to crop data, and it takes a short time.

[0069] Preferably, after step S11, the method further includes:

[0070] When n-2 is not less than 0, delete the rollbcak-(n-2).wal file.

[0071] That is, when the rollback-2.wal file is generated, the rollback-0.wal file is deleted.

[0072] Since the rollback safety depth is 10000, the keys recorded in the rollback-0.wal file are no longer used. Delete the rollback-0.wal file to save disk space.

[0073] Preferably, the above method further comprises:

[0074] Execute a first transaction to update a first key-value pair, remove a version number from a first key in the first key-value pair to obtain a second key, and cache the second key;

[0075] After passing the first block height interval, perform the following operations on each second key:

[0076] Divide the current block height by the block safety depth to obtain a first value, multiply the first value by the block safety depth to obtain a second end height of the second block height interval, and use 0 as the second start height of the second block height interval;

[0077] The second key and the second starting height of the second block height interval are spliced ​​together to obtain a third key, and the second key and the second ending height of the second block height interval are spliced ​​together to obtain a fourth key; wherein the second ending height is lower than the first starting height of the first block height interval;

[0078] The third key and the fourth key are located through binary search, and the data between the third key, the fourth key and the third key and the fourth key are deleted.

[0079] Specifically, assuming that the current block height is 1000010, the first block height interval is [1000010, 101010], and the block security depth is 10000;

[0080] The blockchain node executes tx1 to update the key-value pair. The updated key is assumed to be .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:00000000000001000010. Then the updated key is removed from the version number and cached. The cached key is .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv and written to the cache.

[0081] When the block height reaches 101010, several keys without version numbers including .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv have been cached; perform the following operations on each key without version number:

[0082] Let’s take .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv as an example;

[0083] The blockchain node divides 1000010 into 10000=10, 10*10000=100000; the determined block height interval that needs to be streamlined is [0,100000];

[0084] The blockchain nodes are spliced ​​to obtain two keys: .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:0000000000000000000 and .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:00000000000000999999;

[0085] The blockchain node locates .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:0000000000000000000 and .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:00000000000009999 through binary search. 99, delete all data of .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:00000000000000000000 and .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:00000000000000999999.

[0086] In more embodiments, the first block height interval may also be configured according to actual needs, for example, configured as [1000010,102010], which can achieve the same technical effect.

[0087] The above embodiment cannot guarantee the deletion of all historical status data, but can delete historical status data that is written more frequently. Because the number of data versions that are written more frequently is also greater, it also occupies more disk space. After streamlining this part of data, the disk space saved is close to that of the existing solution, but the speed is several times faster than the existing solution.

[0088] The above embodiment reduces memory consumption and takes less time.

[0089] It should be noted that the reason why the above technical effects can be achieved is that after the applicant applies KVMVCC technology to blockchain, the data saved is similar to:

[0090] -rw-r—r—r—1yann 2.1M October 14 23:20 924556.ldb

[0091] -rw-r—r—r—1yann 2.1M October 14 23:21 926431.ldb

[0092] -rw-r—r—r—1yann 2.1M October 14 23:23 928857.ldb

[0093] …

[0094] The .ldb file is a file that stores data, and the data within and between each file is in order; the data stored in each file has a range, which is recorded in the index file;

[0095] The database only needs to locate the two keys .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:0000000000000000000 and .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:00000000000000999999 through binary search and then delete all the data between the two keys. Therefore, the data storage in the database is orderly, and the data between the two keys must be .mvcc.d.mavl-coins-bty-12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv:{height}, where 0<=height<=999999. Only two binary searches are needed to prune a key. The same method is used to prune other keys, which is several times faster than the original solution.

[0096] Preferably, the storage method of the state data includes storage in the form of a global index table, each blockchain node stores an mvcc index table, the mvcc index table includes a plurality of first key-value pairs, the first key of the first key-value pair includes the first address of the first user, and the first value of the first key-value pair includes the first height set of the minimum block height at which the state of the first address changes in each data set.

[0097] The applicant has applied for several patent applications for distributed data storage (for details, please refer to 2020105112795, etc.). The general content is that the data set of each shard (for example, every 1,000 consecutive blocks) will be stored by several nodes in the blockchain network.

[0098] The applicant has applied for several patent applications for distributed data storage (for details, please refer to 2020114269042, etc.), the general content of which is that the mvcc index table includes several key-value pairs, the key of the above key-value pair includes the first address of the first user, and the value of the above key-value pair includes the first height set of each first block height where the first address changes state, that is, for example, key includes addr1, and value includes the height set of each block height where addr1 changes state, for example, [789, 1126, 1348, 1789]; the blockchain node saves all version indexes of each key, which is used to determine the target shard, reduce network interaction and improve query efficiency;

[0099] In the above embodiment, the applicant believes that for the version indexes belonging to the same shard, only one minimum version index needs to be retained, which can quickly determine the target shard, and the length of the version sequence will not exceed one tenth of the block height at most. That is, if there are four versions [789, 1126, 1348, 1789], then only the two indexes 789 and 1126 need to be saved. Because 789 belongs to the first shard, the latter three version indexes belong to the second shard, and for all version indexes of the same shard, only the minimum value needs to be retained.

[0100] For example, when you need to query the status data of version 1500, the maximum version number less than or equal to 1500 in the local index list is 1126, so the second shard is determined. Then, a kvmvcc query is performed on any node belonging to the second shard, with start=1000 and end=1500. Since the database of this shard contains data of versions 1126, 1348, and 1789, kvmvcc will return data with version number 1348, which is consistent with the query efficiency of saving all indexes, but the number of version indexes that need to be saved is much less, which can be reduced to one thousandth at most.

[0101] Because fewer version numbers need to be saved, query efficiency will also be improved to a certain extent. Because when the version index sequence is longer, the data will be larger and reading will take more time. Secondly, assuming that the length of the version index list is N, the maximum value less than or equal to K is searched in the list. The most efficient search algorithm is binary search, and the complexity is logN. Therefore, when N decreases, the search efficiency will also improve.

[0102] The above embodiment only needs to save part of the version index to efficiently query data without reducing the query efficiency.

[0103] Figure 2 A schematic diagram of the structure of a device provided in one embodiment of the present invention.

[0104] like Figure 2 As shown, as another aspect, the present application also provides a device, including one or more central processing units (CPU) 201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 202 or the program loaded from the storage part 208 to the random access memory (RAM) 203. In the RAM 203, various programs and data required for the operation of the device 200 are also stored. The CPU 201, the ROM 202, and the RAM 203 are connected to each other through a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0105] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.

[0106] In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing any of the above methods. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 209, and / or installed from the removable medium 211.

[0107] As another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.

[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.

[0109] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor. For example, each of the units may be a software program arranged in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0110] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.

Claims

1. A data clipping method, characterized in that: Applicable to a blockchain node, the method comprises: When the modulo result of the current block height and the block safety depth is 0, a rollbcak-n.wal file is generated; wherein n is the quotient of the current block height and the block safety depth, and the rollbcak-n.wal is used to store a list of keys generated by each first block height in the third block height interval, and the list of keys generated by the first block height is stored in the form of: the first block height: the keys generated by executing all transactions of the first block of the first block height, the third starting height of the third block height interval is the current block height, and the third ending height of the third block height interval is the third starting height plus the block safety depth minus one; When n-2 is not less than 0, start an independent process to read all the keys in the rollback-{n-2}.wal file and remove duplicates; The keys after deduplication are stored in the database in the form of a fifth key-value pair; wherein the fifth key of the fifth key-value pair is .mvcc.m.versionkl:{n-2}, and the fifth value of the fifth key-value pair is the keys after deduplication; Receiving a first cropping instruction sent by a user; wherein the first cropping instruction includes a second block height; Dividing the second block height by the block security depth to obtain a second value, and multiplying the second value by the block security depth to obtain a third block height; Read the six keys corresponding to .mvcc.m.versionkl:{the second value} from the database; Perform the following operations on each of the six keys read: Splicing the sixth key and the third block height together to obtain a seventh key; splicing the sixth key and the initial block height to obtain an eighth key; The seventh key and the eighth key are located by binary search, and the seventh key, the eighth key and the data between the eighth key and the seventh key are deleted.

2. The method according to claim 1, characterized in that After generating the rollbcak-n.wal file, the following steps are also included: When n-2 is not less than 0, delete the rollbcak-(n-2).wal file.

3. The method according to claim 1, characterized in that Also includes: Execute a first transaction to update a first key-value pair, remove a version number from a first key in the first key-value pair to obtain a second key, and cache the second key; After passing through the first block height interval, the following operations are performed on each of the second keys: Divide the current block height by the block safety depth to obtain a first value, multiply the first value by the block safety depth to obtain a second end height of a second block height interval, and use 0 as a second start height of the second block height interval; The second key and the second starting height of the second block height interval are spliced ​​together to obtain a third key, and the second key and the second ending height of the second block height interval are spliced ​​together to obtain a fourth key; wherein the second ending height is lower than the first starting height of the first block height interval; The third key and the fourth key are located by binary search, and the third key, the fourth key and the data between the third key and the fourth key are deleted.

4. A computer device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 3.

5. A storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.