Disk data reading/writing method and device

US11048601B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11048601-B2
Application numberUS-201716348248-A
CountryUS
Kind codeB2
Filing dateSep 13, 2017
Priority dateNov 8, 2016
Publication dateJun 29, 2021
Grant dateJun 29, 2021

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

The embodiments of the present disclosure disclose a method and apparatus for reading or writing disk data. The disk includes a primary metadata block storing metadata, a backup metadata block for backing up metadata, and at least one object block group. Each object block group includes a data block storing object data, and an index block storing an index of the object data. The primary metadata block is located at a head of the disk; and the backup metadata block is located at a tail of the disk. The at least one object block group is located between the primary metadata block and the backup metadata block. In reading or writing object data, the index in the index block, the metadata in the primary metadata block and the metadata backed up in the backup metadata block can be separately operated. By applying the embodiments of the present disclosure, the life and security of the disk are increased.

First claim

Opening claim text (preview).

The invention claimed is: 1. A method for reading disk data, wherein a disk comprises a primary metadata block storing metadata, a backup metadata block for backing up the metadata, and at least one object block group; each object block group comprises a data block storing object data, and an index block storing an index of the object data; the primary metadata block is located at a head of the disk; the backup metadata block is located at a tail of the disk; the at least one object block group is located between the primary metadata block and the backup metadata block; the index block comprises a primary index block and a backup index block; the primary index block is configured to store an index of object data, and the backup index block is configured to back up the index of the object data; for each object block group, a primary index block in the object block group is located at a head of the object block group, and a backup index block in the object block group is located at a tail of the object block group; a data block in the object block group is located between the primary index block and the backup index block of the object block group; the method comprises: receiving a read instruction for target object data; determining a first data block corresponding to the target object data according to an identifier of the target object data, the metadata in the primary metadata block, the metadata backed up in the backup metadata block, and an index in the index block in each object block group, and determining a first object block group in which the first data block is located; reading the target object data from the first data block of the first object block group. 2. The method according to claim 1 , wherein, the step of determining a first data block corresponding to the target object data according to an identifier of the target object data, the metadata in the primary metadata block, the metadata backed up in the backup metadata block, and an index in the index block in each object block group, and determining a first object block group in which the first data block is located comprises: reading the metadata in the primary metadata block and/or the metadata backed up in the backup metadata block, and determining locations of the primary index block and the backup index block in each object block group; reading the index in the primary index block or the index backed up in the backup index block at the determined locations; and determining the first data block corresponding to the target object data according to the read index and the identifier of the target object data, and determining the first object block group in which the first data block is located. 3. The method according to claim 2 , wherein, the disk further comprises at least one reserved block; and the method further comprises: when reading the metadata in the primary metadata block fails, or reading the metadata backed up in the backup metadata block fails, or reading the index in the primary index block in each object block group fails, or reading the index backed up in the backup index block in each object block group fails, determining an object block whose reading operation fails as a suspected bad block, and re-writing and/or re-reading object data into/from the suspected bad block; if re-writing and/or re-reading the object data succeeds, repairing data in the suspected bad block according to primary and backup redundant data; if re-writing and/or re-reading the object data fails, obtaining a reserved block and replacing the suspected bad block with the reserved block; overwriting the obtained reserved block according to the primary and backup redundant data, and updating the metadata in the primary metadata block and the metadata backed up in the backup metadata block. 4. The method according to claim 1 , wherein, the step of determining a data block corresponding to the target object data according to an identifier of the target object data, the metadata in the primary metadata block, the metadata backed up in the backup metadata block, and an index in the index block in each object block group comprises: calculating a first index check value of the identifier of the target object data; acquiring an identifier of the first data block and a first data length for the first index check value from a preset index database; wherein the preset index database is configured to store a corresponding relationship among an index check value, an identifier of a data block, and a data length; the index check value stored in the preset index database is determined according to the metadata in the primary metadata block, the metadata backed up in the backup metadata block, and the index in the index block in each object block group; determining the first data block according to the identifier of the first data block; the step of reading the target object data from the first data block of the first object block group comprises: reading the target object data with the first data length from the first data block of the first object block group. 5. An electronic device, wherein the electronic device comprises a processor, a communication interface, a memory, and a communication bus; wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is configured to store an application program; the processor is configured to perform the method according to claim 1 . 6. A non-transitory storage medium, wherein the storage medium stores an application program, and the application program performs the method according to claim 1 when being executed. 7. A method for writing disk data, wherein a disk comprises: a primary metadata block storing metadata, a backup metadata block for backing up the metadata, and at least one object block group; each object block group comprises: a data block storing object data, and an index block storing an index of the object data; the primary metadata block is located at a head of the disk; and the backup metadata block is located at a tail of the disk; the at least one object block group is located between the primary metadata block and the backup metadata block; the index block comprises a primary index block and a backup index block; the primary index block is configured to store an index of object data, and the backup index block is configured to back up the index of the object data; for each object block group, a primary index block in the object block group is located at a head of the object block group, and a backup index block in the object block group is located at a tail of the object block group; a data block in the object block group is located between the primary index block and the backup index block of the object block group; the method comprises: receiving a writing instruction for target object data; determining an idle first data block in the at least one object block group, and determining a first object block group corresponding to the first data block; and writing the target object data into the first data block of the first object block group, and updating an index in an index block in the first object block group, the metadata in the primary metadata block and the metadata backed up in the backup metadata block according to an identifier of the target object data. 8. The method according to claim 7 , wherein, the step of updating an index in an index block in the first object block group, the metadata in the primary metadata block and the metadata backed up in the backup metadata block according to an identifier of the target object data comprises: writing the identifier of the target object data as an index into a primary index block in the first object block gr

Assignees

Inventors

Classifications

  • G06F3/0644Primary

    Management of space entities, e.g. partitions, extents, pools · CPC title

  • Management of blocks · CPC title

  • G06F3/0622Primary

    in relation to access · CPC title

  • Details of searching files based on file metadata · CPC title

  • Magnetic disk device · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11048601B2 cover?
The embodiments of the present disclosure disclose a method and apparatus for reading or writing disk data. The disk includes a primary metadata block storing metadata, a backup metadata block for backing up metadata, and at least one object block group. Each object block group includes a data block storing object data, and an index block storing an index of the object data. The primary metadat…
Who is the assignee on this patent?
Hangzhou Hikvision Digital Tec
What technology area does this patent fall under?
Primary CPC classification G06F3/0644. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Jun 29 2021 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 5 related publications on this page (citations in our corpus or others sharing the same primary CPC).