CN109543455B - Data archiving method and device for block chain - Google Patents

Data archiving method and device for block chain Download PDF

Info

Publication number
CN109543455B
CN109543455B CN201811311190.3A CN201811311190A CN109543455B CN 109543455 B CN109543455 B CN 109543455B CN 201811311190 A CN201811311190 A CN 201811311190A CN 109543455 B CN109543455 B CN 109543455B
Authority
CN
China
Prior art keywords
block chain
block
transaction data
blockchain
data
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
CN201811311190.3A
Other languages
Chinese (zh)
Other versions
CN109543455A (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.)
Union Mobile Pay Co Ltd
Original Assignee
Union Mobile Pay 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 Union Mobile Pay Co Ltd filed Critical Union Mobile Pay Co Ltd
Priority to CN201811311190.3A priority Critical patent/CN109543455B/en
Publication of CN109543455A publication Critical patent/CN109543455A/en
Application granted granted Critical
Publication of CN109543455B publication Critical patent/CN109543455B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data archiving method and a data archiving device for a block chain, wherein the method comprises the following steps: the block chain node receives a write-in request of transaction data; detecting whether the first block chain meets a preset filing condition; if not, writing the transaction data into the first block chain; and if so, creating a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain. In the embodiment of the invention, when the block link point detects that the first block chain meets the preset filing condition, the first block chain is filed, and a second block chain is newly established for writing in the transaction data.

Description

Data archiving method and device for block chain
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method and an apparatus for archiving data of a blockchain.
Background
The block chain system is a data network system which generates and updates transaction data by using a node consensus algorithm, ensures the safety of data transmission and access by using cryptography and generates a distributed account book which cannot be tampered and counterfeited. In the blockchain system, the transaction ledger is stored in a blockchain structure, and each blockchain link point stores the complete transaction data of the blockchain system. As the running time of the blockchain system increases, the height of the blockchain and the amount of transaction data stored on the blockchain also increase linearly, so that the storage device in the blockchain link point for storing the transaction data of the blockchain faces a storage bottleneck.
Because the address of the blockchain established in the blockchain node and used for storing the transaction data in the blockchain node cannot be changed, in order to avoid that the storage device corresponding to the blockchain address in the blockchain link point faces a storage bottleneck, the existing data archiving technology of the blockchain generally transfers the historical transaction data meeting a certain condition on the blockchain to other storage devices corresponding to non-blockchain addresses in the blockchain link point or to a third-party storage device, for example: when the height of the block chain reaches 100, transferring the transaction data stored in the first block to the fiftieth block of the block chain to other storage devices corresponding to the non-block chain addresses of the block chain link points. However, in the existing data archiving technology of the blockchain, the transaction data on the blockchain needs to be transferred, the transferred transaction data may be tampered, and the transfer of the transaction data also affects the synchronization efficiency of the newly added blockchain link point on the transaction data, so that a data archiving scheme of the blockchain that avoids the transfer of the transaction data is urgently needed.
Disclosure of Invention
The invention provides a data archiving method and device for a block chain, which are used for solving the problems that the transaction data of the block chain faces storage bottleneck and is transferred in the prior art.
In a first aspect, the present invention discloses a data archiving method for a blockchain, which is applied to a blockchain node, and the method includes:
receiving a write request of transaction data;
detecting whether the first block chain meets a preset filing condition;
if not, writing the transaction data into the first block chain; and if so, creating a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain.
According to the data archiving method for the block chain, transaction data are directly stored on an original block chain, the transaction data do not need to be transferred, the archiving efficiency of the block chain is improved, the problem that the transaction data are tampered due to the transfer of the transaction data is avoided, the consistency and the authenticity of the transaction data stored by each node of the block chain are guaranteed, the address of a newly-built second block chain is not limited by the address of the first block chain, the block chain link point can newly build a second block chain in storage equipment with the same or different address of the first block chain in the block chain link point for writing of subsequently-generated transaction data, the problem of storage bottleneck is avoided, and the infinite capacity expansion of the block chain is realized.
Optionally, the preset archiving condition includes at least one of the following:
the block height of the block chain reaches a set block height threshold, the storage space occupied by the block chain is larger than a set storage space threshold, and the creation time length of the block chain is larger than a set time length threshold.
Optionally, the pointing of the created block of the second blockchain to the first blockchain includes:
and the hash value of the last block in the created blocks of the second block chain is the hash value of the last block of the first block chain.
Optionally, the method further includes:
and aiming at the transaction data, adding the identification information of the transaction data, the identification information of the target block chain corresponding to the transaction data and the index relation of the identification information of the target block chain in an index table.
In a second aspect, the present invention discloses a data archiving apparatus for a blockchain, which is applied to a blockchain node, and includes:
the data operation module is used for receiving a write-in request of transaction data;
the archiving management module is used for detecting whether the first block chain meets a preset archiving condition;
the data operation module is further used for writing the transaction data into the first block chain if the detection result of the filing management module is negative; and if the detection result of the filing management module is positive, a second block chain is newly established, and the transaction data is written into the second block chain, wherein a created block of the second block chain points to the first block chain.
Optionally, the preset archiving condition includes at least one of the following: the block height of the block chain reaches a set block height threshold, the storage space occupied by the block chain is larger than a set storage space threshold, and the creation time length of the block chain is larger than a set time length threshold.
Optionally, the pointing of the created block of the second blockchain to the first blockchain includes: and the hash value of the last block in the created blocks of the second block chain is the hash value of the last block of the first block chain.
Optionally, the apparatus further comprises:
and the index maintenance module is used for adding the identification information of the transaction data, the identification information of the target block chain corresponding to the transaction data and the index relationship of the identification information of the target block chain in an index table aiming at the transaction data.
In a third aspect, the present invention discloses a block link point, comprising: a memory and a processor;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of any of the methods described above.
In a fourth aspect, the present invention discloses a computer readable storage medium storing a computer program executable by an electronic device, the program, when run on the electronic device, causing the electronic device to perform the steps of any of the methods described above.
The invention discloses a data archiving method and a data archiving device for a block chain, wherein the method comprises the following steps: the block chain node receives a write-in request of transaction data; detecting whether the first block chain meets a preset filing condition; if not, writing the transaction data into the first block chain; and if so, creating a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain. Since in the embodiment of the present invention, the block link point creates the second block chain when detecting that the first block chain satisfies the preset archive condition, wherein the created block of the second block chain points to the first block chain and is used for writing transaction data, because the address of the first block chain does not need to be changed when the second block chain is created, the address of the created second block chain is not limited by the address of the first block, the block link point can create the second block chain in the same or different storage devices corresponding to the address of the first block chain in the block link point, used for storing new transaction data, avoids the problem that the block chain link points meet the storage bottleneck, realizes the infinite capacity expansion of the block chain, and the data archiving method does not relate to the data unloading of the transaction data, avoids the transaction data from being tampered after being unloaded, and improves the practicability of the data archiving of the block chain.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a data archiving process of a block chain according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a transaction data query process according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data archiving apparatus for a block chain according to an embodiment of the present invention;
FIG. 4 is a block link point diagram according to an embodiment of the present invention;
fig. 5 is a second schematic diagram of a block link point according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is to be understood that the use of a plurality of references in the present invention refers to two or more, and the terms "first", "second", etc. in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance, nor is it to be construed as indicating or implying any order.
Example 1:
fig. 1 is a schematic diagram of a data archiving process of a block chain according to an embodiment of the present invention, where the process includes:
s101: a write request for transaction data is received.
S102: and detecting whether the first block chain meets a preset filing condition, if not, performing S103, and if so, returning to S104.
The data archiving method for the block chain provided by the embodiment of the invention is applied to any block chain node of the block chain, and the block chain node can be electronic equipment such as a PC (personal computer), a server cluster and the like with operation and storage functions.
In the present embodiment, the first blockchain may also be referred to as a current blockchain, which refers to a blockchain that is not archived, and only one current blockchain exists in the blockchain link points. The archive blockchain refers to a blockchain that has satisfied a predetermined archive condition and is prohibited from data writing, wherein after the current blockchain satisfies the predetermined archive condition, the current blockchain is prohibited from data writing, and after a new blockchain is created at a block link point, the current blockchain becomes a archive blockchain, and the new blockchain at the block link point becomes a new current blockchain, wherein after the current blockchain and the first blockchain satisfy the predetermined archive condition, the newly created block chain at the block link point may also be referred to as a second blockchain in the embodiment of the present invention.
In addition, it should be understood that the block chains referred to in the embodiments of the present invention, such as the first block chain, the second block chain, the current block chain, etc., refer to a block chain that can be used for storing transaction data, i.e., a block chain composed of blocks storing transaction data one by one, rather than a block chain technique or a block chain system, etc.
In addition, the preset filing conditions in the embodiment of the present invention include: the block height of the block chain reaches one or more of a set block height threshold value, the storage space occupied by the block chain is larger than a set storage space threshold value, the creation time length of the block chain is larger than a set time length threshold value and the like.
Specifically, after receiving a write request of transaction data each time, the block link point detects whether the first block link point meets a preset archive condition, and if the first block link point meets any preset archive condition, for example: and determining that the first block chain meets a preset filing condition when the block height of the first block chain reaches a set block height threshold.
S103: writing the transaction data to the first blockchain.
S104: and newly building a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain.
Specifically, if the first blockchain does not meet the preset archiving condition, it is indicated that the first blockchain still meets the storage condition of the transaction data, and the blockchain node writes the transaction data into the first blockchain; if the first block meets the preset filing condition, it indicates that the first block chain does not meet the storage condition of the transaction data, the block link point prohibits the data writing function of the first block chain, prevents the newly generated transaction data from being written into the first block chain, and prevents the transaction data on the first block chain from being tampered, and at the same time, the block link point newly creates a second block chain, and points the created block of the newly created second block chain to the first block chain, for example: by writing the identification information of the first block chain into the block header of the created block of the second block, the created block of the newly-created second block chain is pointed to the first block chain, and preferably, the hash value of the created block of the second block chain pointing to the first block chain is the hash value of the last block of the first block chain in the created block of the second block chain.
And the block link point writes the transaction data into the second block chain after the created block of the newly-built second block chain points to the first block chain, and the newly-built second block chain is used for the subsequent newly-generated transaction data before the preset filing condition is not met, namely the block link point writes the transaction data after receiving the writing request of the subsequent transaction data.
Because the newly generated block chain in the block chain link points to the last block chain generated by the block chain link point, when the new block chain link point is added, the newly added block chain link point can determine all transaction data needing to be synchronized according to the directional relation between the block chains in any block chain link point of the existing block chain, so that the synchronization efficiency is improved, and the synchronization accuracy is ensured.
In addition, in the embodiment of the present invention, when the second block chain is newly created at the block link point, the second block chain may be newly created in the same storage device as the storage device corresponding to the address of the first block chain at the block link point, or the second block chain may be newly created in a storage device different from the storage device corresponding to the address of the first block chain. Preferably, when the second blockchain is newly created, the blockchain node may determine whether the size of the remaining storage space of the storage device corresponding to the address of the first blockchain is greater than a set storage space threshold, if so, create the second blockchain in the storage device corresponding to the address of the first blockchain, and if not, create the second blockchain in other storage devices whose size of the remaining storage space in the blockchain node is greater than the set storage space threshold.
Since the block link point creates the second block chain after receiving the write request of the transaction data and detecting that the first block chain meets the preset archive condition in the embodiment of the invention, wherein the created block of the second block chain points to the first block chain and is used for writing transaction data, because the address of the first block chain does not need to be changed when the second block chain is created, the address of the created second block chain is not limited by the address of the first block, the block link point can create the second block chain in the same or different storage devices corresponding to the address of the first block chain in the block link point, used for storing new transaction data, avoids the problem that the block chain link points meet the storage bottleneck, realizes the infinite capacity expansion of the block chain, and the data archiving method does not relate to the transfer of the transaction data, avoids the transaction data from being tampered after the transfer, and improves the practicability of the data archiving of the block chain.
Example 2:
to facilitate the query of the transaction data, on the basis of the above embodiment, in an embodiment of the present invention, the method further includes:
and aiming at the transaction data, adding the identification information of the transaction data, the identification information of the target block chain corresponding to the transaction data and the index relation of the identification information of the target block chain in an index table.
In the embodiment of the present invention, the identification information of the transaction data may be identification number (ID) information of the transaction data, or may also be information of a key field in the transaction data, and the like, the identification information of the block may be height information of the block on the blockchain, and the identification information of the blockchain may be information of a digital fingerprint of the blockchain, information of a storage address, ID information of the blockchain, and the like. In the embodiment of the invention, after the transaction data is written into the block chain, the index relationship between the transaction data and the block chain and between blocks of the block chain is determined, and the index relationship is added into the index table to maintain the index table.
As shown in fig. 2, when transaction data is queried, a block link node receives a query request containing transaction data identification information sent by a user, and queries whether the transaction data is located in a filing block chain and location information of the transaction data through the identification information of the transaction data and an index table, where the location information of the transaction data may be identification information of a block chain and identification information of a block corresponding to the transaction; if the transaction data are located in the filing blockchain, inquiring the transaction data on the filing blockchain according to the position information of the transaction data, and returning the inquired transaction data result; and if the transaction data is not located in the filing blockchain, inquiring the transaction data on the current blockchain, namely the unfiled blockchain, and returning the inquired result of the transaction data.
Example 3:
fig. 3 is a schematic structural diagram of a data archiving apparatus for a blockchain according to an embodiment of the present invention, applied to a blockchain node, the apparatus including:
a data operation module 31, configured to receive a write request of transaction data;
a filing management module 32, configured to detect whether the first blockchain meets a preset filing condition;
the data operation module 31 is further configured to, if the detection result of the archive management module 32 is negative, write the transaction data into the first block chain; if the detection result of the filing management module 32 is yes, a second blockchain is created, and the transaction data is written into the second blockchain, wherein a created block of the second blockchain points to the first blockchain.
Preferably, the preset filing condition includes at least one of the following: the block height of the block chain reaches a set block height threshold, the storage space occupied by the block chain is larger than a set storage space threshold, and the creation time length of the block chain is larger than a set time length threshold.
Preferably, the pointing of the created block of the second blockchain to the first blockchain comprises: and the hash value of the last block in the created blocks of the second block chain is the hash value of the last block of the first block chain.
The device further comprises:
the index maintenance module 33 is configured to add, to the transaction data, an index relationship between the identification information of the transaction data and the identification information of the target block chain corresponding to the transaction data and the identification information of the target block chain in an index table.
The data operation module 31 is further configured to receive a query request of transaction data; and inquiring the transaction data through the identification information of the transaction data and the index table.
Example 4:
based on the same inventive concept, the embodiment of the present invention further provides a block link point, and since the principle of solving the problem of the block link point is similar to the data archiving method of the block chain, the implementation of the block chain node may refer to the implementation of the method, and repeated details are not repeated.
Fig. 4 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention, where in fig. 4, a bus architecture may include any number of interconnected buses and bridges, and specifically, one or more processors 41 represented by a processor 41 and various circuits of a memory 42 represented by a memory 42 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface. The processor 41 is responsible for managing the bus architecture and general processing, and the memory 42 may store data used by the processor 41 in performing operations.
In the block chain node provided in the embodiment of the present invention:
the processor 41 is configured to read the program in the memory 42 and execute the following processes: receiving a write request of transaction data; detecting whether the first block chain meets a preset filing condition; if not, writing the transaction data into the first block chain; and if so, creating a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain.
Preferably, the preset archiving condition includes at least one of:
the block height of the block chain reaches a set block height threshold, the storage space occupied by the block chain is larger than a set storage space threshold, and the creation time length of the block chain is larger than a set time length threshold.
Preferably, the creating block of the second blockchain pointing to the first blockchain comprises:
and the hash value of the last block in the created blocks of the second block chain is the hash value of the last block of the first block chain.
Preferably, the processor 41 is further configured to add, to the transaction data, an index relationship between the identification information of the transaction data and the identification information of the target block chain corresponding to the transaction data and the identification information of the target block chain in an index table.
Example 5:
on the basis of the above embodiments, the embodiment of the present invention further provides a block link point, as shown in fig. 5, including: the system comprises a processor 51, a communication interface 52, a memory 53 and a communication bus 54, wherein the processor 51, the communication interface 52 and the memory 53 are communicated with each other through the communication bus 54;
the memory 53 has stored therein a computer program which, when executed by the processor 51, causes the processor 51 to perform the steps of:
receiving a write request of transaction data;
detecting whether the first block chain meets a preset filing condition; if not, writing the transaction data into the first block chain; and if so, creating a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain.
Example 6:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
receiving a write request of transaction data;
detecting whether the first block chain meets a preset filing condition; if not, writing the transaction data into the first block chain; and if so, creating a second block chain, and writing the transaction data into the second block chain, wherein the created block of the second block chain points to the first block chain.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A data archiving method for a blockchain is applied to a blockchain node, and the method comprises the following steps:
receiving a write request of transaction data;
detecting whether the first block chain meets a preset filing condition;
if not, writing the transaction data into the first block chain; if so, newly building a second block chain in a storage device different from the storage device corresponding to the address of the first block chain in the block chain link points, writing the transaction data into the second block chain, and forbidding the data writing function of the first block chain; wherein a created block of the second blockchain points to the first blockchain;
wherein the method further comprises:
and aiming at the transaction data, adding the identification information of the transaction data, the identification information of the target block chain corresponding to the transaction data and the index relation of the identification information of the target block chain in an index table.
2. The method of claim 1, wherein the preset archiving conditions include at least one of:
the block height of the block chain reaches a set block height threshold, the storage space occupied by the block chain is larger than a set storage space threshold, and the creation time length of the block chain is larger than a set time length threshold.
3. The method of claim 1, wherein the second blockchain's founded blocks pointing to the first blockchain comprises:
and the hash value of the last block in the created blocks of the second block chain is the hash value of the last block of the first block chain.
4. An apparatus for block chain data archiving, applied to a block chain node, the apparatus comprising:
the data operation module is used for receiving a write-in request of transaction data;
the archiving management module is used for detecting whether the first block chain meets a preset archiving condition;
the data operation module is further used for writing the transaction data into the first block chain if the detection result of the filing management module is negative; if the detection result of the filing management module is positive, a second block chain is newly established in a storage device different from the storage device corresponding to the address of the first block chain in the block chain node, the transaction data is written into the second block chain, and the data writing function of the first block chain is forbidden; wherein a created block of the second blockchain points to the first blockchain;
wherein the apparatus further comprises:
and the index maintenance module is used for adding the identification information of the transaction data, the identification information of the target block chain corresponding to the transaction data and the index relationship of the identification information of the target block chain in an index table aiming at the transaction data.
5. The apparatus of claim 4, wherein the preset archiving condition comprises at least one of: the block height of the block chain reaches a set block height threshold, the storage space occupied by the block chain is larger than a set storage space threshold, and the creation time length of the block chain is larger than a set time length threshold.
6. The apparatus of claim 4, wherein the second blockchain's founded blocks pointing to the first blockchain comprises: and the hash value of the last block in the created blocks of the second block chain is the hash value of the last block of the first block chain.
7. A block link point, comprising: a memory and a processor;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of any one of claims 1-3.
8. A computer-readable storage medium, characterized in that it stores a computer program executable by an electronic device, which program, when run on the electronic device, causes the electronic device to carry out the steps of the method according to any one of claims 1-3.
CN201811311190.3A 2018-11-06 2018-11-06 Data archiving method and device for block chain Active CN109543455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811311190.3A CN109543455B (en) 2018-11-06 2018-11-06 Data archiving method and device for block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811311190.3A CN109543455B (en) 2018-11-06 2018-11-06 Data archiving method and device for block chain

Publications (2)

Publication Number Publication Date
CN109543455A CN109543455A (en) 2019-03-29
CN109543455B true CN109543455B (en) 2021-07-13

Family

ID=65844390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811311190.3A Active CN109543455B (en) 2018-11-06 2018-11-06 Data archiving method and device for block chain

Country Status (1)

Country Link
CN (1) CN109543455B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110011788B (en) * 2019-04-10 2020-12-25 深圳市网心科技有限公司 Data processing method, system and related equipment based on block chain
CN110287196B (en) * 2019-06-29 2021-11-02 杭州复杂美科技有限公司 Block storage method, parallel chain transaction acquisition method, equipment and storage medium
CN112445792B (en) * 2019-09-04 2024-05-24 中移物联网有限公司 Block chain block data storage method and device, electronic equipment and storage medium
CN111737104A (en) * 2019-10-25 2020-10-02 北京沃东天骏信息技术有限公司 Block chain network service platform, test case sharing method thereof and storage medium
CN110990490B (en) * 2019-12-19 2023-09-01 京东科技信息技术有限公司 Method, device, equipment and medium for checking in blockchain network
CN111275553B (en) * 2020-01-20 2023-08-11 联动优势科技有限公司 Block chain data storage method and block chain system
CN111651443A (en) * 2020-05-22 2020-09-11 京东数字科技控股有限公司 Data management method and device, electronic equipment and storage medium
CN111866085B (en) * 2020-06-28 2021-12-14 北京沃东天骏信息技术有限公司 Data storage method, system and device based on block chain
CN111737362B (en) * 2020-07-22 2020-12-22 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and storage medium
CN112925479A (en) * 2021-02-20 2021-06-08 京东数字科技控股股份有限公司 Block chain data management method and device, electronic equipment and medium
CN112822224B (en) * 2021-04-19 2021-06-22 国网浙江省电力有限公司 Safe transmission method for financial data query

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423426A (en) * 2017-08-02 2017-12-01 众安信息技术服务有限公司 A kind of data archiving method and electronic equipment of block chain block number evidence
CN107526775A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of method of block chain data filing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106686087A (en) * 2016-12-30 2017-05-17 先锋支付有限公司 Blockchain truncation method and distributed node
US20180268944A1 (en) * 2017-03-20 2018-09-20 Ramkrishna Prakash System, apparatus and method for management of health and wellness information, and management of transactions using same
CN107577427B (en) * 2017-08-31 2019-12-13 上海保险交易所股份有限公司 data migration method, device and storage medium for blockchain system
CN107728941B (en) * 2017-09-28 2019-09-24 中国银行股份有限公司 A kind of block chain data compression method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107526775A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of method of block chain data filing
CN107423426A (en) * 2017-08-02 2017-12-01 众安信息技术服务有限公司 A kind of data archiving method and electronic equipment of block chain block number evidence

Also Published As

Publication number Publication date
CN109543455A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109543455B (en) Data archiving method and device for block chain
KR101791594B1 (en) Management of storage in a storage network
CN111124277B (en) Deep learning data set caching method, system, terminal and storage medium
EP3678015A1 (en) Metadata query method and device
US9501512B2 (en) Optimizing storage in a publish / subscribe environment
CN109784058A (en) Version strong consistency method of calibration, client, server and storage medium
CN109522314B (en) Block chain-based data archiving method and terminal equipment
CN110765076B (en) Data storage method, device, electronic equipment and storage medium
CN111444196B (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN110543448A (en) data synchronization method, device, equipment and computer readable storage medium
CN109492049B (en) Data processing, block generation and synchronization method for block chain network
CN109918382A (en) Data processing method, device, terminal and storage medium
CN110995776A (en) Block distribution method and device of block chain, computer equipment and storage medium
CN112597153A (en) Data storage method and device based on block chain and storage medium
CN112256433B (en) Partition migration method and device based on Kafka cluster
CN104765661A (en) Multiple-node hot standby method of metadata service nodes in cloud storage service
CN111444192A (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN104978336A (en) Unstructured data storage system based on Hadoop distributed computing platform
CN107391761A (en) A kind of data managing method and device based on data de-duplication technology
CN108255989A (en) Picture storage method, device, terminal device and computer storage media
CN113836184A (en) Service persistence method and device
CN107391039B (en) Data object storage method and device
US10146466B1 (en) Merging mapping metadata to promote reference counting efficiency
CN111143113A (en) Method, electronic device and computer program product for copying metadata
CN114721594A (en) Distributed storage method, device, equipment and machine 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