Dynamic cleaning method for block storage data and terminal
By judging data marks and user operation portraits in block storage, combining block maps and node maps to distinguish data types and usage times, dynamic cleaning of block storage data is realized, data redundancy and expiration problems are solved, and data redundancy and expiration are optimized. Use of storage space.
Patent Information
- Application Number
- CN202410963435.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Under Web 3.0, the shared data stored in blocks has problems with data redundancy and expired data deposition. The existing cleaning methods require manual screening or cleaning according to the environment and user wishes, and there is a lack of dynamic and effective cleaning solutions.
By receiving the file uploaded by the user and determining whether there is a mark in the data block, if it exists, clean it according to the mark. Otherwise, data cleaning will be performed based on the user's operation portrait, and a block map and a node map are established to traverse the blocks and distinguish the data into Important long-term, important temporary and temporary data, and the cleaning strategy is determined based on the number of markings and usages.
It realizes dynamic, efficient and flexible cleaning of block storage data, reduces useless data accumulation, optimizes storage space, and is suitable for dynamic cleaning of block shared data.
Smart Images

Figure CN118939188A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of block data cleaning, and in particular to a method and a terminal for dynamically cleaning block storage data. Background Art
[0002] Currently, with the application of Web3.0, data transmission has become easier and data storage has become more secure. However, many shared data stored in Web 3.0 have data redundancy. The reasons are: one is that in order to facilitate users to download data during data download, data will be cached in various blocks to facilitate user download; the other is that users upload the same file for storage, which will put pressure on the block space. At the same time, there is also the accumulation of expired data.
[0003] The existing cleaning methods require manual screening of data and cleaning of data, or the need to clean data in combination with the current environment and user wishes. However, there is currently no reasonable and effective solution for dynamic cleaning of block shared data. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and terminal for dynamically cleaning block storage data, which can optimize the storage space of block storage data when blocks share data and effectively reduce the block storage pressure.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A method for dynamically cleaning block storage data, comprising the steps of:
[0007] Receive files uploaded by users and use data blocks to store the file data uploaded by users;
[0008] The data blocks of the user are traversed by clearing the cache blocks to determine whether the data blocks store tags indicating the importance of the data. If so, data cleaning is performed based on the tags in the data blocks; otherwise, file data in the data blocks are cleaned based on the user's operation profile.
[0009] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0010] A dynamic cleaning terminal for block storage data comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned dynamic cleaning method for block storage data is implemented.
[0011] The beneficial effect of the present invention is that when dynamically cleaning the user's data block, if the data block stores a tag of the file data, the data is cleaned according to the tag, otherwise the file data is cleaned according to the user's operation profile. In this way, by establishing tags for the data and cooperating with the user's operation profile, the block data for sharing can be cleaned dynamically, efficiently and flexibly, reducing the accumulation of useless data. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 A flowchart of a method for dynamically cleaning block storage data according to an embodiment of the present invention;
[0013] Figure 2 A schematic diagram of a dynamic cleaning terminal for block storage data according to an embodiment of the present invention;
[0014] Figure 3 A schematic diagram of a data marking block according to an embodiment of the present invention;
[0015] Figure 4 A schematic diagram of a user portrait block according to an embodiment of the present invention;
[0016] Description of labels:
[0017] 1. A dynamic cleaning terminal for block storage data; 2. A memory; 3. A processor. DETAILED DESCRIPTION
[0018] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0019] Please refer to Figure 1 , an embodiment of the present invention provides a method for dynamically cleaning block storage data, comprising the steps of:
[0020] Receive files uploaded by users and use data blocks to store the file data uploaded by users;
[0021] The data blocks of the user are traversed by clearing the cache blocks to determine whether the data blocks store tags indicating the importance of the data. If so, data cleaning is performed based on the tags in the data blocks; otherwise, file data in the data blocks are cleaned based on the user's operation profile.
[0022] From the above description, it can be seen that the beneficial effect of the present invention is that when dynamically cleaning the user's data block, if the data block stores a tag of the file data, the data is cleaned according to the tag, otherwise the file data is cleaned according to the user's operation profile. In this way, by establishing tags for the data and cooperating with the user's operation profile, the block data for sharing can be cleaned dynamically, efficiently and flexibly, reducing the accumulation of useless data.
[0023] Further, traversing the data blocks of the user by clearing the cache blocks includes:
[0024] A block map is established for all data blocks of the user, and a corresponding node map is established for each data block. When the cache block is cleared using the block map to traverse the data blocks of the user, the node data is traversed for the corresponding data block through the node map.
[0025] From the above description, it can be seen that a block map of all data blocks is first established, and a corresponding node map is established for each data block. Therefore, in the process of traversing the block map, the non-occupied block data can be processed, marked and cleaned according to the data attributes of the node map, and the occupied blocks can be skipped. After the block is unoccupied (as long as it has not been completed according to the map, continue to judge) it can be cleaned up.
[0026] Further, data cleaning is performed according to the mark in the data block, including:
[0027] If the mark of the file data in the data block is an important long-term mark, the file data is not processed;
[0028] If the mark of the file data in the data block is an important temporary mark, when the file data reaches a temporary expiration time, the mark of the file data is changed to a temporary data mark;
[0029] If the mark of the file data in the data block is a temporary data mark, a use tag is added to the file data when the file data is in use, and the file data is cleared when the file data is in an idle state.
[0030] From the above description, it can be seen that by classifying data into important long-term, important temporary and temporary data, data cleaning can be performed reasonably, while also avoiding the situation where temporary data being used is deleted.
[0031] Furthermore, data cleaning is performed on the file data in the data block according to the operation profile of the user, including:
[0032] The file data in the data block is obtained, and the usage count of the file data is obtained. If the usage count reaches a threshold, the file data is not processed.
[0033] It can be seen from the above description that for data blocks that are not marked, the number of times used is used to determine whether the file data needs to be cleaned up, thereby effectively and reasonably cleaning up the data.
[0034] Furthermore, the number of times the file data is used is obtained. If the number of times does not reach a threshold value, it is determined whether there is a second file data identical to the file data in each data block and the number of times the second file data is used reaches the threshold value. If so, the file data is deleted and a reference path of the second file data is stored in the current data block.
[0035] From the above description, it can be seen that when the file data is used less frequently and there is the same file data with more frequent uses in other data blocks, the file data with less frequent uses can be deleted and a reference path can be set. In this way, the data can be called from other data blocks when the user wants to use the file data, further improving the utilization rate of the block storage data.
[0036] Please refer to Figure 2 Another embodiment of the present invention provides a dynamic cleaning terminal for block storage data, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned method for dynamic cleaning of block storage data when executing the computer program.
[0037] The above-mentioned method and terminal for dynamically cleaning block storage data of the present invention are particularly suitable for optimizing the storage space of block storage data when blocks share data, and effectively reducing the block storage pressure. The following is an explanation through specific implementation methods:
[0038] Embodiment 1
[0039] Please refer to Figure 1 , a method for dynamically cleaning block storage data, comprising the steps of:
[0040] S1. Receive files uploaded by users and use data blocks to store the file data uploaded by users.
[0041] In this embodiment, please refer to Figure 3When users upload file data, they can mark the file data according to the data mark block. The mark types include important long-term, important temporary and temporary data. Among them, the important long-term mark prohibits other processing modules from processing the file data; the important temporary mark prohibits data caching, and allows other processing blocks to process it when it expires; the temporary data mark allows the cache block to be cleared, and also allows the user portrait block to process. This type of data is for efficient transmission without considering its safety factor.
[0042] S2. Traverse the data blocks of the user by clearing the cache blocks to determine whether the data blocks store tags indicating the importance of the data. If so, clean the data according to the tags in the data blocks; otherwise, clean the file data in the data blocks according to the operation profile of the user.
[0043] S21. A block map is established for all data blocks of the user, and a corresponding node map is established for each data block. When the cache block is cleared using the block map to traverse the data blocks of the user, the node data is traversed for the corresponding data block through the node map.
[0044] In this embodiment, a block map is first established for all data blocks. The block map stores information of all data blocks, including blocks that are in use or occupied. Therefore, occupied blocks need to be skipped when they are in use to prevent the situation where traversing and processing at the same time increase the CPU time slice processing time. A node map is established for each data block. Specifically, all nodes in the data block are traversed and stored as the node map of the data block.
[0045] By loading the block map in batches, that is, first establish a block map of all blocks, traverse the data blocks according to the block map, and then traverse the data for each block according to the node map. During the block map traversal process, the non-occupied block data can be processed and marked according to the data attributes of the node map, and the occupied blocks can be skipped. After the block is unoccupied (as long as it has not been completed according to the map, continue to judge), all traversal and cleaning can be completed.
[0046] S22: If a mark indicating the importance of data is stored in the data block, data cleaning is performed according to the mark in the data block.
[0047] Specifically, if the mark of the file data in the data block is an important long-term mark, the file data is not processed;
[0048] If the mark of the file data in the data block is an important temporary mark, when the file data reaches a temporary expiration time, the mark of the file data is changed to a temporary data mark;
[0049] If the mark of the file data in the data block is a temporary data mark, a use tag is added to the file data when the file data is in use, and the file data is cleared when the file data is in an idle state.
[0050] S23: If the data block does not store a mark indicating the importance of the data, clean up the file data in the data block according to the operation profile of the user.
[0051] Specifically, the file data in the data block is obtained, and the number of times the file data is used is obtained. If the number of times reaches the number threshold, the file data is not processed. If the number of times does not reach the number threshold, it is determined whether there is a second file data identical to the file data in each data block and the number of times the second file data is used reaches the number threshold. If so, the file data is deleted, and the reference path of the second file data is stored in the current data block.
[0052] In this embodiment, please refer to Figure 4 The user portrait block obtains the data block corresponding to the user and traverses the data type of the file data in the data block, and the data type of the file data includes: video files, audio files, text files and other files. In some embodiments, the file data can be marked according to the type of file data, for example: video file types are all considered important for a long time.
[0053] At the same time, the number of times the file data is used needs to be counted in the user portrait block. When the number of uses is less than the threshold set by the system, the block is traversed to see whether there is a second file data that is the same as the file data and is active. If so, the data is deleted and marked as a reference, and the reference path to the second file data is recorded. In this way, if the user remembers to use this file data one day, he will go to other blocks to download the file.
[0054] In this embodiment, the block data needs to be sorted after the block interaction is concluded, which is equivalent to further sorting the data tags to ensure the security and stability of the block data.
[0055] Embodiment 2
[0056] Please refer to Figure 2A dynamic cleaning terminal 1 for block storage data includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a dynamic cleaning method for block storage data in embodiment 1 is implemented.
[0057] In summary, the present invention provides a method and terminal for dynamically cleaning block storage data. When a user uploads file data, a corresponding mark can be set for the file data. When the user's data block is dynamically cleaned, if the mark of the file data is stored in the data block, the data is cleaned according to the mark; otherwise, the file data is cleaned according to the user's operation profile. When cleaning through the user profile, some important and long-term types can be excluded according to the type of file data, and then the data is cleaned according to the number of references. If the data is the same as the data to be cleaned, and the same data does not need to be cleaned, a data reference path can be added after the data to be cleaned is deleted, and it is referenced to the same data. In this way, by establishing a mark for the data and cooperating with the user's operation profile, the block data used for sharing can be cleaned dynamically, efficiently and flexibly, reducing the accumulation of useless data.
[0058] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for dynamically cleaning block storage data, characterized in that: Includes steps: Receive files uploaded by users and use data blocks to store the file data uploaded by users; The data blocks of the user are traversed by clearing the cache blocks to determine whether the data blocks store tags indicating the importance of the data. If so, data cleaning is performed based on the tags in the data blocks; otherwise, file data in the data blocks are cleaned based on the user's operation profile.
2. A method for dynamically cleaning block storage data according to claim 1, characterized in that: Traversing the data blocks of the user by clearing the cache blocks includes: A block map is established for all data blocks of the user, and a corresponding node map is established for each data block. When the cache block is cleared using the block map to traverse the data blocks of the user, the node data is traversed for the corresponding data block through the node map.
3. A method for dynamically cleaning block storage data according to claim 1, characterized in that: Data cleaning is performed according to the mark in the data block, including: If the mark of the file data in the data block is an important long-term mark, the file data is not processed; If the mark of the file data in the data block is an important temporary mark, when the file data reaches a temporary expiration time, the mark of the file data is changed to a temporary data mark; If the mark of the file data in the data block is a temporary data mark, a use tag is added to the file data when the file data is in use, and the file data is cleared when the file data is in an idle state.
4. A method for dynamically cleaning block storage data according to claim 1, characterized in that: Cleaning the file data in the data block according to the user's operation profile includes: The file data in the data block is obtained, and the usage count of the file data is obtained. If the usage count reaches a threshold, the file data is not processed.
5. A method for dynamically cleaning block storage data according to claim 4, characterized in that: Obtain the number of times the file data is used. If the number of times does not reach a number threshold, determine whether there is second file data identical to the file data in each data block and the number of times the second file data is used reaches a number threshold. If so, delete the file data and store a reference path of the second file data in the current data block.
6. A dynamic cleaning terminal for block storage data, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Receive files uploaded by users and use data blocks to store the file data uploaded by users; The data blocks of the user are traversed by clearing the cache blocks to determine whether the data blocks store tags indicating the importance of the data. If so, data cleaning is performed based on the tags in the data blocks; otherwise, file data in the data blocks are cleaned based on the user's operation profile.
7. A dynamic cleaning terminal for block storage data according to claim 6, characterized in that: Traversing the data blocks of the user by clearing the cache blocks includes: A block map is established for all data blocks of the user, and a corresponding node map is established for each data block. When the cache block is cleared using the block map to traverse the data blocks of the user, the node data is traversed for the corresponding data block through the node map.
8. A dynamic cleaning terminal for block storage data according to claim 6, characterized in that: Data cleaning is performed according to the mark in the data block, including: If the mark of the file data in the data block is an important long-term mark, the file data is not processed; If the mark of the file data in the data block is an important temporary mark, when the file data reaches a temporary expiration time, the mark of the file data is changed to a temporary data mark; If the mark of the file data in the data block is a temporary data mark, a use tag is added to the file data when the file data is in use, and the file data is cleared when the file data is in an idle state.
9. A dynamic cleaning terminal for block storage data according to claim 6, characterized in that: Cleaning the file data in the data block according to the user's operation profile includes: The file data in the data block is obtained, and the usage count of the file data is obtained. If the usage count reaches a threshold, the file data is not processed.
10. A dynamic cleaning terminal for block storage data according to claim 9, characterized in that: Obtain the number of times the file data is used. If the number of times does not reach a number threshold, determine whether there is second file data identical to the file data in each data block and the number of times the second file data is used reaches a number threshold. If so, delete the file data and store a reference path of the second file data in the current data block.
Citation Information
Patent Citations
IOS engineering useless file cleaning method and computer readable storage medium
CN108897569A
Personal computer storage management system based on machine learning
CN116301646A
Data sanitization
US20160300069A1
Method and system for verification of deleted data for blockchains
US20190147065A1
Method for cleaning a delta storage system
US9141301B1
