CN113468118B - File increment storage method, device and storage medium based on blockchain - Google Patents

File increment storage method, device and storage medium based on blockchain Download PDF

Info

Publication number
CN113468118B
CN113468118B CN202110514598.6A CN202110514598A CN113468118B CN 113468118 B CN113468118 B CN 113468118B CN 202110514598 A CN202110514598 A CN 202110514598A CN 113468118 B CN113468118 B CN 113468118B
Authority
CN
China
Prior art keywords
file
update list
files
metadata
uploaded
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.)
Active
Application number
CN202110514598.6A
Other languages
Chinese (zh)
Other versions
CN113468118A (en
Inventor
郑子彬
罗少龙
张海勤
胥勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Qianhai Mobile Technology Co ltd
Original Assignee
Shenzhen Qianhai Mobile Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Qianhai Mobile Technology Co ltd filed Critical Shenzhen Qianhai Mobile Technology Co ltd
Priority to CN202110514598.6A priority Critical patent/CN113468118B/en
Publication of CN113468118A publication Critical patent/CN113468118A/en
Application granted granted Critical
Publication of CN113468118B publication Critical patent/CN113468118B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a file increment storage method, a device and a storage medium based on a blockchain, wherein the method comprises the following steps: a user requests to upload a file; judging the type of the uploaded file, if the file is an old file, providing a hash value and block information of a system when the file is in a previous version by a user; the system acquires a file of a previous version from the blockchain network; judging the file type of the previous version of file according to the metadata; collecting a common file and a plurality of incremental update list files to iteratively restore the files; and taking the file subjected to iterative restoration as an old file, taking the file uploaded by a user as a new file, attempting to generate an incremental update list file, packaging metadata outside the generated incremental update list file, marking the file as the incremental update list file, and uploading the packaged file to a blockchain network.

Description

File increment storage method, device and storage medium based on blockchain
Technical Field
The present application relates to the field of blockchain storage technologies, and in particular, to a blockchain-based file incremental storage method, a blockchain-based file incremental storage device, a blockchain-based file incremental storage computer device, and a blockchain-based file incremental storage medium.
Background
Blockchains are serially concatenated literal records (also known as blocks) of content that are cryptographically concatenated and protected. Each block contains a cryptographic hash of the previous block, a corresponding time stamp, and transaction data (typically represented by a hash value calculated using the merck tree algorithm), which is designed to make the contents of the block difficult to tamper with. The distributed ledgers serially connected by blockchain technique enable two parties to record transactions effectively and to check the transactions permanently.
For blockchain systems that are primarily used for file storage, it is desirable to take into account that the user will modify the content in the files that have been uploaded to the system. However, because of the non-tamperable nature of blockchains, uploaded files are often not modifiable anymore, existing systems deal with modifying files by users by simply recreating a new file. Since most of the time, the modification of the file by the user is tiny, the modified part of the user is very small compared with the content of the whole file, and the addition of a file needs to be stored on a plurality of nodes in the system at the same time, which causes the blockchain system to store a large amount of redundant content and wastes storage space and energy. Therefore, it is necessary to optimize the storage mode of the file.
How to solve the above problems is a problem to be solved in the art.
Disclosure of Invention
The application provides a file increment storage method, a device, computer equipment and a storage medium based on a blockchain, so as to reduce the problem of storage space waste.
In a first aspect, the present application provides a blockchain-based file delta storage method, the method comprising:
step S101, a user requests to upload a file;
step S102, judging whether the uploaded file is a new file or a modified old file, if so, entering step S103, and if so, entering step S110;
step S103, the hash value and the block information of the system when the user provides the file of the previous version;
step S104, the system acquires the file of the previous version from the block chain network;
step S105, judging the file type of the previous version of file according to the metadata;
step S106, collecting a common file and a plurality of increment update list files to iteratively restore the files;
step S107, taking the file subjected to iterative restoration as an old file, taking the file uploaded by a user as a new file, attempting to generate an incremental update list file, if the generation is successful, entering step S110, and if the generation is unsuccessful, entering step S108;
step S108, encapsulating metadata outside the generated delta update list file, marking the file as a delta update list file,
step S109, uploading the packaged file to a blockchain network;
step S110, metadata are packaged outside the file uploaded by the user, the file is marked as a common file, and the common file is uploaded to a block chain network;
wherein the metadata includes: the file type marking bit is used for marking the file type, the file type marking bit is divided into two types, namely a common file and an incremental update list file, and the incremental update list file is used for recording the editing operation of a user on the file content.
In a second aspect, the present application also provides a file delta storage device, the device comprising:
the judging unit is used for requesting uploading the file by the user and judging whether the uploaded file is a new file or a modified old file;
the metadata acquisition unit is used for acquiring the file of the previous version from the block chain network according to the hash value and the block information of the system when the user provides the file of the previous version, and judging the file type of the file of the previous version according to the metadata;
the iteration restoring unit is used for collecting a common file and a plurality of increment updating list files so as to iteratively restore the files;
the list generation unit is used for taking the file restored by iteration as an old file, taking the file uploaded by the user as a new file, and attempting to generate an increment update list file;
the encapsulation unit is used for encapsulating metadata outside the generated incremental update list file, marking the file as an incremental update list file, encapsulating metadata outside a new file uploaded by a user, and marking the file as a common file;
and the uploading unit is used for uploading the packaged file to the blockchain network.
In a third aspect, the present application also provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and implement the blockchain-based file delta storage method as described above when the computer program is executed.
In a fourth aspect, the present application also provides a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to implement a blockchain-based file delta storage method as described above.
The application discloses a file increment storage method, device, equipment and storage medium based on a block chain, wherein a user requests to upload a file; judging the type of the uploaded file, if the file is an old file, providing a hash value and block information of a system when the file is in a previous version by a user; the system acquires a file of a previous version from the blockchain network; judging the file type of the previous version of file according to the metadata; collecting a common file and a plurality of incremental update list files to iteratively restore the files; and taking the file subjected to iterative restoration as an old file, taking the file uploaded by a user as a new file, attempting to generate an incremental update list file, packaging metadata outside the generated incremental update list file, marking the file as the incremental update list file, and uploading the packaged file to a blockchain network. The method can reduce the problem of storage space waste.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a blockchain-based file delta storage method provided by an embodiment of the application;
FIG. 2 is a schematic flow chart of generating an incremental update list file provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart of file downloading for a blockchain-based file delta storage method provided by an embodiment of the application;
FIG. 4 is a schematic flow chart of iterative restoration of a blockchain-based file delta storage method provided by an embodiment of the application
FIG. 5 is a schematic block diagram of a file delta storage device according to an embodiment of the present application;
fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
The embodiment of the application provides a file increment storage method, device, computer equipment and storage medium based on a blockchain. The file increment storage method based on the block chain can be applied to a terminal or a server to reduce the problem of storage space waste.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart of a file delta storage method based on a blockchain according to an embodiment of the present application. The method includes steps S101 to S110.
S101, a user requests to upload a file.
The step is preprocessing of file uploading, which is completed under the chain, and when a user needs to upload a file to the blockchain system, the user needs to be added into the blockchain network as a node.
S102, judging whether the uploaded file is a new file or a modified old file, if the uploaded file is the old file, entering the step S103, and if the uploaded file is the new file, entering the step S110.
When a user uploads a file, it is necessary to indicate to the system whether the file is newly created, a file that is not originally in the system, or a file that is generated by modification on a file already in the system.
S103, the user provides the hash value of the system and the information of the block where the hash value is located when the file is in the previous version.
If the user indicates that the file is generated by modifying the existing file, the system can request the hash value and the block information returned by the system when the user uploads a version of the file.
S104, the system acquires the file of the previous version from the blockchain network.
The system may obtain the last version of the file from the blockchain network based on the hash value of the last version of the file and the information of the block in which the last version of the file is located.
S105, judging the file type of the file of the previous version according to the metadata.
The metadata comprises a file type marking bit, a hash value of a previous version file and a block where the previous version file is located. The file type marking bit can be used for judging the file type, the hash value of the previous version file and the block where the previous version file is located, and is used for searching the previous version file by the system during file downloading and generating a finished new file according to an algorithm. The file types include two types, a normal file and an incremental update list file, respectively. The normal file is the original file uploaded by the user, and the incremental update list file is a file automatically generated by the system and is used for recording the editing operation of the user on the file content. If the previous version file is a new file, the file is an incremental update list file, and the system continues to search for the earlier version file until a common file is found. In some embodiments, the file marker bit is represented by a binary bit, with a binary bit of 0 representing a normal file and a binary tiredness of 1 representing an incremental update list file.
S106, collecting a plurality of increment update list files of a common filer so as to iteratively restore the files.
S107, taking the file restored by iteration as an old file, taking the file uploaded by the user as a new file, attempting to generate an incremental update list file, if the generation is successful, proceeding to the step S110, and if the generation is unsuccessful, proceeding to the step S18.
Specifically, a difference threshold is set manually, the difference threshold is the difference between the new file and the old file, if the difference between the new file and the old file is not greater than the difference threshold, the incremental update list file is successfully generated, and if the difference between the new file and the old file is greater than the difference threshold, the incremental update list file is not successfully generated. When the difference file between the new file and the old file is larger than the difference threshold, the generated update list file is large, the space cost and the calculation cost when the new file is generated are high, the new file is not suitable for the current business scene any more, the incremental update list file generation is failed, the system is returned to the original storage mode, and a new copy is generated when the user modifies the file once.
S108, metadata is packaged outside the generated incremental update list file, and the file is marked as the incremental update list file.
The newly uploaded file is marked as an incremental update list file by the file type marking bit of the metadata. The method for packaging metadata is to insert three fields in the header of the file, a file type marking bit, a hash value of the previous version file and a block where the previous version file is located.
S109, uploading the packaged file to a blockchain network.
S110, metadata is packaged outside the file uploaded by the user, the file is marked as a common file, and the common file is uploaded to a blockchain network. The metadata is described above.
According to the incremental storage method provided by the application, when the newly uploaded file is a modified file (the modification of the file by a user is tiny, compared with the whole file content, the modification of the user is very little), only the incremental difference list is needed to be uploaded, the new file is not needed to be uploaded, and the problem of resource waste of redundant storage is solved.
Since the blockchain-based file delta storage method can be applied to a terminal or a server, the trained model needs to be stored in the terminal or the server. The terminal can be electronic equipment such as a mobile phone, a tablet personal computer, a notebook computer, a desktop computer, a personal digital assistant, wearable equipment and the like; the servers may be independent servers or may be server clusters.
If the method is applied to the terminal, in order to ensure the normal operation of the terminal and store files, the model obtained through training is also required to be compressed, and the model after the compression is stored in the terminal.
The compression processing specifically comprises pruning processing, quantization processing, huffman coding processing and the like on the model so as to reduce the size of the model, and further facilitate the storage in a terminal with smaller capacity.
Referring to fig. 2, generating the incremental update list file includes steps S1071-S1072.
S1071, after the system obtains the old file and the file to be uploaded, comparing the difference between the content of the file to be uploaded and the content of the old file through a Levenstat distance algorithm, and obtaining an LD matrix.
Among them, the levenstein distance (Levenshtein Distance) algorithm is simply called LD algorithm.
S1072, when the difference is smaller than a set difference threshold, obtaining a matching string of the old file and the file to be uploaded through backtracking the LD matrix, and then traversing the matching string to generate an update list.
All differences between the file to be uploaded and the old file are recorded in the list, and how to obtain a new file by adding, replacing and deleting characters step by step on the basis of the old file. Therefore, the new file is not required to be stored, only the increment update list file is required to be stored, and under the condition of small threshold value, the new file can be efficiently generated through the old file and the increment update list file, so that the storage space is saved.
In an alternative embodiment, the pseudo code of the process of generating the delta update list file is as follows.
Reading edited file content new_file and old file content old_file
Calculating edit distance d between new_file and old_file by LD algorithm to obtain LD matrix a
If d > length (old_file) file content variance threshold e then return failure
Referring to fig. 3, the incremental storing method of a file based on a blockchain according to an embodiment of the present application further includes downloading the file. Downloading the file includes steps S201-S209.
S201, a user requests to download a file.
S202, downloading the file, releasing the file encapsulation, and obtaining the metadata and the unencapsulated file.
S203, judging the file type according to the metadata, if the file is a common file, entering step S204, and if the file is an incremental update list file, entering step S205.
S204, providing the unpackaged file to a user.
S205, searching and downloading the file of the previous version in the blockchain network according to the hash value of the file of the previous version in the metadata and the block information.
S206, judging the file type of the file of the previous version according to the metadata, if the file is a common file, entering step S207, and if the file is an incremental update list file, entering S206 again.
If the file type flag bit in the metadata indicates that the file is an incremental update list file, no direct file may be provided to the user. The system retrieves and downloads the previous version of the file in the blockchain network based on the previous version of the file hash value and the block information in the metadata and checks the file type of the file. If it is still a delta file list file, the process is repeated, continuing to find the last version of the file, until a normal file is found.
S207, collecting a common file and a plurality of files of the previous version, and iteratively restoring the files.
S208, providing the file obtained by iteratively restoring the file for a user.
Referring to fig. 4, the iterative recovery file includes steps S301-S305.
S301, numbering a common file and a plurality of increment update list files as 1 to n in sequence.
S302, judging whether the number of the remaining files is larger than 1, and if so, judging that the number of the remaining files is larger than 1.
S303, if the residual files are larger than 1, a file is generated by taking the common file with the number of 1 and the incremental update list file.
S304, removing the common file, the increment update list file and the serial numbers thereof, numbering the generated file as 1, and reducing the serial numbers of all other files by 1.
And S305, if the number of the remaining files is not more than 1, taking the remaining 1 file as a successfully restored file.
Specifically, the inputs to the iterative restore file process are a normal file and 0 or more delta update list files. The process first numbers the files, the common file number is 1, and the incremental update list files (if any) are numbered 2,3, …, n in sequence. Subsequently, the normal file with the number 1 and the incremental update list file with the number 2 are taken out, and a new file is generated from the two files, and the process of generating the file is shown in the following pseudo code. After the generation, the normal file and the incremental update list file, and their numbers, are removed from the input, the generated file is numbered 1, and the numbers of all other files are reduced by 1. This process is repeated until one file remains, and the file is taken as a successfully restored file and output.
In an alternative embodiment, the pseudo code of the process of generating a file from a normal file and an incremental update list is as follows.
Referring to fig. 5, fig. 5 is a schematic block diagram of a file delta storage device according to an embodiment of the present application, where the device may be configured in a server to perform the above-described file delta storage method based on blockchain. The apparatus 400 comprises: a determination unit 401, a metadata acquisition unit 402, an iterative restoration unit 403, a list generation unit 404, a model training unit packaging unit 405, and an uploading unit 406.
A determining unit 401, configured to request the user to upload a file, and determine whether the uploaded file is a new file or a modified old file;
a metadata obtaining unit 402, configured to obtain, according to a hash value and block information of a system when the user provides a previous version of file, the previous version of file from the blockchain network, and determine a file type of the previous version of file according to metadata;
an iterative restoring unit 403, configured to collect a common file and a plurality of incremental update list files, so as to iteratively restore the files;
a list generating unit 404, configured to take the iteratively restored file as an old file, and the file uploaded by the user as a new file, and attempt to generate an incremental update list file;
the packaging unit 405 is configured to package metadata outside the generated incremental update list file, mark the file as an incremental update list file, package metadata outside a new file uploaded by a user, and mark the file as a common file;
an uploading unit 406, configured to upload the encapsulated file to the blockchain network.
It should be noted that, for convenience and brevity of description, the specific working process of the apparatus and each unit described above may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 6.
Referring to fig. 6, fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server or a terminal.
With reference to FIG. 6, the computer device includes a processor, memory, and a network interface connected by a system bus, where the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any of a number of blockchain-based file delta storage methods.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by a processor, causes the processor to perform any of a number of blockchain-based file delta storage methods.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
step S101, a user requests to upload a file;
step S102, judging whether the uploaded file is a new file or a modified old file, if so, entering step S103, and if so, entering step S110;
step S103, the hash value and the block information of the system when the user provides the file of the previous version;
step S104, the system acquires the file of the previous version from the block chain network;
step S105, judging the file type of the previous version of file according to the metadata;
step S106, collecting a common file and a plurality of increment update list files to iteratively restore the files;
step S107, taking the file subjected to iterative restoration as an old file, taking the file uploaded by a user as a new file, attempting to generate an incremental update list file, if the generation is successful, entering step S110, and if the generation is unsuccessful, entering step S108;
step S108, encapsulating metadata outside the generated delta update list file, marking the file as a delta update list file,
step S109, uploading the packaged file to a blockchain network;
step S110, metadata are packaged outside the file uploaded by the user, the file is marked as a common file, and the common file is uploaded to a block chain network;
wherein the metadata includes: the file type marking bit is used for marking the file type, the file type marking bit is divided into two types, namely a common file and an incremental update list file, and the incremental update list file is used for recording the editing operation of a user on the file content.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize any blockchain-based file incremental storage method provided by the embodiment of the application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (7)

1. A method for incremental storage of files, comprising: step S101, a user requests to upload a file; step S102, judging whether the uploaded file is a new file or a modified old file, if so, entering step S103, and if so, entering step S110; step S103, the hash value and the block information of the system when the user provides the file of the previous version; step S104, the system acquires the file of the previous version from the block chain network; step S105, judging the file type of the previous version of file according to the metadata; step S106, collecting a common file and a plurality of increment update list files to iteratively restore the files; step S107, taking the file subjected to iterative restoration as an old file, taking the file uploaded by a user as a new file, attempting to generate an incremental update list file, if the generation is successful, entering step S110, and if the generation is unsuccessful, entering step S108; step S108, metadata are packaged outside the generated incremental update list file, the file is marked as an incremental update list file, and step S109, the packaged file is uploaded to a blockchain network; step S110, metadata are packaged outside the file uploaded by the user, the file is marked as a common file, and the common file is uploaded to a block chain network; wherein the metadata includes: the file type marking bit is used for marking file types, the file types are divided into two types, namely a common file and an incremental update list file, and the incremental update list file is used for recording editing operation of a user on file content;
the iterative recovery file comprises: step S301, numbering a common file and a plurality of increment update list files as 1 to n in sequence; step S302, whether the number of the residual files is larger than 1; step S303, if the residual files are larger than 1, a file is generated by taking the common file with the number of 1 and the incremental update list file; step S304, removing the common file, the increment update list file and the serial numbers thereof, numbering the generated file as 1, and reducing the serial numbers of all other files by 1; and step S305, if the number of the remaining files is not more than 1, taking the remaining 1 file as a successfully restored file.
2. The method of claim 1, wherein generating the delta update list file comprises: after the system obtains the old file and the file to be uploaded, comparing the difference between the content of the file to be uploaded and the content of the old file by using a Leventan distance algorithm to obtain an LD matrix; when the difference is smaller than the set difference threshold, a matching string of the old file and the file to be uploaded is obtained through backtracking the LD matrix, and then the matching string is traversed to generate an update list.
3. The incremental storage method of claim 1 further comprising a file download, the file download comprising: step S201, a user requests to download a file; step S202, downloading files and releasing file encapsulation to obtain metadata and unencapsulated files; step S203, judging the file type according to the metadata, if the file is a common file, entering step S204, and if the file is an incremental update list file, entering step S205; step S204, providing the unpackaged file to a user; step S205, searching and downloading the file of the previous version in the blockchain network according to the hash value of the file of the previous version in the metadata and the block information; step S206, judging the file type of the file of the previous version according to the metadata, if the file is a common file, entering step S207, and if the file is an incremental file, returning to step S205; step S207, collecting a common file and a plurality of files of the previous version, and iteratively restoring the files; step S208, providing the file obtained by iteratively restoring the file for the user.
4. The incremental storage method of claim 1 wherein the file type flag bit is a binary bit.
5. A file delta storage device, comprising: the judging unit is used for requesting uploading the file by the user and judging whether the uploaded file is a new file or a modified old file; the metadata acquisition unit is used for acquiring the file of the previous version from the block chain network according to the hash value and the block information of the system when the user provides the file of the previous version, and judging the file type of the file of the previous version according to the metadata; the iteration restoring unit is used for collecting a common file and a plurality of increment updating list files so as to iteratively restore the files; the list generation unit is used for taking the file restored by iteration as an old file, taking the file uploaded by the user as a new file, and attempting to generate an increment update list file; the encapsulation unit is used for encapsulating metadata outside the generated incremental update list file, marking the file as an incremental update list file, encapsulating metadata outside a new file uploaded by a user, and marking the file as a common file; and the uploading unit is used for uploading the packaged file to the blockchain network.
6. A computer device, the computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor being configured to execute the computer program and to implement the file delta storage method according to any one of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the file delta storage method according to any one of claims 1 to 4.
CN202110514598.6A 2021-05-11 2021-05-11 File increment storage method, device and storage medium based on blockchain Active CN113468118B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110514598.6A CN113468118B (en) 2021-05-11 2021-05-11 File increment storage method, device and storage medium based on blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110514598.6A CN113468118B (en) 2021-05-11 2021-05-11 File increment storage method, device and storage medium based on blockchain

Publications (2)

Publication Number Publication Date
CN113468118A CN113468118A (en) 2021-10-01
CN113468118B true CN113468118B (en) 2023-09-22

Family

ID=77870805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110514598.6A Active CN113468118B (en) 2021-05-11 2021-05-11 File increment storage method, device and storage medium based on blockchain

Country Status (1)

Country Link
CN (1) CN113468118B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114867046B (en) * 2022-07-06 2022-09-13 深圳市乙辰科技股份有限公司 Wireless network equipment firmware updating method and wireless network equipment
CN117033738B (en) * 2023-10-07 2023-12-08 广东省信息工程有限公司 Digital file management method and system based on blockchain

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108364242A (en) * 2018-01-31 2018-08-03 北京安妮全版权科技发展有限公司 The copyright for preserving intermediate file really weighs method and device
CN110298194A (en) * 2019-06-11 2019-10-01 阿里巴巴集团控股有限公司 Document handling method, device, equipment and storage medium based on block chain
CN110381072A (en) * 2018-10-11 2019-10-25 腾讯科技(深圳)有限公司 Data verification method, system and computer readable storage medium based on block chain
CN110673985A (en) * 2019-09-20 2020-01-10 深圳创维-Rgb电子有限公司 Method for automatically backing up version library, storage medium and server
CN111598536A (en) * 2020-05-07 2020-08-28 贵州省邮电规划设计院有限公司 Government affair data early warning monitoring system based on keyless signature block chain technology
CN112445769A (en) * 2020-11-24 2021-03-05 杭州趣链科技有限公司 Block chain-based on-chain storage method and device, terminal equipment and medium
CN112699081A (en) * 2020-10-23 2021-04-23 中国工商银行股份有限公司 File self-certification method and device based on block chain

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10719771B2 (en) * 2016-11-09 2020-07-21 Cognitive Scale, Inc. Method for cognitive information processing using a cognitive blockchain architecture
US10726342B2 (en) * 2016-11-09 2020-07-28 Cognitive Scale, Inc. Cognitive information processing using a cognitive blockchain architecture
US20210029163A1 (en) * 2019-07-24 2021-01-28 International Business Machines Corporation Security layer for configuring blockchain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108364242A (en) * 2018-01-31 2018-08-03 北京安妮全版权科技发展有限公司 The copyright for preserving intermediate file really weighs method and device
CN110381072A (en) * 2018-10-11 2019-10-25 腾讯科技(深圳)有限公司 Data verification method, system and computer readable storage medium based on block chain
CN110298194A (en) * 2019-06-11 2019-10-01 阿里巴巴集团控股有限公司 Document handling method, device, equipment and storage medium based on block chain
CN110673985A (en) * 2019-09-20 2020-01-10 深圳创维-Rgb电子有限公司 Method for automatically backing up version library, storage medium and server
CN111598536A (en) * 2020-05-07 2020-08-28 贵州省邮电规划设计院有限公司 Government affair data early warning monitoring system based on keyless signature block chain technology
CN112699081A (en) * 2020-10-23 2021-04-23 中国工商银行股份有限公司 File self-certification method and device based on block chain
CN112445769A (en) * 2020-11-24 2021-03-05 杭州趣链科技有限公司 Block chain-based on-chain storage method and device, terminal equipment and medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
prototype of running clinical trials in an untrustworthy environment using blockchain;Daniel R Wong等;nature communications;第10卷(第1期);1-10 *
区块链技术下数字版权保护的机遇、挑战与发展路径;赖利娜;李永明;;法治研究(第04期);127-135 *
基于区块链技术的QMS运行有效性提升研究;马忠民;;中国质量与标准导报(第02期);60-63 *

Also Published As

Publication number Publication date
CN113468118A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN113468118B (en) File increment storage method, device and storage medium based on blockchain
CN111444196B (en) Method, device and equipment for generating Hash of global state in block chain type account book
EP3449372B1 (en) Fault-tolerant enterprise object storage system for small objects
CN109522305B (en) Big data deduplication method and device
CN102624545A (en) Data backup method, data backup device, data recovery method and data recovery device of network management system
CN108133026B (en) Multi-data processing method, system and storage medium
CN112506941B (en) Processing method and device for checking point, electronic equipment and storage medium
CN113535563A (en) Test case duplication removing method and device, computer equipment and storage medium
CN111143461A (en) Mapping relation processing system and method and electronic equipment
CN111444194B (en) Method, device and equipment for clearing indexes in block chain type account book
CN115858471A (en) Service data change recording method, device, computer equipment and medium
CN110990640B (en) Data determination method, device, equipment and computer readable storage medium
CN113535470A (en) Configuration backup method and device, electronic equipment and storage medium
CN110636042B (en) Method, device and equipment for updating verified block height of server
CN113505153A (en) Memorandum backup method based on iOS system and related equipment
CN112596959A (en) Distributed storage cluster data backup method and device
CN111949738A (en) Block chain-based data storage deduplication method, terminal device and storage medium
CN111625186B (en) Data processing method, device, electronic equipment and storage medium
CN113407508B (en) Method, system, equipment and medium for compressing log file
CN110109883B (en) File filtering and storing method and device
CN112529759B (en) Document processing method, apparatus, device, storage medium, and computer program product
CN112733210B (en) Equipment identifier obtaining method and device and computer readable storage medium
CN111444195B (en) Method, device and equipment for clearing indexes in block chain type account book
CN112035471B (en) Transaction processing method and computer equipment
CN111309516B (en) Method for recovering management data of intelligent household equipment and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Zheng Zibin

Inventor after: Luo Shaolong

Inventor after: Zhang Haiqin

Inventor after: Xu Yong

Inventor before: Luo Shaolong

Inventor before: Xu Yong

Inventor before: Zhang Haiqin

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant