CN112181307A - Block chain based distributed data redundancy storage method and electronic equipment - Google Patents

Block chain based distributed data redundancy storage method and electronic equipment Download PDF

Info

Publication number
CN112181307A
CN112181307A CN202011090652.0A CN202011090652A CN112181307A CN 112181307 A CN112181307 A CN 112181307A CN 202011090652 A CN202011090652 A CN 202011090652A CN 112181307 A CN112181307 A CN 112181307A
Authority
CN
China
Prior art keywords
storage
terminal
storage node
candidate
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.)
Withdrawn
Application number
CN202011090652.0A
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.)
Ningbo Golden Lion Technology Co Ltd
Original Assignee
Ningbo Golden Lion 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 Ningbo Golden Lion Technology Co Ltd filed Critical Ningbo Golden Lion Technology Co Ltd
Priority to CN202011090652.0A priority Critical patent/CN112181307A/en
Publication of CN112181307A publication Critical patent/CN112181307A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • 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
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Abstract

The embodiment of the disclosure discloses a distributed data redundancy storage method based on a block chain and an electronic device. One embodiment of the method comprises: acquiring a target data block set to be stored; generating a coding matrix; multiplying the target data block set by the coding matrix to obtain coded data; transmitting the encoded data to a first terminal, wherein the first terminal stores the encoded data; receiving the storage record table returned by the first terminal; and recording the storage record table into the block chain. According to the method, the target data block set is subjected to encoding processing to generate encoded data, and the encoded data has redundancy. The first terminal stores the coded data, and can store the coded data in a storage node with low storage cost while ensuring redundant storage. And finally, the storage record table is issued to the block chain, so that the storage cost is saved while the safety of the distributed storage data is ensured.

Description

Block chain based distributed data redundancy storage method and electronic equipment
Technical Field
The embodiment of the disclosure relates to the field of block chains and data storage, in particular to a distributed data redundancy storage method and electronic equipment based on the block chains.
Background
With the development of cloud computing and block chain technologies, the confidentiality and credibility of distributed storage and communication are effectively guaranteed by linking the storage terminals of the distributed storage and relying on the characteristics of decentralization and traceability of the block chain, and the development and application of the block chain-based distributed data storage are promoted.
However, when the method is adopted for large-scale distributed data storage in actual business, the following technical problems still face:
firstly, due to the large scale of the number of nodes and the low reliability of a single node, failure events of the storage nodes occur frequently, and the reliability, real-time availability and safety of the data stored in a distributed manner cannot be effectively guaranteed.
Secondly, the distributed storage terminal based on the block chain has strong heterogeneity, and the storage performance and the network communication performance of different terminals have large difference. Indiscriminately storing data uplinks in individual storage terminals, storage nodes, creates a waste of storage resources.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a block chain based distributed data redundancy storage method and an electronic device to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method for block chain-based distributed data redundancy storage, including: acquiring a target data block set to be stored; generating a coding matrix; multiplying the target data block set by the coding matrix to obtain coded data; transmitting the encoded data to a first terminal, wherein the first terminal stores the encoded data; receiving the storage record table returned by the first terminal; and recording the storage record table into the block chain.
In a second aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any one of the first aspects.
The above embodiments of the present disclosure have the following advantages: firstly, generating an encoding matrix, and encoding a target data block to be stored by using the encoding matrix to generate encoded data with redundancy. The application of the coding processing technology has the advantages of high reliability, low storage space overhead and the like, and can quickly restore data when the problems of data damage or data loss occur. And secondly, sending the ciphertext set to a first terminal for storing data. And the first terminal determines a target storage node set according to the storage cost index and the storage reliability index of each storage node. In the process of determining the target storage node set, screening is firstly carried out according to the storage cost index, and storage nodes with lower storage cost are preferentially selected. And secondly, screening according to the storage reliability index to ensure that the selected target storage node set can meet the storage reliability requirement. And thirdly, recording the storage record table into the block chain. By utilizing the characteristics of decentralization and traceability of the block chain, distributed data redundancy storage based on the block chain is realized. The method transmits the target data block to the first terminal in the form of coded data after coding processing, and the coded data has storage redundancy. And the first terminal selects a target storage node set according to the storage cost index and the storage reliability index. And finally, the storage record table is issued to the block chain, and the coded data can be stored in the storage nodes with low storage cost while ensuring redundant storage and safe and reliable storage, so that the storage cost is saved while ensuring the safety of the distributed storage data.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is an architectural diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram of some embodiments of a block chain based distributed data redundancy storage method, according to some embodiments of the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a block chain based distributed data redundancy storage approach, according to some embodiments of the present disclosure;
FIG. 4 is a schematic block diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the blockchain-based distributed data redundancy storage method of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a data storage application, a data encryption application, a data analysis application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various terminal devices having a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the above-listed terminal apparatuses. Which may be implemented as multiple software or software modules (e.g., to provide target block data input, etc.), or may be implemented as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a server that stores target data input by the terminal apparatuses 101, 102, 103, and the like. The server may encrypt and distribute, store, and the like the received target data, and feed back a processing result (e.g., encoded data) to the terminal device.
It should be noted that the distributed data redundancy storage method based on the block chain provided by the embodiment of the present disclosure may be executed by the server 105, or may be executed by the terminal device.
It should be noted that the local area of the server 105 may also directly store data, and the server 105 may directly extract the local data and obtain encoded data after encoding processing, in this case, the exemplary system architecture 100 may not include the terminal devices 101, 102, and 103 and the network 104.
It should be noted that the terminal devices 101, 102, and 103 may also have storage-class applications installed therein, and in this case, the encoding processing method may also be executed by the terminal devices 101, 102, and 103. At this point, the exemplary system architecture 100 may also not include the server 105 and the network 104.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, for providing storage services), or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of electronic devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a blockchain-based distributed data redundancy storage method according to the present disclosure is shown. The block chain-based distributed data redundancy storage method comprises the following steps:
step 201, acquiring a target data block set to be stored.
In some embodiments, an executing agent (e.g., the electronic device shown in fig. 1) of the block chain-based distributed data redundancy storage method may directly obtain a target set of data blocks to be stored by a target user. Optionally, the target user refers to a user who provides a target data block to be stored. The set of target data blocks includes a first number of target data blocks.
Step 202, generating an encoding matrix.
In some embodiments, the execution body generates an encoding matrix. Optionally, the execution body determines a redundant bit value and an allowable bit value. An identity matrix is generated, wherein the identity matrix comprises a first number of rows and a first number of columns. A random matrix is generated, wherein the random matrix includes a first number of columns and a number of rows that is a sum of the redundant bit values and the fault-tolerant bit values. The elements in the random matrix are values that are independently selected to be either "0" or "1" according to a probability of "0.5".
An encoding matrix is generated, wherein the encoding matrix comprises a first number of rows and a first number of columns of a sum of the redundant bit values, the tolerant bit values, and the first number. The first number of the row identity matrixes of the coding matrix, and the sum of the rear redundancy bit value and the fault-tolerant bit value of the coding matrix are row random matrixes. Specifically, the coding matrix can be represented by the following formula:
Figure BDA0002721934840000051
wherein, I represents an identity matrix,
Figure BDA0002721934840000052
k denotes the first number. R represents a random matrix, and R represents a random matrix,
Figure BDA0002721934840000061
representing the redundant bit value and t representing the tolerance bit value. r denotes an element in a random matrix, r1,1Elements representing the 1 st row and 1 st column of the random matrix, r+t,kRepresenting the elements of row + t and column k of the random matrix. G denotes an encoding matrix.
Step 203, multiplying the target data block set and the coding matrix to obtain coded data.
In some embodiments, the execution body multiplies the target set of data blocks and the encoding matrix to obtain encoded data. Specifically, the target data block set may be multiplied by the coding matrix using the following equation to generate the coded data:
D×G=S,
where D denotes a target data block set, G denotes an encoding matrix, and S denotes encoded data. D ═ D1,...,Dk]K denotes a first number, the set of target data blocks contains a first number of target data blocks, and k is an arbitrary integer. D1Representing the first target data block, DkRepresenting the kth target data block.
The above formula is used as an invention point of the embodiment of the present disclosure, and solves the technical problems mentioned in the background art that "because the number of nodes is large in scale and the reliability of a single node is not high, failure events of storage nodes occur frequently, and the reliability, real-time availability and safety of data in distributed storage cannot be effectively guaranteed. Firstly, the coding matrix is constructed in a mode of combining the identity matrix and the random matrix, the requirement that an original target data block after coding processing and a newly-increased redundant part in coded data are mutually independent is met, and information in an original target data block set can be directly extracted conveniently in the data recovery process. Secondly, the number of parameters in the coding matrix is small, the coding matrix only comprises redundant bit values and fault-tolerant bit values, the parameter setting mode is simple, and the operation efficiency is higher. Finally, the coded data processed by the coding matrix has redundancy, and in the process of data recovery, rapid and accurate storage fault repair can be realized according to the coding matrix, so that the reliability, real-time availability and safety of the data of distributed storage are improved, and the technical problem I is solved.
Step 204, the encoded data is sent to the first terminal.
In some embodiments, the execution body transmits the encoded data to the first terminal, and the first terminal stores the encoded data. Optionally, the first terminal includes at least one management node and a storage node set. The storage node set comprises a second number of storage nodes, and the management node records the storage performance index of each storage node in the storage node set. Optionally, the storage performance index is determined by a storage cost index and a storage reliability index.
In some optional implementations of some embodiments, for each storage node in the storage node set, the first terminal determines, according to the storage cost index and the storage reliability index of the storage node stored in the management node, the storage performance index of the storage node by using the following formula:
Figure BDA0002721934840000071
wherein α and β are a first weight and a second weight, respectivelyAnd alpha and beta are any positive integer. i represents a storage node count, c represents a storage cost index, a represents a storage reliability index, and s represents a storage performance index. c. CiRepresenting a storage cost index of the i-th storage node, aiRepresenting the storage reliability index, s, of the ith storage nodeiAnd the storage performance index of the ith storage node is shown.
And the first terminal reorders the storage performance indexes of each storage node in the storage node set from large to small according to the numerical values to generate a storage performance index sequence. And the first terminal determines the storage nodes corresponding to the first third number of storage performance indexes in the storage performance index sequence as a first candidate storage node set.
Optionally, the first terminal determines the reliability index constraint value. The first terminal determines the number of the sum of the redundant bit value, the tolerance bit value, and the first number as a fourth number. And the first terminal reorders the storage cost indexes of each first candidate storage node in the first candidate storage node set from small to large according to the numerical values to generate a storage cost index sequence. And the first terminal determines the storage nodes corresponding to the first fourth number of storage cost indexes in the storage cost index sequence as a second candidate storage node set. The first terminal generates a third storage node set by using all storage nodes in the first candidate storage node set which are not in the second candidate storage node set. The first terminal determines a sum of candidate storage reliability indicators for the second set of candidate storage nodes.
Optionally, in response to the sum of the candidate storage reliability indicators being greater than the reliability indicator constraint value, determining the second set of candidate indicator storage nodes as the target set of storage nodes.
Optionally, in response to that the sum of the candidate storage reliability indexes is smaller than the reliability index constraint value, the first terminal reorders the storage reliability indexes of each third candidate storage node in the third candidate storage node set from large to small according to the numerical values, and generates a first storage reliability index sequence. And the first terminal reorders the storage reliability indexes of each second candidate storage node in the second candidate storage node set from small to large according to the numerical values to generate a second storage reliability index sequence. And the first terminal removes the storage node corresponding to the first storage reliability index in the second storage reliability index sequence from the second candidate storage node set. And the first terminal adds the storage node corresponding to the first storage reliability index in the first storage reliability index sequence into the second candidate storage node set. And determining the second candidate index storage node set as a target storage node set.
Optionally, the first terminal stores the encoded data in the target storage node set. The first terminal splits the encoded data into a fourth number of encoded data blocks. And the first terminal sequentially stores the fourth number of coded data blocks in the fourth number of target storage nodes of the target storage node set.
Optionally, the first terminal generates a storage record table. And generating a storage record table according to the corresponding relation between the fourth number of storage nodes and the coded data blocks stored corresponding to the fourth number of storage nodes. The elements in the storage record table are the content of the first byte of the encoded data block and the address of the storage node corresponding to the encoded data block.
The above method is an inventive point of the present disclosure, and solves the technical problem mentioned in the background art that "indiscriminately storing data uplinks in each storage terminal and storage node causes waste of storage resources. First, a first terminal for data storage determines a first candidate storage node set capable of meeting a target data storage requirement according to storage cost indexes of storage nodes. And secondly, the first terminal selects storage nodes capable of meeting the requirement of the reliability index from the first candidate storage node set according to a preset reliability index constraint value so as to finally determine a target storage node set. According to the method, in the process of determining the target storage node set, screening is performed according to the storage cost index, and storage nodes with lower storage cost are preferentially selected. And then screening is carried out according to the storage reliability index, so that the selected target storage node set can meet the storage reliability requirement. The method realizes the optimized utilization of the storage resources on the premise of meeting the requirement of reliable storage, thereby solving the second technical problem.
Step 205, receiving the storage record table returned by the first terminal.
In some embodiments, the execution body receives a storage record table returned by the first terminal.
Step 206, record the storage record table into the block chain.
In some embodiments, the execution body records the storage record table into the block chain. Optionally, an intelligent contract is invoked, wherein the intelligent contract comprises intelligent contract code, an instance, and execution data. The intelligent contract includes intelligent contract code, an instance, and execution data. An intelligent contract is a set of commitments defined in digital form. The intelligent contract can control data in the block chain and appoint the rights and obligations of each participating terminal in the block chain. The smart contracts may be automatically executed by the computer system. In particular, the intelligent contract includes intelligent contract code, instances, and execution data. The intelligent contract code may be the source code of the intelligent contract. The intelligent contract code may be a piece of code that the computer system is capable of executing. An instance may be an actual service in a blockchain running an intelligent contract. The execution data may be data that remains in the blockchain after execution of an instance.
And operating the intelligent contract code and storing the storage record table in a block chain. Specifically, the storage record table may be determined as one block. And running intelligent contract codes to add the block to the block chain. Specifically, the intelligent contract for recording the block generates an instance and executes data during the operation process. The instance and the execution data are recorded in a blockchain.
One embodiment presented in fig. 2 has the following beneficial effects: firstly, generating an encoding matrix, and encoding a target data block to be stored by using the encoding matrix to generate encoded data with redundancy. The application of coding processing has the advantages of high reliability, low storage space overhead and the like, and can quickly restore data when the problems of data damage or data loss occur. And secondly, sending the ciphertext set to a first terminal for storing data. And the first terminal determines a target storage node set according to the storage cost index and the storage reliability index of each storage node. In the process of determining the target storage node set, screening is firstly carried out according to the storage cost index, and storage nodes with lower storage cost are preferentially selected. And secondly, screening according to the storage reliability index to ensure that the selected target storage node set can meet the storage reliability requirement. And thirdly, recording the storage record table into the block chain. By utilizing the characteristics of decentralization and traceability of the block chain, distributed data redundancy storage based on the block chain is realized. The method transmits the target data block to the first terminal in the form of coded data after coding processing, and the coded data has storage redundancy. And the first terminal selects a target storage node set according to the storage cost index and the storage reliability index. And finally, the storage record table is issued to the block chain, and the coded data can be stored in the storage nodes with low storage cost while ensuring redundant storage and safe and reliable storage, so that the storage cost is saved while ensuring the safety of the distributed storage data.
With continued reference to fig. 3, a schematic diagram of one application scenario of a block chain based distributed data redundancy storage method according to the present disclosure is shown.
In the application scenario of fig. 3, a user sends a set of target data chunks 301 to be stored to a server. After receiving the target data block set, the server performs encoding processing on the target data block to generate encoded data 302. And the server sends the coded data to the first terminal to finish storage. Wherein the set of target storage nodes for storage comprises a fourth number of storage nodes. p represents a fourth number. And obtaining a storage record table 303 according to the coded data and the corresponding situation of the storage nodes. The server receives the stored record table 304 sent back by the first terminal. The server updates blockchain 305. Wherein the block chain includes a fifth number of blocks. n denotes a fifth number.
It is understood that the elements and processes recited in this application scenario 300 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting benefits described above for the method are also applicable to the application scenario 300 and the units included therein, and are not described herein again.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use in implementing a server of an embodiment of the present disclosure is shown. The server shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An Input/Output (I/O) interface 405 is also connected to the bus 404.
The following components are connected to the I/O interface 405: a storage section 406 including a hard disk and the like; and a communication section 407 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 407 performs communication processing via a network such as the internet. A drive 408 is also connected to the I/O interface 405 as needed. A removable medium 409 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted as necessary on the drive 408, so that a computer program read out therefrom is mounted as necessary in the storage section 406.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 407 and/or installed from the removable medium 409. The above-described functions defined in the method of the present disclosure are performed when the computer program is executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable medium in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A distributed data redundancy storage method based on a block chain comprises the following steps:
acquiring a target data block set to be stored, wherein the target data block set comprises a first number of target data blocks;
generating a coding matrix;
multiplying the target data block set and the coding matrix to obtain coded data;
sending the coded data to a first terminal, wherein the first terminal stores the coded data, and the first terminal generates a storage record table;
receiving the storage record table returned by the first terminal;
and recording the storage record table into a block chain.
2. The method of claim 1, wherein the generating an encoding matrix comprises:
determining a redundant bit value and a fault-tolerant bit value;
generating an identity matrix, wherein the identity matrix comprises a first number of rows and a first number of columns;
generating a random matrix, wherein the random matrix comprises a first number of columns and a sum number of rows of the redundant bit values and the fault-tolerant bit values, and elements in the random matrix are values which are independently selected to be '0' or '1' according to a probability of '0.5';
generating the coding matrix, wherein the coding matrix comprises a row with the sum of the redundant bit values, the tolerance bit values and the first number and a column with the first number, the first row with the first number of the coding matrix is the identity matrix, and the row with the sum of the redundant bit values and the tolerance bit values after the coding matrix is the random matrix.
3. The method of claim 2, wherein the first terminal comprises at least one management node and a storage node set, wherein the storage node set comprises a second number of storage nodes, and wherein the management node records storage performance indicators for each storage node in the storage node set.
4. The method of claim 3, wherein the storage performance indicator is determined by a storage cost indicator and a storage reliability indicator.
5. The method of claim 4, wherein the first terminal stores the encoded data, comprising:
for each storage node in the storage node set, according to the storage cost index and the storage reliability index of the storage node stored in the management node, the first terminal determines the storage performance index of the storage node by using the following formula:
Figure FDA0002721934830000021
wherein α and β are a first weight and a second weight, respectively, α and β are any positive integer, i represents the storage node count, c represents the storage cost index, a represents the storage reliability index, s represents the storage performance index, c represents the storage performance indexiRepresenting a storage cost index of the i-th storage node, aiRepresenting the storage reliability index, s, of the ith storage nodeiThe storage performance index of the ith storage node is represented;
the first terminal reorders the storage performance indexes of each storage node in the storage node set from large to small according to numerical values to generate a storage performance index sequence;
the first terminal determines storage nodes corresponding to the first third number of storage performance indexes in the storage performance index sequence as a first candidate storage node set;
the first terminal generates a target storage node set based on the first candidate storage node set;
and the first terminal stores the coded data in the target storage node set.
6. The method of claim 5, wherein the first terminal generating a target set of storage nodes based on the first set of candidate storage nodes comprises:
the first terminal determines a reliability index constraint value;
the first terminal determines the number of the sum of the redundant bit value, the tolerance bit value and the first number as a fourth number;
the first terminal reorders the storage cost indexes of each first candidate storage node in the first candidate storage node set from small to large according to numerical values to generate a storage cost index sequence;
the first terminal determines storage nodes corresponding to the first fourth number of storage cost indexes in the storage cost index sequence as a second candidate storage node set;
the first terminal generates a third storage node set by using all storage nodes in the first candidate storage node set which are not in the second candidate storage node set;
the first terminal determines a candidate storage reliability index sum of the second candidate storage node set;
determining the second set of candidate storage nodes as the target set of storage nodes in response to the sum of candidate storage reliability indicators being greater than the reliability indicator constraint value.
7. The method of claim 6, wherein the first terminal generates a target set of storage nodes based on the first set of candidate storage nodes, further comprising:
in response to that the sum of the candidate storage reliability indexes is smaller than the reliability index constraint value, the first terminal reorders the storage reliability indexes of each third candidate storage node in the third candidate storage node set from large to small according to numerical values to generate a first storage reliability index sequence;
the first terminal reorders the storage reliability indexes of each second candidate storage node in the second candidate storage node set from small to large according to numerical values to generate a second storage reliability index sequence;
the first terminal removes the storage node corresponding to the first storage reliability index in the second storage reliability index sequence from the second candidate storage node set;
the first terminal adds the storage node corresponding to the first storage reliability index in the first storage reliability index sequence into the second candidate storage node set;
determining the second set of candidate index storage nodes as the target set of storage nodes.
8. The method of claim 7, wherein the first terminal storing the encoded data in the set of target storage nodes comprises:
the first terminal dividing the encoded data into a fourth number of encoded data blocks;
and the first terminal sequentially stores the fourth number of coded data blocks in a fourth number of target storage nodes of the target storage node set.
9. The method of claim 8, wherein the recording the storage record table into a blockchain comprises:
invoking an intelligent contract, wherein the intelligent contract comprises intelligent contract code, an instance, and execution data;
and operating the intelligent contract code and storing the storage record table in a block chain.
10. A first terminal device comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
CN202011090652.0A 2020-10-13 2020-10-13 Block chain based distributed data redundancy storage method and electronic equipment Withdrawn CN112181307A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011090652.0A CN112181307A (en) 2020-10-13 2020-10-13 Block chain based distributed data redundancy storage method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011090652.0A CN112181307A (en) 2020-10-13 2020-10-13 Block chain based distributed data redundancy storage method and electronic equipment

Publications (1)

Publication Number Publication Date
CN112181307A true CN112181307A (en) 2021-01-05

Family

ID=73949816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011090652.0A Withdrawn CN112181307A (en) 2020-10-13 2020-10-13 Block chain based distributed data redundancy storage method and electronic equipment

Country Status (1)

Country Link
CN (1) CN112181307A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485637A (en) * 2021-05-11 2021-10-08 广州炒米信息科技有限公司 Data storage method and device and computer equipment
CN114826720A (en) * 2022-04-19 2022-07-29 中国工商银行股份有限公司 Data storage method and device, computer readable storage medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485637A (en) * 2021-05-11 2021-10-08 广州炒米信息科技有限公司 Data storage method and device and computer equipment
CN114826720A (en) * 2022-04-19 2022-07-29 中国工商银行股份有限公司 Data storage method and device, computer readable storage medium and electronic equipment
CN114826720B (en) * 2022-04-19 2024-01-30 中国工商银行股份有限公司 Data storage method, data storage device, computer readable storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109274717B (en) Block chain based shared storage method, device, medium and electronic equipment
US11314451B2 (en) Method and apparatus for storing data
CN111950030A (en) Data sharing storage method based on block chain, terminal equipment and storage medium
CN111629063A (en) Block chain based distributed file downloading method and electronic equipment
CN112181307A (en) Block chain based distributed data redundancy storage method and electronic equipment
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN112182109A (en) Distributed data coding storage method based on block chain and electronic equipment
CN111610938B (en) Distributed data code storage method, electronic device and computer readable storage medium
CN112182108A (en) Block chain based distributed data storage updating method and electronic equipment
US20230040564A1 (en) Learning Causal Relationships
CN112182112A (en) Block chain based distributed data dynamic storage method and electronic equipment
CN110245014B (en) Data processing method and device
CN111858586B (en) Data processing method and device
CN111951112A (en) Intelligent contract execution method based on block chain, terminal equipment and storage medium
CN112445860B (en) Method and device for processing distributed transaction
CN109617789B (en) Method, system, electronic device and storage medium for processing session message
CN111966653A (en) Data processing method, device, server and storage medium for micro-service call link
CN115982133A (en) Data processing method and device
CN112181308A (en) Block chain based distributed data storage method and electronic equipment
CN109087097B (en) Method and device for updating same identifier of chain code
CN113157911A (en) Service verification method and device
CN111931231A (en) Redundant storage method, terminal device and storage medium for distributed system
CN113051323A (en) Water environment big data exchange method
CN112182111A (en) Block chain based distributed system layered processing method and electronic equipment
CN110262756B (en) Method and device for caching data

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210105