CN111046029A - Data clipping method, device and storage medium - Google Patents
Data clipping method, device and storage medium Download PDFInfo
- Publication number
- CN111046029A CN111046029A CN201911224003.2A CN201911224003A CN111046029A CN 111046029 A CN111046029 A CN 111046029A CN 201911224003 A CN201911224003 A CN 201911224003A CN 111046029 A CN111046029 A CN 111046029A
- Authority
- CN
- China
- Prior art keywords
- key
- height
- block
- value
- keys
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000004590 computer program Methods 0.000 claims description 8
- 244000141353 Prunus domestica Species 0.000 abstract 1
- 230000007246 mechanism Effects 0.000 description 10
- 230000000694 effects Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000013138 pruning Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/215—Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Abstract
The invention provides a data clipping method, a device and a storage medium, which relate to the technical field of block chains and the like, and the method comprises the following steps: judging whether the height of the first block is smaller than the cutting safety height and larger than a second difference value between the height of the current block and the number of the first blocks: if yes, storing the height of the first block into a height list of the second key; determining whether the total number of height lists for each second key exceeds a preconfigured first threshold: if yes, the following operations are respectively executed on each second key: and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching the corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs. The present application prunes useless state data stored in a state database.
Description
Technical Field
The present application relates to the field of block chain technology, and in particular, to a data clipping method, device and storage medium.
Background
In another patent application with application number CN201810884295.1, the applicant proposes a data query mechanism that can complete the query of transaction data in the blockchain by one read operation; in the mechanism, each node of a block chain respectively stores a Merck tree of each block and a global index table corresponding to the Merck tree of each block, and the Merck tree and the global index table use the block height H as a version number;
compared with the tree-structured storage data, the mechanism stores less state data, but still generates a lot of useless state data occupation space over time.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies in the prior art, it is desirable to provide a data clipping method, apparatus, and storage medium that clips useless state data.
In a first aspect, the present invention provides a data clipping method applicable to a blockchain node, where the blockchain node is configured with a first number of blocks to be clipped at a single time and a first difference between a current block height and a clipping safety height, and the first number of blocks is greater than the first difference, the method including:
analyzing the first key to obtain a first block height and a second key; wherein the first value is not greater than the first block number;
judging whether the height of the first block is smaller than the cutting safety height and larger than a second difference value between the height of the current block and the number of the first blocks:
if yes, storing the height of the first block into a height list of the second key;
determining whether the total number of height lists for each second key exceeds a preconfigured first threshold:
if yes, the following operations are respectively executed on each second key:
and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching the corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs.
In a second aspect, the present invention provides a data clipping method applied to a blockchain node, where the blockchain node is configured with a first number of blocks to be clipped at a single time and a first difference between a current block height and a clipping safety height, and the first number of blocks is greater than the first difference, the method includes:
analyzing the first key to obtain a first block height and a second key; wherein the first value is not greater than the first block number;
adding one to the number of times of resolving to the second key to update the second numerical value;
judging whether the first block height is smaller than a first difference value and larger than a second difference value between the current block height and the first block number:
if yes, storing the height of the first block into a height list of the second key;
determining whether the second value exceeds a preconfigured second threshold:
if yes, the following operations are respectively executed on each second key:
and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching the corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs.
In a third aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a method of data pruning provided according to embodiments of the present invention.
In a fourth aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the data cropping method provided according to the embodiments of the present invention.
According to the data clipping method, the data clipping device and the data clipping storage medium, provided by the embodiments of the invention, the first block height and the second key are obtained by analyzing the first key; judging whether the height of the first block is smaller than the cutting safety height and larger than a second difference value between the height of the current block and the number of the first blocks: if yes, storing the height of the first block into a height list of the second key; determining whether the total number of height lists for each second key exceeds a preconfigured first threshold: if yes, the following operations are respectively executed on each second key: and according to the second keys and the heights of the blocks in the corresponding height list, restoring a plurality of third keys, searching corresponding stored key value pairs according to the restored third keys, deleting the searched key value pairs, and cutting useless state data stored in the state database.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a data cropping method according to an embodiment of the present invention.
FIG. 2 is a flow diagram of a preferred embodiment of the method shown in FIG. 1.
Fig. 3 is a flowchart of another data clipping method according to an embodiment of the present invention.
FIG. 4 is a flow chart of a preferred embodiment of the method shown in FIG. 3.
Fig. 5 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In another patent application with application number CN201810884295.1, the applicant proposes a data query mechanism that can complete the query of transaction data in block chain by one read operation.
In the above mechanism, each node of the block chain stores the merkel tree of each block and the global index table corresponding to the merkel tree of each block, and the merkel tree and the global index table use the block height H as the version number.
Compared with the tree-structured storage data, the mechanism stores less state data, but still generates a lot of useless state data occupation space over time.
The problems caused by the above mechanism can be solved by the data acquisition method shown in fig. 1.
Fig. 1 is a flowchart of a data cropping method according to an embodiment of the present invention. As shown in fig. 1, in the present embodiment, the present invention provides a data clipping method applicable to a blockchain node, where the blockchain node is configured with a first block number of a single-time clipped block and a first difference between a current block height and a clipping safety height, and the first block number is greater than the first difference, the method includes:
s12: analyzing the first key to obtain a first block height and a second key; wherein the first value is not greater than the first block number;
s14: judging whether the height of the first block is smaller than the cutting safety height and larger than a second difference value between the height of the current block and the number of the first blocks:
if yes, go to step S15: storing the first block height into a height list of the second key;
s16: determining whether the total number of height lists for each second key exceeds a preconfigured first threshold:
if yes, the following operations are respectively executed on each second key:
s17: and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching the corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs.
Specifically, assume that the state database has stored therein:
key:-mvcc-.d.hello0.00000000000000008000,value:world0;
key:-mvcc-.d.hello1.00000000000000008000,value:world1;
key:-mvcc-.d.hello2.00000000000000008000,value:world2;
key:-mvcc-.d.hello3.00000000000000008000,value:world3;
the height of the current block is 10000, the number of first blocks of a single cutting block is 5000, a first difference value between the height of the current block and the cutting safety height is 1000, a first value is 1000, and a first threshold value is 3; restoring a plurality of third keys according to the second keys and the corresponding plurality of block heights in the height list to: restoring a third key according to the second key and the height of each block in the corresponding height list;
in step S12, the node parses a first key "key: -mvcc-. d.hello 0.00000000000000008000", acquires a first tile height 8000 and a second key hello 0;
similarly, the node analyzes a first key 'key: -mvcc-. d.hello 1.000000000000000000008000', and obtains a first block height 8000 and a second key hello 1; the node analyzes a first key '-mvcc-. d.hello 2.00000000000000008000' to obtain a first block height 8000 and a second key hello 2; the node analyzes a first key '-mvcc-. d.hello 3.00000000000000008000' to obtain a first block height 8000 and a second key hello 3;
in step S14, the node determines whether the first block height is smaller than the clipping safety height and larger than a second difference between the current block height and the first block number;
since 8000< (10000-: the node stores 8000 into the height list of the second key hello0, at this time, the height list of the second key hello0 is updated to map _ hello0[8000 ];
similarly, the height list of the second key hello1 is updated to map _ hello1[8000 ]; the altitude list of the second key hello2 is updated to map _ hello2[8000 ]; the altitude list of the second key hello3 is updated to map _ hello3[8000 ];
in step S16, the node determines whether the total number of height lists for each second key exceeds a preconfigured first threshold:
since the total height list of the second keys is 4 and the first threshold is 3, the following operations are respectively performed on the second keys:
in step S17, the node restores a third key according to the second key and the heights of the blocks in the corresponding height list, searches for a corresponding stored key-value pair according to each restored third key, and deletes each found key-value pair, that is, the node restores the third key according to hello0 and 8000, the restored third key is key: -mvcc-. d.hello0.00000000000000008000, and searches for a corresponding stored key-value pair 'key: -mvcc-. d.hello 0.0000000000008000, and value: world 0', and deletes the found key-value pair 'key: -mvcc-. d.hello 0.0000000000008000, and value: world 0';
similarly, the node restores key of-mvcc-. d.hello 1.0000000000008000, searches the key value pair of-mvcc-. d.hello 1.0000000000008000 and value of world 1; deleting key of-mvcc-. d.hello 1.0000000000008000, value of world 1;
the node restores key of-mvcc-. d.hello 2.0000000000008000, searches the key value pair of-mvcc-. d.hello 2.0000000000008000 and value of world 2; deleting key of-mvcc-. d.hello 2.0000000000008000, value of world 2;
the node restores key of-mvcc-. d.hello 3.0000000000008000, searches the key value pair of-mvcc-. d.hello 3.0000000000008000 and value of world 3; and delete key: -mvcc-. d.hello 3.0000000000008000, value: world 3.
The above embodiment stores in the status database:
key:-mvcc-.d.hello0.00000000000000008000,value:world0;
key:-mvcc-.d.hello1.00000000000000008000,value:world1;
key:-mvcc-.d.hello2.00000000000000008000,value:world2;
key:-mvcc-.d.hello3.00000000000000008000,value:world3;
the height of the current block is 10000, the number of first blocks of a single cutting block is 5000, a first difference value between the height of the current block and the cutting safety height is 1000, a first value is 1000, and a first threshold value is 3; restoring a plurality of third keys according to the second keys and the corresponding plurality of block heights in the height list to: the third key is restored according to the heights of the second key and each block in the corresponding height list;
in further embodiments, the first threshold may also be configured according to actual requirements, for example, configured as 10, and the same technical effect may be achieved.
In further embodiments, restoring the third keys according to the second keys and the block heights in the corresponding height list may further be configured as follows according to actual requirements: the same technical effect can be achieved by restoring a plurality of third keys according to the second keys and the block heights in the corresponding height list except the latest N block heights, wherein N is a positive integer, for example, N is configured to be 1.
In further embodiments, the determining mechanism of step S16 may be further configured to: the same technical effect can be achieved by judging whether the total height of the blocks stored in the height list of each second key exceeds a pre-configured first threshold.
FIG. 2 is a flow diagram of a preferred embodiment of the method shown in FIG. 1. As shown in fig. 2, in a preferred embodiment, after step S17, the method further includes:
s18: deleting the block heights of the restored third key in the corresponding height list.
Specifically, in step S18, the tile heights of the corresponding height list for restoring the third key are deleted, i.e., the corresponding height list is updated as:
map_hello0[null];
map_hello1[null];
map_hello2[null];
map_hello3[null];。
in further embodiments, S18 may be further configured to: the same technical effect can be realized by marking the deletion mark on the height of each block for restoring the third key in the corresponding height list. At this time, the corresponding altitude list is updated as:
map_hello0[8000(deleted)];
map_hello1[8000(deleted)];
map_hello2[8000(deleted)];
map_hello3[8000(deleted)]。
preferably, before step S12, a step of triggering a clipping mechanism is further configured, for example: determining whether a remainder of the current block height and the preconfigured first value is 0: if yes, go to step S12; the first value is not larger than the first block number, and the same technical effect can be achieved.
Fig. 3 is a flowchart of another data clipping method according to an embodiment of the present invention. As shown in fig. 3, in this embodiment, a data clipping method applicable to a blockchain node is provided, where the blockchain node is configured with a first block number of a single-time clipped block and a first difference between a current block height and a clipping safety height, and the first block number is greater than the first difference, and the method includes:
s22: analyzing the first key to obtain a first block height and a second key; wherein the first value is not greater than the first block number;
s23: adding one to the number of times of resolving to the second key to update the second numerical value;
s24: judging whether the first block height is smaller than a first difference value and larger than a second difference value between the current block height and the first block number:
if yes, go to step S25: storing the first block height into a height list of the second key;
s26: determining whether the second value exceeds a preconfigured second threshold:
if yes, the following operations are respectively executed on each second key:
s27: and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching the corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs.
Specifically, assume that the state database has stored therein:
key:-mvcc-.d.hello0.00000000000000008000,value:world0;
key:-mvcc-.d.hello1.00000000000000008000,value:world1;
key:-mvcc-.d.hello2.00000000000000008000,value:world2;
key:-mvcc-.d.hello3.00000000000000008000,value:world3;
the height of the current block is 10000, the number of first blocks of a single cutting block is 5000, the first difference value between the height of the current block and the cutting safety height is 1000, the first numerical value is 1000, and the second threshold value is 3; restoring a plurality of third keys according to the second keys and the corresponding plurality of block heights in the height list to: restoring a third key according to the second key and the height of each block in the corresponding height list;
in step S22, the node parses a first key "key: -mvcc-. d.hello 0.00000000000000008000", acquires a first tile height 8000 and a second key hello 0;
similarly, the node analyzes a first key 'key: -mvcc-. d.hello 1.000000000000000000008000', and obtains a first block height 8000 and a second key hello 1; the node analyzes a first key '-mvcc-. d.hello 2.00000000000000008000' to obtain a first block height 8000 and a second key hello 2; the node analyzes a first key '-mvcc-. d.hello 3.00000000000000008000' to obtain a first block height 8000 and a second key hello 3;
in step S23, the number of times of resolving to the second key is increased by one to update the second value, that is, when the node resolves to key: -mvcc-,. d.hello0.00000000000000008000, the second value is updated to 1, when the node resolves to key: -mvcc-,. d.hello 1.0000000000008000, the second value is updated to 2, when the node resolves to key: -mvcc-,. d.hello 2.0000000000008000, the second value is updated to 3, when the node resolves to key: -mvcc-,. d.hello 0.000000008000, the second value is updated to 4.
In step S24, it is determined whether the first block height is smaller than a first difference and larger than a second difference between the current block height and the first block number:
since 8000< (10000-: the node stores 8000 into the height list of the second key hello0, at this time, the height list of the second key hello0 is updated to map _ hello0[8000 ];
similarly, the height list of the second key hello1 is updated to map _ hello1[8000 ]; the altitude list of the second key hello2 is updated to map _ hello2[8000 ]; the altitude list of the second key hello3 is updated to map _ hello3[8000 ];
in step S26, the node determines whether the second value exceeds a preconfigured second threshold:
since the second numerical value is 4 and the second threshold value is 3, the following operations are respectively performed on each second key:
in step S27, the node restores a plurality of third keys according to the heights of the second keys and the blocks in the corresponding height list, searches for the corresponding stored key-value pairs according to the restored third keys, and deletes each found key-value pair, i.e., the node, i.e., restores the third keys according to hello0 and 8000, the restored third keys are key: -mvcc-. d.hello0.00000000000000008000, and searches for the corresponding stored key-value pair "key: -mvcc-. d.hello 0.0000000000008000, value: world 0", and deletes the found key-value pair "key: -mvcc-. d.hello0.00000000000000008000, value: world 0";
similarly, the node restores key of-mvcc-. d.hello 1.0000000000008000, searches the key value pair of-mvcc-. d.hello 1.0000000000008000 and value of world 1; deleting key of-mvcc-. d.hello 1.0000000000008000, value of world 1;
the node restores key of-mvcc-. d.hello 2.0000000000008000, searches the key value pair of-mvcc-. d.hello 2.0000000000008000 and value of world 2; deleting key of-mvcc-. d.hello 2.0000000000008000, value of world 2;
the node restores key of-mvcc-. d.hello 3.0000000000008000, searches the key value pair of-mvcc-. d.hello 3.0000000000008000 and value of world 3; and delete key: -mvcc-. d.hello 3.0000000000008000, value: world 3.
The above embodiment assumes that the state database stores:
key:-mvcc-.d.hello0.00000000000000008000,value:world0;
key:-mvcc-.d.hello1.00000000000000008000,value:world1;
key:-mvcc-.d.hello2.00000000000000008000,value:world2;
key:-mvcc-.d.hello3.00000000000000008000,value:world3;
the height of the current block is 10000, the number of first blocks of a single cutting block is 5000, the first difference value between the height of the current block and the cutting safety height is 1000, the first numerical value is 1000, and the second threshold value is 3; restoring a plurality of third keys according to the second keys and the corresponding plurality of block heights in the height list to: the third key is restored according to the heights of the second key and each block in the corresponding height list for detail explanation;
in further embodiments, the second threshold may also be configured according to actual requirements, for example, configured as 10, and the same technical effect may be achieved.
In further embodiments, restoring the third keys according to the second keys and the block heights in the corresponding height list may further be configured as follows according to actual requirements: the same technical effect can be achieved by restoring a plurality of third keys according to the second keys and the block heights in the corresponding height list except the latest N block heights, wherein N is a positive integer, for example, N is configured to be 1.
FIG. 4 is a flow chart of a preferred embodiment of the method shown in FIG. 3. As shown in fig. 2, in a preferred embodiment, after step S27, the method further includes:
s28: deleting the block heights of the restored third key in the corresponding height list.
Specifically, in step S28, the tile heights of the corresponding height list for restoring the third key are deleted, i.e., the corresponding height list is updated as:
map_hello0[null];
map_hello1[null];
map_hello2[null];
map_hello3[null];。
in further embodiments, S28 may be further configured to: the same technical effect can be realized by marking the deletion mark on the height of each block for restoring the third key in the corresponding height list. At this time, the corresponding altitude list is updated as:
map_hello0[8000(deleted)];
map_hello1[8000(deleted)];
map_hello2[8000(deleted)];
map_hello3[8000(deleted)]。
preferably, before step S22, a step of triggering a clipping mechanism is further configured, for example: determining whether a remainder of the current block height and the preconfigured first value is 0: if yes, go to step S22; the first value is not larger than the first block number, and the same technical effect can be achieved.
Fig. 5 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 5, as another aspect, the present application also provides an apparatus 500 including one or more Central Processing Units (CPUs) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the apparatus 500 are also stored. The CPU501, ROM502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the data clipping method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing a method of data cropping. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the data cropping methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (6)
1. A data clipping method is characterized in that a first block number of a single clipping block and a first difference between a current block height and a clipping safety height are configured on a block chain node, wherein the first block number is greater than the first difference, the method is applied to the block chain node, and the method comprises the following steps:
analyzing the first key to obtain a first block height and a second key; wherein the first value is not greater than the first number of blocks;
judging whether the height of the first block is smaller than the cutting safety height and larger than a second difference value between the height of the current block and the number of the first blocks:
if yes, storing the height of the first block into a height list of the second key;
determining whether a total amount of the list of heights of each of the second keys exceeds a preconfigured first threshold:
if yes, the following operations are respectively executed on each second key:
and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs.
2. The method of claim 1, wherein after deleting each located key-value pair, further comprising:
deleting the block heights of the restored third key in the corresponding height list.
3. A data clipping method is characterized in that a first block number of a single clipping block and a first difference between a current block height and a clipping safety height are configured on a block chain node, wherein the first block number is greater than the first difference, the method is applied to the block chain node, and the method comprises the following steps:
analyzing the first key to obtain a first block height and a second key; wherein the first value is not greater than the first number of blocks;
adding one to the number of times of resolving to the second key to update a second numerical value;
judging whether the first block height is smaller than the first difference value and larger than a second difference value between the current block height and the first block number:
if yes, storing the height of the first block into a height list of the second key;
determining whether the second value exceeds a preconfigured second threshold:
if yes, the following operations are respectively executed on each second key:
and restoring a plurality of third keys according to the second keys and the heights of the blocks in the corresponding height list, searching the corresponding stored key value pairs according to the restored third keys, and deleting the searched key value pairs.
4. The method of claim 3, wherein after deleting each located key-value pair, further comprising:
deleting the block heights of the restored third key in the corresponding height list.
5. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-4.
6. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911224003.2A CN111046029A (en) | 2019-12-04 | 2019-12-04 | Data clipping method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911224003.2A CN111046029A (en) | 2019-12-04 | 2019-12-04 | Data clipping method, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111046029A true CN111046029A (en) | 2020-04-21 |
Family
ID=70234417
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911224003.2A Pending CN111046029A (en) | 2019-12-04 | 2019-12-04 | Data clipping method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111046029A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797086A (en) * | 2020-07-03 | 2020-10-20 | 杭州复杂美科技有限公司 | Data clipping method, device and storage medium |
CN112417054A (en) * | 2020-12-09 | 2021-02-26 | 杭州复杂美科技有限公司 | Distributed data storage method, data query method, device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180189333A1 (en) * | 2017-01-03 | 2018-07-05 | International Business Machines Corporation | Limiting blockchain size to optimize performance |
CN109684333A (en) * | 2018-12-24 | 2019-04-26 | 杭州复杂美科技有限公司 | A kind of storage of data and method of cutting out, equipment and storage medium |
WO2019179539A2 (en) * | 2019-07-11 | 2019-09-26 | Alibaba Group Holding Limited | Shared blockchain data storage |
CN110442577A (en) * | 2019-07-15 | 2019-11-12 | 杭州复杂美科技有限公司 | A kind of storage of status data, inquiry and management method, equipment and storage medium |
-
2019
- 2019-12-04 CN CN201911224003.2A patent/CN111046029A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180189333A1 (en) * | 2017-01-03 | 2018-07-05 | International Business Machines Corporation | Limiting blockchain size to optimize performance |
CN109684333A (en) * | 2018-12-24 | 2019-04-26 | 杭州复杂美科技有限公司 | A kind of storage of data and method of cutting out, equipment and storage medium |
WO2019179539A2 (en) * | 2019-07-11 | 2019-09-26 | Alibaba Group Holding Limited | Shared blockchain data storage |
CN110442577A (en) * | 2019-07-15 | 2019-11-12 | 杭州复杂美科技有限公司 | A kind of storage of status data, inquiry and management method, equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
MARTIN FLORIAN: "Erasing Data from Blockchain Nodes" * |
尤瑶;孔兰菊;肖宗水;郑永清;李庆忠;: "一种支持区块链交易溯源的混合索引机制" * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797086A (en) * | 2020-07-03 | 2020-10-20 | 杭州复杂美科技有限公司 | Data clipping method, device and storage medium |
CN112417054A (en) * | 2020-12-09 | 2021-02-26 | 杭州复杂美科技有限公司 | Distributed data storage method, data query method, device and storage medium |
CN112417054B (en) * | 2020-12-09 | 2024-03-05 | 北京万古科技股份有限公司 | Distributed data storage method, data query method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109684333B (en) | Data storage and cutting method, equipment and storage medium | |
US10489454B1 (en) | Indexing a dataset based on dataset tags and an ontology | |
CN109559234B (en) | Block chain state data storage method, equipment and storage medium | |
US9535761B2 (en) | Tracking large numbers of moving objects in an event processing system | |
CN112364209B (en) | Distributed data storage method, data query method, device and storage medium | |
CN108171267B (en) | User group division method and device and message pushing method and device | |
CN111046029A (en) | Data clipping method, device and storage medium | |
CN110287170B (en) | Database upgrading method, state data calling method, device and storage medium | |
US20180197302A1 (en) | Method and apparatus for determining to-be-superimposed area of image, superimposing image and presenting picture | |
CN109815343B (en) | Method, apparatus, device and medium for obtaining data models in a knowledge graph | |
CN109542455B (en) | Contract execution method, contract reduction method, device, and storage medium | |
US10241963B2 (en) | Hash-based synchronization of geospatial vector features | |
CN110633594A (en) | Target detection method and device | |
CN110083677B (en) | Contact person searching method, device, equipment and storage medium | |
US10733218B2 (en) | System, method, and program for aggregating data | |
CN114519061A (en) | Map data updating method, device, electronic equipment and medium | |
CN112182029A (en) | Data query method, device and storage medium | |
CN110825947B (en) | URL deduplication method, device, equipment and computer readable storage medium | |
CN110322350B (en) | Method, device, equipment and storage medium for cutting hollow block in consensus network | |
US20230046868A1 (en) | Information processing method and apparatus, device, and computer-readable storage medium | |
CN112417054B (en) | Distributed data storage method, data query method, device and storage medium | |
CN110019295B (en) | Database retrieval method, device, system and storage medium | |
CN115495606A (en) | Image gathering method and system | |
GB2496500A (en) | Intranet search engine that takes account of email data | |
Khade et al. | Frequent set mining for streaming mixed and large data |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200421 |
|
WD01 | Invention patent application deemed withdrawn after publication |