WO2019024673A1 - 一种区块链块数据的归档方法、装置及查询方法、装置 - Google Patents
一种区块链块数据的归档方法、装置及查询方法、装置 Download PDFInfo
- Publication number
- WO2019024673A1 WO2019024673A1 PCT/CN2018/095783 CN2018095783W WO2019024673A1 WO 2019024673 A1 WO2019024673 A1 WO 2019024673A1 CN 2018095783 W CN2018095783 W CN 2018095783W WO 2019024673 A1 WO2019024673 A1 WO 2019024673A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- block data
- data
- block
- archiving
- compressed package
- Prior art date
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/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/113—Details of archiving
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
- G06F16/137—Hash-based
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
-
- 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/21—Design, administration or maintenance of databases
- G06F16/214—Database migration support
-
- 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/21—Design, administration or maintenance of databases
- G06F16/215—Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
-
- 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/21—Design, administration or maintenance of databases
- G06F16/219—Managing data history or versioning
-
- 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
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a data archiving method and archiving device for blockchain block data, and an inquiry method and a query device.
- Blockchain is a distributed node consensus algorithm to generate and update data, cryptographically ensure data transmission and access security, generate non-tamperable and unforgeable distributed ledgers, and establish mutual trust data networks.
- Data archiving is a way to keep the size of an online database largely unchanged but to provide stable database performance for user applications. It works by migrating data that has not been used for a long time in an online database to a historical database or file format archive. The scale of the activity data.
- the archived data can be backed up at any time without affecting the application of the online database, this part of the data is generally long-term inactive data; the online database is also slimmed down after data archiving, the amount of backup data is reduced, and the overall Reduce the amount of data that needs to be backed up.
- each node in the blockchain Since each node in the blockchain stores complete data, as the chain height increases, the data of each node increases all the time. Therefore, data of the blockchain data needs to be archived, but currently there is no data for the blockchain node block. Efficient data archiving method. After research, the data stored in the blockchain is mainly divided into state data and block data. The block data access probability is low, the data volume is large, and it will not be changed. Therefore, it is necessary to provide a blockchain block. The method by which data is archived.
- the present invention provides a method, an apparatus, and a query method and apparatus for archiving block block data, so as to reduce space occupation of block data on a disk, and improve node data backup and recovery efficiency.
- An aspect of the present invention provides an archiving method for blockchain block data, including: detecting whether blockchain nodes have block data satisfying an archival condition, and archiving conditions include block data height values and access frequencies; if it is detected that archival conditions are met Block data, copying the block data that meets the archiving conditions locally, compressing and generating the compressed package, and uploading the compressed package to the reliable distributed storage system; if the upload is successful, obtaining the hash value of the compressed package file, and compressing the package file The hash value is inserted into the archive file hash table with the record of the height range of the block data in the archive.
- detecting whether the block chain node has the block data that meets the archiving condition includes: checking the number of block data stored locally by the block chain node; if the number of locally stored block data is greater than a preset number, Obtaining a preset number of block data from the block data of the lowest height value; and determining, if the access frequency of each of the preset block data is less than the preset access frequency, determining the preset number of block data to satisfy The block data of the archive condition.
- determining the preset number of block data as the block data satisfying the archiving condition includes: recording the preset time access The block data exceeding the preset access times and the corresponding height value thereof; matching the height value of the preset number of block data with the height value of the block data whose access frequency exceeds the preset access frequency; when none matches, It is determined that the preset number of block data is block data satisfying the archival condition.
- detecting whether the block chain node has the block data satisfying the archiving condition comprises: periodically detecting whether the block chain node has block data that satisfies the archiving condition, and the period is less than a time for generating the preset number of block data. .
- the archiving method further comprises: maintaining an archive file hash table in the database of the blockchain node, the archive file hash table is configured to save a hash value of the compressed package file archived by the blockchain node and the The correspondence between the height ranges of the block data in the compressed package.
- the archiving method further includes: if the upload fails, outputting an error log, and re-uploading; if the re-uploading fails, returning to the step of detecting whether the blockchain node has block data satisfying the archival condition; and deleting the generated redundancy Other data.
- a second aspect of the present invention provides a method for querying block block data, comprising: obtaining a query request, where the query request includes a height value of block data to be queried; and when the block data to be queried is archive block data, according to The height value queries the hash value of the compressed package file corresponding to the height value in the archive file hash table, and the archive file hash table includes the hash value of the compressed package file of the archive block data and the height range of the block data in the compressed package.
- Correspondence relationship when querying the hash value of the compressed package file corresponding to the height value, query whether there is a folder with the same hash value name in the locally downloaded historical data directory; if there is, the access history data directory has the same The block data under the hash name folder is queried; if not, the compressed package corresponding to the file hash value is downloaded from the reliable distributed storage system, and the compressed package is decompressed and the query result is returned.
- the query request is forwarded to other nodes.
- the method further comprises: determining whether the to-be-queried block data is archived according to whether the height value is smaller than a lowest height value of the block data locally stored by the block chain node.
- a third aspect of the present invention provides an archiving apparatus for blockchain block data, comprising: a detecting module, configured to detect whether a block chain node has block data satisfying an archival condition, and the archiving condition includes a block data height value and an access frequency.
- the uploading module is configured to: when the detecting module detects the block data that meets the archiving condition, copy the block data that satisfies the archiving condition locally, compress and generate the compressed package, and upload the compressed package to the reliable distributed storage system; the recording module, It is used to obtain the hash value of the compressed package file when the upload module is successfully uploaded, and insert the record of the hash value of the compressed package file and the height range of the block data in the compressed package into the archive file hash table.
- the detecting module includes: a viewing unit, configured to view a number of block data stored locally by the blockchain node; and an acquiring unit, configured to: when the number of locally stored block data is greater than a preset number, The block data of the lowest height value starts to acquire a preset number of block data; and the determining unit is configured to determine a preset number when the access frequency of each of the preset number of block data is less than the preset access frequency
- the block data is block data that satisfies the archiving conditions.
- the determining unit is configured to record the block data whose access frequency exceeds the preset access frequency and the corresponding height value in the preset time; the preset height of the block data and the preset time access The height values of the block data whose frequencies exceed the preset access frequency are matched; when none of the matches, the preset block data is determined to be the block data satisfying the archiving condition.
- the detecting module is specifically configured to periodically detect whether the block chain node has block data that meets an archival condition, and the detecting period is less than a time for generating a preset number of block data.
- the archiving device further comprises: a maintenance module, configured to maintain an archive file hash table in the database of the blockchain node, wherein the archive file hash table is used to save the compressed package file archived by the blockchain node The correspondence between the hash value and the height range of the block data in the compressed package.
- a maintenance module configured to maintain an archive file hash table in the database of the blockchain node, wherein the archive file hash table is used to save the compressed package file archived by the blockchain node The correspondence between the hash value and the height range of the block data in the compressed package.
- the archiving device further includes: an error reporting module, configured to output an error log when the uploading module fails to upload; return a module for re-uploading, and return to the detecting module when the re-uploading fails; To delete the generated redundant data.
- an error reporting module configured to output an error log when the uploading module fails to upload
- a fourth aspect of the present invention provides a device for querying block block data, comprising: an obtaining module, configured to acquire a query request, the query request includes a height value of block data to be queried; and a query module is configured to be used When the block data of the query is the archive block data, the hash value of the compressed package file corresponding to the height value is queried in the archive file hash table according to the height value, and the archive file hash table includes the hash value of the compressed package file of the archive block data.
- the matching module is configured to query, if the query module queries the hash value, a folder having the same hash value name in the locally downloaded historical data directory;
- the access module is configured to: when the matching module queries the folder, access the block data under the folder with the same hash value under the historical data directory for querying; and the downloading module is configured to: when the matching module does not query the folder,
- the compressed package corresponding to the hash value is downloaded from the reliable distributed storage system, and the compressed package is decompressed and the query result is returned.
- the querying device further includes: a forwarding module, configured to forward the query request to the other node when the hash value obtaining module does not query the hash value.
- the querying device further includes: a determining module, configured to determine, according to whether the height value of the block data to be queried is smaller than a lowest height value of the block data locally stored by the block chain node, whether the to-be-queried block data has been archived.
- a determining module configured to determine, according to whether the height value of the block data to be queried is smaller than a lowest height value of the block data locally stored by the block chain node, whether the to-be-queried block data has been archived.
- the present invention also provides a computer device comprising a memory, a processor, and a computer program stored on the memory and executed by the processor, the processor executing the computer program to implement the archiving method of the blockchain data, and/or the above The steps of the query method of the blockchain data.
- the present invention further provides a computer readable storage medium having stored thereon a computer program, the computer program being executed by the processor to implement the archiving method of the blockchain data, and/or the query of the blockchain data. The steps of the method.
- the method, device, and query method and device for archiving block block data can easily and efficiently divide infrequently used block data by setting the height value and access frequency of the block data as archival conditions.
- the security of the archived data is guaranteed to prevent tampering; by hashing the uploaded compressed package file with the block in the compressed package
- the height range of the data is inserted into the archive file hash table as a record, which realizes the record of the archive data, and facilitates recovery query of the archive data.
- FIG. 1 is a flowchart of a method for archiving blockchain data according to an embodiment of the present invention.
- FIG. 2 is a flowchart of a method for archiving blockchain data according to another embodiment of the present invention.
- FIG. 3 is a flowchart of a method for querying blockchain data according to an embodiment of the present invention.
- FIG. 4 is a flowchart of a method for querying blockchain data according to another embodiment of the present invention.
- FIG. 5 is a structural block diagram of an apparatus for archiving block block data according to an embodiment of the present invention.
- FIG. 6 is a structural block diagram of a device for querying blockchain data according to an embodiment of the present invention.
- FIG. 7 is a structural block diagram of an electronic device according to an embodiment of the present invention.
- FIG. 8 is a structural block diagram of a computer device according to an embodiment of the present invention.
- FIG. 1 is a flowchart of a method for archiving blockchain data according to an embodiment of the present invention.
- the method can be performed by a blockchain based node or network device, as can be seen in the figure, the method 100 includes:
- the block chain node has block data that satisfies the archiving condition, and the archiving condition includes a block data height value and an access frequency.
- Blockchain is a technology for implementing a centrally distributed distributed ledger.
- Each "block data” that makes up a blockchain is similar to a "page” in a ledger.
- Each page records several transactions, one page at a time.
- the book pages are bound in chronological order, forming a complete book, that is, the blockchain, the height value of the block data and the access frequency can intuitively reflect whether the block data of the block chain node is data that is not used for a long time.
- the block data satisfying the archiving condition is detected, the block data satisfying the archiving condition is locally copied, compressed, and the compressed package is generated, and the compressed package is uploaded to the reliable distributed storage system.
- the reliable distributed storage system is a reliable distributed storage system with non-tamperable, non-missing, public traceability and natural disaster tolerance characteristics.
- the upload succeeds, obtain a hash value of the compressed package file, and insert a record of the hash value of the compressed package file and the height range of the block data in the compressed package into the archive file hash table.
- the infrequently used block data can be easily and efficiently divided; by using these infrequently used
- the compressed data of the block data is uploaded to the reliable distributed storage system to ensure the security of the archived data and prevent tampering; by inserting the hash value of the uploaded compressed package file and the height range of the block data in the compressed package as one record In the archive file hash table, the record of the archive data is realized, and the recovery query of the archive data is facilitated.
- FIG. 2 is a flowchart of a method for archiving blockchain data according to another embodiment of the present invention. As can be seen from the figure, the method 200 includes:
- the archiving condition includes whether the block data height value is less than a preset height value and the access frequency is less than a preset access frequency, and the preset height value depends on the number of block data locally stored by the block chain node and the locally stored blocks. The lowest height value of the data, as well as the preset number.
- the process of detecting whether block data of the block condition is present in the data of the block chain node includes:
- the lowest height value of the locally stored block data is H0
- the highest height value is H11
- a preset number of block data is obtained starting from the block data of the lowest height value.
- the preset number can be M.
- the specific value of the preset number is not limited, and can be configured according to the actual application environment. For example, when M is 10, the specific embodiment in a is taken as an example.
- a preset number that is, 11 is greater than 10
- the block data of the lowest height value starts to acquire a preset number of block data, that is, block data of H0 to H10.
- a list is maintained in the memory for recording block data whose access frequency exceeds the preset access frequency in a preset period and a height value corresponding to the block data.
- the preset access frequency is N
- the block data whose access frequency exceeds N is recorded. For example, ⁇ T1...T10 ⁇ .
- the preset block data that is, the block data of H0 to H10 is not within ⁇ T1...T10 ⁇
- the block data of H0 to H10 is block data satisfying the archiving condition, that is, the block data
- the access frequency of each block data in the preset number of block data is less than the preset access frequency, it is determined that the preset number of block data satisfies the archiving condition.
- the specific value of the preset access frequency is not limited, and may be specifically set according to actual applications.
- copying the block data satisfying the archiving condition from the local copy in 220 further includes: setting the specified path; copying the block data satisfying the archiving condition from the local by the set specified path.
- a key-value storage method is adopted in the archive file hash table, wherein the height value range of the block data is used as the key, and the hash value of the uploaded compressed package file is used as the value to generate the record.
- a record such as 1_1000: filehash0 indicates that the compressed value of the compressed data of the block data of height 1 to 1000 corresponds to filehash0.
- the method 200 further includes: 280: Clearing the local redundant data.
- the upload succeeds, inserting the hash value of the compressed package file and the uploaded block data height range into the archive file hash table, that is, after 240, clearing the local compressed package and the redundancy of the locally archived block data. Data to avoid redundant data accumulation and disk usage.
- the error is changed, and each preset period is repeatedly packaged and uploaded to the upload success.
- the redundant data such as the compressed package that has not been successfully uploaded is deleted.
- 260 to 270 are re-uploading processes, and the process may be implemented in other manners in addition to the foregoing manners.
- the embodiment of the present invention does not limit the process.
- the archiving method of the blockchain data provided by any of the above embodiments, by setting the height value and the access frequency of the block data as the archiving conditions, it is possible to easily and efficiently divide the infrequently used block data;
- the compressed package of the block data used is uploaded to the reliable distributed storage system to ensure the security of the archived data and prevent tampering; by using the hash value of the uploaded compressed package file and the height range of the block data in the compressed package as a piece
- the record is inserted into the archive file hash table, which realizes the record of the archive data, and is convenient for the recovery query of the archive data.
- 210 specifically includes: periodically detecting whether the blockchain node has block data that meets an archival condition. Periodically detecting block data in the block chain node data that meets the archiving conditions, and archiving the part of the data, can reduce the size of the active data, and can reduce the amount of data per archive, thereby improving the efficiency of backup and recovery.
- the method 200 may further include: setting a time for periodic detection. Specifically, the cycle time is less than the time for generating the preset number of block data.
- the periodic detection may be a real-time detection, and the time of the periodic detection is set according to an actual application, which is not limited by the embodiment of the present invention.
- the detection period By setting the detection period to be less than the preset number of generation times of the block data, it is possible to archive a preset number of block data that has already met the archiving condition before generating the preset number of block data again, thereby avoiding local The accumulation of block data.
- the method 200 further includes: maintaining an archive file hash table in each block chain node database for persisting the hash value of the compressed package file that holds the block chain node archive and the archived block data. Correspondence of the height range.
- the step may be performed before 210, or may be performed before 240, or may be a file hash table that is previously maintained, which is not limited by the embodiment of the present invention.
- the method 200 further includes storing the hot data in a cached manner.
- Hot data refers to block data that may be accessed or accessed multiple times during a certain period of time in locally stored block data.
- FIG. 3 is a flowchart of a method for querying blockchain data according to an embodiment of the present invention. As can be seen from the figure, the method 300 includes:
- the query request includes the height value of the block data of the block chain node to be queried.
- the query request may also include other content, and the content of the query request is not limited by the embodiment of the present invention.
- the block data to be queried is the archive block data
- the hash value of the compressed package file corresponding to the height value is queried in the archive file hash table according to the height value
- the archive file hash table includes the zip file of the archive block data. The correspondence between the hash value and the record of the height range of the block data in the compressed package.
- the block data to be queried is known as the archived block data by default.
- the query is performed in the archive file hash table according to the height value thereof, when it is being archived.
- the local history downloaded data directory is queried to query whether there is a folder with the same hash value name, so that the historical data that has been downloaded locally can be firstly obtained.
- the query is performed under the directory.
- the compressed package corresponding to the hash value is downloaded from the reliable distributed storage system to avoid direct reliable distribution.
- FIG. 4 is a flowchart of a method for querying blockchain data according to an embodiment of the present invention. As can be seen from the figure, the method 400 includes:
- the query request may be initiated by the client, and the user queries the block data corresponding to the height value by inputting a height value.
- the block data to be queried is archived according to whether the height value is smaller than a lowest height value of the block data locally stored by the blockchain node, and if yes, execute 430; otherwise, access the local blockstore.db query.
- the archive file hash table here includes a record of the hash value of the archive file of the archive block data and the height range of the block data in the archive.
- the key file may be in a key-value storage manner.
- the height value range of the block data is used as the key, and the hash value of the uploaded compressed package file is used as the value to generate the record.
- a record such as 1_1000: filehash0 indicates that the compressed value of the compressed data of the block data of height 1 to 1000 corresponds to filehash0.
- the hash value of the compressed package file corresponding to the height value in the query request is calculated by the matching algorithm, and 440 is performed;
- the reliable distributed storage system is a reliable distributed storage system with non-tamperable, non-missing, public traceability and natural disaster tolerance characteristics.
- method 400 further includes:
- the next preset period cleans up the redundant database folders and compressed packages generated this time.
- the redundant data generated in this case is cleaned up in the next cycle of the preset period of the redundant database folder and the compressed package generated by the set cleaning.
- the preset period and the periodic detection of the block data in the block chain node data that meet the archiving condition may be the same or different, which is not limited in the embodiment of the present invention.
- the block data to be queried is archived data according to the height value in the query request, and if yes, querying in the archive file hash table according to the height value.
- the local history downloaded data directory is queried to query whether there is a folder with the same hash value name, so that it can be downloaded from the local first. The query is performed under the historical data directory.
- the compressed package corresponding to the hash value is downloaded from the reliable distributed storage system, thereby avoiding direct The problem of waste of processing resources caused by downloading of reliable distributed storage systems and accumulation of files such as compressed packages caused by multiple downloads.
- the archive file hash table is updated, the query request is forwarded, and other nodes are requested to perform the query to avoid the situation that the query cannot be queried.
- the query method of the blockchain data provided by any of the foregoing embodiments can quickly and efficiently query and recover the archived block data, and does not need to be downloaded every time, thereby avoiding accumulation of redundant data and improving the query. Efficiency and equipment efficiency.
- the archiving device 50 includes a detecting module 51, an uploading module 52, and a recording module 53.
- the detecting module 51 is configured to detect whether there is block data satisfying the archiving condition in the data of the block chain node, and the archiving condition includes a height value of the block data and an access frequency.
- the uploading module 52 locally copies the block data satisfying the archiving condition, performs compression to generate the compressed package, and uploads the compressed package to the reliable distributed storage system.
- the recording module 53 acquires the hash value of the compressed package file, and inserts the hash value of the compressed package file and the record of the height range of the block data in the compressed package into the archive file hash table.
- the archiving device 50 further includes an error reporting module 55, a return module 56, and a deletion module 57.
- the error reporting module 55 outputs an error log
- the returning module 56 re-uploads the compressed package.
- the recording module 53 obtains the hash value of the compressed package file, and the compressed package is obtained.
- the record of the hash value of the file and the height range of the block data in the compressed package is inserted into the archive file hash table; if the re-upload fails, the return module 56 restarts the detection module 51, and the detection module 51 re-pairs the block chain node.
- the block data is detected; the deletion module 57 deletes the redundant data generated by the process.
- the detecting module 51 is specifically configured to periodically detect whether the block chain node has block data that meets the archiving condition, and the cycle time of the periodic detection is less than the time for generating the preset number of block data.
- the detecting module 51 includes: a viewing unit 511, configured to view the number of block data locally stored by the block chain node, that is, all blocks between the block data of the lowest height value and the block data of the highest height value.
- the obtaining unit 512 is configured to: when a number of locally stored block data is greater than a preset number, acquire a preset number of block data from the block data of the lowest height value.
- determining unit 513 when the access frequency of each preset number of block data is less than the preset access frequency, determining the preset number of block data as the block data satisfying the archival condition.
- the determining unit 513 is specifically configured to record the block data whose access frequency exceeds the preset access frequency in the preset period and the corresponding height value thereof; the preset height of the block data and the preset period The height values of the block data whose access frequency exceeds the preset access frequency match; when none of them matches, it is determined that the preset number of block data is the block data satisfying the archiving condition.
- the archiving apparatus 50 further includes: a maintenance module 54 for maintaining a database file hash table at the blockchain node, and an archive file hash table for storing the archived file of the blocked chain file of the block chain node. The correspondence between the hash value and the height range of the block data in the compressed package.
- the archiving apparatus can easily and efficiently divide the infrequently used block data by setting the height value of the block data and the access frequency as the archiving conditions; by uploading the compressed packets of the infrequently used block data to
- the reliable distributed storage system ensures the security of the archived data and prevents tampering; by inserting the hash value of the uploaded compressed package file and the height range of the block data in the compressed package as a record into the archive file hash table, The recording of the archived data is realized, and the recovery query of the archived data is facilitated.
- the embodiment of the present invention provides a device for querying block block data.
- the query device 60 includes an obtaining module 61, a query module 62, a matching module 63, an access module 64, and a downloading module 65.
- the obtaining module 61 is configured to obtain a query request, where the query request includes a height value of the block data of the blockchain node to be queried.
- the query module 62 queries the archive file hash table for the hash value of the compressed package file corresponding to the height value according to the height value acquired by the obtaining module 61, and the return file hash is used.
- the table includes the correspondence between the hash value of the compressed package file of the returned data and the height range of the block data in the compressed package.
- the matching module 63 queries the locally downloaded historical data directory to query whether there is a folder with the same hash value name.
- the access module 64 accesses the block data under the folder with the same hash value under the historical data directory for query; when the matching module 63 does not query.
- the download module 65 downloads the compressed package corresponding to the hash value from the reliable distributed storage system, decompresses the compressed package, and returns the query result.
- the archiving device 60 further includes: the forwarding module 66, configured to forward the query request to other nodes when the query module 62 does not query the hash value of the compressed package file corresponding to the height value.
- the archiving device 60 further includes: a determining module 67, configured to determine, according to whether the height value of the block data to be queried is smaller than a minimum height value of the block data locally stored by the block chain node, whether the block data to be queried has been Return.
- a determining module 67 configured to determine, according to whether the height value of the block data to be queried is smaller than a minimum height value of the block data locally stored by the block chain node, whether the block data to be queried has been Return.
- whether the block data to be queried is the archived data is determined according to the height value in the query request, and if so, the query is performed in the archive file hash table according to the height value, when the archive file is hashed.
- the local historical downloaded data directory is queried to query whether there is a folder with the same hash name, so that it can be firstly executed in the locally downloaded historical data directory.
- An embodiment of the present invention provides an electronic device.
- the electronic device 70 includes the above-described archiving device 50 and the query device 60.
- the present invention also provides a computer device.
- the computer device 80 includes a memory 81, a processor 82, and a computer program stored on the memory and executed by the processor.
- the processor 82 executes the computer program, the predecessor is implemented.
- An embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements an archiving method and/or implementation of blockchain data as provided in any of the preceding embodiments.
- the computer storage medium can be any tangible medium such as a floppy disk, a CD-ROM, a DVD, a hard drive, or even a network medium.
- an implementation form of the embodiments of the present invention described above may be a computer program product
- the method or apparatus of the embodiments of the present invention may be implemented in software, hardware, or a combination of software and hardware.
- the hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated design hardware.
- a suitable instruction execution system such as a microprocessor or dedicated design hardware.
- processor control code such as a carrier medium such as a magnetic disk, CD or DVD-ROM, such as a read only memory.
- Such code is provided on a programmable memory (firmware) or on a data carrier such as an optical or electronic signal carrier.
- the method and apparatus of the present invention may be implemented by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., also It can be implemented by software executed by various types of processors, or by a combination of the above-described hardware circuits and software such as firmware.
- the archiving device and the querying device provided in the above embodiments are only illustrated by the division of the above functional modules when performing the respective functions. In actual applications, the function allocation may be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
- the embodiments of the archiving device, the archiving method, the querying device, and the querying method provided by the foregoing embodiments are respectively in the same concept, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
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)
- Quality & Reliability (AREA)
- Library & Information Science (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种区块链块数据的归档方法、装置及查询方法、装置,通过对满足归档条件的块数据进行归档,降低了节点存储的块数据,减少了块数据对磁盘空间的占用,提高了磁盘空间使用率,提高了节点数据备份和恢复效率。其中的归档方法包括:检测区块链节点是否存在满足归档条件的块数据,所述归档条件包括块数据高度值和访问频率;若检测到满足所述归档条件的块数据,从本地拷贝所述满足归档条件的块数据,进行压缩生成压缩包,并将所述压缩包上传至可靠分布式存储系统;若上传成功,获取所述压缩包的文件哈希值,并将所述压缩包文件的哈希值与所述压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
Description
本申请要求2017年8月2日提交的申请号为No.201710651103.8的中国申请的优先权,通过引用将其全部内容并入本文。
本发明涉及计算机技术领域,具体涉及一种区块链块数据的数据归档方法和归档装置,以及查询方法和查询装置。
发明背景
区块链是利用分布式节点共识算法来生成和更新数据、利用密码学的方式保证数据传输和访问的安全,生成不可篡改和不可伪造的分布式账本,建立互相信任的数据网络。
数据归档是一种保持在线数据库规模大体不变却有能够为用户应用提供稳定的数据库性能的方法,其工作原理是,将在线数据库中长期不使用的数据迁移至历史数据库或文件形式归档,降低了活动数据的规模。
由于已归档的数据可以随时进行备份而不会影响在线数据库的应用,这部分数据一般为长时间不活跃的数据;在线的数据库也因为进行数据归档后而瘦身,备份数据量减少,并从整体减少需要备份的数据总量;同时,在对数据进行同步和恢复的时候,可以在短时间内首先完成在线数据库恢复,之后再进行其他数据的恢复工作,能够提高效率和可用性。
由于区块链中的每个节点都会存储完整数据,随着链高度的增加,每个节点数据一直增加,因此需要对区块链的数据进行数据归档,而目前对于区块链节点块数据没有高效的数据归档方法,经过研究,区块链中存储的数据主要分为状态数据和块数据,块数据访问概率低,数据量大,且不会更改,所以需要提供一种对区块链块数据进行数据归档的方法。
发明内容
有鉴于此,本发明提供一种区块链块数据的归档方法、装置及查询方法、装置,以减少块数据对磁盘的空间占用,提高节点数据备份和恢复效率。
本发明一方面提供了一种区块链块数据的归档方法,包括:检测区块链节点是否存在满足归档条件的块数据,归档条件包括块数据高度值和访问频率;若检测到满足归档条件的块数据,从本地拷贝满足归档条件的块数据,进行压缩生成压缩包,并将压缩包上传至可靠分布式存储系统;若上传成功,获取压缩包文件的哈希值,并将压缩包文件的哈希值与压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
在一个实施例中,检测区块链节点是否存在满足归档条件的块数据包括:查看区块链节点本地存储的块数据的个数;若本地存储的块数据的个数大于预设个数,从最低高度值的块数据开始获取预设个数的块数据;以及若预设个数的块数据中的每一个的访问频率均小于预设访问频率,确定预设个数的块数据为满足归档条件的块数据。
在一个实施例中,若预设个数的块数据中的每一个的访问频率小于预设访问频率,确定预设个数的块数据为满足归档条件的块数据包括:记录预设时间内访问次数超过预设访问次数的块数据及其对应的高度值;将预设个数的块数据的高度值和访问频率超过预设访问频率的块数据的高度值相匹配;当均不匹配时,确定预设个数的块数据为满足归档条件的块数据。
在一个实施例中,检测区块链节点是否存在满足归档条件的块数据包括:周期性检测区块链节点是否存在满足归档条件的块数据,该周期小于生成预设个数的块数据的时间。
在一个实施例中,归档方法还包括:在区块链节点的数据库维护归档文件哈希表,该归档文件哈希表用于保存区块链节点已归档的压缩包文件的哈希值与该压缩包中的块数据的高度范围的对应关系。
在一个实施例中,归档方法还包括:若上传失败,输出错误日志,并重新上传;若重新上传失败,返回检测区块链节点是否存在满足归档条件的块数据的步骤;以及删除产生的冗余数据。
本发明的第二方面提供了一种区块链块数据的查询方法,包括:获取查询请求,查询请求包括待查询的块数据的高度值;当待查询的块数据为归档块数据时,根据高度值在归档文件哈希表中查询高度值对应的压缩包文件的哈希值,归档文件哈希表包括归档块数据的压缩包文件的哈希值与压缩包中的块数据的高度范围的对应关系;当查询到高度值对应的压缩包文件的哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹;若有,访问历史数据目录下具有相同哈希值名称的文件夹下的块数据进行查询;若无,从可靠分布式存储系统下载文件哈希值对应的压缩包,对压缩包进行解压并返回查询结果。
在一个实施例中,当未查询到高度值对应的压缩包文件的哈希值时,将查询请求转发给其他节点。
在一个实施例中,在获取查询请求之后还包括:根据高度值是否小于区块链节点本地存储的块数据的最低高度值判断待查询块数据是否已归档。
本发明的第三方面提供了一种区块链块数据的归档装置,包括:检测模块,用于检测区块链节点是否存在满足归档条件的块数据,归档条件包括块数据高度值和访问频率;上传模块,用于在检测模块检测到满足归档条件的块数据时,从本地拷贝满足归档条件的块数据,进行压缩生成压缩包,并将压缩包上传至可靠分布式存储系统;记录模块,用于当上传模块上传成功 时,获取压缩包文件的哈希值,将压缩包文件的哈希值与压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
在一个实施例中,检测模块包括:查看单元,用于查看区块链节点本地存储的块数据个数;获取单元,用于当本地存储的块数据的个数大于预设个数时,从最低高度值的块数据开始获取预设个数的块数据;以及确定单元,用于当预设个数的块数据中的每一个的访问频率小于预设访问频率时,确定预设个数的块数据为满足归档条件的块数据。
在一个实施例中,确定单元具体用于记录预设时间内访问频率超过预设访问频率的块数据及其对应的高度值;将预设个数的块数据的高度值和预设时间内访问频率超过预设访问频率的块数据的高度值相匹配;当均不匹配时,确定预设个数的块数据为满足归档条件的块数据。在一个实施例中,检测模块具体用于周期性检测区块链节点是否存在满足归档条件的块数据,该检测周期小于生成预设个数的块数据的时间。
在一个实施例中,归档装置还包括:维护模块,用于在区块链节点的数据库维护归档文件哈希表,所述归档文件哈希表用于保存区块链节点已归档的压缩包文件的哈希值与压缩包中的块数据的高度范围的对应关系。
在一个实施例中,归档装置还包括:报错模块,用于当上传模块上传失败时,输出错误日志;返回模块,用于重新上传,以及当重新上传失败时,返回检测模块;删除模块,用于删除产生的冗余数据。
本发明的第四方面提供了一种区块链块数据的查询装置,包括:获取模块,用于获取查询请求,该查询请求包括待查询的块数据的高度值;查询模块,用于当待查询的块数据为归档块数据时,根据高度值在归档文件哈希表中查询高度值对应的压缩包文件的哈希值,归档文件哈希表包括归档块数据的压缩包文件的哈希值与压缩包中的块数据的高度范围的对应关系;匹配模块,用于当查询模块查询到哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹;访问模块,用于当匹配模块查询到文件夹时,访问历史数据目录下具有相同哈希值名称的文件夹下的块数据进行查询;下载模块,用于当匹配模块未查询到文件夹时,从可靠分布式存储系统下载哈希值对应的压缩包,对压缩包进行解压并返回查询结果。
在一个实施例中,查询装置还包括:转发模块,用于当哈希值获取模块未查询到哈希值时,将查询请求转发给其他节点。
在一个实施例中,查询装置还包括:判断模块,用于根据待查询的块数据的高度值是否小于区块链节点本地存储的块数据的最低高度值判断待查询块数据是否已归档。
本发明还提供了一种计算机设备,包括存储器、处理器以及存储在存储器上被处理器执行的计算机程序,该处理器执行计算机程序时实现上述区块链块数据的归档方法,和/ 或上述区块链块数据的查询方法的步骤。
本发明又提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述区块链块数据的归档方法,和/或上述区块链块数据的查询方法的步骤。
根据本发明实施例提供的区块链块数据的归档方法、装置及查询方法、装置,通过将块数据的高度值和访问频率设置为归档条件,能够简单、高效的划分不常使用的块数据;通过将这些不常使用的块数据的压缩包上传至可靠分布式存储系统,保证了归档数据的安全性,防止被篡改;通过将上传的压缩包文件的哈希值与压缩包中的块数据的高度范围作为一条记录插入归档文件哈希表中,实现了对归档数据的记录,便于对归档数据进行恢复查询。
附图简要说明
图1是本发明一实施例提供的一种区块链块数据的归档方法流程图。
图2是本发明另一实施例提供的一种区块链块数据的归档方法流程图。
图3是本发明一实施例提供的一种区块链块数据的查询方法流程图。
图4是本发明另一实施例提供的一种区块链块数据的查询方法流程图。
图5是本发明一实施例提供的一种区块链块数据的归档装置的结构框图。
图6是本发明一实施例提供的一种区块链块数据的查询装置的结构框图。
图7是本发明一实施例提供的一种电子设备的结构框图。
图8是本发明一实施例提供的一种计算机设备的结构框图。
实施本发明的方式
为使本发明的目的、技术手段和优点更加清楚明白,以下结合附图对本发明作进一步详细说明。
图1所示为本发明一实施例提供的一种区块链块数据的归档方法的流程图。该方法可以由基于区块链的节点或网络设备执行,从图中可以看出,方法100包括:
110、检测区块链节点是否存在满足归档条件的块数据,归档条件包括块数据高度值和访问频率。
区块链是实现无中心的分布式总账的一种技术,组成区块链的每一个“块数据”类似于账本中的“页”,每页都记录了若干条交易,把一页一页的帐页按照时间顺序装订起来,就形成以一个完整的账本,即区块链,块数据的高度值和访问频率能够直观的反应区块链节点的块数据是否为长期不使用的数据。
120、若检测到满足归档条件的块数据,从本地拷贝满足归档条件的块数据,进行压缩生成压缩包,并将压缩包上传至可靠分布式存储系统。
该可靠分布式存储系统为具有不可篡改、不丢失、公开追溯且天然容灾特性的可靠分布式存储系统。
130、若上传成功,获取压缩包文件的哈希值,并将压缩包文件的哈希值与压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
根据本实施例提供的区块链块数据的归档方法,通过将块数据的高度值和访问频率设置为归档条件,能够简单、高效的划分不常使用的块数据;通过将这些不常使用的块数据的压缩包上传至可靠分布式存储系统,保证了归档数据的安全性,防止被篡改;通过将上传的压缩包文件的哈希值与压缩包中的块数据的高度范围作为一条记录插入归档文件哈希表中,实现了对归档数据的记录,便于对归档数据进行恢复查询。
图2所示为本发明另一实施例提供的一种区块链块数据的归档方法的流程图。从图中可以看出,该方法200包括:
210、检测区块链节点的数据中是否存在满足归档条件的块数据,若存在,则执行220;若不存在,则重复执行210。
其中,归档条件包括块数据高度值是否小于预设高度值和访问频率是否小于预设访问频率,该预设高度值取决于区块链节点本地存储的块数据的个数和这些本地存储的块数据的最低高度值,以及预设个数。
具体而言,在一个实施例中,检测区块链节点的数据中是否存在满足归档条件的块数据的过程包括:
a、查看区块链节点本地存储的块数据的个数,即最低高度值的块数据与最高高度值的块数据之间的所有块数据的个数。
例如本地存储的块数据的最低高度值为H0,最高高度值为H11,则本地存储的块数据的个数为H11-H0+1=11个,即最低高度值到最高高度值之间有11个块数据。
b、若本地存储的块数据的个数大于预设个数,则从最低高度值的块数据开始获取预设个数的块数据。
预设个数可以为M,对于预设个数的具体数值不加以限定,可以根据实际应用环境进行配置。例如M为10时,仍以a中的具体实施例为例,当本地存储的最低高度值到最高高度值之间的块数据的个数大于预设个数,即11大于10时,则从最低高度值的块数据开始获取预设个数的块数据,即H0到H10的块数据。
c、若该预设个数的块数据中的每一个的访问频率均小于预设访问频率,确定该预设个数 的块数据为满足归档条件的块数据。
例如在内存中维护一个列表,用于记录预设周期内访问频率超过预设访问频率的块数据以及这些块数据对应的高度值,该预设访问频率为N,记录访问频率超过N的块数据例如为{T1…T10}。
这种情况下,当该预设个数的块数据,即H0到H10的块数据均不在{T1…T10}内时,确定该H0到H10的块数据为满足归档条件的块数据,即该预设个数的块数据中的每个块数据的访问频率均小于预设访问频率时,确定该预设个数的块数据满足归档条件。
需要说明的是,对预设访问频率的具体数值不加以限定,可以根据实际应用具体设置。
220、从本地拷贝满足归档条件的块数据,进行压缩生成压缩包。
例如从本地blockstore.db数据库中拷贝满足归档条件的块数据,并进行压缩,生成压缩包。
在一个实施例中,220中从本地拷贝满足归档条件的块数据还包括:设置指定路径;通过设置的指定路径从本地拷贝满足归档条件的块数据。
230、将压缩包上传至可靠分布式存储系统,若上传成功,则执行240;若上传失败,则执行250-270。
240、获取上传的压缩包文件的哈希值,并将压缩包文件的哈希值与上传的压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
例如在该归档文件哈希表中采用key-value存储方式,其中,用块数据的高度值范围作为key,用上传的压缩包文件的哈希值作为value生成记录。示例性的,如1_1000:filehash0这样的一条记录,表示高度1至1000的块数据的压缩包对应的哈希值为filehash0。
可选的,将压缩包文件的哈希值与压缩包中的块数据的高度范围的记录插入归档文件哈希表中之后,即240之后,方法200还包括:280、清除本地冗余数据。
具体的,上传成功将压缩包文件的哈希值与上传的块数据高度范围的记录插入归档文件哈希表中之后,即240之后,清除本地的压缩包、本地已经归档的块数据的冗余数据,以避免冗余数据积累和对磁盘的占用。
250、输出错误日志。
260、重新对压缩包上传一次,若再次上传成功,则执行240;若再次上传失败,则返回210,并执行270。
具体的,根据输出的错误日志的反馈,更改错误,每个预设周期重复打包上传至上传成功。
270、删除产生的冗余数据。
具体的,删除此次生成的未上传成功的压缩包等冗余数据。
需要说明的是,260至270是重新上传的过程,除了上述方式外还可以通过其他方式实现 该过程,本发明实施例对该过程不加以限定。
根据上述任一实施例提供的区块链块数据的归档方法,通过将块数据的高度值和访问频率设置为归档条件,能够简单、高效的划分不常使用的块数据;通过将这些不常使用的块数据的压缩包上传至可靠分布式存储系统,保证了归档数据的安全性,防止被篡改;通过将上传的压缩包文件的哈希值与压缩包中的块数据的高度范围作为一条记录插入归档文件哈希表中,实现了对归档数据的记录,便于对归档数据进行恢复查询。
在一个实施例中,210具体包括:周期性检测区块链节点是否存在满足归档条件的块数据。周期性地检测区块链节点数据中满足归档条件的块数据,以对该部分数据进行归档,可以降低活跃数据的规模,同时可以减少每次归档的数据量,提高了备份和恢复的效率。
这种情况下,方法200还可以包括:设定周期性检测的时间。具体的,该周期时间小于生成预设个数的块数据的时间。
其中,该周期性检测可以是实时检测,周期性检测的时间根据实际应用进行设置,本发明实施例对此不加以限定。
通过将检测周期设置为小于预设个数的块数据的生成时间,可以在再次生成预设个数的块数据前将已经满足归档条件的预设个数的块数据进行归档,从而避免本地块数据的累积。
在一个实施例中,方法200还包括:在每个区块链节点数据库维护一个归档文件哈希表,用于持久化保存区块链节点归档的压缩包文件的哈希值与归档的块数据的高度范围的对应关系。
需要说明的是,该步骤可以是在210之前执行,也可以是在240之前执行,还可以是使用之前维护的归档文件哈希表,本发明实施例对此不加以限定。
在一个实施例中,方法200还包括:对热数据通过缓存方式进行存储。热数据是指本地存储的块数据中,在某段时间可能被访问或被多次访问的块数据。
通过对热数据采取缓存方式,可以加快访问速度以及减少设备处理的压力。当这些热数据不被访问并满足归档条件时,对其进行数据归档。
图3所示为本发明一实施例提供的区块链块数据的查询方法的流程图。从图中可以看出,该方法300包括:
310、获取查询请求,该查询请求包括待查询的块数据的高度值。
该查询请求包括所要查询的区块链节点的块数据的高度值。在其他实施例中查询请求还可以包括其他,本发明实施例对查询请求的内容不加以限定。
320、当待查询的块数据为归档块数据时,根据高度值在归档文件哈希表中查询高度值对应的压缩包文件的哈希值,归档文件哈希表包括归档块数据的压缩包文件的哈希值与压缩包中 的块数据的高度范围的记录的对应关系。
330、当查询到高度值对应的压缩包文件的哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹,若有,执行340,;若无,执行350。
340、访问历史数据目录下具有相同哈希值名称的文件夹下的块数据进行查询;
350、从可靠分布式存储系统下载该哈希值对应的压缩包,对压缩包进行解压并返回查询结果。
根据本实施例提供的区块链块数据的查询方法,默认已知所要查询的块数据为已归档块数据,这种情况下,根据其高度值在归档文件哈希表中查询,当在归档文件哈希表中能够查询到对应的压缩包文件的哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹,从而首先能够从本地已下载的历史数据目录下进行查询,当本地已经下载的历史数据目录下没有查询到相同哈希值名称的文件夹时,再从可靠分布式存储系统下载该哈希值对应的压缩包,避免直接从可靠分布式存储系统下载造成的处理资源浪费以及多次下载造成的压缩包等文件积累的问题。
图4所示为本发明一实施例提供的区块链块数据的查询方法的流程图。从图中可以看出,该方法400包括:
410、获取查询请求。
具体的,查询请求可以通过客户端发起,用户通过输入高度值来查询该高度值对应的块数据。
420、根据高度值判断所要查询的块数据是否已归档,若是,则执行430;否则,访问本地查询。
具体的,根据该高度值是否小于区块链节点本地存储的块数据的最低高度值判断所要查询的块数据是否已归档,若是,则执行430;否则,访问本地blockstore.db查询。
本领域技术人员可以理解,如果在查询之前已经确定所要查询的块数据已归档,则420的执行过程可以省略,直接执行430。
430、根据高度值在归档文件哈希表中查询,若在归档文件哈希表中查询到该高度值对应的压缩包文件的哈希值,则执行440;若在归档文件哈希表中没有查询到对应的压缩包文件的哈希值,则转发查询请求,请求其他节点。
这里的归档文件哈希表包括归档块数据的压缩包文件的哈希值与压缩包中的块数据的高度范围的记录。例如该归档文件哈希表中可以采用key-value存储方式,其中,用块数据的高度值范围作为key,用上传的压缩包文件的哈希值作为value生成记录。示例性的,如1_1000:filehash0这样的一条记录,表示高度1至1000的块数据的压缩包对应的哈希值为filehash0。
具体的,当根据高度值在该节点的归档文件哈希表中查询到对应的记录时,通过匹配算法计算该查询请求中的高度值对应的压缩包文件的哈希值,并执行440;
因为当有新节点加入集群时,在进行归档文件哈希表同步的过程中,有请求访问到该节点,因为归档文件哈希表没有完整同步,存在查询归档块数据所在压缩包文件的哈希值失败的可能性,所以更新归档文件哈希表后,携带本节点信息,转发查询请求,请求其他节点进行查询,其查询过程与本实施例所述的方式类似,此处不再加以赘述。
440、在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹,若在本地已经下载的历史数据目录下查询到相同哈希值名称的文件夹,则执行450;若在本地已经下载的历史数据目录下没有查询到相同哈希值名称的文件夹,则执行460。
具体的,根据匹配计算获取的压缩包文件的哈希值,在本地已下载的历史数据目录下查询是否存在与该压缩包文件的哈希值具有相同哈希值名称的文件夹,若有,则执行450;若没有,则执行460。
450、访问历史数据目录下具有相同哈希值名称的文件夹下的数据库文件查找。
460、从可靠分布式存储系统下载该哈希值对应的压缩包,若下载成功,则执行470;若下载失败,则返回错误,并重新查找。
该可靠分布式存储系统为具有不可篡改、不丢失、公开追溯且天然容灾特性的可靠分布式存储系统。
470、解压并返回查询结果。
在一个实施例中,在470之后方法400还包括:
480、下一个预设周期清理此次产生的多余数据库文件夹和压缩包。
具体的,在设定的清理产生的多余数据库文件夹和压缩包的预设周期的下一个周期对此次产生的冗余数据进行清理。
该预设周期与周期性地检测区块链节点数据中满足归档条件的块数据的周期可以相同,也可以不同,本发明实施例对此不加以限定。
根据上述任一实施例提供的区块链块数据的查询方法,根据查询请求中的高度值判断所要查询的块数据是否是已归档数据,若是,则根据高度值在归档文件哈希表中查询。当在归档文件哈希表中能够查询到对应的压缩包文件的哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹,从而首先能够从本地已下载的历史数据目录下进行查询,当本地已经下载的历史数据目录下没有查询到相同哈希值名称的文件夹时,再从可靠分布式存储系统下载该哈希值对应的压缩包,避免直接从可靠分布式存储系统下载造成的处理资源浪费以及多次下载造成的压缩包等文件积累的问题。当在归档文件哈希表中没有查询到对应的压缩包文 件的哈希值时,更新归档文件哈希表,转发查询请求,请求其他节点进行查询,避免查询不到的情况。通过上述任一实施例提供的区块链块数据的查询方法,能够对已归档的块数据进行快速高效查询并恢复,且无需每次都进行下载,避免了冗余数据的积累,提高了查询效率及设备使用效率。
本发明实施例提供了一种区块链块数据的归档装置,参照图5所示,该归档装置50包括:检测模块51、上传模块52和记录模块53。其中,检测模块51用于检测区块链节点的数据中是否存在满足归档条件的块数据,该归档条件包括块数据的高度值和访问频率。当检测模块51检测到满足归档条件的块数据时,上传模块52从本地拷贝满足归档条件的块数据,进行压缩生成压缩包,并将压缩包上传至可靠分布式存储系统。当上传模块52上传成功时,记录模块53获取压缩包文件的哈希值,将压缩包文件的哈希值与压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
在一个实施例中,归档装置50还包括:报错模块55、返回模块56以及删除模块57。具体而言,当上传模块52上传失败时,报错模块55输出错误日志,返回模块56对压缩包进行重新上传,若重新上传成功,由记录模块53获取压缩包文件的哈希值,将压缩包文件的哈希值与压缩包中的块数据的高度范围的记录插入归档文件哈希表中;若重新上传失败,返回模块56重新启动检测模块51,由检测模块51重新对区块链节点中的块数据进行检测;删除模块57对该过程产生的冗余数据进行删除。
在一个实施例中,检测模块51具体用于周期性检测区块链节点是否存在满足归档条件的块数据,该周期性检测的周期时间小于生成预设个数的块数据的时间。
在一个实施例中,检测模块51包括:查看单元511,用于查看区块链节点本地存储的块数据的个数,即最低高度值的块数据与最高高度值的块数据之间的所有块数据的个数。获取单元512,用于当本地存储的块数据的个数大于预设个数时,从最低高度值的块数据开始获取预设个数的块数据。以及确定单元513,当每个预设个数的块数据的访问频率均小于预设访问频率时,确定预设个数的块数据为满足归档条件的块数据。
在一个实施例中,确定单元513具体用于记录预设周期内访问频率超过预设访问频率的块数据及其对应的高度值;将预设个数的块数据的高度值和预设周期内访问频率超过预设访问频率的块数据的高度值相匹配;当均不匹配时,确定预设个数的块数据为满足归档条件的块数据。
在一个实施例中,归档装置50还包括:维护模块54用于在区块链节点的数据库维护归档文件哈希表,归档文件哈希表用于保存区块链节点已归档的压缩包文件的哈希值与压缩包中的块数据的高度范围的对应关系。
本实施例提供的归档装置,通过将块数据的高度值和访问频率设置为归档条件,能够简单、 高效的划分不常使用的块数据;通过将这些不常使用的块数据的压缩包上传至可靠分布式存储系统,保证了归档数据的安全性,防止被篡改;通过将上传的压缩包文件的哈希值与压缩包中的块数据的高度范围作为一条记录插入归档文件哈希表中,实现了对归档数据的记录,便于对归档数据进行恢复查询。
本发明实施例提供了一种区块链块数据的查询装置,参照图6所示,该查询装置60包括:获取模块61、查询模块62、匹配模块63、访问模块64以及下载模块65。其中,获取模块61用于获取查询请求,该查询请求包括所要查询的区块链节点的块数据的高度值。当待查询的块数据为归档数据时,查询模块62根据获取模块61获取到的高度值在归档文件哈希表中查询该高度值对应的压缩包文件的哈希值,该归当文件哈希表包括归当数据的压缩包文件的哈希值与压缩包中的块数据的高度范围的对应关系。当查询模块62查询到高度值对应的压缩包文件的哈希值时,由匹配模块63在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹。当匹配模块63查询到该具有相同哈希值名称的文件夹时,利用访问模块64访问历史数据目录下具有相同哈希值名称的文件夹下的块数据进行查询;当匹配模块63未查询到该具有相同哈希值名称的文件夹时,下载模块65从可靠分布式存储系统下载该哈希值对应的压缩包,对压缩包进行解压并返回查询结果。
在一个实施例中,归档装置60还包括:转发模块66用于当查询模块62未查询到高度值对应的压缩包文件的哈希值时,将查询请求转发给其他节点。
在一个实施例中,归档装置60还包括:判断模块67,用于根据待查询的块数据的高度值是否小于区块链节点本地存储的块数据的最低高度值判断待查询的块数据是否已归当。
根据上述实施例提供的查询装置,可以根据查询请求中的高度值判断所要查询的块数据是否是已归档数据,若是,则根据高度值在归档文件哈希表中查询,当在归档文件哈希表中能够查询到对应的压缩包文件的哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹,从而首先能够在本地已下载的历史数据目录下进行查询,避免直接从可靠分布式存储系统下载造成的处理资源浪费以及多次下载造成的压缩包等文件积累的问题;当在归档文件哈希表中没有查询到对应的压缩包文件的哈希值时,更新归档文件哈希表,转发查询请求,请求其他节点进行查询,避免查询不到的情况;同时,在本地已经下载的历史数据目录下没有查询到相同哈希值名称的文件夹,再从可靠分布式存储系统下载该哈希值对应的压缩包,这样避免了一开始即从可靠分布式存储系统下载所造成的冗余数据积累的问题,从而通过本发明实施例对提供的方法,能够对已归档的块数据进行快速高效查询恢复,且无需每次都进行下载,避免了冗余数据的积累,提高了查询效率及设备使用效率。
本发明实施例提供了一种电子设备,参照图7所示,该电子设备70包括上述归档装 置50和查询装置60。
本发明还提供了一种计算机设备,参照图8所示,该计算机设备80包括存储器81、处理器82以及存储在存储器上被处理器执行的计算机程序,处理器82执行计算机程序时实现如前任一实施例提供的区块链块数据的归档方法和/或实现如前任一实施例提供的区块链块数据的查询方法。
本发明一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如前任一实施例提供的区块链块数据的归档方法和/或实现如前任一实施例提供的区块链块数据的查询方法。该计算机存储介质可以为任何有形媒介,例如软盘、CD-ROM、DVD、硬盘驱动器、甚至网络介质等。
应当理解,虽然以上描述了本发明实施方式的一种实现形式可以是计算机程序产品,但是本发明的实施方式的方法或装置可以被依软件、硬件、或者软件和硬件的结合来实现。硬件部分可以利用专用逻辑来实现;软件部分可以存储在存储器中,由适当的指令执行系统,例如微处理器或者专用设计硬件来执行。本领域的普通技术人员可以理解上述的方法和设备可以使用计算机可执行指令和/或包含在处理器控制代码中来实现,例如在诸如磁盘、CD或DVD-ROM的载体介质、诸如只读存储器(固件)的可编程的存储器或者诸如光学或电子信号载体的数据载体上提供了这样的代码。本发明的方法和装置可以由诸如超大规模集成电路或门阵列、诸如逻辑芯片、晶体管等的半导体、或者诸如现场可编程门阵列、可编程逻辑设备等的可编程硬件设备的硬件电路实现,也可以用由各种类型的处理器执行的软件实现,也可以由上述硬件电路和软件的结合例如固件来实现。
需要说明的是:上述所有可选技术方案,可以采用任意结合形成本发明的可选实施例,在此不再一一赘述。
此外,上述实施例提供的归档装置和查询装置在执行各自的功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的归档装置和归档方法、查询装置和查询方法的实施例分别属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
以上仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
Claims (20)
- 一种区块链块数据的数据归档方法,其特征在于,包括:检测区块链节点是否存在满足归档条件的块数据,所述归档条件包括块数据高度值和访问频率;若检测到满足所述归档条件的块数据,从本地拷贝所述满足归档条件的块数据,进行压缩生成压缩包,并将所述压缩包上传至可靠分布式存储系统;若上传成功,获取所述压缩包的文件哈希值,并将所述压缩包文件的哈希值与所述压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
- 根据权利要求1所述的区块链块数据的归档方法,其特征在于,所述检测区块链节点是否存在满足归档条件的块数据包括:查看所述区块链节点本地存储的块数据个数;若所述本地存储的块数据的个数大于预设个数,从最低高度值的块数据开始获取所述预设个数的块数据;以及若所述预设个数的块数据中的每一个的访问频率均小于预设访问频率,确定所述预设个数的块数据为满足所述归档条件的块数据。
- 根据权利要求2所述的区块链块数据的归档方法,其特征在于,若所述预设个数的块数据中的每一个的访问频率均小于预设访问频率,确定所述预设个数的块数据为满足所述归档条件的块数据,包括:记录预设周期内访问频率超过预设访问频率的块数据及其对应的高度值;将所述预设个数的块数据的高度值和所述访问频率超过预设访问频率的块数据的高度值相匹配;当均不匹配时,确定所述预设个数的块数据为满足所述归档条件的块数据。
- 根据权利要求2或3所述的区块链块数据的归档方法,其特征在于,所述检测区块链节点是否存在满足归档条件的块数据包括:周期性检测区块链节点是否存在满足归档条件的块数据,所述周期小于生成预设个数的块数据的时间。
- 根据权利要求1-4中任一所述的区块链块数据的归档方法,其特征在于,所述方法还包括:在所述区块链节点的数据库维护所述归档文件哈希表,所述归档文件哈希表用于保存所述区块链节点已归档的压缩包文件的哈希值与所述压缩包中的块数据的高度范围的对应关系。
- 根据权利要求1-5中任一所述的区块链块数据的归档方法,其特征在于,所述方法还包 括:若上传失败,输出错误日志,并重新上传;若重新上传失败,返回所述检测区块链节点是否存在满足归档条件的块数据的步骤;以及删除产生的冗余数据。
- 一种区块链块数据的查询方法,其特征在于,包括:获取查询请求,所述查询请求包括待查询的块数据的高度值;当所述待查询的块数据为归档块数据时,根据所述高度值在归档文件哈希表中查询所述高度值对应的压缩包文件的哈希值,所述归档文件哈希表包括归档块数据的压缩包文件的哈希值与所述压缩包中的块数据的高度范围的对应关系;当查询到所述高度值对应的压缩包文件的哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹;若有,访问所述历史数据目录下具有相同哈希值名称的文件夹下的块数据进行查询;若无,从可靠分布式存储系统下载所述文件哈希值对应的压缩包,对所述压缩包进行解压并返回查询结果。
- 根据权利要求7所述的区块链块数据的查询方法,其特征在于,当未查询到所述高度值对应的压缩包文件的哈希值时,将所述查询请求转发给其他节点。
- 根据权利要求7或8所述的区块链块数据的查询方法,其特征在于,在获取查询请求之后还包括:根据所述高度值是否小于所述区块链节点本地存储的块数据的最低高度值判断所述待查询块数据是否已归档。
- 一种区块链块数据的归档装置,其特征在于,包括:检测模块,用于检测区块链节点是否存在满足归档条件的块数据,所述归档条件包括块数据高度值和访问频率;上传模块,用于在所述检测模块检测到满足所述归档条件的块数据时,从本地拷贝所述满足归档条件的块数据,进行压缩生成压缩包,并将所述压缩包上传至可靠分布式存储系统;记录模块,用于当上传模块上传成功时,获取所述压缩包文件的哈希值,将所述压缩包文件的哈希值与所述压缩包中的块数据的高度范围的记录插入归档文件哈希表中。
- 根据权利要求10所述的区块链块数据的归档装置,其特征在于,所述检测模块包括:查看单元,用于查看所述区块链节点本地存储的块数据个数;获取单元,用于当本地存储的块数据的个数大于预设个数时,从最低高度值的块数据开始获取所述预设个数的块数据;以及确定单元,用于当所述预设个数的块数据中的每一个的访问频率均小于预设访问频率时,确定所述预设个数的块数据为满足所述归档条件的块数据。
- 根据权利要求11所述的区块链块数据的归档装置,其特征在于,所述确定单元具体用于记录预设周期内访问频率超过预设访问频率的块数据及其对应的高度值;将所述预设个数的块数据的高度值和所述访问频率超过预设访问频率的块数据的高度值相匹配;当均不匹配时,确定所述预设个数的块数据为满足所述归档条件的块数据。
- 根据权利要求10-12中任一所述的区块链块数据的归档装置,其特征在于,所述检测模块具体用于周期性检测区块链节点是否存在满足归档条件的块数据,所述周期小于生成预设个数的块数据的时间。
- 根据权利要求10-13中任一所述的区块链块数据的归档装置,其特征在于,还包括:维护模块,用于在区块链节点的数据库维护所述归档文件哈希表,所述归档文件哈希表用于保存所述区块链节点已归档的压缩包文件的哈希值与所述压缩包中的块数据的高度范围的对应关系。
- 根据权利要求10-14中任一所述的区块链块数据的归档装置,其特征在于,还包括:报错模块,用于当所述上传模块上传失败时,输出错误日志;返回模块,用于重新上传,以及当所述重新上传失败时,返回所述检测模块;删除模块,用于删除产生的冗余数据。
- 一种区块链块数据的查询装置,其特征在于,包括:获取模块,用于获取查询请求,所述查询请求包括待查询的块数据的高度值;查询模块,用于当所述待查询的块数据为归档块数据时,根据所述高度值在归档文件哈希表中查询所述高度值对应的压缩包文件的哈希值,所述归档文件哈希表包括归档块数据的压缩包文件的哈希值与所述压缩包中的块数据的高度范围的对应关系;匹配模块,用于当所述查询模块查询到所述哈希值时,在本地已下载的历史数据目录下查询是否有相同哈希值名称的文件夹;访问模块,用于当所述匹配模块查询到所述文件夹时,访问所述历史数据目录下具有相同哈希值名称的文件夹下的块数据进行查询;下载模块,用于当所述匹配模块未查询到所述文件夹时,从可靠分布式存储系统下载所述哈希值对应的压缩包,对所述压缩包进行解压并返回查询结果。
- 根据权利要求16所述的区块链块数据的查询装置,其特征在于,还包括:转发模块,用于当所述查询模块未查询到所述哈希值时,将所述查询请求转发给其他节点。
- 根据权利要求16或17所述的区块链块数据的查询装置,其特征在于,还包括:判断模块,用于根据所述待查询的块数据的高度值是否小于所述区块链节点本地存储的块数据的最低高度值判断所述待查询块数据是否已归档。
- 一种计算机设备,包括存储器、处理器以及存储在所述存储器上被所述处理器执行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-6中任一所述的区块链块数据的归档方法,和/或如权利要求7-9中任一项所述区块链块数据的查询方法的步骤。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-6中任一所述的区块链块数据的归档方法,和/或如权利要求7-9中任一项所述区块链块数据的查询方法的步骤。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
SG11201903009PA SG11201903009PA (en) | 2017-08-02 | 2018-07-16 | Method and device for archiving block data of blockchain and method and device for querying the same |
JP2019511774A JP2019532401A (ja) | 2017-08-02 | 2018-07-16 | ブロックチェーンのブロックデータのアーカイブ方法、装置及び照会方法、装置 |
KR1020197007136A KR20190067158A (ko) | 2017-08-02 | 2018-07-16 | 블록체인 블록 데이터의 아카이빙 방법, 장치 및 조회 방법, 장치 |
US16/243,835 US20190146946A1 (en) | 2017-08-02 | 2019-01-09 | Method and device for archiving block data of blockchain and method and device for querying the same |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710651103.8 | 2017-08-02 | ||
CN201710651103.8A CN107423426B (zh) | 2017-08-02 | 2017-08-02 | 一种区块链块数据的数据归档方法及电子设备 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/243,835 Continuation US20190146946A1 (en) | 2017-08-02 | 2019-01-09 | Method and device for archiving block data of blockchain and method and device for querying the same |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019024673A1 true WO2019024673A1 (zh) | 2019-02-07 |
Family
ID=60436583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/095783 WO2019024673A1 (zh) | 2017-08-02 | 2018-07-16 | 一种区块链块数据的归档方法、装置及查询方法、装置 |
Country Status (6)
Country | Link |
---|---|
US (1) | US20190146946A1 (zh) |
JP (1) | JP2019532401A (zh) |
KR (1) | KR20190067158A (zh) |
CN (1) | CN107423426B (zh) |
SG (1) | SG11201903009PA (zh) |
WO (1) | WO2019024673A1 (zh) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111177480A (zh) * | 2019-12-27 | 2020-05-19 | 安徽易商数码科技有限公司 | 一种区块链目录档案系统 |
KR20200112633A (ko) * | 2019-03-18 | 2020-10-05 | 알리바바 그룹 홀딩 리미티드 | 합의 시스템 다운타임 복구 |
CN112559533A (zh) * | 2020-12-23 | 2021-03-26 | 杭州趣链科技有限公司 | 连续型数据库的归档方法、装置及电子设备 |
US11126751B2 (en) * | 2019-04-18 | 2021-09-21 | Advanced New Technologies Co., Ltd. | Index creation for data records |
CN113722285A (zh) * | 2021-11-03 | 2021-11-30 | 江苏荣泽信息科技股份有限公司 | 一种基于多链的跨链分布式文件存证系统 |
CN114595279A (zh) * | 2022-05-06 | 2022-06-07 | 中国信息通信研究院 | 区块链数据的处理方法和装置 |
Families Citing this family (68)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107239479B (zh) * | 2017-03-28 | 2020-03-13 | 创新先进技术有限公司 | 一种基于区块链的数据存储以及查询的方法及装置 |
CN107423426B (zh) * | 2017-08-02 | 2020-06-02 | 众安信息技术服务有限公司 | 一种区块链块数据的数据归档方法及电子设备 |
US10877959B2 (en) * | 2018-01-17 | 2020-12-29 | Sap Se | Integrated database table access |
CN108519862B (zh) * | 2018-03-30 | 2020-03-17 | 百度在线网络技术(北京)有限公司 | 区块链系统的存储方法、装置、系统和存储介质 |
CN108563771B (zh) * | 2018-04-20 | 2020-06-09 | 中国科学院合肥物质科学研究院 | 基于区块链的大文件管理系统及方法 |
CN108846137A (zh) * | 2018-07-10 | 2018-11-20 | 佛山伊苏巨森科技有限公司 | 一种区块链上应用的电子装置 |
CN110727391A (zh) * | 2018-07-16 | 2020-01-24 | 北京京东尚科信息技术有限公司 | 交易数据存储方法及装置、区块链系统、介质和电子设备 |
CN109144414B (zh) * | 2018-07-27 | 2020-07-07 | 阿里巴巴集团控股有限公司 | 区块链数据的多级存储方法和装置 |
CN109189327B (zh) * | 2018-07-27 | 2020-05-05 | 阿里巴巴集团控股有限公司 | 区块链数据的压缩处理方法和装置 |
US10671308B2 (en) * | 2018-08-07 | 2020-06-02 | International Business Machines Corporation | Private and fault-tolerant storage of segmented data |
CN109189853B (zh) * | 2018-08-08 | 2021-05-28 | 众安信息技术服务有限公司 | 一种区块链之间数据同步方法与装置 |
EP3609120B1 (en) | 2018-08-09 | 2022-04-13 | Nokia Technologies Oy | Distributed data storage |
CN109167699A (zh) * | 2018-08-20 | 2019-01-08 | 众安信息技术服务有限公司 | 处理区块链的节点的状态的方法和装置 |
CN108900364B (zh) * | 2018-08-22 | 2021-11-26 | 泰康保险集团股份有限公司 | 区块链网络的管理方法、装置、介质及电子设备 |
CN109359096A (zh) * | 2018-09-14 | 2019-02-19 | 佛山科学技术学院 | 一种基于区块链存储的数字资产安全共享方法及装置 |
CN109361734B (zh) * | 2018-09-18 | 2021-04-20 | 百度在线网络技术(北京)有限公司 | 一种区块链的数据处理方法、装置、设备及介质 |
CN109656873B (zh) * | 2018-11-02 | 2023-04-14 | 平安科技(深圳)有限公司 | 基于区块链的数据归档方法、装置及终端设备 |
CN109543455B (zh) * | 2018-11-06 | 2021-07-13 | 联动优势科技有限公司 | 一种区块链的数据归档方法及装置 |
CN109684333B (zh) * | 2018-12-24 | 2021-02-09 | 杭州复杂美科技有限公司 | 一种数据存储及裁剪方法、设备和存储介质 |
CN111382119B (zh) * | 2018-12-29 | 2023-08-22 | 华为技术有限公司 | 区块数据归档方法及相关设备 |
CN110032581A (zh) * | 2019-01-18 | 2019-07-19 | 阿里巴巴集团控股有限公司 | 一种基于区块链的业务文件存储方法及装置 |
CN110264187B (zh) * | 2019-01-23 | 2021-06-04 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、计算机设备及存储介质 |
US11178157B2 (en) * | 2019-02-05 | 2021-11-16 | Centurylink Intellectual Property Llc | Data and source validation for equipment output data or equipment failure prediction using blockchains |
CN110096505B (zh) * | 2019-03-31 | 2021-05-11 | 杭州复杂美科技有限公司 | 一种数据存储方法和系统、设备及存储介质 |
CN110083606B (zh) * | 2019-04-25 | 2021-06-08 | 深圳市豪斯莱科技有限公司 | 跨链存储方法、终端及存储介质 |
US11150978B2 (en) | 2019-04-26 | 2021-10-19 | Bank Of America Corporation | Automated system for intelligent error correction within an electronic blockchain ledger |
US20200372183A1 (en) * | 2019-05-21 | 2020-11-26 | Hewlett Packard Enterprise Development Lp | Digitally Signing Software Packages With Hash Values |
US10853341B2 (en) * | 2019-06-28 | 2020-12-01 | Advanced New Technologies Co., Ltd. | Blockchain based hierarchical data storage |
CN110474776B (zh) * | 2019-07-19 | 2022-06-07 | 上海朝夕网络技术有限公司 | 一种可信的区块数据动态删减方法 |
CN110413621B (zh) * | 2019-07-31 | 2021-08-06 | 中国工商银行股份有限公司 | 基于区块链的离线归档系统及方法 |
CN111033491B (zh) * | 2019-08-01 | 2023-06-30 | 创新先进技术有限公司 | 基于纠错编码存储共享的区块链数据 |
US11249987B2 (en) * | 2019-08-14 | 2022-02-15 | Advanced New Technologies Co., Ltd. | Data storage in blockchain-type ledger |
CN110458567B (zh) * | 2019-08-23 | 2022-06-24 | 广东工业大学 | 一种基于区块链的物品交易管理系统和方法 |
CN110554047B (zh) * | 2019-09-06 | 2021-07-02 | 腾讯科技(深圳)有限公司 | 产品缺陷检测数据处理方法、装置、系统和设备 |
EP3673376B1 (en) | 2019-09-12 | 2022-11-30 | Advanced New Technologies Co., Ltd. | Log-structured storage systems |
CN111183450B (zh) | 2019-09-12 | 2024-04-19 | 创新先进技术有限公司 | 日志结构存储系统 |
CN111837113B (zh) | 2019-09-12 | 2024-11-01 | 蚂蚁链技术有限公司 | 日志结构存储系统 |
CN110716895B (zh) * | 2019-09-17 | 2023-05-26 | 平安科技(深圳)有限公司 | 目标数据归档方法、装置、计算机设备及介质 |
CN110958300B (zh) * | 2019-10-30 | 2022-06-07 | 京东科技信息技术有限公司 | 一种数据的上传方法、系统、装置、电子设备和计算机可读介质 |
CN110958301A (zh) * | 2019-11-04 | 2020-04-03 | 广州亚美信息科技有限公司 | 基于联盟链的车辆档案数据处理方法、装置和系统 |
CN110866068B (zh) * | 2019-11-09 | 2024-02-02 | 上证所信息网络有限公司 | 一种基于hdfs的公告数据存储方法及其装置 |
KR20210075654A (ko) * | 2019-12-13 | 2021-06-23 | 현대자동차주식회사 | 블록체인 생성 시스템 및 그 운용 방법 |
CN111163151A (zh) * | 2019-12-26 | 2020-05-15 | 联想(北京)有限公司 | 一种信息处理方法、设备及计算机可读存储介质 |
KR102559290B1 (ko) * | 2020-01-06 | 2023-07-26 | 주식회사 아미크 | 하이브리드 클라우드 기반의 실시간 데이터 아카이빙 방법 및 시스템 |
CN111259074A (zh) * | 2020-01-12 | 2020-06-09 | 杭州复杂美科技有限公司 | 区块同步方法、设备和存储介质 |
CN111539014B (zh) * | 2020-03-27 | 2023-04-25 | 肾泰网健康科技(南京)有限公司 | 基于区块链的伦理文件存档方法 |
CN111538699A (zh) * | 2020-03-31 | 2020-08-14 | 首钢京唐钢铁联合有限责任公司 | 一种数据归档方法及装置 |
CN111459895B (zh) * | 2020-03-31 | 2023-09-29 | 杭州云象网络技术有限公司 | 一种区块链数据分级压缩与存储方法及系统 |
CN111209346B (zh) * | 2020-04-24 | 2020-07-28 | 腾讯科技(深圳)有限公司 | 一种区块链数据归档方法、装置和计算机可读存储介质 |
US11973857B2 (en) * | 2020-04-29 | 2024-04-30 | Kyndryl, Inc. | Data archive |
CN111708835B (zh) * | 2020-05-28 | 2023-04-25 | 西安纸贵互联网科技有限公司 | 区块链数据存储方法及装置 |
CN111611319A (zh) * | 2020-06-08 | 2020-09-01 | 杭州复杂美科技有限公司 | 分布式数据存储方法、设备和存储介质 |
CN111797086B (zh) * | 2020-07-03 | 2024-07-05 | 南京鼐威欣信息技术有限公司 | 数据裁剪方法、设备和存储介质 |
CN111858771A (zh) * | 2020-07-30 | 2020-10-30 | 杭州复杂美科技有限公司 | 分布式数据存储方法、设备和存储介质 |
CN111984612B (zh) * | 2020-08-04 | 2024-03-22 | 中国人民银行数字货币研究所 | 一种共享文件的方法、装置和系统 |
KR102572475B1 (ko) * | 2020-09-17 | 2023-08-30 | 주식회사 세수 | 폐기 가능 블록체인 원장 시스템 및 이를 이용하는 블록체인 운용 방법 |
EP4221075A4 (en) | 2020-09-23 | 2023-11-15 | Fujitsu Limited | CONTROL METHOD, CONTROL PROGRAM AND INFORMATION PROCESSING DEVICE |
CN112184206A (zh) * | 2020-09-30 | 2021-01-05 | 杭州复杂美科技有限公司 | 数据获取方法、设备和存储介质 |
US11652604B2 (en) * | 2020-11-12 | 2023-05-16 | Paypal, Inc. | Blockchain data compression and storage |
CN112380166B (zh) * | 2020-11-12 | 2024-10-01 | 上海保险交易所股份有限公司 | 区块链数据归档方法和装置 |
US11734241B2 (en) * | 2020-11-25 | 2023-08-22 | International Business Machines Corporation | Efficient spatial indexing |
US12007981B2 (en) | 2020-12-02 | 2024-06-11 | International Business Machines Corporation | Blockchain selective world state database |
CN112650733A (zh) * | 2020-12-28 | 2021-04-13 | 杭州趣链科技有限公司 | 一种智能合约状态数据的处理方法、系统与装置 |
CN112835906B (zh) * | 2021-02-08 | 2022-04-29 | 杭州趣链科技有限公司 | 基于区块链的数据管理方法、装置、系统、设备和介质 |
US20220311595A1 (en) * | 2021-03-24 | 2022-09-29 | International Business Machines Corporation | Reducing transaction aborts in execute-order-validate blockchain models |
US12074981B2 (en) | 2021-05-19 | 2024-08-27 | Micro Focus Llc | Blockchain consolidation with active archiving |
CN113220665B (zh) * | 2021-05-20 | 2023-10-20 | 成都质数斯达克科技有限公司 | 一种区块链数据归档方法、装置、电子设备及可读存储介质 |
CN114372030A (zh) * | 2022-01-11 | 2022-04-19 | 同方有云(北京)科技有限公司 | 热磁存储和蓝光存储之间的数据处理方法及装置 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103034592A (zh) * | 2012-12-05 | 2013-04-10 | 华为技术有限公司 | 数据处理方法和装置 |
CN103530388A (zh) * | 2013-10-22 | 2014-01-22 | 浪潮电子信息产业股份有限公司 | 一种云存储系统中提升性能的数据处理方法 |
CN105630609A (zh) * | 2016-02-24 | 2016-06-01 | 杭州复杂美科技有限公司 | 区块链的打包存储方法 |
CN106991165A (zh) * | 2017-03-31 | 2017-07-28 | 北京京东金融科技控股有限公司 | 基于区块链的处理金融数据的方法、装置及电子设备 |
CN107423426A (zh) * | 2017-08-02 | 2017-12-01 | 众安信息技术服务有限公司 | 一种区块链块数据的数据归档方法及电子设备 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101446966A (zh) * | 2008-12-31 | 2009-06-03 | 中国建设银行股份有限公司 | 数据存储方法及系统 |
CN103412799B (zh) * | 2013-07-26 | 2016-08-24 | 华为技术有限公司 | 数据恢复方法、数据恢复设备和分布式存储系统 |
CN105808633B (zh) * | 2016-01-08 | 2019-07-23 | 平安科技(深圳)有限公司 | 数据归档方法和系统 |
-
2017
- 2017-08-02 CN CN201710651103.8A patent/CN107423426B/zh active Active
-
2018
- 2018-07-16 JP JP2019511774A patent/JP2019532401A/ja not_active Withdrawn
- 2018-07-16 SG SG11201903009PA patent/SG11201903009PA/en unknown
- 2018-07-16 KR KR1020197007136A patent/KR20190067158A/ko not_active Application Discontinuation
- 2018-07-16 WO PCT/CN2018/095783 patent/WO2019024673A1/zh active Application Filing
-
2019
- 2019-01-09 US US16/243,835 patent/US20190146946A1/en not_active Abandoned
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103034592A (zh) * | 2012-12-05 | 2013-04-10 | 华为技术有限公司 | 数据处理方法和装置 |
CN103530388A (zh) * | 2013-10-22 | 2014-01-22 | 浪潮电子信息产业股份有限公司 | 一种云存储系统中提升性能的数据处理方法 |
CN105630609A (zh) * | 2016-02-24 | 2016-06-01 | 杭州复杂美科技有限公司 | 区块链的打包存储方法 |
CN106991165A (zh) * | 2017-03-31 | 2017-07-28 | 北京京东金融科技控股有限公司 | 基于区块链的处理金融数据的方法、装置及电子设备 |
CN107423426A (zh) * | 2017-08-02 | 2017-12-01 | 众安信息技术服务有限公司 | 一种区块链块数据的数据归档方法及电子设备 |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20200112633A (ko) * | 2019-03-18 | 2020-10-05 | 알리바바 그룹 홀딩 리미티드 | 합의 시스템 다운타임 복구 |
KR102365793B1 (ko) | 2019-03-18 | 2022-02-21 | 어드밴스드 뉴 테크놀로지스 씨오., 엘티디. | 합의 시스템 다운타임 복구 |
US11347598B2 (en) | 2019-03-18 | 2022-05-31 | Advanced New Technologies Co., Ltd. | Consensus system downtime recovery |
US11126751B2 (en) * | 2019-04-18 | 2021-09-21 | Advanced New Technologies Co., Ltd. | Index creation for data records |
CN111177480A (zh) * | 2019-12-27 | 2020-05-19 | 安徽易商数码科技有限公司 | 一种区块链目录档案系统 |
CN111177480B (zh) * | 2019-12-27 | 2023-05-30 | 安徽易商数码科技有限公司 | 一种区块链目录档案系统 |
CN112559533A (zh) * | 2020-12-23 | 2021-03-26 | 杭州趣链科技有限公司 | 连续型数据库的归档方法、装置及电子设备 |
CN112559533B (zh) * | 2020-12-23 | 2023-06-16 | 杭州趣链科技有限公司 | 连续型数据库的归档方法、装置及电子设备 |
CN113722285A (zh) * | 2021-11-03 | 2021-11-30 | 江苏荣泽信息科技股份有限公司 | 一种基于多链的跨链分布式文件存证系统 |
CN113722285B (zh) * | 2021-11-03 | 2022-02-11 | 江苏荣泽信息科技股份有限公司 | 一种基于多链的跨链分布式文件存证系统 |
CN114595279A (zh) * | 2022-05-06 | 2022-06-07 | 中国信息通信研究院 | 区块链数据的处理方法和装置 |
Also Published As
Publication number | Publication date |
---|---|
SG11201903009PA (en) | 2019-05-30 |
KR20190067158A (ko) | 2019-06-14 |
JP2019532401A (ja) | 2019-11-07 |
CN107423426A (zh) | 2017-12-01 |
CN107423426B (zh) | 2020-06-02 |
US20190146946A1 (en) | 2019-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019024673A1 (zh) | 一种区块链块数据的归档方法、装置及查询方法、装置 | |
US11775392B2 (en) | Indirect replication of a dataset | |
US11520670B2 (en) | Method and apparatus for restoring data from snapshots | |
US20230359644A1 (en) | Cloud-based replication to cloud-external systems | |
CN110249321B (zh) | 用于从分布式数据源中捕获变更数据以供异构目标使用的系统和方法 | |
US11500821B2 (en) | Synchronizing metadata in a data storage platform comprising multiple computer nodes | |
US9195668B2 (en) | Log access method storage control apparatus, archive system, and method of operation | |
US10019323B1 (en) | Method and system for container data recovery in a storage system | |
US10387271B2 (en) | File system storage in cloud using data and metadata merkle trees | |
US11188423B2 (en) | Data processing apparatus and method | |
US10437682B1 (en) | Efficient resource utilization for cross-site deduplication | |
US10929176B2 (en) | Method of efficiently migrating data from one tier to another with suspend and resume capability | |
US11567902B2 (en) | Systems and methods for document search and aggregation with reduced bandwidth and storage demand | |
JP2020506444A (ja) | 期限切れバックアップ処理方法及びバックアップサーバ | |
US10649807B1 (en) | Method to check file data integrity and report inconsistencies with bulk data movement | |
WO2015145661A1 (ja) | ストレージシステム及び重複データ排除方法 | |
US10331362B1 (en) | Adaptive replication for segmentation anchoring type | |
US9361302B1 (en) | Uniform logic replication for DDFS | |
WO2018077092A1 (zh) | 应用于分布式文件系统的存盘方法、装置及分布式文件系统 | |
US20190236161A1 (en) | Using relative generation numbers to deduplicate file system events | |
WO2023151547A1 (zh) | 一种数据处理系统、方法及设备 | |
US20240103977A1 (en) | Distributed and deduplicating file system for storing backup metadata to object storage | |
US20240103976A1 (en) | Distributed and deduplicating file system for storing backup data to object storage | |
US20240143371A1 (en) | Data Deduplication for Replication-Based Migration of Virtual Machines | |
WO2015131492A1 (zh) | 文件分块方法、系统及文件处理系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
ENP | Entry into the national phase |
Ref document number: 2019511774 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20197007136 Country of ref document: KR Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18841241 Country of ref document: EP Kind code of ref document: A1 |