WO2021104380A1 - 数据存储方法、装置及存储系统 - Google Patents

数据存储方法、装置及存储系统 Download PDF

Info

Publication number
WO2021104380A1
WO2021104380A1 PCT/CN2020/131816 CN2020131816W WO2021104380A1 WO 2021104380 A1 WO2021104380 A1 WO 2021104380A1 CN 2020131816 W CN2020131816 W CN 2020131816W WO 2021104380 A1 WO2021104380 A1 WO 2021104380A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
stored
storage area
storage
index information
Prior art date
Application number
PCT/CN2020/131816
Other languages
English (en)
French (fr)
Inventor
叶敏
王伟
林起芊
Original Assignee
杭州海康威视系统技术有限公司
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 杭州海康威视系统技术有限公司 filed Critical 杭州海康威视系统技术有限公司
Priority to EP20894122.9A priority Critical patent/EP4068070A4/en
Priority to US17/780,334 priority patent/US11853549B2/en
Publication of WO2021104380A1 publication Critical patent/WO2021104380A1/zh

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • 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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1847File system types specifically adapted to static storage, e.g. adapted to flash memory or SSD
    • 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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • 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
    • 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/0644Management of space entities, e.g. partitions, extents, pools
    • 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/0647Migration mechanisms
    • G06F3/0649Lifecycle management
    • 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/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • 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/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0685Hybrid storage combining heterogeneous device types, e.g. hierarchical storage, hybrid arrays
    • 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/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B20/1217Formatting, e.g. arrangement of data block or words on the record carriers on discs
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B20/1217Formatting, e.g. arrangement of data block or words on the record carriers on discs
    • G11B2020/1218Formatting, e.g. arrangement of data block or words on the record carriers on discs wherein the formatting concerns a specific area of the disc
    • G11B2020/1238Formatting, e.g. arrangement of data block or words on the record carriers on discs wherein the formatting concerns a specific area of the disc track, i.e. the entire a spirally or concentrically arranged path on which the recording marks are located

Definitions

  • This application relates to the field of data storage technology, and in particular to a data storage method, device and storage system.
  • USB flash drive USB flash drive
  • SM Smart Media
  • SMR Single Magneting Recording
  • the data to be written is usually written to the SMR disk according to the sequence of the received data writing instructions. Since a storage area of an SMR disk can only be written sequentially, when the same data is frequently overwritten in a storage area of the SMR disk, only the last storage block that stores the data will store the data. The data stored in the storage block is valid data, the data stored in other storage blocks are invalid data, and the storage block in the storage area does not support deletion operations, which will easily cause a large number of fragments of the SMR disk. If these fragments cannot be recovered in time , The storage resource utilization rate of the SMR disk is not high.
  • the purpose of the embodiments of the present application is to provide a data storage method, device, and storage system to improve the storage resource utilization of SMR disks.
  • the specific technical solutions are as follows:
  • the embodiments of the present application provide a data storage method, which is applied to a shingled magnetic recording SMR storage system.
  • the SMR storage system includes SMR disks and non-SMR disks; SMR disks include conventional magnetic recording CMR (conventional magnetic recording). , Traditional magnetic recording) area and SMR area.
  • the SMR area includes multiple storage areas, and each storage area is logically divided into multiple storage blocks; the method includes: when the data to be stored is obtained, the data type of the data to be stored is determined ; Based on the data type of the data stored in each storage area in the SMR disk, determine the target storage area with the same data type as the data to be stored; determine the target storage block to be written to the data to be stored in the target storage area; based on The identification of the target storage block generates the main index information and backup index information of the data to be stored; based on the identification of the data to be stored and the target storage block, the database index information of the data to be stored is generated; the backup index information of the data to be stored and the backup index information are generated Data is written to the target storage block, the main index information of the data to be stored is written to the CMR area or non-SMR disk, and the database index information of the data to be stored is written to the non-SMR disk.
  • the embodiments of the present application also provide a data storage device, which is applied to a shingled magnetic recording SMR storage system.
  • the SMR storage system includes SMR disks and non-SMR disks; SMR disks include traditional magnetic recording CMR areas and SMRs.
  • the SMR area includes multiple storage areas, and each storage area is logically divided into multiple storage blocks;
  • the device includes: a first data type determining module for determining the data type of the data to be stored when the data to be stored is obtained;
  • the target storage area determination module is used to determine the target storage area that is the same as the data type of the data to be stored based on the data type of the data stored in each storage area in the SMR disk;
  • the target storage block determination module is used to store data in the target storage area.
  • the first index information generation module is used to generate the main index information and the backup index information of the data to be stored based on the identification of the target storage block;
  • the second index information generation module It is used to generate database index information of the data to be stored based on the identification of the data to be stored and the target storage block;
  • the storage module is used to write the backup index information of the data to be stored and the data to be stored into the target storage block, and the data to be stored
  • the main index information is written to the CMR area or non-SMR disk, and the database index information of the data to be stored is written to the non-SMR disk.
  • an embodiment of the present application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus.
  • the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is used for A computer program is stored; the processor is used to implement the method steps of the above-mentioned first aspect when executing the program stored in the memory.
  • the embodiments of the present application also provide a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of any one of claims 1-8 are implemented.
  • the embodiments of the present application also provide an SMR storage system.
  • the SMR storage system includes: SMR disks, non-SMR disks, and processors.
  • the SMR disks include a CMR area and an SMR area.
  • the SMR area includes multiple storage areas.
  • the storage area is logically divided into multiple storage blocks; the storage block is used to store the data to be stored and the backup index information of the data to be stored; the CMR area is used to store the main index information of the data to be stored; the non-SMR disk is used to store the data to be stored The database index information; the processor is used to execute the data storage method of the first aspect at runtime.
  • the embodiments of the present invention also provide a computer program product containing instructions, which when executed by a processor, implement the method steps of the first aspect described above.
  • the data storage method, device, electronic equipment, storage medium, and storage system can determine the data type of the data to be stored when the data to be stored is obtained; then it can be based on each storage area in the SMR disk Determine the target storage area with the same data type as the data to be stored; determine the target storage block to be written to the data to be stored in the target storage area; after the target storage block is determined, it can be based on The identification of the target storage block generates the main index information and backup index information of the data to be stored; based on the identification of the data to be stored and the target storage block, the database index information of the data to be stored is generated; finally, the backup index information of the data to be stored can be Write the data to be stored into the target storage block, write the main index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored into the non-SMR disk.
  • the data of the same data type can be stored in the same storage area; because the data of the same data type usually has the same or similar overwrite operation frequency, therefore, the data with the same or similar overwrite operation will be stored.
  • Stored in the same storage area so as to facilitate timely recovery of fragments generated in the storage area according to the frequency of overwriting and writing of the data, reduce the amount of fragments, and thereby improve the storage resource utilization of the SMR disk.
  • the main index information of the data to be stored is written to the CMR area or non-SMR disk
  • the database index information of the data to be stored is written to the non-SMR disk. Since the CMR area or non-SMR disk supports the delete operation, When the main index information and database index information of the data are updated, you can directly locate the main index information stored in the CMR area or non-SMR disk and the database index information stored in the non-SMR disk, so that the stored main index Information and database index information are updated without the need to perform frequent overwrite operations on the main index information and database index information in sequential write operations, thereby greatly reducing the invalid data in the SMR disk and increasing the storage resources of the SMR disk Utilization rate.
  • FIG. 1 is a schematic diagram of an SMR disk in the related art
  • FIG. 2 is a schematic structural diagram of a data storage system according to an embodiment of the application.
  • FIG. 3a is a schematic diagram of an SMR area in an SMR disk according to an embodiment of the application.
  • 3b is a schematic diagram of the main index block in the CMR area of the SMR disk according to an embodiment of the application;
  • FIG. 3c is a schematic diagram of preparing index blocks in the SMR area of the SMR disk according to an embodiment of the application.
  • FIG. 4 is a flowchart of a first implementation manner of a data storage method according to an embodiment of this application.
  • FIG. 5a is a schematic diagram of a storage area for storing video data in the embodiment shown in FIG. 4;
  • 5b is a schematic diagram of a storage area storing video index data in the embodiment shown in FIG. 4;
  • FIG. 6 is a flowchart of a second implementation manner of a data storage method according to an embodiment of this application.
  • FIG. 7 is a flowchart of a third implementation manner of a data storage method according to an embodiment of the application.
  • FIG. 8 is a flowchart of a fourth implementation manner of a data storage method according to an embodiment of this application.
  • FIG. 9 is a schematic diagram of a data transfer process in a data storage method shown in FIG. 8;
  • FIG. 10 is a schematic structural diagram of a data storage device according to an embodiment of the application.
  • FIG. 11 is a schematic structural diagram of an electronic device according to an embodiment of the application.
  • HM SMR High Speed Management SMR technology
  • the HM SMR disk is divided into two storage areas, a CMR area and an SMR.
  • the SMR area includes multiple storage areas, and the CMR area supports random read and write.
  • Each storage area in the SMR area only supports sequential writing, and multiple storage areas support parallel writing;
  • each storage area in the SMR area has a write pointer inside, and each write operation starts from the write pointer, and the write operation is based on
  • the physical sector size is aligned, a single read and write operation cannot span multiple storage areas, and the storage area where data has been written must be reset before the next reuse.
  • the application layer software can directly manage the complete life cycle of the storage area, including sequential writing of data in the storage area, recovery and resetting of the storage area, etc.
  • streaming data In the security industry, video data, pictures, and audio data are referred to as streaming data for short.
  • Streaming data has the characteristics of large data volume, more writes and less reading, and fast coverage.
  • the video index data corresponding to the video data is stored. In this way, as time progresses, the video index data of the video data will change accordingly. Therefore, it is necessary to sequentially write video index data that changes continuously as time advances in a storage area of the SMR disk.
  • the storage space of the video index data A is the same as that stored in the storage area of the SMR disk.
  • the video index data B is sequentially written in the adjacent storage space, where, relative to the video index data A, the time of the video data recorded in the video index data B has changed; further, after the time length t has elapsed again, the SMR disk
  • the video index data C is sequentially written in the storage space adjacent to the storage space where the video index data B is stored, wherein, relative to the video index data B, the video data recorded in the video index data C is Time has changed; in this way, by analogy, it is possible to perform frequent overwrite operations on the same data in a storage area of the SMR disk.
  • the embodiments of the present application provide a data storage method, device, electronic equipment, storage medium, and storage system to improve the storage resource utilization of SMR disks.
  • the SMR storage system may include: a processor 210, an SMR disk 220, and a non-SMR Disk 230.
  • the SMR disk includes a CMR area and an SMR area.
  • the SMR area includes multiple storage areas, and each storage area is logically divided into multiple storage blocks;
  • the storage block in the SMR disk 220 is used to store the data to be stored and the backup index information of the data to be stored;
  • the CMR area in the SMR disk 220 is used to store the main index information of the data to be stored;
  • the non-SMR disk 230 is used to store the database index information of the data to be stored
  • the processor 210 is configured to execute any data storage method embodiment of the embodiments of the present application at runtime.
  • the SMR disk may include a CMR area and an SMR area.
  • the SMR area includes multiple storage areas, and each storage area is logically divided into multiple storage blocks.
  • the SMR area includes: a storage area, a backup metadata area, and a reserved area.
  • the storage area is used to store the object data and the backup index information corresponding to the object data.
  • the object data and the backup index information of the object data are stored in the storage block.
  • each storage block includes an object block and a backup index block.
  • the object data is stored in the object block, and the backup index information of the object data is stored in the backup index block.
  • a storage area is divided into multiple object blocks and multiple backup index blocks, and each object block is followed by one
  • the backup index block is used as a backup index block corresponding to the object block.
  • the backup metadata area is used to store backup metadata information.
  • the reserved area is used as an intermediate medium when the object block is recycled.
  • the CMR area includes: a main metadata area and a main index storage area, and the main index storage area is divided into multiple main index blocks.
  • the main metadata area is used to store the main metadata information.
  • the main index storage area is used to store the main index information that is mutually backup with the backup index information, and the main index information is stored in the main index block. Then, for an object block in the storage area of the SMR area, in addition to having a corresponding backup index block in the SMR area, any object block in the storage area also has the same object block in the main index area. Corresponding to a main index block.
  • the SMR disk may have metadata information used to describe its structural attributes.
  • metadata information used to describe its structural attributes.
  • two pieces of metadata information including the primary metadata information and the backup metadata information can be generated.
  • the content of the above-mentioned primary metadata information and backup metadata information are consistent and mutually backup, which can include: the size of the CMR area, the size of the SMR area, the number of storage areas in the SMR area, the size of a single primary/backup index block, and a single Information such as the size of the object block, the initialization time of the file system, and the total number of available blocks in the file system.
  • the last storage area in the SMR area can be used as the backup metadata area to store the backup metadata information. In this way, the metadata information can be prevented from being lost after the CMR area is damaged.
  • the contents of the main index information and the backup index information corresponding to any object block are consistent and mutually backup.
  • Figure 3b shows the storage structure diagram of the main index storage area in the CMR area.
  • Can include: file system management data and Unit_key.
  • Unit_key is the unit key corresponding to the object block in the storage area in the SMR area.
  • the so-called unit key value can be understood as: a collection of key-value pairs corresponding to the stored data stored in the object block.
  • File system management data can include: object block number, Unit_key length, storage status of the object block (for example, free, used, or deleted, etc.), the length of the valid data stored in the object block, and the check value of the data stored in the object block , The write time of the object block.
  • the write time of the target block refers to the write time of the target data corresponding to the target block.
  • the main index storage area may include one main index storage area, or may include multiple consecutive main index storage areas. As shown in FIG. 3b, each main index storage area may include multiple main index blocks, and each main index block (main index block 1 to main index block N) is continuously distributed. That is, for a storage area in the SMR area, in the main index storage area, the main index information corresponding to each object block in the storage area is continuously stored.
  • the backup index block in each storage block in the SMR area may also include: file system management data and Unit_key, so that the backup index block can correspond to the main index block in FIG. 3b.
  • each primary index block refers to: for multiple continuous storage blocks in a storage area in the SMR area, the backup index information stored in the backup index block in the multiple storage blocks ,
  • the main index storage area in the CMR area is also continuously stored according to the multiple consecutive main index blocks.
  • streaming data is stored as object data in the object blocks in the storage area of the SMR area.
  • Each object block corresponds to the main index information and the backup index information that have the same content and are mutually backup.
  • the main index information is stored in In the main index storage area of the CMR area, the backup index information is stored in the storage area of the SMR area.
  • the non-SMR disk may include a solid state drive.
  • FIG. 4 it is a flowchart of a first implementation manner of a data storage method according to an embodiment of the present application.
  • the method may include:
  • a data storage instruction may be sent to the above-mentioned data storage system.
  • the data storage instruction may include the data to be stored.
  • the data to be stored can be obtained.
  • the user may use a terminal device to send a data storage instruction to the data storage system.
  • the terminal device may include a personal computer, a smart phone, and so on.
  • the terminal device may call an application program interface of the data storage system to send the data storage instruction to the application program interface, and the data storage system may obtain the data storage instruction through the application program interface.
  • the data storage instruction may also include the data type identification of the data to be stored, and the aforementioned data storage system may determine the data type identification of the data to be stored after acquiring the data to be stored.
  • the data type of the stored data when the data storage instruction includes the data type identification of the data to be stored, then the data type identification of the data to be stored can be obtained to obtain the data type of the data to be stored. Therefore, the above-mentioned step of determining the data type of the data to be stored based on the data type identification of the data to be stored is the step of "learning the data type of the data to be stored based on the data type identification of the data to be stored". From this point of view, the action of determining is not actually performed, as long as the data type of the data to be stored is known.
  • S420 Determine a target storage area that is the same as the data type of the data to be stored based on the data type of the data stored in each storage area in the SMR disk.
  • S430 Determine a target storage block to be written into the data to be stored in the target storage area.
  • the data storage system determines the data type of the data to be stored, in order to store the data to be stored according to the data type of the data to be stored, it may be based on the data type of the data stored in each storage area in the SMR disk, Determine the target storage area with the same data type as the data to be stored, and then determine the target storage block in the target storage area.
  • the so-called target storage area with the same data type as the data to be stored refers to the target storage area in which the data type of the stored data is the same as the data type of the data to be stored. That is, the data type of the data stored in the target storage area is the same as the data type of the data to be stored.
  • one storage area can be selected from the at least one storage area as Target storage area.
  • a storage area with available storage blocks can be selected as the target storage area in the at least one storage area.
  • the data storage system may select a storage block in the target storage area as the target storage block for the data to be stored. For example, a free storage block in the target storage area is used as the target storage block.
  • S440 Based on the identifier of the target storage block, generate main index information and backup index information of the data to be stored;
  • S450 Generate database index information of the data to be stored based on the identification of the data to be stored and the target storage block;
  • S460 Write the backup index information of the data to be stored and the data to be stored into the target storage block, write the primary index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored into the non-SMR Disk.
  • the primary index information and backup index information of the data to be stored can be generated based on the identification of the target storage block.
  • the identification of the data to be stored and the target storage block generates the database index information of the data to be stored.
  • the content of the so-called main index information and the backup index information are consistent and mutually backup, and the main index information and the backup index information can be used to locate the stored data to be queried in the SMR disk.
  • the identification of the target storage block when generating the primary index information and backup index information of the data to be stored, the identification of the target storage block, the identification of the target storage area where the target storage block is located, and the data of the data to be stored can be determined.
  • the type identification, the data volume of the data to be stored, and the storage area of the data to be stored in the target storage block are used to generate the main index information and the backup index information of the data to be stored using the various types of information determined above.
  • the SMR disk can be used as the hardware support of the database, so that the database can correspond to at least one SMR disk.
  • the distributed database may correspond to multiple SMR disks, and storing data in the distributed database means that the data is stored in multiple SMR disks corresponding to the distributed database. Therefore, when querying the stored data in the distributed database, it is necessary to determine which SMR disk of the multiple SMR disks corresponding to the distributed database is stored.
  • the database index information of the data to be stored needs to be generated, and the database index information can be used to query the stored data in the SMR disk corresponding to the database.
  • the unit key of the data to be stored may be obtained from the above-mentioned data storage instruction, and then based on the data to be stored.
  • the unit key of the stored data and the identification of the target storage block generate the database index information of the data to be stored.
  • the identifier of the target storage block may be the serial number of the target storage block in the SMR area.
  • the identification of the SMR disk, the identification of the target storage area where the target storage block is located, the identification of the data type of the data to be stored, and the data of the data to be stored can be further determined.
  • the amount and the storage area of the data to be stored in the target storage block are used to generate the database index information of the data to be stored using the various types of information determined above.
  • the sequence number of the storage block in the SMR area is counted according to the number of storage blocks in the SMR area.
  • the maximum sequence number of the storage block is the total number of all storage blocks in the SMR area. Therefore, when generating database index information, there is no need to use the identification information of the storage area.
  • the serial number of the storage block in the SMR area may be used to generate the database index information for generating the data to be stored.
  • the identification information of the target storage area where the target data block is located may not be used.
  • the above-mentioned data storage system may adopt a three-level index, including a database index, a primary index, and a backup index.
  • the database index is a primary index
  • the primary index is a secondary index
  • the standby index is a tertiary index.
  • the database index information of the data to be stored can be stored in the non-SMR disk, and the data of the data to be stored can be stored in the non-SMR disk.
  • the backup index information and the data to be stored are stored in the storage block in the storage area of the SMR area, and the main index information is stored in the CMR area of the SMR disk or stored in the non-SMR disk.
  • the target storage block may include a target object block and a target index block.
  • the target index block is adjacent to the target object block. Based on this, the backup index information of the data to be stored may be stored in the target index block. , Store the to-be-stored data in the target object block.
  • the backup index information of the data to be stored and the data to be stored can be written into the target storage block, and the primary index information of the data to be stored can be written to the target storage block.
  • the index information is written to the CMR area or non-SMR disk, and the database index information of the data to be stored is written to the non-SMR disk, so that after the data to be stored is stored, it is convenient for subsequent reading.
  • SMR disks in order to ensure data consistency and avoid storing the same data in multiple SMR disks, here, when generating the database index information of the data to be stored, it can also be based on the unit key of the data to be stored , The WWN (World Wide Name, the hardware's globally unique identifier) of the SMR disk and the identification of the target storage block are used to generate database index information for the data to be stored.
  • the WWN World Wide Name, the hardware's globally unique identifier
  • the target storage area with the same data type as the video data can be determined, and then the data type A storage block in the target storage areas with the same data type of the video data is determined as the target storage block for storing the video data.
  • the so-called target storage area with the same data type as the video data refers to: in each storage area in the SMR disk, the data type of the stored data is the same as the data type of the video data.
  • the video data may be stored in the target object block of the target storage block of the video data, and the backup index information of the video data may be stored in the target index block after the target object block of the video data.
  • the storage area for storing the video data may be the storage area shown in FIG. 5a. In the storage area, there are N-1 storage blocks, and each storage block stores one video data, then N-1 videos can be stored. data.
  • the data to be stored obtained by the data storage system is video index data
  • the target storage area with the same data type as the video index data can be determined , And then determine a storage block in the target storage area with the same data type as the video index data as the target storage block for storing the video index data.
  • the so-called target storage area with the same data type as the video index data refers to: in each storage area in the SMR disk, the data type of the stored data is the same as the data type of the video index data.
  • the video index data can be stored in the target object block of the target storage block of the video index data, and the backup index information of the video index data can be stored in the target index block after the target object block of the video index data .
  • the storage area for storing the video index data may be the storage area shown in FIG. 5b. In the storage area, there are N-1 storage blocks, and each storage block stores one video index data, then N-1 Video index data.
  • the data type of the data to be stored can be determined; then, the data type can be determined based on the data type of the data stored in each storage area in the SMR disk.
  • the target storage area with the same data type of the data to be stored; the target storage block to be written to the data to be stored is determined in the target storage area; after the target storage block is determined, based on the identification of the target storage block, the target storage block of the data to be stored can be generated Primary index information and backup index information; based on the identification of the data to be stored and the target storage block, the database index information of the data to be stored is generated; finally, the backup index information of the data to be stored and the data to be stored can be written into the target storage block, and the The main index information of the data to be stored is written to the CMR area or non-SMR disk, and the database index information of the data to be stored is written to the non-SMR disk.
  • the data of the same data type can be stored in the same storage area; because the data of the same data type usually has the same or similar overwrite operation frequency, therefore, the data with the same or similar overwrite operation will be stored.
  • it is convenient to reclaim the fragments generated in the storage area in time according to the frequency of overwriting and writing of the data, thereby reducing the amount of fragments, thereby improving the storage resource utilization of the SMR disk.
  • the main index information of the data to be stored is written to the CMR area or non-SMR disk
  • the database index information of the data to be stored is written to the non-SMR disk. Since the CMR area or non-SMR disk supports the delete operation, When the main index information and database index information of the data are more detailed, you can directly locate the main index information stored in the CMR area or the non-SMR disk and the database index information stored in the non-SMR disk. Index information and database index information are updated without frequent overwriting operations on the main index information and database index information, thereby greatly reducing invalid data in the SMR disk and improving the storage resource utilization of the SMR disk.
  • the embodiment of the present application also provides a possible implementation manner.
  • the second method of the data storage method in this embodiment of the present application is shown in FIG.
  • a flowchart of an implementation manner, the method may include:
  • step S620 Determine whether there is a storage area storing stored data of the same data type as the data to be stored in the storage area of stored data; if it exists, perform step S630, if not, perform step S640.
  • S630 Use a storage area storing stored data of the same data type as the data to be stored as a target storage area.
  • S640 Select a free storage area in the SMR disk and determine it as the target storage area.
  • the data type of the data stored in the above-mentioned stored data storage area may be the same as the data type of the data to be stored, or it may be different from the data type of the data to be stored, in order to determine the stored data
  • whether there is a storage area storing stored data of the same data type as the data to be stored can be based on the data type identification of the data stored in each stored data storage area and the data type of the data to be stored Identification, judging whether there is a storage area storing stored data of the same data type as the data to be stored in the storage area where the data is stored.
  • the storage area storing the stored data of the same data type as the data to be stored can be stored The area is used as the target storage area.
  • the data type of the data stored in each storage area can be determined, so as to determine the data of the data stored in each storage area In the type, whether there is a data type that is the same as the data type of the data to be stored. If there is, then the storage area storing the data of the data type to be stored can be used as the target storage area.
  • the multiple storage areas that store the stored data of the same data type as the data to be stored can be used. Select a storage area with free storage blocks as the target storage area.
  • the data type of the data to be stored is different from the data stored in any storage block in the storage area of the stored data.
  • the data types are different.
  • S650 Determine a target storage block to be written into the data to be stored in the target storage area
  • S660 Based on the identifier of the target storage block, generate main index information and backup index information of the data to be stored;
  • S670 Generate database index information of the data to be stored based on the identification of the data to be stored and the target storage block;
  • S680 Write the backup index information of the data to be stored and the data to be stored into the target storage block, write the primary index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored into the non-SMR Disk.
  • the target storage area is determined for the data to be stored, so that the subsequent steps can be implemented The storage of the data to be stored.
  • steps S610, S650 to S680 in the embodiment of the present application are the same as steps SS410, S430 to S460 in the first implementation manner, and will not be repeated here.
  • the embodiment of the present application also provides a possible implementation manner.
  • the third data storage method of the embodiment of the present application is shown in FIG.
  • a flowchart of an implementation manner, the method may include:
  • S720 Determine a target storage area with the same data type as the data to be stored based on the data type of the data stored in each storage area in the SMR disk;
  • S730 Determine a target storage block to be written into the data to be stored in the target storage area
  • S750 Generate database index information of the data to be stored based on the identification of the data to be stored and the target storage block;
  • S760 Obtain the unit key of the data to be stored, and search the non-SMR disk for whether there is database index information with the same unit key as the data to be stored; if it exists, perform step S770;
  • S770 Determine the main index information to be deleted based on the identification information of the storage block in the database index information that has the same unit key as the data to be stored;
  • S780 Delete the main index information to be deleted in the CMR area.
  • the data to be stored may be stored in the storage area for the first time, or may be updated data stored in the storage area.
  • the unit key of the to-be-stored data can be acquired first.
  • the data to be stored when the data to be stored is stored in the database, the data to be stored may be stored in the form of a key-value pair.
  • the database may assign a unit key to the data to be stored. It is understandable that the database is based on SMR disks and non-SMR disks in the storage system and exists in the form of software.
  • step S790 After obtaining the unit key of the data to be stored, it can be searched in the non-SMR disk whether there is database index information that has the same unit key as the data to be stored.
  • database index information that has the same unit key as the data to be stored, it means that the data to be stored is the data that updates the data stored in the SMR disk.
  • the database indexes information it means that the data to be stored is stored in the SMR disk for the first time. Then step S790 can be directly executed.
  • the database index information stored in the non-SMR disk may include the The unit key of the stored data corresponding to the database index information, that is, the unit key exists in each database index information stored in the non-SMR disk.
  • the so-called database index information that has the same unit key as the data to be stored refers to the database index information that has the same unit key as the unit key of the data to be stored.
  • the primary index information of the data is unique.
  • the main index information to be deleted may be determined based on the identification information of the storage block in the database index information having the same unit key as the data to be stored.
  • the storage block that stores the same data as the data to be stored can be determined based on the unit key of the data to be stored. Identification, and then the corresponding storage block can be determined. Since the backup index information stored in the storage block and the main index information are mutually backups, after obtaining the backup index information stored in the storage block, the main index information to be deleted can be determined.
  • the stored data corresponding to the main index information to be deleted is data updated using the to-be-stored data.
  • the main index information to be deleted when the main index information to be deleted is stored in the CMR area of the SMR disk, the main index information to be deleted stored in the CMR area can be deleted, and when the main index information to be deleted is stored When it is in a non-SMR disk, the to-be-deleted primary index information stored in the non-SMR disk can be deleted.
  • the uniqueness of the main index information can be guaranteed. Avoid getting the data before the update.
  • S790 Write the backup index information of the data to be stored and the data to be stored into the target storage block, write the main index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored into the non-SMR Disk.
  • the aforementioned storage area may be provided with a state, and the state may include an idle state, a busy state, and a full state.
  • the state of the target storage area can be set to a busy state, so as to avoid determining the target storage area as a storage area for other data to be stored.
  • steps S710 to S750 and S790 in this embodiment of the present application are the same as steps S410 to S450 and S460 in the first implementation manner, and will not be repeated here.
  • the embodiment of the present application also provides a possible implementation manner.
  • the fourth implementation of a data storage method in this embodiment of the present application A flowchart of the method, the method may include:
  • S820 Determine a target storage area that is the same as the data type of the data to be stored based on the data type of the data stored in each storage area in the SMR disk;
  • S830 Determine a target storage block to be written into the data to be stored in the target storage area
  • S840 Based on the identifier of the target storage block, generate main index information and backup index information of the data to be stored;
  • S850 Generate database index information of the data to be stored based on the identification of the data to be stored and the target storage block;
  • S860 Write the backup index information of the data to be stored and the data to be stored into the target storage block, write the primary index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored into the non-SMR Disk.
  • S870 When receiving the cleaning instruction for the SMR disk, determine the first storage with 0 available storage blocks in the SMR disk based on the allocated storage amount, the number of storage areas, and the allocated storage amount of the storage block in the SMR area stored in the metadata area Area and the number of storage blocks in each first storage area;
  • S880 For each first storage area, determine the number of effective storage blocks in the first storage area based on database index information and the number of storage blocks in the first storage area, where the data stored in the effective storage block is valid data;
  • S890 Based on the number of effective storage blocks in each first storage area, determine whether the first storage area is a storage area to be cleaned, and if so, reset and clean the storage area to be cleaned.
  • some data when the data to be stored is stored according to different data types, some data have a higher update frequency, and some data have a lower update frequency.
  • video data does not need to be updated after it is stored in the storage area. After the video index data is stored in the storage area, it is usually updated frequently.
  • a new storage block is usually selected for storage in the storage area of the video index data.
  • the updated video index data and database index information are generated based on the identifier of the newly selected storage block, and the storage block storing the video index data before the update becomes an invalid storage block.
  • the invalid storage block can be reset and recycled.
  • the so-called resetting and cleaning of the storage area to be cleaned refers to: cleaning the data in the storage area to be cleaned, so that the storage area to be cleaned is reset to realize the recovery of the storage area to be cleaned.
  • the user can use the terminal device to send a cleaning instruction to the data storage system.
  • the data storage system can determine the storage area to be cleaned, and then reset and clean the storage area to be cleaned.
  • the CMR area may include: a metadata area, which may store the allocated storage amount, the number of storage areas, and the allocated storage amount of the storage block of the SMR area, where the allocated storage amount of the SMR area is the The total allocated size of the SMR area.
  • the allocated storage amount of the storage block is the size allocated to each storage block.
  • the above-mentioned data storage system can calculate the size of each storage area based on the allocated storage amount and the number of storage areas in the SMR area, and then can calculate the storage area based on the size of each storage area and the allocated storage capacity of the storage block. The number of storage blocks.
  • the above data storage system calculates the number of storage blocks in each storage area, for each storage area, the number of storage blocks with data stored in the storage area can be counted, and then it can be based on the storage blocks in each storage area. And the number of storage blocks with data stored in the storage area, determine whether the available storage block in the storage area is 0, if it is 0, the storage area with the available storage block being 0 can be used as the first storage area In this way, all the first storage areas in the SMR area and the number of storage blocks in each first storage area can be obtained.
  • the aforementioned data storage system can determine the storage block with database index information in the first storage area based on the database index information and the number of storage blocks in the first storage area, and then The storage block with database index information is determined as the effective storage block in the first storage area, so that the number of effective storage blocks in the first storage area can be obtained by statistics.
  • the first storage area is a storage area to be cleaned based on the number of effective storage blocks in each first storage area. For example, when the number of effective storage blocks in the first storage area is less than the preset cleaning threshold, the first storage area may be determined as the storage area to be cleaned. Then the storage area to be cleaned can be reset and cleaned. In order to realize the timely recovery of the storage area and increase the utilization rate of the storage space of the SMR disk.
  • the storage area to be cleaned may also store valid data.
  • each storage area to be cleaned may be reset.
  • the target paste storage area that is the same as the data type of the data to be copied can be determined; in order to transfer the valid data to the target paste storage District.
  • the so-called destination paste storage area with the same data type as the data to be copied refers to the destination in which the data type of the stored data is the same as the data type of the data to be copied in each storage area in the SMR disk except the clean storage area
  • the paste storage area, that is, the determined target paste storage area is a storage area in the SMR disk other than the cleanup storage area, and the data type of the data stored in the storage area is the same as the data type of the data to be copied.
  • the target paste storage block of the data to be copied to be pasted can be determined in the target paste storage area. Then, based on the identification of the target paste storage block, the primary index information and backup index information of the data to be copied can be generated; based on the identification of the data to be copied and the target paste storage block, the database index information of the data to be copied can be generated.
  • the data to be copied in the effective storage block can be copied, the backup index information of the data to be copied and the copied data to be copied can be written into the target paste storage block, and the main index information of the data to be copied can be written into the CMR area or non- SMR disk, and write the database index information of the data to be copied to the non-SMR disk.
  • the valid data stored in the storage area to be cleaned can be transferred to the storage area of the same data type as the valid data, so that the valid data can be avoided from being cleaned up.
  • the non-SMR disk and the data to be copied can also be deleted Database index information with the same unit key.
  • the so-called database index information in the non-SMR disk that has the same unit key as the data to be copied refers to the database whose unit key is the same as the unit key of the data to be copied in each database index information stored in the non-SMR disk Index information.
  • the storage areas to be cleaned up determined through the above steps are storage area 1 and storage area 2 shown in FIG. 9, where storage block A and storage block B in storage area 1 are storage blocks to be copied, and storage area 2 Storage block C and storage block D in are also storage blocks to be copied. Assuming that the data types of the data stored in storage area 1 and storage area 2 are the same, it can be determined that the target paste storage area is storage 3.
  • the storage blocks to be pasted can be determined for storage block A, storage block B, storage block C, and storage block D in storage area 3 respectively, assuming that the storage block to be pasted determined for storage block A is storage block A', which is The storage block to be pasted determined by storage block B is storage block B', the storage block to be pasted determined for storage block C is storage block C', and the storage block to be pasted determined for storage block D is storage block D', Then you can copy and paste the data stored in storage block A to storage block A', copy and paste the data stored in storage block B to storage block B', and copy and paste the data stored in storage block C to storage block C'. , Copy and paste the data stored in the storage block D to the storage block D'; finally, reset and clean the storage area 1 and storage area 2.
  • steps S810 to S860 in the embodiment of the present application are the same as steps S410 to S460 in the first implementation manner, and will not be repeated here.
  • the embodiment of the present application also provides a data storage device, which can be applied to the shingled magnetic recording SMR storage system.
  • the SMR storage system includes SMR disks and non-SMR disks; SMR disks Including traditional magnetic recording CMR area and SMR area, the SMR area includes multiple storage areas, each storage area is logically divided into multiple storage blocks; referring to FIG. 10, the device may include:
  • the first data type determining module 1010 is configured to determine the data type of the data to be stored when the data to be stored is acquired;
  • the target storage area determination module 1020 is configured to determine a target storage area that is the same as the data type of the data to be stored based on the data type of the data stored in each storage area in the SMR disk;
  • the target storage block determining module 1030 is configured to determine the target storage block to which the data to be stored is to be written in the target storage area;
  • the first index information generating module 1040 is configured to generate main index information and backup index information of the data to be stored based on the identifier of the target storage block;
  • the second index information generating module 1050 is configured to generate database index information of the data to be stored based on the identification of the data to be stored and the target storage block;
  • the storage module 1060 is used to write the backup index information of the data to be stored and the data to be stored into the target storage block, write the main index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored Write to a non-SMR disk.
  • the data storage device provided in the embodiment of the present application can determine the data type of the data to be stored when the data to be stored is obtained; then, the data type can be determined based on the data type of the data stored in each storage area in the SMR disk.
  • the target storage area with the same data type of the data to be stored; the target storage block to be written to the data to be stored is determined in the target storage area; after the target storage block is determined, based on the identification of the target storage block, the target storage block of the data to be stored can be generated Primary index information and backup index information; based on the identification of the data to be stored and the target storage block, the database index information of the data to be stored is generated; finally, the backup index information of the data to be stored and the data to be stored can be written into the target storage block, and the The main index information of the data to be stored is written to the CMR area or non-SMR disk, and the database index information of the data to be stored is written to the non-SMR disk.
  • the data of the same data type can be stored in the same storage area; because the data of the same data type usually has the same or similar overwrite operation frequency, therefore, the data with the same or similar overwrite operation will be stored.
  • Stored in the same storage area so as to facilitate timely recovery of fragments generated in the storage area according to the frequency of overwriting and writing of the data, reduce the amount of fragments, and thereby improve the storage resource utilization of the SMR disk.
  • the main index information of the data to be stored is written to the CMR area or non-SMR disk
  • the database index information of the data to be stored is written to the non-SMR disk. Since the CMR area or non-SMR disk supports the delete operation, When the main index information and database index information of the data are more detailed, you can directly locate the main index information stored in the CMR area or the non-SMR disk and the database index information stored in the non-SMR disk. Index information and database index information are updated without frequent overwriting operations on the main index information and database index information, thereby greatly reducing invalid data in the SMR disk and improving the storage resource utilization of the SMR disk.
  • the target storage area determination module 1020 may include: a judging sub-module for judging whether there is a storage area storing stored data of the same data type as the data to be stored in the storage area of the stored data ; If it exists, trigger the first target storage area determination sub-module, if it does not exist, trigger the second target storage area determination sub-module; the first target storage area determination sub-module is used to store the same data type as the data to be stored The storage area of the stored data is used as the target storage area; the second target storage area determining sub-module is used to select an idle storage area in the SMR disk and determine it as the target storage area.
  • the CMR area includes: a metadata area in which the data type identification of the data stored in the storage area of each stored data is stored;
  • the first data type determination module 1010 includes: the first data type identification acquisition The sub-module is used to obtain the data to be stored and the data type identification of the data to be stored received through the application program interface; the first data type determination sub-module is used to determine the data type of the data to be stored based on the data type identification of the data to be stored ; Judgment sub-module, specifically used to: based on the data type identification of the data stored in the storage area of each stored data and the data type identification of the data to be stored, determine whether there is stored and to-be-stored data in the storage area of the stored data A storage area with stored data of the same data type.
  • the data storage device may further include: a search module for obtaining the unit key of the data to be stored, and searching in the non-SMR disk whether there is database index information with the same unit key as the data to be stored; if Exist, trigger the information determination module to be deleted;
  • the information determination module to be deleted is used to determine the main index information to be deleted based on the identification information of the storage block in the database index information having the same unit key as the data to be stored; the first deletion module, Used to delete the main index information to be deleted in the CMR area.
  • the CMR area includes: a metadata area
  • the data storage device may further include: a first storage area determining module, configured to, when a cleaning instruction for the SMR disk is received, based on the SMR stored in the metadata area The allocated storage capacity of the area, the number of storage areas and the allocated storage capacity of storage blocks, determine the first storage area with 0 available storage blocks in the SMR disk and the number of storage blocks in each first storage area; the valid data block quantity determination module, For each first storage area, based on the database index information and the number of storage blocks in the first storage area, determine the number of effective storage blocks in the first storage area, where the data stored in the effective storage block is valid Data; the storage area to be cleaned up determining module, used to determine whether the first storage area is the storage area to be cleaned based on the number of effective storage blocks in each first storage area, and if so, trigger the cleaning module; the cleaning module for Reset and clean the storage area to be cleaned.
  • a first storage area determining module configured to, when a cleaning instruction for the SMR disk
  • the cleaning module may include: a second data type determining module, configured to determine the data type of the data to be copied stored in the storage area to be cleaned when the number of effective storage blocks in the storage area to be cleaned is not 0 ;
  • the target paste storage area determination module is used to determine the target paste storage area that is the same as the data type of the data to be copied based on the data type of the data stored in each storage area except the storage area to be cleaned in the SMR disk;
  • the storage block determination module is used to determine the target paste storage block of the data to be copied to be pasted in the target paste storage area;
  • the third index information determination module is used to generate the main index information of the data to be copied based on the identification of the target paste storage block And prepare index information;
  • the fourth index information determination module is used to generate the database index information of the data to be copied based on the data to be copied and the identification of the target paste storage block;
  • the paste module is used to copy the data to be copied in the effective storage block, And write the backup index information of the data
  • the data storage device may further include: a second deletion module, configured to delete database index information in the non-SMR disk that has the same unit key as the data to be copied.
  • the data to be stored includes video data and/or video index data
  • the first data type determination module 1010 is specifically configured to: determine the data type of the video data when the video data is acquired; and/or, when the video data is acquired When it comes to the video index data, determine the data type of the video index data
  • the target storage area determination module 1020 is specifically used to: determine the data type of the video data based on the data type of the data stored in each storage area in the SMR disk And/or, based on the data type of the data stored in each storage area in the SMR disk, determine the target storage area with the same data type as the video index data.
  • An embodiment of the present application also provides an electronic device, as shown in FIG. 11, including a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104.
  • the processor 1101, the communication interface 1102, and the memory 1103 pass through the communication bus 1104. Completing mutual communication; memory 1103, used to store computer programs; processor 1101, used to execute the programs stored in the memory 1103, to implement the following method steps: when the data to be stored is obtained, the data of the data to be stored is determined Type: Based on the data type of the data stored in each storage area in the SMR disk, determine the target storage area with the same data type as the data to be stored; determine the target storage block to be written to the data to be stored in the target storage area; Based on the identification of the target storage block, generate the primary index information and backup index information of the data to be stored; generate the database index information of the data to be stored based on the identification of the data to be stored and the target storage block; combine the backup index information and the backup index information of the data to be stored The storage data is written to
  • An electronic device provided by an embodiment of the present application can determine the data type of the data to be stored when it obtains the data to be stored; then, the data type of the data stored in each storage area in the SMR disk can be used to determine the data type and the data type of the data stored in each storage area of the SMR disk.
  • the main index information of the stored data is written to the CMR area or non-SMR disk, and the database index information of the data to be stored is written to the non-SMR disk.
  • the data of the same data type can be stored in the same storage area; because the data of the same data type usually has the same or similar overwrite operation frequency, therefore, the data with the same or similar overwrite operation will be stored.
  • Stored in the same storage area so as to facilitate timely recovery of fragments generated in the storage area according to the frequency of overwriting and writing of the data, reduce the amount of fragments, and thereby improve the storage resource utilization of the SMR disk.
  • the main index information of the data to be stored is written to the CMR area or non-SMR disk
  • the database index information of the data to be stored is written to the non-SMR disk. Since the CMR area or non-SMR disk supports the delete operation, When the main index information and database index information of the data are more detailed, you can directly locate the main index information stored in the CMR area or the non-SMR disk and the database index information stored in the non-SMR disk. Index information and database index information are updated without frequent overwriting operations on the main index information and database index information, thereby greatly reducing invalid data in the SMR disk and improving the storage resource utilization of the SMR disk.
  • the communication bus 1104 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 1102 is used for communication between the aforementioned electronic device and other devices.
  • the memory 1103 may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk storage.
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located far away from the foregoing processor.
  • the aforementioned processor 1101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), dedicated Integrated Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the embodiment of the present 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 following method steps are implemented:
  • the data type of the data to be stored is determined
  • the computer-readable storage medium provided by the embodiment of the present application can determine the data type of the data to be stored when the data to be stored is obtained; then, it can be based on the data type of the data stored in each storage area in the SMR disk, Determine the target storage area with the same data type as the data to be stored; determine the target storage block to be written to the data to be stored in the target storage area; after the target storage block is determined, the target storage block can be generated based on the identification of the target storage block.
  • the main index information and backup index information of the data based on the identification of the data to be stored and the target storage block, the database index information of the data to be stored is generated; finally, the backup index information of the data to be stored and the data to be stored can be written into the target storage block , Write the main index information of the data to be stored into the CMR area or non-SMR disk, and write the database index information of the data to be stored into the non-SMR disk.
  • the data of the same data type can be stored in the same storage area; because the data of the same data type usually has the same or similar overwrite operation frequency, therefore, the data with the same or similar overwrite operation will be stored.
  • Stored in the same storage area so as to facilitate timely recovery of fragments generated in the storage area according to the frequency of overwriting and writing of the data, reduce the amount of fragments, and thereby improve the storage resource utilization of the SMR disk.
  • the main index information of the data to be stored is written to the CMR area or non-SMR disk
  • the database index information of the data to be stored is written to the non-SMR disk. Since the CMR area or non-SMR disk supports the delete operation, When the main index information and database index information of the data are more detailed, you can directly locate the main index information stored in the CMR area or the non-SMR disk and the database index information stored in the non-SMR disk. Index information and database index information are updated without frequent overwriting operations on the main index information and database index information, thereby greatly reducing invalid data in the SMR disk and improving the storage resource utilization of the SMR disk.
  • the embodiments of the present application also provide a computer program product containing instructions, which when executed by a processor implements any embodiment of the data storage method in the embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据存储方法、装置及存储系统,其中,该方法包括:在获取到待存储数据时,确定待存储数据的数据类型(S410);基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区(S420);在目标存储区中确定待写入待存储数据的目标存储块(S430);基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息(S440);基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息(S450);将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘(S460)。从而可以提高SMR磁盘的存储资源利用率。

Description

数据存储方法、装置及存储系统
本申请要求于2019年11月27日提交中国专利局、申请号为201911181875.5发明名称为“数据存储方法、装置及存储系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据存储技术领域,特别是涉及一种数据存储方法、装置及存储系统。
背景技术
随着信息技术的发展,各种各样的电子设备会产生大量的数据,为了定期对该数据进行分析处理,需要先将该数据存储到存储介质中,例如,存储到软盘、光盘、磁盘、闪存、U盘(USB flash drive,USB闪存盘)、SM(Smart Media)卡、记忆棒等存储介质中,其中,USB为Universal Serial Bus(通用串行总线)的缩写。
为了使得单个磁盘能够存储更多的数据,现有技术中出现了SMR(Shingled Magneting Recording,叠瓦式磁记录)磁盘,在SMR磁盘中,各个数据磁道之间如同屋顶上的瓦片一样部分重叠,这样可以使得在写入数据时,在相同的面积内容纳了更多的磁道,从而提高了存储面密度,增加了单个磁盘的存储容量。
然而,发明人发现,在现有技术中,通常是按照接收到的数据写入指令的先后顺序来将待写入数据写入到SMR磁盘中的。由于SMR磁盘的一个存储区只能顺序写入,当在该SMR磁盘的一个存储区中对同一个数据进行频繁的覆盖写入操作时,存储该数据的存储块中,只有最后一个存储该数据的存储块中存储的是有效数据,其他存储块中存储的该数据均为无效数据,并且该存储区的存储块不支持删除操作,容易导致该SMR磁盘出现大量碎片,如果这些碎片不能及时回收,则使得该SMR磁盘的存储资源利用率不高。
发明内容
本申请实施例的目的在于提供一种数据存储方法、装置及存储系统,以提高SMR磁盘的存储资源利用率。具体技术方案如下:
第一方面,本申请实施例提供了一种数据存储方法,应用于叠瓦式磁记录SMR存储系统,SMR存储系统包括SMR磁盘及非SMR磁盘;SMR磁盘包括传统式磁记录CMR(conventional magnetic recording,传统式磁记录)区域及SMR区域,SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;该方法包括:在获取到待存储数据时,确定待存储数据的数据类型;基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
第二方面,本申请实施例还提供了一种数据存储装置,应用于叠瓦式磁记录SMR存储系统,SMR存储系统包括SMR磁盘及非SMR磁盘;SMR磁盘包括传统式磁记录CMR区域及SMR区域,SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;装置包括:第一数据类型确定模块,用于在获取到待存储数据时,确定待存储数据的数据类型;目标存储区确定模块,用于基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;目标存储块确定模块,用于在目标存储区中确定待写入待存储数据的目标存储块;第一索引信息生成模块,用于基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;第二索引信息生成模块,用于基于待存储 数据以及目标存储块的标识,生成待存储数据的数据库索引信息;存储模块,用于将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
第三方面,本申请实施例还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;存储器,用于存放计算机程序;处理器,用于执行存储器上所存放的程序时,实现上述第一方面的方法步骤。
第四方面,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现权利要求1-8任一的方法步骤。
第五方面,本申请实施例还提供了一种SMR存储系统,SMR存储系统包括:SMR磁盘、非SMR磁盘及处理器,SMR磁盘包括CMR区域及SMR区域,SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;存储块用于存储待存储数据及待存储数据的备索引信息;CMR区域用于存储待存储数据的主索引信息;非SMR磁盘用于存储待存储数据的数据库索引信息;处理器用于在运行时执行上述第一方面的数据存储方法。
第六方面,本发明实施例还提供了一种包含指令的计算机程序产品,当其被处理器执行时,实现上述第一方面的方法步骤。
本申请实施例提供的一种数据存储方法、装置、电子设备、存储介质及存储系统,在获取到待存储数据时,可以确定待存储数据的数据类型;然后可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;在确定出目标存储块后,可以基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;最后,可以将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。这样,可以使得相同数据类型的数据,存储到同一个存储区;由于相同数据类型的数据,通常具有相同或相近的覆盖写入操作频率,因此,将具有相同或相近的覆盖写入操作的数据存储到同一个存储区中,以方便按照该数据的覆盖写入操作频率,对该存储区中产生的碎片进行及时回收,减少碎片量,进而可以提高SMR磁盘的存储资源利用率。
其中,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘,由于CMR区域或非SMR磁盘支持删除操作,因此,在对待存储数据的主索引信息和数据库索引信息进行更新时,可以直接定位到CMR区域或非SMR磁盘中所存储的主索引信息以及非SMR磁盘中所存储的数据库索引信息,从而,对所存储的主索引信息和数据库索引信息进行更新,而无需对主索引信息和数据库索引信息按照顺序写入操作进行频繁的覆盖写入操作,从而,可以大量减少了SMR磁盘中的无效数据,提高SMR磁盘的存储资源利用率。
当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。
附图说明
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为相关技术中SMR磁盘的一种示意图;
图2为本申请实施例的一种数据存储系统的结构示意图;
图3a为本申请实施例的SMR磁盘中SMR区域的示意图;
图3b为本申请实施例的SMR磁盘的CMR区域中主索引块的示意图;
图3c为本申请实施例的SMR磁盘的SMR区域中备索引块的示意图;
图4为本申请实施例的一种数据存储方法第一种实施方式的流程图;
图5a为图4所示的实施方式中存储视频数据的存储区的示意图;
图5b为图4所示的实施方式中存储视频索引数据的存储区的示意图;
图6为本申请实施例的一种数据存储方法第二种实施方式的流程图;
图7为本申请实施例的一种数据存储方法第三种实施方式的流程图;
图8为本申请实施例的一种数据存储方法第四种实施方式的流程图;
图9为图8所示的一种数据存储方法中数据转移过程的示意图;
图10为本申请实施例的一种数据存储装置的结构示意图;
图11为本申请实施例的一种电子设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
相关技术中,为了增加SMR磁盘的读写效率,采用了HM(Host Manage,主机管理)SMR技术。参见图1,HM SMR磁盘分为CMR区域与SMR两个存储区域,该SMR区域包括多个存储区,CMR区域支持随机读写。SMR区域中的每个存储区内仅支持顺序写,多个存储区之间支持并行写;SMR区域的每个存储区内部都有一个写指针,每个写操作从写指针开始,写操作根据物理扇区大小对齐,单次读写操作不能跨越多个存储区,已经写入数据的存储区域在下次复用写之前必须重置。HM SMR磁盘暴露存储区与写指针后,应用层软件可以直接管理存储区的完整生命周期,包括存储区内数据顺序写入、存储区域的回收重置等。
在安防行业中,视频数据、图片、音频数据简称为流式数据,流式数据存在数据量较大、写多读少、覆盖频率快等特点;在项目应用中,存储流式数据时,需要进行大量的新数据写入与过期数据删除,并且需要处理大量的流式数据存储带来的硬件成本问题。由于,SMR磁盘具有存储密度高的特点,因此,非常适合安防行业使用。
然而,由于SMR磁盘的一个存储区只能顺序写入,当在该SMR磁盘的一个存储区中对同一个数据进行频繁的覆盖写入操作时,存储该数据的存储块中,只有最后一个存储该数据的存储块中存储的是有效数据,其他存储块中存储的该数据均为无效数据,并且该存储区的存储块不支持删除操作,容易导致该SMR磁盘出现大量碎片,如果这些碎片不能及时回收,则会使得该SMR磁盘的存储资源利用率不高。
其中,为了便于理解上述在该SMR磁盘的一个存储区中对同一个数据进行频繁的覆盖写入操作,下面,通过一个具 体实施例进行说明。
在安防行业中,在存储视频数据时,会对应存储该视频数据的视频索引数据。这样,随着时间的推进,视频数据的视频索引数据会随之发生变化,因此,需要在SMR磁盘的一个存储区中,顺序写入随着时间的推进不断变化的视频索引数据。
例如,在开始存储视频数据时,在SMR磁盘的一个存储区中写入视频索引数据A,在经过时长t后,在SMR磁盘的一个存储区中,与存储有视频索引数据A的存储空间相邻的存储空间中顺序写入视频索引数据B,其中,相对于视频索引数据A,视频索引数据B中所记录的视频数据的时间发生了变化;进而,在再次经过时长t后,在SMR磁盘的一个存储区中,与存储有视频索引数据B的存储空间相邻的存储空间中顺序写入视频索引数据C,其中,相对于视频索引数据B,视频索引数据C中所记录的视频数据的时间发生了变化;这样,依次类推,便可以实现在该SMR磁盘的一个存储区中对同一个数据进行频繁的覆盖写入操作。
有鉴于此,本申请实施例提供了一种数据存储方法、装置、电子设备、存储介质及存储系统,以提高SMR磁盘的存储资源利用率。
下面,首先对发明实施例的SMR存储系统进行介绍,如图2所示,为本申请实施例的SMR存储系统的结构示意图,该SMR存储系统可以包括:处理器210、SMR磁盘220以及非SMR磁盘230,SMR磁盘包括CMR区域及SMR区域,SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;
SMR磁盘220中的存储块用于存储待存储数据及待存储数据的备索引信息;
SMR磁盘220中的CMR区域用于存储待存储数据的主索引信息;
非SMR磁盘230用于存储待存储数据的数据库索引信息;
处理器210用于在运行时执行本申请实施例的任一种数据存储方法的实施例。
在一些示例中,如图3a所示,该SMR磁盘可以包括CMR区域及SMR区域,SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块。
如图3a所示,SMR区域包括:存储区、备元数据区和保留区。其中,存储区用于存储对象数据和对象数据对应的备索引信息。具体的,在存储区中,对象数据和对象数据的备索引信息存储在存储块中。
在一些示例中,每个存储块包括对象块和备索引块。对象数据存储在对象块中,对象数据的备索引信息存储在该备索引块中,通常,一个存储区中划分有多个对象块和多个备索引块,每个对象块之后紧跟有一个备索引块,作为该对象块对应的一个备索引块。备元数据区用于存储备元数据信息。保留区用于在对对象块进行回收时,作为中间介质。
如图3a所示,CMR区域包括:主元数据区和主索引存储区,该主索引存储区被划分为多个主索引块。其中,主元数据区用于存储主元数据信息。主索引存储区用于存储与备索引信息互为备份的主索引信息,主索引信息存储在主索引块。那么,对于上述SMR区域的存储区中的一个对象块而言,该存储区中的任一个对象块,除了在SMR区域具有对应的一个备索引块外,在主索引区还具有与该对象块对应的一个主索引块。
其中,SMR磁盘可以具有用于描述自身的结构属性的元数据信息。并且,为了防止CMR区域损坏后导致SMR磁盘的元数据信息丢失,可以生成包括主元数据信息和备元数据信息的两份元数据信息。
上述主元数据信息和备元数据信息的内容一致且互为备份,可以包括:CMR区域的大小、SMR区域的大小、SMR区域中存储区的个数、单个主/备索引块的大小、单个对象块的大小、文件系统初始化时间、文件系统可用块总数等信息。在具体应用中,可以将SMR区域中的最后一个存储区作为备元数据区,用来存储备元数据信息,这样,可以防止CMR区域损坏后导致元数据信息丢失。任一对象块对应的主索引信息和备索引信息的内容一致且互为备份。
图3b所示,为CMR区域中主索引存储区的存储结构图。可以包括:文件系统管理数据和Unit_key。
其中,Unit_key是SMR区域中的存储区中的对象块对应的单元键。所谓单元键值可以理解为:存储到对象块中的已存储数据对应的键值对的集合。
文件系统管理数据可以包括:对象块号、Unit_key长度、对象块的存储状态(例如为空闲、已使用或已删除等)、对象块存储的有效数据的长度、对象块存储的数据的校验值,对象块的写入时间。其中,对象块的写入时间是指:对象块对应的对象数据的写入时间。
主索引存储区可以包括一个主索引存储区,也可以包括多个连续的主索引存储区。如图3b所示,每个主索引存储区可以包括多个主索引块,各个主索引块(主索引块1~主索引块N)连续分布。也就是说,对于SMR区域中的一个存储区来说,在主索引存储区中,连续存储有该存储区中各个对象块对应的主索引信息。
如图3c所示,SMR区域中的每个存储块中的备索引块也可以包括:文件系统管理数据和Unit_key,这样可以使得备索引块与图3b中的主索引块对应。
结合图3b和图3c可知,各个主索引块连续存储是指:对于SMR区域中的一个存储区中的多个连续的存储块,该多个存储块中的备索引块中存储的备索引信息,在CMR区域中的主索引存储区中也是按照该多个连续的主索引块进行连续存储的。
通常,将流式数据作为对象数据存储至SMR区域的存储区中的对象块中,每一对象块对应有内容一致且互为备份的主索引信息和备索引信息,其中,主索引信息存储在CMR区域的主索引存储区中,备索引信息存储在SMR区域的存储区中。在一些示例中,该非SMR磁盘可以包括固态硬盘。
下面,对本申请实施例的一种数据存储方法进行介绍,如图4所示,为本申请实施例的一种数据存储方法的第一种实施方式的流程图,该方法可以包括:
S410,在获取到待存储数据时,确定待存储数据的数据类型。
在一些示例中,当用户向上述的数据存储系统中存储数据时,可以向上述的数据存储系统发送一个数据存储指令,该数据存储指令中可以包括该待存储数据,该数据存储系统在获取到该数据存储指令时,则可以获取到该待存储数据。
在一些示例中,用户可以使用一个终端设备向该数据存储系统发送一个数据存储指令,该终端设备可以包括个人电脑、智能手机等。
在一些示例中,该终端设备可以调用该数据存储系统的应用程序接口,以将该数据存储指令发送至该应用程序接口,该数据存储系统可以通过该应用程序接口获取到该数据存储指令。
在又一些示例中,该数据存储指令中还可以包括该待存储数据的数据类型标识,则上述的数据存储系统可以在获取到待存储数据后,基于该待存储数据的数据类型标识,确定待存储数据的数据类型。其中,当数据存储指令中包括该待 存储数据的数据类型标识时,那么,获得该待存储数据的数据类型标识,即可获得该待存储数据的数据类型。因此,上述基于该待存储数据的数据类型标识,确定待存储数据的数据类型的步骤,也就是,“基于该待存储数据的数据类型标识,获知待存储数据的数据类型”的步骤。这样看来,并非真正执行确定这一动作,只要获知了待存储数据的数据类型即可。
S420,基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区。
S430,在目标存储区中确定待写入待存储数据的目标存储块。
上述的数据存储系统在确定待存储数据的数据类型后,为了按照该待存储数据的数据类型对该待存储数据进行存储,可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区,然后在该目标存储区中确定目标存储块。
其中,所谓与待存储数据的数据类型相同的目标存储区是指:所存储的已存储的数据的数据类型与待存储数据的数据类型相同的目标存储区。也就是说,目标存储区中所存储的数据的数据类型与待存储数据的数据类型相同。
例如,当该SMR磁盘中的各个存储区中,有至少一个存储区中已存储的数据的数据类型与该待存储数据的数据类型相同,则可以从该至少一个存储区中选择一个存储区作为目标存储区。在一些示例中,可以在该至少一个存储区中选择还有可用存储块的存储区作为目标存储区。
上述的数据存储系统在确定出目标存储区后,可以在该目标存储区中选择一个存储块作为该待存储数据的目标存储块。例如,将该目标存储区中的空闲存储块作为该目标存储块。
S440,基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;
S450,基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;
S460,将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
在确定出目标存储区和目标存储块后,为了使得后续能够读取到该待存储数据,可以基于该目标存储块的标识,来生成该待存储数据的主索引信息和备索引信息,基于该待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息。
其中,所谓主索引信息和备索引信息的内容一致且互为备份,并且,主索引信息和备索引信息可以用于在SMR磁盘中定位所要查询的已存储的数据。
在一些示例中,基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息时,可以确定目标存储块的标识、目标存储块所在的目标存储区的标识、待存储数据的数据类型标识、待存储数据的数据量以及待存储数据在目标存储块中的存储区域等信息,从而,利用上述所确定的各类信息,生成待存储数据的主索引信息和备索引信息。
此外,SMR磁盘可以作为数据库的硬件支撑,从而,数据库可以对应于至少一个SMR磁盘。例如,对于分布式数据库而言,分布式数据库可以对应于多个SMR磁盘,数据存储在分布式数据库中即为数据存储到该分布式数据库对应的多个SMR磁盘中。从而,在分布式数据库中查询已存储的数据时,需要确定数据存储到分布式数据库对应的多个SMR磁盘中的哪个SMR磁盘中。
基于此,则需要生成待存储数据的数据库索引信息,并且,数据库索引信息可以用于在数据库对应的SMR磁盘中查询已存储的数据。
在一些示例中,在基于该待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息时,可以先从上述的数据存储指令中获取该待存储数据的单元键,然后基于该待存储数据的单元键和目标存储块的标识,生成待存储数据的数据库索引信息。该目标存储块的标识可以是该目标存储块在SMR区域的序号。
例如,在确定待存储数据的单元键和目标存储块的标识后,可以进一步确定SMR磁盘的标识、目标存储块所在的目标存储区的标识、待存储数据的数据类型标识、待存储数据的数据量以及待存储数据在目标存储块中的存储区域等信息,从而,利用上述所确定的各类信息,生成待存储数据的数据库索引信息。
其中,由于存储块在SMR区域的序号是按照该SMR区域的存储块的数量进行计数的,例如,存储块的最大序号为该SMR区域中的所有存储块的总数量。因此,这里在生成数据库索引信息时,无需使用存储区的标识信息。
也就是说,在另一些示例中,可以使用存储块在SMR区域中的序号生成在生成待存储数据的数据库索引信息。这样,在生成待存储数据的数据库索引信息时,可以不使用目标数据块所在的目标存储区的标识信息。
在一些示例中,上述的数据存储系统可以采用三级索引,包括数据库索引、主索引及备索引。其中,数据库索引为一级索引、主索引为二级索引、备索引为三级索引。
基于此,在生成待存储数据的主索引信息、备索引信息和待存储数据的数据库索引信息后,可以将该待存储数据的数据库索引信息存储在上述非SMR磁盘中,将该待存储数据的备索引信息和该待存储数据存储在SMR区域的存储区中的存储块中,将主索引信息存储在该SMR磁盘的CMR区域或者存储在非SMR磁盘中。
在一些示例中,该目标存储块可以包括目标对象块和目标索引块,该目标索引块近邻在该目标对象块之后,基于此,可以将该待存储数据的备索引信息存储至该目标索引块中,将该待存储数据存储在该目标对象块中。
在生成该待存储数据的主索引信息、备索引信息以及该待存储数据的数据库索引信息后,可以将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘,这样,可以使得对待存储数据进行存储后,方便后续读取。
在又一些示例中,该数据存储系统中的SMR磁盘可以是一个,也可以是多个。当该SMR磁盘为多个时,为了保证数据的一致性,避免相同的数据存储在多个SMR磁盘,这里,在生成待存储数据的数据库索引信息时,还可以基于该待存储数据的单元键、该SMR磁盘的WWN(World Wide Name,硬件的全球唯一标识)和目标存储块的标识,生成待存储数据的数据库索引信息。
为了更清楚的说明本申请实施例,这里以视频数据和视频索引数据作为该待存储数据为例进行说明。
假设该数据存储系统获取到的待存储数据是视频数据,则可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与视频数据的数据类型相同的目标存储区,然后在与视频数据的数据类型相同的目标存储区中确定一个存储块作为存储该视频数据的目标存储块。其中,所谓与视频数据的数据类型相同的目标存储区是指:SMR磁盘中的各个存储区中,已存储的数据的数据类型与视频数据的数据类型相同的存储区。最后,可以将该视频数据存储至该视频数据的目标存储块的目标对象块中,将该视频数据的备索引信息,存储至该视频数据的目标对象块之后的目标索引块中。例如,存储该视频数据的存储区可以是图5a所示的存储区,在该存储区中,共有N-1个存储块,每个存储块存储一个视频数据, 则可以存储N-1个视频数据。
又假设,该数据存储系统获取到的待存储数据是视频索引数据,则可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与视频索引数据的数据类型相同的目标存储区,然后在与视频索引数据的数据类型相同的目标存储区中确定一个存储块作为存储该视频索引数据的目标存储块。其中,所谓与视频索引数据的数据类型相同的目标存储区是指:SMR磁盘中的各个存储区中,已存储的数据的数据类型与视频索引数据的数据类型相同的存储区。最后,可以将该视频索引数据存储至该视频索引数据的目标存储块的目标对象块中,将该视频索引数据的备索引信息,存储至该视频索引数据的目标对象块之后的目标索引块中。例如,存储该视频索引数据的存储区可以是图5b所示的存储区,在该存储区中,共有N-1个存储块,每个存储块存储一个视频索引数据,则可以存储N-1个视频索引数据。
本申请实施例提供的一种数据存储方法,在获取到待存储数据时,可以确定待存储数据的数据类型;然后可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;在确定出目标存储块后,可以基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;最后,可以将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。这样,可以使得相同数据类型的数据,存储到同一个存储区;由于相同数据类型的数据,通常具有相同或相近的覆盖写入操作频率,因此,将具有相同或相近的覆盖写入操作的数据存储到同一个存储区中,可以方便按照该数据的覆盖写入操作频率,对该存储区中产生的碎片进行及时回收,减少碎片量,进而可以提高SMR磁盘的存储资源利用率。
其中,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘,由于CMR区域或非SMR磁盘支持删除操作,因此,在对待存储数据的主索引信息和数据库索引信息进行更细时,可以直接定位到CMR区域或非SMR磁盘中所存储的主索引信息以及非SMR磁盘中所存储的数据库索引信息,从而,对所存储的主索引信息和数据库索引信息进行更新,而无需对主索引信息和数据库索引信息进行频繁的覆盖写入操作,从而,可以大量减少了SMR磁盘中的无效数据,提高SMR磁盘的存储资源利用率。
在图4所示的一种数据存储方法的基础上,本申请实施例还提供了一种可能的实现方式,如图6所示,为本申请实施例的一种数据存储方法的第二种实施方式的流程图,该方法可以包括:
S610,在获取到待存储数据时,确定待存储数据的数据类型。
S620,判断已存储数据的存储区中,是否存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区;如果存在,执行步骤S630,如果不存在执行步骤S640。
S630,将存储有与待存储数据具有相同数据类型的已存储的数据的存储区作为目标存储区。
S640,选择SMR磁盘中的一个空闲存储区确定为目标存储区。
在一些示例中,上述的已存储数据的存储区中已存储的数据的数据类型,可能与该待存储数据的数据类型相同,也有可能与该待存储数据的数据类型不同,为了确定该已存储数据的存储区中,是否存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区,可以基于各个已存储数据的存储区存储的数据的数据类型标识和待存储数据的数据类型标识,判断已存储数据的存储区中,是否存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区。
当该已存储数据的存储区中,存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区,则可以将存储有与待存储数据具有相同数据类型的已存储的数据的存储区作为目标存储区。
也就是说,在确定待存储数据的数据类型后,针对已存储数据的各个存储区,可以确定每个存储区所存储的数据的数据类型,从而,判断每个存储区所存储的数据的数据类型中,是否存在与待存储数据的数据类型相同的数据类型。如果有,那么,便可以将存储有待存储数据的数据类型的数据的存储区作为目标存储区。
在一些示例中,当该存储有与待存储数据具有相同数据类型的已存储的数据的存储区有多个时,可以从该存储有与待存储数据具有相同数据类型的已存储的数据的多个存储区,选择具有空闲存储块的存储区作为该目标存储区。
当不存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区时,则说明该待存储数据的数据类型与已存储数据的存储区中的任何一个存储块中存储的数据的数据类型都不同,此时,可以选择一个空闲存储区作为目标存储区。然后可以通过后续步骤将该待存储数据存储至该空闲存储区的目标存储块中,并标记该空闲存储区中存储的数据类型为该待存储数据的数据类型,最后,可以将对该空闲存储区标记的数据类型存储至主元数据区中,以便后续查询。
S650,在目标存储区中确定待写入待存储数据的目标存储块;
S660,基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;
S670,基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;
S680,将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
通过本申请实施例,可以实现在已存储数据的存储区中存储的数据类型都与该待存储数据的数据类型不同时,为该待存储数据确定出目标存储区,从而可以通过后续步骤实现对该待存储数据的存储。
其中,本申请实施例中的步骤S610、S650~S680与第一种实施方式中的步骤SS410、S430~S460相同,这里不再赘述。
在图4所示的一种数据存储方法的基础上,本申请实施例还提供了一种可能的实现方式,如图7所示,为本申请实施例的一种数据存储方法的第三种实施方式的流程图,该方法可以包括:
S710,在获取到待存储数据时,确定待存储数据的数据类型;
S720,基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;
S730,在目标存储区中确定待写入待存储数据的目标存储块;
S740,基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;
S750,基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;
S760,获取待存储数据的单元键,并在非SMR磁盘中查找是否存在与待存储数据具有相同单元键的数据库索引信息;如果存在,执行步骤S770;
S770,基于与待存储数据具有相同单元键的数据库索引信息中的存储块的标识信息,确定待删除主索引信息;
S780,删除CMR区域中的待删除主索引信息。
在一些示例中,该待存储数据可以是初次存储至该存储区中,也可以是对该存储区中已存储的数据进行更新的。
为了确定该待存储数据是否为初次存储至该待存储区,可以先获取该待存储数据的单元键。在一些示例中,在将待存储数据存储至数据库中时,可以以键值对的形式对该待存储数据进行存储,此时,该数据库可以为该待存储数据分配一个单元键。可以理解的是,该数据库是基于该存储系统中的SMR磁盘和非SMR磁盘,以软件的形式存在的。
在获取到该待存储数据的单元键后,可以在非SMR磁盘中查找是否存在与待存储数据具有相同单元键的数据库索引信息。当存在与该待存储数据具有相同单元键的数据库索引信息时,则说明该待存储数据是对该SMR磁盘中存储的数据进行更新的数据,当不存在与该待存储数据具有相同单元键的数据库索引信息时,则说明该待存储数据是初次存储至该SMR磁盘中的。则可以直接执行步骤S790。
其中,针对各个已存储的数据,由于可以利用该已存储的数据的单元键生成该已存储的数据的数据库索引信息,因此,在非SMR磁盘中所存储的各个数据库索引信息中,可以包括该数据库索引信息所对应的已存储的数据的单元键,也就是说,在非SMR磁盘中所存储的各个数据库索引信息中存在单元键。基于此,所谓与待存储数据具有相同单元键的数据库索引信息是指:所存在的单元键与待存储数据的单元键相同的数据库索引信息。
在一些示例中,为了保证使用该待存储数据对已存储数据的存储区中存储的数据进行更新后,该数据的主索引信息具有唯一性,当确定非SMR磁盘中存在与该待存储数据具有相同单元键的数据库索引信息时,可以基于与该待存储数据具有相同单元键的数据库索引信息中的存储块的标识信息,确定待删除主索引信息。
例如,在确定非SMR磁盘中存在与该待存储数据具有相同单元键的数据库索引信息后,可以基于该待存储数据的单元键,确定出存储有与该待存储数据相同的数据的存储块的标识,进而可以确定出对应的存储块。由于该存储块中存储的备索引信息与主索引信息互为备份,因此,在得到该存储块中存储的备索引信息后,便可以确定出待删除的主索引信息。该待删除的主索引信息对应的已存储数据为使用该待存储数据进行更新的数据。在确定出待删除主索引信息后,当该待删除主索引信息存储在该SMR磁盘的CMR区域时,则可以删除该CMR区域中存储的待删除主索引信息,当该待删除主索引信息存储在非SMR磁盘中时,则可以删除该非SMR磁盘中存储的待删除主索引信息。从而可以保证主索引信息的唯一性。避免获取到更新前的数据。
S790,将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
在一些示例中,上述的存储区可以设置有状态,该状态可以包括空闲状态、忙碌状态和满载状态。当上述的数据存储系统在确定出目标存储区时,可以将该目标存储区的状态设置为忙碌状态,以避免将该目标存储区确定为其他待存储数据的存储区。在将待存储数据写入该目标存储区中的目标存储块后,可以判断该目标存储区中是否存储满,如果存储满数据,则可以将该目标存储区的状态设置为满载状态,该满载状态可以表示该目标存储区中可存储数据的存储块为0。如果该目标存储区中还未存储满数据,则可以将该目标存储区的状态设置为空闲状态,以便为其他待存储数据确定目标存储区。
可以理解的是,本申请实施例的步骤S710~S750和S790,与第一种实施方式中的步骤S410~S450和S460相同,这里不再赘述。
在图4所示的一种数据存储方法的基础上,本申请实施例还提供了一种可能的实现方式,如图8所示,为本申请实施例的一种数据存储方法第四种实施方式的流程图,该方法可以包括:
S810,在获取到待存储数据时,确定待存储数据的数据类型;
S820,基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;
S830,在目标存储区中确定待写入待存储数据的目标存储块;
S840,基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;
S850,基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;
S860,将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
S870,在接收到对SMR磁盘的清理指令时,基于元数据区中存储的SMR区域的分配存储量、存储区数量以及存储块分配存储量,确定SMR磁盘中可用存储块为0的第一存储区以及每个第一存储区中的存储块数量;
S880,针对每个第一存储区,基于数据库索引信息和该第一存储区中的存储块数量,确定该第一存储区中的有效存储块数量,其中,有效存储块中存储的数据为有效数据;
S890,基于每个第一存储区中的有效存储块数量,确定该第一存储区是否为待清理存储区,如果是,对该待清理存储区进行重置清理。
在一些示例中,当按照不同的数据类型对待存储数据进行存储后,有些数据的更新频率较高,有些数据的更新频率较低,例如,视频数据在存储至存储区后,不需要进行更新,而视频索引数据在存储至存储区后,通常会进行频繁地更新,而由于现有技术中在对该视频索引数据进行更新时,通常是在视频索引数据的存储区中重新选择一个存储块存储该更新后的视频索引数据,并基于该重新选择的存储块的标识生成数据库索引信息,则存储更新前的视频索引数据的存储块成为无效存储块。当进行多次更新后,会使得该视频索引数据存储区中的无效存储块比较多。为了更有效的对SMR磁盘的存储空间进行利用,可以对该无效存储块进行重置回收。
其中,所谓对待清理存储区进行重置清理是指:对待清理存储区中的数据进行清理,从而,对待清理存储区进行重置,实现对待清理存储区的回收。
在一些示例中,用户可以使用终端设备向该数据存储系统发送一个清理指令。该数据存储系统在接收到该清理指令后,可以确定待清理存储区,然后对该待清理存储区进行重置清理。
在一些示例中,CMR区域可以包括:元数据区,该元数据区可以存储有SMR区域的分配存储量、存储区数量以及存储块分配存储量,其中,该SMR区域的分配存储量为对该SMR区域分配的总大小,该存储块分配存储量为对每个存储块分配的大小。
上述的数据存储系统可以基于该SMR区域的分配存储量和存储区数量,计算得到每个存储区的大小,然后可以基于每个存储区的大小和存储块分配存储量,计算得到该存储区中存储块的数量。
上述的数据存储系统在计算得到每个存储区中存储块的数量后,针对每个存储区,可以统计该存储区中存储有数据的存储块的数量,进而可以基于每个存储区中存储块的数量和该存储区中存储有数据的存储块的数量,确定该存储区中的可用存储块是否为0,如果为0,则可以将该可用存储块为0的存储区作为第一存储区,这样,可以得到该SMR区域中 的所有第一存储区和每个第一存储区中存储块数量。
然后,上述的数据存储系统可以针对每个第一存储区,基于数据库索引信息和该第一存储区中的存储块数量,确定出该第一存储区中具有数据库索引信息的存储块,进而可以将该具有数据库索引信息的存储块确定为该第一存储区中的有效存储块,从而可以统计得到该第一存储区中的有效存储块数量。
最后,可以基于每个第一存储区中的有效存储块数量,来确定该第一存储区是否为待清理存储区。例如,当该第一存储区中的有效存储块数量小于预设清理阈值时,则可以将该第一存储区确定为待清理存储区。然后可以对该待清理存储区进行重置清理。以实现及时对存储区的回收,提高SMR磁盘的存储空间的使用率。
在一些示例中,在对待清理存储区进行重置回收时,该待清理存储区中还可能存储有有效数据,为了避免对有效存储块中存储的有效数据重置,可以针对每个待清理存储区,统计该待清理存储区中的有效存储块数量,在待清理存储区中的有效存储块数量不为0时,可以确定待清理存储区中存储的待复制数据的数据类型,也即存储的有效数据的数据类型;也就是说,在待清理存储区中的有效存储块数量不为0时,可以将待清理存储区中的有效存储块中所存储的有效数据作为待复制数据。然后可以基于SMR磁盘中除待清理存储区外的各个存储区中已存储的数据的数据类型,确定与待复制数据的数据类型相同的目标粘贴存储区;以便将该有效数据转移至目标粘贴存储区中。
其中,所谓与待复制数据的数据类型相同的目标粘贴存储区是指:SMR磁盘中除清理存储区外的各个存储区中,已存储的数据的数据类型与待复制数据的数据类型相同的目标粘贴存储区,也就是说,所确定的目标粘贴存储区为SMR磁盘中除清理存储区外的一个存储区,且该存储区中已存储的数据的数据类型与待复制数据的数据类型相同。
在确定出目标粘贴存储区后,可以在目标粘贴存储区中确定待粘贴待复制数据的目标粘贴存储块。然后可以基于目标粘贴存储块的标识,生成待复制数据的主索引信息以及备索引信息;基于待复制数据以及目标粘贴存储块的标识,生成待复制数据的数据库索引信息。
最后,可以复制有效存储块中的待复制数据,并将待复制数据的备索引信息和所复制的待复制数据写入目标粘贴存储块,将待复制数据的主索引信息写入CMR区域或非SMR磁盘,并将待复制数据的数据库索引信息写入非SMR磁盘。这样,可以将待清理存储区中存储的有效数据,转移至与该有效数据的数据类型相同的存储区中,从而可以避免清理掉该有效数据。
在又一些示例中,当对该有效数据进行转移后,为了使得该有效数据具有唯一的数据库索引,则在复制有效存储块中的待复制数据之前,还可以删除非SMR磁盘中与待复制数据具有相同单元键的数据库索引信息。
其中,所谓非SMR磁盘中与待复制数据具有相同单元键的数据库索引信息是指:非SMR磁盘中所存储的各个数据库索引信息中,所包括的单元键与待复制数据的单元键相同的数据库索引信息。
例如,假设通过上述步骤确定出的待清理存储区为图9所示的存储区1和存储区2,其中,存储区1中的存储块A和存储块B为待复制存储块,存储区2中的存储块C和存储块D也是待复制存储块。又假设存储区1和存储区2中存储的数据的数据类型相同,则可以确定出目标粘贴存储区为存储3。然后可以在存储区3中分别为存储块A、存储块B、存储块C和存储块D确定出待粘贴存储块,假设为存储块A确定出的待粘贴存储块为存储块A’,为存储块B确定出的待粘贴存储块为存储块B’,为存储块C确定出的待粘贴存储块为存储块C’,为存储块D确定出的待粘贴存储块为存储块D’,则可以依次将存储块A中存储的数据复制粘贴至存储块A’,将存储块B中存储的数据复制粘贴至存储块B’,将存储块C中存储的数据复制粘贴至存储块C’,将存储块D中存储的数据复制粘贴至存储块D’;最后对存储区1和存储区2进行重置清理。
其中,本申请实施例中的步骤S810~S860与第一种实施方式中的步骤S410~S460相同,这里不再赘述。
相应于上述的方法实施例,本申请实施例还提供了一种数据存储装置,该数据存储装置可以应用于叠瓦式磁记录SMR存储系统,SMR存储系统包括SMR磁盘及非SMR磁盘;SMR磁盘包括传统式磁记录CMR区域及SMR区域,SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;参见图10,该装置可以包括:
第一数据类型确定模块1010,用于在获取到待存储数据时,确定待存储数据的数据类型;
目标存储区确定模块1020,用于基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;
目标存储块确定模块1030,用于在目标存储区中确定待写入待存储数据的目标存储块;
第一索引信息生成模块1040,用于基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;
第二索引信息生成模块1050,用于基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;
存储模块1060,用于将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
本申请实施例提供的一种数据存储装置,在获取到待存储数据时,可以确定待存储数据的数据类型;然后可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;在确定出目标存储块后,可以基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;最后,可以将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。这样,可以使得相同数据类型的数据,存储到同一个存储区;由于相同数据类型的数据,通常具有相同或相近的覆盖写入操作频率,因此,将具有相同或相近的覆盖写入操作的数据存储到同一个存储区中,以方便按照该数据的覆盖写入操作频率,对该存储区中产生的碎片进行及时回收,减少碎片量,进而可以提高SMR磁盘的存储资源利用率。
其中,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘,由于CMR区域或非SMR磁盘支持删除操作,因此,在对待存储数据的主索引信息和数据库索引信息进行更细时,可以直接定位到CMR区域或非SMR磁盘中所存储的主索引信息以及非SMR磁盘中所存储的数据库索引信息,从而,对所存储的主索引信息和数据库索引信息进行更新,而无需对主索引信息和数据库索引信息进行频繁的覆盖写入操作,从而,可以大量减少了SMR磁盘中的无效数据,提高SMR磁盘的存储资源利用率。
在一些示例中,目标存储区确定模块1020,可以包括:判断子模块,用于判断已存储数据的存储区中,是否存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区;如果存在,触发第一目标存储区确定子模块,如果不存在,触发第二目标存储区确定子模块;第一目标存储区确定子模块,用于将存储有与待存储数据具有相同数据类型的已存储的数据的存储区作为目标存储区;第二目标存储区确定子模块,用于选择SMR磁盘中的一个空闲存储区确定为目标存储区。
在一些示例中,CMR区域包括:元数据区,元数据区中存储有各个已存储数据的存储区存储的数据的数据类型标识;第一数据类型确定模块1010,包括:第一数据类型标识获取子模块,用于获取通过应用程序接口接收的待存储数据以及 待存储数据的数据类型标识;第一数据类型确定子模块,用于基于待存储数据的数据类型标识,确定待存储数据的数据类型;判断子模块,具体用于:基于各个已存储数据的存储区存储的数据的数据类型标识和待存储数据的数据类型标识,判断已存储数据的存储区中,是否存在存储有与待存储数据具有相同数据类型的已存储的数据的存储区。
在一些示例中,该数据存储装置,还可以包括:查找模块,用于获取待存储数据的单元键,并在非SMR磁盘中查找是否存在与待存储数据具有相同单元键的数据库索引信息;如果存在,触发待删除信息确定模块;待删除信息确定模块,用于基于与待存储数据具有相同单元键的数据库索引信息中的存储块的标识信息,确定待删除主索引信息;第一删除模块,用于删除CMR区域中的待删除主索引信息。
在一些示例中,CMR区域包括:元数据区,该数据存储装置,还可以包括:第一存储区确定模块,用于在接收到对SMR磁盘的清理指令时,基于元数据区中存储的SMR区域的分配存储量、存储区数量以及存储块分配存储量,确定SMR磁盘中可用存储块为0的第一存储区以及每个第一存储区中的存储块数量;有效数据块数量确定模块,用于针对每个第一存储区,基于数据库索引信息和该第一存储区中的存储块数量,确定该第一存储区中的有效存储块数量,其中,有效存储块中存储的数据为有效数据;待清理存储区确定模块,用于基于每个第一存储区中的有效存储块数量,确定该第一存储区是否为待清理存储区,如果是,触发清理模块;清理模块,用于对该待清理存储区进行重置清理。
在一些示例中,清理模块,可以包括:第二数据类型确定模块,用于在待清理存储区中的有效存储块数量不为0时,确定待清理存储区中存储的待复制数据的数据类型;目标粘贴存储区确定模块,用于基于SMR磁盘中除待清理存储区外的各个存储区中已存储的数据的数据类型,确定与待复制数据的数据类型相同的目标粘贴存储区;目标粘贴存储块确定模块,用于在目标粘贴存储区中确定待粘贴待复制数据的目标粘贴存储块;第三索引信息确定模块,用于基于目标粘贴存储块的标识,生成待复制数据的主索引信息以及备索引信息;第四索引信息确定模块,用于基于待复制数据以及目标粘贴存储块的标识,生成待复制数据的数据库索引信息;粘贴模块,用于复制有效存储块中的待复制数据,并将待复制数据的备索引信息和所复制的待复制数据写入目标粘贴存储块,将待复制数据的主索引信息写入CMR区域或非SMR磁盘,并将待复制数据的数据库索引信息写入非SMR磁盘。
在一些示例中,该数据存储装置,还可以包括:第二删除模块,用于删除非SMR磁盘中与待复制数据具有相同单元键的数据库索引信息。
在一些示例中,待存储数据包括视频数据和/或视频索引数据;第一数据类型确定模块1010,具体用于:在获取到视频数据时,确定视频数据的数据类型;和/或,在获取到视频索引数据时,确定视频索引数据的数据类型;目标存储区确定模块1020,具体用于:基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与视频数据的数据类型相同的目标存储区;和/或,基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与视频索引数据的数据类型相同的目标存储区。
本申请实施例还提供了一种电子设备,如图11所示,包括处理器1101、通信接口1102、存储器1103和通信总线1104,其中,处理器1101,通信接口1102,存储器1103通过通信总线1104完成相互间的通信;存储器1103,用于存放计算机程序;处理器1101,用于执行存储器1103上所存放的程序时,实现以下方法步骤:在获取到待存储数据时,确定待存储数据的数据类型;基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索 引信息写入非SMR磁盘。
本申请实施例提供的一种电子设备,在获取到待存储数据时,可以确定待存储数据的数据类型;然后可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;在确定出目标存储块后,可以基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;最后,可以将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。这样,可以使得相同数据类型的数据,存储到同一个存储区;由于相同数据类型的数据,通常具有相同或相近的覆盖写入操作频率,因此,将具有相同或相近的覆盖写入操作的数据存储到同一个存储区中,以方便按照该数据的覆盖写入操作频率,对该存储区中产生的碎片进行及时回收,减少碎片量,进而可以提高SMR磁盘的存储资源利用率。
其中,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘,由于CMR区域或非SMR磁盘支持删除操作,因此,在对待存储数据的主索引信息和数据库索引信息进行更细时,可以直接定位到CMR区域或非SMR磁盘中所存储的主索引信息以及非SMR磁盘中所存储的数据库索引信息,从而,对所存储的主索引信息和数据库索引信息进行更新,而无需对主索引信息和数据库索引信息进行频繁的覆盖写入操作,从而,可以大量减少了SMR磁盘中的无效数据,提高SMR磁盘的存储资源利用率。
上述电子设备提到的通信总线1104可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口1102用于上述电子设备与其他设备之间的通信。
存储器1103可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述的处理器1101可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现以下方法步骤:
在获取到待存储数据时,确定待存储数据的数据类型;
基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;
在目标存储区中确定待写入待存储数据的目标存储块;
基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;
基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;
将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。
本申请实施例提供的一种计算机可读存储介质,在获取到待存储数据时,可以确定待存储数据的数据类型;然后可以基于SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与待存储数据的数据类型相同的目标存储区;在目标存储区中确定待写入待存储数据的目标存储块;在确定出目标存储块后,可以基于目标存储块的标识,生成待存储数据的主索引信息以及备索引信息;基于待存储数据以及目标存储块的标识,生成待存储数据的数据库索引信息;最后,可以将待存储数据的备索引信息和待存储数据写入目标存储块,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘。这样,可以使得相同数据类型的数据,存储到同一个存储区;由于相同数据类型的数据,通常具有相同或相近的覆盖写入操作频率,因此,将具有相同或相近的覆盖写入操作的数据存储到同一个存储区中,以方便按照该数据的覆盖写入操作频率,对该存储区中产生的碎片进行及时回收,减少碎片量,进而可以提高SMR磁盘的存储资源利用率。
其中,将待存储数据的主索引信息写入CMR区域或非SMR磁盘,并将待存储数据的数据库索引信息写入非SMR磁盘,由于CMR区域或非SMR磁盘支持删除操作,因此,在对待存储数据的主索引信息和数据库索引信息进行更细时,可以直接定位到CMR区域或非SMR磁盘中所存储的主索引信息以及非SMR磁盘中所存储的数据库索引信息,从而,对所存储的主索引信息和数据库索引信息进行更新,而无需对主索引信息和数据库索引信息进行频繁的覆盖写入操作,从而,可以大量减少了SMR磁盘中的无效数据,提高SMR磁盘的存储资源利用率。
本申请实施例还提供了一种包含指令的计算机程序产品,当其被处理器执行时实现本申请实施例的任一种数据存储方法的实施例。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例、系统实施例、电子设备实施例、计算机可读存储介质实施例以及计算机程序产品实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (14)

  1. 一种数据存储方法,其特征在于,应用于叠瓦式磁记录SMR存储系统,所述SMR存储系统包括SMR磁盘及非SMR磁盘;所述SMR磁盘包括传统式磁记录CMR区域及SMR区域,所述SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;所述方法包括:
    在获取到待存储数据时,确定所述待存储数据的数据类型;
    基于所述SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与所述待存储数据的数据类型相同的目标存储区;
    在所述目标存储区中确定待写入所述待存储数据的目标存储块;
    基于所述目标存储块的标识,生成所述待存储数据的主索引信息以及备索引信息;
    基于所述待存储数据以及所述目标存储块的标识,生成所述待存储数据的数据库索引信息;
    将所述待存储数据的备索引信息和所述待存储数据写入所述目标存储块,将所述待存储数据的主索引信息写入所述CMR区域或所述非SMR磁盘,并将所述待存储数据的数据库索引信息写入所述非SMR磁盘。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与所述待存储数据的数据类型相同的目标存储区的步骤,包括:
    判断已存储数据的存储区中,是否存在存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区;
    如果存在,将所述存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区作为所述目标存储区;
    如果不存在,则选择所述SMR磁盘中的一个空闲存储区确定为目标存储区。
  3. 根据权利要求2所述的方法,其特征在于,所述CMR区域包括:元数据区,所述元数据区中存储有各个所述已存储数据的存储区存储的数据的数据类型标识;所述在获取到待存储数据时,确定所述待存储数据的数据类型的步骤,包括:
    获取通过应用程序接口接收的待存储数据以及所述待存储数据的数据类型标识;
    基于所述待存储数据的数据类型标识,确定所述待存储数据的数据类型;
    所述判断已存储数据的存储区中,是否存在存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区,包括:
    基于所述各个所述已存储数据的存储区存储的数据的数据类型标识和所述待存储数据的数据类型标识,判断所述已存储数据的存储区中,是否存在存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区。
  4. 根据权利要求1所述的方法,其特征在于,在所述将所述待存储数据的备索引信息和所述待存储数据写入所述目标存储块之前,所述方法还包括:
    获取所述待存储数据的单元键,并在所述非SMR磁盘中查找是否存在与所述待存储数据具有相同单元键的数据库索引信息;
    如果存在,基于与所述待存储数据具有相同单元键的数据库索引信息中的存储块的标识信息,确定待删除主索引信息;
    删除所述CMR区域中的所述待删除主索引信息。
  5. 根据权利要求1所述的方法,其特征在于,所述CMR区域包括:元数据区,在所述将所述待存储数据的备索引信息和所述待存储数据写入所述目标存储块,将所述待存储数据的主索引信息写入所述CMR区域或所述非SMR磁盘,并将所述待存储数据的数据库索引信息写入所述非SMR磁盘之后,所述方法还包括:
    在接收到对所述SMR磁盘的清理指令时,基于所述元数据区中存储的SMR区域的分配存储量、存储区数量以及存储块分配存储量,确定所述SMR磁盘中可用存储块为0的第一存储区以及每个所述第一存储区中的存储块数量;
    针对每个所述第一存储区,基于所述数据库索引信息和该第一存储区中的存储块数量,确定该第一存储区中的有效存储块数量,其中,所述有效存储块中存储的数据为有效数据;
    基于每个第一存储区中的有效存储块数量,确定该第一存储区是否为待清理存储区,如果是,对该待清理存储区进行重置清理。
  6. 根据权利要求5所述的方法,其特征在于,所述对该待清理存储区进行重置清理,包括:
    在所述待清理存储区中的有效存储块数量不为0时,确定所述待清理存储区中存储的待复制数据的数据类型;
    基于所述SMR磁盘中除所述待清理存储区外的各个存储区中已存储的数据的数据类型,确定与所述待复制数据的数据类型相同的目标粘贴存储区;
    在所述目标粘贴存储区中确定待粘贴所述待复制数据的目标粘贴存储块;
    基于所述目标粘贴存储块的标识,生成所述待复制数据的主索引信息以及备索引信息;
    基于所述待复制数据以及所述目标粘贴存储块的标识,生成所述待复制数据的数据库索引信息;
    复制所述有效存储块中的待复制数据,并将所述待复制数据的备索引信息和所复制的所述待复制数据写入所述目标粘贴存储块,将所述待复制数据的主索引信息写入所述CMR区域或所述非SMR磁盘,并将所述待复制数据的数据库索引信息写入所述非SMR磁盘。
  7. 根据权利要求6所述的方法,其特征在于,在所述复制所述有效存储块中的待复制数据之前,所述方法还包括:
    删除所述非SMR磁盘中与所述待复制数据具有相同单元键的数据库索引信息。
  8. 根据权利要求1所述的方法,其特征在于,所述待存储数据包括视频数据和/或视频索引数据;
    所述在获取到待存储数据时,确定所述待存储数据的数据类型,包括:
    在获取到所述视频数据时,确定所述视频数据的数据类型;和/或
    在获取到所述视频索引数据时,确定所述视频索引数据的数据类型;
    所述基于所述SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与所述待存储数据的数据类型相同的目标 存储区,包括:
    基于所述SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与所述视频数据的数据类型相同的目标存储区;和/或
    基于所述SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与所述视频索引数据的数据类型相同的目标存储区。
  9. 一种数据存储装置,其特征在于,应用于叠瓦式磁记录SMR存储系统,所述SMR存储系统包括SMR磁盘及非SMR磁盘;所述SMR磁盘包括传统式磁记录CMR区域及SMR区域,所述SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;所述装置包括:
    第一数据类型确定模块,用于在获取到待存储数据时,确定所述待存储数据的数据类型;
    目标存储区确定模块,用于基于所述SMR磁盘中的各个存储区中已存储的数据的数据类型,确定与所述待存储数据的数据类型相同的目标存储区;
    目标存储块确定模块,用于在所述目标存储区中确定待写入所述待存储数据的目标存储块;
    第一索引信息生成模块,用于基于所述目标存储块的标识,生成所述待存储数据的主索引信息以及备索引信息;
    第二索引信息生成模块,用于基于所述待存储数据以及所述目标存储块的标识,生成所述待存储数据的数据库索引信息;
    存储模块,用于将所述待存储数据的备索引信息和所述待存储数据写入所述目标存储块,将所述待存储数据的主索引信息写入所述CMR区域或所述非SMR磁盘,并将所述待存储数据的数据库索引信息写入所述非SMR磁盘。
  10. 根据权利要求9所述的装置,其特征在于,所述目标存储区确定模块,包括:
    判断子模块,用于判断已存储数据的存储区中,是否存在存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区;如果存在,触发第一目标存储区确定子模块,如果不存在,触发第二目标存储区确定子模块;
    所述第一目标存储区确定子模块,用于将所述存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区作为所述目标存储区;
    所述第二目标存储区确定子模块,用于选择所述SMR磁盘中的一个空闲存储区确定为目标存储区。
  11. 根据权利要求10所述的装置,其特征在于,所述CMR区域包括:元数据区,所述元数据区中存储有各个所述已存储数据的存储区存储的数据的数据类型标识;第一数据类型确定模块,包括:
    第一数据类型标识获取子模块,用于获取通过应用程序接口发送的待存储数据以及所述待存储数据的数据类型标识;
    第一数据类型确定子模块,用于基于所述待存储数据的数据类型标识,确定所述待存储数据的数据类型;
    所述判断子模块,具体用于:
    基于所述各个所述已存储数据的存储区存储的数据的数据类型标识和所述待存储数据的数据类型标识,判断所述已存储数据的存储区中,是否存在存储有与所述待存储数据具有相同数据类型的已存储的数据的存储区。
  12. 一种SMR存储系统,其特征在于,所述SMR存储系统包括:SMR磁盘、非SMR磁盘及处理器,所述SMR磁盘包括CMR区域及SMR区域,所述SMR区域包括多个存储区,每个存储区逻辑划分为多个存储块;
    所述存储块用于存储待存储数据及所述待存储数据的备索引信息;
    所述CMR区域用于存储所述待存储数据的主索引信息;
    所述非SMR磁盘用于存储所述待存储数据的数据库索引信息;
    所述处理器用于在运行时执行上述权利要求1-8任一所述的数据存储方法。
  13. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
    存储器,用于存放计算机程序;
    处理器,用于执行存储器上所存放的程序时,实现权利要求1-8任一所述的方法步骤。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时现权利要求1-8任一所述的方法步骤。
PCT/CN2020/131816 2019-11-27 2020-11-26 数据存储方法、装置及存储系统 WO2021104380A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20894122.9A EP4068070A4 (en) 2019-11-27 2020-11-26 DATA STORAGE METHOD AND DEVICE AND STORAGE SYSTEM
US17/780,334 US11853549B2 (en) 2019-11-27 2020-11-26 Index storage in shingled magnetic recording (SMR) storage system with non-shingled region

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911181875.5 2019-11-27
CN201911181875.5A CN111399762B (zh) 2019-11-27 2019-11-27 数据存储方法、装置及存储系统

Publications (1)

Publication Number Publication Date
WO2021104380A1 true WO2021104380A1 (zh) 2021-06-03

Family

ID=71433960

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/131816 WO2021104380A1 (zh) 2019-11-27 2020-11-26 数据存储方法、装置及存储系统

Country Status (4)

Country Link
US (1) US11853549B2 (zh)
EP (1) EP4068070A4 (zh)
CN (1) CN111399762B (zh)
WO (1) WO2021104380A1 (zh)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399762B (zh) 2019-11-27 2021-06-18 杭州海康威视系统技术有限公司 数据存储方法、装置及存储系统
CN111651127B (zh) * 2020-06-10 2023-05-02 杭州海康威视数字技术股份有限公司 一种基于叠瓦式磁记录盘的监控数据存储方法及装置
CN114237489B (zh) * 2020-09-09 2024-04-05 浙江宇视科技有限公司 将逻辑资源写入smr盘的方法、装置、电子设备及存储介质
CN112214169B (zh) * 2020-09-28 2021-08-10 深圳大学 一种数据存储装置及存储数据的迁移方法
CN112463051B (zh) * 2020-11-26 2023-12-29 苏州精控能源科技股份有限公司 一种电池存储系统的管理方法及数据存储方法
CN113190507B (zh) * 2021-05-14 2022-06-03 杭州海康威视数字技术股份有限公司 一种索引信息同步方法、装置及电子设备
CN113282582B (zh) * 2021-05-21 2023-06-20 海南超船电子商务有限公司 一种船位数据的高效存储方法及系统
CN113467723A (zh) * 2021-07-26 2021-10-01 浙江大华技术股份有限公司 一种数据存储方法、装置、设备及介质
CN113568582B (zh) * 2021-07-30 2023-05-26 重庆紫光华山智安科技有限公司 数据管理方法、装置和存储设备
CN114217741A (zh) * 2021-11-30 2022-03-22 浙江大华技术股份有限公司 存储装置的存储方法及存储装置
CN114153394A (zh) * 2021-11-30 2022-03-08 浙江大华技术股份有限公司 一种数据存储管理方法、装置及设备
CN114356851A (zh) * 2022-01-12 2022-04-15 北京字节跳动网络技术有限公司 数据文件的存储方法、装置、电子设备及存储介质
CN115576947A (zh) * 2022-10-19 2023-01-06 北京力控元通科技有限公司 一种数据管理方法、装置、组合库、电子设备及存储介质
CN115657950B (zh) * 2022-10-31 2023-06-30 深圳市时创意电子有限公司 一种基于多信道的数据读写处理方法、装置及相关设备
CN116303481B (zh) * 2023-05-22 2023-09-12 深圳市首航新能源股份有限公司 故障录波数据的存储方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201355A (zh) * 2016-07-12 2016-12-07 腾讯科技(深圳)有限公司 数据处理方法和装置以及存储系统
CN108062200A (zh) * 2016-11-08 2018-05-22 杭州海康威视数字技术股份有限公司 一种磁盘数据读写方法及装置
US20180342261A1 (en) * 2017-05-26 2018-11-29 Microsoft Technology Licensing, Llc File system for shingled magnetic recording (smr)
CN109254733A (zh) * 2018-09-04 2019-01-22 北京百度网讯科技有限公司 用于存储数据的方法、装置和系统
CN111399762A (zh) * 2019-11-27 2020-07-10 杭州海康威视系统技术有限公司 数据存储方法、装置及存储系统

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8913335B2 (en) * 2011-05-23 2014-12-16 HGST Netherlands B.V. Storage device with shingled data and unshingled cache regions
US11636031B2 (en) * 2011-08-11 2023-04-25 Pure Storage, Inc. Optimized inline deduplication
CN104216957A (zh) * 2014-08-20 2014-12-17 北京奇艺世纪科技有限公司 一种视频元数据的查询系统及查询方法
CN104461390B (zh) * 2014-12-05 2017-10-24 华为技术有限公司 将数据写入叠瓦状磁记录smr硬盘的方法及装置
CN106548789B (zh) * 2015-09-17 2019-05-17 伊姆西公司 用于操作叠瓦式磁记录设备的方法和装置
US20170124104A1 (en) * 2015-10-31 2017-05-04 Netapp, Inc. Durable file system for sequentially written zoned storage
US10466907B2 (en) * 2016-03-22 2019-11-05 Toshiba Memory Corporation Method to efficiently store object data of an object storage service on a magnetic disk drive and magnetic SMR disk drive
US10318389B2 (en) * 2016-07-15 2019-06-11 Quantum Corporation Joint de-duplication-erasure coded distributed storage
CN108021513B (zh) * 2016-11-02 2021-09-10 杭州海康威视数字技术股份有限公司 一种数据存储方法及装置
CN108255408B (zh) * 2016-12-28 2021-03-23 中国电信股份有限公司 数据存储方法以及系统
US10381040B1 (en) * 2018-02-06 2019-08-13 Western Digital Technologies, Inc. Dynamic hybrid shingled magnetic recording device
CN110502455B (zh) * 2018-05-18 2021-10-12 杭州海康威视数字技术股份有限公司 数据存储方法及系统
WO2020041928A1 (zh) * 2018-08-27 2020-03-05 深圳市锐明技术股份有限公司 数据存储方法、系统及终端设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201355A (zh) * 2016-07-12 2016-12-07 腾讯科技(深圳)有限公司 数据处理方法和装置以及存储系统
CN108062200A (zh) * 2016-11-08 2018-05-22 杭州海康威视数字技术股份有限公司 一种磁盘数据读写方法及装置
US20180342261A1 (en) * 2017-05-26 2018-11-29 Microsoft Technology Licensing, Llc File system for shingled magnetic recording (smr)
CN109254733A (zh) * 2018-09-04 2019-01-22 北京百度网讯科技有限公司 用于存储数据的方法、装置和系统
CN111399762A (zh) * 2019-11-27 2020-07-10 杭州海康威视系统技术有限公司 数据存储方法、装置及存储系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4068070A4

Also Published As

Publication number Publication date
CN111399762A (zh) 2020-07-10
US20220413706A1 (en) 2022-12-29
CN111399762B (zh) 2021-06-18
US11853549B2 (en) 2023-12-26
EP4068070A4 (en) 2023-01-25
EP4068070A1 (en) 2022-10-05

Similar Documents

Publication Publication Date Title
WO2021104380A1 (zh) 数据存储方法、装置及存储系统
US10635359B2 (en) Managing cache compression in data storage systems
US9183129B2 (en) Method and system for managing large write-once tables in shadow page databases
KR101813786B1 (ko) Ssd 상의 기록-시-복사를 위한 시스템 및 방법
WO2019062574A1 (zh) 一种元数据查询方法及装置
WO2017185579A1 (zh) 一种数据存储方法及装置
CN105069048A (zh) 一种小文件存储方法、查询方法和装置
WO2021109590A1 (zh) 一种数据存储方法、装置及电子设备和存储介质
WO2019091085A1 (zh) 一种快照比对的方法和装置
US10296250B2 (en) Method and apparatus for improving performance of sequential logging in a storage device
EP4174677A1 (en) Data reading and writing method and device
US11169968B2 (en) Region-integrated data deduplication implementing a multi-lifetime duplicate finder
US20090327295A1 (en) Maintenance of exo-file system metadata on removable storage device
CN111651127A (zh) 一种基于叠瓦式磁记录盘的监控数据存储方法及装置
CN110147203A (zh) 一种文件管理方法、装置、电子设备及存储介质
CN105493080A (zh) 基于上下文感知的重复数据删除的方法和装置
CN118051179A (zh) 用于使用多个分区的分区命名空间存储的技术
WO2023082902A1 (zh) 索引的创建方法、计算设备及存储介质
US10496607B2 (en) Systems and methods for enabling modifications of multiple data objects within a file system volume
WO2022140918A1 (en) Method and system for in-memory metadata reduction in cloud storage system
US11698871B2 (en) Method for PRP/SGL handling for out-of-order NVME controllers
WO2023029417A1 (zh) 一种数据存储方法及装置
US20240143213A1 (en) Fingerprint tracking structure for storage system
WO2020019173A1 (zh) 一种用于对象存储的存储器控制电路
CN117389909A (zh) 内存数据淘汰方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20894122

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020894122

Country of ref document: EP

Effective date: 20220627