CN113986853A - Block chain data storage and sharing method, system, equipment and terminal - Google Patents

Block chain data storage and sharing method, system, equipment and terminal Download PDF

Info

Publication number
CN113986853A
CN113986853A CN202111123138.7A CN202111123138A CN113986853A CN 113986853 A CN113986853 A CN 113986853A CN 202111123138 A CN202111123138 A CN 202111123138A CN 113986853 A CN113986853 A CN 113986853A
Authority
CN
China
Prior art keywords
data
sharing
original
block chain
storage
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
CN202111123138.7A
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.)
Northwest University
Original Assignee
Northwest University
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 Northwest University filed Critical Northwest University
Priority to CN202111123138.7A priority Critical patent/CN113986853A/en
Publication of CN113986853A publication Critical patent/CN113986853A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing 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
    • 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/602Providing cryptographic facilities or services
    • 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

Abstract

The invention belongs to the technical field of data storage and sharing of a plurality of data owners in a block chain, and discloses a block chain data storage and sharing method, a system, equipment and a terminal, wherein the block chain data storage and sharing method comprises the following steps: after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in a cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology. According to the invention, the fragment data is compressed by using a Huffman tree-based compression method, so that the coding and decoding efficiency of RS erasure codes is improved, and the storage pressure of cloud is reduced; under the condition that a few data owners do not want to share data or lose data, the original data can be recovered by decoding by using an RS erasure code technology, so that data sharing is realized.

Description

Block chain data storage and sharing method, system, equipment and terminal
Technical Field
The invention belongs to the technical field of data storage and sharing of a plurality of data owners in a block chain, and particularly relates to a block chain data storage and sharing method, a block chain data storage and sharing system, a block chain data storage and sharing device and a block chain data storage and sharing terminal.
Background
Currently, the blockchain is a distributed database maintained by nodes of a peer-to-peer network, and is an emerging technology formed by combining technologies such as cryptography, a database, a P2P network, a consensus algorithm, an intelligent contract and the like. Where smart contracts are a computer protocol intended to propagate, validate and execute contracts in an informational manner, allowing for trusted transactions in a blockchain, and thus data sharing can be achieved through smart contracts.
With the continuous development of a block chain technology, in order to solve the problems of low efficiency and the like caused by the fact that a block chain stores a large amount of data, a cloud-based under-chain storage mode is provided, the main idea is to transfer the data originally stored in the block chain into a non-block chain storage system, generate a unique identifier for storing the data according to a certain rule, and when the block chain data needs to access complete data, the original data can be obtained in the non-block chain storage system through the unique identifier of the data.
Huffman coding is a variable length coding mode, and is characterized in that the Huffman coding is sequenced according to probability of characters appearing in a file needing to be coded, two groups with the minimum probability are selected and combined into a group of branches, and thus a Huffman tree is constructed. Huffman compression is a lossless compression algorithm using Huffman coding and is commonly used to reduce the storage space for compressing files. Thus, introducing Huffman compression in the block chain may reduce the under-chain storage space of the cloud.
Erasure codes belong to a method for protecting and recovering data in a coding theory, and are introduced into the storage field because erasure code technology achieves better effects in the process of protecting and recovering data and reduces storage overhead on the premise of ensuring data security. The Reed-Solomon (RS) algorithm is an erasure code algorithm commonly used in a storage system, the RS algorithm encodes m data blocks to generate m + n coded blocks, and original data can be decoded by arbitrarily taking the m blocks, namely the RS algorithm tolerates n data blocks at most or the coded blocks to be lost simultaneously. However, no technical scheme for applying the Huffman compression technology and the reed-solomon (RS) algorithm to the block chain data storage and sharing in the prior art is reported. Therefore, a new method and system for storing and sharing blockchain data based on Huffman compression and erasure coding is needed.
Through the above analysis, the problems and defects of the prior art are as follows:
(1) the block chain stores a large amount of data, which causes problems such as inefficiency.
(2) The technical scheme of applying the Huffman compression technology and the Reed-Solomon (RS) algorithm in combination to the block chain data storage and sharing in the prior art has not been reported.
The difficulty in solving the above problems and defects is:
(1) the Huffman compression technology is used for compressing shared data to improve the coding and decoding efficiency of RS erasure codes and the data sharing efficiency, and the authenticity of the data compressed by the Huffman compression technology is guaranteed;
(2) by means of the mode that the storage scheme under the chain is the most widely applied at present, the scheme can improve the operation efficiency of the block chain, but how to efficiently ensure the data security of the cloud-based storage under the chain is a difficult point;
(3) because the existing data volume is large and the data types are various, it is a difficult point to select a proper storage and sharing scheme and ensure the safe storage and reliable data sharing of the data.
The significance of solving the problems and the defects is as follows:
(1) the current data sharing scheme based on the block chain is mostly applied to a single data owner, while in a practical application scenario, one data may belong to a plurality of data owners simultaneously, and the scheme solves the problem that whether data sharing is performed or not is difficult to decide when the data belongs to a plurality of data owners;
(2) according to the scheme, a chain-up and chain-down storage mode is adopted, data is stored in the cloud instead of all data being stored in the block chain, and meanwhile, a data sharing process is only carried out on the block chain, so that the storage pressure of the block chain is reduced, and the transaction speed of the block chain is improved;
(3) because the existing data volume is large, the scheme compresses data by using a Huffman compression technology and processes the compressed data into different coding blocks by using an RS algorithm, so that the data storage pressure of the cloud is reduced.
Disclosure of Invention
The invention provides a method, a system, equipment and a terminal for storing and sharing block chain data, and particularly relates to a method, a system, equipment and a terminal for storing and sharing block chain data based on Huffman compression and erasure coding technology.
The invention is realized in such a way that a method for storing and sharing block chain data comprises the following steps:
after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in the cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology.
Further, the method for storing and sharing the blockchain data comprises the following steps:
the method comprises the following steps of firstly, obtaining and preprocessing original data: the method comprises the steps of fragmenting data, compressing the data by using a Huffman algorithm, and processing the compressed data into different coding blocks by using an erasure code technology, wherein the Huffman algorithm is used for compressing the data so as to reduce the pressure of data storage under a chain;
step two, data storage: the method includes the steps that data originally stored in a block chain are transferred to cloud ends, each cloud end only stores one coding block, the method adopts a chain-up and chain-down storage mode, original data are stored in the cloud, and only hash values are used in the block chain for transaction, so that the operation efficiency of the block chain is improved;
step three, data sharing: the method includes the steps of firstly recovering data by using an erasure code technology, then decompressing the data by using a Huffman algorithm to obtain original data, and finally sharing the data by using an intelligent contract with access control authority.
Further, the method for storing and sharing the blockchain data further comprises the following steps:
(1) determining the original data: acquiring original data D and determining the number p of common owners;
(2) preprocessing raw data: dividing p into m and n, namely p is m + n, and m is greater than n, wherein m is the number of fragments of original data D, and n is the number of check blocks, dividing the original data D into m blocks, compressing the m pieces of fragment data by using a Huffman tree-based compression method, and finally adding n parts of check data and encoding the m parts of compressed data by using RS erasure codes to form p parts of encoded data;
(3) data storage: respectively storing the formed m + n coded data at cloud ends of p data owners, and storing the generated data hash value in a block chain, so as to solve the problem of storage expansibility of the block chain;
(4) data sharing: and counting the number s of data owners wanting to share the data D so as to judge whether to share the data.
Further, in step (4), the data sharing process is divided into the following two cases:
1) if s < m, the original data D cannot be recovered by using s blocks, data sharing cannot be performed;
2) and if s is larger than or equal to m, sharing data.
Further, in step 2), the data sharing process is as follows:
downloading fragment data: the s data owners respectively download the stored fragment data from respective cloud ends;
recovering the original data: decoding the s block data by using an RS erasure code technology and obtaining uncompressed original data;
thirdly, decompressing the sliced data: decompressing data by using a Huffman tree-based decompression method to obtain original data D;
data sharing: and the data owner uploads the hash value of the original data D to the block chain through an intelligent contract with access control authority, and the data requester downloads the hash value of the original data D through the intelligent contract to complete the data sharing process.
Further, in the fourth step, the data sharing includes:
the data requester makes a data request to the data owner through the intelligent contract and sends the own public key to the data owner; the data owner responds to the data request of the data requester and encrypts the hash by using the public key of the data requester; the data owner uploads the encrypted hash to the blockchain by using an intelligent contract; and the data requester downloads the encrypted hash through the intelligent contract and decrypts the hash by using the private key of the data requester.
Another objective of the present invention is to provide a blockchain data storage and sharing system using the method, the system comprising:
the data acquisition and preprocessing module is used for fragmenting the original data, compressing the original data by using a Huffman algorithm, and processing the compressed data into different coding blocks by using an erasure code technology;
the data storage module is used for transferring data originally stored in the block chain to the cloud ends, and each cloud end only stores one coding block;
and the data sharing module is used for recovering data by using an erasure code technology, decompressing the data by using a Huffman algorithm to obtain original data, and sharing the data by using an intelligent contract with access control authority.
It is a further object of the invention to provide a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of:
after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in the cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology.
It is another object of the present invention to provide a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in the cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology.
Another objective of the present invention is to provide an information data processing terminal, which is used for implementing the block chain data storage and sharing system.
By combining all the technical schemes, the invention has the advantages and positive effects that: the traditional data sharing scheme based on the block chain is only suitable for a single data owner, and in an actual application scene, a certain data may have a plurality of data owners, so the invention provides the block chain data storage and sharing method suitable for the plurality of data owners. Compared with the prior art, the method has the advantages that the storage pressure of the block chain is transferred to the cloud-based storage under the chain, so that the storage pressure of the block chain nodes is reduced, and meanwhile, the storage pressure of the storage under the chain is reduced by using the Huffman compression technology. When data sharing is carried out, if the number s of data owners agreeing to share the data is not less than m, the data sharing can be carried out after the original data is recovered by using an erasure code technology, the authority of a single data owner is weakened in the process, and the safety of the data is improved.
Compared with the prior art, the scheme overcomes the defect of the block chain-based data storage and sharing method when certain data belongs to a plurality of data owners. The invention comprises the following steps: acquiring and preprocessing original data; storing data; and (4) sharing data. When data are stored, the data which are stored in a block chain are transferred to the cloud ends, and each cloud end only stores the coding blocks which are processed by the Huffman compression and erasure coding technology; when most data owners agree to share data, the original data is obtained by decompression through a Huffman algorithm after the data is decoded by using an erasure code technology, and data sharing is carried out by using an intelligent contract with access control authority. The invention can reduce the storage pressure of the block chain and improve the data sharing efficiency.
Compared with the prior art, the invention has the beneficial effects that:
(1) according to the method, the original data are fragmented, the data are coded into a plurality of data blocks by using an RS erasure code technology, the coded data blocks are respectively stored in different cloud ends, and the storage pressure of a block chain is reduced by the method.
(2) The invention uses a Huffman tree-based compression method to compress the partitioned data, thereby improving the coding and decoding efficiency of RS erasure codes and reducing the storage pressure of the cloud.
(3) Based on the fault-tolerant capability of the erasure code technology, the invention can recover the original data by decoding by using the RS erasure code technology under the condition that a few data owners do not want to share the data or the data is lost, thereby realizing the data sharing.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for storing and sharing blockchain data according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a method for storing and sharing blockchain data according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of data storage according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of data sharing provided in the embodiment of the present invention.
FIG. 5 is a block diagram of a blockchain data storage and sharing system according to an embodiment of the present invention;
in the figure: 1. a data acquisition and preprocessing module; 2. a data storage module; 3. and a data sharing module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following 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 view of the problems in the prior art, the present invention provides a method, a system, a device and a terminal for storing and sharing block chain data, which are described in detail below with reference to the accompanying drawings.
As shown in fig. 1, the method for storing and sharing block chain data according to an embodiment of the present invention includes the following steps:
s101, acquiring and preprocessing original data: the method comprises the steps of fragmenting data, compressing the data by using a Huffman algorithm, and processing the compressed data into different coding blocks by using an erasure code technology;
s102, data storage: transferring data originally stored in a block chain to cloud ends, wherein each cloud end only stores one coding block;
s103, data sharing: the method comprises the steps of firstly recovering data by using an erasure code technology, secondly decompressing the data by using a Huffman algorithm to obtain original data, and finally sharing the data by using an intelligent contract with access control authority.
A schematic diagram of a method for storing and sharing block chain data according to an embodiment of the present invention is shown in fig. 2, a schematic diagram of data storage according to an embodiment of the present invention is shown in fig. 3, and a schematic diagram of data sharing according to an embodiment of the present invention is shown in fig. 4.
As shown in fig. 5, the block chain data storage and sharing system according to the embodiment of the present invention includes:
the data acquisition and preprocessing module 1 is used for fragmenting original data, compressing the original data by using a Huffman algorithm, and processing the compressed data into different coding blocks by using an erasure code technology;
the data storage module 2 is used for transferring data originally stored in the block chain to the cloud ends, and each cloud end only stores one coding block;
and the data sharing module 3 is used for recovering data by using an erasure code technology, decompressing the data by using a Huffman algorithm to obtain original data, and sharing the data by using an intelligent contract with access control authority.
The technical solution of the present invention is further described below with reference to specific examples.
Example 1
The invention aims to overcome the defect of a mechanism for safely storing and sharing data when the data has a plurality of data owners, and provides a block chain safe storage and sharing scheme based on Huffman compression and erasure coding technology. The method comprises the steps of firstly fragmenting original data, then compressing the original data by using a Huffman algorithm, finally coding the fragmented data into a plurality of data blocks by using an erasure code technology, then storing the data blocks in the cloud, and storing a file hash generated by the cloud in a block chain. When a data requester requests data, the data owner can share the data by recovering the original data through an erasure code technology.
In order to achieve the purpose, the technical scheme of the invention is as follows:
the invention relates to a block chain data storage and sharing scheme based on a Huffman tree and an erasure code technology, which comprises the following steps:
1. determining the original data: acquiring original data D and determining the number p of common owners;
2. preprocessing raw data: dividing p into m and n, namely p is m + n, and m is greater than n, wherein m is the number of fragments of original data D, and n is the number of check blocks, dividing the original data D into m blocks, compressing the m pieces of fragment data by using a Huffman tree-based compression method, and finally adding n parts of check data and encoding the m parts of compressed data by using RS erasure codes to form p parts of encoded data;
3. data storage: respectively storing the formed m + n coded data in the cloud of p data owners, and storing the generated data hash value in a block chain, thereby solving the problem of storage expansibility of the block chain;
4. data sharing: firstly, counting the number s of data owners wanting to share data D, and judging whether to share the data D or not, wherein the process is divided into the following two conditions;
4.1 if s < m, the original data D can not be recovered by using s blocks, and data sharing can not be carried out;
4.2 if s is more than or equal to m, carrying out data sharing, wherein the specific process is as follows:
(1) downloading fragment data: the s data owners respectively download the stored fragment data from the cloud ends of the data owners;
(2) and (3) recovering original data: decoding the s block data by using an RS erasure code technology to obtain uncompressed original data;
(3) decompressing the fragment data: decompressing data by using a Huffman tree-based decompression method to obtain original data D;
(4) data sharing: the data owner uploads the hash value of the original data D to the block chain through an uploadHash () interface of an intelligent contract DataSharing with access control authority, and the data requester downloads the hash value of the original data D through a requestHash () interface of the intelligent contract DataSharing, so that the data sharing process is completed.
The invention relates to a block chain safe storage and sharing method based on Huffman compression and RS erasure code technology. Compared with the prior art, the method has the advantages that the storage pressure of the block chain is transferred to the cloud-based storage under the chain, so that the storage pressure of the block chain nodes is reduced, and meanwhile, the storage pressure of the storage under the chain is reduced by using the Huffman compression technology. When data sharing is carried out, if the number s of data owners agreeing to share the data is not less than m, the data sharing can be carried out after the original data is recovered by using an erasure code technology, the authority of a single data owner is weakened in the process, and the safety of the data is improved.
According to the method, the original data are segmented, the data are coded into a plurality of data blocks by using an RS erasure code technology, the coded data blocks are respectively stored in different cloud ends, and the storage pressure of a block chain is reduced by the method. The invention uses a Huffman tree-based compression method to compress the fragment data, thereby improving the coding and decoding efficiency of RS erasure codes and reducing the storage pressure of the cloud. Based on the fault-tolerant capability of the erasure code technology, the invention can recover the original data by decoding by using the RS erasure code technology under the condition that a few data owners do not want to share the data or the data is lost, thereby realizing the data sharing.
Example 2
As shown in fig. 2, the erasure code based blockchain data storage and sharing method according to an embodiment of the present invention includes the following steps:
first, determining the original data: acquiring original data D, determining the number p of data owners, and dividing p into m and n, namely p is m + n, wherein m is the number of fragments of the original data D, and n is the number of check blocks;
secondly, preprocessing original data: dividing original data D into m fragments, adding n parts of check data to m parts of original data by utilizing RS erasure codes to form p parts of coded data, wherein the coding process adopts a Reed-Solomon algorithm based on a Cauchy matrix, and the method specifically comprises the following steps of:
(1) taking m as 5 and n as 3 as an example, the original data D is sliced, and the sliced data are denoted as m1, m2, m3, m4, and m 5;
(2) compressing the fragment data m1, m2, m3, m4 and m5 by using a Huffman tree-based compression method, wherein the compressed data are D1, D2, D3, D4 and D5, and are recorded as D ═ D [ D ] D3, D4 and D5 [ ]1,d2,d3,d4,d5]-1
(3) Generating a cauchy matrix:
Figure BDA0003277742120000101
(4) generating an erasure code coding matrix B based on a Cauchy matrix after adding 3 check block data and coding, wherein the process is marked as P ═ BD, P is a coded data matrix, B is a coding matrix, and D is a compressed fragment data matrix;
Figure BDA0003277742120000102
(5) the encoded matrix P includes d1, d2, d3, d4, d4, d5, c1, c2, and c3, which are denoted as P ═ d1, d2, d3, d4, d5, c1, c2, and c3]-1
Thirdly, data storage: respectively storing the coded data in the formed matrix P in the cloud ends of P data owners, and storing the generated data hash value in a block chain, thereby solving the problem of storage expansibility of the block chain;
step four, data sharing: the original data D belongs to a plurality of data owners, so that the number s of the data owners willing to share the original data D is counted at first to judge whether to share the data, and the process is divided into the following two cases;
3.1 if s is less than m, it means that only s data owners are willing to share the original data D, the other p-s data owners are unwilling to share the data, and the original data D cannot be recovered by using s fragmented data, so that the data sharing cannot be performed;
3.2 if s is larger than or equal to m, it represents that the original data D can be recovered by using s pieces of fragment data, and the data sharing is performed, specifically, the process is as follows:
(1) downloading fragment data: the s data owners respectively download the stored fragment data from the cloud ends of the data owners;
(2) and (3) recovering original data: recovering the original data D by decoding the s block data using an RS erasure code algorithm;
first, assuming that s is 5, indicating that 3 data owners (users who store D1, D4 and c 2) are unwilling to share the original data D, and the remaining 5 data owners indicate willingness to share, the process of recovering the original data D is as follows:
step 1: deleting the corresponding row of the fragment data which is not willing to share in the coding matrix, and then the matrix B(m+n)mBecome matrix B'mmFor convenience of description, matrix B 'will be described'mmIs marked as B';
Figure BDA0003277742120000111
step 2: calculating an inverse matrix B 'of matrix B'-1
Step 3: the decoding restores the original data, and the specific process is divided into the following 4 steps:
first, in order to restore original data, data willing to share users is formed into a new matrix K ═ d2,d3,d5,c1,c3]-1
② to calculate data D, first, equation B' D ═ K is expressed;
Figure BDA0003277742120000121
③ due to B'-1B ═ E, equation B ' D ═ K multiplied by B ' simultaneously '-1To obtain B'-1B'D=B'-1K;
Fourthly, D ═ B 'is obtained'-1K, finishing the decoding process in the process to obtain fragment data d1, d2, d3, d4 and d 5;
(3) decompressing the fragment data: decompressing the fragment data D1, D2, D3, D4 and D5 by using a Huffman tree-based decompression method to obtain m1, m2, m3, m4 and m5, and completing the whole process of restoring the original data D by the processes;
(4) data sharing: when the data requester requests data D, the data owner uses the smart contract DataSharing with access control authority to implement data chaining.
Firstly, a data requester makes a data request to a data owner through an intelligent contract and sends a public key of the data requester to the data owner through a sendPk () interface;
the data owner responds to the data request of the data requester and encrypts the hash by using the public key of the data requester;
thirdly, the data owner uploads the encrypted hash to the block chain by using an uploadHash () interface of the intelligent contract;
and fourthly, the data requester downloads the encrypted hash through the intelligent contract requestHash () interface and decrypts the hash by using the private key of the data requester.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When used in whole or in part, is implemented in a computer program product that includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the invention may be generated in whole or in part when the computer program instructions are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL), or wireless (e.g., infrared, wireless, microwave, etc.)). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any modification, equivalent replacement, and improvement made by those skilled in the art within the technical scope of the present invention disclosed in the present invention should be covered within the scope of the present invention.

Claims (10)

1. A method for storing and sharing blockchain data, the method comprising: after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in a cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology.
2. The blockchain data storage and sharing method according to claim 1, wherein the blockchain data storage and sharing method comprises the steps of:
the method comprises the following steps of firstly, obtaining and preprocessing original data: the method comprises the steps of fragmenting data, compressing the data by using a Huffman algorithm, and processing the compressed data into different coding blocks by using an erasure code technology;
step two, data storage: transferring data originally stored in a block chain to cloud ends, wherein each cloud end only stores one coding block;
step three, data sharing: and recovering data by using an erasure code technology, decompressing the data by using a Huffman algorithm to obtain original data, and sharing the data by using an intelligent contract with access control authority.
3. The blockchain data storage and sharing method according to claim 1, wherein the blockchain data storage and sharing method further comprises:
(1) determining the original data: acquiring original data D and determining the number p of common owners;
(2) preprocessing raw data: dividing p into m and n, wherein p is m + n, m is greater than n, m is the number of fragments of original data D, n is the number of check blocks, dividing the original data D into m blocks, compressing the m fragments by using a Huffman tree-based compression method, and finally adding n parts of check data and encoding the m parts of compressed data by using RS erasure codes to form p parts of encoded data;
(3) data storage: respectively storing the formed m + n coded data in the cloud of p data owners, and storing the generated data hash value in a block chain, thereby solving the problem of storage expandability of the block chain;
(4) data sharing: and counting the number s of data owners wanting to share the data D so as to judge whether to share the data.
4. The blockchain data storage and sharing method according to claim 3, wherein in the step (4), the data sharing process is divided into the following two cases:
1) if s < m, the original data D cannot be recovered by using s blocks, data sharing cannot be performed;
2) and if s is larger than or equal to m, sharing data.
5. The blockchain data storage and sharing method according to claim 4, wherein in step 2), the data sharing process is as follows:
downloading fragment data: the s data owners respectively download the stored fragment data from respective cloud ends;
recovering the original data: decoding the s block data by using an RS erasure code technology to obtain uncompressed original data;
thirdly, decompressing the sliced data: decompressing data by using a Huffman tree-based decompression method to obtain original data D;
data sharing: and the data owner uploads the hash value of the original data D to the block chain through an intelligent contract with access control authority, and the data requester downloads the hash value of the original data D through the intelligent contract to complete the data sharing process.
6. The blockchain data storage and sharing method according to claim 5, wherein in the step (iv), the data sharing includes: the data requester makes a data request to the data owner through the intelligent contract and sends the own public key to the data owner; the data owner responds to the data request of the data requester and encrypts the hash by using the public key of the data requester; the data owner uploads the encrypted hash to the blockchain by using an intelligent contract; and the data requester downloads the encrypted hash through the intelligent contract and decrypts the hash by using the private key of the data requester.
7. A blockchain data storage and sharing system for implementing the blockchain data storage and sharing method of any one of claims 1 to 6, wherein the blockchain data storage and sharing system comprises:
the data acquisition and preprocessing module is used for fragmenting the original data, compressing the original data by using a Huffman algorithm, and processing the compressed data into different coding blocks by using an erasure code technology;
the data storage module is used for transferring data originally stored in the block chain to the cloud ends, and each cloud end only stores one coding block;
and the data sharing module is used for recovering data by using an erasure code technology, decompressing the data by using a Huffman algorithm to obtain original data, and sharing the data by using an intelligent contract with access control authority.
8. A computer device, characterized in that the computer device comprises a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to carry out the steps of:
after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in a cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology.
9. A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
after original data are fragmented and compressed by using a Huffman algorithm, the fragmented data are encoded into a plurality of data blocks by using an erasure code technology and then stored in a cloud, and a file hash generated by the cloud is stored in a block chain; when a data requester requests data, the data owner can share the data by recovering the original data by using an erasure code technology.
10. An information data processing terminal, characterized in that the information data processing terminal is configured to implement the blockchain data storage and sharing system according to claim 7.
CN202111123138.7A 2021-09-24 2021-09-24 Block chain data storage and sharing method, system, equipment and terminal Pending CN113986853A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111123138.7A CN113986853A (en) 2021-09-24 2021-09-24 Block chain data storage and sharing method, system, equipment and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111123138.7A CN113986853A (en) 2021-09-24 2021-09-24 Block chain data storage and sharing method, system, equipment and terminal

Publications (1)

Publication Number Publication Date
CN113986853A true CN113986853A (en) 2022-01-28

Family

ID=79736529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111123138.7A Pending CN113986853A (en) 2021-09-24 2021-09-24 Block chain data storage and sharing method, system, equipment and terminal

Country Status (1)

Country Link
CN (1) CN113986853A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114594911A (en) * 2022-03-13 2022-06-07 西安电子科技大学 Block chain data storage system and method based on under-chain erasure code distributed storage

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114594911A (en) * 2022-03-13 2022-06-07 西安电子科技大学 Block chain data storage system and method based on under-chain erasure code distributed storage
CN114594911B (en) * 2022-03-13 2024-03-29 西安电子科技大学 Block chain data storage system and method based on under-chain erasure code distributed storage

Similar Documents

Publication Publication Date Title
CN107046812B (en) Data storage method and device
US20170286224A1 (en) Optimal slice encoding strategies within a dispersed storage unit
CN107395209B (en) Data compression method, data decompression method and equipment thereof
CN104754055A (en) Safety cloud storage method for use in multi-cloud environment
US20210227007A1 (en) Data storage method, encoding device, and decoding device
CN107154945A (en) A kind of cloudy fragmentation method for secure storing and system based on correcting and eleting codes
US20190004727A1 (en) Using a namespace to augment de-duplication
CN110300159B (en) Sensing cloud data safe low-cost storage method based on edge computing
US10476519B2 (en) System and method for high-speed transfer of small data sets
US11586588B2 (en) System and methods for bandwidth-efficient cryptographic data transfer
CN112182109A (en) Distributed data coding storage method based on block chain and electronic equipment
CN113986853A (en) Block chain data storage and sharing method, system, equipment and terminal
CN116108506A (en) Meta-universe digital asset security management system
US20190065255A1 (en) Accessing data in accordance with an execution deadline
CN112559462A (en) Data compression method and device, computer equipment and storage medium
US20230401173A1 (en) System and methods for secure deduplication of compacted data
CN108897497B (en) Centerless data management method and device
Sari et al. The implementation of timestamp, bitmap and rake algorithm on data compression and data transmission from iot to cloud
CN116760661A (en) Data storage method, apparatus, computer device, storage medium, and program product
US20190007380A1 (en) De-duplication of data streams
CN111614728A (en) Data transmission method and system
CN116880778B (en) User privacy protection method based on regenerative coding and distributed storage
CN112988461B (en) Data backup method, edge node, data center and computer storage medium
CN108920104B (en) Centerless video monitoring cloud access method
US20240080478A1 (en) Point cloud encoding and decoding method and apparatus, computer, and 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