CN111597262B - Management method and management system for block data in block chain - Google Patents

Management method and management system for block data in block chain Download PDF

Info

Publication number
CN111597262B
CN111597262B CN202010406741.5A CN202010406741A CN111597262B CN 111597262 B CN111597262 B CN 111597262B CN 202010406741 A CN202010406741 A CN 202010406741A CN 111597262 B CN111597262 B CN 111597262B
Authority
CN
China
Prior art keywords
block
data
sub
objects
abstract
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.)
Active
Application number
CN202010406741.5A
Other languages
Chinese (zh)
Other versions
CN111597262A (en
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.)
Beijing Peersafe Technology Co ltd
Original Assignee
Beijing Peersafe 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 Beijing Peersafe Technology Co ltd filed Critical Beijing Peersafe Technology Co ltd
Priority to CN202010406741.5A priority Critical patent/CN111597262B/en
Publication of CN111597262A publication Critical patent/CN111597262A/en
Application granted granted Critical
Publication of CN111597262B publication Critical patent/CN111597262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a block data management method in a block chain, which comprises the following steps: 1) Creating a new block object for each new block, wherein the sub-object included in the block object is consistent with the sub-object of the parent block, and the block object records the position and the abstract value of the sub-object; 2) Calculating the sub-object to be modified in the new block, and modifying; 3) For the child object which has been modified, changing the position and abstract value of the child object included in the parent object; 4) The recursive manner is modified until the tile object is reached. The invention also correspondingly provides a system for managing the block data in the block chain. The invention can effectively manage the block data, improve the multiplexing rate of the multi-block shared data, and accelerate the production speed of the blocks, so that the management efficiency of the block chain node on the block data is higher.

Description

Management method and management system for block data in block chain
Technical Field
The invention belongs to the technical field of data memory object management, and particularly relates to a management method and a management system for block data in a block chain.
Background
The generation and management scheme of the blocks of the current block chain is simpler. In blockchain systems such as UTXO architectures, there is no concept of balance, and what the node program is concerned with is how to manage the transactions under one account that are not consumed, i.e., UTXOs. However, in the blockchain system of the "account-balance" system represented by the ethernet, the balance of a certain account at a certain moment is required, unlike the UTXO system, the balance of the account can be directly checked out on the data corresponding to a block, instead of traversing and counting all transactions under the user, which is also a great feature of the "account-balance" system.
In an "account-balance" system, the balance of each account on each block may be different due to the existence of the balance concept, while the account on the adjacent block is not very different. That is, there are cases where the blocks are not exactly the same, but the differences are not very large.
How to use this feature to make each block share common data and make a certain distinction is an important point to be considered.
The current blockchain system divides each block separately, creates a block object, and loads corresponding data under the block, which is a forward loading mode with low efficiency.
Disclosure of Invention
Aiming at the problems in the background technology, the invention provides a new block memory organization method, which relates to three aspects of basic block design, new block generation method and block storage/loading, and can be used by a block chain node program for reference. One of the important modules in the blockchain node is the memory object management of the block, how to design a management scheme of the block directly influences the speed of producing the block by the blockchain network, and a reasonable block management scheme also influences the memory use efficiency of the node process. The invention provides a new implementation scheme aiming at the block memory object of the block chain node.
The invention provides a block data management method in a block chain, which comprises the following steps:
1) Creating a new block object for each new block, wherein the sub-object included in the block object is consistent with the sub-object of the parent block, and the block object records the position and the abstract value of the sub-object;
2) Calculating the sub-object to be modified in the new block, and modifying;
3) For the child object which has been modified, changing the position and abstract value of the child object included in the parent object;
4) The recursive manner is modified until the tile object is reached.
The invention also proposes a management system of block data in a block chain, the system having a processor capable of completing the steps of:
1) Creating a new block object for each new block, wherein the sub-object included in the block object is consistent with the sub-object of the parent block, and the block object records the position and the abstract value of the sub-object;
2) Calculating the sub-object to be modified in the new block, and modifying;
3) For the child object which has been modified, changing the position and abstract value of the child object included in the parent object;
4) The recursive manner is modified until the tile object is reached.
The invention effectively manages the block data, improves the multiplexing rate of multi-block shared data, accelerates the production speed of the block and ensures that the management efficiency of the block chain node on the block data is higher by designing the data structure of the basic block and modifying the leaf object, returning the leaf object and recursively modifying the father object.
Drawings
For easier understanding of the present invention, the present invention will be described in more detail by referring to specific embodiments shown in the drawings. These drawings depict only typical embodiments of the invention and are not therefore to be considered to limit the scope of the invention.
FIG. 1 is a block base data structure diagram.
FIG. 2 is a flow chart for modifying data objects within a block.
FIG. 3 is a flow chart of the read object data at block loading.
Detailed Description
Embodiments of the present invention will now be described with reference to the drawings, wherein like elements are designated by like reference numerals. The following embodiments and technical features in the embodiments may be combined with each other without collision.
As shown in fig. 1, the present invention first proposes a block base data structure. In this basic data structure, a chunk is also essentially an object, each chunk object containing N sub-objects, each sub-object having a pointer and summary data. These pointers and summary data are maintained by the tile object. That is, each tile object maintains N pointers and N digest data (preferably, 16 pointers and 16 digest data are used, and the invention is described below by taking 16 as an example). The object pointed by each pointer corresponds to the original object of each abstract data one by one, namely the abstract data of the sub-object pointed by the first pointer is recorded at the position of the first abstract data, and so on.
The object pointed to by each pointer in a block may be a null object (null value), a leaf object, or a node object. Leaf objects are useful user entity data such as user addresses, user actions, etc. Node objects, like folders, may contain leaf objects and node objects. Each node object also contains 16 pointers and 16 summary data.
The block object is a special node object, and M layers (for example, 64 layers) of data are set in total from the block object to the object at the lowest layer. 16 pointers and 64 layers of data are selected as above, which is relevant to the programming implementation. The summary value of the data is 256 bits, the maximum representable number of the 4 bits is 16, just 16 child nodes can be specified, if the position represented by a certain 4 bits already has data, another 4 bits are needed to confirm the position of the data, and in order not to conflict, one layer is sunk, so that 256/4=64 layers are sunk in total. The position can be expressed by 8 bits, so that 256 nodes can exist, and 32 layers can sink; if 2 bits are designed to represent the position, there can be 4 sub-nodes, which sink 128 layers.
In summary, the block-based data structure of the present invention is characterized as follows:
1) Each block object contains 16 sub-objects;
2) Each block object records the pointer (or other data as long as the storage position of the sub object can be found) and summary data of the sub object;
3) Each sub-object type is divided into a leaf object, a node object and an empty object;
4) Each node object also contains pointers and summary data for 16 sub-objects and corresponding objects.
The generation method of a new block based on the block basic data structure is described below with reference to fig. 2.
S1, creating a block object, wherein 16 pointers and 16 summary data follow the values recorded in the parent block. The new block is now a different object than the parent block, but other values are the same except for the block number and time. I.e. the content pointed to by the two blocks at this point is identical.
S2, checking the transaction generated in the round of consensus period, and modifying the corresponding node object. At this time, instead of modifying the original object, an object new entry is created, and the correct value is recorded in the new object. Taking an example: for example, a transaction is a 100-element transfer of user A (layer 6, layer 2 leaf object) to user B (layer 5, layer 8 leaf object) that causes layer 6, layer 2 leaf object to change from layer 5, layer 8 leaf object. At this time, instead of modifying the two original objects, an object is created in which the correct value is recorded, namely: the A account has 500 elements and the B account has 300 elements.
S3, modifying the parent object of the corresponding leaf object, and modifying the corresponding pointer value and the abstract value. For example, the corresponding record of the child object in the parent object is the nth pointer and the nth object, at this time, the nth pointer is replaced by the pointer of the new object new entity in S2, and the nth digest value is replaced by the digest value of the new object new entity in S2.
S4, since the execution of S3 directly affects the parent object of the parent object, the same operation is performed in a recursion direction. I.e., modifying the parent object to which each child object has been modified, to the block root object. Some pointers and digest values recorded in the final block root object have changed.
At this point, the content recorded in the new chunk is already different from its parent chunk, but is limited to only a few leaf objects and corresponding node objects that have been modified.
In summary, the new block generation method is characterized in that:
1) Creating a new object for each new block, wherein the child object contained in the new block object is consistent with the child object of the parent block;
2) Calculating leaf objects needing to be modified in the new block, and modifying the leaf objects;
3) For leaf objects that have been modified, the contents of their parent are changed: including pointers and digest values corresponding to the child objects;
4) The modification is recursively performed until the block object.
The following describes a method of storing and loading a block based on the block basic data structure with reference to fig. 3.
And T1, recording basic information data of the block in a relational data table, wherein the basic information data comprises abstract data of the block. The object data of the block content is recorded in a key-value database, and each abstract value corresponds to one block object data. The abstract value is the key, and the serialization data of the corresponding sub-object is the value.
And T2, reading block abstract data from a relational database at first during loading, reading block object data from a key-value database according to the abstract value, recording abstract values of all sub-objects in the object data, respectively reading all the sub-object data according to the abstract values, distributing memory space for the sub-objects, and recording sub-object pointers at corresponding positions of 16 pointers. If there are node objects in the sub-objects, each sub-object of the node object is continued, and the sub-objects are recursively read until all the sub-objects do not contain node objects, at which time the block data is fully loaded.
In summary, the storage and loading method of the block is characterized in that:
1) And (3) storing: basic information data of the block is recorded in a relational data table, and object data of the block content is recorded in a key-value database.
2) Loading: the block digest data is read out from the relational database, and then all object data is read out from the key-value database in a recursion mode according to the digest value.
The present invention also proposes a management system for block data in a blockchain, said system having a processor capable of performing the method steps as described above.
The above embodiments are only preferred embodiments of the present invention, and it is intended that the common variations and substitutions made by those skilled in the art within the scope of the technical solution of the present invention are included in the scope of the present invention.

Claims (10)

1. A method of managing block data in a blockchain, comprising:
1) Creating a new block object for each new block, wherein the block object comprises a child object, the position and the abstract value of the child object are recorded by the block object, and the content pointed by the new block and the parent block of the new block is the same;
2) Calculating the sub-object to be modified in the new block, and modifying;
3) For the child object which has been modified, changing the position and abstract value of the child object included in the parent object;
4) The recursive manner is modified until the tile object is reached.
2. The method of claim 1, wherein the block data in the blockchain is managed by a block manager,
each child object type is divided into leaf objects, node objects, and null objects, the node objects containing leaf objects and/or node objects.
3. The method of claim 1, wherein the block data in the blockchain is managed by a block manager,
the block object records the location of the child object as a pointer to the child object.
4. The method of managing block data in a blockchain of claim 3, further comprising:
the basic information data of the block is recorded in a relational data table and comprises abstract data of the block, the object data of the block content is recorded in a key-value database, and each abstract value corresponds to one block object data.
5. The method of managing block data in a blockchain of claim 4, further comprising:
when loading, firstly reading block abstract data from a relational database, then reading block object data from a key-value database according to the abstract value, recording abstract values of all sub-objects in the object data, respectively reading all the sub-object data according to the abstract values, distributing storage space for the sub-objects, and recording sub-object pointers at corresponding positions of the pointers.
6. A system for managing block data in a blockchain, the system having a processor capable of performing the steps of:
1) Creating a new block object for each new block, wherein the block object comprises a child object, the position and the abstract value of the child object are recorded by the block object, and the content pointed by the new block and the parent block of the new block is the same;
2) Calculating the sub-object to be modified in the new block, and modifying;
3) For the child object which has been modified, changing the position and abstract value of the child object included in the parent object;
4) The recursive manner is modified until the tile object is reached.
7. The system for managing block data in a blockchain of claim 6,
each child object type is divided into leaf objects, node objects, and null objects, the node objects containing leaf objects and/or node objects.
8. The system for managing block data in a blockchain of claim 6,
the block object records the location of the child object as a pointer to the child object.
9. The system for managing block data in a blockchain of claim 8, further comprising:
the basic information data of the block is recorded in a relational data table and comprises abstract data of the block, the object data of the block content is recorded in a key-value database, and each abstract value corresponds to one block object data.
10. The system for managing block data in a blockchain of claim 9, further comprising:
when loading, firstly reading block abstract data from a relational database, then reading block object data from a key-value database according to the abstract value, recording abstract values of all sub-objects in the object data, respectively reading all the sub-object data according to the abstract values, distributing storage space for the sub-objects, and recording sub-object pointers at corresponding positions of the pointers.
CN202010406741.5A 2020-05-14 2020-05-14 Management method and management system for block data in block chain Active CN111597262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010406741.5A CN111597262B (en) 2020-05-14 2020-05-14 Management method and management system for block data in block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010406741.5A CN111597262B (en) 2020-05-14 2020-05-14 Management method and management system for block data in block chain

Publications (2)

Publication Number Publication Date
CN111597262A CN111597262A (en) 2020-08-28
CN111597262B true CN111597262B (en) 2023-05-02

Family

ID=72190741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010406741.5A Active CN111597262B (en) 2020-05-14 2020-05-14 Management method and management system for block data in block chain

Country Status (1)

Country Link
CN (1) CN111597262B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169055A (en) * 2017-04-27 2017-09-15 北京众享比特科技有限公司 The operating method and operating system of a kind of database table
CN107743064A (en) * 2017-09-28 2018-02-27 深圳市易成自动驾驶技术有限公司 The common recognition method and system of block chain
WO2018124716A1 (en) * 2016-12-29 2018-07-05 주식회사 코인플러그 Method for providing integrated point service by using merkle tree structure in utxo-based protocol, and support server using same
CN108520415A (en) * 2018-04-26 2018-09-11 泰康保险集团股份有限公司 Data processing method based on block chain and device
CN108846659A (en) * 2018-06-13 2018-11-20 深圳前海微众银行股份有限公司 Transfer account method, device and storage medium based on block chain
WO2019021107A1 (en) * 2017-07-24 2019-01-31 nChain Holdings Limited Computer-implemented system and method for managing a large distributed memory pool in a blockchain network
CN109408521A (en) * 2018-09-28 2019-03-01 上海擎沣投资控股有限公司 A kind of method and device thereof for more new block chain global data state
CN110347660A (en) * 2019-06-28 2019-10-18 阿里巴巴集团控股有限公司 Based on the classification storage method and device of block chain, electronic equipment
CN110347684A (en) * 2019-06-28 2019-10-18 阿里巴巴集团控股有限公司 Based on the classification storage method and device of block chain, electronic equipment
CN110457319A (en) * 2019-07-31 2019-11-15 阿里巴巴集团控股有限公司 Block chain state date storage method and device, electronic equipment
CN110471795A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Block chain state data reconstruction method and device, electronic equipment
JP2020046961A (en) * 2018-09-19 2020-03-26 富士通株式会社 Transaction management device, transaction management method and transaction management program

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018124716A1 (en) * 2016-12-29 2018-07-05 주식회사 코인플러그 Method for providing integrated point service by using merkle tree structure in utxo-based protocol, and support server using same
CN107169055A (en) * 2017-04-27 2017-09-15 北京众享比特科技有限公司 The operating method and operating system of a kind of database table
WO2019021107A1 (en) * 2017-07-24 2019-01-31 nChain Holdings Limited Computer-implemented system and method for managing a large distributed memory pool in a blockchain network
CN107743064A (en) * 2017-09-28 2018-02-27 深圳市易成自动驾驶技术有限公司 The common recognition method and system of block chain
CN108520415A (en) * 2018-04-26 2018-09-11 泰康保险集团股份有限公司 Data processing method based on block chain and device
CN108846659A (en) * 2018-06-13 2018-11-20 深圳前海微众银行股份有限公司 Transfer account method, device and storage medium based on block chain
JP2020046961A (en) * 2018-09-19 2020-03-26 富士通株式会社 Transaction management device, transaction management method and transaction management program
CN109408521A (en) * 2018-09-28 2019-03-01 上海擎沣投资控股有限公司 A kind of method and device thereof for more new block chain global data state
CN110347660A (en) * 2019-06-28 2019-10-18 阿里巴巴集团控股有限公司 Based on the classification storage method and device of block chain, electronic equipment
CN110347684A (en) * 2019-06-28 2019-10-18 阿里巴巴集团控股有限公司 Based on the classification storage method and device of block chain, electronic equipment
CN110457319A (en) * 2019-07-31 2019-11-15 阿里巴巴集团控股有限公司 Block chain state date storage method and device, electronic equipment
CN110471795A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Block chain state data reconstruction method and device, electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A Blockchain-Based Framework for Data Sharing With Fine-Grained Access Control in Decentralized Storage Systems";Shangping Wang等;《IEEE Access 》;全文 *
"基于嵌套Merkle Hash tree区块链的云数据动态审计模型";周坚等;《计算机应用》;全文 *

Also Published As

Publication number Publication date
CN111597262A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN110471795B (en) Block chain state data recovery method and device and electronic equipment
TWI731595B (en) Block chain state data storage method and device, and electronic equipment
EP2069979B1 (en) Dynamic fragment mapping
US9659048B2 (en) Key-Value data storage system
EP0801773B1 (en) Storage plane organization and storage systems based thereon
US6532476B1 (en) Software based methodology for the storage and retrieval of diverse information
US6415375B2 (en) Information storage and retrieval system
CN103631538A (en) Cold and hot data identification threshold value calculation method, device and system
CN101315628A (en) Internal memory database system and method and device for implementing internal memory data base
CN103370691A (en) Managing buffer overflow conditions
CN103106286A (en) Method and device for managing metadata
CN103577513A (en) Systems and/or methods for caching xml information sets with delayed node instantiation
CN105095261A (en) Data insertion method and device
US7769781B1 (en) Method for labeling data stored in sequential data structures with parameters which describe position in a hierarchy
CN107818114A (en) A kind of data processing method, device and database
US9292549B2 (en) Method and system for index serialization
US7984072B2 (en) Three-dimensional data structure for storing data of multiple domains and the management thereof
CN116662019B (en) Request distribution method and device, storage medium and electronic device
CN111597262B (en) Management method and management system for block data in block chain
CN104133970A (en) Data space management method and device
JP6006740B2 (en) Index management device
CN107818155A (en) A kind of storage method of distribution main website and distribution main website data
US7577673B2 (en) Organising data in a database
CN114625713A (en) Metadata management method and device in storage system and storage system
CN110232139B (en) SOC data management method suitable for embedded software

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
GR01 Patent grant
GR01 Patent grant