CN113360095B - Hard disk data management method, device, equipment and medium - Google Patents

Hard disk data management method, device, equipment and medium Download PDF

Info

Publication number
CN113360095B
CN113360095B CN202110626327.XA CN202110626327A CN113360095B CN 113360095 B CN113360095 B CN 113360095B CN 202110626327 A CN202110626327 A CN 202110626327A CN 113360095 B CN113360095 B CN 113360095B
Authority
CN
China
Prior art keywords
file
information
written
indication information
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110626327.XA
Other languages
Chinese (zh)
Other versions
CN113360095A (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.)
Chongqing Unisinsight Technology Co Ltd
Original Assignee
Chongqing Unisinsight 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 Chongqing Unisinsight Technology Co Ltd filed Critical Chongqing Unisinsight Technology Co Ltd
Priority to CN202110626327.XA priority Critical patent/CN113360095B/en
Publication of CN113360095A publication Critical patent/CN113360095A/en
Application granted granted Critical
Publication of CN113360095B publication Critical patent/CN113360095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

In the hard disk data management method, device, equipment and medium provided by the application, after the electronic equipment constructs bitmap information in a memory according to the position indication information, when a target file needs to be deleted, a bitmap mark corresponding to the target file in the bitmap information is released according to a storage block occupied by the target file. Because the bitmap information is not stored in the target hard disk but replaced by the position indication information, when the bitmap mark is released, I/O operation is not required to be carried out on the target hard disk, and the data management efficiency is improved.

Description

Hard disk data management method, device, equipment and medium
Technical Field
The present application relates to the field of computers, and in particular, to a hard disk data management method, apparatus, device, and medium.
Background
Distributed storage systems are becoming more and more popular as data is being stored in ever increasing quantities. The distributed storage system works in a high concurrency and high load state, and has higher requirements on performance. Some distributed storage is built on a traditional file system (for example, a windows system or a linux system-owned file management system), and not only performance and reliability are difficult to adapt to a distributed storage scenario, but also requirements on hardware are high.
In response to the above problems, some data management systems have emerged that are customized for distributed storage scenarios. However, the inventor researches and discovers that the performance of the existing data management system customized for the distributed storage scenario needs to be further improved.
Disclosure of Invention
In order to overcome at least one defect in the prior art, in a first aspect, an embodiment of the present application provides a hard disk data management method, which is applied to an electronic device, where the electronic device maintains first file information and bitmap information of a target hard disk in a memory; the first file information records a file identifier of a written file; the target hard disk is divided into storage blocks with preset sizes, and the bitmap information records the storage blocks occupied by the written files, wherein the bitmap information is generated based on position indication information in the target hard disk, and the position indication information records block addresses of the storage blocks occupied by the written files, and the method comprises the following steps:
receiving a deletion request of a first target file, wherein the first target file belongs to the written file;
according to the deletion request, deleting the file identification corresponding to the first target file from the first file information;
and releasing the bitmap mark corresponding to the first target file in the bitmap information according to the storage block occupied by the first target file, wherein the bitmap mark represents that the corresponding storage block is occupied.
In a second aspect, an embodiment of the present application provides a hard disk data management apparatus, which is applied to an electronic device, where the electronic device maintains first file information and bitmap information of a target hard disk in a memory; the first file information records a file identifier of a written file; the target hard disk is divided into storage blocks with preset sizes, the bitmap information records the storage blocks occupied by the written files, the bitmap information is generated based on position indication information in the target hard disk, the position indication information records block addresses of the storage blocks occupied by the written files, and the hard disk data management device comprises:
a request receiving module, configured to receive a deletion request of a first target file, where the first target file belongs to the written file;
the data deleting module is used for deleting the file identifier corresponding to the first target file from the first file information according to the deleting request;
the data deleting module is further configured to release a bitmap mark corresponding to the first target file in the bitmap information according to the storage block occupied by the first target file, where the bitmap mark represents that the corresponding storage block is occupied.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor and a memory, where the memory stores a computer program, and when the computer program is executed by the processor, the hard disk data management method is implemented.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the hard disk data management method.
Compared with the prior art, the method has the following beneficial effects:
in the method, the apparatus, the device and the medium for managing hard disk data provided by the embodiment of the application, after the electronic device constructs bitmap information in a memory according to the position indication information, when a first target file needs to be deleted, a bitmap mark corresponding to the first target file in the bitmap information is released according to a storage block occupied by the first target file. Because the bitmap information is not stored in the target hard disk but replaced by the position indication information, when the bitmap mark is released, I/O operation is not required to be carried out on the target hard disk, and the data management efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a schematic step diagram of a hard disk data management method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data management area according to an embodiment of the present application;
FIG. 4A is a schematic diagram of data writing according to an embodiment of the present application;
FIG. 4B is a second schematic diagram of data writing according to the present embodiment;
FIG. 4C is a third schematic diagram illustrating data writing according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data writing device according to an embodiment of the present application.
An icon: 120-a memory; 130-a processor; 140-a communication device; 201-request receiving module; 202-data deletion module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as presented in the figures, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the 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.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. In addition, one skilled in the art, under the guidance of the present disclosure, may add one or more other operations to the flowchart, or may remove one or more operations from the flowchart.
Since a conventional file system (e.g., a file management system of a windows system or a linux system) is not only complex in structure, but also low in performance in a distributed scenario, it is difficult to adapt to the data storage requirement of the distributed storage scenario.
Although some data management systems customized for a distributed storage scenario are currently available, the currently customized data management systems generally divide a hard disk into a plurality of storage blocks with preset sizes, and then configure a bitmap storage area in the hard disk for storing bitmap information. It should be understood that, in order to reduce the storage space occupied by the data index information, the corresponding relationship between each storage block and the bit can be established. Then, when the bit position is 1, representing that the storage block corresponding to the bit is occupied, otherwise, representing that the storage block is unoccupied; thus, 1Byte (1byte = 8bit) of storage space can be used to index 8 storage blocks.
Because the bitmap information is stored in the hard disk, the bitmap information needs to be updated synchronously when the origin block is deleted or other storage blocks are occupied. However, the hard disk belongs to a block device, and is not good at performing the bit read-write operation, which in turn affects the performance of the whole system. The hard disk may be, but is not limited to, a solid state disk, a mechanical hard disk, and the like.
Based on the above technical problems, the inventors have made creative efforts to propose the following technical solutions to solve or improve the above problems. It should be noted that the above prior art solutions have disadvantages which are the result of practical and careful study by the inventor, and therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present application in the following should be the contribution of the inventor to the present application in the creation process of the invention, and should not be understood as technical contents known to those skilled in the art.
In view of this, an embodiment of the present application provides a hard disk data management method applied to an electronic device, so as to improve the management efficiency of data in a hard disk in a distributed storage scenario. The electronic device may be, but is not limited to, a server, a user terminal, and the like. The server may be, but is not limited to, a Web server, an FTP (File Transfer Protocol) server, and the like. The user terminal may be, but is not limited to, a smart phone, a Personal Computer (PC), a tablet PC, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), and the like.
The present embodiment provides a schematic structural diagram of the electronic device. Referring to fig. 1, the electronic apparatus includes a memory 120, a processor 130, and a communication device 140.
The memory 120, processor 130, and communication device 140 are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The Memory 120 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like. The memory 120 is used for storing a program, and the processor 130 executes the program after receiving the execution instruction. The communication device 140 is used for transmitting and receiving data through a network or a data bus.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
With respect to the hard disk data management method applied to the electronic device, the following describes each step in detail with reference to a flowchart of steps shown in fig. 2. The electronic equipment maintains first file information and bitmap information of a target hard disk in a memory; the first file information records a file identifier of the written file.
The target hard disk is divided into storage blocks with preset sizes, and bitmap information records the storage blocks occupied by the written files, wherein the bitmap information is generated based on position indication information in the target hard disk, and the position indication information records block addresses of the storage blocks occupied by the written files.
As shown in fig. 2, the hard disk data management method includes:
step S101, a deletion request of the first target file is received.
Wherein the first target file belongs to the written file.
Step S102, according to the deletion request, deleting the file identification corresponding to the first target file from the first file information.
Step S103, according to the memory block occupied by the first target file, releasing the bitmap mark corresponding to the first target file in the bitmap information.
The bitmap mark represents that the corresponding storage block is occupied.
Therefore, after the electronic equipment constructs the bitmap information in the memory according to the position indication information, when the first target file needs to be deleted, the bitmap mark corresponding to the first target file in the bitmap information is released according to the storage block occupied by the first target file. Because the bitmap information is not stored in the target hard disk, and the bitmap information is replaced by the position indication information, I/O operation is not required to be carried out on the target hard disk when the bitmap mark is released, and the data management efficiency is improved.
The position indication information is located in a data management area configured in advance in the target hard disk, second file information is recorded in the data management area, and the first file information is generated based on the second file information.
Therefore, the electronic equipment synchronously deletes the file identification of the first target file in the second file information.
For easy understanding, the present embodiment provides a schematic diagram of a data management area, and an exemplary description is given of a relationship among the above-described position indication information, the second file information, the bitmap information, and the first file information.
Illustratively, as shown in fig. 3, the data management area is located at the head of the target hard disk, and the remaining storage area is a data storage area, i.e. it needs to be divided into memory blocks of a preset size for storing data.
In this example, for convenience of explanation, a storage area other than the data management area in the target hard disk is referred to as a chunk area; the second file information occupied area is called a file area; the area occupied by the position indication information is referred to as a location area.
The location area records the corresponding relationship between the written files and the occupied storage blocks, that is, the storage addresses of the storage blocks occupied by the written files in the target hard disk. The file identifier recorded in the file area includes a file name, a creation time, and the like.
Optionally, as shown in fig. 3, the data management area further includes a super area for recording basic information of the target hard disk, including respective positions and spatial sizes of the file area, the location area, and the chunk area.
On the basis, the electronic equipment reads the position indication information and the second file information; generating bitmap information in a memory according to the position indication information; and generating the first file information in the memory according to the second file information. Of course, in order to distinguish the file area, the location area, and the chunk area, the electronic device needs to read the basic information in the super area.
In this embodiment, only the file identifier of the written file is loaded, and the deleted file is not loaded, so that when the bitmap information releases the bitmap flag corresponding to the first target file, the block address of the storage block occupied by the first target file in the position indication information is not deleted when the first target file is deleted, and when other files need to use the storage block occupied by the first target file, the corresponding relationship between the other files is changed again.
In this manner, I/O operations may be further reduced when the first target file is deleted.
Optionally, in order to facilitate organization and management of the written file, the data management area further records second directory information, and the electronic device further maintains, in the memory, first directory information of the target hard disk, where the first directory information is generated based on the second directory information, and the first directory information is used to record an affiliation between the created directory and the written file.
Referring again to fig. 3, in the present embodiment, an area for recording the second directory information in the data management area is referred to as a dir area. Since the dir area records the dependency relationship between the created directory and the written files, when a target directory needs to be deleted, the electronic device needs to be deleted together with all the written files in the target directory.
In order to facilitate management of the written files in the management target hard disk, in the present embodiment, the file size of each written file is defined, that is, each written file has a data capacity of a preset size. Considering that each storage block is also a predetermined size, each written file is divided into data blocks of a predetermined size, and each data block is stored in a different storage block.
Therefore, after the file size of each written file is limited, the final number of the written files which can be stored in the storage area except the data management area in the target hard disk can be determined. It should be noted that the data management area may be located in a storage medium other than the target hard disk, and in this case, the entire target hard disk may be used as a chunk area for storing data.
Illustratively, it is assumed that the data capacity of the preset size of each written file is 64MB, and the size of each data block of the preset size is 64Kb (i.e. the memory block is also 64 Kb); therefore, the 64M file can be divided into 1024 shares, and each share of data blocks is stored in a different storage block.
In addition, in order to make each written file be able to be classified into the directory to which it belongs in an extreme case, in this embodiment, the number of directories that can be recorded in the second directory area is not less than the number of directories that can be recorded in the second file area.
Assuming that each directory identifier requires 64 bits (8 bytes) of storage space; if the storage space required by each file identifier is 64 bits (8 bytes), and the storage space required by the block address of each storage block is 64 bits (8 bytes), the storage space required by the second file information, the second directory information, and the location indication information can be calculated in the following manner:
file number = chunk capacity/64 MB;
dir number = file number;
locate number = file number 1024;
second file information = file number × 64bit;
second directory information = dir number × 64 bits;
the storage space = location number × 64 bits required for the position indication information.
Alternatively, data backtracking may be performed in order to perform data backtracking when an abnormality occurs in the write data. The position indication information of the written file comprises first indication information and second indication information, wherein the occupation time of the storage block corresponding to the first indication information is earlier than that of the storage block corresponding to the second indication information.
Based on the first indication information and the second indication information, the electronic equipment receives first data to be written, wherein the first data to be written is used for covering a written file; and then writing the first data to be written into the memory block corresponding to the first indication information.
For example, assume that each directory identifier requires 64 bits (8 bytes) of storage space; the storage space required by each file identifier is 64 bits (8 Byte), the storage space required by the block address of each storage block is 64 bits (8 Byte), at this time, each data block in which the file has been written is configured with the storage space required by two block addresses, and at this time, the storage space required by the second file information, the second directory information, and the indication information can be calculated in the following manner:
file number = chunk capacity/64 MB;
dir number = file number;
locate number = file number 2048;
second file information = file number × 64bit;
second directory information = dir number × 64 bits;
the storage space = location number × 64 bits required for the position indication information.
The following describes an exemplary writing process of the first data to be written with reference to fig. 4A to 4C. As shown in fig. 4A, when first data to be written, whose data content is content a, is written to the target hard disk for the first time, it is assumed that the file for recording the first data to be written is file X. The electronic equipment divides the first to-be-written data with the data content of content A into 1024 parts, numbers each part of data blocks in an incremental mode (namely 0-1023), and arranges 2 block address storage spaces for each data block, wherein one block address storage space is used for recording first indication information, and the other block address storage space is used for recording second indication information.
The following description will be given by taking the data block numbered 0 therein as an example. As shown in fig. 4A, the indication information (including the first indication information and the second indication information) recorded in the block address storage space sequentially includes an address number, a block address, and a version number from left to right.
At this time, the electronic device stores the data block of number 0 in the memory block of number 0, and at the same time, records the block address of the memory block of number 0 in the memory space of address number 0, and marks it with version number 1.
Then, as shown in fig. 4B, when the first data to be written having the data content of content B is written in file X for the second time, the electronic apparatus also divides the first data to be written having the data content of content B into 1024 shares and numbers each share of data blocks in an incremental manner (i.e., 0 to 1023).
At this time, the electronic device stores the data block of number 0 in the memory block of number 1, and records the block address of the memory block of number 1 in the memory space of address number 1, and marks it with version number 2.
Further, as shown in fig. 4C, when the first data to be written having the data content of content C is written into file X for the third time, the electronic device also divides the first data to be written having the data content of content C into 1024 shares and numbers each share of data blocks in an incremental manner (i.e., 0 to 1023).
Since the storage spaces numbered 0 and 1 are used at this time, the electronic device stores the data block numbered 0 in the storage block numbered 2 according to the principle that the storage space with the relatively small version number is selected for overwriting, but the storage space with the relatively large version number is not selected for overwriting. The electronic device records the block address of the memory block with the number 2 in the memory space with the version number 1 in an overlaying manner, and marks the block address with the version number 3.
When the first data to be written is abnormal, the storage space with the version number of 2 is not covered at this time, so that data recovery can be performed through the block address recorded in the storage space with the version number of 2.
Of course, after the first data to be written is written successfully, the storage block corresponding to the storage space numbered 2, that is, the storage block numbered 1, may be released from the bitmap information, so as to achieve the purpose of improving the utilization rate of the storage resources.
Of course, the first file information further records a file identifier of an unwritten file, and is for second generation write data that is not written in an overwriting manner. The electronic equipment receives second data to be written; and distributing a second target file for the second data to be written from the unwritten file.
For example, after the file size of each written file is defined, the final number of written files that can be stored in a storage area other than the data management area in the target hard disk can be determined. Therefore, the remaining unwritten file in the first file information is the unwritten file.
Then, the electronic equipment selects a target mark from the idle marks according to the idle marks in the bitmap information, wherein the idle marks represent that the corresponding storage blocks are not occupied; and writing the data to be written into the storage block corresponding to the target mark.
Finally, the electronic equipment adds the block address of the storage block occupied by the second target file to the position indication information. At this time, the corresponding relationship between the block address of the storage block occupied by the second target file and the second target file is recorded in the position indication information.
Based on the same inventive concept as the hard disk data management method, the embodiment of the application also provides a hard disk data management device which is applied to electronic equipment.
The electronic equipment maintains first file information and bitmap information of a target hard disk in a memory; the first file information records a file identifier of a written file; the target hard disk is divided into storage blocks with preset sizes, and bitmap information records the storage blocks occupied by the written files, wherein the bitmap information is generated based on position indication information in the target hard disk, and the position indication information records block addresses of the storage blocks occupied by the written files.
The hard disk data management device comprises at least one functional module which can be stored in a memory in a software form. The processor is used for executing executable modules stored in the memory, such as software functional modules and computer programs included in the hard disk data management device. As shown in fig. 5, the hard disk data management apparatus is functionally divided into:
a request receiving module 201, configured to receive a deletion request of a first target file, where the first target file belongs to a written file.
In this embodiment, the request receiving module 201 is configured to implement step S101 in fig. 2, and for the detailed description of the request receiving module 201, reference may be made to the detailed description of step S101.
A data deleting module 202, configured to delete, according to the deletion request, a file identifier corresponding to the first target file from the first file information;
the data deleting module 202 is further configured to release a bitmap flag corresponding to the first target file in the bitmap information according to the memory block occupied by the first target file, where the bitmap flag indicates that the corresponding memory block is occupied.
In this embodiment, the data deleting module 202 is configured to implement steps S102 to S103 in fig. 2, and for a detailed description of the request receiving module 201, reference may be made to detailed descriptions of steps S102 to S103.
It should be noted that the hard disk data management apparatus may further include other software functional modules, which are used to implement other steps or sub-steps of the hard disk data management method. Similarly, the data deleting module 202 and the request receiving module 201 may also be used to implement other steps or sub-steps of the hard disk data management method. The embodiment does not specifically limit this, and those skilled in the art may perform division based on different division manners.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to realize the hard disk data management method.
The embodiment of the application also provides a computer readable storage medium, the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the hard disk data management method is realized.
To sum up, in the hard disk data management method, apparatus, device, and medium provided in this embodiment of the present application, after the electronic device constructs bitmap information in a memory according to the position indication information, when a first target file needs to be deleted, a bitmap mark corresponding to the first target file in the bitmap information is released according to a storage block occupied by the first target file. Because the bitmap information is not stored in the target hard disk, and the bitmap information is replaced by the position indication information, I/O operation is not required to be carried out on the target hard disk when the bitmap mark is released, and the data management efficiency is improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only for various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and all such changes or substitutions are included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A hard disk data management method is characterized by being applied to electronic equipment, wherein the electronic equipment maintains first file information and bitmap information in a memory; the first file information records a file identifier of a written file in a target hard disk; the target hard disk is divided into storage blocks with preset sizes, and the bitmap information records the storage blocks occupied by the written files, wherein the method comprises the following steps:
receiving a deletion request of a first target file, wherein the first target file belongs to the written file;
according to the deletion request, deleting a file identifier corresponding to the target file from the first file information;
releasing a bitmap mark corresponding to the first target file in the bitmap information according to the storage block occupied by the first target file, wherein the bitmap mark represents that the corresponding storage block is occupied;
the bitmap information is generated based on position indication information in the target hard disk, the position indication information records block addresses of storage blocks occupied by the written files, the position indication information of each written file comprises first indication information and second indication information, and the first indication information and the second indication information are respectively marked with different version numbers, and the method further comprises:
receiving first data to be written, wherein the first data to be written is used for covering a written file;
if the version number of the first indication information is smaller than that of the second indication information, writing the first to-be-written data into a storage block corresponding to the first indication information, wherein the version number of the first indication information smaller than that of the second indication information represents that the occupation time of the storage block corresponding to the first indication information is earlier than that of the storage block corresponding to the second indication information;
and if the first data to be written is written into the storage block corresponding to the first indication information, restoring the written file to the state before the first data to be written is written by using second indication information.
2. The hard disk data management method according to claim 1, wherein the location indication information is located in a data management area pre-configured in the target hard disk, the data management area further records second file information, and the first file information is generated based on the second file information, the method further comprising:
and synchronously deleting the file identification of the first target file in the second file information.
3. The method of claim 2, wherein before receiving the request for deleting the first target file, the method further comprises:
reading the position indication information and the second file information;
generating the bitmap information in a memory according to the position indication information;
and generating the first file information in a memory according to the second file information.
4. The hard disk data management method according to claim 2, wherein second directory information is further recorded in the data management area, the electronic device further maintains first directory information of the target hard disk in the memory, and the first directory information is generated based on the second directory information, wherein the first directory information is used for recording an affiliation between a created directory and the written file.
5. The hard disk data management method according to claim 1, wherein the first file information further records a file identifier of an unwritten file, and the method further comprises:
receiving second data to be written;
distributing a second target file for the second data to be written from the unwritten files;
selecting a target mark from the idle marks according to the idle marks in the bitmap information, wherein the idle marks represent that the corresponding storage blocks are not occupied;
writing the data to be written into a storage block corresponding to the target mark;
adding the block address of the storage block occupied by the second target file to the position indication information.
6. The hard disk data management method according to any one of claims 1 to 5, wherein each written file has a data capacity of a preset size, the data capacity of the preset size is divided into data blocks of a preset size, and each data block is stored in a different storage block.
7. A hard disk data management device is characterized by being applied to electronic equipment, wherein the electronic equipment maintains first file information and bitmap information in a memory; the first file information records a file identifier of a written file in a target hard disk; the target hard disk is divided into storage blocks with preset sizes, the bitmap information records the storage blocks occupied by the written files, and the hard disk data management device comprises:
a request receiving module, configured to receive a deletion request of a first target file, where the first target file belongs to the written file;
the data deleting module is used for deleting the file identifier corresponding to the first target file from the first file information according to the deleting request;
the data deleting module is further configured to release a bitmap mark corresponding to the first target file in the bitmap information according to the storage block occupied by the first target file, where the bitmap mark represents that the corresponding storage block is occupied;
the bitmap information is generated based on position indication information in the target hard disk, the position indication information records block addresses of storage blocks occupied by the written files, the position indication information of each written file comprises first indication information and second indication information, and the first indication information and the second indication information are respectively marked with different version numbers;
the data deleting module is further used for receiving first data to be written, wherein the first data to be written is used for covering a written file;
if the version number of the first indication information is smaller than that of the second indication information, writing the first data to be written into the storage block corresponding to the first indication information, wherein the version number of the first indication information smaller than that of the second indication information represents that the occupied time of the storage block corresponding to the first indication information is earlier than that of the storage block corresponding to the second indication information;
and if the first data to be written is written into the storage block corresponding to the first indication information, restoring the written file to the state before the first data to be written is written by using second indication information.
8. An electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the hard disk data management method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the hard disk data management method of any one of claims 1 to 6.
CN202110626327.XA 2021-06-04 2021-06-04 Hard disk data management method, device, equipment and medium Active CN113360095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110626327.XA CN113360095B (en) 2021-06-04 2021-06-04 Hard disk data management method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110626327.XA CN113360095B (en) 2021-06-04 2021-06-04 Hard disk data management method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN113360095A CN113360095A (en) 2021-09-07
CN113360095B true CN113360095B (en) 2023-02-17

Family

ID=77532228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110626327.XA Active CN113360095B (en) 2021-06-04 2021-06-04 Hard disk data management method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113360095B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867651B (en) * 2021-12-03 2022-02-25 武汉深之度科技有限公司 Hard disk data cleaning method and device and computing equipment

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5237460A (en) * 1990-12-14 1993-08-17 Ceram, Inc. Storage of compressed data on random access storage devices
US20020143764A1 (en) * 2001-04-03 2002-10-03 Martin Andrew R. Data management system and method for intercepting and changing database instructions between a database back end and an application front end
JP4257834B2 (en) * 2003-05-06 2009-04-22 インターナショナル・ビジネス・マシーンズ・コーポレーション Magnetic disk device, file management system and method thereof
US7647358B2 (en) * 2004-03-22 2010-01-12 Microsoft Corporation Computing device with relatively limited storage space and operating/file system thereof
US8799367B1 (en) * 2009-10-30 2014-08-05 Netapp, Inc. Using logical block addresses with generation numbers as data fingerprints for network deduplication
US8504792B2 (en) * 2009-12-22 2013-08-06 Apple Inc. Methods and apparatuses to allocate file storage via tree representations of a bitmap
CN101916290B (en) * 2010-08-18 2014-12-10 中兴通讯股份有限公司 Managing method of internal memory database and device
US9009407B2 (en) * 2011-03-29 2015-04-14 Dell Products L.P. System and method for performing system memory save in tiered/cached storage
US9483205B2 (en) * 2014-07-02 2016-11-01 Hedvig, Inc. Writing to a storage platform including a plurality of storage clusters
CN104461923B (en) * 2014-10-31 2018-07-03 深圳市锐明技术股份有限公司 A kind of hard disc physical block management method and system
EP3217294B1 (en) * 2014-11-28 2018-11-28 Huawei Technologies Co. Ltd. File access method and apparatus and storage device
TWI582581B (en) * 2016-05-13 2017-05-11 群暉科技股份有限公司 Method and apparatus for performing data recovery in a redundant storage system
US10452606B1 (en) * 2016-09-29 2019-10-22 EMC IP Holding Company LLC Continuous metadata formatting
CN108628541B (en) * 2017-03-22 2020-07-07 华为技术有限公司 File storage method, device and storage system
US20180276022A1 (en) * 2017-03-24 2018-09-27 Commvault Systems, Inc. Consistent virtual machine replication
CN109753222B (en) * 2017-11-01 2021-03-26 腾讯科技(深圳)有限公司 Data deleting method, server and computer readable medium
CN107797770B (en) * 2017-11-07 2020-08-21 深圳神州数码云科数据技术有限公司 Method and device for synchronizing disk state information
CN109962946B (en) * 2017-12-22 2022-03-15 阿里巴巴集团控股有限公司 Method and device for downloading resources
CN108595262B (en) * 2018-03-29 2021-06-22 北京奇艺世纪科技有限公司 Data processing method and device
CN110169040B (en) * 2018-07-10 2021-09-28 深圳花儿数据技术有限公司 Distributed data storage method and system based on multilayer consistent hash

Also Published As

Publication number Publication date
CN113360095A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN102945212B (en) Collect zoning and expression
US6823417B2 (en) Memory controller for memory card manages file allocation table
CN110018998B (en) File management method and system, electronic equipment and storage medium
CN101983376B (en) Access device, information recording device, information recording system, file management method, and program
CN109508246A (en) Log recording method, system and computer readable storage medium
CN110727403A (en) Metadata management method and device
CN114924914B (en) Disk partition table information backup and recovery method and system
CN114827178A (en) Data processing method, device and equipment and readable storage medium
CN113360095B (en) Hard disk data management method, device, equipment and medium
CN108664482A (en) FLASH memory and storage file management method
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN114428764B (en) File writing method, system, electronic device and readable storage medium
CN110504002B (en) Hard disk data consistency test method and device
CN111803917A (en) Resource processing method and device
CN114466083A (en) Data storage system supporting protocol intercommunication
CN115509808B (en) Data backup method, device, computer equipment and storage medium
CN114936010B (en) Data processing method, device, equipment and medium
CN116578410A (en) Resource management method, device, computer equipment and storage medium
CN111752941A (en) Data storage method, data access method, data storage device, data access device, server and storage medium
CN113467997B (en) Data recovery method and device, mobile equipment and storage medium
CN113806803A (en) Data storage method, system, terminal equipment and storage medium
CN114675776A (en) Resource storage method and device, storage medium and electronic equipment
CN111008195A (en) Database free space management method, system, terminal and storage medium
CN111625502A (en) Data reading method and device, storage medium and electronic device
CN112015672A (en) Data processing method, device, equipment and storage medium in storage system

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
GR01 Patent grant
GR01 Patent grant