WO2021249201A1 - 一种基于叠瓦式磁记录盘的监控数据存储方法及装置 - Google Patents

一种基于叠瓦式磁记录盘的监控数据存储方法及装置 Download PDF

Info

Publication number
WO2021249201A1
WO2021249201A1 PCT/CN2021/096418 CN2021096418W WO2021249201A1 WO 2021249201 A1 WO2021249201 A1 WO 2021249201A1 CN 2021096418 W CN2021096418 W CN 2021096418W WO 2021249201 A1 WO2021249201 A1 WO 2021249201A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
magnetic recording
information
monitoring data
recording area
Prior art date
Application number
PCT/CN2021/096418
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 杭州海康威视数字技术股份有限公司
Publication of WO2021249201A1 publication Critical patent/WO2021249201A1/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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0653Monitoring storage devices or 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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of data storage technology, and in particular to a monitoring data storage method and device based on shingled magnetic recording disks.
  • HDD Hard Disk Drive
  • PMR Perpendicular Magnetic Recording
  • SMR (Shingled Magnetic Recording, shingled magnetic recording) disk is the leading next-generation disk. It keeps the existing head and media unchanged, and achieves an increase in its storage area density by overlapping tracks like tiles. Compared with traditional HDDs, SMR disks contain more tracks in the same area through shingled storage, thereby increasing the storage area density and meeting the requirements of big data storage.
  • the purpose of the embodiments of the present application is to provide a monitoring data storage method and device based on the shingled magnetic recording disk, so as to realize the storage of monitoring data using the shingled magnetic recording disk.
  • the specific technical solutions are as follows:
  • embodiments of the present application provide a monitoring data storage method based on shingled magnetic recording disks.
  • the shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas.
  • the method includes:
  • the data index information of the monitoring data is obtained, and the data index information is stored in the conventional magnetic recording area.
  • the embodiments of the present application provide a monitoring data storage device based on shingled magnetic recording disks.
  • the shingled magnetic recording disks include a conventional magnetic recording area and a shingled magnetic recording area.
  • the device includes:
  • the acquisition module is used to acquire the monitoring data to be stored
  • the storage module is used to store the monitoring data in the shingled magnetic recording area according to the sequential storage rules; in the process of storing the monitoring data, obtain the data index information of the monitoring data, and store the data index information in the conventional magnetic recording area.
  • an embodiment of the present application provides an electronic device, including a processor and a machine-readable storage medium, the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is executed by the machine-executable instructions Prompt: to implement the method provided in the first aspect of the embodiments of the present application.
  • an embodiment of the present application provides a machine-readable storage medium that stores machine-executable instructions that, when called and executed by a processor, implement the method provided in the first aspect of the embodiments of the present application.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method provided in the first aspect of the embodiments of the present application.
  • an embodiment of the present application provides a monitoring system.
  • the monitoring system includes a monitoring device, a shingled magnetic recording disk, and electronic equipment.
  • the shingled magnetic recording disk includes a conventional magnetic recording area and a shingled magnetic recording area;
  • Monitoring equipment used to collect monitoring data and send the monitoring data to electronic equipment
  • Electronic equipment used to receive the monitoring data sent by the monitoring equipment; store the monitoring data in the shingled magnetic recording area according to the order storage rules; in the process of storing the monitoring data, obtain the data index information of the monitoring data and index the data Information is stored in the conventional magnetic recording area;
  • the shingled magnetic recording area in the shingled magnetic recording disk is used to store monitoring data
  • the conventional magnetic recording area in the shingled magnetic recording disk is used to store data index information.
  • the embodiment of the application provides a monitoring data storage method and device based on an shingled magnetic recording disk, wherein the method includes: obtaining monitoring data to be stored, storing the monitoring data in the shingled magnetic recording according to the order storage rule Area, in the process of storing monitoring data, the data index information of the monitoring data is obtained, and the data index information is stored in the conventional magnetic recording area.
  • Shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas. Shingled magnetic recording areas are larger and used to store monitoring data and can only store data sequentially. Conventional magnetic recording areas are smaller and used for Store data index information. Therefore, in the process of storing monitoring data, read the data index information of the monitoring data and store the data index information in the conventional magnetic recording area, thereby realizing the use of shingled magnetic recording disks to store the monitoring data .
  • FIG. 1 is a schematic flowchart of a monitoring data storage method based on shingled magnetic recording disks according to an embodiment of the application;
  • FIG. 2 is a schematic diagram of the structural allocation of the shingled magnetic recording disk according to an embodiment of the application
  • FIG. 3 is a schematic diagram of the structure allocation of a conventional magnetic recording area according to an embodiment of the application.
  • FIG. 4 is a schematic diagram of the structural allocation of shingled magnetic recording areas according to an embodiment of the application.
  • FIG. 5 is a schematic diagram of the allocation process of database file sub-regions according to an embodiment of the application.
  • FIG. 6 is a schematic diagram of a format for storing video clips in an shingled magnetic recording area according to an embodiment of the application
  • FIG. 7 is a schematic diagram of a format for storing picture data in an shingled magnetic recording area according to an embodiment of the application.
  • FIG. 8 is a schematic diagram of the flow of filling zeros when the storage unit of the shingled magnetic recording area is less than 4KB according to an embodiment of the application;
  • FIG. 9 is a schematic diagram of a process of writing a full 4KB of data in a storage unit of a shingled magnetic recording area according to an embodiment of the application.
  • FIG. 10 is a schematic diagram of a flow of data writing maintaining 4KB alignment when switching segments of the shingled magnetic recording area according to an embodiment of the application;
  • FIG. 11 is a schematic diagram of a flow of information data storage according to an embodiment of the application.
  • FIG. 12 is a schematic diagram of the initialization process of an embodiment of the application.
  • FIG. 13 is a schematic diagram of a process of adding a virtual hard disk according to an embodiment of the application.
  • FIG. 14 is a schematic diagram of the initialization process of another embodiment of the application.
  • 15 is a schematic diagram of the recovery process of the shingled magnetic recording area according to an embodiment of the application.
  • 16 is a schematic diagram of the process of restoring the data index information of the video data in the sub-region of the database file from the video data according to an embodiment of the application;
  • FIG. 17 is a schematic flowchart of restoring data index information of picture data in a sub-region of a database file from picture data according to an embodiment of the application;
  • FIG. 18 is a schematic structural diagram of a monitoring data storage device based on shingled magnetic recording disks according to an embodiment of the application
  • FIG. 19 is a schematic structural diagram of an electronic device according to an embodiment of the application.
  • FIG. 20 is a schematic structural diagram of a monitoring system according to an embodiment of the application.
  • embodiments of the present application provide a monitoring data storage method and device based on shingled magnetic recording disks.
  • the method for storing monitoring data based on the shingled magnetic recording disk provided by the embodiment of the present application is first introduced.
  • the method is applied to electronic equipment, which can be a device independent of the SMR disk, or a modular device inserted into the SMR disk.
  • the monitoring data storage method based on the shingled magnetic recording disk provided by the embodiment of the present application can be set in at least one of software, hardware circuit, and logic circuit in an electronic device.
  • the SMR disk includes a CMR (Conventional Magnetic Recording) area and an SMR area.
  • the entire SMR disk is divided into a zone (storage unit) of 256MB.
  • the storage space of the SMR area is relatively large, accounting for about 99% of the entire SMR disk. In a single zone, data can only be written sequentially, not randomly written, and only data that has been written can be read.
  • the storage space of the CMR area is small, allowing data to be written randomly.
  • each zone of the SMR disk has a special status, such as open (open), close (close), finish (end), etc.
  • WP Write Pointer
  • SMR disks are generally divided into two types: DeviceManage and HostManage.
  • the Device Manage type of SMR disk is adapted by the disk manufacturer to the SMR disk storage logic in the disk firmware; the Host Manage type of SMR disk is developed and adapted by the disk integrator for the SMR disk storage logic.
  • the SMR disk in the embodiment of this application is a Host Manage type SMR disk.
  • All SMR disks fall within the protection scope of the embodiments of the present application.
  • an embodiment of the present application provides a monitoring data storage method based on an shingled magnetic recording disk, as shown in FIG. 1, which may include the following steps.
  • S102 Store the monitoring data in the shingled magnetic recording area according to the order storage rule.
  • S103 In the process of storing the monitoring data, obtain data index information of the monitoring data, and store the data index information in a conventional magnetic recording area.
  • Shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas. Shingled magnetic recording areas are larger and used to store monitoring data and can only store data sequentially. Conventional magnetic recording areas are smaller and used for Store data index information. Therefore, in the process of storing monitoring data, read the data index information of the monitoring data and store the data index information in the conventional magnetic recording area, thereby realizing the use of shingled magnetic recording disks to store the monitoring data .
  • the SMR disk includes the CMR area and the SMR area.
  • the CMR area is used to store the data index information of the monitoring data
  • the SMR area is used to store the monitoring data.
  • the monitoring data refers to the image data collected by the monitoring equipment.
  • Data index information refers to basic information such as the data type, data size, data length, data start time, storage location, etc. of the monitoring data. The data index information is obtained from the monitoring data during the storage of the monitoring data It is read or generated when monitoring data is stored.
  • the conventional magnetic recording area includes an information file subarea and a database file subarea; the information file subarea is pre-stored with the formatting information of the shingled magnetic recording disk, and the database file subarea is used to store the data index information of the monitoring data .
  • the CMR area can provide a database function.
  • the CMR area is used to store formatting information and database files of the SMR disk.
  • the formatting information includes the attribute identification of the SMR disk, the storage unit index, etc. Formatted hardware information.
  • the CMR area can include an information file subarea and a database file subarea.
  • the information file subarea is pre-stored with the formatting information of the SMR disk.
  • the database file subarea is used to store the data index information of the monitoring data and occupies most of the space of the CMR area. .
  • the CMR area includes two information file sub-areas, which are located in the first and last zone of the CMR area, as shown in Figure 3.
  • the number of information file sub-areas included in the CMR area is not specifically limited here, and it may be one or multiple.
  • Each zone serves as a file, and the index manages the storage space of the entire SMR disk except the first zone.
  • the CMR area is not limited to a storage method of a database.
  • the shingled magnetic recording area includes a plurality of storage units; the formatting information of the shingled magnetic recording disk includes the attribute identification of the shingled magnetic recording disk and the unit index of each storage unit.
  • S102 may specifically be: storing the monitoring data in the designated storage unit in the shingled magnetic recording area according to the sequential storage rule.
  • the formatting information of the SMR disk includes the attribute identifier of the SMR disk and the unit index of each storage unit, and the attribute identifier of the SMR disk includes the size of the SMR disk, how many zones the SMR disk includes, etc.
  • the SMR area is mainly allocated to surveillance data such as video data and picture data. The area allocation of the SMR area is shown in Figure 4. Different types of surveillance data are stored in different zones.
  • the monitoring data includes multiple data types; the database file sub-area includes database units pre-allocated for monitoring data of different data types; each storage unit is used to store monitoring data of different data types.
  • S102 may specifically be: according to the data type of the monitoring data, according to the order storage rule, storing the monitoring data in the storage unit corresponding to the data type in the shingled magnetic recording area.
  • the step of storing the data index information in the conventional magnetic recording area may specifically be: according to the data type of the monitored data, storing the data index information in the database unit corresponding to the data type.
  • the SMR area is used to store different types of monitoring data such as video data and picture data.
  • the monitoring data of different data types is stored in a corresponding storage unit.
  • the CMR area is used to store database files.
  • the database file sub-areas includes database units pre-allocated for monitoring data of different data types.
  • the database file sub-areas can be divided into video library, picture library, information library, etc. Take a 4T SMR disk as an example.
  • the CMR area is about 40G and a total of 160 files.
  • the method may further include: for any database unit, if the used storage space of the database unit reaches a preset threshold, deleting the earliest stored data index information in the database unit.
  • the entire space occupied by the database can only grow continuously and cannot be recycled. Therefore, when a certain database unit occupies a full space (that is, the used storage space of the database unit reaches a preset threshold), the old data index information in the database unit needs to be deleted to free up space for new data index information to be inserted.
  • priority can be assigned to the stored data index data, the newer the stored data index data, the higher the priority, and when deleting, the data index data with the lowest priority can be deleted.
  • the allocation process of the database file sub-area is shown in Figure 5.
  • Apply for a database file to determine whether the current disk is an SMR disk. If it is, search for the monitoring pre-allocated on the SMR disk.
  • the database unit corresponding to the data type of the data stores the data index information of the monitoring data in the database unit, and if the database unit occupies full space, the earliest stored data index information in the database unit is deleted.
  • the monitoring data includes monitoring data of multiple channels;
  • the shingled magnetic recording area includes multiple storage units;
  • S102 may specifically be: storing each data segment synchronously to each storage unit in the shingled magnetic recording area in accordance with the sequential storage rule, wherein the data segment includes at least the header of the data segment and the monitoring data of one channel.
  • the segment header is used to record the data index information of the monitoring data of a channel;
  • S103 may specifically be: when the monitoring data of a channel is started to be stored, the data segment header of the monitoring data is generated, the data index information of the monitoring data is recorded in the data segment header, and the data index information is stored in the conventional magnetic field. Record area.
  • each data segment includes at least a data segment header and monitoring data of one channel.
  • the data segment header records the monitoring of one channel.
  • Data index information of the data After receiving the monitoring data of a channel to be stored, it is determined to start storing the monitoring data of the channel, and before starting to store the monitoring data of the channel, it is necessary to generate the data segment header first, and record a first in the data segment header. Copy data index information, and store the data index information in the regular recording area.
  • Monitoring data includes video data and picture data.
  • S102 can specifically be: each data segment is stored synchronously to each storage unit in the shingled magnetic recording area in accordance with the sequential storage rule, where the data segment includes a data segment header and a channel
  • the video data and the end of the data section, the head and the end of the data section are used to record the data index information of the video data.
  • the data index information recorded at the end of the data section is more than the data index information recorded at the head of the data section.
  • S103 may specifically be: when starting to store the video data of one channel, generate a data segment header of the video data, record the data index information of the video data in the data segment header, and store the data index information in the conventional magnetic recording area ;
  • the current data index information is obtained every preset time period, and the current data index information is used to update the data index information of the video data in the conventional magnetic recording area;
  • the video data of the channel is recorded, the end of the data segment of the video data is generated, the data index information of the video data is recorded at the end of the data segment, and the data index information of the video data in the conventional magnetic recording area is updated.
  • Each data segment includes a data segment header, a channel of video data, and a data segment tail.
  • the data segment header and data segment tail record the video data data Index information. Since the data in the SMR area can only be written in sequence, at the beginning of the recording, a data segment header is generated, a data index information is recorded in the data segment header, and the data index information is stored in the CMR area, the data index information of the header The length of the recording data cannot be recorded; in the process of storing the recording data of one channel, the data index information is obtained from the recording data every preset time period (such as 1 minute, 2 minutes, etc.) as the current data index information (can Including the start time, current time, current location of the video data of a channel, etc.), and use the current data index information to update the data index information of the video data in the CMR area, that is, the video stored in the CMR area The data index data is updated to the latest obtained current data index information; when the recording data ends,
  • S102 may specifically be: storing each data segment synchronously to each storage unit in the shingled magnetic recording area according to a sequential storage rule, where the data segment includes the header of the data segment and the picture data of one channel, The data segment header is used to record the data index information of the picture data.
  • S103 may specifically be: when starting to store the picture data of one channel, generate a data segment header of the picture data, record the data index information of the picture data in the data segment header, and store the data index information in the conventional magnetic recording area .
  • Each data segment includes a data segment header and picture data of one channel.
  • the data segment header records the data index information of the picture data. After receiving the picture data of a channel to be stored, it is determined to start storing the picture data of the channel, and before starting to store the picture data of the channel, it is necessary to generate the data segment header first, and record a copy in the data segment header Data index information, and store the data index information in the CMR area.
  • S102 may specifically be: storing each data segment synchronously in each storage unit in the shingled magnetic recording area according to a sequential storage rule, where the data The segment includes at least one channel of picture data and a data segment tail, and the data segment tail is used to record data index information of the picture data of one channel.
  • S103 may specifically be: after storing the picture data of one channel, generate the end of the data segment of the picture data, record the data index information of the picture data at the end of the data segment, and store the data index information in the conventional magnetic recording area.
  • Each data segment includes one channel of picture data and the end of the data segment.
  • the end of the data segment records the data index information of the picture data. After receiving the picture data of a channel to be stored, it is determined to start storing the picture data of the channel. After the picture data of the channel is stored, the end of the data segment is generated, a data index information is recorded at the end of the data segment, and the The data index information is stored in the CMR area.
  • the traditional database retrieval method can be used to read the corresponding monitoring data from the SMR area for playback, display, etc., which will not be repeated here.
  • S102 may specifically be: storing the monitoring data in the shingled magnetic recording area according to the sequential storage rules and the preset bit alignment strategy, where the preset bit alignment strategy is determined according to the preset data size of the data index information.
  • the data size of the data index information is set to 4KB
  • the preset bit alignment strategy corresponding to the data size of 4KB is the DIO (Discrete Input/Output, discrete input/output) alignment method
  • DIO Discrete Input/Output, discrete input/output
  • the monitoring data is written into the SMR area using the preset bit alignment method DIO to ensure that the data of the last preset bit must be data index information. If there is a blank before the data of the last preset bit, fill it with 0 to adopt 4KB alignment Take the way DIO writes into the SMR area as an example, add 0 to the data bits less than 4K, as shown in Figure 8.
  • the recording data is written into the recording buffer first, and then based on the characteristics of SMR disk sequential writing Write to SRM disk.
  • the tail is less than 4KB part of the data with 0, increase the index of the clip, and then keep the original offset to continue to write data, as shown in Figure 10. It should be noted that if there is no I frame in the new video clip, the I frame needs to be copied.
  • the method may further include: when the monitoring data is stored in the shingled magnetic recording area, if the monitoring data is not aligned, obtaining the write pointer of the storage unit storing the monitoring data in the shingled magnetic recording area , And adjust the offset of the stored monitoring data based on the write pointer.
  • the monitoring data is not aligned when writing data
  • the method may further include: obtaining information data associated with the monitoring data; storing the information data in a local buffer; in the process of storing the information data, reading the data index information of the information data, and storing the data index information To the conventional magnetic recording area.
  • information data is mostly structured data, such as face, vehicle and other related attribute information.
  • the storage method is shown in Figure 11. After obtaining the information data associated with the monitoring data, the information data is stored in the local buffer. And in the process of storing the information data, the data index information of the information data can be read, and the data index information can be stored in the CMR area.
  • Data index information can be stored in the database file sub-area of the CMR area, and traditional database retrieval methods can be used, which can satisfy various attributes and condition combination retrieval, etc., read the corresponding information data from the buffer, display and display The corresponding video or picture data is output, so I won’t repeat it here.
  • the SMR disk Before executing the monitoring data storage method based on the shingled magnetic recording disk provided by the embodiment of the present application, the SMR disk may also be initialized. As shown in FIG. 12, the initialization process includes the following steps.
  • S1201 Obtain the area parameters of the conventional magnetic recording area and the shingled magnetic recording area.
  • S1202 Initialize the information file sub-areas and the database file sub-areas in the conventional magnetic recording area according to the area parameters of the conventional magnetic recording area and the shingled magnetic recording area.
  • the SMR disk Before the SMR disk is used for monitoring data storage, the SMR disk may have been used. Therefore, the SMR disk needs to be initialized first.
  • the specific initialization operation is to initialize the information file subarea and the database file subarea in the CMR area. Among them, when initializing the unit index of the information file sub-area, it is necessary to add the usage status of the synchronized system information file; when initializing the logic of the database file sub-area, add the CMR area except the first and last zone, all other zones Pre-allocated as database free files.
  • the initialization process can be divided into two parts: adding a virtual hard disk and initializing.
  • the virtual hard disk adding process shown in Figure 13 performs disk hot plug detection. If a data disk is detected, the specified command is used to obtain the disk type. If it is an SMR disk, obtain the area parameters of the SMR area, where the area parameters of the SMR area include attribute information such as the size of the SMR area, and then add a virtual hard disk according to the area parameters of the SMR area.
  • the initialization process shown in Figure 14 the area parameters of the CMR area are obtained, the WP of the SMR area is reset, and the attribute identification and unit index in the sub-area of the information file are initialized to complete the initialization.
  • the conventional magnetic recording area includes a database file sub-area and at least two information file sub-areas; the information file sub-area is pre-stored with the formatting information of the shingled magnetic recording disk, and the database file sub-area is used to store monitoring data. Data index information.
  • the method may further include: if the formatting information stored in any information file subregion is damaged, obtaining and using formatting information stored in other information file subregions to restore the damaged formatting information in the information file subregion.
  • the formatting information of the shingled magnetic recording disk includes the unit index of each storage unit in the shingled magnetic recording area; if all the unit indexes stored in the sub-areas of the information file are damaged, the method further includes:
  • the first step is to obtain and determine the information file sub-areas according to the positions of the sub-areas in the conventional magnetic recording area.
  • the second step is to traverse the shingled magnetic recording area and read the tail information of each storage unit.
  • the read unit index is stored in the information file sub-area.
  • the read unit index is stored in the information file sub-area.
  • the unit index in the subarea of the reconstruction information file mainly includes two parts: CMR area restoration and SMR area restoration. Since the location of the information file sub-region is fixed, the CMR area restoration is to determine the information file sub-region based on the location of each sub-region in the CMR area.
  • the SMR area recovery is specifically shown in Figure 15. It traverses the SMR area, reads the tail information of each storage unit, and judges whether a valid unit index is read from the tail information of the storage unit, and if so, it will read the unit index. Store to the information file sub-area.
  • the WP of the SMR area when the SMR disk is initialized, the WP of the SMR area is not reset, but the ID information of the SMR disk is recorded in the initialization information of the SMR disk. And record the ID information in the unit index at the head or tail of each storage unit.
  • the ID information in the initialization information of the SMR disk is different from the ID information in the unit index of the head or tail of the storage unit, it means that the storage unit is invalid and needs to be repaired. You can correct the SMR at this time.
  • the WP of the area is reset, or when monitoring data is stored, after the storage unit is obtained, the WP of the SMR area is reset.
  • the format information of the shingled magnetic recording disk may also include the attribute identifier of the shingled magnetic recording disk. If the attribute identifier stored in one information file sub-area is damaged, the information stored in the other information file sub-area can be used. The attribute identification restores the damaged attribute identification in the sub-area of the information file.
  • the conventional magnetic recording area includes a database file subarea and an information file subarea; the information file subarea is pre-stored with the attribute identification of the shingled magnetic recording disk and the unit index of each storage unit in the shingled magnetic recording area,
  • the database file sub-area is used to store the data index information of the monitoring data.
  • the method may further include: if the data index information stored in the database file subarea is damaged, searching for the storage unit corresponding to the unit index in the shingled magnetic recording area according to the unit index; in the storage unit, starting from the end of the data, According to the data length recorded at the end of the data, traverse forward in turn, find the end of the previous monitoring data, and restore the data index information of each monitoring data according to the data end of each monitoring data; or, in the storage unit, from the data From the beginning of the header, according to the data length recorded in the data header, it traverses backward in turn, finds the data header of the next monitoring data, and restores the data index information of each monitoring data according to the data header of each monitoring data.
  • monitoring data mainly refers to video data and picture data.
  • the data index information stored in the database file sub-area is damaged, the damaged data index information can be directly recovered from the video data.
  • the unit index the corresponding storage unit can be found in the SMR area.
  • the end of the storage unit is the data index information of the last video clip. Therefore, according to the length of the segment recorded in the data index information, the last video clip can be found. Data index information. In this way, the data index information of all video clips can be recovered. As shown in Figure 16, after traversing the SMR area once, the data index information of the recording data in the entire database file sub-area can be recovered.
  • the damaged data index information can be directly recovered from the picture data.
  • the corresponding storage unit can be found in the SMR area. After the corresponding picture data is found, all picture data can be found backwards according to the data index information of the picture data, as shown in Figure 17, after traversing all After the picture data, the data index information of the picture data in the entire database file sub-area can be recovered.
  • the corresponding storage unit can be found in the SMR area, the corresponding picture data can be found, and all the picture data can be found forward according to the data index information of the picture data , After traversing all the picture data, the data index information of the picture data in the entire database file sub-area can be recovered.
  • the embodiments of this application realize the management of the partition format of the SMR disk, and realize the storage and retrieval of monitoring data on the SMR disk, including file allocation, file data writing, file update, file overwriting, data retrieval, etc. . Moreover, the self-repair of the file system is also realized.
  • the embodiments of the present application provide a monitoring data storage device based on shingled magnetic recording disks.
  • the shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas, as shown in FIG. 18
  • the device may include:
  • the obtaining module 1810 is used to obtain the monitoring data to be stored
  • the storage module 1820 is used to store the monitoring data in the shingled magnetic recording area according to the sequential storage rules; in the process of storing the monitoring data, obtain the data index information of the monitoring data, and store the data index information in the conventional magnetic recording area .
  • the conventional magnetic recording area includes an information file subarea and a database file subarea; the information file subarea is pre-stored with the formatting information of the shingled magnetic recording disk, and the database file subarea is used to store the data index information of the monitoring data .
  • the shingled magnetic recording area includes a plurality of storage units;
  • the formatting information of the shingled magnetic recording disk includes the attribute identification of the shingled magnetic recording disk and the unit index of each storage unit;
  • the storage module 1820 can be specifically used to store the monitoring data in a designated storage unit in the shingled magnetic recording area in accordance with a sequential storage rule.
  • the monitoring data includes multiple data types;
  • the database file sub-area includes database units pre-allocated for monitoring data of different data types; each storage unit is used to store monitoring data of different data types;
  • the storage module 1820 can be specifically used to: according to the data type of the monitoring data, store the monitoring data in the storage unit corresponding to the data type in the shingled magnetic recording area according to the sequential storage rules; according to the data type of the monitoring data, store the data The index information is stored in the database unit corresponding to the data type.
  • the device may also include:
  • the deleting module is used to delete the earliest stored data index information in the database unit if the storage space used by the database unit reaches a preset threshold for any database unit.
  • the device may also include:
  • the initialization module is used to obtain the area parameters of the conventional magnetic recording area and the shingled magnetic recording area; according to the area parameters of the conventional magnetic recording area and the shingled magnetic recording area, initialize the information file sub-areas and the database in the conventional magnetic recording area File sub-area.
  • the monitoring data includes monitoring data of multiple channels;
  • the shingled magnetic recording area includes multiple storage units;
  • the storage module 1820 can be specifically used to: store each data segment synchronously to each storage unit in the shingled magnetic recording area according to a sequential storage rule, where the data segment includes at least a data segment header and one channel of monitoring data, The data segment header is used to record the data index information of the monitoring data of a channel; when the monitoring data of a channel is started to be stored, the data segment header of the monitoring data is generated, and the data index information of the monitoring data is recorded in the data segment header , And store the data index information to the conventional magnetic recording area.
  • the monitoring data includes video data;
  • the data segment also includes a data segment tail, and the data segment tail is used to record data index information for updating the video data;
  • the storage module 1820 can also be used to: in the process of storing the video data of a channel, obtain the current data index information every preset time period, and use the current data index information to update the video data in the conventional magnetic recording area Data index information; when the video data of a channel is stored, the end of the data segment of the video data is generated, the data index information of the video data is recorded at the end of the data segment, and the data index information of the video data in the conventional magnetic recording area is updated .
  • the monitoring data includes image data.
  • the monitoring data includes image data of multiple channels; the shingled magnetic recording area includes multiple storage units;
  • the storage module 1820 can be specifically used to: store each data segment synchronously to each storage unit in the shingled magnetic recording area according to a sequential storage rule, wherein the data segment includes at least one channel of picture data and the end of the data segment, and the data The end of the segment is used to record the data index information of the picture data of a channel; after storing the picture data of a channel, the end of the data segment of the picture data is generated, the data index information of the picture data is recorded at the end of the data segment, and the data is indexed Information is stored in the conventional magnetic recording area.
  • the storage module 1820 can be specifically used to store the monitoring data in the shingled magnetic recording area according to the sequence storage rules and preset bit alignment strategies, wherein the preset bit alignment strategy is preset according to the data index information The data size is determined.
  • the device may also include:
  • the adjustment module is used to obtain the write pointer of the storage unit storing the monitoring data in the shingled magnetic recording area if the monitoring data is not aligned when the monitoring data is stored in the shingled magnetic recording area, and based on the write pointer , Adjust the offset of the stored monitoring data.
  • the obtaining module 1810 can also be used to obtain information data associated with monitoring data;
  • the storage module 1820 can also be used to store information data in a local buffer; in the process of storing information data, read the data index information of the information data, and store the data index information in the conventional magnetic recording area.
  • the conventional magnetic recording area includes a database file sub-area and at least two information file sub-areas; the information file sub-area is pre-stored with the formatting information of the shingled magnetic recording disk, and the database file sub-area is used to store monitoring data. Data index information;
  • the device may also include:
  • the recovery module is used to obtain and use formatting information stored in other information file sub-areas to perform formatting information that is damaged in any information file sub-area if the formatting information stored in any information file sub-area is damaged. recover.
  • the formatting information of the shingled magnetic recording disk includes the unit index of each storage unit in the shingled magnetic recording area;
  • the device may also include:
  • the reconstruction module is used to obtain and determine the information file sub-areas according to the position of each sub-areas in the conventional magnetic recording area if the unit indexes stored in all the sub-areas of the information file are damaged; traverse the shingled magnetic recording area and read each The tail information of the storage unit; if a valid unit index is read from the tail information of the storage unit, the read unit index is stored in the information file sub-area; if the valid unit index is not read from the tail information of the storage unit Read the header information of each storage unit; if a valid unit index is read from the header information of the storage unit, store the read unit index in the information file sub-area.
  • the conventional magnetic recording area includes a database file sub-area and at least two information file sub-areas; the information file sub-area is pre-stored with the attribute identification of the shingled magnetic recording disk and the information of each storage unit in the shingled magnetic recording area. Unit index, the database file sub-area is used to store the data index information of the monitoring data;
  • the device may also include:
  • the search module is used to search for the storage unit corresponding to the unit index in the shingled magnetic recording area according to the unit index if the data index information stored in the subarea of the database file is damaged;
  • the recovery module is used in the storage unit to start from the end of the data, traverse forward in turn according to the data length recorded at the end of the data, find the end of the previous monitoring data, and restore each monitoring based on the end of each monitoring data
  • the data index information of the data or, in the storage unit, starting from the data header, according to the data length recorded in the data header, traverse backward in turn to find the data header of the next monitoring data, and according to the data of each monitoring data
  • the data header recovers the data index information of each monitoring data.
  • Shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas. Shingled magnetic recording areas are larger and used to store monitoring data and can only store data sequentially. Conventional magnetic recording areas are smaller and used for Store data index information. Therefore, in the process of storing monitoring data, read the data index information of the monitoring data and store the data index information in the conventional magnetic recording area, thereby realizing the use of shingled magnetic recording disks to store the monitoring data .
  • An embodiment of the present application provides an electronic device, as shown in FIG. 19, including a processor 1901 and a machine-readable storage medium 1902.
  • the machine-readable storage medium 1902 stores machine-executable instructions that can be executed by the processor 1901.
  • the device 1901 is prompted by machine-executable instructions to implement the monitoring data storage method based on shingled magnetic recording disks provided in the embodiments of the present application.
  • the above-mentioned machine-readable storage medium may include RAM (Random Access Memory, random access memory), and may also include NVM (Non-Volatile Memory, non-volatile memory), for example, at least one disk storage.
  • NVM Non-Volatile Memory, non-volatile memory
  • the machine-readable storage medium may also be at least one storage device located far away from the foregoing processor.
  • the above-mentioned processor may be a general-purpose processor, including CPU (Central Processing Unit), NP (Network Processor, network processor), etc.; it may also be DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array, Field Programmable Gate Array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor, network processor
  • DSP Digital Signal Processing, digital signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array, Field Programmable Gate Array
  • other programmable logic devices discrete gates or transistor logic devices, discrete hardware components.
  • the machine-readable storage medium 1902 and the processor 1901 may transmit data through a wired connection or a wireless connection, and the electronic device may communicate with other devices through a wired communication interface or a wireless communication interface. What is shown in FIG. 19 is only an example of data transmission between the processor 1901 and the machine-readable storage medium 1902 via a bus, and is not intended to limit the specific connection manner.
  • Shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas. Shingled magnetic recording areas are larger and used to store monitoring data and can only store data sequentially. Conventional magnetic recording areas are smaller and used for Store data index information. Therefore, in the process of storing monitoring data, read the data index information of the monitoring data and store the data index information in the conventional magnetic recording area, thereby realizing the use of shingled magnetic recording disks to store the monitoring data .
  • the embodiment of the present application provides a machine-readable storage medium that stores machine-executable instructions that, when called and executed by a processor, implement the monitoring data storage method based on the shingled magnetic recording disk provided by the embodiment of the present application.
  • Shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas. Shingled magnetic recording areas are larger and used to store monitoring data and can only store data sequentially. Conventional magnetic recording areas are smaller and used for Store data index information. Therefore, in the process of storing monitoring data, read the data index information of the monitoring data and store the data index information in the conventional magnetic recording area, thereby realizing the use of shingled magnetic recording disks to store the monitoring data .
  • a computer program product containing instructions, which when run on a computer, causes the computer to execute the shingled-based magnetic recording disk provided by the embodiments of the present application. Monitoring data storage method.
  • the computer may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD (Digital Versatile Disc)), or a semiconductor medium (such as an SSD (Solid State Disk, solid state hard disk)), etc. .
  • the embodiment of the present application also provides a monitoring system.
  • the monitoring system includes a monitoring device 2010, an shingled magnetic recording disk 2020, and an electronic device 2030.
  • the shingled magnetic recording disk 2020 includes a conventional magnetic recording area and Shingled magnetic recording area;
  • the monitoring device 2010 is used to collect monitoring data and send the monitoring data to the electronic device 2030;
  • the electronic device 2030 is used to receive the monitoring data sent by the monitoring device 2010; store the monitoring data in the shingled magnetic recording area according to the order storage rules; in the process of storing the monitoring data, obtain the data index information of the monitoring data, and Data index information is stored in the conventional magnetic recording area;
  • the shingled magnetic recording area in the shingled magnetic recording disk 2020 is used to store monitoring data
  • the conventional magnetic recording area in the shingled magnetic recording disk 2020 is used to store data index information.
  • Shingled magnetic recording disks include conventional magnetic recording areas and shingled magnetic recording areas. Shingled magnetic recording areas are larger and used to store monitoring data and can only store data sequentially. Conventional magnetic recording areas are smaller and used for Store data index information. Therefore, in the process of storing monitoring data, read the data index information of the monitoring data and store the data index information in the conventional magnetic recording area, thereby realizing the use of shingled magnetic recording disks to store the monitoring data .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Recording Or Reproducing By Magnetic Means (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

本申请公开了一种基于叠瓦式磁记录盘的监控数据存储方法及装置,其中,方法包括:获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。

Description

一种基于叠瓦式磁记录盘的监控数据存储方法及装置
本申请要求于2020年06月10日提交中国专利局、申请号为202010521106.1发明名称为“一种基于叠瓦式磁记录盘的监控数据存储方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据存储技术领域,尤其涉及一种基于叠瓦式磁记录盘的监控数据存储方法及装置。
背景技术
随着计算机技术的不断发展,当前社会已经进入大数据时代,大数据时代的数据量呈爆发式增长。当前承担数据存储任务的设备主要为HDD(Hard Disk Drive,硬盘驱动器),而HDD的存储面密度(每单位面积存储的位数)受到物理限制,目前HDD所使用的PMR(Perpendicular Magnetic Recording,垂直磁记录)技术即将达到其存储面密度限制,导致无法满足大数据存储的要求。
SMR(Shingled Magnetic Recording,叠瓦式磁记录)盘是领先的下一代磁盘,它保持现有磁头和介质不变,通过将磁道像瓦片一样重叠在一起来实现其存储面密度的增长。和传统的HDD相比,SMR盘通过叠瓦式存储,在相同的面积内容纳了更多的磁道,从而提高了存储面密度,能够满足大数据存储的要求。
随着监控技术的不断发展,监控领域的数据量也呈现出指数级增长,为了满足监控领域的数据存储要求,希望能够将SMR盘应用到监控数据存储中,因此,在监控领域中,如何实现利用SMR盘对监控数据进行存储是当前监控领域亟待解决的技术问题。
发明内容
本申请实施例的目的在于提供一种基于叠瓦式磁记录盘的监控数据存储方法及装置,以实现利用叠瓦式磁记录盘对监控数据进行存储。具体技术方案如下:
第一方面,本申请实施例提供了一种基于叠瓦式磁记录盘的监控数据存储方法,叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,该方法包括:
获取待存储的监控数据;
按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域;
在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
第二方面,本申请实施例提供了一种基于叠瓦式磁记录盘的监控数据存储装置,叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,该装置包括:
获取模块,用于获取待存储的监控数据;
存储模块,用于按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域;在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
第三方面,本申请实施例提供了一种电子设备,包括处理器和机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器被机器可执行指令促使:实现本申请实施例第一方面所提供的方法。
第四方面,本申请实施例提供了一种机器可读存储介质,存储有机器可执行指令,在被处理器调用和执行时,实现本申请实施例第一方面所提供的方法。
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行实现本申请实施例第一方面所提供的方法。
第六方面,本申请实施例提供了一种监控系统,监控系统包括监控设备、叠瓦式磁记录盘及电子设备,叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域;
监控设备,用于采集监控数据,并将监控数据发送至电子设备;
电子设备,用于接收监控设备发送的监控数据;按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域;在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域;
叠瓦式磁记录盘中的叠瓦式磁记录区域,用于存储监控数据;
叠瓦式磁记录盘中的常规磁记录区域,用于存储数据索引信息。
本申请实施例提供的一种基于叠瓦式磁记录盘的监控数据存储方法及装置,其中,方法包括:获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。
附图说明
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例的基于叠瓦式磁记录盘的监控数据存储方法的流程示意图;
图2为本申请实施例的叠瓦式磁记录盘的结构分配示意图;
图3为本申请实施例的常规磁记录区域的结构分配示意图;
图4为本申请实施例的叠瓦式磁记录区域的结构分配示意图;
图5为本申请实施例的数据库文件子区域的分配流程示意图;
图6为本申请实施例的叠瓦式磁记录区域存储录像片段的格式示意图;
图7为本申请实施例的叠瓦式磁记录区域存储图片数据的格式示意图;
图8为本申请实施例的叠瓦式磁记录区域的存储单元不足4KB补0的流程示意图;
图9为本申请实施例的叠瓦式磁记录区域的存储单元满4KB数据写入的流程示意图;
图10为本申请实施例的叠瓦式磁记录区域的切换片段时保持4KB对齐的数据写入的流程示意图;
图11为本申请实施例的信息数据存储的流程示意图;
图12为本申请一实施例的初始化流程示意图;
图13为本申请实施例的虚拟硬盘添加的流程示意图;
图14为本申请另一实施例的初始化流程示意图;
图15为本申请实施例的叠瓦式磁记录区域的恢复流程示意图;
图16为本申请实施例的从录像数据恢复数据库文件子区域中录像数据的数据索引信息的流程示意图;
图17为本申请实施例的从图片数据恢复数据库文件子区域中图片数据的数据索引信息的流程示意图;
图18为本申请实施例的基于叠瓦式磁记录盘的监控数据存储装置的结构示意图;
图19为本申请实施例的电子设备的结构示意图;
图20为本申请实施例的监控系统的结构示意图。
具体实施方式
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了实现利用叠瓦式磁记录盘对监控数据进行存储,本申请实施例提供了一种基于叠瓦式磁记录盘的监控数据存储方法及装置。下面,首先对本申请实施例所提供的基于叠瓦式磁记录盘的监控数据存储方法进行介绍。该方法应用于电子设备,电子设备可以是独立于SMR盘的设备,也可以是SMR盘所插装的模块设备。本申请实施例所提供的基于叠瓦式磁记录盘的监控数据存储方法可以被设置于电子设备中的软件、硬件电路和逻辑电路中的至少一种。
SMR盘包括CMR(Conventional Magnetic Recording,常规磁记录)区域和SMR区域,整个SMR盘按照256MB为一个zone(存储单元)进行划分。SMR区域的存储空间较大,占整个SMR盘约99%的空间,在单个zone内只能顺序写入数据,不能随机写,且只能读取已 写入的数据。CMR区域的存储空间较小,允许数据随机写入。
SMR盘读写存在如下限制:SMR盘每个zone有特殊的状态,例如open(打开)、close(关闭)、finish(结束)等,同时打开的zone个数有一定限制,超过一定个数时,SMR盘的读写性能会下降;每个zone有自己的WP(Write Pointer,写指针),zone中的数据必须从当前的WP向后写入;WP之后的数据无法读取;不允许跨zone读写;SMR区域的写位置必须保持4KB对齐,且写字节数为4KB整数倍。
SMR盘一般分为Device Manage(设备管理)和Host Manage(主机管理)两种类型。Device Manage类型的SMR盘是由磁盘生产厂商在磁盘固件中适配SMR盘存储逻辑;Host Manage类型的SMR盘是由磁盘集成方进行SMR盘存储逻辑的开发适配。本申请实施例中的SMR盘是Host Manage类型的SMR盘,当然,除了现有的Host Manage类型的SMR盘以外,只要能够实现由用户、磁盘集成方等非磁盘生产厂商进行存储逻辑开发适配的SMR盘均属于本申请实施例的保护范围。
基于上述SMR盘的读写限制,本申请实施例提供了一种基于叠瓦式磁记录盘的监控数据存储方法,如图1所示,可以包括如下步骤。
S101,获取待存储的监控数据。
S102,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域。
S103,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
应用本申请实施例,获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。
现有的文件系统,如NTFS(New Technology File System,新技术文件系统)、FAT32(File Allocation Table 32,格式采用32位的文件分配表)、ext4(Fourth extended filesystem,第四代扩展文件系统)等均不支持SMR盘,因此,在将SMR应用于监控系统时,无法使用通用的文件系统。如图2所示,SMR盘包括CMR区域和SMR区域,CMR区域用于存储监控数据的数据索引信息,SMR区域用于存储监控数据,其中,监控数据是指利用监控设备采集到的图片数据、录像数据、视频数据等,数据索引信息是指监控数据的数据类型、数据大小、数据长度、数据起始时间、存储位置等基本信息,数据索引信息是在监控数据的存储过程中从监控数据中读取到的或者在存储监控数据时生成的。
可选的,常规磁记录区域包括信息文件子区域和数据库文件子区域;信息文件子区域 预先存储有叠瓦式磁记录盘的格式化信息,数据库文件子区域用于存储监控数据的数据索引信息。
在本申请实施例的一种实现方式中,CMR区域可以提供数据库功能,CMR区域用于存储SMR盘的格式化信息以及数据库文件,其中,格式化信息包括SMR盘的属性标识、存储单元索引等格式化的硬件信息。CMR区域可以包括信息文件子区域和数据库文件子区域,信息文件子区域预先存储有SMR盘的格式化信息,数据库文件子区域用于存储监控数据的数据索引信息,占据了CMR区域的大部分空间。一般情况下,CMR区域包括两个信息文件子区域,分别位于CMR区域的第一个和最后一个zone,如图3所示。当然,CMR区域中包括多少个信息文件子区域在这里不做具体限定,可以为1个,也可以为多个。每个zone作为一个文件,索引管理除第一个zone外的整个SMR盘的存储空间。当然,本申请实施例中,CMR区域并不限定为数据库这一种存储方式。
可选的,叠瓦式磁记录区域包括多个存储单元;叠瓦式磁记录盘的格式化信息包括叠瓦式磁记录盘的属性标识以及各存储单元的单元索引。相应的,S102具体可以为:按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域中的指定存储单元。
在本申请实施例的一种实现方式中,SMR盘的格式化信息包括SMR盘的属性标识以及各存储单元的单元索引,SMR盘的属性标识包括SMR盘的大小、SMR盘包括多少个zone等在进行SMR盘格式化时所限定的信息;单元索引至少包括各zone在SMR盘中的位置,基于单元索引可以快速索引到SMR盘中对应的zone。SMR区域主要分配给录像数据、图片数据等监控数据使用,SMR区域的区域分配如图4所示,不同类型的监控数据存储在不同的zone中。
可选的,监控数据包括多种数据类型;数据库文件子区域包括针对不同数据类型的监控数据预先分配的数据库单元;各存储单元用于存储不同数据类型的监控数据。
相应的,S102具体可以为:根据监控数据的数据类型,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域中该数据类型对应的存储单元。
S103中,将数据索引信息存储至常规磁记录区域的步骤,具体可以为:根据监控数据的数据类型,将数据索引信息存储至数据类型对应的数据库单元。
在本申请实施例的一种实现方式中,SMR区域用于存储录像数据、图片数据等不同类型的监控数据,具体的,将不同数据类型的监控数据存储于相应的存储单元中。CMR区域用于存储数据库文件,相应的,数据库文件子区域包括针对不同数据类型的监控数据预先分配的数据库单元,例如,可以将数据库文件子区域划分为录像库、图片库、信息库等,以4T的SMR盘为例,CMR区域约40G共160个文件,如表1所示,预分配1/20(即2G)给录像库、1/5(即8G)给图片库、1/5(即8G)给信息库,1/10(即4G)预留,剩余用作数据库空闲文件。
表1 CMR区域分配表
录像库 图片库 信息库 预留 数据库空闲文件
1/20 1/5 1/5 1/10 剩余
可选的,该方法还可以包括:针对任一数据库单元,若该数据库单元已使用的存储空间达到预设阈值,则删除该数据库单元中最早存储的数据索引信息。
数据库占用的整块空间,只能不断增长,不能回收。因此,当某一个数据库单元占用空间满时(即数据库单元已使用的存储空间达到预设阈值),需删除数据库单元中老的数据索引信息,释放出空间供新的数据索引信息插入。具体实现时,可以给已存储的数据索引数据分配优先级,越新存储的数据索引数据优先级越高,则在删除时,可以删除优先级最低的数据索引数据。
综上所述,数据库文件子区域的分配流程如图5所示,存储监控数据时,申请数据库文件,判断当前的磁盘是否为SMR盘,如果是,则查找该SMR盘上预分配的该监控数据的数据类型对应的数据库单元,将该监控数据的数据索引信息存储至该数据库单元,如果该数据库单元占用空间满,则删除该数据库单元中最早存储的数据索引信息。
可选的,监控数据包括多个通道的监控数据;叠瓦式磁记录区域包括多个存储单元;
相应的,S102具体可以为:将各个数据段按照顺序存储规则,同步存储至叠瓦式磁记录区域中的各存储单元,其中,数据段至少包括数据段头部及一个通道的监控数据,数据段头部用于记录一个通道的监控数据的数据索引信息;
S103具体可以为:在开始存储一个通道的监控数据时,生成该监控数据的数据段头部,在数据段头部记录该监控数据的数据索引信息,并将数据索引信息存储至所述常规磁记录区域。
在本申请实施例的一种实现方式中,SMR区域中可以存储多个数据段,每个数据段至少包括数据段头部和一个通道的监控数据,数据段头部记录的是一个通道的监控数据的数据索引信息。在接收到待存储的一个通道的监控数据后,确定要开始存储该通道的监控数据,而在开始存储该通道的监控数据之前,需先生成数据段头部,在数据段头部先记录一份数据索引信息,并将该数据索引信息存储至常规记录区域。
监控数据包括录像数据和图片数据。相应的,针对于录像数据,S102具体可以为:将各个数据段按照顺序存储规则,同步存储至叠瓦式磁记录区域中的各存储单元,其中,数据段包括数据段头部、一个通道的录像数据及数据段尾部,数据段头部及数据段尾部用于记录录像数据的数据索引信息,数据段尾部记录的数据索引信息多于数据段头部记录的数据索引信息。
S103具体可以为:在开始存储一个通道的录像数据时,生成该录像数据的数据段头部,在数据段头部记录该录像数据的数据索引信息,并将数据索引信息存储至常规磁记录区域;在存储一个通道的录像数据的过程中,每间隔预设时间段,获取当前数据索引信息,并利 用当前数据索引信息,更新常规磁记录区域中该录像数据的数据索引信息;在存储完一个通道的录像数据时,生成该录像数据的数据段尾部,在数据段尾部记录该录像数据的数据索引信息,并更新常规磁记录区域中该录像数据的数据索引信息。
如图6所示,SMR区域中存储多个数据段,每个数据段包括数据段头部、一个通道的录像数据及数据段尾部,数据段头部和数据段尾部记录的是录像数据的数据索引信息。由于SMR区域数据只能顺序写入,录像开始时,生成数据段头部,在数据段头部先记录一份数据索引信息,并将该数据索引信息存储至CMR区域,头部的数据索引信息无法记录录像数据的长度;在存储一个通道的录像数据的过程中,每间隔预设时间段(例如1分钟、2分钟等),从录像数据中获取数据索引信息,作为当前数据索引信息(可以包括一通道的录像数据起始时间、当前时间、录像数据的当前位置等),并利用当前数据索引信息,更新CMR区域中该录像数据的数据索引信息,也就是将CMR区域中存储的该录像数据的数据索引数据更新为最新获取到的当前数据索引信息;当录像数据结束后,生成数据段尾部,在数据段尾部再记录一份数据索引信息,并基于该数据索引信息,更新CMR区域中该录像数据的数据索引信息,尾部的数据索引信息中记录当前录像数据的长度及录像的起止时间、片段个数等信息,可见,数据段尾部记录的数据索引信息多于数据段头部记录的数据索引信息。
针对于图片数据,S102具体可以为:将各个数据段按照顺序存储规则,同步存储至叠瓦式磁记录区域中的各存储单元,其中,数据段包括数据段头部及一个通道的图片数据,数据段头部用于记录图片数据的数据索引信息。
S103具体可以为:在开始存储一个通道的图片数据时,生成该图片数据的数据段头部,在数据段头部记录该图片数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
如图7所示,SMR区域中存储多个数据段,每个数据段包括数据段头部和一个通道的图片数据,数据段头部记录的是图片数据的数据索引信息。在接收到待存储的一个通道的图片数据后,确定要开始存储该通道的图片数据,而在开始存储该通道的图片数据之前,需先生成数据段头部,在数据段头部记录一份数据索引信息,并将该数据索引信息存储至CMR区域。
在本申请实施例的另一种实现方式中,针对于图片数据,S102具体可以为:将各个数据段按照顺序存储规则,同步存储至叠瓦式磁记录区域中的各存储单元,其中,数据段至少包括一个通道的图片数据及数据段尾部,数据段尾部用于记录一个通道的图片数据的数据索引信息。
S103具体可以为:在存储一个通道的图片数据后,生成该图片数据的数据段尾部,在数据段尾部记录该图片数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
SMR区域中存储多个数据段,每个数据段包括一个通道的图片数据和数据段尾部,数据段尾部记录的是图片数据的数据索引信息。在接收到待存储的一个通道的图片数据后, 确定要开始存储该通道的图片数据,在存储该通道的图片数据之后,生成数据段尾部,在数据段尾部记录一份数据索引信息,并将该数据索引信息存储至CMR区域。
由于数据索引信息存储在CMR区域的数据库文件子区域中,可以采用传统的数据库检索方式,从SMR区域中读取相应的监控数据,进行回放、展示等,这里不再赘述。
可选的,S102具体可以为:按照顺序存储规则及预设位对齐策略,将监控数据存储至叠瓦式磁记录区域,其中,预设位对齐策略根据数据索引信息的预设数据大小确定。
一般会对数据索引信息设置一定的数据大小,例如设置数据索引信息的数据大小为4KB,而4KB的数据大小对应的预设位对齐策略就是DIO(Discrete Input/Output,离散输入/输出)对齐方式,则监控数据采用预设位对齐方式DIO写入SMR区域,保证最后预设位的数据一定是数据索引信息,如果最后预设位的数据前有空白,则用0补齐,以采用4KB对齐方式DIO写入SMR区域为例,对不足4K的数据位补0,如图8所示。
关于4KB对齐写的方式,为满足SMR盘顺序写入的特性,必须满4KB之后再写入,如图9所示,录像数据先写入录像缓冲区,然后再基于SMR盘顺序写入的特性写入SRM盘。针对于录像片段,在切换录像片段时,尾部不足4KB部分数据补0,增加片段索引,然后保持原偏移继续写入数据,如图10所示。需要说明的一点,如果新录像片段无I帧,则还需拷贝I帧。
若下次写入录像数据之前设备断电,在丢失录像缓冲区中的小部分数据,但数据库认为该段数据已成功记录至SMR盘,可能引起回放时间变少。
可选的,该方法还可以包括:在存储监控数据至叠瓦式磁记录区域时,若出现监控数据未对齐的情况,则获取叠瓦式磁记录区域中存储监控数据的存储单元的写指针,并基于写指针,调整存储监控数据的偏移量。
若写入数据时出现监控数据未对齐的情况,则可以获取SMR区域中存储监控数据的存储单元的WP,基于WP调整存储监控数据的偏移量,使得存储监控数据的偏移量向WP校正,也就是通过调整存储监控数据的偏移量,使得存储监控数据的位置尽可能的靠近WP指向的位置。
可选的,该方法还可以包括:获取监控数据关联的信息数据;将信息数据存储至本地缓冲区;在存储信息数据的过程中,读取信息数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
在监控领域,信息数据大多是结构化数据,比如人脸、车辆等相关属性信息,存储方式如图11所示,在获取到监控数据关联的信息数据后,将信息数据存储至本地缓冲区,并且在存储信息数据的过程中可以读取到信息数据的数据索引信息,将数据索引信息存储至CMR区域。
数据索引信息可以存储在CMR区域的数据库文件子区域中,则可以采用传统的数据库检索方式,可以满足各种属性、条件组合检索等,从缓冲区中读取相应的信息数据,进行 展示,展示出对应的录像或图片数据,这里不再赘述。
在执行本申请实施例所提供的基于叠瓦式磁记录盘的监控数据存储方法之前,还可以对SMR盘进行初始化操作,如图12所示,初始化流程包括如下步骤。
S1201,获取常规磁记录区域和叠瓦式磁记录区域的区域参数。
S1202,根据常规磁记录区域和叠瓦式磁记录区域的区域参数,初始化常规磁记录区域中的信息文件子区域和数据库文件子区域。
在使用SMR盘进行监控数据存储之前,SMR盘可能已经使用过,因此,需要首先对SMR盘进行初始化,具体的初始化操作就是对CMR区域中的信息文件子区域和数据库文件子区域进行初始化。其中,初始化信息文件子区域的单元索引时,需新增同步系统信息文件的使用情况;初始化数据库文件子区域的逻辑时,新增将CMR区域除第一个和最后一个zone以外,其他zone全部预分配为数据库空闲文件。
具体的,初始化的流程可以分为增加虚拟硬盘和初始化两个部分,如图13所示的虚拟硬盘添加流程,进行磁盘热插拔检测,如果检测到数据盘,则利用指定命令获取磁盘类型,如果是SMR盘,则获取SMR区域的区域参数,其中,SMR区域的区域参数包括SMR区域的大小等属性信息,再根据SMR区域的区域参数添加虚拟硬盘。如图14所示的初始化流程,获取CMR区域的区域参数,复位SMR区域的WP,初始化信息文件子区域中的属性标识和单元索引,则完成初始化。
可选的,常规磁记录区域包括数据库文件子区域和至少两个信息文件子区域;信息文件子区域预先存储有叠瓦式磁记录盘的格式化信息,数据库文件子区域用于存储监控数据的数据索引信息。
该方法还可以包括:若任一信息文件子区域中存储的格式化信息损坏,则获取并利用其他信息文件子区域存储的格式化信息对该信息文件子区域中损坏的格式化信息进行恢复。
在实际场景中,易出现数据损坏的情况,针对格式化信息损坏的情况,由于一般情况下CMR区域中包括至少两个信息文件子区域,则如果一个信息文件子区域中存储的格式化信息损坏,则可以利用其他信息文件子区域存储的格式化信息对该信息文件子区域中损坏的格式化信息进行恢复。
可选的,叠瓦式磁记录盘的格式化信息包括叠瓦式磁记录区域中各存储单元的单元索引;若所有信息文件子区域中存储的单元索引均损坏,该方法还包括:
第一步,获取并根据常规磁记录区域中各子区域的位置,确定信息文件子区域。
第二步,遍历叠瓦式磁记录区域,读取各存储单元的尾部信息。
第三步,如果从存储单元的尾部信息中读取到有效的单元索引,则将读取到的单元索引存储至信息文件子区域。
第四步,如果从存储单元的尾部信息中未读取到有效的单元索引,则读取各存储单元 的头部信息。
第五步,如果从存储单元的头部信息中读取到有效的单元索引,则将读取到的单元索引存储至信息文件子区域。
如果所有信息文件子区域中存储的单元索引均损坏,则需要重建各信息文件子区域中的单元索引。重建信息文件子区域中的单元索引主要包括两部分:CMR区域恢复和SMR区域恢复。由于信息文件子区域的位置是固定的,因此,CMR区域恢复就是根据CMR区域中各子区域的位置,确定信息文件子区域。而SMR区域恢复具体如图15所示,遍历SMR区域,读取各存储单元的尾部信息,判断从存储单元的尾部信息中是否读取到有效的单元索引,若是则将读取到的单元索引存储至信息文件子区域,若否,则读取各存储单元的头部信息,判断从存储单元的头部信息中是否读取到有效的单元索引,若是则将读取到的单元索引存储至信息文件子区域,若否则将空闲文件写入信息文件子区域。
在本申请实施例的一种实现方式中,在对SMR盘进行初始化操作时,并不会对SMR区域的WP进行复位,而是在SMR盘的初始化信息中记录下该SMR盘的ID信息,并将该ID信息记录在各存储单元的头部或者尾部的单元索引中。在应用时,如果SMR盘的初始化信息中的ID信息和存储单元的头部或尾部的单元索引中的ID信息是不同的,则说明该存储单元无效,需要进行修复,可以在此时对SMR区域的WP进行复位,或者存储监控数据时,在拿到该存储单元后,再对SMR区域的WP进行复位。
可选的,叠瓦式磁记录盘的格式化信息还可以包括叠瓦式磁记录盘的属性标识,如果一个信息文件子区域中存储的属性标识损坏,则可以利用其他信息文件子区域存储的属性标识对该信息文件子区域中损坏的属性标识进行恢复。
可选的,常规磁记录区域包括数据库文件子区域和信息文件子区域;信息文件子区域预先存储有叠瓦式磁记录盘的属性标识以及叠瓦式磁记录区域中各存储单元的单元索引,数据库文件子区域用于存储监控数据的数据索引信息。
该方法还可以包括:若数据库文件子区域中存储的数据索引信息损坏,则根据单元索引,在叠瓦式磁记录区域中查找单元索引对应的存储单元;在存储单元中,从数据尾部开始,根据数据尾部记录的数据长度,依次向前遍历,查找到前一个监控数据的数据尾部,并根据各监控数据的数据尾部恢复出各监控数据的数据索引信息;或者,在存储单元中,从数据头部开始,根据数据头部记录的数据长度,依次向后遍历,查找到后一个监控数据的数据头部,并根据各监控数据的数据头部恢复出各监控数据的数据索引信息。
综上所述,监控数据主要是指录像数据和图片数据,针对于录像数据,如果数据库文件子区域中存储的数据索引信息损坏,可以从录像数据中,直接恢复出损坏的数据索引信息。根据单元索引,在SMR区域中可以查找到对应的存储单元,存储单元的尾部为最后一个录像片段的数据索引信息,因此,根据该数据索引信息中记录的片段长度,可以找到上一个录像片段的数据索引信息。以此方式,可以恢复出所有的录像片段的数据索引信息。 如图16所示,将SMR区域遍历一遍后,可恢复出整个数据库文件子区域中录像数据的数据索引信息。
针对于图片数据,如果数据库文件子区域中存储的数据索引信息损坏,可以从图片数据中,直接恢复出损坏的数据索引信息。根据单元索引,在SMR区域中可以查找到对应的存储单元,找到对应的图片数据后,再根据图片数据的数据索引信息,向后可以找到所有的图片数据,如图17所示,遍历完所有图片数据后,可以恢复出整个数据库文件子区域中图片数据的数据索引信息。
在本申请实施例的另一种实现方式中,根据单元索引,在SMR区域中可以查找到对应的存储单元,找到对应的图片数据,根据图片数据的数据索引信息,向前找到所有的图片数据,遍历完所有图片数据后,可以恢复出整个数据库文件子区域中图片数据的数据索引信息。
综上所述,本申请实施例实现了对SMR盘的分区格式管理,实现了监控数据在SMR盘上的存储和检索,包括文件分配、文件数据写入、文件更新、文件覆盖、数据检索等。并且,还实现了文件系统的自修复。
基于上述方法实施例,本申请实施例提供了一种基于叠瓦式磁记录盘的监控数据存储装置,叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,如图18所示,该装置可以包括:
获取模块1810,用于获取待存储的监控数据;
存储模块1820,用于按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域;在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
可选的,常规磁记录区域包括信息文件子区域和数据库文件子区域;信息文件子区域预先存储有叠瓦式磁记录盘的格式化信息,数据库文件子区域用于存储监控数据的数据索引信息。
可选的,叠瓦式磁记录区域包括多个存储单元;叠瓦式磁记录盘的格式化信息包括叠瓦式磁记录盘的属性标识以及各存储单元的单元索引;
存储模块1820,具体可以用于:按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域中的指定存储单元。
可选的,监控数据包括多种数据类型;数据库文件子区域包括针对不同数据类型的监控数据预先分配的数据库单元;各存储单元用于存储不同数据类型的监控数据;
存储模块1820,具体可以用于:根据监控数据的数据类型,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域中该数据类型对应的存储单元;根据监控数据的数据类型,将数据索引信息存储至数据类型对应的数据库单元。
可选的,该装置还可以包括:
删除模块,用于针对任一数据库单元,若该数据库单元已使用的存储空间达到预设阈值,则删除该数据库单元中最早存储的数据索引信息。
可选的,该装置还可以包括:
初始化模块,用于获取常规磁记录区域和叠瓦式磁记录区域的区域参数;根据常规磁记录区域和叠瓦式磁记录区域的区域参数,初始化常规磁记录区域中的信息文件子区域和数据库文件子区域。
可选的,监控数据包括多个通道的监控数据;叠瓦式磁记录区域包括多个存储单元;
存储模块1820,具体可以用于:将各个数据段按照顺序存储规则,同步存储至叠瓦式磁记录区域中的各存储单元,其中,数据段至少包括数据段头部及一个通道的监控数据,数据段头部用于记录一个通道的监控数据的数据索引信息;在开始存储一个通道的监控数据时,生成该监控数据的数据段头部,在数据段头部记录该监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
可选的,监控数据包括录像数据;数据段还包括数据段尾部,数据段尾部用于记录录像数据更新的数据索引信息;
存储模块1820,还可以用于:在存储一个通道的录像数据的过程中,每间隔预设时间段,获取当前数据索引信息,并利用当前数据索引信息,更新常规磁记录区域中该录像数据的数据索引信息;在存储完一个通道的录像数据时,生成该录像数据的数据段尾部,在数据段尾部记录该录像数据的数据索引信息,并更新常规磁记录区域中该录像数据的数据索引信息。
可选的,监控数据包括图片数据。
可选的,监控数据包括多个通道的图片数据;叠瓦式磁记录区域包括多个存储单元;
存储模块1820,具体可以用于:将各个数据段按照顺序存储规则,同步存储至叠瓦式磁记录区域中的各存储单元,其中,数据段至少包括一个通道的图片数据及数据段尾部,数据段尾部用于记录一个通道的图片数据的数据索引信息;在存储一个通道的图片数据后,生成该图片数据的数据段尾部,在数据段尾部记录该图片数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
可选的,存储模块1820,具体可以用于:按照顺序存储规则及预设位对齐策略,将监控数据存储至叠瓦式磁记录区域,其中,预设位对齐策略根据数据索引信息的预设数据大小确定。
可选的,该装置还可以包括:
调整模块,用于在存储监控数据至叠瓦式磁记录区域时,若出现监控数据未对齐的情况,则获取叠瓦式磁记录区域中存储监控数据的存储单元的写指针,并基于写指针,调整存储监控数据的偏移量。
可选的,获取模块1810,还可以用于获取监控数据关联的信息数据;
存储模块1820,还可以用于将信息数据存储至本地缓冲区;在存储信息数据的过程中,读取信息数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。
可选的,常规磁记录区域包括数据库文件子区域和至少两个信息文件子区域;信息文件子区域预先存储有叠瓦式磁记录盘的格式化信息,数据库文件子区域用于存储监控数据的数据索引信息;
该装置还可以包括:
恢复模块,用于若任一信息文件子区域中存储的格式化信息损坏,则获取并利用其他信息文件子区域存储的格式化信息对所述任一信息文件子区域中损坏的格式化信息进行恢复。
可选的,叠瓦式磁记录盘的格式化信息包括叠瓦式磁记录区域中各存储单元的单元索引;
该装置还可以包括:
重建模块,用于若所有信息文件子区域中存储的单元索引均损坏,获取并根据常规磁记录区域中各子区域的位置,确定信息文件子区域;遍历叠瓦式磁记录区域,读取各存储单元的尾部信息;如果从存储单元的尾部信息中读取到有效的单元索引,则将读取到的单元索引存储至信息文件子区域;如果从存储单元的尾部信息中未读取到有效的单元索引,则读取各存储单元的头部信息;如果从存储单元的头部信息中读取到有效的单元索引,则将读取到的单元索引存储至信息文件子区域。
可选的,常规磁记录区域包括数据库文件子区域和至少两个信息文件子区域;信息文件子区域预先存储有叠瓦式磁记录盘的属性标识以及叠瓦式磁记录区域中各存储单元的单元索引,数据库文件子区域用于存储监控数据的数据索引信息;
该装置还可以包括:
查找模块,用于若数据库文件子区域中存储的数据索引信息损坏,则根据单元索引,在叠瓦式磁记录区域中查找单元索引对应的存储单元;
恢复模块,用于在存储单元中,从数据尾部开始,根据数据尾部记录的数据长度,依次向前遍历,查找到前一个监控数据的数据尾部,并根据各监控数据的数据尾部恢复出各监控数据的数据索引信息;或者,在存储单元中,从数据头部开始,根据数据头部记录的数据长度,依次向后遍历,查找到后一个监控数据的数据头部,并根据各监控数据的数据头部恢复出各监控数据的数据索引信息。
应用本申请实施例,获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索 引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。
本申请实施例提供了一种电子设备,如图19所示,包括处理器1901和机器可读存储介质1902,机器可读存储介质1902存储有能够被处理器1901执行的机器可执行指令,处理器1901被机器可执行指令促使:实现本申请实施例所提供的基于叠瓦式磁记录盘的监控数据存储方法。
上述机器可读存储介质可以包括RAM(Random Access Memory,随机存取存储器),也可以包括NVM(Non-Volatile Memory,非易失性存储器),例如至少一个磁盘存储器。可选的,机器可读存储介质还可以是至少一个位于远离上述处理器的存储装置。
上述处理器可以是通用处理器,包括CPU(Central Processing Unit,中央处理器)、NP(Network Processor,网络处理器)等;还可以是DSP(Digital Signal Processing,数字信号处理器)、ASIC(Application Specific Integrated Circuit,专用集成电路)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
机器可读存储介质1902与处理器1901之间可以通过有线连接或者无线连接的方式进行数据传输,并且电子设备可以通过有线通信接口或者无线通信接口与其他的设备进行通信。图19所示的仅为处理器1901与机器可读存储介质1902之间通过总线进行数据传输的示例,不作为具体连接方式的限定。
应用本申请实施例,获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。
本申请实施例提供了一种机器可读存储介质,存储有机器可执行指令,在被处理器调用和执行时,实现本申请实施例提供的基于叠瓦式磁记录盘的监控数据存储方法。
应用本申请实施例,获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。
在本申请实施例提供的又一实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行实现本申请实施例提供的基于叠瓦式磁记录盘的监控数据存储方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、DSL(Digital Subscriber Line,数字用户线))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘、磁带)、光介质(例如DVD(Digital Versatile Disc,数字多功能光盘))、或者半导体介质(例如SSD(Solid State Disk,固态硬盘))等。
本申请实施例还提供了一种监控系统,如图20所示,监控系统包括监控设备2010、叠瓦式磁记录盘2020及电子设备2030,叠瓦式磁记录盘2020包括常规磁记录区域和叠瓦式磁记录区域;
监控设备2010,用于采集监控数据,并将监控数据发送至电子设备2030;
电子设备2030,用于接收监控设备2010发送的监控数据;按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域;在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域;
叠瓦式磁记录盘2020中的叠瓦式磁记录区域,用于存储监控数据;
叠瓦式磁记录盘2020中的常规磁记录区域,用于存储数据索引信息。
应用本申请实施例,获取待存储的监控数据,按照顺序存储规则,将监控数据存储至叠瓦式磁记录区域,在存储监控数据的过程中,获取监控数据的数据索引信息,并将数据索引信息存储至常规磁记录区域。叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,叠瓦式磁记录区域较大,用于存储监控数据,且只能顺序存储数据,常规磁记录区域较小,用于存储数据索引信息,因此,在存储监控数据的过程中,读取监控数据的数据索引信息,将数据索引信息存储至常规磁记录区域,从而实现了利用叠瓦式磁记录盘对监控数据进行存储。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任 何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备、机器可读存储介质、计算机程序产品和监控系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (35)

  1. 一种基于叠瓦式磁记录盘的监控数据存储方法,其特征在于,所述叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,所述方法包括:
    获取待存储的监控数据;
    按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域;
    在存储所述监控数据的过程中,获取所述监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  2. 根据权利要求1所述的方法,其特征在于,所述常规磁记录区域包括信息文件子区域和数据库文件子区域;所述信息文件子区域预先存储有所述叠瓦式磁记录盘的格式化信息,所述数据库文件子区域用于存储监控数据的数据索引信息。
  3. 根据权利要求2所述的方法,其特征在于,所述叠瓦式磁记录区域包括多个存储单元;所述叠瓦式磁记录盘的格式化信息包括所述叠瓦式磁记录盘的属性标识以及各存储单元的单元索引;
    所述按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域的步骤,包括:
    按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域中的指定存储单元。
  4. 根据权利要求3所述的方法,其特征在于,所述监控数据包括多种数据类型;所述数据库文件子区域包括针对不同数据类型的监控数据预先分配的数据库单元;所述各存储单元用于存储不同数据类型的监控数据;
    所述按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域中的指定存储单元的步骤,包括:
    根据所述监控数据的数据类型,按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域中所述数据类型对应的存储单元;
    所述将所述数据索引信息存储至所述数据库文件子区域的步骤,包括:
    根据所述监控数据的数据类型,将所述数据索引信息存储至所述数据类型对应的数据库单元。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    针对任一数据库单元,若该数据库单元已使用的存储空间达到预设阈值,则删除该数据库单元中最早存储的数据索引信息。
  6. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    获取所述常规磁记录区域和所述叠瓦式磁记录区域的区域参数;
    根据所述常规磁记录区域和所述叠瓦式磁记录区域的区域参数,初始化所述常规磁记录区域中的信息文件子区域和数据库文件子区域。
  7. 根据权利要求1所述的方法,其特征在于,所述监控数据包括多个通道的监控数据;所述叠瓦式磁记录区域包括多个存储单元;
    所述按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域的步骤,包括:
    将各个数据段按照顺序存储规则,同步存储至所述叠瓦式磁记录区域中的各存储单元,所述数据段至少包括数据段头部及一个通道的监控数据,所述数据段头部用于记录一个通道的监控数据的数据索引信息;
    所述在存储所述监控数据的过程中,获取所述监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域的步骤,包括:
    在开始存储一个通道的监控数据时,生成该监控数据的数据段头部,在所述数据段头部记录该监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  8. 根据权利要求7所述的方法,其特征在于,所述监控数据包括录像数据;所述数据段还包括数据段尾部,所述数据段尾部用于记录录像数据更新的数据索引信息;
    在所述生成该监控数据的数据段头部,在所述数据段头部记录该监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域的步骤之后,所述方法还包括:
    在存储一个通道的录像数据的过程中,每间隔预设时间段,获取当前数据索引信息,并利用所述当前数据索引信息,更新所述常规磁记录区域中该录像数据的数据索引信息;
    在存储完一个通道的录像数据时,生成该录像数据的数据段尾部,在所述数据段尾部记录该录像数据的数据索引信息,并更新所述常规磁记录区域中该录像数据的数据索引信息。
  9. 根据权利要求7所述的方法,其特征在于,所述监控数据包括图片数据。
  10. 根据权利要求1所述的方法,其特征在于,所述监控数据包括多个通道的图片数据;所述叠瓦式磁记录区域包括多个存储单元;
    所述按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域的步骤,包括:
    将各个数据段按照顺序存储规则,同步存储至所述叠瓦式磁记录区域中的各存储单元,所述数据段至少包括一个通道的图片数据及数据段尾部,所述数据段尾部用于记录一个通道的图片数据的数据索引信息;
    所述在存储所述监控数据的过程中,获取所述监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域的步骤,包括:
    在存储一个通道的图片数据后,生成该图片数据的数据段尾部,在所述数据段尾部记录该图片数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  11. 根据权利要求1所述的方法,其特征在于,所述按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域的步骤,包括:
    按照顺序存储规则及预设位对齐策略,将所述监控数据存储至所述叠瓦式磁记录区域,所述预设位对齐策略根据所述数据索引信息的预设数据大小确定。
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:
    在存储所述监控数据至所述叠瓦式磁记录区域时,若出现所述监控数据未对齐的情况, 则获取所述叠瓦式磁记录区域中存储所述监控数据的存储单元的写指针,并基于所述写指针,调整存储所述监控数据的偏移量。
  13. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取所述监控数据关联的信息数据;
    将所述信息数据存储至本地缓冲区;
    在存储所述信息数据的过程中,读取所述信息数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  14. 根据权利要求1所述的方法,其特征在于,所述常规磁记录区域包括数据库文件子区域和至少两个信息文件子区域;所述信息文件子区域预先存储有所述叠瓦式磁记录盘的格式化信息,所述数据库文件子区域用于存储监控数据的数据索引信息;
    所述方法还包括:
    若任一信息文件子区域中存储的格式化信息损坏,则获取并利用其他信息文件子区域存储的格式化信息对所述任一信息文件子区域中损坏的格式化信息进行恢复。
  15. 根据权利要求14所述的方法,其特征在于,所述叠瓦式磁记录盘的格式化信息包括所述叠瓦式磁记录区域中各存储单元的单元索引;
    若所有信息文件子区域中存储的单元索引均损坏,所述方法还包括:
    获取并根据所述常规磁记录区域中各子区域的位置,确定信息文件子区域;
    遍历所述叠瓦式磁记录区域,读取各存储单元的尾部信息;
    如果从所述存储单元的尾部信息中读取到有效的单元索引,则将读取到的单元索引存储至所述信息文件子区域;
    如果从所述存储单元的尾部信息中未读取到有效的单元索引,则读取各存储单元的头部信息;
    如果从所述存储单元的头部信息中读取到有效的单元索引,则将读取到的单元索引存储至所述信息文件子区域。
  16. 根据权利要求1所述的方法,其特征在于,所述常规磁记录区域包括数据库文件子区域和信息文件子区域;所述信息文件子区域预先存储有所述叠瓦式磁记录区域中各存储单元的单元索引,所述数据库文件子区域用于存储监控数据的数据索引信息;
    所述方法还包括:
    若所述数据库文件子区域中存储的数据索引信息损坏,则根据所述单元索引,在所述叠瓦式磁记录区域中查找所述单元索引对应的存储单元;
    在所述存储单元中,从数据尾部开始,根据所述数据尾部记录的数据长度,依次向前遍历,查找到前一个监控数据的数据尾部,并根据各监控数据的数据尾部恢复出各监控数据的数据索引信息;或者,在所述存储单元中,从数据头部开始,根据所述数据头部记录的数据长度,依次向后遍历,查找到后一个监控数据的数据头部,并根据各监控数据的数 据头部恢复出各监控数据的数据索引信息。
  17. 一种基于叠瓦式磁记录盘的监控数据存储装置,其特征在于,所述叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域,所述装置包括:
    获取模块,用于获取待存储的监控数据;
    存储模块,用于按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域;在存储所述监控数据的过程中,获取所述监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  18. 根据权利要求17所述的装置,其特征在于,所述常规磁记录区域包括信息文件子区域和数据库文件子区域;所述信息文件子区域预先存储有所述叠瓦式磁记录盘的格式化信息,所述数据库文件子区域用于存储监控数据的数据索引信息。
  19. 根据权利要求18所述的装置,其特征在于,所述叠瓦式磁记录区域包括多个存储单元;所述叠瓦式磁记录盘的格式化信息包括所述叠瓦式磁记录盘的属性标识以及各存储单元的单元索引;
    所述存储模块,具体用于:按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域中的指定存储单元。
  20. 根据权利要求19所述的装置,其特征在于,所述监控数据包括多种数据类型;所述数据库文件子区域包括针对不同数据类型的监控数据预先分配的数据库单元;所述各存储单元用于存储不同数据类型的监控数据;
    所述存储模块,具体用于:根据所述监控数据的数据类型,按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域中所述数据类型对应的存储单元;根据所述监控数据的数据类型,将所述数据索引信息存储至所述数据类型对应的数据库单元。
  21. 根据权利要求20所述的装置,其特征在于,所述装置还包括:
    删除模块,用于针对任一数据库单元,若该数据库单元已使用的存储空间达到预设阈值,则删除该数据库单元中最早存储的数据索引信息。
  22. 根据权利要求19所述的装置,其特征在于,所述装置还包括:
    初始化模块,用于获取所述常规磁记录区域和所述叠瓦式磁记录区域的区域参数;根据所述常规磁记录区域和所述叠瓦式磁记录区域的区域参数,初始化所述常规磁记录区域中的信息文件子区域和数据库文件子区域。
  23. 根据权利要求17所述的装置,其特征在于,所述监控数据包括多个通道的监控数据;所述叠瓦式磁记录区域包括多个存储单元;
    所述存储模块,具体用于:将各个数据段按照顺序存储规则,同步存储至所述叠瓦式磁记录区域中的各存储单元,所述数据段至少包括数据段头部及一个通道的监控数据,所述数据段头部用于记录一个通道的监控数据的数据索引信息;在开始存储一个通道的监控数据时,生成该监控数据的数据段头部,在所述数据段头部记录该监控数据的数据索引信 息,并将所述数据索引信息存储至所述常规磁记录区域。
  24. 根据权利要求23所述的装置,其特征在于,所述监控数据包括录像数据;所述数据段还包括数据段尾部,所述数据段尾部用于记录录像数据更新的数据索引信息;
    所述存储模块,还用于:在存储一个通道的录像数据的过程中,每间隔预设时间段,获取当前数据索引信息,并利用所述当前数据索引信息,更新所述常规磁记录区域中该录像数据的数据索引信息;在存储完一个通道的录像数据时,生成该录像数据的数据段尾部,在所述数据段尾部记录该录像数据的数据索引信息,并更新所述常规磁记录区域中该录像数据的数据索引信息。
  25. 根据权利要求23所述的装置,其特征在于,所述监控数据包括图片数据。
  26. 根据权利要求17所述的装置,其特征在于,所述监控数据包括多个通道的图片数据;所述叠瓦式磁记录区域包括多个存储单元;
    所述存储模块,具体用于:将各个数据段按照顺序存储规则,同步存储至所述叠瓦式磁记录区域中的各存储单元,所述数据段至少包括一个通道的图片数据及数据段尾部,所述数据段尾部用于记录一个通道的图片数据的数据索引信息;在存储一个通道的图片数据后,生成该图片数据的数据段尾部,在所述数据段尾部记录该图片数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  27. 根据权利要求17所述的装置,其特征在于,所述存储模块,具体用于:按照顺序存储规则及预设位对齐策略,将所述监控数据存储至所述叠瓦式磁记录区域,所述预设位对齐策略根据所述数据索引信息的预设数据大小确定。
  28. 根据权利要求27所述的装置,其特征在于,所述装置还包括:
    调整模块,用于在存储所述监控数据至所述叠瓦式磁记录区域时,若出现所述监控数据未对齐的情况,则获取所述叠瓦式磁记录区域中存储所述监控数据的存储单元的写指针,并基于所述写指针,调整存储所述监控数据的偏移量。
  29. 根据权利要求17所述的装置,其特征在于,所述获取模块,还用于获取所述监控数据关联的信息数据;
    所述存储模块,还用于将所述信息数据存储至本地缓冲区;在存储所述信息数据的过程中,读取所述信息数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域。
  30. 根据权利要求17所述的装置,其特征在于,所述常规磁记录区域包括数据库文件子区域和至少两个信息文件子区域;所述信息文件子区域预先存储有所述叠瓦式磁记录盘的格式化信息,所述数据库文件子区域用于存储监控数据的数据索引信息;
    所述装置还包括:
    恢复模块,用于若任一信息文件子区域中存储的格式化信息损坏,则获取并利用其他信息文件子区域存储的格式化信息对所述任一信息文件子区域中损坏的格式化信息进行 恢复。
  31. 根据权利要求30所述的装置,其特征在于,所述叠瓦式磁记录盘的格式化信息包括所述叠瓦式磁记录区域中各存储单元的单元索引;
    所述装置还包括:
    重建模块,用于若所有信息文件子区域中存储的单元索引均损坏,获取并根据所述常规磁记录区域中各子区域的位置,确定信息文件子区域;遍历所述叠瓦式磁记录区域,读取各存储单元的尾部信息;如果从所述存储单元的尾部信息中读取到有效的单元索引,则将读取到的单元索引存储至所述信息文件子区域;如果从所述存储单元的尾部信息中未读取到有效的单元索引,则读取各存储单元的头部信息;如果从所述存储单元的头部信息中读取到有效的单元索引,则将读取到的单元索引存储至所述信息文件子区域。
  32. 根据权利要求17所述的装置,其特征在于,所述常规磁记录区域包括数据库文件子区域和信息文件子区域;所述信息文件子区域预先存储有所述叠瓦式磁记录区域中各存储单元的单元索引,所述数据库文件子区域用于存储监控数据的数据索引信息;
    所述装置还包括:
    查找模块,用于若所述数据库文件子区域中存储的数据索引信息损坏,则根据所述单元索引,在所述叠瓦式磁记录区域中查找所述单元索引对应的存储单元;
    恢复模块,用于在所述存储单元中,从数据尾部开始,根据所述数据尾部记录的数据长度,依次向前遍历,查找到前一个监控数据的数据尾部,并根据各监控数据的数据尾部恢复出各监控数据的数据索引信息;或者,在所述存储单元中,从数据头部开始,根据所述数据头部记录的数据长度,依次向后遍历,查找到后一个监控数据的数据头部,并根据各监控数据的数据头部恢复出各监控数据的数据索引信息。
  33. 一种电子设备,其特征在于,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器被所述机器可执行指令促使:实现权利要求1-16任一项所述的方法。
  34. 一种机器可读存储介质,其特征在于,存储有机器可执行指令,在被处理器调用和执行时,实现权利要求1-16任一项所述的方法。
  35. 一种监控系统,其特征在于,所述监控系统包括监控设备、叠瓦式磁记录盘及电子设备,所述叠瓦式磁记录盘包括常规磁记录区域和叠瓦式磁记录区域;
    所述监控设备,用于采集监控数据,并将所述监控数据发送至所述电子设备;
    所述电子设备,用于接收所述监控设备发送的所述监控数据;按照顺序存储规则,将所述监控数据存储至所述叠瓦式磁记录区域;在存储所述监控数据的过程中,获取所述监控数据的数据索引信息,并将所述数据索引信息存储至所述常规磁记录区域;
    所述叠瓦式磁记录盘中的叠瓦式磁记录区域,用于存储所述监控数据;
    所述叠瓦式磁记录盘中的常规磁记录区域,用于存储所述数据索引信息。
PCT/CN2021/096418 2020-06-10 2021-05-27 一种基于叠瓦式磁记录盘的监控数据存储方法及装置 WO2021249201A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010521106.1A CN111651127B (zh) 2020-06-10 2020-06-10 一种基于叠瓦式磁记录盘的监控数据存储方法及装置
CN202010521106.1 2020-06-10

Publications (1)

Publication Number Publication Date
WO2021249201A1 true WO2021249201A1 (zh) 2021-12-16

Family

ID=72349298

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/096418 WO2021249201A1 (zh) 2020-06-10 2021-05-27 一种基于叠瓦式磁记录盘的监控数据存储方法及装置

Country Status (2)

Country Link
CN (1) CN111651127B (zh)
WO (1) WO2021249201A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115712389A (zh) * 2022-10-28 2023-02-24 哈尔滨工业大学(深圳) 一种数据存储介质间的调度方法、装置及电子设备

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651127B (zh) * 2020-06-10 2023-05-02 杭州海康威视数字技术股份有限公司 一种基于叠瓦式磁记录盘的监控数据存储方法及装置
CN112214169B (zh) * 2020-09-28 2021-08-10 深圳大学 一种数据存储装置及存储数据的迁移方法
CN113467723A (zh) * 2021-07-26 2021-10-01 浙江大华技术股份有限公司 一种数据存储方法、装置、设备及介质
CN114217741A (zh) * 2021-11-30 2022-03-22 浙江大华技术股份有限公司 存储装置的存储方法及存储装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856076B2 (en) * 2011-06-17 2014-10-07 International Business Machines Corporation Rendering tape file system information in a graphical user interface
CN104156172A (zh) * 2013-01-17 2014-11-19 西部数据技术公司 数据存储装置的数据管理
CN108255408A (zh) * 2016-12-28 2018-07-06 中国电信股份有限公司 数据存储方法以及系统
CN109753224A (zh) * 2017-11-03 2019-05-14 浙江宇视科技有限公司 存储结构及存储结构配置方法
CN111399762A (zh) * 2019-11-27 2020-07-10 杭州海康威视系统技术有限公司 数据存储方法、装置及存储系统
CN111506251A (zh) * 2019-01-30 2020-08-07 杭州海康威视系统技术有限公司 数据处理方法、装置、smr存储系统及存储介质
CN111651127A (zh) * 2020-06-10 2020-09-11 杭州海康威视数字技术股份有限公司 一种基于叠瓦式磁记录盘的监控数据存储方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9460751B2 (en) * 2013-09-16 2016-10-04 Seagate Technology Llc Binding shingled recording bands
CN103745007A (zh) * 2014-01-24 2014-04-23 深圳市华宝电子科技有限公司 一种文件管理方法及装置
CN104461390B (zh) * 2014-12-05 2017-10-24 华为技术有限公司 将数据写入叠瓦状磁记录smr硬盘的方法及装置
CN106548789B (zh) * 2015-09-17 2019-05-17 伊姆西公司 用于操作叠瓦式磁记录设备的方法和装置
CN106201355B (zh) * 2016-07-12 2018-12-11 腾讯科技(深圳)有限公司 数据处理方法和装置以及存储系统
CN110502455B (zh) * 2018-05-18 2021-10-12 杭州海康威视数字技术股份有限公司 数据存储方法及系统
CN110149803B (zh) * 2018-08-27 2023-06-09 深圳市锐明技术股份有限公司 数据存储方法、系统及终端设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856076B2 (en) * 2011-06-17 2014-10-07 International Business Machines Corporation Rendering tape file system information in a graphical user interface
CN104156172A (zh) * 2013-01-17 2014-11-19 西部数据技术公司 数据存储装置的数据管理
CN108255408A (zh) * 2016-12-28 2018-07-06 中国电信股份有限公司 数据存储方法以及系统
CN109753224A (zh) * 2017-11-03 2019-05-14 浙江宇视科技有限公司 存储结构及存储结构配置方法
CN111506251A (zh) * 2019-01-30 2020-08-07 杭州海康威视系统技术有限公司 数据处理方法、装置、smr存储系统及存储介质
CN111399762A (zh) * 2019-11-27 2020-07-10 杭州海康威视系统技术有限公司 数据存储方法、装置及存储系统
CN111651127A (zh) * 2020-06-10 2020-09-11 杭州海康威视数字技术股份有限公司 一种基于叠瓦式磁记录盘的监控数据存储方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115712389A (zh) * 2022-10-28 2023-02-24 哈尔滨工业大学(深圳) 一种数据存储介质间的调度方法、装置及电子设备

Also Published As

Publication number Publication date
CN111651127A (zh) 2020-09-11
CN111651127B (zh) 2023-05-02

Similar Documents

Publication Publication Date Title
WO2021249201A1 (zh) 一种基于叠瓦式磁记录盘的监控数据存储方法及装置
US20220413706A1 (en) Data Storage Method, Apparatus and Storage System
US8806173B2 (en) Elimination of duplicate written records
CN106951375B (zh) 在存储系统中删除快照卷的方法及装置
US9189494B2 (en) Object file system
CN104484427B (zh) 一种录像文件存储装置及方法
CN113568582B (zh) 数据管理方法、装置和存储设备
JP2002123421A (ja) フラッシュメモリのための再写像制御方法及びこれによるフラッシュメモリの構造
CN100530190C (zh) 用于处理信息的装置和方法
WO2020103493A1 (zh) 基于fat32文件系统的删除文件恢复方法及系统
JP2015005229A (ja) テープカートリッジのファイルを複製する方法、プログラム及びテープドライブ
CN109918352B (zh) 存储器系统和存储数据的方法
KR20120093061A (ko) 광 디스크 저장 시스템에 저장된 미디어에의 액세스, 압축 및 추적
JP2019028954A (ja) ストレージ制御装置、プログラム、及び重複排除方法
CN111143116A (zh) 一种磁盘坏块处理的方法及装置
US7152147B2 (en) Storage control system and storage control method
CN113448946B (zh) 数据迁移方法及装置、电子设备
US10725970B2 (en) Block storage device with optional deduplication
US20060015681A1 (en) Apparatus and method for writing and reading data
JP5394394B2 (ja) ファイルシステムにおけるファイル管理・編集方法及び装置
KR102094786B1 (ko) 파일 시스템 및 상기 파일 시스템을 이용한 파일 저장 방법
KR20190089796A (ko) 감시 시스템의 영상 관리 장치 및 방법
JP4667225B2 (ja) 制御装置およびコピー制御方法
JP2005165485A (ja) ファイル管理装置、ストレージ管理システム、システム管理方法、プログラム及び記録媒体
CN115878017A (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: 21821389

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21821389

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 21821389

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10.07.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21821389

Country of ref document: EP

Kind code of ref document: A1