CN110989936A - Storage space allocation method and device and storage medium - Google Patents

Storage space allocation method and device and storage medium Download PDF

Info

Publication number
CN110989936A
CN110989936A CN201911243699.3A CN201911243699A CN110989936A CN 110989936 A CN110989936 A CN 110989936A CN 201911243699 A CN201911243699 A CN 201911243699A CN 110989936 A CN110989936 A CN 110989936A
Authority
CN
China
Prior art keywords
metadata
ssd
space
storage
service data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911243699.3A
Other languages
Chinese (zh)
Inventor
唐军辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201911243699.3A priority Critical patent/CN110989936A/en
Publication of CN110989936A publication Critical patent/CN110989936A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

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

Abstract

The embodiment of the invention discloses a space allocation method, a space allocation device and a storage medium, which are used for flexibly adjusting the space of an SSD and improving the read-write performance of metadata. The method provided by the embodiment of the invention comprises the following steps: receiving service data, wherein the service data comprises metadata and object data; judging whether the service data is the metadata or not; if yes, judging whether the SSD reaches a first storage threshold value; if yes, a first space is divided from the HDD, and the first space is added into the SSD.

Description

Storage space allocation method and device and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a storage space allocation method, an apparatus, and a storage medium.
Background
In the current distributed storage system, in consideration of access performance, metadata is generally stored on a Solid State Disk (SSD) (solid State driver) device, but in consideration of cost performance of the storage system, the SSD capacity ratio is generally low.
This will lead to the following problems:
1. in a scene of a large amount of small files, metadata has a high ratio in data, when the ratio exceeds the SSD capacity ratio of a storage system, the available capacity of an OSD object data storage space mechanical hard Disk (HDD) (hard Disk driver) device is still large, but the storage system cannot write new data because the SSD device is full of metadata.
2. In a distributed storage system, metadata is usually stored by a hierarchical database, and cold metadata which is not accessed for a long time at the bottom layer also resides in an SSD space, so that the SSD space is wasted.
Disclosure of Invention
The embodiment of the invention provides a storage space distribution method, a storage space distribution device and a storage medium, which are used for flexibly adjusting an SSD space and improving the read-write performance of metadata.
A first aspect of an embodiment of the present application provides a method for allocating a storage space, where the storage space includes a solid state disk SSD and a mechanical disk HDD, and the storage space is applied to an object storage service OSD, and the method includes:
receiving service data, wherein the service data comprises metadata and object data;
judging whether the service data is the metadata or not;
if yes, judging whether the SSD reaches a first storage threshold value;
if yes, a first space is divided from the HDD, and the first space is added into the SSD.
Preferably, after dividing the first space from the HDD and before adding the first space to the SSD, the method further includes:
judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
and if so, adding the first space into the SSD.
Preferably, the metadata includes first metadata, and the first metadata is metadata from the OSD;
if the metadata is the first metadata, the method further comprises:
writing the first metadata to the SSD.
Preferably, the metadata further includes second metadata, and the second metadata is metadata generated by merging the metadata in the SSD;
if the metadata is the second metadata, the method further comprises:
judging whether the second metadata is bottom-layer data or not;
if yes, if a first space is divided from the HDD, writing the second metadata into the first space;
and if not, writing the second metadata into the SSD.
Preferably, the method further comprises:
and if the service data is the object data, writing the object data into the HDD.
Preferably, the method further comprises:
and if the SSD does not reach the first storage threshold, writing the metadata into the SSD.
A second aspect of the embodiments of the present application provides a storage space allocation apparatus, where the storage space includes a solid state disk SSD and a mechanical disk HDD, and the storage space is applied to an object storage service OSD, and the apparatus includes:
the receiving unit is used for receiving service data, and the service data comprises metadata and object data;
a judging unit, configured to judge whether the service data is the metadata;
the judging unit is further configured to judge whether the SSD reaches a first storage threshold if the service data is the metadata;
and the space dividing unit is used for dividing a first space from the HDD and adding the first space into the SSD if the SSD reaches a first storage threshold value.
Preferably, the judging unit is further configured to:
after a first space is divided from the HDD and before the first space is added into the SSD, judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
the space dividing unit is further configured to:
and if the SSD reaches a second storage threshold, adding the first space to the SSD.
Preferably, the metadata includes first metadata, and the first metadata is metadata from the OSD;
the device further comprises:
a first writing unit, configured to write the first metadata into the SSD if the metadata is the first metadata.
Preferably, the metadata further includes second metadata, and the second metadata is metadata generated by merging the metadata in the SSD;
the judging unit is further configured to judge whether the second metadata is bottom-layer data if the metadata is the second metadata;
the first writing unit is further configured to write the second metadata into a first space partitioned from the HDD if the second metadata is bottom layer data;
the first writing unit is further configured to write the second metadata into the SSD if the second metadata is not bottom-layer data.
Preferably, the apparatus further comprises:
and a second writing unit, configured to write the object data into the HDD if the service data is the object data.
Preferably, the apparatus further comprises:
and a third writing unit, configured to write the metadata into the SSD if the SSD does not reach the first storage threshold.
A third aspect of the embodiments of the present application provides a computer apparatus, including a processor, where the processor is configured to implement the storage space allocation method provided in the first aspect of the embodiments of the present application when executing a computer program stored in a memory.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is used, when being executed by a processor, to implement the storage space allocation method provided in the first aspect of the embodiments of the present application.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the application, service data is received, the service data comprises metadata and object data, whether the service data is the metadata or not is judged, if the service data is the metadata, judgment is carried out on the storage capacity of the SSD, and if the storage capacity of the SSD reaches a first storage threshold value, a first space is divided from the HDD and added into the SSD, so that flexible adjustment of the SSD space is achieved, and the read-write performance of the metadata is improved.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a storage space allocation method in an embodiment of the present application;
FIG. 2 is a schematic diagram of another embodiment of a storage space allocation method in an embodiment of the present application;
FIG. 3 is a schematic diagram of another embodiment of a storage space allocation method in an embodiment of the present application;
FIG. 4 is a schematic diagram of a hierarchical storage of metadata in an SSD in an embodiment of the present application;
FIG. 5 is a schematic diagram of another embodiment of a storage space allocation method in an embodiment of the present application;
fig. 6 is a schematic diagram of an embodiment of a storage space allocation apparatus in an embodiment of the present application.
Detailed Description
The embodiment of the invention provides a storage space distribution method, a storage space distribution device and a storage medium, which are used for flexibly adjusting an SSD space and improving the read-write performance of metadata.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to solve the problem that in the prior art, when an object storage service stores metadata in service data, a Solid State Disk (SSD) (solid State driver) has a limited storage space, so that the SSD is full of the metadata, and a storage system cannot work, the application provides a storage space allocation method, an apparatus, and a storage medium, which are used for flexibly adjusting the space of the SSD to improve the read-write performance of the metadata.
For convenience of description, the terms used in the present application are explained first and are used in the following portions without further description.
Ssd (solid State drive): solid state drives are also called solid state drives.
HDD (hard Disk drive): hard disk drives, also called mechanical disks.
OSD (object storage Daemon): an object storage service. In the distributed storage, when service data is written, each OSD generates metadata and object data, in order to improve access performance, an SSD device is generally used to store the metadata of the OSD, an HDD device is used to store the object data of the OSD, and each SSD device is allocated to a plurality of OSDs in a partition manner to store the metadata.
Next, a method for allocating a storage space in the present application is described, referring to fig. 1, where an embodiment of the method for allocating a storage space in the present application includes:
101. receiving service data, wherein the service data comprises metadata and object data;
when the storage space allocation method is applied to an object storage service osd (object storage daemon) in a distributed storage system, the storage space is divided into a solid State Disk (ssd) and a mechanical Disk (hard Disk drive).
The OSD is configured to receive service data and perform read-write operation on the service data, where the service data is data that is input from outside and needs to perform read-write operation, and the general service data includes metadata and object data, specifically, the metadata in the service data includes a storage location, a data size, a data authority, creation time of the data, and the like of the data, and the object data in the service data is data content itself, and when the service data is a word document, the metadata in the service data refers to the storage location, the data size, the data authority, the data creation time, and the like of the word document, and the object data in the service data is content of the word document itself.
When the OSD performs write operation on the service data, the metadata in the service data is preferentially written into the SSD, and the object data in the service data is written into the HDD, so that the read-write performance of the metadata is ensured. The SSD capacity in the storage space is generally configured to be low in consideration of the cost/performance ratio of the storage system, and when the SSD capacity is exhausted, the storage system may be rendered inoperable.
To solve this problem, the storage space allocation apparatus in the present application executes step 102 when receiving the service data.
102. Judging whether the service data is the metadata, if so, executing step 103, otherwise, executing step 105;
when the storage space allocation apparatus receives the service data, it is further determined whether the service data is metadata, if yes, step 103 is executed, and if no, step 105 is executed.
103. Judging whether the SSD reaches a first storage threshold value, if so, executing step 104, and if not, executing step 105;
if the service data is metadata, because the metadata is generally stored in the SSD, in order to prevent the storage space of the SSD from being insufficient, the storage space allocating device may determine in advance whether the SSD reaches the first storage threshold before storing the metadata, if yes, perform step 104, and if not, perform step 105.
104. Dividing a first space from the HDD and adding the first space to the SSD;
when the storage capacity of the SSD reaches a first threshold value, a first space is divided from the HDD, and the first space is added into the SSD, so that the space of the SSD can be flexibly adjusted, and the reading and writing performance of the metadata can be improved.
105. Other processes are performed.
If the storage capacity of the SSD does not reach the first threshold or the service data is the object data, executing another process, which is not limited herein.
In the embodiment of the application, service data is received, the service data comprises metadata and object data, whether the service data is the metadata or not is judged, if the service data is the metadata, judgment is carried out on the storage capacity of the SSD, and if the storage capacity of the SSD reaches a first storage threshold value, a first space is divided from the HDD and added into the SSD, so that flexible adjustment of the SSD space is achieved, and the read-write performance of the metadata is improved.
Based on the embodiment shown in fig. 1, when the storage capacity of the SSD reaches the first storage threshold, the instruction to partition the first space from the HDD and add the first space to the SSD is executed, so that the problem that the storage space of the HDD is exhausted and the first space cannot be partitioned may occur, based on the problem, 2 storage thresholds may be set for the SSD, and after the first space is partitioned from the HDD, before the first space is added to the SSD, the following steps are executed, please refer to fig. 2, where another embodiment of the method for allocating the storage space in the embodiment of the present application includes:
201. judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value, if so, executing step 202, and if not, executing step 203;
in order to prevent the problem that the storage space in the HDD is exhausted and the first space cannot be partitioned for the SSD to use, the present application may set 2 storage thresholds for the SSD, where the first storage threshold is smaller than the second storage threshold, when the storage space of the SSD reaches the first threshold, the first space is partitioned from the HDD in advance for standby, and then when the storage space of the SSD reaches the second threshold, step 202 is executed.
202. Adding the first space to the SSD;
when the storage space of the SSD reaches a second storage threshold, the first space is added to the SSD.
203. Other processes are performed.
If the storage space of the SSD does not reach the second storage threshold, other processes are executed, which is not limited in this respect.
In the embodiment of the application, 2 storage threshold values are set for the SSD, when the SSD reaches a first storage threshold value, a first space is divided from the HDD in advance for standby, and when the SSD reaches a second storage threshold value, the first space is added into the SSD, wherein the first storage threshold value is smaller than the second storage threshold value, so that the problem that the storage space of the HDD is exhausted in advance and the first space cannot be divided is solved, and the space of the SSD is flexibly adjusted.
Based on the embodiment described in fig. 2, the service data includes metadata and object data, where the metadata includes first metadata and second metadata, and the following steps may also be performed on the metadata and refer to fig. 3, another embodiment of the storage space allocation method in the embodiment of the present application includes:
301. if the service data is metadata and the metadata is first metadata, writing the first metadata into the SSD, wherein the first metadata is the metadata from the OSD;
and if the service data received by the storage space allocation device is the first metadata in the metadata, writing the first metadata into the SSD, wherein the first metadata is the metadata from the OSD.
It should be noted that, in the embodiment of the present application, the metadata of the service data includes first metadata and second metadata, where the first metadata is service data from outside and metadata that requires OSD to perform read-write operation, and the second metadata is metadata that is stored inside the SSD and is generated due to merging, where the merging is to eliminate duplicate data inside the SSD, so as to achieve the purpose of eliminating redundancy.
If the metadata is the first metadata, the first metadata is written into the SSD, so that the purpose of writing the latest metadata into the SSD is achieved, and the read-write performance of the latest metadata is improved.
302. If the metadata is second metadata, judging whether the second metadata is bottom layer data, wherein the second metadata is metadata generated by merging the metadata in the SSD, if so, executing a step 303, and if not, executing a step 304;
if the metadata in the service data is the second metadata, determining whether the second metadata is the bottom metadata, if so, executing step 303, and if not, executing step 304.
The second metadata is metadata generated by merging the metadata in the SSD, and for convenience of understanding, fig. 4 shows a schematic diagram of the hierarchical storage of the metadata in the SSD.
When the metadata is stored in the SSD, the metadata is stored in the database, and the database stores the metadata according to the hierarchy, so that whether the second metadata is the bottom layer data can be directly determined by the hierarchy, wherein the bottom layer data is generally cold data with less reading and writing.
303. If a first space is divided from the HDD, writing second metadata into the first space;
and if the second metadata is the bottom layer cold data and the first space is divided from the HDD, writing the second metadata into the first space, thereby realizing sinking of the bottom layer cold data and acquiring more storage space for other metadata.
304. Writing second metadata to the SSD;
when the second metadata is not the bottom-layer data, the second metadata is written into the SSD, so that the purpose of writing the latest metadata into the SSD is achieved, and the read-write performance of the latest metadata is improved.
305. And if the service data is the object data, writing the object data into the HDD.
When the storage space allocation device processes the object data in the service data, the object data is directly written into the HDD to realize the storage of the object data.
In the embodiment of the application, the storage processes of the metadata and the object data in the service data and the first metadata and the second metadata in the metadata are described in detail, so that the purpose of writing the latest metadata into the SSD is achieved, and the read-write performance of the latest metadata is further improved.
Based on the embodiment described in fig. 1, if the service data is metadata and the SSD does not reach the first storage threshold, the following steps are performed, please refer to fig. 5, another embodiment of the storage space allocation method in the embodiment of the present application includes:
501. and if the service data is metadata and the SSD does not reach the first storage threshold value, writing the metadata into the SSD.
And if the service data is metadata and the SSD does not reach the first storage threshold, writing the metadata into the SSD to realize the storage of the metadata.
In the embodiment of the application, the storage process of the metadata in the service data is described in detail when the SSD does not reach the first storage threshold, so that the implementability of the embodiment of the application is improved.
With reference to fig. 6, the storage space allocation apparatus in the embodiment of the present application is described below, and an embodiment of the storage space allocation apparatus in the embodiment of the present application includes:
a receiving unit 603, configured to receive service data, where the service data includes metadata and object data;
a determining unit 601, configured to: judging whether the service data is the metadata or not;
the determining unit 601 is further configured to determine whether the SSD reaches a first storage threshold if the service data is metadata;
a space dividing unit 602, configured to divide a first space from the HDD and add the first space to the SSD if the SSD reaches a first storage threshold.
Preferably, the determining unit 601 is further configured to:
after a first space is divided from the HDD and before the first space is added into the SSD, judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
the space dividing unit 602 is further configured to:
adding the first space to the SSD when the SSD reaches a second storage threshold.
Preferably, the metadata includes first metadata, and the first metadata is metadata from the OSD;
the device further comprises:
a first writing unit 604, configured to write the first metadata into the SSD if the metadata is the first metadata.
Preferably, the metadata further includes second metadata, and the second metadata is metadata generated by merging the metadata in the SSD;
the determining unit 601 is further configured to determine whether the second metadata is bottom layer data;
the first writing unit 604 is further configured to write the second metadata into a first space partitioned from the HDD if the second metadata is bottom layer data;
the first writing unit 604 is further configured to write the second metadata into the SSD when the second metadata is not bottom-layer data.
Preferably, the service data further includes object data;
the device further comprises:
a second writing unit 605, configured to write the object data into the HDD if the service data is the object data.
Preferably, the apparatus further comprises:
a third writing unit 606, configured to write the metadata into the SSD if the SSD does not reach the first storage threshold.
It should be noted that the functions of the above units are similar to those described in fig. 1 to 5, and are not described again here.
In the embodiment of the present application, the receiving unit 603 receives the service data, the determining unit 601 determines whether the service data is metadata, and determines the storage capacity of the SSD when the service data is metadata, and when the storage capacity of the SSD reaches a first storage threshold, the space dividing unit 602 divides the first space from the HDD and adds the first space to the SSD, so as to flexibly adjust the space of the SSD and improve the read-write performance of the metadata.
The above describes the memory space allocation apparatus in the embodiment of the present invention from the perspective of the modular functional entity, and the following describes the computer apparatus in the embodiment of the present invention from the perspective of hardware processing:
the computer device is used for realizing the functions of the storage space distribution device, and one embodiment of the computer device in the embodiment of the invention comprises the following components:
a processor and a memory;
the memory is used for storing the computer program, and the processor is used for realizing the following steps when executing the computer program stored in the memory:
receiving service data, wherein the service data comprises metadata and object data;
judging whether the service data is the metadata or not;
if yes, judging whether the SSD reaches a first storage threshold value;
if yes, a first space is divided from the HDD, and the first space is added into the SSD.
In some embodiments of the present invention, after the first space is partitioned from the HDD and before the first space is added to the SSD, the processor may be further configured to implement the following steps:
judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
and if so, adding the first space into the SSD.
In some embodiments of the present invention, the processor may be further configured to:
and if the metadata is the first metadata, writing the first metadata into the SSD.
In some embodiments of the present invention, the processor may be further configured to:
if the metadata is the second metadata, judging whether the second metadata is bottom layer data;
if yes, if a first space is divided from the HDD, writing the second metadata into the first space;
and if not, writing the second metadata into the SSD.
In some embodiments of the present invention, the processor may be further configured to:
and if the service data is the object data, writing the object data into the HDD.
In some embodiments of the present invention, the processor may be further configured to:
and if the SSD does not reach the first storage threshold, writing the metadata into the SSD.
It is to be understood that, when the processor in the computer apparatus described above executes the computer program, the functions of each unit in the corresponding apparatus embodiments may also be implemented, and are not described herein again. Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the storage space allocation arrangement. For example, the computer program may be divided into units in the above-described storage space allocation arrangement, each unit may implement a specific function as described above for the respective storage space allocation arrangement.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing equipment. The computer device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the processor, memory are merely examples of a computer apparatus and are not meant to be limiting, and that more or fewer components may be included, or certain components may be combined, or different components may be included, for example, the computer apparatus may also include input output devices, network access devices, buses, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer device and which connects the various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the terminal, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The present invention also provides a computer-readable storage medium for implementing the functions of the storage space allocation apparatus, having a computer program stored thereon, which, when executed by a processor, the processor is operable to perform the steps of:
receiving service data, wherein the service data comprises metadata and object data;
judging whether the service data is the metadata or not;
if yes, judging whether the SSD reaches a first storage threshold value;
if yes, a first space is divided from the HDD, and the first space is added into the SSD.
In some embodiments of the invention, the computer program stored on the computer-readable storage medium, when executed by the processor, may be specifically configured to perform the steps of:
after a first space is divided from the HDD and before the first space is added into the SSD, judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
and if so, adding the first space into the SSD.
In some embodiments of the invention, the computer program stored on the computer-readable storage medium, when executed by the processor, may be specifically configured to perform the steps of:
and if the metadata is the first metadata, writing the first metadata into the SSD.
In some embodiments of the invention, the computer program stored on the computer-readable storage medium, when executed by the processor, may be specifically configured to perform the steps of:
if the metadata is the second metadata, judging whether the second metadata is bottom layer data;
if yes, if a first space is divided from the HDD, writing the second metadata into the first space;
and if not, writing the second metadata into the SSD.
In some embodiments of the invention, the computer program stored on the computer-readable storage medium, when executed by the processor, may be specifically configured to perform the steps of:
and if the service data is the object data, writing the object data into the HDD.
In some embodiments of the invention, the computer program stored on the computer-readable storage medium, when executed by the processor, may be specifically configured to perform the steps of:
and if the SSD does not reach the first storage threshold, writing the metadata into the SSD.
It will be appreciated that the integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a corresponding one of the computer readable storage media. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium and used by a processor to implement the steps of the above embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A storage space allocation method is characterized in that the storage space comprises a Solid State Disk (SSD) and a mechanical disk (HDD), and the storage space is applied to an object storage service (OSD), and the method comprises the following steps:
receiving service data, wherein the service data comprises metadata and object data;
judging whether the service data is the metadata or not;
if yes, judging whether the SSD reaches a first storage threshold value;
if yes, a first space is divided from the HDD, and the first space is added into the SSD.
2. The method of claim 1, wherein after partitioning a first space from the HDD, before adding the first space to the SSD, the method further comprises:
judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
and if so, adding the first space into the SSD.
3. The method of claim 1 or 2, wherein the metadata comprises first metadata, and the first metadata is metadata from the OSD;
if the metadata is the first metadata, the method further comprises:
writing the first metadata to the SSD.
4. The method of claim 3, wherein the metadata further comprises second metadata, the second metadata being metadata generated by merging the SSD internal metadata;
if the metadata is the second metadata, the method further comprises:
judging whether the second metadata is bottom-layer data or not;
if yes, writing the second metadata into a first space when the first space is divided from the HDD;
and if not, writing the second metadata into the SSD.
5. The method of claim 1, further comprising:
and if the service data is the object data, writing the object data into the HDD.
6. The method of claim 3, further comprising:
and if the SSD does not reach the first storage threshold, writing the metadata into the SSD.
7. A storage space allocation device, wherein the storage space comprises a Solid State Disk (SSD) and a mechanical disk (HDD), and the storage space is applied to an object storage service (OSD), the device comprises:
the receiving unit is used for receiving service data, and the service data comprises metadata and object data;
a judging unit, configured to judge whether the service data is the metadata;
the judging unit is further configured to judge whether the SSD reaches a first storage threshold if the service data is the metadata;
and the space dividing unit is used for dividing a first space from the HDD and adding the first space into the SSD if the SSD reaches a first storage threshold value.
8. The apparatus of claim 7,
the judging unit is further configured to:
after a first space is divided from the HDD and before the first space is added into the SSD, judging whether the SSD reaches a second storage threshold value, wherein the second storage threshold value is larger than the first storage threshold value;
the space dividing unit is further configured to:
and if the SSD reaches the second storage threshold, adding the first space to the SSD.
9. The apparatus of claim 7 or 8, wherein the metadata comprises first metadata, and the first metadata is metadata from the OSD;
the device further comprises:
a first writing unit, configured to write the first metadata into the SSD if the metadata is the first metadata.
10. A computer arrangement comprising a processor, characterized in that the processor, when executing a computer program stored on a memory, is adapted to carry out the memory space allocation method according to any one of claims 1 to 6.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, is adapted to carry out the storage space allocation method according to any one of claims 1 to 6.
CN201911243699.3A 2019-12-06 2019-12-06 Storage space allocation method and device and storage medium Pending CN110989936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911243699.3A CN110989936A (en) 2019-12-06 2019-12-06 Storage space allocation method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911243699.3A CN110989936A (en) 2019-12-06 2019-12-06 Storage space allocation method and device and storage medium

Publications (1)

Publication Number Publication Date
CN110989936A true CN110989936A (en) 2020-04-10

Family

ID=70090941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911243699.3A Pending CN110989936A (en) 2019-12-06 2019-12-06 Storage space allocation method and device and storage medium

Country Status (1)

Country Link
CN (1) CN110989936A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590029A (en) * 2021-06-30 2021-11-02 济南浪潮数据技术有限公司 Disk space allocation method, system, storage medium and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120137054A1 (en) * 2010-11-24 2012-05-31 Stec, Inc. Methods and systems for object level de-duplication for solid state devices
CN103309815A (en) * 2013-05-23 2013-09-18 华中科技大学 Method and system for increasing available capacity and service life of solid state disc
CN103558991A (en) * 2011-12-31 2014-02-05 华为数字技术(成都)有限公司 Method, device and storage equipment for hierarchically storing data
CN106919342A (en) * 2015-12-28 2017-07-04 成都华为技术有限公司 Storage resource distribution method and device based on automatic simplify configuration
CN110147204A (en) * 2019-05-22 2019-08-20 苏州浪潮智能科技有限公司 A kind of metadata rule method, apparatus, system and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120137054A1 (en) * 2010-11-24 2012-05-31 Stec, Inc. Methods and systems for object level de-duplication for solid state devices
CN103558991A (en) * 2011-12-31 2014-02-05 华为数字技术(成都)有限公司 Method, device and storage equipment for hierarchically storing data
CN103309815A (en) * 2013-05-23 2013-09-18 华中科技大学 Method and system for increasing available capacity and service life of solid state disc
CN106919342A (en) * 2015-12-28 2017-07-04 成都华为技术有限公司 Storage resource distribution method and device based on automatic simplify configuration
CN110147204A (en) * 2019-05-22 2019-08-20 苏州浪潮智能科技有限公司 A kind of metadata rule method, apparatus, system and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590029A (en) * 2021-06-30 2021-11-02 济南浪潮数据技术有限公司 Disk space allocation method, system, storage medium and equipment
CN113590029B (en) * 2021-06-30 2023-12-22 济南浪潮数据技术有限公司 Disk space allocation method, system, storage medium and equipment

Similar Documents

Publication Publication Date Title
US10977124B2 (en) Distributed storage system, data storage method, and software program
US10146651B2 (en) Member replacement in an array of information storage devices
EP3617867A1 (en) Fragment management method and fragment management apparatus
JP2013509658A (en) Allocation of storage memory based on future usage estimates
CN104158858A (en) Method and system for accessing distributed cluster file system
US20210357258A1 (en) Method, device and medium for allocating resource based on type of pci device
CN103229150B (en) data control method and system
CN112748849A (en) Method, apparatus and computer program product for storing data
US9317306B2 (en) Computer device and memory management method thereof
CN110989936A (en) Storage space allocation method and device and storage medium
CN111124253B (en) Method, apparatus and computer program product for managing storage devices
CN112748862A (en) Method, electronic device and computer program product for managing disc
CN110941436A (en) Data storage method and device of application program, storage medium and terminal equipment
CN110609660A (en) Host end mapping method and device of SSD array, computer equipment and storage medium
CN109725844B (en) Disk allocation method, device and storage system
CN110262758B (en) Data storage management method, system and related equipment
CN112988696B (en) File sorting method and device and related equipment
CN115543859A (en) Wear leveling optimization method, device, equipment and medium for multi-partition SSD
CN111026720B (en) File processing method, system and related equipment
CN110727400A (en) Flow control method, apparatus, device and medium for distributed storage system
US11016685B2 (en) Method and defragmentation module for defragmenting resources
CN111597127A (en) Hybrid SLC caching method and device, computer equipment and storage medium
CN111190550B (en) Metadata acceleration method and device and storage equipment
CN114371815B (en) Data storage method, device and system
CN115878508A (en) Data caching method and device, merged storage equipment and data caching system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination