CN111597190A - Block chain data storage and retrieval method, device, equipment and storage medium - Google Patents
Block chain data storage and retrieval method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111597190A CN111597190A CN202010411245.9A CN202010411245A CN111597190A CN 111597190 A CN111597190 A CN 111597190A CN 202010411245 A CN202010411245 A CN 202010411245A CN 111597190 A CN111597190 A CN 111597190A
- Authority
- CN
- China
- Prior art keywords
- block
- data
- information
- block number
- serial number
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2255—Hash tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6245—Protecting personal data, e.g. for financial or medical purposes
Abstract
The invention relates to a block chain data storage and retrieval method, a device, equipment and a storage medium, wherein the method comprises the following steps: s1, when the user applies for modifying or deleting data, the node locates the block containing the data to be modified, downloads all the information in the block and then modifies or deletes the information, and stores the modified content in the new block, and the alliance node identifies the new block; s2, in the numbering replacement account book, the block number of the original block points to the block number of the new block; s3, acquiring the block number of the block corresponding to the input search information; s4 judges whether the serial number replaces the block serial number in the account book, if not, the block serial number is the final output block serial number, if yes, the serial number replaces the block serial number pointed by the original block serial number in the account book to replace the original block serial number, and the block information corresponding to the block serial number pointed by the original block serial number is output. The node can only retrieve the block which is stored again after the data is modified, and the retrieval efficiency is improved.
Description
Technical Field
The invention relates to a block chain data storage and retrieval method, a block chain data storage and retrieval device and a block chain data storage and retrieval device, and a storage medium, and belongs to the technical field of block chains.
Background
The block chain is a decentralized distributed database system which is maintained by all nodes in a block chain network together, and consists of a series of data blocks generated based on a cryptography method, and the data blocks are orderly linked together according to the sequence of the generation time to form the block chain. The blockchain has the unique blockchain generation, transaction generation and verification protocols and has the characteristics of distribution, public transparency, irrevocability, unforgeability, traceability, high trust and the like. The data of the block chain is stored in a hash data storage mode, and the search data on the block chain is generally matched according to the input search data and the established index in an index establishment mode, so that the related information is found. However, the data information of the existing block cannot be modified or deleted on the block chain, so that the node cannot search and judge the latest correct data information required by the key word.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, an object of the present invention is to provide a method, an apparatus, a device, and a storage medium for storing and retrieving block chain data, which improve retrieval efficiency by modifying and re-storing data to be modified on a block chain, and by using the modified data storage and retrieval method, a node can only search for a block which is re-stored after modifying the data.
In order to achieve the above object, the present invention provides a method for storing and retrieving block chain data, comprising the following steps: s1, when the user applies for modifying or deleting data, the node locates the block containing the data to be modified, downloads all the information in the block and then modifies or deletes the information, and stores the modified content in the new block, and the alliance node identifies the new block; s2, in the numbering replacement account book, the block number of the original block points to the block number of the new block; s3, acquiring the block number of the block corresponding to the input search information; s4 judges whether the serial number in step S3 exists in the replacement account book, if not, the block serial number in step S3 is the finally output block serial number, if so, the serial number of the new block in the replacement account book is replaced with the serial number to replace the block serial number in step S3, and block information corresponding to the block serial number of the new block is output.
Further, the block chain is a federation chain, and the members of the federation chain are responsible for the generation and management of blocks in the federation chain.
And further, establishing a data index database of each block in the alliance chain, and if the input retrieval information is the same as the information in the data index database, acquiring the block number corresponding to the data index database.
Further, the data index database is used for segmenting the processed data and establishing an index according to a segmentation result, and the data index database comprises a keyword index, a time index, a type index and a user information index.
Further, desensitization processing is performed on data entering the blockchain, which includes data directly input into the blockchain and data that is modified or deleted.
Further, desensitization includes encryption of the names, identification numbers, cell phone numbers, and addresses of the particular persons involved, as well as other privacy requirements set forth by the user.
Further, the account book with the replaced numbers can adjust the sequence of the output data of the block chain by adjusting the priority sequence of the block numbers.
The invention also discloses a block chain data storage and retrieval device, which comprises: the modification/deletion module is used for positioning the node to a block containing data to be modified when a user applies for modifying or deleting the data, downloading all information in the block, then modifying or deleting the information, storing the modified content in a new block, and commonly identifying the new block by the alliance node; the number replacing module is used for pointing the block number of the original block to the block number of the new block in the number replacing account book; a block number acquisition module for acquiring a block number of a block corresponding to the input search information; and the judging module is used for judging whether the serial number replaces the block serial number in the block serial number acquiring module, if not, the block serial number in the block serial number acquiring module is the finally output block serial number, if so, the serial number replaces the block serial number of the new block in the account book to replace the block serial number in the block serial number acquiring module, and the block information corresponding to the block serial number of the new block is output.
The present invention also provides a computer device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, the at least one instruction, at least one program, set of codes, or set of instructions being loaded and executed by the processor to implement any of the above-described blockchain data storage and retrieval methods.
The present invention also provides a computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by a processor to implement the blockchain data storage and retrieval method of any of the above.
Due to the adoption of the technical scheme, the invention has the following advantages:
1. by establishing the block data index base, a user can quickly store and retrieve the required block data through the keyword information.
2. By establishing the block number replacement account book, the node can modify or delete the data in the block and then restore the modified data, so that a user only obtains the modified block data when searching the data through the keyword, and the result of replacing and modifying the block chain data is achieved.
Drawings
Fig. 1 is a flow chart of a method for blockchain data storage and retrieval in accordance with an embodiment of the present invention.
Detailed Description
The present invention is described in detail by way of specific embodiments in order to better understand the technical direction of the present invention for those skilled in the art. It should be understood, however, that the detailed description is provided for a better understanding of the invention only and that they should not be taken as limiting the invention. In describing the present invention, it is to be understood that the terminology used is for the purpose of description only and is not intended to be indicative or implied of relative importance.
Example one
A method for storing and retrieving blockchain data, as shown in fig. 1, includes the following steps:
s1, when the user applies for modifying or deleting data, the node locates the block containing the data to be modified, downloads all the information in the block and then modifies or deletes the information, and stores the modified content in the new block, and the alliance node identifies the new block. In this embodiment, all the original blocks are still stored in the block chain, so the block data in the method of this embodiment does not relate to transaction data, and the transaction balance of the user account is not changed. In addition, considering that a new block needs to be uploaded in time and there is a specific directivity in the content, the block chain in this embodiment is preferably a alliance chain.
A federation chain is a blockchain of members and limited third parties for a particular group, internally designating a plurality of preselected nodes as billers, the generation of each block being determined collectively by all of the preselected nodes. The members of the federation chain are responsible for the generation and management of the chunks in the federation chain.
S2 points the block number of the original block to the block number of the new block in the number replacement book.
S3, acquiring the block number of the block corresponding to the input search information;
s4 judges whether the serial number in step S3 exists in the replacement account book, if not, the block serial number in step S3 is the finally output block serial number, if so, the serial number of the new block in the replacement account book is replaced with the serial number to replace the block serial number in step S3, and block information corresponding to the block serial number of the new block is output.
To facilitate the retrieval of data in a federation chain, a database index is built for blocks in the federation chain. The specific process comprises the following steps: applying for block data uploading, synchronously uploading data by the alliance nodes, and processing the uploaded data, wherein the data processing method comprises but is not limited to desensitization processing, and the desensitization processing comprises the steps of encrypting the privacy information such as names, identification numbers, mobile phone numbers, addresses and the like of specific personnel and other privacy requirements provided by users, or directly deleting the information related to personal privacy in the uploaded data. And establishing a data index base of each block in the alliance chain, and if the input retrieval information is the same as the information in the data index base, acquiring the block number corresponding to the data index base. The data index database is used for establishing indexes according to word segmentation results by segmenting processed data, and comprises keyword indexes, time indexes, type indexes and user information indexes. The user can retrieve by searching the keyword data, the search time data, and the search type data. And the retrieval feedback is the block number which is judged by replacing the account book with the number, and the block data is timely and accurately acquired according to the block number.
It should be noted here that, whether the data block is directly uploaded to the block chain, or the newly generated data block is modified or deleted, data processing needs to be performed on the data therein, and a data index library corresponding to the data block is established.
In addition, the serial number replacement account book can adjust the sequence of the output data of the block chain by adjusting the priority sequence of the block serial numbers.
Example two
Based on the same inventive concept, the present embodiment discloses a block chain data storage and retrieval apparatus, comprising: the modification/deletion module is used for positioning the node to a block containing data to be modified when a user applies for modifying or deleting the data, downloading all information in the block, then modifying or deleting the information, storing the modified content in a new block, and commonly identifying the new block by the alliance node; the number replacing module is used for pointing the block number of the original block to the block number of the new block in the number replacing account book; the block number acquisition module is used for acquiring the block number of the block corresponding to the input retrieval information; and the judging module is used for judging whether the serial number replaces the block serial number in the block serial number acquiring module, if not, the block serial number in the block serial number acquiring module is the finally output block serial number, if so, the serial number replaces the block serial number of the new block in the account book to replace the block serial number in the block serial number acquiring module, and the block information corresponding to the block serial number of the new block is output.
EXAMPLE III
Based on the same inventive concept, the present embodiment provides a computer device, which includes a processor and a memory, where at least one instruction, at least one program, code set, or instruction set is stored in the memory, and the at least one instruction, the at least one program, code set, or instruction set is loaded and executed by the processor to implement any one of the above block chain data storage and retrieval methods.
Example four
Based on the same inventive concept, the present embodiments provide a computer-readable storage medium having at least one instruction, at least one program, code set, or set of instructions stored therein, which is loaded and executed by a processor to implement any of the above methods for blockchain data storage and retrieval.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. A method for blockchain data storage and retrieval, comprising the steps of:
s1, when the user applies for modifying or deleting data, the node locates the block containing the data to be modified, downloads all the information in the block for modification or deletion, and stores the modified content in a new block, and the alliance node identifies the new block;
s2, in the numbering replacement account book, the block number of the original block points to the block number of the new block;
s3 acquires a block number corresponding to the input search information;
s4 determines whether the block number in step S3 exists in the number replacement ledger, if not, the block number in step S3 is the block number finally output, and if so, replaces the block number in step S3 with the block number of the new block in the number replacement ledger, and outputs block information corresponding to the block number of the new block.
2. The blockchain data storage and retrieval method of claim 1, wherein the blockchain is a federation chain, members of the federation chain being responsible for generation and management of blocks in the federation chain.
3. The method as claimed in claim 2, wherein a data index database of each block in the alliance chain is established, and if the inputted retrieval information is the same as the information in the data index database, the block number corresponding to the data index database is obtained.
4. The blockchain data storage and retrieval method of claim 3, wherein the data index library creates an index according to a result of the word segmentation by performing word segmentation on the processed data, and the data index library includes a keyword index, a time index, a type index, and a user information index.
5. A blockchain data storage and retrieval method according to any of claims 1 to 4 in which desensitization is applied to data entering a blockchain, including data directly entered into the blockchain and data modified or deleted.
6. A blockchain data storage and retrieval method according to claim 5 wherein the desensitisation process includes encryption of the names, identity numbers, cell phone numbers and addresses of the persons involved, as well as other privacy requirements set forth by the user.
7. A blockchain data storage and retrieval method according to any of claims 1 to 4 wherein the numbering replacement ledger is capable of adjusting the order in which blockchain output data is output by adjusting the order of priority of the block numbers to be output.
8. A blockchain data storage and retrieval device, comprising:
the system comprises a modification/deletion module, a federation node and a data processing module, wherein the modification/deletion module is used for positioning a node to a block containing data to be modified when a user applies for modifying or deleting the data, downloading all information in the block, then modifying or deleting the information, storing the modified content in a new block, and commonly identifying the new block by the federation node;
the number replacing module is used for pointing the original block number of the block to the block number of the new block in the number replacing account book;
the block number acquisition module is used for acquiring the block number of the block corresponding to the input retrieval information;
and the judging module is used for judging whether the block number in the block number acquiring module exists in the account book replaced by the number, if not, the block number in the block number acquiring module is the finally output block number, and if so, replacing the block number in the block number acquiring module by the block number of the new block in the account book replaced by the number, and outputting block information corresponding to the block number of the new block.
9. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the blockchain data storage and retrieval method of any one of claims 1 to 7.
10. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the blockchain data storage and retrieval method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010411245.9A CN111597190A (en) | 2020-05-15 | 2020-05-15 | Block chain data storage and retrieval method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010411245.9A CN111597190A (en) | 2020-05-15 | 2020-05-15 | Block chain data storage and retrieval method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111597190A true CN111597190A (en) | 2020-08-28 |
Family
ID=72191063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010411245.9A Pending CN111597190A (en) | 2020-05-15 | 2020-05-15 | Block chain data storage and retrieval method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111597190A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080071969A1 (en) * | 2006-09-15 | 2008-03-20 | Lin Jason T | Method for Class-Based Update Block Replacement Rules in Non-Volatile Memory |
CN107451177A (en) * | 2017-03-24 | 2017-12-08 | 北京瑞卓喜投科技发展有限公司 | For the querying method and system of the block chain of the single corrigenda of increase block |
CN107463596A (en) * | 2017-03-24 | 2017-12-12 | 北京瑞卓喜投科技发展有限公司 | Block chain parallel query method and system for setting errata outside chain |
CN108512649A (en) * | 2018-02-09 | 2018-09-07 | 北京欧链科技有限公司 | The processing method and processing device of the reversed Hash link of block chain |
CN109086413A (en) * | 2018-08-03 | 2018-12-25 | 上海点融信息科技有限责任公司 | For searching for the method, equipment and readable storage medium storing program for executing of block chain data |
CN109241192A (en) * | 2018-09-18 | 2019-01-18 | 百度在线网络技术(北京)有限公司 | The data modification and block verification method, device, equipment and medium of block chain |
US20190042620A1 (en) * | 2017-08-01 | 2019-02-07 | International Business Machines Corporation | Optimizing queries and other retrieve operations in a blockchain |
CN110399373A (en) * | 2019-06-26 | 2019-11-01 | 杭州慧牧科技有限公司 | A kind of block chain account book storage system, storage querying method and delet method |
CN110474776A (en) * | 2019-07-19 | 2019-11-19 | 上海朝夕网络技术有限公司 | A kind of believable block data dynamic deletes method |
-
2020
- 2020-05-15 CN CN202010411245.9A patent/CN111597190A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080071969A1 (en) * | 2006-09-15 | 2008-03-20 | Lin Jason T | Method for Class-Based Update Block Replacement Rules in Non-Volatile Memory |
CN107451177A (en) * | 2017-03-24 | 2017-12-08 | 北京瑞卓喜投科技发展有限公司 | For the querying method and system of the block chain of the single corrigenda of increase block |
CN107463596A (en) * | 2017-03-24 | 2017-12-12 | 北京瑞卓喜投科技发展有限公司 | Block chain parallel query method and system for setting errata outside chain |
US20190042620A1 (en) * | 2017-08-01 | 2019-02-07 | International Business Machines Corporation | Optimizing queries and other retrieve operations in a blockchain |
CN108512649A (en) * | 2018-02-09 | 2018-09-07 | 北京欧链科技有限公司 | The processing method and processing device of the reversed Hash link of block chain |
CN109086413A (en) * | 2018-08-03 | 2018-12-25 | 上海点融信息科技有限责任公司 | For searching for the method, equipment and readable storage medium storing program for executing of block chain data |
CN109241192A (en) * | 2018-09-18 | 2019-01-18 | 百度在线网络技术(北京)有限公司 | The data modification and block verification method, device, equipment and medium of block chain |
CN110399373A (en) * | 2019-06-26 | 2019-11-01 | 杭州慧牧科技有限公司 | A kind of block chain account book storage system, storage querying method and delet method |
CN110474776A (en) * | 2019-07-19 | 2019-11-19 | 上海朝夕网络技术有限公司 | A kind of believable block data dynamic deletes method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2302538B1 (en) | Method and system for capturing change of data | |
US10824758B2 (en) | System and method for managing enterprise data | |
CN105488050B (en) | A kind of more indexing means of database, apparatus and system | |
CN105956123A (en) | Local updating software-based data processing method and apparatus | |
CN105760781A (en) | Storage method, restoration method and operation method of ordered and derivable large-data files | |
CN112861496A (en) | Report generation display method and device, computer equipment and readable storage medium | |
CN113434910A (en) | Business data chaining method and device | |
CN110287192B (en) | Search application data processing method and device, computer equipment and storage medium | |
CN110362542B (en) | Nuclear power station file encoding method and device, computer equipment and storage medium | |
CN108512948B (en) | Address book updating method and device, computer equipment and storage medium | |
CN111177121A (en) | Order data feedback method and device, computer equipment and storage medium | |
CN109564569A (en) | The memory for calculating for a long time is reduced to use | |
CN109325042A (en) | Handle template acquisition methods, form processing method, device, equipment and medium | |
CN105373605A (en) | Batch storage method and system for data files | |
CN113515322B (en) | Application program loading method and device, computer equipment and readable storage medium | |
CN113918437A (en) | User behavior data analysis method and device, computer equipment and storage medium | |
CN112711649A (en) | Database multi-field matching method, device, equipment and storage medium | |
CN113468118A (en) | File increment storage method and device, computer equipment and storage medium | |
CN111597190A (en) | Block chain data storage and retrieval method, device, equipment and storage medium | |
CN111782649A (en) | Data acquisition format updating method and device, computer equipment and storage medium | |
CN111221967A (en) | Language data classification storage system based on block chain architecture | |
CN107563219B (en) | Database management method and device | |
CN112765183B (en) | Multi-source data fusion method and device, storage medium and electronic equipment | |
CN109101232A (en) | A kind of method, apparatus of product development, computer equipment and storage medium | |
CN114648279A (en) | Candidate loading and unloading point position recommendation 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 |