Unlock instant, AI-driven research and patent intelligence for your innovation.

Data storage method and device and computer equipment

A technology for data storage and computer programs, which is applied in the field of computer systems and can solve problems such as low query efficiency

Active Publication Date: 2021-03-19
SHANGHAI BILIBILI TECH CO LTD
View PDF9 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Aiming at the problem of low query efficiency when querying blocks in the prior art, a data storage method, device, computer equipment, and computer-readable storage medium are now provided to improve data query efficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Data storage method and device and computer equipment
  • Data storage method and device and computer equipment
  • Data storage method and device and computer equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0054] figure 2 A flowchart of a data storage method according to Embodiment 1 of the present application is schematically shown. It can be understood that the flowchart in this method embodiment is not used to limit the sequence of execution steps. An exemplary description is given below taking the computer device 2 as the execution subject.

[0055]Such as figure 2 As shown, the data storage method includes steps S20-S23, wherein:

[0056] Step S20, monitor the generation of blocks in the blockchain in real time, and obtain the first transaction log in the first block when the generation of the first block is detected;

[0057] Specifically, by monitoring the blockchain in real time or at regular intervals, the output of blocks can be monitored. Exemplarily, a block generation monitoring program can be used to monitor whether a new block is generated in the block chain, and when it is detected that the first block is generated in the block chain, the first block in the...

Embodiment 2

[0090] Figure 5 A flowchart of the data storage method according to Embodiment 2 of the present application is schematically shown. The data storage method may also include steps S50-S51, wherein:

[0091] Step S50, receiving a transaction query request initiated by an external device.

[0092] Step S51 , based on the transaction query request, query the relational database and return a query result matching the transaction query request to the external device.

[0093] Specifically, the transaction query request is used to query the data required by the user, for example, the user's recharge data within a certain period of time, order data within a certain period of time, etc. can be queried. The transaction query request is sent in the form of SQL statement.

[0094] When the user needs to query the transaction details / operations stored in each block in the blockchain, the transaction query request can be sent through an external device to directly query the data require...

Embodiment 3

[0097] Figure 6 A flowchart of the data storage method according to Embodiment 3 of the present application is schematically shown. The data storage method may also include steps S60-S63, wherein:

[0098] Step S60, receiving a data verification request initiated by an external device.

[0099] Specifically, the data verification request is a request initiated for verifying data. Exemplarily, since the transaction log stored in the relational database is centralized database data, the stored data may be tampered with, so , the user may think that the data stored in the relational database does not match the actual transaction situation. When the user questions the data stored in the relational database, the user can initiate a data verification request through an external device. In this embodiment, the data verification request carries the block number of the block to be queried or the hash value of the block to be queried.

[0100] Step S61, based on the data verificatio...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a data storage method and device and computer equipment, and belongs to the technical field of data storage. The data storage method comprises the steps of monitoring generation of blocks in a block chain in real time, and when it is monitored that a first block is generated, obtaining a first transaction log in the first block; storing the first transaction log into a relational database; when it is monitored that a second block is generated, judging whether the first block in the block chain changes or not, wherein the second block is the Nth block after the first block, and N is an integer larger than or equal to 1; and if the first block is changed, obtaining a second transaction log from the changed first block in the block chain, and updating the first transaction log according to the second transaction log. According to the scheme, the query efficiency can be improved, and the accuracy of the data stored in the relational database can be ensured.

Description

technical field [0001] The present invention relates to the field of computer systems, in particular to a data storage method, device and computer equipment. Background technique [0002] In blockchain technology, data is stored in the form of blocks, which are generated one by one in chronological order and connected into a chain. Each block records the transaction information that occurred at the corresponding time. [0003] However, in the current market, most of the queries on data stored in the blockchain are focused on querying a single block, that is, users want to query the data they need, and after initiating a query request, they can only query it in a specified area. If you need to query the blocks on the entire blockchain, you need to initiate multiple query requests, which seriously affects the efficiency of data query. Contents of the invention [0004] Aiming at the problem of low query efficiency when querying blocks in the prior art, a data storage method...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/2453G06F16/2458G06F16/27G06Q40/04
CPCG06F16/2453G06F16/2471G06F16/27G06Q40/04
Inventor 王鑫李华敬张翘楚毕凯
Owner SHANGHAI BILIBILI TECH CO LTD