CN113468118A - File increment storage method and device, computer equipment and storage medium - Google Patents

File increment storage method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113468118A
CN113468118A CN202110514598.6A CN202110514598A CN113468118A CN 113468118 A CN113468118 A CN 113468118A CN 202110514598 A CN202110514598 A CN 202110514598A CN 113468118 A CN113468118 A CN 113468118A
Authority
CN
China
Prior art keywords
file
files
user
uploaded
metadata
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110514598.6A
Other languages
Chinese (zh)
Other versions
CN113468118B (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

Images

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 invention discloses a file increment storage method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: a user requests to upload a file; judging the type of the uploaded file, and if the file is an old file, providing a hash value of a system and information of a block where the file is located when the file is a last version by a user; the system acquires a previous version of the file from the blockchain network; judging the file type of the previous edition file according to the metadata; collecting a common file and a plurality of incremental update list files to iteratively restore the file; and taking the file subjected to iterative reduction as an old file, taking the file uploaded by a user as a new file, trying to generate an increment updating list file, packaging metadata outside the generated increment updating list file, marking the file as the increment updating list file, and uploading the packaged file to a block chain network.

Description

File increment storage method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of block chain storage technologies, and in particular, to a file incremental storage method and apparatus, a computer device, and a storage medium.
Background
The block chain is a concatenated text record (also called a block) cryptographically concatenated and protected with content. Each block contains the cryptographic hash of the previous block, the corresponding time stamp, and transaction data (typically represented by hash values computed using the Merkle tree algorithm), which makes the contents of the block tamper-resistant. The distributed account book concatenated by the block chain technology can effectively record the transaction by two parties and permanently check the transaction.
For a blockchain system whose primary use is 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 uploaded files are generally not modifiable due to the non-tamperable nature of blockchains, existing systems simply recreate a new file by modifying the file by the user. Since most of the time, the modification of the file by the user is slight, compared with the content of the whole file, the modified part of the user is very little, and in addition, one file needs to be stored on a plurality of nodes in the system at the same time, the situation causes that the blockchain system stores a large amount of redundant content, and the storage space and energy are wasted. Therefore, it is necessary to optimize the way files are stored.
How to solve the above problems is a problem to be solved urgently in the field.
Disclosure of Invention
The application provides a file increment storage method and device, computer equipment and a storage medium, so as to reduce the problem of storage space waste.
In a first aspect, the present application provides a file incremental storage method, where the method includes:
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 the uploaded file is the old file, entering step S103, and if the uploaded file is the new file, entering step S110;
step S103, providing the hash value of the system and the block information of the system when the user last edition file;
s104, the system acquires a previous version of the file from the block chain network;
step S105, judging the file type of the previous edition file according to the metadata;
s106, collecting a common file and a plurality of incremental update list files to iteratively restore the file;
step S107, taking the file subjected to iterative reduction as an old file, taking the file uploaded by a user as a new file, trying to generate an increment updating list file, if the generation is successful, entering step S110, and if the generation is unsuccessful, entering step S108;
step S108, packaging metadata outside the generated incremental update list file, marking the file as an incremental update list file,
step S109, uploading the packaged file to a block chain network;
step S110, packaging metadata outside the file uploaded by the user, marking the file as a common file, and uploading the common file to a block chain network;
wherein the metadata includes: the file type marking bits are used for marking file types, the file types are divided into two types, namely a common file and an increment updating list file, and the increment updating list file is used for recording editing operation of a user on file contents.
In a second aspect, the present application further provides a file incremental storage apparatus, including:
the judging unit is used for requesting to upload the file by a 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 iterative reduction unit is used for collecting a common file and a plurality of increment updating list files so as to iteratively reduce the files;
the list generating unit is used for trying to generate an increment updating list file by taking the file subjected to iterative reduction as an old file and the file uploaded by a user as a new file;
the packaging unit is used for packaging metadata outside the generated incremental update list file, marking the file as the incremental update list file, packaging the metadata outside the 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 block chain network.
In a third aspect, the present application further provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program and realizing the file increment storage method when the computer program is executed.
In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the processor is caused to implement the file incremental storage method as described above.
The application discloses a file increment storage method, a device, equipment and a storage medium, wherein a file is uploaded by a user request; judging the type of the uploaded file, and if the file is an old file, providing a hash value of a system and information of a block where the file is located when the file is a last version by a user; the system acquires a previous version of the file from the blockchain network; judging the file type of the previous edition file according to the metadata; collecting a common file and a plurality of incremental update list files to iteratively restore the file; and taking the file subjected to iterative reduction as an old file, taking the file uploaded by a user as a new file, trying to generate an increment updating list file, packaging metadata outside the generated increment updating list file, marking the file as the increment updating list file, and uploading the packaged file to a block chain network. The method can reduce the problem of waste of storage space.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a file incremental storage method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of generating an incremental update list file as provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart of file downloading of a file incremental storage method provided by an embodiment of the present application;
FIG. 4 is a schematic flowchart of iterative restoration of a file incremental storage method provided by an embodiment of the present application
FIG. 5 is a schematic block diagram of a file incremental storage apparatus provided in 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 technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The embodiment of the application provides a file increment storage method and device, computer equipment and a storage medium. The file increment storage method can be applied to a terminal or a server to reduce the problem of waste of storage space.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart of a file incremental storage method 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 the 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 used as a node to join the blockchain network.
S102, judging whether the uploaded file is a new file or a modified old file, if the uploaded file is the new file, the step S103 is executed, and if the uploaded file is the new file, the step S110 is executed.
When a user uploads a file, it is necessary to indicate to the system whether the file is new, a file that the system does not have originally, or a file that results from a modification of an existing file in the system.
S103, providing the hash value of the system and the information of the block when the file is in the last edition by the user.
If the user indicates that the file is generated by modifying an existing file, the system will require the hash value and the block information returned by the system when the user uploads a version file.
And S104, the system acquires the file of the previous version from the block chain network.
The system can obtain the file of the previous version from the blockchain network according to the hash value of the file of the previous version and the information of the block where the file is located.
And S105, judging the file type of the previous edition file according to the metadata.
The metadata comprises a file type mark bit, a hash value of a previous version file and a block where the previous version file is located. The file type mark bit can be used for judging the file type, the hash value of the previous version of the file and the block where the previous version of the file is located, and is used for searching the previous version of the file by the system when the file is downloaded, and generating a finished new file according to an algorithm. The file types include two types, which are a normal file and an incremental update list file. The normal file is an original file uploaded by a user, and the incremental update list file is a file automatically generated by the system and used for recording the editing operation of the user on the file content. If the previous version of the file is a new file, the file is an incrementally updated list file, and the system will continue to search for an earlier version of the file until a common file is found. In some embodiments, the file flag bit is represented by a binary bit, a binary bit of 0 represents a normal file, and a binary bit of 1 represents an incremental update list file.
And S106, collecting a plurality of increment updating list files of a common file worker to iteratively restore the files.
And S107, taking the file subjected to iterative reduction as an old file, taking the file uploaded by the user as a new file, trying to generate an increment updating list file, if the generation is successful, entering the step S110, and if the generation is unsuccessful, entering the step S18.
Specifically, a difference threshold value is manually set, the difference threshold value is the difference between the new file and the old file, if the difference between the new file and the old file is not larger than the difference threshold value, the incremental update list file is successfully generated, and if the difference between the new file and the old file is larger than the difference threshold value, 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 value, the generated update list file is large, the space cost and the calculation cost when the new file is generated are higher, the update list file is not suitable for the current service scene any more, the generation of the incremental update list file fails at the moment, the system returns to the original storage mode, and at the moment, a new copy is generated after the user modifies the file once.
S108, packaging metadata outside the generated incremental update list file, and marking the file as an incremental update list file.
And marking the newly uploaded file as an incremental update list file through a file type marking bit of the metadata. The method for encapsulating the metadata is to insert three fields into the header of the file, namely a file type marking bit, a hash value of a previous version of the file and a block where the previous version of the file is located.
And S109, uploading the packaged file to a block chain network.
And S110, encapsulating metadata outside the file uploaded by the user, marking the file as a common file, and uploading the common file to a block chain network. Metadata please refer to the above.
According to the incremental storage method provided by the invention, when the newly uploaded file is a modified file (the modification of the file by a user is small, and compared with the content of the whole file, the modification part of the user is very little), only the incremental difference list needs to be uploaded, and the new file does not need to be uploaded, so that the problem that the resource is wasted by redundant storage is solved.
Since the file incremental storage method can be applied to a terminal or a server, the trained model needs to be saved in the terminal or the server. The terminal can be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and a wearable device; the servers may be independent servers or server clusters.
If the method is applied to the terminal, in order to ensure the normal operation of the terminal and the file storage, the model obtained by training needs to be compressed, and the compressed model is stored in the terminal.
The compression processing specifically includes pruning, quantization, huffman coding and the like on the model to reduce the size of the model, so that the model can be conveniently stored in a terminal with smaller capacity.
Referring to fig. 2, generating the incremental update list file includes steps and S1071-S1072.
S1071, after the old file and the file to be uploaded are obtained by the system, the difference between the content of the file to be uploaded and the content of the old file is compared through a Levensstein distance algorithm, and an LD matrix is obtained.
Among them, the Levenshtein Distance (Levenshtein Distance) algorithm is abbreviated as LD algorithm.
S1072, when the difference is smaller than the set difference threshold value, obtaining a matching string of the old file and the file to be uploaded by backtracking the LD matrix, and traversing the matching string to generate an updating list.
All differences between the files to be uploaded and the old files are recorded in the list, and how to obtain the new files by adding, replacing and deleting characters on the basis of the old files step by step. Therefore, the new file does not need to be stored, only the incremental update list file needs to be stored, and the new file can be generated by the old file and the incremental update list file efficiently under the condition of smaller threshold value, so that the storage space is saved.
In an alternative embodiment, the pseudo code for the process of generating the delta update list file is as follows.
Figure BDA0003059606420000061
Figure BDA0003059606420000071
Referring to fig. 3, the method for incrementally storing a file according to the embodiment of the present application further includes downloading the file. The downloading of the file includes steps S201 to S209.
S201, a user requests to download a file.
S202, downloading the file, removing the file package, and obtaining metadata and the unpacked file.
S203, judging the file type according to the metadata, if the file type is a common file, entering the step S204, and if the file type is an incremental update list file, entering the step S205.
And S204, providing the unpackaged file to a user.
S205, retrieving and downloading the file of the previous version in the blockchain network according to the file hash value of the previous version and the blockchain information in the metadata.
S206, judging the file type of the file of the previous version according to the metadata, if the file is a common file, entering the step S207, and if the file is an incremental update list file, entering the step 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 will retrieve and download the previous version of the file in the blockchain network based on the previous version of the file hash value and the blockchain information in the metadata, and check the file type of the file. If the file is still an incremental file list file, the process is repeated, and the file of the last version of the file is continuously searched until a normal file is found.
S207, collecting a common file and a plurality of files of previous versions, and iteratively restoring the files.
And S208, providing the file obtained by iteratively restoring the file to the user.
Referring to FIG. 4, the iterative restore file includes steps S301-S305.
S301, numbering a common file and a plurality of incremental update list files from 1 to n in sequence.
S302, judging whether the number of the residual files is larger than 1 or not, and if so, judging whether the number of the residual files is larger than 1.
And S303, if the residual files are larger than 1, generating a file by taking the common file with the number of 1 and the incremental updating list file.
S304, removing the common files and the incremental update list files and the numbers thereof, numbering the generated files as 1, and reducing the numbers of all other files by 1.
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 process of restoring a file are a normal file and 0 or more delta update list files. The process first numbers the files, with the common file numbered 1, and the incremental update list files (if any) numbered 2,3, …, n in sequence. Subsequently, the normal file numbered 1 and the incremental update list file numbered 2 are fetched, and a new file is generated from the two files, and the process of generating the files is shown in the following pseudo code. After generation, the normal file and the incremental update list file, as well as their numbers, are removed from the input, the generated file is numbered 1, and the numbers of all other files are decremented by 1. This process is repeated until one file remains, which is taken as a successfully restored file and output.
In an alternative embodiment, the pseudo code for the process of generating a file from a normal file and a delta update list is as follows.
Figure BDA0003059606420000081
Figure BDA0003059606420000091
Referring to fig. 5, fig. 5 is a schematic block diagram of a file incremental storage apparatus according to an embodiment of the present application, where the apparatus may be configured in a server for executing the file incremental storage method. The apparatus 400, comprising: the device 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 a 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 the system when the user provides the previous version of the file, a file of the previous version from the blockchain network, and determine a file type of the previous version of the file according to the 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 file;
a list generating unit 404, configured to use the iteratively restored file as an old file, use a file uploaded by a user as a new file, and attempt to generate an incremental update list file;
an encapsulating unit 405, configured to encapsulate metadata outside the generated incremental update list file, mark the file as an incremental update list file, encapsulate metadata outside a new file uploaded by a user, and mark the file as a normal file;
and an uploading unit 406, configured to upload the encapsulated file to the blockchain network.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the units described above may refer to the corresponding processes in the foregoing method embodiments, and are 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 disclosure. The computer device may be a server or a terminal.
Referring to fig. 6, the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a nonvolatile 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 one of the file incremental storage methods.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by a processor, causes the processor to perform any of the file incremental storage methods.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a 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 execute 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 the uploaded file is the old file, entering step S103, and if the uploaded file is the new file, entering step S110;
step S103, providing the hash value of the system and the block information of the system when the user last edition file;
s104, the system acquires a previous version of the file from the block chain network;
step S105, judging the file type of the previous edition file according to the metadata;
s106, collecting a common file and a plurality of incremental update list files to iteratively restore the file;
step S107, taking the file subjected to iterative reduction as an old file, taking the file uploaded by a user as a new file, trying to generate an increment updating list file, if the generation is successful, entering step S110, and if the generation is unsuccessful, entering step S108;
step S108, packaging metadata outside the generated incremental update list file, marking the file as an incremental update list file,
step S109, uploading the packaged file to a block chain network;
step S110, packaging metadata outside the file uploaded by the user, marking the file as a common file, and uploading the common file to a block chain network;
wherein the metadata includes: the file type marking bits are used for marking file types, the file types are divided into two types, namely a common file and an increment updating list file, and the increment updating list file is used for recording editing operation of a user on file contents.
The embodiment of the application further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, the computer program comprises program instructions, and the processor executes the program instructions to implement any one of the file incremental storage methods provided by the embodiment of the application.
The computer-readable storage medium may be an internal storage unit of the computer device described in 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), and the like provided on the computer device.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A file incremental storage method is characterized by comprising the following steps:
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 the uploaded file is the old file, entering step S103, and if the uploaded file is the new file, entering step S110;
step S103, providing the hash value of the system and the block information of the system when the user last edition file;
s104, the system acquires a previous version of the file from the block chain network;
step S105, judging the file type of the previous edition file according to the metadata;
s106, collecting a common file and a plurality of incremental update list files to iteratively restore the file;
step S107, taking the file subjected to iterative reduction as an old file, taking the file uploaded by a user as a new file, trying to generate an increment updating list file, if the generation is successful, entering step S110, and if the generation is unsuccessful, entering step S108;
step S108, packaging metadata outside the generated incremental update list file, marking the file as an incremental update list file,
step S109, uploading the packaged file to a block chain network;
step S110, packaging metadata outside the file uploaded by the user, marking the file as a common file, and uploading the common file to a block chain network;
wherein the metadata includes: the file type marking bits are used for marking file types, the file types are divided into two types, namely a common file and an increment updating list file, and the increment updating list file is used for recording editing operation of a user on file contents.
2. The method for incremental storage of files according to claim 1, wherein said generating an incremental 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 through a Levenstein distance algorithm to obtain an LD matrix;
and when the difference is smaller than the set difference threshold value, obtaining a matching string of the old file and the file to be uploaded by backtracking the LD matrix, and traversing the matching string to generate an updated list.
3. The method of claim 1, wherein iteratively restoring the file comprises:
s301, numbering a common file and a plurality of incremental update list files from 1 to n in sequence;
step S302, whether the number of the residual files is more than 1 or not;
step S303, if the residual files are larger than 1, a common file with the number of 1 and the incremental updating list file are taken to generate a file;
step S304, removing the common files and the incremental update list files and the numbers thereof, numbering the generated files as 1, and reducing the 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 file successfully restored.
4. The method for incremental storage of files according to claim 1, further comprising file downloading, wherein the file downloading comprises:
step S201, a user requests to download a file;
step S202, downloading the file, removing the file package, and obtaining metadata and unpackaged files;
step S203, judging the file type according to the metadata, if the file type is a common file, entering step S204, and if the file type is an incremental update list file, entering step S205;
step S204, providing the unpackaged files to a user;
step S205, retrieving and downloading the file of the previous version in the blockchain network according to the file hash value of the previous version and the block information in the metadata;
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 previous versions, and iteratively restoring the files;
and step S208, providing the file obtained by iteratively restoring the file to the user.
5. The method for incremental storage of files according to claim 1, wherein said file type flag bit is a binary bit.
6. A file incremental storage apparatus, comprising:
the judging unit is used for requesting to upload the file by a 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 iterative reduction unit is used for collecting a common file and a plurality of increment updating list files so as to iteratively reduce the files;
the list generating unit is used for trying to generate an increment updating list file by taking the file subjected to iterative reduction as an old file and the file uploaded by a user as a new file;
the packaging unit is used for packaging metadata outside the generated incremental update list file, marking the file as the incremental update list file, packaging the metadata outside the 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 block chain network.
7. A computer device, wherein the computer device comprises a memory and a processor;
the memory is used for storing a computer program;
the processor is used for executing the computer program and realizing the file incremental storage method according to any one of claims 1 to 5 when the computer program is executed.
8. 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 incremental storage method of any one of claims 1 to 5.
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 true CN113468118A (en) 2021-10-01
CN113468118B 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)

Cited By (2)

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

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180129945A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. Method for Cognitive Information Processing Using a Cognitive Blockchain Architecture
US20180129952A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. Cognitive Information Processing Using a Cognitive Blockchain Architecture
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
US20210029163A1 (en) * 2019-07-24 2021-01-28 International Business Machines Corporation Security layer for configuring blockchain
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

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180129945A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. Method for Cognitive Information Processing Using a Cognitive Blockchain Architecture
US20180129952A1 (en) * 2016-11-09 2018-05-10 Cognitive Scale, Inc. Cognitive Information Processing Using a Cognitive Blockchain Architecture
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
US20210029163A1 (en) * 2019-07-24 2021-01-28 International Business Machines Corporation Security layer for configuring blockchain
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
DANIEL R WONG等: "prototype of running clinical trials in an untrustworthy environment using blockchain", NATURE COMMUNICATIONS, vol. 10, no. 1, pages 1 - 10, XP055916862, DOI: 10.1038/s41467-019-08874-y *
赖利娜;李永明;: "区块链技术下数字版权保护的机遇、挑战与发展路径", 法治研究, no. 04, pages 127 - 135 *
马忠民;: "基于区块链技术的QMS运行有效性提升研究", 中国质量与标准导报, no. 02, pages 60 - 63 *

Cited By (3)

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

Also Published As

Publication number Publication date
CN113468118B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN113468118B (en) File increment storage method, device and storage medium based on blockchain
US20160196188A1 (en) Failure recovery of a task state in batch-based stream processing
CN110620657A (en) Webpage word processing method, system and device
CN110597814A (en) Structured data serialization and deserialization method and device
CN111177121A (en) Order data feedback method and device, computer equipment and storage medium
CN102624545A (en) Data backup method, data backup device, data recovery method and data recovery device of network management system
CN113535563A (en) Test case duplication removing method and device, computer equipment and storage medium
WO2017189597A1 (en) Fault-tolerant enterprise object storage system for small objects
CN113918437A (en) User behavior data analysis method and device, computer equipment and storage medium
US9710337B1 (en) Systems and methods for restoring web parts in content management systems
CN112529759A (en) Document processing method, device, equipment, storage medium and computer program product
US10311021B1 (en) Systems and methods for indexing backup file metadata
CN109271431B (en) Data extraction method, device, computer equipment and storage medium
CN112748866A (en) Method and device for processing incremental index data
CN115858471A (en) Service data change recording method, device, computer equipment and medium
CN111444194B (en) Method, device and equipment for clearing indexes in block chain type account book
CN109542893B (en) Composite data structure setting method based on programming language and electronic equipment
WO2021114101A1 (en) Method and apparatus for incremental update of file, and terminal and computer-readable storage medium
CN110636042B (en) Method, device and equipment for updating verified block height of server
CN111949738A (en) Block chain-based data storage deduplication method, terminal device and storage medium
CN113760600A (en) Database backup method, database restoration method and related device
CN115686380B (en) File storage method, device, computer equipment and storage medium
CN114546731B (en) Workflow data recovery method and data recovery system
CN111625186B (en) Data processing method, device, electronic equipment and storage medium
CN114461672A (en) Data retrieval method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
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

GR01 Patent grant
GR01 Patent grant