CN111177257A - Data storage and access method, device and equipment of block chain - Google Patents

Data storage and access method, device and equipment of block chain Download PDF

Info

Publication number
CN111177257A
CN111177257A CN201911282240.4A CN201911282240A CN111177257A CN 111177257 A CN111177257 A CN 111177257A CN 201911282240 A CN201911282240 A CN 201911282240A CN 111177257 A CN111177257 A CN 111177257A
Authority
CN
China
Prior art keywords
data
stored
node
transaction record
blockchain
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
CN201911282240.4A
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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201911282240.4A priority Critical patent/CN111177257A/en
Publication of CN111177257A publication Critical patent/CN111177257A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data storage method and an access method, a device and equipment of a block chain, wherein the method is applied to any node on the block chain, and the data storage method comprises the following steps: when receiving data to be stored of a preset big data type, storing the data to be stored locally; acquiring a storage address of the data to be stored; and generating a transaction record based on the storage address of the data to be stored and the data identification so as to distribute the transaction record on the blockchain by a block outlet node. The application can realize the storage of the data of the big data type.

Description

Data storage and access method, device and equipment of block chain
Technical Field
The present application relates to the field of data processing, and in particular, to a method, an apparatus, and a device for storing and accessing data of a block chain.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. The data storage is carried out based on a chain structure, and the data storage has the excellent technical characteristics of decentralization, no tampering, traceability and the like.
Block chains are being innovated and integrated with various industries as a basic technology. At present, the application of blockchain technology is continuously expanding from the field of digital currency and financial assets to the field of non-financial fields, such as copyright protection, supply chain management, tracing, etc., and may be expanded to more other non-financial applications in the future. With the expansion of the application field of the blockchain, the blockchain is required to have the capability of storing various types of data, for example, large data types occupying large storage space for video, audio, pictures, PDF files, and the like.
Since the existing data storage method of the block chain is to store all data in the form of transaction records in the block, it is obvious that the size of the transaction records cannot exceed the size of the block, and if the data of the big data type is stored by using the method, the data of the big data type occupies a large storage space, and if the data of the big data type is stored in the block in the form of transaction records, the data of the big data type will exceed the size of the block with a high probability, so the existing data storage method in the block chain is not suitable for storing the data of the big data type.
Disclosure of Invention
In view of this, the present application provides a data storage method, an apparatus, and a device for a block chain, which can implement storage of data occupying a large storage space.
In a first aspect, to achieve the above object, the present application provides a data storage method for a blockchain, where the method is applied to any node on the blockchain, and the method includes:
when receiving data to be stored of a preset big data type, storing the data to be stored locally;
acquiring a storage address of the data to be stored;
and generating a transaction record based on the storage address of the data to be stored and the data identification so as to distribute the transaction record on the blockchain by a block outlet node.
In an optional embodiment, before generating a transaction record based on the storage address of the data to be stored and the data identifier, the method further includes:
determining a copy node for the data to be stored from the block chain, and sending the data to be stored to the copy node;
acquiring network address information of the replica node;
correspondingly, the transaction record is generated based on the storage address of the data to be stored and the data identifier, so that the transaction record is distributed on the blockchain by the block-out node, specifically:
and generating a transaction record based on the storage address of the data to be stored, the data identification and the network address information of the replica node so as to distribute the transaction record on the blockchain by the block-out node.
In an optional embodiment, before generating a transaction record based on the storage address of the data to be stored and the data identifier, the method further includes:
extracting integrity verification information of the data to be stored;
correspondingly, the transaction record is generated based on the storage address of the data to be stored and the data identifier, so that the transaction record is distributed on the blockchain by the block-out node, specifically:
and generating a transaction record based on the storage address of the data to be stored, the data identification, the integrity verification information and the network address information of the replica node, so that the transaction record is distributed on the blockchain by the out-blocking node.
In a second aspect, the present application further provides a data access method for a blockchain, where the data access method is applied to any node on the blockchain based on data stored by using the data storage method for a blockchain described in any one of the above, and the method includes:
when an access request for data of a preset big data type is received, acquiring a storage address of the data from a transaction record;
if the storage address of the data is determined to belong to the local area, acquiring the data from the local area based on the storage address;
an access response is returned containing the data.
In an optional implementation manner, before returning the access response including the data, the method further includes:
if the storage address of the data is not determined to belong to the local area, acquiring copy node information of the data from the transaction record;
and importing the data from any replica node based on the replica node information.
In an optional implementation manner, before returning the access response including the data, the method further includes:
acquiring integrity verification information of the data from the transaction record;
performing integrity verification on the data based on the integrity verification information;
correspondingly, the returning of the access response containing the data specifically includes:
and returning an access response containing the data after the data is determined to pass the integrity verification.
In a third aspect, the present application further provides a data storage apparatus for a blockchain, where the apparatus is applied to any node on the blockchain, and the apparatus includes:
the storage module is used for storing the data to be stored in local when receiving the data to be stored of a preset big data type;
the first acquisition module is used for acquiring the storage address of the data to be stored;
and the generating model is used for generating a transaction record based on the storage address of the data to be stored and the data identification so as to distribute the transaction record on the blockchain by the block outlet node.
In a fourth aspect, the present application further provides a data access apparatus for a blockchain, where the data access apparatus is applied to any node on the blockchain based on the data storage apparatus for a blockchain, and the apparatus includes:
the second acquisition module is used for acquiring the storage address of the data from the transaction record when receiving an access request for the data of a preset big data type;
the third acquisition module is used for acquiring the data from the local part based on the storage address when the storage address of the data is determined to belong to the local part;
and the return module is used for returning the access response containing the data.
In a fifth aspect, the present application also provides a computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to perform the method according to any one of the above.
In a sixth aspect, the present application further provides an apparatus comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method as in any one of the above.
According to the data storage method of the block chain, for any node on the block chain, when data to be stored of a preset big data type is received, the data to be stored is stored locally, a transaction record is generated based on a storage address and a data identification of the data to be stored, and finally the transaction record is distributed on the block chain by the block outlet node. According to the embodiment of the application, data of a large data type occupying a large storage space does not need to be stored in the block in a transaction record mode, but the storage address of the data is recorded in the transaction record, so that the situation that the data exceeds the size of the block due to overlarge data does not exist, and the application can realize the storage of the data of the large data type.
In addition, according to the data storage method of the block chain provided by the embodiment of the application, data does not need to be synchronized with each node, so that the storage space required by each node in the block chain is reduced, and meanwhile, the network transmission pressure of the block chain is reduced, so that the overall performance of the block chain is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a flowchart of a data storage method for a block chain according to an embodiment of the present application;
fig. 2 is a flowchart of another data storage method for a blockchain according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a data access method for a block chain according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data storage device of a block chain according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data access apparatus of a block chain according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data storage device of a block chain according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data access device of a block chain according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and 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 application.
Because data of a large data type occupying a large storage space is stored in a block in a transaction record mode, the data is likely to exceed the size of the block, and therefore, the current data storage mode of the block chain is not suitable for storing the data of the large data type.
Based on the above, the application provides a data storage method of a blockchain, for any node on the blockchain, when receiving data to be stored of a preset big data type, the data to be stored is stored locally, a transaction record is generated based on a storage address and a data identifier of the data to be stored, and finally the transaction record is distributed on the blockchain by a block outlet node. Therefore, the data of the large data type occupying a large storage space is not required to be stored in the block in the form of the transaction record, but the storage address of the data is recorded in the transaction record, so that the situation that the data exceeds the size of the block due to overlarge data does not exist, and the data of the large data type can be stored.
The following is a data storage method of a block chain provided in an embodiment of the present application, and with reference to fig. 1, is a flowchart of a data storage method of a block chain provided in an embodiment of the present application, where the method is applied to any node on a block chain, and the method includes:
s101: when receiving data to be stored of a preset big data type, storing the data to be stored locally.
In the embodiment of the present application, the preset data of the big data type refers to data occupying a large storage space, and includes, but is not limited to, data such as video, audio, pictures, and PDF files.
Because the data of the preset big data type occupies a large storage space, even if the data does not exceed the size of the block, if the data is stored by adopting the current data storage method of the blockchain, some problems may also exist, for example, because the blockchain currently adopts the P2P network technology to distribute the transaction records, if the data of the preset big data type is distributed by adopting the method, the problem of too large network transmission pressure may be caused. For another example, because the current data storage method of the blockchain needs to store the same data synchronously at each node, if the method is used to store data of a preset big data type, the occupied storage space for the whole blockchain network is huge.
Based on the above problems, in the embodiment of the present application, when a node on a blockchain receives data to be stored of a preset big data type, the current data storage method of the blockchain is not adopted, but the data to be stored is stored locally in a file form, not in a transaction record. Since the data to be stored locally does not need to be distributed based on the P2P network technology, the problem of excessive network transmission pressure is not caused. In addition, since the data to be stored does not need to be synchronously stored at each node of the blockchain, the occupied storage space for the whole blockchain network is limited.
S102: and acquiring the storage address of the data to be stored.
In the embodiment of the application, after the data to be stored is stored locally, the storage address of the data to be stored is obtained. Specifically, the memory address may be any specified path of the local.
S103: and generating a transaction record based on the storage address of the data to be stored and the data identification so as to distribute the transaction record on the blockchain by a block outlet node.
In practical application, after the node in the block chain completes the transaction, a transaction record of the transaction is generated. In the embodiment of the application, for the data to be stored of the preset big data type, the node generates the transaction record based on the storage address and the data identifier of the data to be stored, but not the data to be stored itself, so that the transaction record distributed by the block-out node on the blockchain does not include the data to be stored itself.
The data identifier is used for uniquely identifying the data to be stored, and may be a file ID of the data to be stored, which is stored locally in a file form.
In the data storage method of the blockchain provided by the embodiment of the application, for any node on the blockchain, when data to be stored of a preset big data type is received, the data to be stored is stored locally, a transaction record is generated based on a storage address and a data identifier of the data to be stored, and finally the transaction record is distributed on the blockchain by the block-out node. According to the embodiment of the application, data of a large data type occupying a large storage space does not need to be stored in the block in a transaction record mode, but the storage address of the data is recorded in the transaction record, so that the situation that the data exceeds the size of the block due to overlarge data does not exist, and the application can realize the storage of the data of the large data type.
In addition, according to the data storage method of the block chain provided by the embodiment of the application, data does not need to be synchronized with each node, so that the storage space required by each node in the block chain is reduced, and meanwhile, the network transmission pressure of the block chain is reduced, so that the overall performance of the block chain is improved.
The risk of storing the data of the preset big data type only by using a single node on the blockchain includes the risk of tampering, the risk of single point failure and the like. Therefore, the data of the same big data type is simultaneously stored in the local node and the duplicate node by setting the duplicate node, so that possible influences caused by the tampering risk, the single-point failure risk and the like are avoided.
Based on this, an embodiment of the present application further provides a data storage method for a block chain, and refer to fig. 2, which is a flowchart of another data storage method for a block chain provided in the embodiment of the present application. The method comprises the following steps:
s201: when receiving data to be stored of a preset big data type, storing the data to be stored locally.
S202: and acquiring the storage address of the data to be stored.
For S201 and S202, reference may be made to S101 and S102 in the above embodiments for understanding, and details are not described herein.
S203: determining a copy node for the data to be stored from the block chain, and sending the data to be stored to the copy node.
For data to be stored of a preset big data type, the embodiment of the application not only stores the data to be stored locally, but also determines a copy node for the data to be stored from a block chain, and sends the data to be stored to the copy node as backup data of the data to be stored.
Since the duplicate node is determined to be a specific node on the blockchain, there may be a certain threat to the security of the data, so that the embodiment of the present application may determine the duplicate node by using a random algorithm, so as to disperse the equal probability of duplicate determination to each node of the blockchain.
In an optional implementation manner, a preset number of nodes may be randomly selected from the nodes on the blockchain as the copy nodes of the data to be stored. Specifically, assuming that the number of nodes on the blockchain is n and the number of replica nodes determined for the data to be stored is m, each node on the blockchain is encoded into {1 to n }, and any random function is adopted to select m random numbers from {1 to n }, and the m random numbers are mapped to corresponding nodes to serve as replica nodes of the data to be stored.
S204: and acquiring the network address information of the replica node.
In the embodiment of the application, after the replica node is determined for the data to be stored, the network address information of the replica node is obtained. Specifically, the network address information of the replica node may be a URL address of the replica node.
S205: and generating a transaction record based on the storage address of the data to be stored, the data identification and the network address information of the replica node so as to distribute the transaction record on the blockchain by the block-out node.
In the embodiment of the application, for the data to be stored of the preset big data type, the node may generate the transaction record based on the storage address and the data identifier of the data to be stored and the network address information of the replica node, that is, the transaction record includes not only the storage address and the data identifier of the data to be stored, but also the network address information of the replica node. And distributing the transaction record on the blockchain by the block-out node, so that other nodes can access the data to be stored based on the information in the transaction record.
In addition, in order to further enrich the information of the replica nodes in the transaction record, the number of the replica nodes can be stored in the transaction record in the embodiment of the application.
In another optional implementation manner, in order to ensure data integrity, in this embodiment of the present application, when receiving data to be stored of a preset big data type, integrity verification information of the data to be stored may also be extracted, and specifically, the integrity verification information may include a digital digest and the like. Specifically, the node generates a transaction record based on the storage address of the data to be stored, the data identifier, the integrity verification information, and the network address information of the replica node, so that the transaction record is distributed on the blockchain by the out-blocking node. The integrity verification information of the data to be stored is stored in the transaction record and can be used for verifying the integrity of the data to be stored.
In practical applications, the data of the preset big data type is generally unstructured data, and for the unstructured data, the embodiment of the application may store the unstructured data in the form of a binary file. Correspondingly, the transaction record can store the storage address, the data identifier, the integrity verification information, the network address information of the copy node and the like of the data to be stored in the form of a binary file in a binary large object Blob type.
Specifically, a certain field is designated as a Blob type when the transaction record is created, and information such as a data identifier (e.g., a file ID), a storage address (e.g., $ Path/$ ID), the number of duplicate nodes, network address information of the duplicate nodes, a digital digest, and a file name of a binary file corresponding to data of the big data type is stored in the field. In an alternative embodiment, the information structure of the field corresponding to the Blob type in the transaction record may be as follows:
{ "ID", "$ filename", "digital summary", "$ Path/$ ID", "number of copies", "node 1 url", "node 2 url", … };
the ID is used for storing a data identifier of data to be stored; "$ filename" is used to store the file name of the data to be stored; the digital abstract is used for storing the digital abstract of the data to be stored; the 'copy number' is used for storing the number of copy nodes of the data to be stored; the "node 1 URL" and the "node 2 URL" are used to store URL addresses of respective copy nodes of data to be stored, respectively.
Based on the data storage method of the block chain provided by the present application, after the data of the preset big data type is stored in the block chain, correspondingly, for the data of the big data type stored in the block chain, the present application also provides a data access method of the block chain, referring to fig. 3, which is a flowchart of the data access method of the block chain provided by the embodiment of the present application, and the data access method can be applied to any node on the block chain, and the method includes:
s301: when an access request for data of a preset big data type is received, a storage address of the data is obtained from a transaction record.
In the embodiment of the application, when any node on the blockchain receives an access request for data of a preset big data type, a storage address of the data is firstly obtained from a transaction record so as to judge whether the data is locally stored.
S302: and if the storage address of the data is determined to belong to the local area, acquiring the data from the local area based on the storage address.
In the embodiment of the application, after the node acquires the storage address of the data from the transaction record, it is further determined whether the storage address belongs to the local area, that is, whether the data is stored locally, and if the data is stored locally, the data is directly acquired from the local area based on the storage address.
In an optional implementation manner, the transaction record may further store the number of the duplicate nodes of the data, network address information of the duplicate nodes, and the like, and specifically, if the node determines that the storage address of the data does not belong to the local, that is, the data is not stored locally, the number of the duplicate nodes of the data may be obtained from the transaction record to determine whether the data has the duplicate nodes.
In addition, if the data has duplicate nodes, the network address information of the duplicate nodes can be obtained from the transaction records, one duplicate node is randomly selected based on the network address information of each duplicate node, and the data is imported from the duplicate node. Specifically, P2P network communication is established with the replica node based on the network address information of the replica node, and the data is obtained from the replica node.
S303: an access response is returned containing the data.
In the embodiment of the present application, in order to ensure the integrity of the returned data, before the data is returned, the integrity of the data may be verified. Specifically, integrity verification information of the data is acquired from the transaction record, and integrity verification is performed on the data based on the integrity verification information. And after the data is determined to pass the integrity verification, returning an access response containing the data, and completing the access to the data.
In an alternative embodiment, the integrity verification information may be a digital digest, specifically, by extracting the digital digest of the data and matching it with the digital digest stored in the transaction record, and if the matching is successful, it indicates that the data passes the integrity verification. If the match fails, an error alert may be returned to indicate that the replica node may be tampered with. The duplicate node may be processed in a manner of isolation, etc., which is not limited in this application.
According to the data access method of the block chain, the access function of the data of the big data type stored on the block chain can be achieved.
In addition, the data storage method of the block chain provided by the application can improve the overall performance of the block chain and reduce the pressure in various aspects of the block chain, so that the processing efficiency of data access can be improved for the access of the data stored in the data storage mode.
Corresponding to the data storage method of the blockchain in the foregoing embodiment, the present application further provides a data storage device of the blockchain, where the device is applied to any node on the blockchain, and with reference to fig. 4, the data storage device of the blockchain provided in the embodiment of the present application is shown in a schematic structural diagram, where the device includes:
the storage module 401 is configured to store data to be stored locally when receiving the data to be stored of a preset big data type;
a first obtaining module 402, configured to obtain a storage address of the data to be stored;
a generating module 403, configured to generate a transaction record based on the storage address of the data to be stored and the data identifier, so that the transaction record is distributed on the blockchain by the egress node.
In an alternative embodiment, the apparatus further comprises:
a sending module, configured to determine a replica node for the data to be stored from the block chain, and send the data to be stored to the replica node;
the acquisition module is used for acquiring the network address information of the replica node;
correspondingly, the generating module is specifically configured to:
and generating a transaction record based on the storage address of the data to be stored, the data identification and the network address information of the replica node so as to distribute the transaction record on the blockchain by the block-out node.
In an alternative embodiment, the apparatus further comprises:
the extraction module is used for extracting the integrity verification information of the data to be stored;
correspondingly, the generating module is specifically configured to:
and generating a transaction record based on the storage address of the data to be stored, the data identification, the integrity verification information and the network address information of the replica node, so that the transaction record is distributed on the blockchain by the out-blocking node.
Based on the data storage method and device of the block chain and the data access method of the block chain in the foregoing embodiments, the present application further provides a data access device of the block chain, and specifically, the device implements a function of accessing data based on data stored by using the data storage device of the block chain, and the data access device is applied to any node on the block chain, and referring to fig. 5, a schematic structural diagram of the data access device of the block chain provided in the embodiments of the present application is shown, where the device includes:
a second obtaining module 501, configured to, when an access request for data of a preset big data type is received, obtain a storage address of the data from a transaction record;
a third obtaining module 502, configured to, when it is determined that the storage address of the data belongs to a local area, obtain the data from the local area based on the storage address;
a returning module 503, configured to return an access response containing the data.
In an alternative embodiment, the apparatus further comprises:
the fourth obtaining module is used for obtaining copy node information of the data from the transaction record if the storage address of the data is determined not to belong to the local;
and the importing module is used for importing the data from any copy node based on the copy node information.
In an alternative embodiment, the apparatus further comprises:
a fifth obtaining module, configured to obtain integrity verification information of the data from the transaction record;
the verification module is used for verifying the integrity of the data based on the integrity verification information;
correspondingly, the return module is specifically configured to:
and returning an access response containing the data after the data is determined to pass the integrity verification.
The data storage device of the block chain and the data access device of the block chain provided by the embodiment of the application can respectively realize the functions of storing and accessing data of a preset big data type. Because data does not need to be synchronized with each node, the storage space required by each node in the block chain is reduced, and the network transmission pressure of the block chain is reduced, so that the overall performance of the block chain is improved, and the processing efficiency of data access on the block chain is ensured.
In addition, an embodiment of the present application further provides a data storage device of a block chain, as shown in fig. 6, where the data storage device may include:
a processor 601, a memory 602, an input device 603, and an output device 604. The number of processors 601 in the data storage device of the blockchain may be one or more, and one processor is taken as an example in fig. 6. In some embodiments of the invention, the processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, wherein the connection by the bus is exemplified in fig. 6.
The memory 602 may be used to store software programs and modules, and the processor 601 executes various functional applications and data processing of the data storage device of the blockchain by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 603 may be used to receive entered numeric or character information and to generate signal inputs relating to user settings and function control of the data storage device of the blockchain.
Specifically, in this embodiment, the processor 601 loads an executable file corresponding to one or more processes of an application program into the memory 602 according to the following instructions, and the processor 601 runs the application program stored in the memory 602, thereby implementing various functions in the data storage method of the above block chain.
In addition, the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the instructions cause the terminal device to execute the above data storage method for a block chain.
In addition, an embodiment of the present application further provides a data access device for a block chain, as shown in fig. 7, where the data access device may include:
a processor 701, a memory 702, an input device 703, and an output device 704. The number of processors 701 in the data access device of the blockchain may be one or more, and one processor is taken as an example in fig. 7. In some embodiments of the invention, the processor 701, the memory 702, the input device 703 and the output device 704 may be connected by a bus or other means, wherein the connection by the bus is exemplified in fig. 7.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing of the data access device of the blockchain by executing the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 703 may be used to receive entered numerical or character information and to generate signal inputs related to user settings and function control of the data access device of the blockchain.
Specifically, in this embodiment, the processor 701 may load an executable file corresponding to a process of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application program stored in the memory 702, thereby implementing various functions in the data access method of the above block chain.
In addition, the present application also provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a terminal device, the terminal device is caused to execute the above data access method for a block chain.
It is understood that for the apparatus embodiments, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is given to a method, an apparatus, and a device for storing and accessing data of a block chain provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A data storage method of a blockchain is applied to any node on the blockchain, and the method comprises the following steps:
when receiving data to be stored of a preset big data type, storing the data to be stored locally;
acquiring a storage address of the data to be stored;
and generating a transaction record based on the storage address of the data to be stored and the data identification so as to distribute the transaction record on the blockchain by a block outlet node.
2. The method of claim 1, wherein before generating a transaction record based on the storage address of the data to be stored and the data identification, further comprising:
determining a copy node for the data to be stored from the block chain, and sending the data to be stored to the copy node;
acquiring network address information of the replica node;
correspondingly, the transaction record is generated based on the storage address of the data to be stored and the data identifier, so that the transaction record is distributed on the blockchain by the block-out node, specifically:
and generating a transaction record based on the storage address of the data to be stored, the data identification and the network address information of the replica node so as to distribute the transaction record on the blockchain by the block-out node.
3. The method of claim 1 or 2, wherein before generating a transaction record based on the storage address of the data to be stored and the data identification, further comprising:
extracting integrity verification information of the data to be stored;
correspondingly, the transaction record is generated based on the storage address of the data to be stored and the data identifier, so that the transaction record is distributed on the blockchain by the block-out node, specifically:
and generating a transaction record based on the storage address of the data to be stored, the data identification, the integrity verification information and the network address information of the replica node, so that the transaction record is distributed on the blockchain by the out-blocking node.
4. A data access method of a blockchain, wherein the data access method is applied to any node on the blockchain based on data stored by using the data storage method of the blockchain according to any one of claims 1 to 3, and the method comprises:
when an access request for data of a preset big data type is received, acquiring a storage address of the data from a transaction record;
if the storage address of the data is determined to belong to the local area, acquiring the data from the local area based on the storage address;
an access response is returned containing the data.
5. The method of claim 4, wherein prior to returning the access response containing the data, further comprising:
if the storage address of the data is not determined to belong to the local area, acquiring copy node information of the data from the transaction record;
and importing the data from any replica node based on the replica node information.
6. The method of claim 4 or 5, wherein before returning the access response containing the data, further comprising:
acquiring integrity verification information of the data from the transaction record;
performing integrity verification on the data based on the integrity verification information;
correspondingly, the returning of the access response containing the data specifically includes:
and returning an access response containing the data after the data is determined to pass the integrity verification.
7. A blockchain data storage apparatus, the apparatus being applied to any node on a blockchain, the apparatus comprising:
the storage module is used for storing the data to be stored in local when receiving the data to be stored of a preset big data type;
the first acquisition module is used for acquiring the storage address of the data to be stored;
and the generating model is used for generating a transaction record based on the storage address of the data to be stored and the data identification so as to distribute the transaction record on the blockchain by the block outlet node.
8. A blockchain data access device, based on the blockchain data storage device of claim 7, the data access device is applied to any node on the blockchain, and the device includes:
the second acquisition module is used for acquiring the storage address of the data from the transaction record when receiving an access request for the data of a preset big data type;
the third acquisition module is used for acquiring the data from the local part based on the storage address when the storage address of the data is determined to belong to the local part;
and the return module is used for returning the access response containing the data.
9. A computer-readable storage medium having stored therein instructions that, when executed on a terminal device, cause the terminal device to perform the method of any one of claims 1-6.
10. An apparatus, comprising: memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method of any of claims 1-6.
CN201911282240.4A 2019-12-13 2019-12-13 Data storage and access method, device and equipment of block chain Pending CN111177257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911282240.4A CN111177257A (en) 2019-12-13 2019-12-13 Data storage and access method, device and equipment of block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911282240.4A CN111177257A (en) 2019-12-13 2019-12-13 Data storage and access method, device and equipment of block chain

Publications (1)

Publication Number Publication Date
CN111177257A true CN111177257A (en) 2020-05-19

Family

ID=70650358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911282240.4A Pending CN111177257A (en) 2019-12-13 2019-12-13 Data storage and access method, device and equipment of block chain

Country Status (1)

Country Link
CN (1) CN111177257A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651521A (en) * 2020-05-27 2020-09-11 山大地纬软件股份有限公司 Electronic contract block chain structure, electronic contract signing device and method
CN112988667A (en) * 2021-05-12 2021-06-18 腾讯科技(深圳)有限公司 Data storage method and device based on block chain network
CN113269649A (en) * 2021-06-16 2021-08-17 上海势炎信息科技有限公司 System and method for tracking digital currency
CN113761585A (en) * 2020-06-17 2021-12-07 北京沃东天骏信息技术有限公司 Data processing method, device and system
CN117891820A (en) * 2024-03-15 2024-04-16 北京电科智芯科技有限公司 Multi-source heterogeneous data storage method, device, equipment, chip and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299336A (en) * 2018-09-30 2019-02-01 腾讯科技(深圳)有限公司 Data back up method, device, storage medium and calculating equipment
CN109635163A (en) * 2018-10-31 2019-04-16 优信数享(北京)信息技术有限公司 A kind of product data management method and system based on block chain
CN110351362A (en) * 2019-07-12 2019-10-18 全链通有限公司 Data verification method, equipment and computer readable storage medium
US20190324958A1 (en) * 2018-04-24 2019-10-24 Duvon Corporation Autonomous exchange via entrusted ledger immutable distributed database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190324958A1 (en) * 2018-04-24 2019-10-24 Duvon Corporation Autonomous exchange via entrusted ledger immutable distributed database
CN109299336A (en) * 2018-09-30 2019-02-01 腾讯科技(深圳)有限公司 Data back up method, device, storage medium and calculating equipment
CN109635163A (en) * 2018-10-31 2019-04-16 优信数享(北京)信息技术有限公司 A kind of product data management method and system based on block chain
CN110351362A (en) * 2019-07-12 2019-10-18 全链通有限公司 Data verification method, equipment and computer readable storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651521A (en) * 2020-05-27 2020-09-11 山大地纬软件股份有限公司 Electronic contract block chain structure, electronic contract signing device and method
CN111651521B (en) * 2020-05-27 2023-10-17 山大地纬软件股份有限公司 Electronic contract block chain structure, electronic contract signing device and method
CN113761585A (en) * 2020-06-17 2021-12-07 北京沃东天骏信息技术有限公司 Data processing method, device and system
CN112988667A (en) * 2021-05-12 2021-06-18 腾讯科技(深圳)有限公司 Data storage method and device based on block chain network
WO2022237497A1 (en) * 2021-05-12 2022-11-17 腾讯科技(深圳)有限公司 Data storage method and apparatus based on blockchain network
CN113269649A (en) * 2021-06-16 2021-08-17 上海势炎信息科技有限公司 System and method for tracking digital currency
CN117891820A (en) * 2024-03-15 2024-04-16 北京电科智芯科技有限公司 Multi-source heterogeneous data storage method, device, equipment, chip and storage medium
CN117891820B (en) * 2024-03-15 2024-05-14 北京电科智芯科技有限公司 Multi-source heterogeneous data storage method, device, equipment, chip and storage medium

Similar Documents

Publication Publication Date Title
CN111177257A (en) Data storage and access method, device and equipment of block chain
CN108446407B (en) Database auditing method and device based on block chain
CN109831487B (en) Fragmented file verification method and terminal equipment
CN108734028B (en) Data management method based on block chain, block chain link point and storage medium
CN110851879B (en) Method, device and equipment for infringement and evidence preservation based on evidence preservation block chain
CN111416808A (en) Cross-block-chain data mutual storage method, device, equipment and storage medium
CN110674140B (en) Block chain-based content processing method, device, equipment and storage medium
CN111262822B (en) File storage method, device, block link point and system
CN109302495A (en) A kind of date storage method and device
CN108256354B (en) Test data-based storage method and storage medium
CN110597918A (en) Account management method and device and computer readable storage medium
CN112087497B (en) Data synchronization method and device, electronic equipment and readable storage medium
CN113570479B (en) Block chain transmission method, system and storage medium for real estate transaction data
JP7101231B2 (en) Data distribution storage method and equipment
CN111899019A (en) Method and system for cross validation and sharing of blacklist and multiple parties
CN110597922A (en) Data processing method, device, terminal and storage medium
CN111597567A (en) Data processing method, data processing device, node equipment and storage medium
CN111339551B (en) Data verification method and related device and equipment
CN110619022B (en) Node detection method, device, equipment and storage medium based on block chain network
CN104965835A (en) Method and apparatus for reading and writing files of a distributed file system
CN111125115A (en) Data storage method, device and medium based on block chain
CN112866302B (en) Method, apparatus, medium and program product for integrity checking of cluster data
CN105550230A (en) Method and device for detecting failure of node of distributed storage system
CN115935414A (en) Block chain based data verification method and device, electronic equipment and storage medium
CN109766313A (en) Geological project data processing method, device and computer equipment

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