CN111125115A - Data storage method, device and medium based on block chain - Google Patents

Data storage method, device and medium based on block chain Download PDF

Info

Publication number
CN111125115A
CN111125115A CN201911370526.8A CN201911370526A CN111125115A CN 111125115 A CN111125115 A CN 111125115A CN 201911370526 A CN201911370526 A CN 201911370526A CN 111125115 A CN111125115 A CN 111125115A
Authority
CN
China
Prior art keywords
block
block chain
chain
core
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911370526.8A
Other languages
Chinese (zh)
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Shandong ICity Information 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 Shandong ICity Information Technology Co., Ltd. filed Critical Shandong ICity Information Technology Co., Ltd.
Priority to CN201911370526.8A priority Critical patent/CN111125115A/en
Publication of CN111125115A publication Critical patent/CN111125115A/en
Pending legal-status Critical Current

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/22Indexing; Data structures therefor; Storage structures
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data storage method, equipment and medium based on a block chain, wherein the method comprises the following steps: acquiring a core block chain, wherein the core block chain stores part or all of write chain information; determining a first block chain positioned before a first block through the first block in the block chain; and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block. By defining the core block chain, the improvement is carried out on the basis of not violating the basic idea of the block chain, each node has the option for data in the block chain while enjoying the supervision right and the voting right, the option for the core block chain is greatly reduced, the storage cost of the node is greatly reduced, and the trueness and the reliability of the data are guaranteed.

Description

Data storage method, device and medium based on block chain
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, device, and medium for storing data based on a blockchain.
Background
With the popularization of block chain technology, the block data generated every moment reaches a very high order. This causes a problem of data storage, which is very unfriendly to hard disk storage and to newly added nodes.
Disclosure of Invention
An embodiment of the present specification provides a data storage method, device, and medium based on a block chain, which are used to solve the following technical problems in the prior art:
the massive data in the block chain causes great pressure on the newly added nodes and the storage devices of the original nodes, and the cost is high.
The embodiment of the specification adopts the following technical scheme:
a first aspect of an embodiment of the present invention provides a data storage method for a block chain, including:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
In one example, further comprising:
judging whether the core block chain is stored in a node;
and if the core block chain is not stored, taking a newly formed second block in the block chain as an established block in the node.
In one example, further comprising:
and monitoring the block information in the core block chain, and if the block information of the core block chain changes, broadcasting the change condition of the block information to inform nodes in the block chain.
In one example, further comprising:
supervising a third block in the core block chain, wherein the third block is a block which is formed easily at the current transaction time;
and judging and forming the transaction specification in the third block, and broadcasting to inform nodes in a block chain.
In one example, further comprising:
and judging whether to change the block information in the core block chain or not according to a consensus mechanism in the block chain.
In one example, the obtaining the core block chain comprises:
acquiring a first core block chain, if the first block chain does not contain target information; a second core block chain is acquired.
In one example, after deleting the first block chain and taking the first block as a new created block, the method further includes:
and downloading part or all of the first block chain through the core block chain, and redefining a new created block.
In one example, the core block chain is stored in a designated node, the designated node including at least one of: government agencies, notarization agencies.
A second aspect of an embodiment of the present invention provides a data storage device based on a block chain, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
A third aspect of an embodiment of the present invention provides a data storage nonvolatile computer storage medium based on a block chain, in which computer-executable instructions are stored, where the computer-executable instructions are configured to:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
by defining the core block chain, the improvement is carried out on the basis of not violating the basic idea of the block chain, each node has the option for data in the block chain while enjoying the supervision right and the voting right, the option for the core block chain is greatly reduced, the storage cost of the node is greatly reduced, and the trueness and the reliability of the data are guaranteed.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic flow chart of a method provided by embodiments of the present disclosure;
fig. 2 is a schematic diagram of an apparatus framework provided in an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in the description belong to the protection scope of the present application.
The embodiment of the application provides a method and a scheme for storing data based on a block chain, the improvement is carried out on the basis of not violating the basic idea of the block chain by defining a core block chain, each node has the option of data in the block chain while enjoying the supervision right and the voting right, the option of the core block chain is greatly reduced, the storage cost of the node is greatly reduced, and the reality and the reliability of the data are guaranteed.
The block chain is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and is a distributed account book which is guaranteed in a cryptographic mode and cannot be tampered and forged.
In a blockchain, the hash value of each block is attached to the hash value of the previous block, each hash value is unique, and once changed, the blocks downstream of the block are changed. In the prior art, a node usually stores all data from a created block to the present, and this retention mode retains all characteristics of a block chain, but wastes storage space, increases the hardware requirement for storing data, and increases the running cost of the block chain.
The storage mode of the block chain is improved based on the problem. In the node, the latest block or a block at a certain position is defined as a new created block, and information of all blocks before the block is deleted after confirming that the information of the block is completely consistent with information of one core block chain. And then downloaded back from the core block chain when it is desired to retrieve the piece of deleted tile information.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method provided in an embodiment of the present disclosure. As shown in fig. 1. The method comprises the following steps:
s101, a core block chain is obtained, and partial or all writing chain information is stored in the core block chain;
s102, determining a first block chain positioned in front of a first block through the first block in the block chain;
s103, judging whether the core block chain contains the first block chain or not, if so, deleting the first block chain, and taking the first block as a new created block.
The block chain is composed of a plurality of connected blocks, each block records the transaction condition of bitcoin in the network for a period of time, and the blocks can be regarded as account pages in the account book. The first block to be constructed earliest is called the founder block and has a unique id (identity document) identification number. Each subsequently created block, except the created block, contains two ID numbers, one being the ID number of the block itself and the other being the ID number of the preamble block. All blocks are connected in sequence through the front-back pointing relationship between ID numbers to form a block chain.
According to the specific embodiment of the present invention, the core block chain refers to a block chain storing part or all of the write chain information, and it should be noted that there should be a plurality of core block chains storing all of the write chain information; there may be a plurality of core block chains storing partial write chain information. Multiple types of core block chains exist simultaneously.
Preferably, in one node, the information may be acquired from a plurality of core block chains, respectively, and if there is no information required in the first core block chain or the information is in doubt, the second core block chain may be acquired and the information in the second core block chain may be downloaded.
According to the embodiment of the present invention, when a node is newly added to a block chain, it is determined whether a core block chain is stored in the node, if the core block chain is not stored, a second block newly formed at the moment of the block chain may be used as an created block in the node, and when the node wants previous block chain information, the second block may be downloaded at any time.
According to an embodiment of the present invention, after step S103, the method further includes: and downloading part or all of the first block chain through the core block chain, and redefining a new created block.
According to the embodiment of the present invention, in the block chain, no matter how much the stored write chain information exists, the supervision right of the node exists from the beginning, and each node can supervise the block information in the core block chain in real time, and if the block information of the core block chain changes, the change condition of the block information is broadcasted to inform each node in the block chain.
Suitably, each new block written into the chain of core blocks is also subject to supervision by the remaining nodes, in particular, a third block in the chain of core blocks, which is a block that is susceptible to being formed at the current time of transaction; and judging and forming the transaction specification in the third block, and broadcasting to inform nodes in a block chain.
According to the embodiment of the invention, each node has a voting right, and when the block information in the core block chain is determined to be changed, each node uses the voting right to determine whether to change the information in the core block chain according to a consensus mechanism in the block chain.
The above embodiments may be implemented by smart contracts, or may be implemented by other ways, and the present invention is not limited to this. The intelligent contract is an automatically running script which is deployed on a blockchain, and has the characteristic of being transparent in public because the intelligent contract is arranged on the blockchain. A user presets rules through an intelligent contract so as to write data into a block chain and acquire data browsing permission, and disclosure of privacy information is avoided to a great extent. Of course, the smart contracts are not the only implementation manner of the present application, and are set correspondingly according to different blockchain platforms, such as an ethernet house, a super book, and the like.
Generally, core block chains have high requirements on hardware and environment, and therefore, mechanisms that are conditional and have high public confidence may be selected according to embodiments of the present invention. Such as government agencies, notary agencies, or large well-credited businesses.
Based on the same idea, some embodiments of the present application further provide a device and a non-volatile computer storage medium corresponding to the above method.
Fig. 2 is a schematic diagram of a device framework provided in an embodiment of the present specification, where a data storage device based on a blockchain includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
Some embodiments of the present application provide a non-volatile computer storage medium corresponding to a blockchain based data storage of fig. 1, having stored thereon computer-executable instructions configured to:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device and media embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for relevant points.
The device and the medium provided by the embodiment of the application correspond to the method one to one, so the device and the medium also have the similar beneficial technical effects as the corresponding method, and the beneficial technical effects of the method are explained in detail above, so the beneficial technical effects of the device and the medium are not repeated herein.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 invention is directed to methods, apparatus (systems), and computer program products according to embodiments of the present invention
A flowchart and/or block diagram of an article. 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.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A data storage method of a block chain is characterized by comprising the following steps:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
2. The method of claim 1, further comprising:
judging whether the core block chain is stored in a node;
and if the core block chain is not stored, taking a newly formed second block in the block chain as an established block in the node.
3. The method of claim 1, further comprising:
and monitoring the block information in the core block chain, and if the block information of the core block chain changes, broadcasting the change condition of the block information to inform nodes in the block chain.
4. The method of claim 1, further comprising:
supervising a third block in the core block chain, wherein the third block is a block which is formed easily at the current transaction time;
and judging and forming the transaction specification in the third block, and broadcasting to inform nodes in a block chain.
5. The method of claim 1, further comprising:
and judging whether to change the block information in the core block chain or not according to a consensus mechanism in the block chain.
6. The method of claim 1, wherein obtaining the chain of core blocks comprises:
acquiring a first core block chain, if the first block chain does not contain target information; a second core block chain is acquired.
7. The method of claim 1, wherein after deleting the first blockchain and treating the first block as a new created block, further comprising:
and downloading part or all of the first block chain through the core block chain, and redefining a new created block.
8. The method of claim 1, wherein the core block chain is stored in a designated node, the designated node comprising at least one of: government agencies, notarization agencies.
9. A blockchain-based data storage device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
10. A blockchain-based data storage non-volatile computer storage medium storing computer-executable instructions configured to:
acquiring a core block chain, wherein the core block chain stores part or all of write chain information;
determining a first block chain positioned before a first block through the first block in the block chain;
and judging whether the core block chain contains the first block chain, if so, deleting the first block chain, and taking the first block as a new created block.
CN201911370526.8A 2019-12-26 2019-12-26 Data storage method, device and medium based on block chain Pending CN111125115A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911370526.8A CN111125115A (en) 2019-12-26 2019-12-26 Data storage method, device and medium based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911370526.8A CN111125115A (en) 2019-12-26 2019-12-26 Data storage method, device and medium based on block chain

Publications (1)

Publication Number Publication Date
CN111125115A true CN111125115A (en) 2020-05-08

Family

ID=70503472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911370526.8A Pending CN111125115A (en) 2019-12-26 2019-12-26 Data storage method, device and medium based on block chain

Country Status (1)

Country Link
CN (1) CN111125115A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111541540A (en) * 2020-07-07 2020-08-14 杭州云链趣链数字科技有限公司 Data processing method and device for block chain privacy protection and computer equipment
CN112835854A (en) * 2021-02-01 2021-05-25 北京百度网讯科技有限公司 File storage method and device, electronic equipment and storage medium
CN116860882A (en) * 2023-09-05 2023-10-10 石家庄学院 Cloud storage resource management and control method and system based on blockchain

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111541540A (en) * 2020-07-07 2020-08-14 杭州云链趣链数字科技有限公司 Data processing method and device for block chain privacy protection and computer equipment
CN111541540B (en) * 2020-07-07 2020-09-29 杭州云链趣链数字科技有限公司 Data processing method and device for block chain privacy protection and computer equipment
CN112835854A (en) * 2021-02-01 2021-05-25 北京百度网讯科技有限公司 File storage method and device, electronic equipment and storage medium
CN116860882A (en) * 2023-09-05 2023-10-10 石家庄学院 Cloud storage resource management and control method and system based on blockchain
CN116860882B (en) * 2023-09-05 2023-12-26 石家庄学院 Cloud storage resource management and control method and system based on blockchain

Similar Documents

Publication Publication Date Title
CN111125115A (en) Data storage method, device and medium based on block chain
CN111935211A (en) Method, equipment and medium for improving main chain performance by adopting side chain based on block chain
CN112487083B (en) Data verification method and device
CN110930578A (en) Voting method, equipment and medium based on block chain
CN111147876A (en) Live broadcast content monitoring method, equipment, storage medium and platform based on block chain
CN111931195A (en) User private key management method, device and medium based on block chain
CN111177257A (en) Data storage and access method, device and equipment of block chain
CN103577546A (en) Method and equipment for data backup, and distributed cluster file system
CN109033365B (en) Data processing method and related equipment
CN111611599A (en) Block chain consensus algorithm implementation method, equipment and medium
CN108874379B (en) Page processing method and device
CN112087530A (en) Method, device, equipment and medium for uploading data to block chain system
CN108062323B (en) Log reading method and device
CN111046267A (en) Method, device and medium for processing network rumors based on block chains
CN111611598A (en) Block chain-based secure distributed cloud storage service implementation method, equipment and medium
CN111639998A (en) Method, device and medium for guaranteeing user deposit rights and interests based on block chain
CN111756803A (en) Server-side pushing method, equipment and medium based on block chain technology
CN111131474A (en) Method, device and medium for managing user protocol based on block chain
CN111010424A (en) Block chain-based network voting method, equipment and medium
CN110888723A (en) Timing task processing method and device
CN111008404A (en) Service call auditing method, equipment and medium based on block chain
CN111191007A (en) Article keyword filtering method and device based on block chain and medium
CN111125802A (en) Method, device and medium for managing non-material cultural heritage information based on block chain
CN110990889A (en) Method, equipment and medium based on block chain notarization prenuptial property
CN110059075B (en) Method, device and equipment for migrating database and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200731

Address after: Floor S01, Inspur Science Park, 1036 Inspur Road, hi tech Zone, Jinan City, Shandong Province

Applicant after: Inspur cloud Information Technology Co.,Ltd.

Address before: Room 3110, S01 building, Langchao building, No. 1036, Langchao Road, high tech Zone, Jinan City, Shandong Province 250101

Applicant before: Shandong Aicheng Network Information Technology Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination