Data processing method, apparatus, and system
AssigneeHuawei Technologies Co., Ltd.
InventorXin Fang
Life of this patent
Estimating the term…
Abstract
Embodiments of the present invention provide a data management technology. An OSD receives a strip write request sent by a client server, where the strip write request carries a to-be-written strip, a version number of the to-be-written strip, an offset of the to-be-written strip, and an object ID of the to-be-written strip; and the OSD writes the to-be-written strip into a storage location determined by using the object ID, the version number of the to-be-written strip, and the offset of the to-be-written strip. By applying the present invention, a quantity of object IDs can be reduced.
Claims16
A data processing method, wherein the method comprises:
- receiving, by an object storage device (OSD), a strip write request sent by a client server, wherein the strip write request carries a to-be-written strip, a version number of the to-be-written strip, an offset of the to-be-written strip, and an object ID of the to-be-written strip, the version number of the to-be-written strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-written strip belongs, the offset of the to-be-written strip describes a location of the to-be-written strip in an object to which the to-be-written strip belongs, and the object ID of the to-be-written strip is an ID of the object to which the to-be-written strip belongs;
- determining, by the OSD, whether a strip determined by using the version number of the to-be-written strip, the object ID of the to-be-written strip, and the offset of the to-be-written strip is backed up;
- and
- if the strip is backed up, writing the to-be-written strip into a storage location determined by using the version number of the to-be-written strip, the object ID of the to-be-written strip, and the offset of the to-be-written strip;
- or
- if the strip is not backed up, backing up data that is in an object of a base version in the OSD and whose offset is the offset of the to-be-written strip and size is a size of the to-be-written strip to the storage location determined by using the version number of the to-be-written strip, the offset of the to-be-written strip, and the object ID of the to-be-written strip, wherein an object ID of the object of the base version is the same as the object ID of the to-be-written strip, and a version number of the object of the base version is a base version number;
- and writing the to-be-written strip into a storage location determined by using the object ID of the to-be-written strip, the base version number, and the offset of the to-be-written strip.
A data processing method, wherein the method comprises:
- receiving, by an object storage device OSD, a strip write request sent by a client server, wherein the strip write request carries a to-be-written strip, a version number of the to-be-written strip, an offset of the to-be-written strip, and an object ID of the to-be-written strip, the version number of the to-be-written strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-written strip belongs, the offset of the to-be-written strip describes a location of the to-be-written strip in an object to which the to-be-written strip belongs, and the object ID of the to-be-written strip is an ID of the object to which the to-be-written strip belongs;
- determining, by the OSD, whether an object determined by using the version number of the to-be-written strip and the object ID is backed up;
- and
- if the object is backed up, writing, by the OSD, the to-be-written strip into a storage location determined by using the object ID, a version number of the object, and the offset of the to-be-written strip;
- or
- if the object is not backed up, backing up data in an object of a base version in the OSD to a storage location determined by using the version number of the to-be-written strip and the object ID, wherein an object ID of the object of the base version is the same as the object ID of the to-be-written strip, and a version number of the object of the base version is a base version number;
- and
- writing, by the OSD, the to-be-written strip into a storage location determined by using the object ID, the base version number, and the offset of the to-be-written strip.
A data reading method, wherein the method comprises:
- receiving, by an object storage device (OSD), a strip read request sent by a client server, wherein the strip read request carries a size of a to-be-read strip, an offset of the to-be-read strip, a version number of the to-be-read strip, and an object ID of the to-be-read strip, the version number of the to-be-read strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-read strip belongs, and the object ID of the to-be-read strip is an ID of an object to which the to-be-read strip belongs;
- determining, by the OSD, whether a strip determined by using the object ID, the version number of the to-be-read strip, and the offset of the to-be-read strip is backed up;
- and
- if the strip is backed up, reading data determined by using the object ID, the version number of the to-be-read strip, the offset of the to-be-read strip, and the size of the to-be-read strip, using the read data as the to-be-read strip, and sending the to-be-read strip to the client server;
- or
- if the strip is not backed up, searching, one by one according to a descending order of snapshot times of objects, the objects whose object IDs are the same as the object ID of the to-be-read strip and version numbers are different from the version number of the to-be-read strip until an object that stores valid data in a storage location determined by using the offset of the to-be-read strip is found, using the found valid data as the to-be-read strip, and sending the to-be-read strip to the client server, wherein a version number of the object is corresponding to the snapshot ID that is of the latest snapshot of the file or the volume to which the to-be-read strip belongs and that exists before the object is generated.
A data reading method, applied to an object storage system, wherein the object storage system comprises an object-based storage device OSD and a client server, and the method comprises:
- receiving, by the OSD, a strip read request sent by the client server, wherein the strip read request carries a size of a to-be-read strip, an offset of the to-be-read strip, a version number of the to-be-read strip, and an object ID of the to-be-read strip, the version number of the to-be-read strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-read strip belongs, and the object ID of the to-be-read strip is an ID of an object to which the to-be-read strip belongs;
- determining, by the OSD, whether an object determined by using the object ID and the version number of the to-be-read strip is backed up;
- and
- if the object is backed up, reading data determined by using the object ID, the version number of the to-be-read strip, the offset of the to-be-read strip, and the size of the to-be-read strip, using the read data as the to-be-read strip, and sending the to-be-read strip to the client server;
- or
- if the object is not backed up, searching, one by one according to a descending order of snapshot times of objects, the objects whose object IDs are the same as the object ID of the to-be-read strip and version numbers are different from the version number of the to-be-read strip until an object that stores valid data in a storage location determined by using the offset of the to-be-read strip is found, using the found valid data as the to-be-read strip, and sending the to-be-read strip to the client server, wherein a version number of the object is corresponding to the snapshot ID that is of the latest snapshot of the file or the volume to which the to-be-read strip belongs and that exists before the object is generated.
An object storage device, comprising a processor, and a storage medium and an interface that are connected to the processor, wherein:
- the interface is configured to receive a strip write request sent by a client server, wherein the strip write request carries a to-be-written strip, a version number of the to-be-written strip, an offset of the to-be-written strip, and an object ID of the to-be-written strip, the version number of the to-be-written strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-written strip belongs, the offset of the to-be-written strip describes a location of the to-be-written strip in an object to which the to-be-written strip belongs, and the object ID of the to-be-written strip is an ID of the object to which the to-be-written strip belongs;
- the storage medium stores a computer program;
- and
- by running the computer program, the processor is configured to:
- determine whether a strip determined by using the version number of the to-be-written strip, the object ID of the to-be-written strip, and the offset of the to-be-written strip is backed up;
- and
- if the strip is backed up, writing the to-be-written strip into a storage location determined by using the version number of the to-be-written strip, the object ID of the to-be-written strip, and the offset of the to-be-written strip;
- or
- if the strip is not backed up, backing up data that is in an object of a base version in the object storage device and whose offset is the offset of the to-be-written strip and size is a size of the to-be-written strip to the storage location determined by using the version number of the to-be-written strip, the offset of the to-be-written strip, and the object ID of the to-be-written strip, wherein an object ID of the object of the base version is the same as the object ID of the to-be-written strip, and a version number of the object of the base version is a base version number;
- and writing the to-be-written strip into a storage location determined by using the object ID of the to-be-written strip, the base version number, and the offset of the to-be-written strip.
An object storage device, comprising a processor, and a storage medium and an interface that are connected to the processor, wherein:
- the interface is configured to receive a strip write request sent by a client server, wherein the strip write request carries a to-be-written strip, a version number of the to-be-written strip, an offset of the to-be-written strip, and an object ID of the to-be-written strip, the version number of the to-be-written strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-written strip belongs, the offset of the to-be-written strip describes a location of the to-be-written strip in an object to which the to-be-written strip belongs, and the object ID of the to-be-written strip is an ID of the object to which the to-be-written strip belongs;
- the storage medium stores a computer program;
- and
- the processor executes the following steps by running the computer program:
- determining whether an object determined by using the version number of the to-be-written strip and the object ID is backed up;
- and
- if the object is backed up, writing, by the data storage device, the to-be-written strip into a storage location determined by using the object ID, a version number of the object, and the offset of the to-be-written strip;
- or
- if the object is not backed up, backing up, by the data storage device, data in an object of a base version to a storage location determined by using the version number of the to-be-written strip and the object ID, wherein an object ID of the object of the base version is the same as the object ID of the to-be-written strip, and a version number of the object of the base version is a base version number;
- and
- writing, by the data storage device, the to-be-written strip into a storage location determined by using the object ID, the base version number, and the offset of the to-be-written strip.
An object storage device, comprising a processor, and a storage medium and an interface that are connected to the processor, wherein:
- the interface is configured to receive a strip read request sent by a client server, wherein the strip read request carries a size of a to-be-read strip, an offset of the to-be-read strip, a version number of the to-be-read strip, and an object ID of the to-be-read strip, the version number of the to-be-read strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-read strip belongs, and the object ID of the to-be-read strip is an ID of an object to which the to-be-read strip belongs;
- the storage medium stores a computer program;
- and
- by running the computer program, the processor is configured to:
- determine whether a strip determined by using the object ID, the version number of the to-be-read strip, and the offset of the to-be-read strip is backed up;
- and
- if the strip is backed up, reading data determined by using the object ID, the version number of the to-be-read strip, the offset of the to-be-read strip, and the size of the to-be-read strip, using the read data as the to-be-read strip, and sending the to-be-read strip to the client server;
- or
- if the strip is not backed up, searching, one by one according to a descending order of snapshot times of objects, the objects whose object IDs are the same as the object ID of the to-be-read strip and version numbers are different from the version number of the to-be-read strip until an object that stores valid data in a storage location determined by using the offset of the to-be-read strip is found, using the found valid data as the to-be-read strip, and sending the to-be-read strip to the client server, wherein a version number of the object is corresponding to the snapshot ID that is of the latest snapshot of the file or the volume to which the to-be-read strip belongs and that exists before the object is generated.
An object storage device, comprising a processor, and a storage medium and an interface that are connected to the processor, wherein:
- the interface is configured to receive a strip read request sent by a client server, wherein the strip read request carries a size of a to-be-read strip, an offset of the to-be-read strip, a version number of the to-be-read strip, and an object ID of the to-be-read strip, the version number of the to-be-read strip is corresponding to a snapshot ID of a latest snapshot of a file or a volume to which the to-be-read strip belongs, and the object ID of the to-be-read strip is an ID of an object to which the to-be-read strip belongs;
- the storage medium stores a computer program;
- and
- the processor executes the following steps by running the computer program:
- determining whether an object determined by using the object ID and the version number of the to-be-read strip is backed up;
- and
- if the object is backed up, reading data determined by using the object ID, the version number of the to-be-read strip, the offset of the to-be-read strip, and the size of the to-be-read strip, using the read data as the to-be-read strip, and sending the to-be-read strip to the client server;
- or
- if the object is not backed up, searching, one by one according to a descending order of snapshot times of objects, the objects whose object IDs are the same as the object ID of the to-be-read strip and version numbers are different from the version number of the to-be-read strip until an object that stores valid data in a storage location determined by using the offset of the to-be-read strip is found, using the found valid data as the to-be-read strip, and sending the to-be-read strip to the client server, wherein a version number of the object is corresponding to the snapshot ID that is of the latest snapshot of the file or the volume to which the to-be-read strip belongs and that exists before the object is generated.
Dependencies are inferred from the claim text.