CN111639074A - Data storage method and device based on block chain - Google Patents

Data storage method and device based on block chain Download PDF

Info

Publication number
CN111639074A
CN111639074A CN202010373422.9A CN202010373422A CN111639074A CN 111639074 A CN111639074 A CN 111639074A CN 202010373422 A CN202010373422 A CN 202010373422A CN 111639074 A CN111639074 A CN 111639074A
Authority
CN
China
Prior art keywords
data
determining
target
block chain
target storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010373422.9A
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010373422.9A priority Critical patent/CN111639074A/en
Publication of CN111639074A publication Critical patent/CN111639074A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to the field of science and technology finance (Fintech), in particular to a Block chain (Block chain) -based data storage method and device, which are used for increasing data storage capacity and improving data processing efficiency. The embodiment of the invention comprises the following steps: determining identification data of target storage data; the target storage data is any one of a plurality of data to be stored; determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data; the block chains are used for storing the data to be stored; and sending the target storage data to the target block chain.

Description

Data storage method and device based on block chain
Technical Field
The invention relates to the field of science and technology finance (Fintech), in particular to a data storage method and device based on a block chain.
Background
With the development of computer technology, more and more technologies are applied in the financial field, the traditional financial industry is gradually changing to financial technology (Finteh), and a Block chain (Block chain) technology is not an exception, but higher requirements are also put forward on the technologies due to the requirements of the financial industry on safety and real-time performance.
Data on the blockchain is stored in the form of an intelligent contract, and problems in functionality and performance exist in the aspects of conversion, query, analysis, processing and the like. To address these problems, data of the blockchain is usually exported through an rpc (remote procedure call) interface, and the message is converted into standardized, structured data and then stored on a relational database or other general storage system.
With the development of application software, more and more applications are applied to the basis of existing users and value accumulation, a larger data scale needs to be pursued, and a block chain always optimizes a storage model and a consensus algorithm so as to improve the carrying capacity of data and bear larger and more complex services. Currently, the storage capacity of a single blockchain is limited by the hardware of a disk, there is an upper limit to the capacity, and the efficiency of data storage or processing using a single blockchain is low.
Disclosure of Invention
The application provides a data storage method and device based on a block chain, which are used for increasing data storage capacity and improving data processing efficiency.
The data storage method based on the block chain provided by the embodiment of the invention comprises the following steps:
determining identification data of target storage data; the target storage data is any one of a plurality of data to be stored;
determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data; the block chains are used for storing the data to be stored;
and sending the target storage data to the target block chain.
In an optional embodiment, the determining, according to the identification data, a target block chain corresponding to the data to be stored from a plurality of block chains includes:
determining the number of the plurality of block chains;
and determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation.
In an optional embodiment, before determining the identification data of the target storage data, the method further includes:
determining a total data volume of the plurality of data to be stored;
determining the storable data quantity of each block chain;
and determining the number of the block chains according to the total data quantity of the data to be stored and the storable data quantity of each block chain.
In an optional embodiment, before determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation, the method further includes:
determining a hash algorithm according to the total data volume of the plurality of generations of stored data;
calculating the identification data of the target storage data by using the hash algorithm to obtain a hash value of the target storage data;
determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation, comprising:
and performing modulus operation on the hash value of the target storage data according to the number of the block chains, and determining the target block chain according to a modulus operation result.
In an alternative embodiment, the sending the target storage data to the target blockchain includes:
encoding the target storage data;
signing the encoded target storage data;
and sending the signed target storage data to the target block chain.
The invention also provides a data storage device based on the block chain, which comprises:
an acquisition unit configured to determine identification data of target storage data; the target storage data is any one of a plurality of data to be stored;
the selecting unit is used for determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data; the block chains are used for storing the data to be stored;
a sending unit, configured to send the target storage data to the target block chain.
In an optional embodiment, the selecting unit is specifically configured to:
determining the number of the plurality of block chains;
and determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation.
In an optional embodiment, the apparatus further includes a determining unit, configured to:
determining a total data volume of the plurality of data to be stored;
determining the storable data quantity of each block chain;
and determining the number of the block chains according to the total data quantity of the data to be stored and the storable data quantity of each block chain.
In an optional embodiment, the selecting unit is further configured to:
determining a hash algorithm according to the total data volume of the plurality of generations of stored data;
calculating the identification data of the target storage data by using the hash algorithm to obtain a hash value of the target storage data;
and performing modulus operation on the hash value of the target storage data according to the number of the block chains, and determining the target block chain according to a modulus operation result.
In an optional embodiment, the sending unit is specifically configured to:
encoding the target storage data;
signing the encoded target storage data;
and sending the signed target storage data to the target block chain.
An embodiment of the present invention further provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
Embodiments of the present invention also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method as described above.
In the embodiment of the invention, a plurality of block chains for storing a plurality of data to be stored are set. And determining identification data of the target storage data aiming at any target storage data in the plurality of data to be stored, and determining a target block chain corresponding to the data to be stored from the plurality of block chains according to the identification data. And sending the target storage data item block chain. Therefore, under the condition that the data volume of the data to be stored is large, the data to be stored can be stored by utilizing the plurality of block chains, and compared with a single block chain, the number of the plurality of block chains can be set according to the data volume of the data to be stored, so that the problems that the single block chain is limited by the hardware of a disk and the capacity has an upper limit are solved, and the expandability of the data storage capacity is enhanced. Meanwhile, a plurality of data to be stored are dispersed in a plurality of block chains for processing and storing, so that the data processing efficiency is high, and the pressure of network bandwidth is favorably reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of a possible system architecture according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a data storage method based on a block chain according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a block chain according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data storage device based on a block chain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For convenience of understanding, terms that may be referred to in the embodiments of the present invention are defined and explained below.
Block chains: a blockchain is a distributed storage system that is commonly maintained and trusted by multiple nodes. The block chain bottom layer is a chain formed by a series of blocks, each block records the hash value of the block besides the data of the block, and the chained data structure is formed in this way. A block consists of a block header and a block body, where the block header definition includes the block height, the hash value (prevHash) of the previous block, etc. of the important fields, and the block body mainly stores transaction data. The block chain guarantees the safety of data transmission and access in a cryptographic mode, and guarantees that data on the chain cannot be tampered by using a chain structure.
Hash (hash): the general translation is "hashing", which is to transform an input of arbitrary length (also called pre-map) into an output of fixed length by a hashing algorithm, and the output is a hash value. This transformation is a compression mapping, i.e. the space of hash values is usually much smaller than the space of inputs, different inputs may hash to the same output, so it is not possible to uniquely determine the input value from the hash value. In short, it is a function of compressing a message of an arbitrary length to a message digest of a certain fixed length.
MD5 Algorithm (MD5 Message Digest Algorithm, MD5 Message-Digest Algorithm): the input string with any length can be calculated to obtain the output with fixed length, and the algorithm is irreversible, even if the encrypted ciphertext is obtained, the plaintext cannot be reversely calculated through a decryption algorithm. The MD5 algorithm may be used for consistency checking. Using the MD5 algorithm to generate a unique consistency check value, i.e. MD5 value, for a file (regardless of size, format and number), it can know whether a source file is changed by checking whether the MD5 value of the file before and after downloading is changed, so as to ensure that the file obtained by downloading is the same as the source file.
SHA256 Algorithm: the operation is mainly performed on a message block of 512 bits and an intermediate hash value of 256 bits, which is essentially a 256-bit encryption algorithm that encrypts the intermediate hash value by using the message block as a key. For any length of message, the SHA256 algorithm generates a 256-bit hash value, called a message digest. This digest is equivalent to an array of 32 bytes in length, usually represented by a 64-byte hexadecimal string, where 1 byte is 8 bits and a hexadecimal character is 4 bits in length.
Modulo Operation (modular Operation): the two concepts of modular arithmetic and Remainder Operation (remaining Operation) overlap but do not coincide completely. The main difference is that the division of negative integers is performed differently. Modulus is mainly used in computer terminology. The remainder is more of a mathematical concept. For positive integers p and a, the following operation is defined: modulus operation: a% p (or a mod p), representing the remainder of a divided by p.
As shown in fig. 1, a system architecture to which the embodiment of the present invention is applicable includes a data processing server 101 and a plurality of blockchains 102. Wherein any blockchain is supported by one or more blockchain servers 103.
The data processing server 101 may be an independent device or a server cluster formed by a plurality of servers. Preferably, the data processing server 101 may perform information processing using cloud computing technology.
The block chain 102 is a chain of a series of blocks, and each block records a Hash value of a block in addition to data of the block, and thus forms a chain. The block chain has two core ideas, one is a cryptography technology, the other is a decentralization idea, and based on the two ideas, historical information on the block chain cannot be tampered. A block consists of a block header and a block body, wherein the block header definition comprises the block height h, the Hash value prevHash of the previous block and other important fields, and the block body mainly stores transaction data.
The blockchain server 103 may be an independent device or a server cluster formed by a plurality of servers. Preferably, the blockchain server 103 may perform information processing by using a cloud computing technology.
The data processing server 101 and the block chain server 103 are connected through a wired or wireless network. Optionally, the wireless or wired networks described above use standard communication techniques and/or protocols. The Network is typically the Internet, but can be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wireline or wireless Network, a private Network, or any combination of virtual private networks. In some embodiments, data exchanged over the network is represented using techniques and/or formats including HyperTextMark-up Language (HTML), Extensible Markup Language (XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). In other embodiments, custom and/or dedicated data communication techniques may also be used in place of, or in addition to, the data communication techniques described above.
The data processing server is temporarily stored with a plurality of data to be stored, and deploys block chains with an appropriate number according to the data volume of all the data to be stored. And the data processing server determines the block chain corresponding to the data to be stored according to the identification data of each data to be stored, and sends the block chain server corresponding to the data to be stored, thereby completing the chaining of the data to be stored. And after the block link receives the data to be stored, processing and storing the data to be stored.
It should be noted that the above-mentioned application scenarios are only presented for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, the embodiments of the present application may be applied to any applicable scenario.
Based on the above architecture, an embodiment of the present invention provides a data storage method based on a block chain, and as shown in fig. 2, the data storage method based on the block chain provided by the embodiment of the present invention includes the following steps:
step 201, the server determines the identification data of the target storage data. The target storage data is any one of a plurality of data to be stored.
Specifically, the identification data of the target storage data has uniqueness, that is, the identification data of different data to be stored are different, and each data to be stored has unique identification data.
For example, if the data to be stored is user information, the identification data may be an identification number of the user. The user information includes information such as an identification number, an address, a validity period and the like. According to the province and the city where the user address is located, a plurality of regions named with the province are divided, and a block chain named with the city is deployed in each region.
For another example, if the data to be stored is judicial evidence data, the identification data may be an evidence number; if the data to be stored is the internet of things device information, the identification data may be a device MAC (Media access control); if the data to be stored is asset data of the supply chain, the identification data may be an asset ID.
Step 202, according to the identification data, determining a target block chain corresponding to the data to be stored from a plurality of block chains. And the block chains are used for storing the data to be stored.
Step 203, sending the target storage data to the target block chain.
In the embodiment of the invention, a plurality of block chains for storing a plurality of data to be stored are set. And determining identification data of the target storage data aiming at any target storage data in the plurality of data to be stored, and determining a target block chain corresponding to the data to be stored from the plurality of block chains according to the identification data. And sending the target storage data item block chain. Therefore, under the condition that the data volume of the data to be stored is large, the data to be stored can be stored by utilizing the plurality of block chains, and compared with a single block chain, the number of the plurality of block chains can be set according to the data volume of the data to be stored, so that the problems that the single block chain is limited by the hardware of a disk and the capacity has an upper limit are solved, and the expandability of the data storage capacity is enhanced. Meanwhile, a plurality of data to be stored are dispersed in a plurality of block chains for processing and storing, so that the data processing efficiency is high, and the pressure of network bandwidth is favorably reduced.
Further, in the embodiment of the present invention, the number of block chains used for storing data to be stored may be determined in advance. Before the determining the identification data of the target storage data, the method further comprises:
determining a total data volume of the plurality of data to be stored;
determining the storable data quantity of each block chain;
and determining the number of the block chains according to the total data quantity of the data to be stored and the storable data quantity of each block chain.
For example, the total data amount of the blockchains in each region and the data increment of the data to be stored are evaluated, and the number of blockchains with the capacity at least equal to twice of the data amount of the data to be stored is planned. If the total data volume of the data to be stored is 5T and the data capacity of each block chain is 0.5T, at least 20 block chains are planned and numbered from 0 to 19.
Taking Shenzhen city block chains as an example, the Shenzhen population is about 1300 million people, the identity information of each person is about 1MB, the image information sampling data such as photos is about 20M, the file information such as certificates is about 80M, the total data volume of the 1300 million people is 1300 million 100M 1.3T, the capacity of each block chain is calculated according to 0.5T, twice the capacity is reserved, 6 block chains need to be planned, and the block chain number is from 0 to 5.
To facilitate partitioning of the target storage data into multiple block chains, the target block chain may be determined according to a modular operation. Determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data, including:
determining the number of the plurality of block chains;
and determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation.
Further, before the modular operation, a hash algorithm can be used to increase the data dispersion. Before determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation, the method further includes:
determining a hash algorithm according to the total data volume of the plurality of generations of stored data;
calculating the identification data of the target storage data by using the hash algorithm to obtain a hash value of the target storage data;
determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation, comprising:
and performing modulus operation on the hash value of the target storage data according to the number of the block chains, and determining the target block chain according to a modulus operation result.
In general, common hashing algorithms are MD5, SHA256, and so on. The Hash algorithm is selected according to the total data amount and the data characteristics. For example, SHA256 is a reasonable hashing algorithm for data volumes on the order of 10T. And calculating the identification data by using a Hash algorithm to obtain a Hash value corresponding to the target storage data, and then performing modulus operation on the Hash value according to the number of the block chains, wherein the modulus value is the block chain number value corresponding to the uplink data.
For example, after the user's id number is calculated by SHA256 algorithm, a binary string with a length of 32 bytes is generated, the binary string may be regarded as a long integer, and modulo calculation is performed on the number of block chains to obtain a number that can be used as a block chain number, and assuming that the number of block chains is 6, a value between 0 and 5 is obtained after modulo calculation.
Through the above process, the address format of the single target storage data in the block chain is obtained as follows:
[ region ] [ Block chain number ] [ Key field ]
Wherein [ area ] is the area where the block chain is located, the [ block chain number ] is the block chain number determined by calculation based on the identification data, and the [ key field ] is the identification data.
For example, if xiaoming in shenzhen has an identity card number of 440305199708317072, the derivation process of the identity information address of xiaoming on the blockchain is as follows:
the identity card number 440305199708317072 has a value of f33ae3bc9a22cd7564990a794789954409977013966fb1a8f43c35776b833a95 calculated by SHA256, and the value is modulo 6 to obtain 4.
The final address is: [ Guangdong ] - [ Shenzhen 4] - [440305199708317072 ].
After determining the blockchain address of the target stored data, the uplink operation of the target stored data can be executed. The sending the target storage data to the target blockchain comprises:
encoding the target storage data;
signing the encoded target storage data;
and sending the signed target storage data to the target block chain.
In the implementation, the target storage data is linked to the area and the block chain described by the address, and different block chains can have different data linking modes. For example, the FISCO BCOS blockchain encodes data using RLP protocol, then signs, and sends the data to the blockchain, and the superhedger Fabric encodes data using protocol buffer, then signs, and sends the data to the blockchain.
In order to more clearly understand the present invention, the above flow is described in detail below with specific embodiments, fig. 3 shows a schematic diagram of a block chain, and the steps of the specific embodiments are as follows, including:
the Internet of things equipment identification is classified according to industries, and each manufacturer forms a block chain built in the classification. For example, the method is divided into a mechanical engineering industry subarea, an automobile engineering industry subarea and the like, and the mechanical engineering industry subarea is provided with a triple worker chain and a willow worker chain; the automobile engineering industry is provided with a wide steam chain and a BYD chain in different areas.
And evaluating the total data quantity and the data growth trend of all the block chains in the region, and planning to obtain a reasonable quantity of block chains, for example, planning 10 block chains by three-in-one process, and planning to store the data quantity of 0.5 × 10 ═ 5T.
And selecting identification data, wherein the identification data of the equipment of the Internet of things is equipment MAC, and the value is uniquely determined when the equipment leaves a factory and is unique in the world.
And selecting an SHA256 algorithm as a hash algorithm.
And traversing all the identification data equipment MAC of the Internet of things equipment to be linked, performing hash calculation on the identification data equipment MAC, and obtaining the block chain number according to the number of the block chains. Taking a certain mechanical equipment MAC for three-in-one reworking as an example, the mechanical equipment MAC is 28:6e: d4:89:6f:01, the HASH value is calculated to obtain be0d63ff69789f631b3eefa60fc79a7e2a43a9bbe208a8b849f5cf28150c9b32, and the HASH value is modulo according to the number 10 of three-in-one reworking chains to obtain 7.
Obtaining the address of the mechanical device:
[ division of mechanical engineering industry ] [ triple work chain 7] [28:6e: d4:89:6f:01]
The mechanical device data is sent to the zone and blockchain described by the address.
An embodiment of the present invention further provides a data storage device based on a block chain, as shown in fig. 4, including:
an obtaining unit 401, configured to determine identification data of target storage data; the target storage data is any one of a plurality of data to be stored;
a selecting unit 402, configured to determine, according to the identification data, a target block chain corresponding to the data to be stored from multiple block chains; the block chains are used for storing the data to be stored;
a sending unit 403, configured to send the target storage data to the target block chain.
Optionally, the selecting unit 402 is specifically configured to:
determining the number of the plurality of block chains;
and determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation.
Optionally, a determining unit 404 is further included, configured to:
determining a total data volume of the plurality of data to be stored;
determining the storable data quantity of each block chain;
and determining the number of the block chains according to the total data quantity of the data to be stored and the storable data quantity of each block chain.
Optionally, the selecting unit 402 is further configured to:
determining a hash algorithm according to the total data volume of the plurality of generations of stored data;
calculating the identification data of the target storage data by using the hash algorithm to obtain a hash value of the target storage data;
and performing modulus operation on the hash value of the target storage data according to the number of the block chains, and determining the target block chain according to a modulus operation result.
Optionally, the sending unit 403 is specifically configured to:
encoding the target storage data;
signing the encoded target storage data;
and sending the signed target storage data to the target block chain.
Based on the same principle, the present invention also provides an electronic device, as shown in fig. 5, including:
the system comprises a processor 501, a memory 502, a transceiver 503 and a bus interface 504, wherein the processor 501, the memory 502 and the transceiver 503 are connected through the bus interface 504;
the processor 501 is configured to read the program in the memory 502, and execute the following method:
determining identification data of target storage data; the target storage data is any one of a plurality of data to be stored;
determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data; the block chains are used for storing the data to be stored;
and sending the target storage data to the target block chain.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. A data storage method based on a block chain is characterized by comprising the following steps:
determining identification data of target storage data; the target storage data is any one of a plurality of data to be stored;
determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data; the block chains are used for storing the data to be stored;
and sending the target storage data to the target block chain.
2. The method according to claim 1, wherein the determining, according to the identification data, a target block chain corresponding to the data to be stored from a plurality of block chains includes:
determining the number of the plurality of block chains;
and determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation.
3. The method of claim 2, wherein prior to determining the identification data of the target storage data, further comprising:
determining a total data volume of the plurality of data to be stored;
determining the storable data quantity of each block chain;
and determining the number of the block chains according to the total data quantity of the data to be stored and the storable data quantity of each block chain.
4. The method of claim 2, wherein determining the target blockchain in accordance with the modulo operation using the identification data of the target storage data and the number of the plurality of blockchains further comprises:
determining a hash algorithm according to the total data volume of the plurality of generations of stored data;
calculating the identification data of the target storage data by using the hash algorithm to obtain a hash value of the target storage data;
determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation, comprising:
and performing modulus operation on the hash value of the target storage data according to the number of the block chains, and determining the target block chain according to a modulus operation result.
5. The method of any one of claims 1-4, wherein said sending the target storage data to the target blockchain comprises:
encoding the target storage data;
signing the encoded target storage data;
and sending the signed target storage data to the target block chain.
6. A blockchain-based data storage device, comprising:
an acquisition unit configured to determine identification data of target storage data; the target storage data is any one of a plurality of data to be stored;
the selecting unit is used for determining a target block chain corresponding to the data to be stored from a plurality of block chains according to the identification data; the block chains are used for storing the data to be stored;
a sending unit, configured to send the target storage data to the target block chain.
7. The apparatus of claim 6, wherein the selection unit is specifically configured to:
determining the number of the plurality of block chains;
and determining the target block chain by using the identification data of the target storage data and the number of the plurality of block chains according to the modular operation.
8. The apparatus of claim 7, further comprising a determination unit to:
determining a total data volume of the plurality of data to be stored;
determining the storable data quantity of each block chain;
and determining the number of the block chains according to the total data quantity of the data to be stored and the storable data quantity of each block chain.
9. The apparatus of claim 7, wherein the selection unit is further configured to:
determining a hash algorithm according to the total data volume of the plurality of generations of stored data;
calculating the identification data of the target storage data by using the hash algorithm to obtain a hash value of the target storage data;
and performing modulus operation on the hash value of the target storage data according to the number of the block chains, and determining the target block chain according to a modulus operation result.
10. The apparatus according to any one of claims 6 to 9, wherein the sending unit is specifically configured to:
encoding the target storage data;
signing the encoded target storage data;
and sending the signed target storage data to the target block chain.
11. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 5.
CN202010373422.9A 2020-05-06 2020-05-06 Data storage method and device based on block chain Pending CN111639074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010373422.9A CN111639074A (en) 2020-05-06 2020-05-06 Data storage method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010373422.9A CN111639074A (en) 2020-05-06 2020-05-06 Data storage method and device based on block chain

Publications (1)

Publication Number Publication Date
CN111639074A true CN111639074A (en) 2020-09-08

Family

ID=72330188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010373422.9A Pending CN111639074A (en) 2020-05-06 2020-05-06 Data storage method and device based on block chain

Country Status (1)

Country Link
CN (1) CN111639074A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988667A (en) * 2021-05-12 2021-06-18 腾讯科技(深圳)有限公司 Data storage method and device based on block chain network
CN116662453A (en) * 2023-08-01 2023-08-29 天津理工大学 Digital asset storage method based on block chain

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988667A (en) * 2021-05-12 2021-06-18 腾讯科技(深圳)有限公司 Data storage method and device based on block chain network
CN116662453A (en) * 2023-08-01 2023-08-29 天津理工大学 Digital asset storage method based on block chain
CN116662453B (en) * 2023-08-01 2023-11-03 天津理工大学 Digital asset storage method based on block chain

Similar Documents

Publication Publication Date Title
US11838415B2 (en) Blockchain-implemented method and system
Aljawarneh et al. A resource-efficient encryption algorithm for multimedia big data
CN108885741B (en) Tokenization method and system for realizing exchange on block chain
USRE49673E1 (en) Systems and methods for secure data exchange
CN104378374B (en) A kind of method and system that communication is set up based on SSL
CN112861190B (en) Data cross-chain cooperation method, system and device
CN113783836A (en) Internet of things data access control method and system based on block chain and IBE algorithm
CN111274268A (en) Internet of things data transmission method, device, medium and electronic equipment
CN111639074A (en) Data storage method and device based on block chain
WO2016122646A1 (en) Systems and methods for providing data security services
Chen Flowchain: A distributed ledger designed for peer-to-peer IoT networks and real-time data transactions
CN112446046B (en) Data management method and device based on intelligent contract
CN112436938B (en) Digital signature generation method and device and server
Guo et al. RNS-based adaptive compression scheme for the block data in the blockchain for IIoT
CN104363593A (en) Two-tier sensor network oriented verifiable Top-k query processing method
CN114679332A (en) APT detection method of distributed system
CN110910110A (en) Data processing method and device and computer storage medium
US20170207914A1 (en) Computer-readable recording medium, shared key generation method, and information processing terminal
JP7499775B2 (en) Method for authenticating messages in resource-limited systems - Patents.com
CN115544026A (en) Data storage method and device, electronic equipment and storage medium
KR20200144214A (en) Agreed data transmit method and apparatus for transmitting the agreed data in network
CN112184440A (en) Data processing method, data processing device, node equipment and storage medium
CN114050914B (en) Revocable lightweight group authentication method, system and medium for edge controller
CN116318738B (en) Signature method, signature system, electronic equipment and storage medium
CN115118437B (en) Multi-signature verification method, device and equipment based on consistent hash and path certification

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