CN115623080A - Distributed storage method and device based on block chain and computer equipment - Google Patents

Distributed storage method and device based on block chain and computer equipment Download PDF

Info

Publication number
CN115623080A
CN115623080A CN202211518995.1A CN202211518995A CN115623080A CN 115623080 A CN115623080 A CN 115623080A CN 202211518995 A CN202211518995 A CN 202211518995A CN 115623080 A CN115623080 A CN 115623080A
Authority
CN
China
Prior art keywords
data
storage
subdata
storage node
hash value
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
CN202211518995.1A
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.)
Sichuan Hantang Cloud Distributed Storage Technology Co ltd
Original Assignee
Sichuan Hantang Cloud Distributed Storage 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 Sichuan Hantang Cloud Distributed Storage Technology Co ltd filed Critical Sichuan Hantang Cloud Distributed Storage Technology Co ltd
Priority to CN202211518995.1A priority Critical patent/CN115623080A/en
Publication of CN115623080A publication Critical patent/CN115623080A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
    • H04L67/1065Discovery involving distributed pre-established resource-based relationships among peers, e.g. based on distributed hash tables [DHT] 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The invention discloses a distributed storage method and device based on a block chain and computer equipment, and relates to the technical field of data storage. The method comprises the following steps: receiving an uploading request aiming at data to be uploaded; determining a storage node list corresponding to the uploading request based on a request address corresponding to the uploading request; when the data size of the data to be uploaded is larger than a preset threshold value, slicing the data to be uploaded to obtain a plurality of subdata; determining the priority order of each storage node in the storage node list based on the available storage space of each storage node in the storage node list; storing the plurality of subdata into a storage node list in a one-to-one correspondence manner, wherein the plurality of storage nodes are arranged in a front priority order and have the same number as the plurality of subdata; the storage paths of the plurality of sub data are broadcasted in the block chain. The method, the device and the computer equipment can avoid the overhigh storage space occupation of the nodes in the block chain and ensure the performance of the whole block chain.

Description

Distributed storage method and device based on block chain and computer equipment
Technical Field
The invention belongs to the technical field of data storage, and particularly relates to a distributed storage method and device based on a block chain and computer equipment.
Background
The block chain is a chain consisting of one block and another block, certain information is stored in each block, the certain information is connected into the chain according to the time sequence generated by each block, the chain is stored in all servers, and the whole block chain is safe as long as one server in the whole system can work. These servers, referred to as nodes in the blockchain system, provide storage space and computational support for the entire blockchain system.
Due to the property of tamper resistance, the blockchain is increasingly widely used for data storage to ensure data security, however, due to the limited storage space of the nodes in the blockchain, when the stored data is too large, performance may be degraded due to too high occupation of the storage space of the nodes, thereby affecting the performance of the whole blockchain.
Therefore, how to provide an effective solution to avoid the storage space occupation of the nodes in the blockchain has become an urgent problem in the prior art.
Disclosure of Invention
The invention aims to provide a distributed storage method and device based on a block chain and computer equipment, which are used for solving the problems in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a block chain-based distributed storage method, including:
receiving an uploading request aiming at data to be uploaded;
determining a storage node list corresponding to the uploading request based on a request address corresponding to the uploading request;
when the data size of the data to be uploaded is larger than a preset threshold value, slicing the data to be uploaded to obtain a plurality of subdata;
determining the priority order of each storage node in the storage node list based on the available storage space of each storage node in the storage node list;
storing the plurality of subdata into the storage node list in a one-to-one correspondence manner, wherein the plurality of storage nodes are arranged in a priority order and have the same number as the plurality of subdata;
and broadcasting the storage paths of the plurality of subdata in a block chain.
Based on the above disclosure, the present invention determines a storage node list corresponding to an upload request based on a request address corresponding to the upload request by receiving the upload request for the data to be uploaded, slices the data to be uploaded to obtain a plurality of subdata when the size of the data to be uploaded is greater than a preset threshold, determines a priority order of each storage node in the storage node list based on an available storage space of each storage node in the storage node list, then stores the plurality of subdata in the storage node list in a one-to-one correspondence manner, stores the plurality of subdata in the plurality of storage nodes with the same number as the plurality of subdata and broadcasts a storage path of the plurality of subdata in a block chain. Therefore, the data slices occupying large storage space can be stored in the plurality of storage nodes respectively, the storage space occupation of the nodes in the block chain is avoided being too high, the performance of the whole block chain is guaranteed, and the block chain is convenient to apply and popularize.
In one possible design, after slicing the data to be uploaded to obtain a plurality of sub-data, the method further includes:
carrying out Hash operation on the plurality of subdata to obtain a plurality of Hash values which are in one-to-one correspondence with the plurality of subdata;
determining the sequence of the plurality of hash values based on the sequence of the plurality of subdata, and constructing a sequence relation between each hash value and an adjacent hash value in the plurality of hash values;
and storing each hash value in the plurality of hash values into the storage node where the corresponding subdata is located.
In one possible design, the constructing the order relationship between each hash value of the plurality of hash values and its adjacent hash value includes:
establishing a hash value sequence table corresponding to each hash value in the plurality of hash values, wherein a target hash value corresponding to the hash value sequence table and a sequence relation between the target hash value and an adjacent hash value are recorded in the hash value sequence table;
the method further comprises the following steps:
and storing the hash value sequence table into the storage node where the corresponding subdata is located.
In one possible design, after storing the plurality of sub data in the storage node list in a one-to-one correspondence, the method further includes:
receiving signature information for a storage path of the plurality of sub data;
verifying signature information of the storage paths of the plurality of sub data;
the broadcasting the storage paths of the plurality of subdata in a block chain comprises:
and after the verification is passed, broadcasting the storage paths of the plurality of sub data in the block chain.
In a possible design, the slicing the data to be uploaded to obtain a plurality of sub-data includes:
determining the number of slices based on the data size of the data to be uploaded and the predefined slice data size;
and slicing the data to be uploaded based on the slice number to obtain the plurality of subdata.
In one possible design, the data to be uploaded is structured data or unstructured data.
In a second aspect, the present invention provides a block chain based distributed storage apparatus, including:
the receiving unit is used for receiving an uploading request aiming at data to be uploaded;
a first determining unit, configured to determine, based on a request address corresponding to the upload request, a storage node list corresponding to the upload request;
the slicing unit is used for slicing the data to be uploaded to obtain a plurality of subdata when the data size of the data to be uploaded is larger than a preset threshold value;
a second determining unit, configured to determine a priority order of each storage node in the storage node list based on an available storage space of each storage node in the storage node list;
the storage unit is used for storing the plurality of subdata into the storage node list in a one-to-one correspondence manner, and the plurality of storage nodes are arranged in a plurality of storage nodes with the highest priority order and the same number as the plurality of subdata;
and the broadcasting unit is used for broadcasting the storage paths of the plurality of subdata in a block chain.
In one possible design, the block chain based distributed storage apparatus further includes:
the operation unit is used for carrying out Hash operation on the plurality of subdata to obtain a plurality of Hash values which are in one-to-one correspondence with the plurality of subdata;
a third determining unit, configured to determine, based on the sequence of the plurality of sub-data, the sequence of the plurality of hash values, and construct a sequential relationship between each hash value of the plurality of hash values and its adjacent hash value;
the storage unit is further configured to store each of the hash values into a storage node where the corresponding sub-data is located.
In a third aspect, the present invention provides a computer device, including a memory, a processor and a transceiver, which are sequentially connected in communication, where the memory is used for storing a computer program, the transceiver is used for transceiving a message, and the processor is used for reading the computer program and executing the block chain based distributed storage method as described in the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon instructions which, when executed on a computer, perform the blockchain-based distributed storage method of the first aspect.
In a fifth aspect, the present invention provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the blockchain-based distributed storage method according to the first aspect.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure in any way. In the drawings:
fig. 1 is a flowchart of a block chain-based distributed storage method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a block chain based distributed storage apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly described below with reference to the accompanying drawings and the embodiments or the description in the prior art, it is obvious that the following description of the structure of the drawings is only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts. It should be noted that the description of the embodiments is provided to help understanding of the present invention, but the present invention is not limited thereto.
In order to avoid that the performance of the whole block chain is affected due to excessively high occupied storage space of nodes in the block chain, embodiments of the present application provide a distributed storage method and apparatus based on the block chain, and a computer device. The distributed storage method based on the block chain provided by the embodiment of the application can be applied to one node in the block chain.
It is to be understood that the described execution body does not constitute a limitation of the embodiments of the present application. The following describes a block chain-based distributed storage method provided in an embodiment of the present application in detail.
As shown in fig. 1, a first aspect of this embodiment provides a distributed storage method based on a blockchain, where the distributed storage method based on a blockchain may include the following steps.
Step S101, an uploading request aiming at data to be uploaded is received.
And S102, determining a storage node list corresponding to the uploading request based on the request address corresponding to the uploading request.
The request address corresponding to the upload request may be a network address of the device that initiated the upload request.
In the embodiment of the application, each node in the block chain can be classified according to the request address corresponding to the uploading request, and nodes of different classifications can be used for storing data uploaded by devices in different network address intervals. After receiving an upload request for data to be uploaded, determining all storage nodes corresponding to the upload request according to a request address corresponding to the upload request, and obtaining a storage node list corresponding to the upload request, where the storage node list includes a plurality of storage nodes.
And S103, when the data size of the data to be uploaded is larger than a preset threshold value, slicing the data to be uploaded to obtain a plurality of subdata.
In the embodiment of the application, a threshold used for evaluating whether the data size of the data is too large is preset, the data size of the data to be uploaded is compared with the threshold, if the data size of the data to be uploaded is larger than the preset threshold, it is indicated that the data is too large, a large storage space needs to be occupied, the storage space of the storage node is possibly occupied too high, and at the moment, the data to be uploaded can be sliced to obtain a plurality of subdata.
The data to be uploaded can be structured data or unstructured data, wherein the structured data refers to data which is highly organized and neatly formatted. Unstructured data is essentially all data outside structured data that does Not fit into any predefined model, and therefore is stored in a non-relational database and can be queried using NoSQL (non-relational database, not Only SQL), which is simply data with variable fields. Example unstructured data may be instant messages, telephone recordings, surveillance pictures or videos, etc.
When the data to be uploaded is sliced, the number of slices can be determined according to the data size of the data to be uploaded and the predefined slice data size, and then the data to be uploaded is sliced according to the number of the slices to obtain the plurality of subdata. For example, the data size of the uploaded data is 10.5G, the predefined slice data size is 2G, and since it is possible to ensure that each sub-data is smaller than 2G only by slicing the data to be uploaded into 6 sub-data, it may be determined that the number of slices is 6, and then the data to be uploaded is sliced into 6 sub-data with a data size smaller than 2G according to the number of slices.
And S104, determining the priority order of each storage node in the storage node list based on the available storage space of each storage node in the storage node list.
In one or more embodiments, when determining the priority order of each storage node in the storage node list, the storage nodes in the storage node list may be prioritized according to the size of the available storage space of each storage node in the storage node list, where the priority of a storage node with a large available storage space is higher than the priority of a storage node with a small available storage space.
It is understood that in other embodiments, the priority order of each storage node in the storage node list may also be determined according to the proportion of the available storage space of each storage node in the storage node list to the total storage space of each storage node.
And S105, storing the plurality of subdata into a storage node list in a one-to-one correspondence mode, wherein the plurality of storage nodes are arranged in a front priority order and have the same number as the plurality of subdata.
For example, if there are 6 pieces of sub data, the 6 pieces of sub data may be stored in the first 6 storage nodes with the top priority, and each storage node in the 6 storage nodes stores one piece of sub data. Therefore, the storage space occupation of the nodes in the block chain can be avoided from being too high, and the performance of the whole block chain is guaranteed.
And S106, broadcasting the storage paths of the plurality of subdata in the block chain.
The plurality of storage nodes can return the storage paths of the stored subdata after storing the corresponding subdata, which indicates that each subdata has been successfully stored, and at this time, the storage paths of the plurality of subdata can be notified to all nodes in the block chain in a broadcasting manner, so that the plurality of subdata can be found according to any node in the block chain in the following process, and the data to be uploaded can be obtained.
In one or more embodiments, after storing the corresponding sub-data, the plurality of storage nodes also sign the storage path of the stored sub-data to obtain signature information of the storage path of the sub-data, and then return the signature information of the storage path of the sub-data. At this time, the storage node that received the signature information of the storage paths of the plurality of sub data can verify the signature information of the storage paths of the plurality of sub data. And after the verification is passed, broadcasting the storage paths of the plurality of sub data in the block chain. When signing the storage path of the sub data stored in the storage node, the storage node may sign the storage path according to a pre-configured key. Thus, data security can be further ensured.
To sum up, in the distributed storage method based on the block chain provided in the embodiment of the present application, an upload request for data to be uploaded is received, a storage node list corresponding to the upload request is determined based on a request address corresponding to the upload request, when the size of the data to be uploaded is greater than a preset threshold, the data to be uploaded is sliced to obtain a plurality of sub-data, a priority order of each storage node in the storage node list is determined based on an available storage space of each storage node in the storage node list, the plurality of sub-data are stored in the storage node list one by one, the priority order is advanced in the plurality of storage nodes having the same number as the plurality of sub-data, and storage paths of the plurality of sub-data are broadcasted in the block chain. Therefore, the data slices occupying large storage space can be stored in the plurality of storage nodes respectively, the storage space occupation of the nodes in the block chain is avoided being too high, the performance of the whole block chain is guaranteed, and the block chain is convenient to apply and popularize.
On the basis of the technical solution of the first aspect, the embodiment of the present application further specifically provides a first possible design that facilitates searching for data stored in a block chain, which may include, but is not limited to, the following steps S107 to S109.
And S107, carrying out hash operation on the plurality of subdata to obtain a plurality of hash values corresponding to the plurality of subdata one by one.
The hash operation is the prior art, and the operation process thereof is not described in detail in the embodiment of the present application.
And S108, determining the sequence of the plurality of hash values based on the sequence of the plurality of subdata, and constructing the sequence relation between each hash value and the adjacent hash value in the plurality of hash values.
In this embodiment of the application, when determining the sequence of the plurality of hash values, the sequence of the plurality of hash values may be determined according to the sequence of the plurality of sub-data corresponding to the plurality of hash values. The multiple subdata includes subdata a, subdata B, subdata C and subdata D, which are sequentially subdata a, subdata B, subdata C and subdata D. The hash value corresponding to the subdata a is a hash value a, the hash value corresponding to the subdata B is a hash value B, the hash value corresponding to the subdata C is a hash value C, and the hash value corresponding to the subdata D is a hash value D, and then the plurality of hash values are sequentially the hash value a, the hash value B, the hash value C and the hash value D.
After the sequence of the plurality of hash values is determined, the sequence relation between each hash value and the adjacent hash value in the plurality of hash values can be established according to the sequence of the plurality of hash values. Specifically, a hash value sequence table corresponding to each hash value of the plurality of hash values may be established, where the hash value sequence table records a target hash value corresponding to the hash value and a sequence relationship between the target hash value and an adjacent hash value.
Still based on the above example, the sequence of the plurality of hash values is hash value a, hash value b, hash value c, and hash value d, for hash value a, a hash value sequence table _ a corresponding to hash value a may be established, hash value a and hash value b adjacent to hash value a may be recorded in hash value sequence table _ a, and hash value b is located after hash value a. For the hash value b, a hash value sequence table _ b corresponding to the hash value b may be established, and the hash value b, and a hash value a and a hash value c adjacent to the hash value b may be recorded in the hash value sequence table _ b, where the hash value a is located before the hash value b, and the hash value c is located after the hash value b. For the hash value c, a hash value sequence table _ c corresponding to the hash value c may be established, and the hash value c, and a hash value b and a hash value d adjacent to the hash value c may be recorded in the hash value sequence table _ c, where the hash value b is located before the hash value c, and the hash value d is located after the hash value c. For the hash value d, a hash value sequence table _ d corresponding to the hash value d may be established, and the hash value d and a hash value c adjacent to the hash value d may be recorded in the hash value sequence table _ d, where the hash value c is located before the hash value d.
And S109, storing each hash value in the plurality of hash values into a storage node where the corresponding subdata is located.
It can be understood that, while each of the plurality of hash values is stored in the storage node where the corresponding sub-data is located, the hash value sequence table may also be stored in the storage node where the corresponding sub-data is located. Therefore, when data stored in a plurality of storage nodes through slicing is searched, adjacent hash values of the hash values corresponding to the subdata can be found only according to the hash value sequence table (corresponding to the hash value) corresponding to a certain subdata in one storage node, so that the adjacent subdata of the subdata is found, other subdata is found according to the adjacent subdata, so that all the subdata is found, all the subdata are spliced to obtain the data to be searched, so that other subdata of the data to be searched can be conveniently searched only by searching one subdata of the data to be searched, the data search is conveniently completed, and the data search efficiency is improved.
Therefore, through the possible design I, the data can be conveniently searched, and the data searching efficiency is improved.
Referring to fig. 2, a second aspect of the present invention provides a blockchain-based distributed storage apparatus, including:
the receiving unit is used for receiving an uploading request aiming at data to be uploaded;
a first determining unit, configured to determine, based on a request address corresponding to the upload request, a storage node list corresponding to the upload request;
the slicing unit is used for slicing the data to be uploaded to obtain a plurality of subdata when the data size of the data to be uploaded is larger than a preset threshold value;
a second determining unit, configured to determine a priority order of each storage node in the storage node list based on an available storage space of each storage node in the storage node list;
the storage unit is used for storing the plurality of subdata into the storage node list in a one-to-one correspondence manner, and the plurality of storage nodes are arranged in a front priority order and have the same number as the plurality of subdata;
and the broadcasting unit is used for broadcasting the storage paths of the plurality of subdata in the block chain.
In one possible design, the distributed storage apparatus based on block chains further includes:
the operation unit is used for carrying out Hash operation on the plurality of subdata to obtain a plurality of Hash values which are in one-to-one correspondence with the plurality of subdata;
a third determining unit, configured to determine, based on the sequence of the plurality of sub-data, the sequence of the plurality of hash values, and construct a sequential relationship between each hash value of the plurality of hash values and its adjacent hash value;
the storage unit is further configured to store each of the plurality of hash values into a storage node where the corresponding sub-data is located.
For the working process, the working details, and the technical effects of the apparatus provided in the second aspect of this embodiment, reference may be made to the first aspect of this embodiment, which is not described herein again.
As shown in fig. 3, a third aspect of the embodiments of the present application provides a computer device, including a memory, a processor, and a transceiver, which are sequentially connected in a communication manner, where the memory is used to store a computer program, the transceiver is used to transmit and receive a message, and the processor is used to read the computer program and execute the block chain-based distributed storage method according to the first aspect of the embodiments.
For specific examples, the Memory may include, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Flash Memory (Flash Memory), a first-in first-out Memory (FIFO), a first-in last-out Memory (FILO), and/or the like; the processor may not be limited to a microprocessor of model STM32F105 series, an ARM (Advanced RISC Machines), an X86 architecture processor, or an NPU (neutral-network processing unit) integrated processor; the transceiver may be, but is not limited to, a WiFi (wireless fidelity) wireless transceiver, a bluetooth wireless transceiver, a General Packet Radio Service (GPRS) wireless transceiver, a ZigBee protocol (ieee 802.15.4 standard-based low power local area network protocol), a 3G transceiver, a 4G transceiver, and/or a 5G transceiver, etc.
A fourth aspect of the present embodiment provides a computer-readable storage medium storing instructions that include the instruction of the blockchain-based distributed storage method according to the first aspect of the present invention, and when the instruction is executed on a computer, the instruction performs the blockchain-based distributed storage method according to the first aspect. The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, floppy disks, optical disks, hard disks, flash memories, flash disks and/or Memory sticks (Memory sticks), etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
A fifth aspect of the present embodiments provides a computer program product containing instructions which, when executed on a computer, cause the computer to perform the blockchain-based distributed storage method according to the first aspect of the present embodiments, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus.
It will be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of example embodiments of the present invention.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a repository code combining means to execute the methods according to the embodiments or parts of the embodiments.
Finally, it should be noted that: the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A distributed storage method based on a block chain is characterized by comprising the following steps:
receiving an uploading request aiming at data to be uploaded;
determining a storage node list corresponding to the uploading request based on a request address corresponding to the uploading request;
when the data size of the data to be uploaded is larger than a preset threshold value, slicing the data to be uploaded to obtain a plurality of subdata;
determining the priority order of each storage node in the storage node list based on the available storage space of each storage node in the storage node list;
storing the plurality of subdata into the storage node list in a one-to-one correspondence manner, wherein the plurality of storage nodes are arranged in a priority order and have the same number as the plurality of subdata;
and broadcasting the storage paths of the plurality of subdata in a block chain.
2. The method of claim 1, wherein after slicing the data to be uploaded to obtain a plurality of sub-data, the method further comprises:
carrying out Hash operation on the plurality of subdata to obtain a plurality of Hash values which are in one-to-one correspondence with the plurality of subdata;
determining the sequence of the plurality of hash values based on the sequence of the plurality of subdata, and constructing the sequence relation between each hash value and the adjacent hash value in the plurality of hash values;
and storing each hash value in the plurality of hash values into the storage node where the corresponding subdata is located.
3. The method according to claim 2, wherein the constructing the order relationship between each hash value of the plurality of hash values and its adjacent hash values comprises:
establishing a hash value sequence table corresponding to each hash value in the plurality of hash values, wherein a target hash value corresponding to the hash value sequence table and a sequence relation between the target hash value and an adjacent hash value are recorded in the hash value sequence table;
the method further comprises the following steps:
and storing the hash value sequence table into the storage node where the corresponding subdata is located.
4. The method of claim 1, wherein after storing the plurality of child data in the storage node list in a one-to-one correspondence, the method further comprises:
receiving signature information for a storage path of the plurality of sub data;
verifying signature information of the storage paths of the plurality of sub-data;
the broadcasting the storage paths of the plurality of subdata in a block chain comprises:
and after the verification is passed, broadcasting the storage paths of the plurality of sub data in the block chain.
5. The method of claim 1, wherein the slicing the data to be uploaded to obtain a plurality of sub-data comprises:
determining the number of slices based on the data size of the data to be uploaded and the predefined slice data size;
and slicing the data to be uploaded based on the slice number to obtain the plurality of subdata.
6. The method of claim 1, wherein the data to be uploaded is structured data or unstructured data.
7. A blockchain-based distributed storage apparatus, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an uploading request aiming at data to be uploaded;
a first determining unit, configured to determine, based on a request address corresponding to the upload request, a storage node list corresponding to the upload request;
the slicing unit is used for slicing the data to be uploaded to obtain a plurality of subdata when the data size of the data to be uploaded is larger than a preset threshold value;
a second determining unit, configured to determine a priority order of each storage node in the storage node list based on an available storage space of each storage node in the storage node list;
the storage unit is used for storing the plurality of subdata into the storage node list in a one-to-one correspondence manner, and the plurality of storage nodes are arranged in a plurality of storage nodes with the highest priority order and the same number as the plurality of subdata;
and the broadcasting unit is used for broadcasting the storage paths of the plurality of subdata in the block chain.
8. The blockchain-based distributed storage apparatus according to claim 7, further comprising:
the operation unit is used for carrying out Hash operation on the plurality of subdata to obtain a plurality of Hash values which are in one-to-one correspondence with the plurality of subdata;
a third determining unit, configured to determine, based on the sequence of the plurality of sub-data, the sequence of the plurality of hash values, and construct a sequential relationship between each hash value of the plurality of hash values and its adjacent hash value;
the storage unit is further configured to store each of the plurality of hash values into a storage node where the corresponding sub-data is located.
9. A computer device, comprising a memory, a processor and a transceiver, which are connected in sequence in communication, wherein the memory is used for storing a computer program, the transceiver is used for sending and receiving messages, and the processor is used for reading the computer program and executing the block chain based distributed storage method according to any one of claims 1 to 6.
CN202211518995.1A 2022-11-30 2022-11-30 Distributed storage method and device based on block chain and computer equipment Pending CN115623080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211518995.1A CN115623080A (en) 2022-11-30 2022-11-30 Distributed storage method and device based on block chain and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211518995.1A CN115623080A (en) 2022-11-30 2022-11-30 Distributed storage method and device based on block chain and computer equipment

Publications (1)

Publication Number Publication Date
CN115623080A true CN115623080A (en) 2023-01-17

Family

ID=84881061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211518995.1A Pending CN115623080A (en) 2022-11-30 2022-11-30 Distributed storage method and device based on block chain and computer equipment

Country Status (1)

Country Link
CN (1) CN115623080A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116686512A (en) * 2023-08-01 2023-09-05 布比(北京)网络技术有限公司 Crop production management method, device, storage medium and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819068A (en) * 2019-03-19 2019-05-28 全链通有限公司 User terminal and its block chain domain name analytic method
CN111064774A (en) * 2019-11-29 2020-04-24 苏州浪潮智能科技有限公司 Distributed data storage method and device
US20210026808A1 (en) * 2019-07-26 2021-01-28 International Business Machines Corporation Distributed file cache
CN113094350A (en) * 2021-04-28 2021-07-09 深圳前海微众银行股份有限公司 Block chain-based distributed file storage method and device
CN113157648A (en) * 2021-04-28 2021-07-23 中国工商银行股份有限公司 Block chain based distributed data storage method, device, node and system
CN113259449A (en) * 2021-05-27 2021-08-13 四块科技(深圳)有限公司 Distributed storage method, device, equipment and storage medium
WO2022241571A1 (en) * 2021-05-21 2022-11-24 Zeu Technologies, Inc. System and method for the safe custody of private data using blockchain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819068A (en) * 2019-03-19 2019-05-28 全链通有限公司 User terminal and its block chain domain name analytic method
US20210026808A1 (en) * 2019-07-26 2021-01-28 International Business Machines Corporation Distributed file cache
CN111064774A (en) * 2019-11-29 2020-04-24 苏州浪潮智能科技有限公司 Distributed data storage method and device
CN113094350A (en) * 2021-04-28 2021-07-09 深圳前海微众银行股份有限公司 Block chain-based distributed file storage method and device
CN113157648A (en) * 2021-04-28 2021-07-23 中国工商银行股份有限公司 Block chain based distributed data storage method, device, node and system
WO2022241571A1 (en) * 2021-05-21 2022-11-24 Zeu Technologies, Inc. System and method for the safe custody of private data using blockchain
CN113259449A (en) * 2021-05-27 2021-08-13 四块科技(深圳)有限公司 Distributed storage method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
VIJAY A. KANADE: "A Blockchain-Based Distributed Storage Network to Manage Growing Data Storage Needs", 《IEEE》 *
梁婉莹等: "基于区块链的文件存储碎片分配优化模型", 《软件导刊》 *
赖力潜等: "基于区块链技术的轻量化分布式云存储系统设计", 《大众标准化》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116686512A (en) * 2023-08-01 2023-09-05 布比(北京)网络技术有限公司 Crop production management method, device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN107332876B (en) Method and device for synchronizing block chain state
KR102099544B1 (en) Method and device for processing distribution of streaming data
US20170031948A1 (en) File synchronization method, server, and terminal
CN106484858A (en) Hot Contents method for pushing and device
CN109634932A (en) A kind of intelligence contract storage method and storage system
CN115623080A (en) Distributed storage method and device based on block chain and computer equipment
CN103281206A (en) System, method and device for determining connected relation
CN103326925B (en) A kind of information push method and device
WO2018006721A1 (en) Method and apparatus for storing log file
US20180018363A1 (en) Time series data processing method and apparatus
CN109951514A (en) Document handling method, system and computer equipment based on cloud storage
CN113132267B (en) Distributed system, data aggregation method and computer readable storage medium
US8325628B2 (en) Determining placement of nodes within a wireless network
CN113535226B (en) Application downloading method, terminal, server, computer device and storage medium
CN104503983A (en) Method and device for providing website certification data for search engine
CN104754601A (en) Hidden node detection method, network node and server
CN110955496A (en) Memory processing method and device, storage medium and electronic device
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN109089159A (en) The splicing method for previewing and Related product of promotion video
CN101309276B (en) Processing method and apparatus of LWAAP slicing packet
CN114039698A (en) Data sending and receiving method, device and equipment based on multiple frequencies
CN108683716B (en) business logic learning and protecting method and learning and protecting device based on big data
CN105407167A (en) Data transmission method and server
CN103701842A (en) Data transmitting method, data receiving method, server and client
CN109727135A (en) Promote method, the computer-readable medium of the operation of block chain information and processing capacity

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230117