A blockchain-based IPFS file storage strategy system

By introducing a blockchain-based storage policy system in IPFS, the problem of IPFS lacking effective storage strategies is solved, and fine control of file storage time and efficient and reasonable allocation of resources are achieved.

CN114691621BActive Publication Date: 2025-06-06INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011606202.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2025-06-06
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

IPFS lacks an effective storage strategy, which makes it impossible to configure resources efficiently and reasonably, especially when it is necessary to save important files for a long time.

Method used

A blockchain-based IPFS file storage policy system is adopted, including a smart contract for IPFS nodes and blockchain importance level policy, a file storage policy is set through the storage policy module, and an expired file is cleaned according to the policy using the file cleaning module.

Benefits of technology

It realizes fine control over file storage time, ensures that important files are permanently saved, thereby configuring resources efficiently and reasonably, solving the problem of improper resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691621B_ABST
    Figure CN114691621B_ABST
Patent Text Reader

Abstract

The embodiment of this specification discloses an IPFS file storage policy system based on blockchain, including: an IPFS node and a blockchain importance level policy smart contract; the blockchain importance level policy smart contract is used to maintain importance level entries; the IPFS node includes a storage policy module and a file cleanup module; the storage policy module is used to set a file storage policy, wherein the file storage policy includes a single processing storage policy and a batch storage policy related to the blockchain importance level policy smart contract; the file cleanup module is used to clean up expired files according to the storage policy. The embodiment of this specification determines the file storage time through the storage policy module, and important files can be set to be permanently saved, thereby controlling the file storage time more finely and accurately, thereby allocating resources more efficiently and reasonably.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the technical field of blockchain, and in particular to an IPFS file storage strategy system based on blockchain. Background Art

[0002] IPFS is a global open distributed file system with unlimited expansion capabilities. It is a powerful tool for expanding the storage capacity of blockchain. With the help of the various capabilities of IPFS, data storage needs in many application scenarios can be solved, and more and better innovative industries will emerge.

[0003] IPFS relies on incentive mechanisms and competition mechanisms to achieve resource storage, lacks effective storage strategies, and cannot allocate resources efficiently and reasonably. Summary of the invention

[0004] One or more embodiments of this specification provide a blockchain-based IPFS file storage strategy system to solve the following technical problems: lack of effective storage strategy and inability to efficiently and reasonably configure resources.

[0005] One or more embodiments of this specification adopt the following technical solutions:

[0006] One or more embodiments of this specification provide a blockchain-based IPFS file storage strategy system, including:

[0007] IPFS node and blockchain importance level strategy smart contract;

[0008] The blockchain importance level strategy smart contract is used to maintain importance level items;

[0009] The IPFS node includes a storage strategy module and a file cleaning module;

[0010] The storage policy module is used to set a file storage policy, wherein the file storage policy includes a single processing storage policy and a batch storage policy related to the blockchain importance level policy smart contract;

[0011] The file cleaning module is used to clean up expired files according to the storage policy.

[0012] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: the embodiments of this specification determine the file storage time through the storage policy module, and important files can be set to be permanently saved, thereby more finely and accurately controlling the file storage time, thereby more efficiently and reasonably configuring resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0014] Figure 1 A schematic diagram of the structure of an IPFS file storage strategy system based on blockchain provided for one or more embodiments of this specification;

[0015] Figure 2 A schematic diagram of a file object data structure provided for one or more embodiments of this specification. DETAILED DESCRIPTION

[0016] The embodiments of this specification provide an IPFS file storage strategy system based on blockchain.

[0017] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0018] The characteristic of IPFS is that popular file resources will never be lost, which complies with the law of use it or lose it. Frequently accessed file resources will never disappear, and files with low frequency of use will eventually disappear slowly due to resource limitations. Therefore, IPFS is more suitable for real-time public resource management. Filecoin encourages miners to provide larger storage space and store files for a long time through an incentive mechanism. However, this method is not very efficient, and the competition mechanism itself is also an energy-consuming behavior.

[0019] IPFS relies entirely on incentive mechanisms and competition mechanisms to achieve resource storage, and lacks an effective storage strategy. A completely free market competition mechanism has a certain degree of blind competition and cannot allocate resources efficiently and reasonably. For example, in the storage scenarios of government archives or historical materials, although the data is rarely used, it is extremely important and needs to be preserved permanently and reliably for a long time. Relying on a completely free market competition mechanism cannot solve this problem well, and free competition itself is also an energy-consuming behavior. Therefore, in a safe, efficient and reliable scenario, an efficient storage strategy is needed to coordinate the effective use of resources.

[0020] The embodiment of this specification determines the file storage time through the storage policy module. Important files can be set to be permanently saved, so that the file storage time can be controlled more finely and accurately, thereby allocating resources more efficiently and reasonably. The technical solution provided by this specification is described in detail below.

[0021] Figure 1 A schematic diagram of the structure of a blockchain-based IPFS file storage strategy system provided for one or more embodiments of this specification, the system includes: an IPFS node and a blockchain importance level strategy smart contract.

[0022] The blockchain importance level policy smart contract is used to maintain importance level entries.

[0023] When maintaining importance level entries, the importance level entries of the blockchain importance level policy smart contract can be maintained through the blockchain client.

[0024] The importance level items in the blockchain importance level strategy smart contract include business tags, importance levels and file duration. The blockchain importance level strategy smart contract includes adding importance level items, updating importance level items, deleting importance level items and querying importance level items. Among them, the file duration can be determined according to the importance level of the file.

[0025] When adding a first importance level entry, the blockchain importance level policy smart contract can first use the business tag and the importance level as the primary key to ensure that the added importance level entry is unique, and then use the business tag, the importance level, and the file duration as the first importance level entry and store it in the blockchain ledger;

[0026] When updating the second importance level entry, the blockchain importance level policy smart contract searches the blockchain ledger for the second importance level entry based on the business tag and the importance level, and updates the file duration.

[0027] When deleting the third importance level entry, the blockchain importance level policy smart contract searches for the third importance level entry from the blockchain ledger based on the business tag and the importance level, and deletes the third importance level entry.

[0028] The IPFS node includes a storage strategy module and a file cleaning module.

[0029] The storage policy module is used to set a file storage policy, wherein the file storage policy includes a single processing storage policy and a batch storage policy related to the blockchain importance level policy smart contract.

[0030] The single-processing storage strategy manages the storage time of a single file from the perspective of time and read count. The types of single-processing storage strategies include permanent storage, storage at a specified time point, specified storage duration, specified read count, and storage duration for a specified number of times. The following is a detailed description of the single-processing storage strategy:

[0031] When the type of the single-process storage policy is permanent storage, it means that the file is permanently stored and will never be deleted.

[0032] When the type of the single-processing storage policy is storage at a specified time point, the timestamp of file expiration can be set. When the system time is at the expiration timestamp, the file cleanup module will automatically clean up the file.

[0033] When the type of the single-processing storage policy is a specified storage duration, the expiration timestamp of the file is determined according to the current system timestamp and the specified storage duration, that is, the expiration timestamp of the file = the current system timestamp + the specified storage duration. When the system timestamp is at the expiration timestamp, the file cleaning module cleans up the file.

[0034] When the type of the single-processing storage policy is to specify the number of reads, for scenarios such as data exchange, the data user will never use the data again after reading it, and data retention will cause space waste. Therefore, you can set the data to be destroyed after reading it once. For safety reasons, you can set it to be destroyed after multiple reads, such as 3 times. In most cases, the data will not be read again after being read once, unless the data is damaged during transmission and needs to be read repeatedly. Set the preset number of reads for the file. Update the actual number of reads when reading a file. The file cleaning program can automatically clean up files whose actual number of reads is greater than or equal to the preset number of reads.

[0035] When the type of single-processing storage policy is to specify the number of storage durations, set the preset number of reads and the storage duration. For example, set the storage duration after the file is read once. If it is not read again within the specified time, it means that the file has been safely delivered and can be safely deleted; if the reading behavior occurs again within the specified time, it means that the data has not been safely delivered. At this time, it is necessary to reset the storage time and wait for reading; this goes on and on until it is no longer read within the specified time, indicating that the file has been safely delivered, and the file cleanup module can safely delete the file.

[0036] Regarding the batch storage strategy, it is to add business tags and importance levels to files, and send the business tags and importance levels of the files to the blockchain importance level strategy smart contract, so that the file cleaning module can be used to determine the file's survival time based on the file's business tags and importance levels, and the file's survival time can be queried through the blockchain importance level strategy smart contract, and whether to clean the file is determined based on the file's survival time and the file creation timestamp, that is, the file's expiration time (file cleaning time) = file creation timestamp + file survival time.

[0037] It should be noted that from the perspective of business and importance, business tags can be added to files to process files of specific business and importance in batches. Different levels of files can be set according to the importance of business data. Files of different importance levels have different durations, and the specific duration can be managed through the blockchain importance level strategy smart contract.

[0038] The file cleaning module is used to clean up expired files according to storage policies.

[0039] Further, the strategy of the file cleaning module can be: periodically cleaning out expired files according to the storage strategy. In addition, the strategy of the file cleaning module can also be: when the disk space reaches a threshold, cleaning out expired files according to the storage strategy.

[0040] It should be noted that the metadata of the file storage policy is stored in the file object data structure, see Figure 2 The file object data structure diagram is shown. The file object data structure includes a data object (file data itself) and a storage strategy. The storage strategy data structure includes the type of single-processing storage strategy, the timestamp of expiration, the number of reads (including the preset number of reads and the actual number of reads), the storage duration, the business tag, and the importance level.

[0041] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0042] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0043] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0044] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0045] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0046] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0047] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0049] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0050] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0051] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0052] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0053] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0054] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0055] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0056] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.

Claims

1. A blockchain-based IPFS file storage strategy system, It is characterized in that include: IPFS node and blockchain importance level strategy smart contract; The blockchain importance level strategy smart contract is used to maintain importance level items; The IPFS node includes a storage strategy module and a file cleaning module; The storage policy module is used to set a file storage policy, wherein the file storage policy includes a single processing storage policy and a batch storage policy related to the blockchain importance level policy smart contract; The file cleaning module is used to clean up expired files according to the storage policy; The importance level entry in the blockchain importance level strategy smart contract includes business tags, importance levels and file duration; The blockchain importance level strategy smart contract includes adding importance level items, updating importance level items, deleting importance level items and querying importance level items; When adding a first importance level entry, the blockchain importance level policy smart contract stores the service tag, the importance level, and the file duration as the first importance level entry in the blockchain ledger; When updating the second importance level entry, the blockchain importance level policy smart contract searches the blockchain account book for the second importance level entry according to the business tag and the importance level, and updates the file duration; When deleting the third importance level entry, the blockchain importance level policy smart contract searches for the third importance level entry from the blockchain ledger according to the business tag and the importance level, and deletes the third importance level entry.

2. The system according to claim 1, It is characterized in that The type of the single-processing storage strategy includes one or more of permanent storage, storage at a specified time point, specified storage duration, specified number of reads, and storage duration for a specified number of times.

3. The system according to claim 2, It is characterized in that The specified number of storage durations is to set a preset number of reads and a storage duration at the same time.

4. The system according to claim 2, It is characterized in that When the type of the single-processing storage strategy is a specified storage duration, the expiration timestamp of the file is determined based on the current system timestamp and the specified storage duration, and when the system timestamp is at the expiration timestamp, the file cleaning module cleans up the file.

5. The system according to claim 1, It is characterized in that The batch storage strategy is to add business tags and importance levels to files, so that the file cleaning module is used to query the file's lifetime through the blockchain importance level strategy smart contract based on the file's business tag and importance level, and determine whether to clean the file based on the file's lifetime and file creation timestamp.

Citation Information

Patent Citations

  • A log auditing method and system based on a block chain

    CN109815203A

  • Weighted distributed data storage method and system and storage medium

    CN111858540A