CN112632080A - Data storage method, device and equipment based on block chain - Google Patents

Data storage method, device and equipment based on block chain Download PDF

Info

Publication number
CN112632080A
CN112632080A CN202011604663.6A CN202011604663A CN112632080A CN 112632080 A CN112632080 A CN 112632080A CN 202011604663 A CN202011604663 A CN 202011604663A CN 112632080 A CN112632080 A CN 112632080A
Authority
CN
China
Prior art keywords
data
database
storage
result set
block
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.)
Granted
Application number
CN202011604663.6A
Other languages
Chinese (zh)
Other versions
CN112632080B (en
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.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202011604663.6A priority Critical patent/CN112632080B/en
Publication of CN112632080A publication Critical patent/CN112632080A/en
Application granted granted Critical
Publication of CN112632080B publication Critical patent/CN112632080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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
    • G06F16/278Data partitioning, e.g. horizontal or vertical partitioning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data storage method based on a block chain, which is applied to the field of the block chain and is used for solving the problems that the storage efficiency of a database is low, the consistency cannot be ensured and the original database is difficult to recover when the data storage fails due to the fact that different types of data are stored in series. The method provided by the invention comprises the following steps: creating a blockchain logical storage layer for mapping the database; the database comprises a continuous database and a discontinuous database; when the block chain receives a storage request, generating an empty result set corresponding to a block in the block chain based on the block chain logic storage layer; writing data corresponding to the storage request into an empty result set according to the data type to obtain a storage result set; wherein the data type comprises continuous data and discontinuous data; and according to the data type, storing the data in the storage result set to a database corresponding to the data type in parallel.

Description

Data storage method, device and equipment based on block chain
Technical Field
The present invention relates to the field of blockchains, and in particular, to a method and an apparatus for storing data based on blockchains, a computer device, and a storage medium.
Background
In the block chain, the data of the block chain can be divided into continuous data and discontinuous data according to the storage characteristics of the data, and the continuous data is directly stored in the continuous database through the mapping of the block chain and the continuous database according to the characteristics of the continuous data and the discontinuous data; and directly storing the discontinuous data in a discontinuous (K-V key value pair) database through mapping of the block chain and the discontinuous database.
In the prior art, continuous data (such as block data) and discontinuous data (such as status data) are stored in different banks, that is, the continuous database stores the block data, and the discontinuous database stores the status data.
However, the behavior of the existing block chain for performing various database interactions is often directly embedded in modules such as an execution module, and is not easy to expand and maintain codes and functions, and different types of data are performed in series during storage operation, for example, the original database includes a continuous database and a discontinuous database, and for block data and state data, in the execution process of a certain block of the block chain, if the state data is generated first, the state data is directly stored in the discontinuous database through mapping of the block chain and the discontinuous database, and then the generated block data is directly stored in the continuous database through mapping of the block chain and the continuous database, which results in low storage efficiency of the database. Meanwhile, if storage of a certain type of data in the continuous data or the discontinuous data fails, the data stored in the actual database is inconsistent with the data stored in the target database (i.e., the continuous database or the discontinuous database), so that the database consistency cannot be guaranteed, and the actual database is difficult to be restored to the original database. Therefore, in the prior art, the storage efficiency of the database is low due to serial storage of different types of data, consistency cannot be guaranteed, and the original database is difficult to recover when data storage fails.
Disclosure of Invention
Embodiments of the present invention provide a data storage method and apparatus based on a block chain, a computer device, and a storage medium, so as to solve the technical problems that the database storage efficiency is low, the consistency cannot be guaranteed, and it is difficult to recover the original database when the data storage fails, due to serial storage of different types of data.
A data storage method based on a block chain comprises the following steps:
creating a blockchain logical storage layer for mapping the database; the database comprises a continuous database and a discontinuous database;
when the block chain receives a storage request, generating an empty result set corresponding to a block in the block chain based on the block chain logic storage layer;
writing data corresponding to the storage request into an empty result set according to the data type to obtain a storage result set; wherein the data type comprises continuous data and discontinuous data;
and according to the data type, storing the data in the storage result set to a database corresponding to the data type in parallel.
A blockchain based data storage device comprising:
the creation module is used for creating a block chain logic storage layer used for mapping the database; the database comprises a continuous database and a discontinuous database;
an empty result set acquisition module, configured to generate an empty result set corresponding to a block in the block chain based on the block chain logical storage layer when the block chain receives a storage request;
the acquisition storage result set module is used for writing the data corresponding to the storage request into the empty result set according to the data type so as to obtain a storage result set; wherein the data type comprises continuous data and discontinuous data;
and the storage module is used for storing the data in the storage result set to a database corresponding to the data type in parallel according to the data type.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-mentioned blockchain-based data storage method when executing the computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned blockchain-based data storage method.
The block chain based data storage method, device, computer equipment and storage medium provided by the embodiment of the invention create a block chain logical storage layer for mapping a database, wherein the database comprises a continuous database and a discontinuous database; when the block chain receives a storage request, generating an empty result set corresponding to a block in the block chain based on the block chain logic storage layer; writing data corresponding to the storage request into an empty result set according to the data type to obtain a storage result set, wherein the data type comprises continuous data and discontinuous data; and according to the data type, storing the data in the storage result set to a database corresponding to the data type in parallel. The database storage operation of different data types is performed in parallel, and the data storage efficiency is improved. The storage result set is corresponding to the block height, so that the block heights corresponding to all databases are consistent, and the original database is easily recovered through the block height when the data storage fails.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention 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 that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of a block chain-based data storage method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a block chain based data storage method according to an embodiment of the present invention;
FIG. 3 is a block chain based data storage device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a server in an embodiment of the invention;
fig. 5 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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.
The block chain-based data storage method provided by the application can be applied to the application environment as shown in fig. 1, wherein the computer device/terminal device/… … communicates with the server through the network. The computer device/terminal device/… … may be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, among others. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a block chain based data storage method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps S101 to S104:
s101, creating a block chain logic storage layer for mapping a database; the database comprises a continuous database and a discontinuous database.
In step S101, the block chain logical storage layer forms a mapping relationship with the database. The continuous database includes, but is not limited to, a block database, a receipt database, and a log database. The non-continuous database includes but is not limited to a contract database, an account database and an index database.
S102, when the block chain receives a storage request, generating an empty result set corresponding to a block in the block chain based on the block chain logic storage layer.
In step S102, the empty result set is used to store data corresponding to the type of the database that has been mapped with the blockchain logical storage layer. For example, when the blockchain logical storage tier maps six databases, a tile database, a receipt database, a log database, a contract database, an account database, and an index database, the empty result set is used to store six data, i.e., tile data, receipt data, log data, contract data, account data, and index data.
Specifically, step S102 includes the following steps a to b:
a. when the block chain receives a storage request, the logical storage layer acquires a block based on the block chain; the block comprises a block height and a block number, and the block height and the block number form a one-to-one corresponding relation.
b. And generating an empty result set corresponding to the block height according to the block number.
For the above steps a and b, the description is made with reference to examples:
for example, in step a, when a storage request is received by the block link, the logical storage layer acquires a block with a block number M and a block height M based on the block chain. The one-to-one correspondence between the block height and the block number means that if the block number is known to be M, the block height of the block corresponding to the block number is known to be M. Then, in step b, an empty result set may be generated corresponding to the block according to the block number M, and the block height corresponding to the empty result set is M.
S103, writing data corresponding to the storage request into an empty result set according to the data type to obtain a storage result set; wherein the data types include continuous data and discontinuous data.
Specifically, step S103 includes the following steps c to d:
c. and classifying the data corresponding to the storage request, determining a corresponding data type, and writing the data into the empty result set according to the data type.
d. And forming a one-to-one correspondence relationship between the data written into the empty result set and the block height corresponding to the empty result set to obtain a storage result set.
And S104, according to the data type, storing the data in the storage result set to a database corresponding to the data type in parallel.
In order to better explain the above embodiment, the following further explains steps S102 to S104 with reference to examples:
for example, suppose six databases, a blockchain logical storage tier mapping chunk database, a receipt database, a log database, a contract database, an account database, and an index database.
For step S102, when a storage request is received, an empty result set is generated, and the block height corresponding to the empty result set is N.
In step S103, data corresponding to the storage request is classified into six types of data, namely block data, receipt data, log data, contract data, account data, and index data, and the data is written into an empty result set, so as to obtain a storage result set, where block heights corresponding to the block data, the receipt data, the log data, the contract data, the account data, and the index data in the storage result set are all N.
For step S104, the block data in the storage result set is stored in the block database, the receipt data is stored in the receipt database, the log data is stored in the log database, the contract data is stored in the contract database, the account data is stored in the account database, and the index data is stored in the index database.
In another embodiment of the present invention, after step S104, the following step a is further included:
A. and forming a one-to-one correspondence relationship between the database and the block heights corresponding to the data stored in the database.
For the step a, for example, when the block height corresponding to the data stored in the database is N, the block height corresponding to the database is also N at this time.
The following step B is also included after the step A:
B. and judging whether the block heights corresponding to all the databases are consistent, if so, determining that the data in the storage result set are successfully stored in the database corresponding to the data type, and if not, determining that all the data in the storage result set are not successfully stored in the database corresponding to the data type.
Specifically, if the data types are inconsistent, the following step e is further included after the step of determining that all the data in the storage result set are not successfully stored in the database corresponding to the data types:
e. data from the stored result set is deleted in the database in which the data has been successfully stored.
In order to better illustrate the above embodiments, step B is further illustrated below with reference to examples:
for example, the block height corresponding to the current block database and the receipt database is N-1, and the block height corresponding to the log database, the contract database, the account database and the index database is N.
Firstly, judging that the block heights corresponding to all the databases are inconsistent, wherein the block heights corresponding to the block database and the receipt database are smaller, and accordingly determining that all the block data are not successfully stored in the block database and all the receipt data are not successfully stored in the receipt database.
In order to ensure the consistency of the database, the log data with the corresponding block height of N in the log database, the contract data with the corresponding block height of N in the contract database, the account data with the corresponding block height of N in the account database and the index data with the corresponding block height of N in the index database are deleted. Therefore, when data are not stored in the database corresponding to the data type successfully, the consistency of the database can be ensured, and the database can be restored to the original state.
The embodiment of the invention provides a data storage method based on a block chain, which comprises the steps of firstly creating a block chain logic storage layer for mapping a database; the database comprises a continuous database and a discontinuous database; when the block chain receives a storage request, generating an empty result set corresponding to a block in the block chain based on the block chain logic storage layer; writing data corresponding to the storage request into an empty result set according to the data type to obtain a storage result set; wherein the data type comprises continuous data and discontinuous data; and according to the data type, storing the data in the storage result set to a database corresponding to the data type in parallel. The database storage operation of different data types is performed in parallel, and the data storage efficiency is improved. The storage result sets correspond to the block heights, so that the block heights corresponding to all databases are consistent, and the original database is easily restored through the block heights when data storage fails, and the problems that the database storage efficiency is low, the consistency cannot be guaranteed and the original database is difficult to restore when the data storage fails due to the fact that different types of data are stored in series can be solved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention. In an embodiment, a data storage device based on a block chain is provided, and the data storage device based on the block chain corresponds to the data storage method based on the block chain in the above embodiment one to one. As shown in fig. 3, the blockchain-based data storage device includes a creation module 11, a get empty result set module 12, a get store result set module 13, and a storage module 14. The functional modules are explained in detail as follows:
a creating module 11, configured to create a blockchain logical storage layer for mapping the database; the database comprises a continuous database and a discontinuous database.
The get empty result set module 12 is configured to generate an empty result set corresponding to a block in the block chain based on the block chain logical storage layer when the block chain receives a storage request.
The acquisition storage result set module 13 is configured to write data corresponding to the storage request into an empty result set according to the data type to obtain a storage result set; wherein the data types include continuous data and discontinuous data.
And the storage module 14 is used for storing the data in the storage result set to a database corresponding to the data type in parallel according to the data type.
In one embodiment, the obtain empty result set module 12 further comprises:
the block generating unit is used for acquiring a block based on the block chain logic storage layer when the block chain receives a storage request; the block comprises a block height and a block number, and the block height and the block number form a one-to-one corresponding relation.
And the empty result set generating unit is used for generating an empty result set corresponding to the block height according to the block number.
In one embodiment, the retrieve stored result set module 13 further comprises:
and the data writing unit is used for classifying the data corresponding to the storage request, determining a corresponding data type and writing the data into the empty result set according to the data type.
And the storage result set generating unit is used for forming a one-to-one correspondence relationship between the data written into the empty result set and the block height corresponding to the empty result set so as to obtain a storage result set.
In this embodiment, the storage module 14 then comprises:
and the database corresponding module is used for forming a one-to-one corresponding relation between the database and the block height corresponding to the data stored in the database.
In this embodiment, the database mapping module includes:
and the judging module is used for judging whether the block heights corresponding to all the databases are consistent, if so, determining that the data in the storage result set are successfully stored in the database corresponding to the data type, and if not, determining that all the data in the storage result set are not successfully stored in the database corresponding to the data type.
In this embodiment, the determining module further includes:
and the deleting unit is used for deleting the data from the storage result set in the database which successfully stores the data.
Wherein the meaning of "first" and "second" in the above modules/units is only to distinguish different modules/units, and is not used to define which module/unit has higher priority or other defining meaning. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such process, method, article, or apparatus, and such that a division of modules presented in this application is merely a logical division and may be implemented in a practical application in a further manner.
For specific definition of the data storage device based on the block chain, reference may be made to the above definition of the data storage method based on the block chain, and details are not described here. The respective modules in the above block chain-based data storage device may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data involved in the data storage method based on the block chain. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a blockchain-based data storage method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external server through a network connection. The computer program is executed by a processor to implement a blockchain-based data storage method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the steps of the above-described data storage method based on the blockchain are implemented, for example, steps S101 to S104 shown in fig. 2 and other extensions of the method and extensions of related steps. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the data storage device based on the block chain in the above-described embodiment, such as the functions of the modules 11 to 14 shown in fig. 3. To avoid repetition, further description is omitted here.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer device and which connects the various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc.
The memory may be integrated in the processor or may be provided separately from the processor.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the above-described embodiment of the blockchain-based data storage method, such as the steps S101 to S104 shown in fig. 2 and extensions of other extensions and related steps of the method. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the blockchain-based data storage apparatus in the above-described embodiments, such as the functions of the modules 11 to 14 shown in fig. 3. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can be executed by the related hardware. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A data storage method based on a block chain is characterized by comprising the following steps:
creating a blockchain logical storage layer for mapping the database; wherein the database comprises a continuous database and a discontinuous database;
when the block chain receives a storage request, generating an empty result set corresponding to a block in the block chain based on the block chain logic storage layer;
writing data corresponding to the storage request into the empty result set according to the data type to obtain a storage result set; wherein the data types include continuous data and discontinuous data;
and according to the data type, storing the data in the storage result set to a database corresponding to the data type in parallel.
2. The method of claim 1, wherein generating an empty result set corresponding to a block in the chain of blocks based on the chain of blocks logical storage layer when the chain of blocks receives a storage request comprises:
when the block chain receives the storage request, a block is acquired based on the block chain logic storage layer; the block comprises a block height and a block number, and the block height and the block number form a one-to-one correspondence;
and generating an empty result set corresponding to the block height according to the block number.
3. The method of claim 2, wherein writing data corresponding to the storage request to the empty result set according to a data type to obtain a storage result set comprises:
classifying the data corresponding to the storage request, determining a corresponding data type, and writing the data into the empty result set according to the data type;
and forming a one-to-one correspondence relationship between the data written into the empty result set and the block height corresponding to the empty result set to obtain a storage result set.
4. The method of claim 3, wherein after storing the data in the stored result set in parallel to the database corresponding to the data type according to the data type, the method further comprises:
and forming a one-to-one correspondence relationship between the database and the block heights corresponding to the data stored in the database.
5. The method of claim 4, wherein after the database is in a one-to-one correspondence with the block heights corresponding to the data stored in the database, the method further comprises:
and judging whether the heights of the blocks corresponding to all the databases are consistent, if so, determining that the data in the storage result set are successfully stored in the database corresponding to the data type, and if not, determining that all the data in the storage result set are not successfully stored in the database corresponding to the data type.
6. The method of claim 5, wherein determining that all of the data in the stored result set is not successfully stored in the database corresponding to the data type if the data in the stored result set is not consistent further comprises:
deleting data from the stored result set in a database in which the data has been successfully stored.
7. A blockchain-based data storage device, comprising:
the creation module is used for creating a block chain logic storage layer used for mapping the database; wherein the database comprises a continuous database and a discontinuous database;
a get empty result set module, configured to generate an empty result set corresponding to a block in the block chain based on the block chain logical storage layer when the block chain receives a storage request
The acquisition storage result set module is used for writing the data corresponding to the storage request into the empty result set according to the data type so as to obtain a storage result set; wherein the data types include continuous data and discontinuous data;
and the storage module is used for storing the data in the storage result set to a database corresponding to the data type in parallel according to the data type.
8. The apparatus of claim 7, wherein the get empty result set module comprises:
a block generation unit, configured to, when the block link receives the storage request, obtain a block based on the block chain logical storage layer; the block comprises a block height and a block number, and the block height and the block number form a one-to-one correspondence;
and the empty result set obtaining unit is used for generating an empty result set corresponding to the block height according to the block number.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the block chain based data storage method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the blockchain-based data storage method according to any one of claims 1 to 6.
CN202011604663.6A 2020-12-29 2020-12-29 Data storage method, device and equipment based on block chain Active CN112632080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011604663.6A CN112632080B (en) 2020-12-29 2020-12-29 Data storage method, device and equipment based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011604663.6A CN112632080B (en) 2020-12-29 2020-12-29 Data storage method, device and equipment based on block chain

Publications (2)

Publication Number Publication Date
CN112632080A true CN112632080A (en) 2021-04-09
CN112632080B CN112632080B (en) 2023-01-13

Family

ID=75286338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011604663.6A Active CN112632080B (en) 2020-12-29 2020-12-29 Data storage method, device and equipment based on block chain

Country Status (1)

Country Link
CN (1) CN112632080B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326165A (en) * 2021-08-04 2021-08-31 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508802A (en) * 2011-11-16 2012-06-20 刘大可 Data writing method based on parallel random storages, data reading method based on same, data writing device based on same, data reading device based on same and system
CN109189785A (en) * 2018-08-10 2019-01-11 平安科技(深圳)有限公司 Date storage method, device, computer equipment and storage medium
CN110096522A (en) * 2019-05-15 2019-08-06 西安电子科技大学 A kind of block chain data processing method, device and equipment for supporting relationship type to retrieve
CN110197708A (en) * 2019-06-05 2019-09-03 重庆邮电大学 A kind of migration of block chain and storage method towards electron medical treatment case history
CN110209681A (en) * 2019-05-22 2019-09-06 深圳壹账通智能科技有限公司 Block chain data enter chain method, apparatus, computer equipment and storage medium
CN111651449A (en) * 2020-04-08 2020-09-11 深圳市华智有为科技有限公司 Data storage method, information rollback method, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508802A (en) * 2011-11-16 2012-06-20 刘大可 Data writing method based on parallel random storages, data reading method based on same, data writing device based on same, data reading device based on same and system
CN109189785A (en) * 2018-08-10 2019-01-11 平安科技(深圳)有限公司 Date storage method, device, computer equipment and storage medium
CN110096522A (en) * 2019-05-15 2019-08-06 西安电子科技大学 A kind of block chain data processing method, device and equipment for supporting relationship type to retrieve
CN110209681A (en) * 2019-05-22 2019-09-06 深圳壹账通智能科技有限公司 Block chain data enter chain method, apparatus, computer equipment and storage medium
CN110197708A (en) * 2019-06-05 2019-09-03 重庆邮电大学 A kind of migration of block chain and storage method towards electron medical treatment case history
CN111651449A (en) * 2020-04-08 2020-09-11 深圳市华智有为科技有限公司 Data storage method, information rollback method, terminal and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326165A (en) * 2021-08-04 2021-08-31 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and computer readable storage medium
CN113326165B (en) * 2021-08-04 2021-11-16 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and computer readable storage medium
WO2023011022A1 (en) * 2021-08-04 2023-02-09 腾讯科技(深圳)有限公司 Blockchain-based data processing method, and device and computer-readable storage medium

Also Published As

Publication number Publication date
CN112632080B (en) 2023-01-13

Similar Documents

Publication Publication Date Title
CN110489421B (en) Data storage method, apparatus, computer readable storage medium and computer device
CN110781214A (en) Database reading and writing method and device, computer equipment and storage medium
CN109144487B (en) Method, device, computer equipment and storage medium for developing business of parts
CN112162773B (en) Differential upgrading method and device, storage medium and terminal
CN110489138B (en) Application updating method, device and storage medium
CN111209120A (en) Data synchronization method and device for microservice and computer readable storage medium
CN112559529A (en) Data storage method and device, computer equipment and storage medium
CN112632080B (en) Data storage method, device and equipment based on block chain
CN112182010A (en) Dirty page refreshing method and device, storage medium and electronic equipment
CN112650729B (en) Rights management method, system and storage medium of distributed file system
CN114089921A (en) Power system data storage method and device, computer equipment and storage medium
CN113535563A (en) Test case duplication removing method and device, computer equipment and storage medium
CN111090701B (en) Service request processing method, device, readable storage medium and computer equipment
CN114614992B (en) Signature value output and verification method, device, computer equipment and storage medium
CN113157738B (en) In-heap data cache synchronization method and device, computer equipment and storage medium
CN109542345B (en) Data writing and reading method and device of Flash memory
CN113722623A (en) Data processing method and device, electronic equipment and storage medium
CN112578772A (en) Data processing method of electronic control unit and related device
CN112783866A (en) Data reading method and device, computer equipment and storage medium
CN110955647A (en) Database assistance method, database assistance device, computer equipment and storage medium
CN111176715A (en) Information calling method and server
CN110309038B (en) Performance test method and device, electronic equipment and computer readable storage medium
CN109918290B (en) Automatic screening method and device for target equipment, computer equipment and storage medium
CN114385317A (en) Cache processing method, device, equipment and storage medium based on cluster environment
CN113076318A (en) User ID distribution method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant