CN111241069A - Data flattening method and system based on block chain - Google Patents

Data flattening method and system based on block chain Download PDF

Info

Publication number
CN111241069A
CN111241069A CN202010063170.XA CN202010063170A CN111241069A CN 111241069 A CN111241069 A CN 111241069A CN 202010063170 A CN202010063170 A CN 202010063170A CN 111241069 A CN111241069 A CN 111241069A
Authority
CN
China
Prior art keywords
data
flattening
node
account
block
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.)
Granted
Application number
CN202010063170.XA
Other languages
Chinese (zh)
Other versions
CN111241069B (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.)
Shanghai Moheng Network Technology Co Ltd
Original Assignee
Shanghai Moheng Network 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 Shanghai Moheng Network Technology Co Ltd filed Critical Shanghai Moheng Network Technology Co Ltd
Priority to CN202010063170.XA priority Critical patent/CN111241069B/en
Publication of CN111241069A publication Critical patent/CN111241069A/en
Application granted granted Critical
Publication of CN111241069B publication Critical patent/CN111241069B/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/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • G06F16/212Schema design and management with details for data modelling support
    • 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

Abstract

The invention discloses a data flattening method and a data flattening system based on a block chain, wherein the method comprises the following steps: establishing a data flattening node; the data flattening node acquires account data in a distributed mode to obtain an account data snapshot, and local data are constructed to participate in consensus; and (3) regularly cleaning data which do not participate in consensus, cleaning historical snapshots of account data, and flattening the local database data of the block link points. The block chain-based data flattening method removes redundancy and complexity, achieves data flattening, greatly reduces hardware resource requirements, and reduces a block chain application landing threshold; by adopting a distributed account data synchronization mode, block link point resources are fully utilized, the speed of constructing local data is greatly improved, and a foundation is provided for the light equipment to access a block link in seconds to become a block link point.

Description

Data flattening method and system based on block chain
Technical Field
The invention relates to the field of data processing, in particular to a data flattening method and system based on a block chain.
Background
The blockchain technology is a distributed data processing technology, and encrypted data is sent to each node through a P2P network communication technology to achieve the common identification of nodes in the whole network, so that the data is ensured to be not falsifiable and not forged. With the development of internet technology, the advantages of decentralized block chain technology, transparent disclosure, no tampering, trusty and the like are widely applied to numerous fields such as intelligent contracts, file storage, supply chain finance, identity verification, digital government affairs, electronic commerce, internet of things, social communication and the like.
With the development of the blockchain technology, blockchain data are increasingly precipitated, great challenges are faced to completely synchronizing blockchain data of newly added nodes, the data synchronization process consumes a great deal of time, hardware resources are wasted, the operation cost is increased, the threshold of application landing of the blockchain is improved, and the ecological development of the blockchain is not facilitated.
In the existing block chain data processing scheme, the local data of each node is completely consistent; nodes with missing data need to synchronize data from the connected nodes, process the data, and store the data locally to achieve blockchain network consensus. After receiving the block data, the node executes a transaction list in the block data, and locally stores the block data, the transaction list, a transaction execution result and account data; the first three types of data are all stored in a local database, and the account data are stored locally and are stored in a Merkle-Patricia Tree structure object as a cache.
Disclosure of Invention
In view of the above defects in the prior art, the technical problems to be solved by the present invention are that in the existing blockchain transaction service, during the transaction process, data redundancy is very large, the efficiency of block data synchronization is very low, and the requirement on hardware equipment is high.
In order to achieve the above object, the present invention provides a data flattening method based on a block chain, which includes the following steps:
establishing a data flattening node;
the data flattening node acquires the latest account data in a distributed mode to obtain an account data snapshot, and constructs local data to participate in consensus;
and (3) regularly cleaning data which do not participate in consensus, cleaning historical snapshots of account data, and flattening the local database data of the block link points.
Further, establishing a data flattening node specifically includes:
preparing a node, starting with a data flattening mark, and taking the node as a data flattening node;
the data flattening node is connected with a plurality of block chain nodes through P2P;
and the data flattening node collects the same block data of all block chain link points connected with the data flattening node, and compares Root Hash in the block data for checking.
Further, the data flattening node obtains the account data in a distributed manner to obtain an account data snapshot, and the method specifically includes:
the data flattening node sends a command for acquiring the account data to the plurality of block link points in a distributed mode, the block link point group receives the command and obtains local data in parallel and sends the local data to the data flattening node, and the data flattening node constructs local account data according to the obtained local data and constructs a latest account data snapshot object.
Further, the data participating in the consensus in the blockchain is set as the latest snapshot of all account data, and a new snapshot of account data is generated each time the account data is changed.
In another preferred embodiment of the present invention, a block chain based data flattening system is provided, which includes:
the new building module is used for building a data flattening node;
the building module is used for the data flattening node to obtain account data in a distributed mode, obtain an account data snapshot, build local data and participate in consensus;
and the cleaning module is used for periodically cleaning data which do not participate in consensus so as to achieve the flattening of the local database data of the block link points.
Further, the newly-built module specifically comprises:
the preparation unit is used for preparing a node, starting with the data flattening mark and taking the node as a data flattening node;
the connection unit is used for connecting the data flattening nodes with the plurality of block chain nodes through P2P;
and the comparison unit is used for collecting the same block data of all block chain link points connected with the data flattening nodes by the data flattening nodes and comparing Root Hash in the block data for checking.
Further, the construction unit specifically includes:
the data flattening node sends a command for acquiring the account data to the plurality of block link points in a distributed mode, the block link point group receives the command and obtains local data in parallel and sends the local data to the data flattening node, and the data flattening node constructs local account data according to the obtained local data and constructs a latest account data snapshot object.
Further, the data participating in the consensus in the blockchain is set as the latest snapshot of all account data, and a new snapshot of account data is generated each time the account data is changed.
In another preferred embodiment of the present invention, there is provided a computer apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method as described in any one of the above when executing the program.
In another preferred embodiment of the present invention, a computer-readable storage medium storing a computer program is provided, wherein the computer program is configured to enable a computer to implement a method for flattening data based on a blockchain as described in any one of the above.
Technical effects
The invention discloses a data flattening method based on a block chain, which aims at the problem that local sediment data is gradually increased along with the increase of the height of the block chain in the prior art, and deletes local block data, transaction data, result data of transaction execution and historical account data snapshots, so that the local data of a final node is most simplified, redundancy and complexity are removed, and data flattening is achieved; if no account is newly added in the block chain network, the nodes started by the data flattening method do not have data increase.
Aiming at the problems of slow and high operation of synchronous data in the existing scheme, the data flattening method based on the block chain fully utilizes the block chain link point resources in a distributed synchronous account data mode, greatly improves the speed of constructing local data, and can start the data flattening node at any block height without starting the synchronous data from the block height 0 like the existing scheme. The existing scheme is used for synchronizing data, namely a slow and high-operation task, and the synchronization process is a calculation process and a history process is completely played; the scheme completely discards the inefficient synchronization process, takes the RootHash of the given block data as a basis, fully utilizes the block link point resources in a distributed mode, and efficiently constructs the local account data snapshot to form the effective block link node.
The block chain-based data flattening method disclosed by the invention removes a large amount of redundant data, greatly reduces the hardware resource requirement, and reduces the block chain application landing threshold, and light mobile devices such as mobile phones and flat plates can be used as block chain nodes; and a distributed account data construction mode is adopted, and a foundation is provided for the light equipment to access the block chain to become the block chain link point under the better network condition.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Drawings
FIG. 1 is a schematic diagram illustrating a data flattening boot process of a block chain-based data flattening method according to a preferred embodiment of the present invention;
FIG. 2 is a block chain account list obtaining flow chart of a block chain-based data flattening method according to a preferred embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a procedure for acquiring blockchain account data according to a method for flattening data based on blockchains according to a preferred embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular internal procedures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
Example one
In the prior art, the data processing scheme in the blockchain transaction service has the following defects:
1) existing block data processing schemes have very large data redundancy
In the existing data processing scheme of the blockchain transaction service, a node locally stores a large amount of data, including blockchain data, transaction result data, account data and the like, so that data redundancy is very large, and data deposition is heavy and complicated.
2) The block data synchronization efficiency of the data processing scheme of the existing block chain transaction service is very low
In the existing data processing scheme of the block chain transaction service, the synchronization efficiency of block data is very low, newly added nodes need to synchronize block chain historical data, the time consumption is small and hours are small, the time consumption is more and months are long, and the time is longer and longer; nodes that need to synchronize data can only synchronize with one node at a time, resulting in very inefficient data synchronization.
3) The existing data processing scheme of the blockchain transaction service has higher requirements on hardware equipment
In the existing data processing scheme of the blockchain transaction service, a large-capacity storage medium must be configured, and a large amount of data generated by a blockchain is stored, so that hardware equipment is heavy, and the application of the blockchain is not favorable for landing.
Aiming at the defects, the invention discloses a data flattening method and a data flattening system based on a block chain, which are used for realizing a block chain data synchronization protocol based on a block chain data flattening technology, namely local data are constructed in a distributed account data acquisition mode; the invention aims to delete all data which do not participate in consensus to achieve data flattening, remove redundancy and complexity, finally reduce the data size of a node, and add a block chain network and participate in consensus. The data flattening method based on the block chain in the embodiment comprises the following steps:
step 100, establishing a data flattening node;
200, acquiring account data by a data flattening node in a distributed mode to obtain an account data snapshot, and constructing local data to participate in consensus;
and step 300, regularly cleaning data which do not participate in consensus to achieve the flattening of the local database data of the block link points.
The data locally stored in the block chain node mainly comprises block data, a transaction list, a transaction execution result and account data; the block data refers to a block formed by packaging block chain nodes, and the block usually comprises information block data such as a block number, time, a transaction list and the like, and is stored locally and does not participate in consensus; the transaction list is a blockchain transaction set, namely is stored in block data, and is independently stored locally in a Key-Value form for convenient retrieval, wherein Key is the Hash of the transaction, and Value is the 16-system code of the transaction; the transaction execution result comprises transaction execution state, information such as block number and log of execution location, and is stored locally; the account data includes information such as account number, transaction number, account credit, and smart contract bytecode. The data such as the block data, the transaction list, the transaction execution result and the like do not participate in the block chain consensus, the data participating in the consensus in the block chain is the latest snapshot of all account data, and a new account data snapshot is generated every time the account data is changed. In this embodiment, a local database is constructed by using the latest account data snapshot, that is, the latest Merkle-Patricia Tree object is constructed, and the object data is also the only data participating in the block chain network consensus. The Merkle-Patricia Tree is an improved data structure which integrates the advantages of two Tree structures of a Mercury Tree and a prefix Tree, and is an important data structure used in Taifang for organizing and managing account data and generating transaction set hash.
Further, step 100, establishing a data flattening node specifically includes:
step 101, preparing a node, starting by using a data flattening mark as a data flattening node;
step 102, connecting a data flattening node with a plurality of block chain nodes through P2P;
and 103, collecting the same block data of all block chain link points connected with the data flattening nodes by the data flattening nodes, and comparing Root Hash in the block data for checking.
The data flattening node is a node started by a data flattening mark, clears local historical data, is connected with a plurality of block chain nodes through P2P, and obtains the RootHash in the block data for final verification when the first block data of any one node is received.
The starting form of the block chain node is two types: 1. the block chain link point is started normally; 2. the block link points are activated in a data flattening mode. As shown in fig. 1, the specific process of starting the data flattening mode of this embodiment is as follows:
step 1, preparing a new node of a block chain, setting data flattening parameters, starting in a data flattening mode, and deleting local block data;
step 2, manually adding one or more online block chain nodes to the data flattening node, and establishing a P2P network connection;
step 3, when the block chain node receives or generates a new block, broadcasting the new block to the data flattening node;
and 4, obtaining Root Hash according to the latest block data for verification after account data are obtained, wherein the block data are used as the first block data of the data flattening node.
Further, in step 200, the data flattening node obtains the account data in a distributed manner to obtain an account data snapshot, which specifically includes:
the data flattening node sends a command for acquiring the account data to the plurality of block link points in a distributed mode, the block link point group receives the command and obtains local data in parallel and sends the local data to the data flattening node, and the data flattening node constructs local account data according to the obtained local data and constructs a latest account data snapshot object.
The method comprises the steps that a Merkle-Patricia Tree object of block chain account data is constructed in a distributed mode, a data flattening node can be connected with a plurality of block chain nodes P2P, Root Hash of the same block data sent by the nodes is consistent, the Root Hash is high in feasibility, the data flattening node sends an account list acquisition command to the block chain nodes to acquire account data to construct a local account list, the data flattening node sends the account data to the block chain nodes in a distributed mode, the block chain node group receives the command to acquire local data in parallel and sends the local data to the data flattening node, the data flattening node constructs local account data, and the latest Merkle-Patricia Tree object is constructed. Therefore, the data flattening node firstly acquires the account list and then acquires the account data; because the account list data is small and the account data is large, the data flattening node firstly acquires the account list and then requests the account data in a distributed mode.
As shown in fig. 2, the step of acquiring the block chain account list flow is as follows:
step 201, the data flattening node sends an account acquisition command to the block link points;
step 202, traversing the local block chain data by the block chain nodes to obtain all account lists, and sending the account lists in batches if the number of the account lists is large;
step 203, caching the account list after the data flattening node receives the account list, and solving a Hash value of the total list for checking;
step 204, after all accounts are sent, sending an end mark to the data flattening node by the block link point;
205. after receiving the end mark, the data flattening node sends an account list Hash value to the block link points;
step 206, the block link points verify whether the Hash value is consistent with the local area, and send verification results to the data flattening;
step 207, if the verification fails, searching a lost account list according to the index; re-request until all account lists are obtained.
After the data flattening node acquires the account list, the account number is acquired in a distributed manner, as shown in fig. 3, the steps of the flow of acquiring the account data are as follows:
step 208, the data flattening node sends a command of acquiring account data to the block link point cluster, wherein the command contains an account list needing to acquire the account data;
step 209, the block link point cluster traverses the data of the local block link according to the account list to obtain the data of the corresponding account, if the data of a single account is large, the data is split and sent, and if the data of the account list is excessive, the data is sent in batches;
step 210, caching the account data to the local after the data flattening node receives the account data, wherein the cache has a function of a Merkle-Patricia Tree; step 208 to step 210 are executed in a circulating way until all the account data are acquired
Step 211, after obtaining all account data, starting a data processing process to obtain a final Merkle-Patricia Tree Root Hash, if the Hash is consistent with the Root Hash obtained in the figure 1, passing the Hash, and if the Hash is inconsistent with the Root Hash, checking the integrity and the correctness of the data through the account list data, randomly selecting other nodes, and continuously sending an 'obtaining account data' command to request missing account data or check data;
step 212, since the above steps require several seconds to several minutes, a new block is generated by the block chain during this period, so that block data in this period needs to be requested;
step 213, synchronously acquiring a small amount of block data;
step 214, if the block height of the data flattening node is consistent with the block chain network and the block data can be normally received, it indicates that the block chain network is added and the block chain data flattening process is completed.
Further, the data participating in the consensus in the blockchain is set as the latest snapshot of all account data, and a new snapshot of account data is generated each time the account data is changed.
Executing a transaction in a blockchain is the only way to change a Merkle-Patricia Tree, where the transaction includes a transfer transaction and a call intelligent contract transaction, and any change in state changes the Merkle-Patricia Tree object, thereby changing the Root Hash (Root Hash refers to the Hash value of the Root node of the Merkle-Patricia Tree).
The nodes of the packed blocks or the nodes of the executed blocks execute related transactions, change the states of the Merkle-Patricia Tree objects, store the latest Root Hash in the latest block data, and finally form block data to be broadcast to other nodes. When the node packs the block, the address of the node is recorded in the block, local transactions are also packed in the block, and finally the block is received by the whole block chain network, so that the node is the node of the packed block; if the local transaction is packed when the blocks are packed, the states of the Merkle-Patricia Tree objects are changed, the latest Root Hash value is calculated and written into the blocks, and the blocks are broadcasted; other nodes receive the block, can also execute the transaction in the block, and can also change the state of the Merkle-Patricia Tree object and calculate the latest Root Hash value; and finally, the Root Hash values are consistent, which indicates that consensus is achieved.
The following will illustrate the implementation process based on block chain data flattening by taking a specific example:
1) preparing a node, starting with a data flattening mark, as a data flattening node F1;
2) preparing a plurality of block chain nodes N2 and N3 …, and establishing P2P network connection with the F1 node;
3) f1, collecting the same block data of all block chain link points, comparing the same block data with the Root Hash of the block data, if the data are consistent, F1 saves the data, and if the data are inconsistent, F1 continues to collect the data until the Root Hash of the same block data is consistent, so that the data safety is ensured;
4) f1 sends an account acquisition command to a blockchain node, and F1 finally acquires a complete account list and caches locally;
5) f1 sends commands of acquiring account data to all blockchain nodes respectively, the blockchain link point group receiving the commands distributes data according to the partial account list provided by F1, and finally F1 receives and caches all account data;
6) f1 building a Merkle-Patricia Tree object according to the account data to obtain a Root Hash comparison, if the comparison is not consistent, checking the missing data and requesting again, if the two Hash are consistent, obtaining a correct account data snapshot, and finally submitting the account data to a local database;
7) f1 is a small number of blocks missing synchronously, these blocks are generated by the blockchain network during the process of F1 from 3) to 6), and finally the block height of F1 is consistent with the block height of the blockchain node;
8) the user creates a blockchain transaction, transfers 10 from account a to account B, sends the transaction to blockchain node N2, has nodes in the blockchain network package the transaction and broadcasts blockchain data;
9) f1 receives the block data, the balance of account A is respectively inquired to be reduced by 10 at the F1 node, the balance of account B is increased by 10, F1 is not forked in the block chain network, and the F1 can be known to have data integrity through transferring different accounts for many times and calling intelligent contracts;
10) f1, cleaning historical block data, transaction data, result data of executed transaction and historical account snapshot data regularly to achieve almost no sediment data, and finally achieving data flattening.
The invention discloses a data flattening method based on a block chain, which aims at the problem that local sediment data is gradually increased along with the increase of the height of the block chain in the prior art, and deletes local block data, transaction data, result data of transaction execution and historical account data snapshots, so that the local data of a final node is most simplified, redundancy and complexity are removed, and data flattening is achieved; if no account is newly added in the block chain network, the nodes started by the data flattening method do not have data increase.
Aiming at the problems of slow and high operation of synchronous data in the existing scheme, the data flattening method based on the block chain fully utilizes the block chain link point resources in a distributed synchronous account data mode, greatly improves the speed of constructing local data, and can start the data flattening node at any block height without starting the synchronous data from the block height 0 like the existing scheme. The existing scheme is used for synchronizing data, namely a slow and high-operation task, and the synchronization process is a calculation process and a history process is completely played; the scheme completely discards the inefficient synchronization process, takes the RootHash of the given block data as a basis, fully utilizes the block link point resources in a distributed mode, and efficiently constructs the local account data snapshot to form the effective block link node.
The block chain-based data flattening method disclosed by the invention removes a large amount of redundant data, greatly reduces the hardware resource requirement, and reduces the block chain application landing threshold, and light mobile devices such as mobile phones and flat plates can be used as block chain nodes; and a distributed account data construction mode is adopted, and a foundation is provided for the light equipment to access the block chain to become the block chain link point under the better network condition.
Example two
The embodiment provides a data flattening system based on a block chain, which comprises:
the new building module is used for building a data flattening node;
the building module is used for the data flattening node to obtain account data in a distributed mode, obtain an account data snapshot, build local data and participate in consensus;
and the cleaning module is used for periodically cleaning data which do not participate in consensus so as to achieve the flattening of the local database data of the block link points.
Further, the newly-built module specifically comprises:
the preparation unit is used for preparing a node, starting with the data flattening mark and taking the node as a data flattening node;
the connection unit is used for connecting the data flattening nodes with the plurality of block chain nodes through P2P;
and the comparison unit is used for collecting the same block data of all block chain link points connected with the data flattening nodes by the data flattening nodes and comparing Root Hash in the block data for checking.
Further, the construction unit specifically includes:
the data flattening node sends a command for acquiring the account data to the plurality of block link points in a distributed mode, the block link point group receives the command and obtains local data in parallel and sends the local data to the data flattening node, and the data flattening node constructs local account data according to the obtained local data and constructs a latest account data snapshot object.
Further, the data participating in the consensus in the blockchain is set as the latest snapshot of all account data, and a new snapshot of account data is generated each time the account data is changed.
The embodiment is to implement the method, and the implementation method is the same as that of the embodiment, which will not be described herein again.
EXAMPLE III
EXAMPLE III
The third embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program that is stored in the memory and can be executed on the processor, and when the processor executes the computer program, the computer device implements any one of the methods described above.
The computer device of this embodiment includes: a processor, a memory, and a computer program, such as a data processing program, stored in the memory and executable on the processor. The processor implements the steps in the above-described respective embodiments of the networking method when executing the computer program. Alternatively, the processor implements the functions of the modules/units in the above device embodiments when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the computer device.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer device may include, but is not limited to, a processor, a memory.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The memory may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the computer device. Further, the memory may also include both an internal storage unit and an external storage device of the computer device. The memory is used for storing the computer program and other programs and data required by the computer device. The memory may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, where the computer program is configured to enable a computer to implement any one of the above methods for flattening data based on a blockchain when the computer executes the computer program.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (10)

1. A data flattening method based on a block chain is characterized by comprising the following steps:
establishing a data flattening node;
the data flattening node acquires the latest account data in a distributed mode to obtain an account data snapshot, and constructs local data to participate in consensus;
and (3) regularly cleaning data which do not participate in consensus, cleaning historical snapshots of account data, and flattening the local database data of the block link points.
2. The method according to claim 1, wherein establishing a data flattening node specifically comprises:
preparing a node, starting with a data flattening mark, and taking the node as a data flattening node;
the data flattening node is connected with a plurality of block chain nodes through P2P;
and the data flattening node collects the same block data of all block chain link points connected with the data flattening node, and compares Root Hash in the block data for checking.
3. The block chain-based data flattening method according to claim 2, wherein the data flattening node obtains the latest account data in a distributed manner to obtain an account data snapshot, and specifically includes:
the data flattening node sends a command for acquiring account data to the plurality of block link points in a distributed mode, the block link point group receives the command and acquires local data in parallel and sends the local data to the data flattening node, and the data flattening node constructs local account data and a latest account data snapshot object according to the obtained local data.
4. The method as claimed in claim 2, wherein the data participating in the block chain is set as the latest snapshot of all account data, and a new snapshot of account data is generated each time the account data changes.
5. A system for flattening data based on a blockchain, comprising:
the new building module is used for building a data flattening node;
the building module is used for the data flattening node to obtain the latest account data in a distributed mode, obtain an account data snapshot, build local data and participate in consensus;
and the cleaning module is used for cleaning data which do not participate in consensus regularly, cleaning historical account data snapshots and flattening the local database data of the block link points.
6. The system according to claim 1, wherein the newly created module specifically comprises:
the preparation unit is used for preparing a node, starting with the data flattening mark and taking the node as a data flattening node;
the connection unit is used for connecting the data flattening nodes with a plurality of block chain nodes through P2P;
and the comparison unit is used for collecting the same block data of all block chain link points connected with the data flattening nodes by the data flattening nodes and comparing Root Hash in the block data for verification.
7. The system according to claim 2, wherein the building unit specifically comprises:
the data flattening node sends a command for acquiring the account data to the plurality of block link points in a distributed mode, the block link point group receives the command and obtains local data in parallel and sends the local data to the data flattening node, and the data flattening node constructs local account data according to the obtained local data and constructs a latest account data snapshot object.
8. The system of claim 2, wherein the data participating in the consensus in the blockchain is set to be the latest snapshot of all account data, and a new snapshot of account data is generated each time the account data changes.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, implements the method according to any of claims 1-4.
10. A computer-readable storage medium storing a computer program, the computer program causing a computer to implement a method for blockchain-based data flattening according to any one of claims 1 to 4 when executed.
CN202010063170.XA 2020-01-19 2020-01-19 Block chain-based data flattening method and system Active CN111241069B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010063170.XA CN111241069B (en) 2020-01-19 2020-01-19 Block chain-based data flattening method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010063170.XA CN111241069B (en) 2020-01-19 2020-01-19 Block chain-based data flattening method and system

Publications (2)

Publication Number Publication Date
CN111241069A true CN111241069A (en) 2020-06-05
CN111241069B CN111241069B (en) 2023-10-20

Family

ID=70874775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010063170.XA Active CN111241069B (en) 2020-01-19 2020-01-19 Block chain-based data flattening method and system

Country Status (1)

Country Link
CN (1) CN111241069B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800129A (en) * 2020-12-31 2021-05-14 杭州趣链科技有限公司 Block state updating method, device and system and electronic equipment
US20230342340A1 (en) * 2022-04-21 2023-10-26 Bank Of America Corporation System and method for electronic data archival in a distributed data network
CN112800129B (en) * 2020-12-31 2024-04-23 杭州趣链科技有限公司 Block state updating method, device, system and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145163A (en) * 2018-08-22 2019-01-04 深圳前海微众银行股份有限公司 Block chain data capacity reduction method, device and storage medium
CN109194702A (en) * 2018-06-04 2019-01-11 平安科技(深圳)有限公司 Medical data recording method, system, computer equipment and storage medium
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
CN109324757A (en) * 2018-08-22 2019-02-12 深圳前海微众银行股份有限公司 Block chain data capacity reduction method, device and storage medium
CN109542979A (en) * 2018-11-19 2019-03-29 广州矩阵信息科技有限公司 A kind of block catenary system Fast synchronization and the mode of simple smart data storage
CN109636388A (en) * 2018-12-07 2019-04-16 深圳市智税链科技有限公司 Data processing method, device, medium and electronic equipment in block chain network
CN110400142A (en) * 2018-06-01 2019-11-01 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN110493325A (en) * 2019-07-31 2019-11-22 阿里巴巴集团控股有限公司 Block chain state method of data synchronization and device, electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
CN110400142A (en) * 2018-06-01 2019-11-01 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109194702A (en) * 2018-06-04 2019-01-11 平安科技(深圳)有限公司 Medical data recording method, system, computer equipment and storage medium
CN109145163A (en) * 2018-08-22 2019-01-04 深圳前海微众银行股份有限公司 Block chain data capacity reduction method, device and storage medium
CN109324757A (en) * 2018-08-22 2019-02-12 深圳前海微众银行股份有限公司 Block chain data capacity reduction method, device and storage medium
CN109542979A (en) * 2018-11-19 2019-03-29 广州矩阵信息科技有限公司 A kind of block catenary system Fast synchronization and the mode of simple smart data storage
CN109636388A (en) * 2018-12-07 2019-04-16 深圳市智税链科技有限公司 Data processing method, device, medium and electronic equipment in block chain network
CN110493325A (en) * 2019-07-31 2019-11-22 阿里巴巴集团控股有限公司 Block chain state method of data synchronization and device, electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800129A (en) * 2020-12-31 2021-05-14 杭州趣链科技有限公司 Block state updating method, device and system and electronic equipment
CN112800129B (en) * 2020-12-31 2024-04-23 杭州趣链科技有限公司 Block state updating method, device, system and electronic equipment
US20230342340A1 (en) * 2022-04-21 2023-10-26 Bank Of America Corporation System and method for electronic data archival in a distributed data network
US11907186B2 (en) * 2022-04-21 2024-02-20 Bank Of America Corporation System and method for electronic data archival in a distributed data network

Also Published As

Publication number Publication date
CN111241069B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN108648078B (en) Transaction preprocessing method and device and electronic equipment
CN110599095B (en) Block chain network-based hazardous waste treatment method and node of block chain network
CN109189751A (en) Method of data synchronization and terminal device based on block chain
CN107729137B (en) Server, block chain signature verification decryption method and storage medium
CN105138615A (en) Method and system for building big data distributed log
EP2544107A1 (en) Method of managing a database
CN102307206A (en) Caching system and caching method for rapidly accessing virtual machine images based on cloud storage
CN111274252A (en) Block chain data chaining method, device, storage medium and server
CN111931220B (en) Consensus processing method, device, medium and electronic equipment for block chain network
CN110933173B (en) Block chain technology-based networking method and device
CN113419823A (en) Alliance chain system suitable for high-concurrency affairs and design method thereof
EP4207688A1 (en) Asynchronous bookkeeping method and apparatus for blockchain, medium, and electronic device
CN111614761A (en) Block chain message transmission method, device, computer and readable storage medium
WO2023279972A1 (en) Blockchain consistency processing method, blockchain node and blockchain system
CN109710617B (en) Secure data transaction method based on Mercker certification
US20170085653A1 (en) Method, device and system for message distribution
US20230275771A1 (en) Pre-execution of block chain transaction in parallel during block consensus
CN103716384A (en) Method and device for realizing cloud storage data synchronization in cross-data-center manner
CN111899019A (en) Method and system for cross validation and sharing of blacklist and multiple parties
CN111226206A (en) Taking snapshots of blockchain data
CN111241069B (en) Block chain-based data flattening method and system
CN111125168B (en) Data processing method and device, electronic equipment and storage medium
CN117370460A (en) Block chain storage optimization method and device based on double-chain storage
CN115037472B (en) Transaction processing method and system based on double-layer DAG consensus mechanism and service equipment
CN110363515B (en) Rights and interests card account information inquiry method, system, server and readable storage medium

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